01: /*
02: * FindBugs - Find Bugs in Java programs
03: * Copyright (C) 2005, University of Maryland
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18: */
19:
20: package edu.umd.cs.findbugs.ba;
21:
22: /**
23: * DataflowAnalysisException variant to report a class lookup failure
24: * that caused dataflow analysis to abort.
25: *
26: * @author David Hovemeyer
27: */
28: public class MissingClassException extends DataflowAnalysisException {
29: private static final long serialVersionUID = 1L;
30:
31: private String className;
32:
33: private MissingClassException(String className) {
34: super ("Missing class"
35: + (className != null ? ": " + className : ""));
36: this .className = className;
37: }
38:
39: /**
40: * Constructor.
41: *
42: * @param exception the ClassNotFoundException that caused this exception
43: */
44: public MissingClassException(ClassNotFoundException exception) {
45: this (ClassNotFoundExceptionParser
46: .getMissingClassName(exception));
47: initCause(exception);
48: }
49:
50: /**
51: * Get the name of the missing class.
52: *
53: * @return name of the missing class, or null if the missing class name is unknown
54: */
55: public String getClassName() {
56: return className;
57: }
58:
59: /**
60: * Get the ClassNotFoundException that caused this exception.
61: *
62: * @return the ClassNotFoundException that caused this exception
63: */
64: public ClassNotFoundException getClassNotFoundException() {
65: return (ClassNotFoundException) getCause();
66: }
67: }
|