Skip to content

Commit

Permalink
DELETE ME - only for local testing
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker committed Mar 8, 2024
1 parent 7370b62 commit 999ab3e
Show file tree
Hide file tree
Showing 2 changed files with 186 additions and 181 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,30 @@ public CompilationUnit toCompilationUnit(org.eclipse.jdt.internal.compiler.env.I
NodeSearcher nodeSearcher, int apiLevel, Map<String, String> compilerOptions,
WorkingCopyOwner workingCopyOwner, WorkingCopyOwner typeRootWorkingCopyOwner, int flags, IProgressMonitor monitor) {
// TODO currently only parse
CompilationUnit res2 = CompilationUnitResolver.FACADE.toCompilationUnit(sourceUnit, initialNeedsToResolveBinding, project, classpaths, nodeSearcher, apiLevel, compilerOptions, typeRootWorkingCopyOwner, typeRootWorkingCopyOwner, flags, monitor);

CompilationUnit res = parse(sourceUnit, apiLevel, compilerOptions, flags, project, monitor);
if (initialNeedsToResolveBinding) {
if( res.getPackage() != null ) {
res.getPackage().resolveBinding();
}
}
// For comparison
// CompilationUnit res2 = CompilationUnitResolver.FACADE.toCompilationUnit(sourceUnit, initialNeedsToResolveBinding, project, classpaths, nodeSearcher, apiLevel, compilerOptions, typeRootWorkingCopyOwner, typeRootWorkingCopyOwner, flags, monitor);
// //res.typeAndFlags=res2.typeAndFlags;
// String res1a = res.toString();
// String res2a = res2.toString();
//
// AnnotationTypeDeclaration l1 = (AnnotationTypeDeclaration)res.types().get(0);
// AnnotationTypeDeclaration l2 = (AnnotationTypeDeclaration)res2.types().get(0);
String res1a = res.toString();
String res2a = res2.toString();

// TypeDeclaration l1 = (TypeDeclaration)res.types().get(2);
// TypeDeclaration l2 = (TypeDeclaration)res2.types().get(2);
// Object o1 = l1.bodyDeclarations().get(0);
// Object o2 = l2.bodyDeclarations().get(0);
// Object o1Param = ((MethodDeclaration)o1).parameters().get(0);
// Object o2Param = ((MethodDeclaration)o2).parameters().get(0);
// Object o1Body1 = ((TypeDeclarationStatement)((Block)o1Param).statements().get(0)).getTypeDeclaration();
// Object o2Body1 = ((TypeDeclarationStatement)((Block)o2Param).statements().get(0)).getTypeDeclaration();
// Object o1Body1Method = ((MethodDeclaration)((TypeDeclaration)o1Body1).bodyDeclarations.get(0)).getBody();
// Object o2Body1Method = ((MethodDeclaration)((TypeDeclaration)o2Body1).bodyDeclarations.get(0)).getBody();
// Object o1Return = ((Block)o1Body1Method).statements().get(0);
// Object o2Return = ((Block)o2Body1Method).statements().get(0);
return res;
}

Expand Down
Loading

0 comments on commit 999ab3e

Please sign in to comment.