removed debug output and cyclic interface hierarchy test, seems to be the root cause of the issues and it not really needed anymore
This commit is contained in:
@@ -23,7 +23,6 @@ import org.eclipse.jdt.core.dom.ITypeBinding;
|
||||
import org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava;
|
||||
import org.springframework.ide.vscode.commons.util.CollectorUtil;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
@@ -52,9 +51,6 @@ public abstract class AnnotationHierarchies {
|
||||
ImmutableList.Builder<ITypeBinding> superAnnotations = ImmutableList.builder();
|
||||
for (IAnnotationBinding ab : annotations) {
|
||||
ITypeBinding sa = ab.getAnnotationType();
|
||||
|
||||
log.info("super annotation analysis for " + typeBinding.getName() + " - " + ab.getName() + " - with binding: " + sa != null ? sa.getName() : "null");
|
||||
|
||||
if (sa != null) {
|
||||
if (!ignoreAnnotation(sa.getQualifiedName())) {
|
||||
superAnnotations.add(sa);
|
||||
@@ -65,7 +61,7 @@ public abstract class AnnotationHierarchies {
|
||||
}
|
||||
}
|
||||
catch (AbortCompilation e) {
|
||||
log.warn("compilation aborted ", e);
|
||||
log.debug("compilation aborted ", e);
|
||||
// ignore this, it is most likely caused by broken source code, a broken classpath, or some optional dependencies not being on the classpath
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,6 @@ import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import org.eclipse.jdt.core.dom.ITypeBinding;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava;
|
||||
import org.springframework.ide.vscode.commons.util.Assert;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
@@ -36,8 +33,6 @@ import com.google.common.collect.ImmutableList;
|
||||
*/
|
||||
public class AnnotationHierarchyAwareLookup<T> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AnnotationHierarchyAwareLookup.class);
|
||||
|
||||
private static class Binding<T> {
|
||||
T value;
|
||||
boolean isOverriding;
|
||||
@@ -105,13 +100,9 @@ public class AnnotationHierarchyAwareLookup<T> {
|
||||
|
||||
private void findElements(ITypeBinding typeBinding, HashSet<String> seen, Consumer<T> requestor) {
|
||||
String qname = typeBinding.getQualifiedName();
|
||||
log.info("find elements for " + typeBinding.getName() + " with qname " + qname);
|
||||
|
||||
if (seen.add(qname)) {
|
||||
Binding<T> binding = bindings.get(qname);
|
||||
|
||||
log.info("binding for " + qname + " is " + binding);
|
||||
|
||||
boolean isOverriding = false;
|
||||
if (binding != null) {
|
||||
requestor.accept(binding.value);
|
||||
@@ -120,8 +111,6 @@ public class AnnotationHierarchyAwareLookup<T> {
|
||||
|
||||
if (!isOverriding) {
|
||||
Collection<ITypeBinding> directSuperAnnotations = AnnotationHierarchies.getDirectSuperAnnotations(typeBinding);
|
||||
log.info("direct super annotations found for " + typeBinding.getName() + " are: " + directSuperAnnotations);
|
||||
|
||||
for (ITypeBinding superAnnotation : directSuperAnnotations) {
|
||||
findElements(superAnnotation, seen, requestor);
|
||||
}
|
||||
|
||||
@@ -375,8 +375,6 @@ public class SpringIndexerJava implements SpringIndexer {
|
||||
SpringIndexerJavaContext context = new SpringIndexerJavaContext(project, cu, docURI, sourceFilePath,
|
||||
lastModified, docRef, null, generatedSymbols, pass, nextPassFiles);
|
||||
|
||||
log.info("AST created, scan in AST for symbols in: " + docURI);
|
||||
|
||||
scanAST(context);
|
||||
}
|
||||
};
|
||||
@@ -479,9 +477,6 @@ public class SpringIndexerJava implements SpringIndexer {
|
||||
Collection<SymbolProvider> providers = symbolProviders.get(typeBinding);
|
||||
Collection<ITypeBinding> metaAnnotations = AnnotationHierarchies.getMetaAnnotations(typeBinding, symbolProviders::containsKey);
|
||||
|
||||
log.info("symbol providers found: " + providers.size() + " for type bindung: " + typeBinding.getQualifiedName());
|
||||
log.info("meta annotations found: " + metaAnnotations.size());
|
||||
|
||||
if (!providers.isEmpty()) {
|
||||
TextDocument doc = DocumentUtils.getTempTextDocument(context.getDocURI(), context.getDocRef(), context.getContent());
|
||||
for (SymbolProvider provider : providers) {
|
||||
@@ -496,7 +491,7 @@ public class SpringIndexerJava implements SpringIndexer {
|
||||
}
|
||||
}
|
||||
else {
|
||||
log.warn("type binding not around: " + context.getDocURI() + " - " + node.toString());
|
||||
log.debug("type binding not around: " + context.getDocURI() + " - " + node.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -522,10 +517,6 @@ public class SpringIndexerJava implements SpringIndexer {
|
||||
String[] classpathEntries = getClasspathEntries(project);
|
||||
String[] sourceEntries = getSourceEntries(project);
|
||||
|
||||
log.info("Java symbol parsing for project: " + project.getElementName());
|
||||
log.info("Classpath: " + Arrays.toString(classpathEntries));
|
||||
log.info("Source: " + Arrays.toString(sourceEntries));
|
||||
|
||||
ASTParser parser = ASTParser.newParser(AST.JLS14);
|
||||
Map<String, String> options = JavaCore.getOptions();
|
||||
JavaCore.setComplianceOptions(JavaCore.VERSION_14, options);
|
||||
|
||||
@@ -120,10 +120,4 @@ public class SpringIndexerFunctionBeansTest {
|
||||
SpringIndexerHarness.assertDocumentSymbols(indexer, docUri);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testScanInconsistentInterfaceHierarchy() throws Exception {
|
||||
String docUri = directory.toPath().resolve("src/main/java/org/test/LoopedFunctionClass.java").toUri().toString();
|
||||
SpringIndexerHarness.assertDocumentSymbols(indexer, docUri);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
package org.test;
|
||||
|
||||
public class LoopedFunctionClass implements LoopedInterface1 {
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package org.test;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
public interface LoopedInterface1 extends LoopedInterface2 {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package org.test;
|
||||
|
||||
public interface LoopedInterface2 /* extends LoopedInterface1 */ {
|
||||
}
|
||||
Reference in New Issue
Block a user