Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2016-01-14 17:11:50 -0500
committerBrian Vosburgh2016-01-14 17:11:50 -0500
commit1299e5e061febdba053f82871f277a8ba0670e66 (patch)
tree8086226efcd96f63b1e539091e7402071d42c1a0
parent7a014a1a25c8d452ffb7ac19a74991c2ee80647e (diff)
downloadwebtools.dali-1299e5e061febdba053f82871f277a8ba0670e66.tar.gz
webtools.dali-1299e5e061febdba053f82871f277a8ba0670e66.tar.xz
webtools.dali-1299e5e061febdba053f82871f277a8ba0670e66.zip
[468637] fix StackOverflowError when type hierarchy has a cycle
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/TypeTools.java65
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JDTToolsTests.java65
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JptCommonCoreUtilityJdtTests.java5
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/TypeToolsTests.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRef.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceUnit.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaConverterClassConverter.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaCustomizer.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmConverterClassConverter.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmCustomizer.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkVirtualJavaPersistentAttribute.java8
14 files changed, 139 insertions, 123 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/TypeTools.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/TypeTools.java
index 50073406f2..6deb8a32b2 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/TypeTools.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/TypeTools.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2016 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.
@@ -10,6 +10,7 @@
package org.eclipse.jpt.common.core.internal.utility;
import java.util.ArrayList;
+import java.util.HashSet;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMethod;
@@ -32,53 +33,72 @@ public final class TypeTools {
/**
* Climb the specified type's inheritance hierarchy looking for the specified interface.
*/
- public static boolean isSubType(String potentialSubTypeName, String potentialSuperTypeName, IJavaProject javaProject) {
+ public static boolean isSubTypeOf(String typeName, String possibleSuperTypeName, IJavaProject javaProject) {
try {
- return isSubType_(javaProject.findType(potentialSubTypeName), javaProject.findType(potentialSuperTypeName));
+ return isSubTypeOf_(javaProject.findType(typeName), javaProject.findType(possibleSuperTypeName));
} catch (JavaModelException ex) {
JptCommonCorePlugin.instance().logError(ex);
return false;
}
}
- public static boolean isSubType(IType potentialSubType, String potentialSuperTypeName) {
+ public static boolean isSubTypeOf(IType type, String possibleSuperTypeName) {
try {
- return isSubType_(potentialSubType, potentialSuperTypeName);
+ return isSubTypeOf_(type, possibleSuperTypeName);
} catch (JavaModelException ex) {
JptCommonCorePlugin.instance().logError(ex);
return false;
}
}
- private static boolean isSubType_(IType potentialSubType, String potentialSuperTypeName) throws JavaModelException {
- return isSubType_(potentialSubType, potentialSubType.getJavaProject().findType(potentialSuperTypeName));
+ private static boolean isSubTypeOf_(IType type, String possibleSuperTypeName) throws JavaModelException {
+ return isSubTypeOf_(type, type.getJavaProject().findType(possibleSuperTypeName));
}
- private static boolean isSubType_(IType potentialSubType, IType potentialSuperType) throws JavaModelException {
- if ((potentialSubType == null) || (potentialSuperType == null)) {
+ private static boolean isSubTypeOf_(IType type, IType possibleSuperType) throws JavaModelException {
+ if (type == null) {
+ return false;
+ }
+ HashSet<String> visitedTypeNames = new HashSet<>();
+ visitedTypeNames.add(type.getFullyQualifiedName());
+ return isSubTypeOf_(type, possibleSuperType, visitedTypeNames);
+ }
+
+ private static boolean isSubTypeOf_(IType type, IType possibleSuperType, HashSet<String> visitedTypeNames) throws JavaModelException {
+ if ((type == null) || (possibleSuperType == null)) {
return false;
}
// short cut if types are the same
- if (potentialSubType.equals(potentialSuperType)) {
+ if (type.equals(possibleSuperType)) {
return true;
}
- IJavaProject javaProject = potentialSubType.getJavaProject();
+ IJavaProject javaProject = type.getJavaProject();
// short cut if potential supertype is java.lang.Object
- if (javaProject.findType(Object.class.getName()).equals(potentialSuperType)) {
+ if (javaProject.findType(Object.class.getName()).equals(possibleSuperType)) {
return true;
}
- String potentialSuperTypeName = potentialSuperType.getFullyQualifiedName();
+ String possibleSuperTypeName = possibleSuperType.getFullyQualifiedName();
+
+ for (String superTypeName : getResolvedSuperTypeNames(type)) {
+ if (superTypeName == null) {
+ continue;
+ }
+ if (visitedTypeNames.contains(superTypeName)) {
+ // no need to revisit any types;
+ // and(!) stop any inheritance cycles (which is possible in source)
+ continue;
+ }
+ visitedTypeNames.add(superTypeName);
- for (String superTypeName : getResolvedSuperTypeNames(potentialSubType)) {
- if (superTypeName.equals(potentialSuperTypeName)) {
+ if (superTypeName.equals(possibleSuperTypeName)) {
return true;
}
// recurse into super type
- if (isSubType_(javaProject.findType(superTypeName), potentialSuperType)) {
+ if (isSubTypeOf_(javaProject.findType(superTypeName), possibleSuperType, visitedTypeNames)) {
return true;
}
}
@@ -97,7 +117,7 @@ public final class TypeTools {
// if type is binary, the types are already resolved
return nonResolvedSuperTypeNames;
}
- ArrayList<String> resolvedSuperTypeNames = new ArrayList<String>();
+ ArrayList<String> resolvedSuperTypeNames = new ArrayList<>();
for (String superTypeName : nonResolvedSuperTypeNames) {
resolvedSuperTypeNames.add(resolveType_(type, superTypeName));
}
@@ -109,11 +129,10 @@ public final class TypeTools {
* This is necessary because, for whatever reason, { @link IType#getSuperInterfaceNames()} and
* {@link IType#getSuperclassName()} return unqualified names when the type is from Java source.
*/
- @SuppressWarnings("unchecked")
private static Iterable<String> getNonResolvedSuperTypeNames(IType type) throws JavaModelException {
- return IterableTools.concatenate(
- IterableTools.removeNulls(IterableTools.singletonIterable(type.getSuperclassName())),
- IterableTools.iterable(type.getSuperInterfaceNames()));
+ String superclassName = type.getSuperclassName();
+ Iterable<String> superInterfaceNames = IterableTools.iterable(type.getSuperInterfaceNames());
+ return (superclassName == null) ? superInterfaceNames : IterableTools.add(superInterfaceNames, superclassName);
}
/**
@@ -140,11 +159,11 @@ public final class TypeTools {
}
public static boolean isSerializable(IType type) {
- return isSubType(type, SERIALIZABLE_NAME);
+ return isSubTypeOf(type, SERIALIZABLE_NAME);
}
public static boolean isSerializable(String typeName, IJavaProject javaProject) {
- return isSubType(typeName, SERIALIZABLE_NAME, javaProject);
+ return isSubTypeOf(typeName, SERIALIZABLE_NAME, javaProject);
}
public static final String SERIALIZABLE_NAME = java.io.Serializable.class.getName();
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JDTToolsTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JDTToolsTests.java
deleted file mode 100644
index 9dd9abe400..0000000000
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JDTToolsTests.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.core.tests.internal.utility.jdt;
-
-import java.util.AbstractCollection;
-import java.util.AbstractList;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import java.util.Vector;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.core.internal.utility.TypeTools;
-
-
-public class JDTToolsTests
- extends AnnotationTestCase {
-
- public JDTToolsTests(String name) {
- super(name);
- }
-
-
- public void testTypeIsSubtype() throws Exception {
- IJavaProject jProj = this.getJavaProject();
-
- // same type
- assertTrue(TypeTools.isSubType(ArrayList.class.getName(), ArrayList.class.getName(), jProj));
- assertTrue(TypeTools.isSubType(List.class.getName(), List.class.getName(), jProj));
-
- // concrete type is subtype of interface
- assertTrue(TypeTools.isSubType(ArrayList.class.getName(), List.class.getName(), jProj));
- assertTrue(TypeTools.isSubType(TreeSet.class.getName(), Iterable.class.getName(), jProj));
-
- // concrete type is not subtype of interface
- assertFalse(TypeTools.isSubType(ArrayList.class.getName(), Map.class.getName(), jProj));
- assertFalse(TypeTools.isSubType(TreeSet.class.getName(), Map.class.getName(), jProj));
-
- // interface is subtype of interface
- assertTrue(TypeTools.isSubType(List.class.getName(), Collection.class.getName(), jProj));
- assertTrue(TypeTools.isSubType(SortedSet.class.getName(), Iterable.class.getName(), jProj));
-
- // interface is not subtype of interface
- assertFalse(TypeTools.isSubType(List.class.getName(), Map.class.getName(), jProj));
- assertFalse(TypeTools.isSubType(SortedSet.class.getName(), Map.class.getName(), jProj));
-
- // concrete type is subtype of concrete type
- assertTrue(TypeTools.isSubType(ArrayList.class.getName(), AbstractList.class.getName(), jProj));
- assertTrue(TypeTools.isSubType(LinkedList.class.getName(), AbstractCollection.class.getName(), jProj));
-
- // concrete type is not subtype of concrete type
- assertFalse(TypeTools.isSubType(ArrayList.class.getName(), Vector.class.getName(), jProj));
- assertFalse(TypeTools.isSubType(LinkedList.class.getName(), Vector.class.getName(), jProj));
- }
-}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JptCommonCoreUtilityJdtTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JptCommonCoreUtilityJdtTests.java
index 0f485953b4..f735366cc9 100644
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JptCommonCoreUtilityJdtTests.java
+++ b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/JptCommonCoreUtilityJdtTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2016 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.
@@ -19,12 +19,12 @@ public class JptCommonCoreUtilityJdtTests {
suite.addTestSuite(CombinationIndexedDeclarationAnnotationAdapterTests.class);
suite.addTestSuite(DefaultAnnotationEditFormatterTests.class);
suite.addTestSuite(ASTToolsTests.class);
- suite.addTestSuite(JDTToolsTests.class);
suite.addTestSuite(MemberAnnotationElementAdapterTests.class);
suite.addTestSuite(NestedDeclarationAnnotationAdapterTests.class);
suite.addTestSuite(NestedIndexedDeclarationAnnotationAdapterTests.class);
suite.addTestSuite(SimpleDeclarationAnnotationAdapterTests.class);
suite.addTestSuite(TypeTests.class);
+ suite.addTestSuite(TypeToolsTests.class);
return suite;
}
@@ -32,5 +32,4 @@ public class JptCommonCoreUtilityJdtTests {
super();
throw new UnsupportedOperationException();
}
-
}
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/TypeToolsTests.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/TypeToolsTests.java
new file mode 100644
index 0000000000..39fd459c34
--- /dev/null
+++ b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/TypeToolsTests.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2016 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.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.common.core.tests.internal.utility.jdt;
+
+import java.util.AbstractCollection;
+import java.util.AbstractList;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import java.util.Vector;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jpt.common.core.internal.utility.TypeTools;
+
+public class TypeToolsTests
+ extends AnnotationTestCase
+{
+ public TypeToolsTests(String name) {
+ super(name);
+ }
+
+ public void testIsSubtypeOf() throws Exception {
+ IJavaProject jProj = this.getJavaProject();
+
+ // same type
+ assertTrue(TypeTools.isSubTypeOf(ArrayList.class.getName(), ArrayList.class.getName(), jProj));
+ assertTrue(TypeTools.isSubTypeOf(List.class.getName(), List.class.getName(), jProj));
+
+ // concrete type is subtype of interface
+ assertTrue(TypeTools.isSubTypeOf(ArrayList.class.getName(), List.class.getName(), jProj));
+ assertTrue(TypeTools.isSubTypeOf(TreeSet.class.getName(), Iterable.class.getName(), jProj));
+
+ // concrete type is not subtype of interface
+ assertFalse(TypeTools.isSubTypeOf(ArrayList.class.getName(), Map.class.getName(), jProj));
+ assertFalse(TypeTools.isSubTypeOf(TreeSet.class.getName(), Map.class.getName(), jProj));
+
+ // interface is subtype of interface
+ assertTrue(TypeTools.isSubTypeOf(List.class.getName(), Collection.class.getName(), jProj));
+ assertTrue(TypeTools.isSubTypeOf(SortedSet.class.getName(), Iterable.class.getName(), jProj));
+
+ // interface is not subtype of interface
+ assertFalse(TypeTools.isSubTypeOf(List.class.getName(), Map.class.getName(), jProj));
+ assertFalse(TypeTools.isSubTypeOf(SortedSet.class.getName(), Map.class.getName(), jProj));
+
+ // concrete type is subtype of concrete type
+ assertTrue(TypeTools.isSubTypeOf(ArrayList.class.getName(), AbstractList.class.getName(), jProj));
+ assertTrue(TypeTools.isSubTypeOf(LinkedList.class.getName(), AbstractCollection.class.getName(), jProj));
+
+ // concrete type is not subtype of concrete type
+ assertFalse(TypeTools.isSubTypeOf(ArrayList.class.getName(), Vector.class.getName(), jProj));
+ assertFalse(TypeTools.isSubTypeOf(LinkedList.class.getName(), Vector.class.getName(), jProj));
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java
index 9e52c22e3f..eed89d7473 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2016 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.
@@ -639,7 +639,7 @@ public class GenericJavaClassMapping
if (jaxbType.getMapping() != null
&& ! jaxbType.getMapping().isXmlTransient()
&& jaxbType.getMapping().getXmlRootElement() != null
- && TypeTools.isSubType(
+ && TypeTools.isSubTypeOf(
jaxbType.getTypeName().getFullyQualifiedName(), getJavaType().getTypeName().getFullyQualifiedName(), getJaxbProject().getJavaProject())) {
return true;
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java
index 36671dfbd2..7896ffd63d 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2016 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.
@@ -380,7 +380,7 @@ public class GenericJavaXmlElement
&& JavaProjectTools.findType(getJaxbProject().getJavaProject(), fqType) != null) {
String attributeBaseType = getAttributeMapping().getValueTypeName();
if (! StringTools.isBlank(attributeBaseType) // can be null if there is a setter with no getter
- && ! TypeTools.isSubType(fqType, attributeBaseType, getJaxbProject().getJavaProject())) {
+ && ! TypeTools.isSubTypeOf(fqType, attributeBaseType, getJaxbProject().getJavaProject())) {
messages.add(
this.buildValidationMessage(
getTypeTextRange(),
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java
index dc60764bdb..a13f836b36 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2016 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.
@@ -251,7 +251,7 @@ public class GenericJavaXmlElementRef
// verify that type actually exists before validating
&& JavaProjectTools.findType(getJaxbProject().getJavaProject(), fqType) != null) {
String attributeValueType = getContext().getAttributeMapping().getValueTypeName();
- if (! TypeTools.isSubType(fqType, attributeValueType, getJaxbProject().getJavaProject())) {
+ if (! TypeTools.isSubTypeOf(fqType, attributeValueType, getJaxbProject().getJavaProject())) {
messages.add(
this.buildValidationMessage(
getTypeTextRange(),
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRef.java
index 508dd2b298..4b369f6a40 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRef.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRef.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 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
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
+ * Copyright (c) 2012, 2016 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.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
import org.eclipse.jpt.common.core.internal.utility.TypeTools;
@@ -26,6 +26,6 @@ public class ELJavaXmlElementRef
@Override
protected boolean isTypeJAXBElement() {
String fqType = getFullyQualifiedType();
- return fqType != null && TypeTools.isSubType(getFullyQualifiedType(), JAXB.JAXB_ELEMENT, getJaxbProject().getJavaProject());
+ return fqType != null && TypeTools.isSubTypeOf(getFullyQualifiedType(), JAXB.JAXB_ELEMENT, getJaxbProject().getJavaProject());
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceUnit.java
index ea9fc4bee1..9f43d0c248 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceUnit.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceUnit.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 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.
@@ -704,7 +704,7 @@ public class EclipseLinkPersistenceUnit
loggerProperty.getValue()
)
);
- } else if (!TypeTools.isSubType(
+ } else if (!TypeTools.isSubTypeOf(
loggerProperty.getValue(), EclipseLinkLogging.ECLIPSELINK_LOGGER_CLASS_NAME, javaProject)
) {
messages.add(
@@ -749,7 +749,7 @@ public class EclipseLinkPersistenceUnit
handlerProperty.getValue()
)
);
- } else if ( ! TypeTools.isSubType(
+ } else if ( ! TypeTools.isSubTypeOf(
handlerProperty.getValue(),
org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkCustomization.ECLIPSELINK_EXCEPTION_HANDLER_CLASS_NAME,
javaProject)
@@ -801,7 +801,7 @@ public class EclipseLinkPersistenceUnit
profilerProperty.getValue()
)
);
- } else if (!TypeTools.isSubType(
+ } else if (!TypeTools.isSubTypeOf(
profilerProperty.getValue(), org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkCustomization.ECLIPSELINK_SESSION_PROFILER_CLASS_NAME, javaProject)
) {
messages.add(
@@ -847,7 +847,7 @@ public class EclipseLinkPersistenceUnit
property.getValue()
)
);
- } else if (!TypeTools.isSubType(
+ } else if (!TypeTools.isSubTypeOf(
property.getValue(), org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkCustomization.ECLIPSELINK_SESSION_CUSTOMIZER_CLASS_NAME, javaProject)
) {
messages.add(
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaConverterClassConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaConverterClassConverter.java
index b79e2cbbd2..42caa82046 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaConverterClassConverter.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaConverterClassConverter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2016 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.
@@ -92,7 +92,7 @@ public abstract class EclipseLinkJavaConverterClassConverter<A extends NamedConv
*/
protected boolean typeImplementsInterface(String typeName, String interfaceName) {
return (typeName != null) &&
- TypeTools.isSubType(typeName, interfaceName, this.getJavaProject());
+ TypeTools.isSubTypeOf(typeName, interfaceName, this.getJavaProject());
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaCustomizer.java
index 5b62017ca8..c52435453e 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaCustomizer.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaCustomizer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 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.
@@ -198,7 +198,7 @@ public class EclipseLinkJavaCustomizer
*/
protected boolean typeImplementsInterface(String typeName, String interfaceName) {
return (typeName != null) &&
- TypeTools.isSubType(typeName, interfaceName, this.getJavaProject());
+ TypeTools.isSubTypeOf(typeName, interfaceName, this.getJavaProject());
}
protected TextRange getCustomizerClassTextRange() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmConverterClassConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmConverterClassConverter.java
index 67445474b6..2e4baf08ae 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmConverterClassConverter.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmConverterClassConverter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2011, 2016 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.
@@ -156,7 +156,7 @@ public abstract class EclipseLinkOrmConverterClassConverter<X extends XmlNamedCo
*/
protected boolean typeImplementsInterface(String typeName, String interfaceName) {
return (typeName != null) &&
- TypeTools.isSubType(typeName, interfaceName, this.getJavaProject());
+ TypeTools.isSubTypeOf(typeName, interfaceName, this.getJavaProject());
}
protected boolean converterClassImplementsInterface(String interfaceName) {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmCustomizer.java
index 2cfa3378e9..af685dd55c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmCustomizer.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmCustomizer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 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.
@@ -284,7 +284,7 @@ public class EclipseLinkOrmCustomizer
)
);
}
- if (!TypeTools.isSubType(customizerJdtType, ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME)) {
+ if (!TypeTools.isSubTypeOf(customizerJdtType, ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME)) {
messages.add(
this.buildValidationMessage(
this.getValidationTextRange(),
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkVirtualJavaPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkVirtualJavaPersistentAttribute.java
index 19662314b4..234c9a2cb0 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkVirtualJavaPersistentAttribute.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkVirtualJavaPersistentAttribute.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2016 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.
@@ -212,8 +212,8 @@ public class EclipseLinkVirtualJavaPersistentAttribute
if (typeName == null) {
return false;
}
- return TypeTools.isSubType(typeName, DATE_TYPE_NAME, this.getJavaProject())
- || TypeTools.isSubType(typeName, CALENDAR_TYPE_NAME, this.getJavaProject());
+ return TypeTools.isSubTypeOf(typeName, DATE_TYPE_NAME, this.getJavaProject())
+ || TypeTools.isSubTypeOf(typeName, CALENDAR_TYPE_NAME, this.getJavaProject());
}
public boolean typeIsSerializable() {
@@ -316,7 +316,7 @@ public class EclipseLinkVirtualJavaPersistentAttribute
}
}
for (JpaContainerDefinition definition : this.getJpaContainerDefinitions()) {
- if (TypeTools.isSubType(typeName, definition.getTypeName(), this.getJavaProject())) {
+ if (TypeTools.isSubTypeOf(typeName, definition.getTypeName(), this.getJavaProject())) {
return definition;
}
}

Back to the top