Skip to content

Commit edadceb

Browse files
authored
Merge pull request #521 from Bl3nd/go-to-enhancement
A small update to parsing
2 parents 3f1fd5a + 9860c9d commit edadceb

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

src/main/java/the/bytecode/club/bytecodeviewer/gui/util/BytecodeViewPanelUpdater.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ private void markOccurrences(RSyntaxTextArea textArea, ClassFileContainer classF
513513
if (token == null)
514514
{
515515
highlighterEx.clearMarkOccurrencesHighlights();
516+
errorStripe.refreshMarkers();
516517
return;
517518
}
518519
}

src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/ClassFileContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public boolean parse()
5656
{
5757
if (shouldParse())
5858
{
59-
TypeSolver typeSolver = new CombinedTypeSolver(new ReflectionTypeSolver(false), new JarTypeSolver(path));
59+
TypeSolver typeSolver = new CombinedTypeSolver(new ReflectionTypeSolver(true), new JarTypeSolver(path));
6060
JavaParser parser = new JavaParser();
6161
parser.getParserConfiguration().setSymbolResolver(new JavaSymbolSolver(typeSolver));
6262
ParseResult<CompilationUnit> parse = parser.parse(this.content);

src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/parser/visitors/MyVoidVisitor.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ public void visit(ClassOrInterfaceType n, Object arg)
347347
new ClassReferenceLocation(getOwner(classFileContainer),
348348
packagePath, "", "reference", classValue.line, classValue.columnStart, classValue.columnEnd + 1));
349349
}
350-
catch (ClassCastException | UnsupportedOperationException | IllegalArgumentException e)
350+
catch (Exception e)
351351
{
352352
printException(n, e);
353353
}
@@ -401,7 +401,7 @@ public void visit(ConstructorDeclaration n, Object arg)
401401
if (node instanceof ObjectCreationExpr)
402402
{
403403
NodeList<BodyDeclaration<?>> bodyDeclarations =
404-
((ObjectCreationExpr) node).getAnonymousClassBody().orElse(null);
404+
((ObjectCreationExpr) node).getAnonymousClassBody().orElse(null);
405405
if (bodyDeclarations != null)
406406
{
407407
if (Objects.requireNonNull(bodyDeclarations.getFirst().orElse(null)).equals(n))
@@ -421,10 +421,10 @@ public void visit(ConstructorDeclaration n, Object arg)
421421

422422
Value constructor = new Value(n.getName(), range);
423423
this.classFileContainer.putMethod(constructor.name, new ClassMethodLocation(resolve.getClassName(),
424-
signature, parameters, "declaration", constructor.line, constructor.columnStart,
425-
constructor.columnEnd + 1));
424+
signature, parameters, "declaration", constructor.line, constructor.columnStart,
425+
constructor.columnEnd + 1));
426426
}
427-
catch (RuntimeException e)
427+
catch (Exception e)
428428
{
429429
printException(n, e);
430430
}
@@ -566,7 +566,7 @@ public void visit(FieldDeclaration n, Object arg)
566566
Value field = new Value(variableDeclarator.getName(), range);
567567

568568
this.classFileContainer.putField(field.name, new ClassFieldLocation(getOwner(classFileContainer),
569-
"declaration", field.line, field.columnStart, field.columnEnd + 1));
569+
"declaration", field.line, field.columnStart, field.columnEnd + 1));
570570
});
571571
}
572572

@@ -828,8 +828,8 @@ public void visit(MethodCallExpr n, Object arg)
828828

829829
Value methodCall = new Value(n.getName(), methodRange);
830830
this.classFileContainer.putMethod(methodCall.name,
831-
new ClassMethodLocation(resolve.getClassName(), signature, parameters, "reference", methodCall.line,
832-
methodCall.columnStart, methodCall.columnEnd + 1));
831+
new ClassMethodLocation(resolve.getClassName(), signature, parameters, "reference", methodCall.line,
832+
methodCall.columnStart, methodCall.columnEnd + 1));
833833

834834
if (method != null)
835835
{
@@ -875,7 +875,7 @@ public void visit(MethodDeclaration n, Object arg)
875875

876876
Value method = new Value(n.getName(), methodRange);
877877
this.classFileContainer.putMethod(method.name, new ClassMethodLocation(resolve.getClassName(), signature,
878-
parameters, "declaration", method.line, method.columnStart, method.columnEnd + 1));
878+
parameters, "declaration", method.line, method.columnStart, method.columnEnd + 1));
879879
}
880880
catch (Exception e)
881881
{

0 commit comments

Comments
 (0)