Details
-
New Feature
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
jtsk_2.1
-
None
-
6353693
Description
Bugtraq ID 6353693
When using ClassDep there are various conditions that result in a diagnostic message being printed that indicates some problem. But there is no API to find out programatically if any such problems occurred.
SuggestedFix
— C:\Documents and Settings\marbro\Local Settings\Temp\t3596t46.tmp Sun Nov 20 11:27:33 2005 UTC
+++ D:\workspace\party\jini\src\com\sun\jini\tool\ClassDep.java Sat Nov 19 17:15:14 2005 UTC
@@ -15,6 +15,10 @@
- limitations under the License.
*
*/
+
+/*
+ * NOTE: this file has been modified by the Cheiron Project.
+ */
package com.sun.jini.tool;
import sun.tools.java.BinaryClass;
@@ -507,6 +511,12 @@
private final ArrayList results = new ArrayList();
/**
+ * Indicates whether a failure has been encountered during deep dependency
+ * checking.
+ */
+ private boolean failed;
+
+ /**
- No argument constructor. The user must fill in the
- appropriate fields prior to asking for the processing
- of dependencies.
@@ -855,12 +865,15 @@
cdef = (BinaryClass)env.getClassDefinition(id);
cdef.loadNested(env);
} catch (ClassNotFound e) { + failed = true; print("classdep.notfound", id); return; }catch (IllegalArgumentException e)
{ + failed = true; print("classdep.illegal", id, e.getMessage()); return; }catch (Exception e) {
+ failed = true;
print("classdep.failed", id);
e.printStackTrace();
return;
@@ -921,8 +934,15 @@ - Method that takes the user provided switches that
- logically define the domain in which to look for
- dependencies.
+ * <p>
+ * Whether a failure has occurred during computing the dependent classes
+ * can be found out with a call to {@link #hasFailed()}.
{ + failed = false; /* sort ins and outs, longest first */ Comparator c = new Compare(); Collections.sort(inside, c); @@ -1115,6 +1135,17 @@ }
+ *
+ * @return array containing the dependent classes found in the format as
+ * specified by the options passed in
*/
public String[] compute()
/**
+ * Indicates whether computing the dependent classes as result of the last
+ * call to
resulted in one or more failures.
+ *
+ * @return <code>true</code> in case a failure has happened, such as a
+ * class not being found, <code>false</code> otherwise
+ */
+ public boolean hasFailed()
+
+ /**
- Convenience method for initializing an instance with specific
- command line arguments. See the description of this class
- for a list and description of the acceptable arguments.
Entry 1 bob.scheifler [2005-11-21 16:25]