summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Butzke2012-08-08 09:41:44 (EDT)
committerKaren Butzke2012-08-08 09:52:29 (EDT)
commit5001be2c2df79c52466802a074264d9a47253ee8 (patch)
treefe7cd8cb8f8792a28a5fb840c5ecbe2f3c10d6d9
parent77cd942ffa05656af3357b1847571ec157bd32ab (diff)
downloadwebtools.dali-5001be2c2df79c52466802a074264d9a47253ee8.zip
webtools.dali-5001be2c2df79c52466802a074264d9a47253ee8.tar.gz
webtools.dali-5001be2c2df79c52466802a074264d9a47253ee8.tar.bz2
bug 379853 - Improve performance ofR2_3_maintenance
BinaryPackageFragment.buildClassFiles()
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPackageFragment.java23
1 files changed, 18 insertions, 5 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPackageFragment.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPackageFragment.java
index 734439b..efa4490 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPackageFragment.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPackageFragment.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2012 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -60,16 +60,29 @@ final class BinaryPackageFragment
for (IJavaElement child : children) {
IClassFile jdtClassFile = (IClassFile) child;
IType jdtType = jdtClassFile.getType();
- if (BinaryPersistentType.typeIsPersistable(jdtType)) {
+ if (typeIsRelevant(jdtType)) {
JavaResourceClassFile classFile = new BinaryClassFile(this, jdtClassFile, jdtType);
- if (classFile.getPersistentType().isAnnotated()) { // we only hold annotated types
- result.add(classFile);
- }
+ result.add(classFile);
}
}
return result;
}
+ static boolean typeIsRelevant(IType type) {
+ if (BinaryPersistentType.typeIsPersistable(type)) {
+ return typeHasAnyAnnotations(type); // we only hold annotated types
+ }
+ return false;
+ }
+
+ static boolean typeHasAnyAnnotations(IType type) {
+ try {
+ return (type.getAnnotations().length > 0);
+ }
+ catch (JavaModelException e) {
+ return false;
+ }
+ }
// ********** JarResourceNode implementation **********