PageRenderTime 39ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/typing/TypeConversionException.java

#
Java | 51 lines | 24 code | 6 blank | 21 comment | 2 complexity | bc2d29ee67d9edcdf508c338bb83d76b MD5 | raw file
Possible License(s): LGPL-2.1
  1. /*
  2. * This program is free software; you can redistribute it and/or modify it under the
  3. * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
  4. * Foundation.
  5. *
  6. * You should have received a copy of the GNU Lesser General Public License along with this
  7. * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
  8. * or from the Free Software Foundation, Inc.,
  9. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  10. *
  11. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  12. * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU Lesser General Public License for more details.
  14. *
  15. * Copyright (c) 2006 - 2009 Pentaho Corporation and Contributors. All rights reserved.
  16. */
  17. package org.pentaho.reporting.libraries.formula.typing;
  18. import org.pentaho.reporting.libraries.formula.EvaluationException;
  19. import org.pentaho.reporting.libraries.formula.LibFormulaErrorValue;
  20. /**
  21. * Creation-Date: 10.04.2007, 14:13:40
  22. *
  23. * @author Thomas Morgner
  24. */
  25. public class TypeConversionException extends EvaluationException
  26. {
  27. private static final long serialVersionUID = -12507914833915502L;
  28. private static ThreadLocal localInstance = new ThreadLocal();
  29. protected TypeConversionException()
  30. {
  31. super(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
  32. }
  33. public static TypeConversionException getInstance()
  34. {
  35. final TypeConversionException o = (TypeConversionException) localInstance.get();
  36. if (o == null)
  37. {
  38. final TypeConversionException retval = new TypeConversionException();
  39. localInstance.set(retval);
  40. return retval;
  41. }
  42. o.fillInStackTrace();
  43. return o;
  44. }
  45. }