[jbosstools-commits] JBoss Tools SVN: r30774 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Fri Apr 22 13:40:07 EDT 2011
Author: scabanovich
Date: 2011-04-22 13:40:06 -0400 (Fri, 22 Apr 2011)
New Revision: 30774
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java
Log:
JBIDE-8722
https://issues.jboss.org/browse/JBIDE-8722
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java 2011-04-22 13:56:22 UTC (rev 30773)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java 2011-04-22 17:40:06 UTC (rev 30774)
@@ -37,13 +37,7 @@
public void add(IPath path, IType type) throws CoreException {
if(type == null) return;
allpaths.add(path);
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=342757
- try {
- type.isAnnotation();
- } catch (ArrayIndexOutOfBoundsException e) {
- CDICorePlugin.getDefault().logError("JDT failed to load " + type.getFullyQualifiedName() + " from " + path + "\nSee https://bugs.eclipse.org/bugs/show_bug.cgi?id=342757");
- return;
- }
+ if(!checkType(type, path)) return;
if(type.isAnnotation()) {
add(annotations, path, type);
} else if(type.isInterface()) {
@@ -52,6 +46,7 @@
add(classes, path, type);
IType[] ts = type.getTypes();
for (IType t: ts) {
+ if(!checkType(t, path)) continue;
if(Flags.isStatic(t.getFlags())) {
add(path, t);
}
@@ -59,6 +54,29 @@
}
}
+ private static Set<IPath> failedPaths = new HashSet<IPath>();
+
+ /**
+ * Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=342757
+ * This method and field failedPaths should be removed as soon as the
+ * issue is fixed.
+ * @param type
+ * @param path
+ * @return
+ * @throws CoreException
+ */
+ private boolean checkType(IType type, IPath path) throws CoreException {
+ try {
+ type.isAnnotation();
+ } catch (ArrayIndexOutOfBoundsException e) {
+ if(failedPaths.contains(path)) return false; // Do not let's be too noisy.
+ failedPaths.add(path);
+ CDICorePlugin.getDefault().logError("JDT failed to load " + type.getFullyQualifiedName() + " from " + path + "\nSee https://bugs.eclipse.org/bugs/show_bug.cgi?id=342757");
+ return false;
+ }
+ return true;
+ }
+
private void add(Map<IPath, Set<IType>> target, IPath path, IType type) {
Set<IType> ts = target.get(path);
if(ts == null) {
More information about the jbosstools-commits
mailing list