Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2012-09-17 16:17:40 +0000
committerBrian Vosburgh2012-09-17 16:17:40 +0000
commita627549fa7546e68d2b259256deac99675846200 (patch)
tree5441c61a8900c439331757df7dfce815f54c691e
parent64d334858d0f991a0bd8a92bf501ba54aa2e6e11 (diff)
downloadwebtools.dali-a627549fa7546e68d2b259256deac99675846200.tar.gz
webtools.dali-a627549fa7546e68d2b259256deac99675846200.tar.xz
webtools.dali-a627549fa7546e68d2b259256deac99675846200.zip
add comment to AbstractJpaProject.findType(String)
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java
index dc139e0b5d..d75ad1830b 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java
@@ -654,11 +654,19 @@ public abstract class AbstractJpaProject
return (jdtType == null) ? null : this.buildExternalJavaResourceType(jdtType);
}
+ /**
+ * If the Java project has a class named <code>Foo</code> in the default package,
+ * {@link IJavaProject#findType(String)} will return the {@link IType}
+ * corresponding to <code>Foo</code> if the named passed to it is <code>".Foo"</code>.
+ * This is not what we are expecting! So we had to put in a check for any
+ * type name beginning with <code>'.'</code>.
+ * See JDT bug 377710.
+ */
protected IType findType(String typeName) {
try {
- return typeName.startsWith(".") ? null : this.getJavaProject().findType(typeName);
+ return typeName.startsWith(".") ? null : this.getJavaProject().findType(typeName); //$NON-NLS-1$
} catch (JavaModelException ex) {
- return null; // ignore exception?
+ return null; // ignore exception? resource exception was probably already logged by JDT
}
}

Back to the top