You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug in getPackage () method of the class ClassNode. In creating the PackageNode when the name attribute of ClassNode does not contain the point that separates the name of the class and its package (line 525).
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at org.designwizard.design.ClassNode.getPackage(ClassNode.java:525)
at org.designwizard.design.ClassNode.getCalleePackages(ClassNode.java:842)
at BugDW1.main(BugDW1.java:27)
The error occurs when calling for getCalleePackages() for the org.apache.lucene.index.Payload.clone class. The clone method there is a class called [B (Bracket B) that calls [B.clone(). The B class name does not have point, ie, no package.
I made a workaround in fork project, which generated changes in getCalleeClasses() method of the class MethodNode (line 468) and in getPackage () method of the class ClassNode (line 525).
Follow my test class that generates the error:
public class BugDW1 {
public static void main(String[] args) {
try {
DesignWizard dw = new DesignWizard(
"./libs/lucene_week_001_rev_978784_date_2010-06-20.jar");
// Pode ser feito com classes e métodos?
Set<ClassNode> classes = dw.getAllClasses();
for (ClassNode entityNode : classes) {
PackageNode pacote = entityNode.getPackage();
// Pacotes acessados pela classe
Set<PackageNode> callees = entityNode.getCalleePackages();
// Pacotes que chama essa classe
Set<PackageNode> callers = entityNode.getCallerPackages();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
The text was updated successfully, but these errors were encountered:
Bug in getPackage () method of the class ClassNode. In creating the PackageNode when the name attribute of ClassNode does not contain the point that separates the name of the class and its package (line 525).
When I used a file https://code.google.com/p/on-the-nature-dataset/ in my experiment the getPackage () method throws an exception of the String class:
The error occurs when calling for getCalleePackages() for the org.apache.lucene.index.Payload.clone class. The clone method there is a class called [B (Bracket B) that calls [B.clone(). The B class name does not have point, ie, no package.
I made a workaround in fork project, which generated changes in getCalleeClasses() method of the class MethodNode (line 468) and in getPackage () method of the class ClassNode (line 525).
Follow my test class that generates the error:
The text was updated successfully, but these errors were encountered: