Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Chandra2019-03-24 11:34:49 +0000
committerVikas Chandra2019-03-24 13:06:02 +0000
commit061975d6e68642349970d01343df49fd1b57bbde (patch)
tree9325787e3b83682794fcee4d310b16d269c572a0
parent133bf5984d84a7cd3476a184ddca8e0ca5116ff5 (diff)
downloadeclipse.pde.ui-061975d6e68642349970d01343df49fd1b57bbde.tar.gz
eclipse.pde.ui-061975d6e68642349970d01343df49fd1b57bbde.tar.xz
eclipse.pde.ui-061975d6e68642349970d01343df49fd1b57bbde.zip
Bug 327452 - Removing @noextend should generate API problem onI20190324-1800
MANIFEST.MF Change-Id: Iada2e8cd3f2717c6dfb85dd33f709341cdb2daa6 Signed-off-by: Vikas Chandra <Vikas.Chandra@in.ibm.com>
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/META-INF/MANIFEST.MF2
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/pom.xml2
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/InterfaceDeltaTests.java4
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/MethodDeltaTests.java4
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/RestrictionsDeltaTests.java32
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test10/after/X_test10.java (renamed from apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test10/after/X.java)4
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test10/before/X_test10.java (renamed from apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test10/before/X.java)4
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/tests-deltas/method/test110/after/p/X_test110.java (renamed from apitools/org.eclipse.pde.api.tools.tests/tests-deltas/method/test110/after/p/X.java)4
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/tests-deltas/method/test110/before/p/X_test110.java (renamed from apitools/org.eclipse.pde.api.tools.tests/tests-deltas/method/test110/before/p/X.java)4
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test1/after/X_test1.java (renamed from apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test1/after/X.java)4
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test1/before/X_test1.java (renamed from apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test1/before/X.java)4
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test10/before/X.java6
-rw-r--r--apitools/org.eclipse.pde.api.tools/META-INF/MANIFEST.MF2
-rw-r--r--apitools/org.eclipse.pde.api.tools/pom.xml2
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/BaseApiAnalyzer.java6
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/ClassFileComparator.java15
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/Messages.java4
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/compatible_delta_messages.properties6
18 files changed, 73 insertions, 36 deletions
diff --git a/apitools/org.eclipse.pde.api.tools.tests/META-INF/MANIFEST.MF b/apitools/org.eclipse.pde.api.tools.tests/META-INF/MANIFEST.MF
index d8e329ec8a..927d18ffa1 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/META-INF/MANIFEST.MF
+++ b/apitools/org.eclipse.pde.api.tools.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.pde.api.tools.tests
-Bundle-Version: 1.1.400.qualifier
+Bundle-Version: 1.1.500.qualifier
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.core.runtime,
org.junit,
diff --git a/apitools/org.eclipse.pde.api.tools.tests/pom.xml b/apitools/org.eclipse.pde.api.tools.tests/pom.xml
index 6cdb4aef9b..b0dcce2cab 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/pom.xml
+++ b/apitools/org.eclipse.pde.api.tools.tests/pom.xml
@@ -19,7 +19,7 @@
</parent>
<groupId>org.eclipse.pde</groupId>
<artifactId>org.eclipse.pde.api.tools.tests</artifactId>
- <version>1.1.400-SNAPSHOT</version>
+ <version>1.1.500-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<build>
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/InterfaceDeltaTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/InterfaceDeltaTests.java
index 3098544fd2..31ae2379a9 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/InterfaceDeltaTests.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/InterfaceDeltaTests.java
@@ -1104,8 +1104,10 @@ public class InterfaceDeltaTests extends DeltaTestSetup {
IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.API, null);
assertNotNull("No delta", delta); //$NON-NLS-1$
IDelta[] allLeavesDeltas = collectLeaves(delta);
- assertEquals("Wrong size", 1, allLeavesDeltas.length); //$NON-NLS-1$
+ assertEquals("Wrong size", 2, allLeavesDeltas.length); //$NON-NLS-1$
IDelta child = allLeavesDeltas[0];
assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$
+ child = allLeavesDeltas[1];
+ assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$
}
}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/MethodDeltaTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/MethodDeltaTests.java
index 9dcc6bf88d..792ce717d3 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/MethodDeltaTests.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/MethodDeltaTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2018 IBM Corporation and others.
+ * Copyright (c) 2007, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -2654,7 +2654,7 @@ public class MethodDeltaTests extends DeltaTestSetup {
assertEquals("Wrong kind", IDelta.REMOVED, child.getKind()); //$NON-NLS-1$
assertEquals("Wrong flag", IDelta.METHOD, child.getFlags()); //$NON-NLS-1$
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); //$NON-NLS-1$
- assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$
+ assertFalse("Not compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$
}
/**
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/RestrictionsDeltaTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/RestrictionsDeltaTests.java
index 4dd18cfac8..2b54552408 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/RestrictionsDeltaTests.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/RestrictionsDeltaTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2018 IBM Corporation and others.
+ * Copyright (c) 2007, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -52,18 +52,14 @@ public class RestrictionsDeltaTests extends DeltaTestSetup {
IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);
assertNotNull("No delta", delta); //$NON-NLS-1$
IDelta[] allLeavesDeltas = collectLeaves(delta);
- assertEquals("Wrong size", 2, allLeavesDeltas.length); //$NON-NLS-1$
+ assertEquals("Wrong size", 1, allLeavesDeltas.length); //$NON-NLS-1$
IDelta child = allLeavesDeltas[0];
assertEquals("Wrong kind", IDelta.ADDED, child.getKind()); //$NON-NLS-1$
assertFalse("Extend restrictions", RestrictionModifiers.isExtendRestriction(child.getCurrentRestrictions())); //$NON-NLS-1$
assertEquals("Wrong flag", IDelta.METHOD, child.getFlags()); //$NON-NLS-1$
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); //$NON-NLS-1$
assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$
- child = allLeavesDeltas[1];
- assertEquals("Wrong kind", IDelta.ADDED, child.getKind()); //$NON-NLS-1$
- assertEquals("Wrong flag", IDelta.RESTRICTIONS, child.getFlags()); //$NON-NLS-1$
- assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); //$NON-NLS-1$
- assertFalse("Is compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$
+
}
/**
@@ -266,7 +262,13 @@ public class RestrictionsDeltaTests extends DeltaTestSetup {
assertTrue("Has no description", afterApiComponent.hasApiDescription()); //$NON-NLS-1$
IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);
assertNotNull("No delta", delta); //$NON-NLS-1$
- assertTrue("Should be NO_DELTA", delta == ApiComparator.NO_DELTA); //$NON-NLS-1$
+ IDelta[] allLeavesDeltas = collectLeaves(delta);
+ assertEquals("Wrong size", 1, allLeavesDeltas.length); //$NON-NLS-1$
+ IDelta child = allLeavesDeltas[0];
+ assertEquals("Wrong kind", IDelta.REMOVED, child.getKind()); //$NON-NLS-1$
+ assertEquals("Wrong flag", IDelta.RESTRICTIONS, child.getFlags()); //$NON-NLS-1$
+ assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); //$NON-NLS-1$
+ assertTrue("Is compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$
}
/**
@@ -285,9 +287,15 @@ public class RestrictionsDeltaTests extends DeltaTestSetup {
assertTrue("Has no description", afterApiComponent.hasApiDescription()); //$NON-NLS-1$
IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);
assertNotNull("No delta", delta); //$NON-NLS-1$
- assertTrue("Should be NO_DELTA", delta == ApiComparator.NO_DELTA); //$NON-NLS-1$
+ IDelta[] allLeavesDeltas = collectLeaves(delta);
+ assertEquals("Wrong size", 1, allLeavesDeltas.length); //$NON-NLS-1$
+ IDelta child = allLeavesDeltas[0];
+ assertEquals("Wrong kind", IDelta.REMOVED, child.getKind()); //$NON-NLS-1$
+ assertEquals("Wrong flag", IDelta.RESTRICTIONS, child.getFlags()); //$NON-NLS-1$
+ assertEquals("Wrong element type", IDelta.INTERFACE_ELEMENT_TYPE, child.getElementType()); //$NON-NLS-1$
+ assertTrue("Is compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$
}
-
+
/**
* Add @noextend on a final class and remove final on the new version of the
* class 247654
@@ -313,7 +321,7 @@ public class RestrictionsDeltaTests extends DeltaTestSetup {
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); //$NON-NLS-1$
assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$
}
-
+
/**
* Add @noinstantiate on an abstract class and remove abstract on the new
* version of the class 247654
@@ -339,7 +347,7 @@ public class RestrictionsDeltaTests extends DeltaTestSetup {
assertEquals("Wrong element type", IDelta.CLASS_ELEMENT_TYPE, child.getElementType()); //$NON-NLS-1$
assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$
}
-
+
/**
* Add extend restrictions
*/
diff --git a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test10/after/X.java b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test10/after/X_test10.java
index f0d2eba281..f40c2f9ecf 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test10/after/X.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test10/after/X_test10.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,6 +11,6 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-public class X {
+public class X_test10 {
public static int s;
} \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test10/before/X.java b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test10/before/X_test10.java
index e309280751..db494f9397 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test10/before/X.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test10/before/X_test10.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,6 +11,6 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-public class X {
+public class X_test10 {
static int s;
} \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/method/test110/after/p/X.java b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/method/test110/after/p/X_test110.java
index f34418b929..50b74c5f14 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/method/test110/after/p/X.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/method/test110/after/p/X_test110.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * Copyright (c) 2008, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,7 @@
*******************************************************************************/
package p;
-public class X {
+public class X_test110 {
protected String m1() {
return null;
diff --git a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/method/test110/before/p/X.java b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/method/test110/before/p/X_test110.java
index 72927f13be..06d703adc0 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/method/test110/before/p/X.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/method/test110/before/p/X_test110.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * Copyright (c) 2008, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,7 @@
*******************************************************************************/
package p;
-public class X {
+public class X_test110 {
protected void m1() {
}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test1/after/X.java b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test1/after/X_test1.java
index b787838ce2..8f8bec7924 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test1/after/X.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test1/after/X_test1.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008,2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,7 +11,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-public class X {
+public class X_test1 {
public void foo() {}
public void foo2() {}
} \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test1/before/X.java b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test1/before/X_test1.java
index 0bceef4e57..7adef8bd7e 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test1/before/X.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test1/before/X_test1.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008,2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,6 +11,6 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-public class X {
+public class X_test1 {
public void foo() {}
} \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test10/before/X.java b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test10/before/X.java
index 08eb779d9b..4a95a90244 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test10/before/X.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/restrictions/test10/before/X.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008,2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,5 +11,9 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
+/**
+ * @noextend This class is not intended to be subclassed by clients.
+ *
+ */
public class X {
} \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools/META-INF/MANIFEST.MF b/apitools/org.eclipse.pde.api.tools/META-INF/MANIFEST.MF
index 90a5e2f48b..220448b8c4 100644
--- a/apitools/org.eclipse.pde.api.tools/META-INF/MANIFEST.MF
+++ b/apitools/org.eclipse.pde.api.tools/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.pde.api.tools;singleton:=true
-Bundle-Version: 1.1.700.qualifier
+Bundle-Version: 1.1.800.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.osgi;bundle-version="[3.4.0,4.0.0)",
diff --git a/apitools/org.eclipse.pde.api.tools/pom.xml b/apitools/org.eclipse.pde.api.tools/pom.xml
index b529ed5494..b28d49e81d 100644
--- a/apitools/org.eclipse.pde.api.tools/pom.xml
+++ b/apitools/org.eclipse.pde.api.tools/pom.xml
@@ -19,7 +19,7 @@
</parent>
<groupId>org.eclipse.pde</groupId>
<artifactId>org.eclipse.pde.api.tools</artifactId>
- <version>1.1.700-SNAPSHOT</version>
+ <version>1.1.800-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<properties>
<defaultSigning-excludeInnerJars>true</defaultSigning-excludeInnerJars>
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/BaseApiAnalyzer.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/BaseApiAnalyzer.java
index 7c33ea4eec..0bf1b0e8f6 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/BaseApiAnalyzer.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/BaseApiAnalyzer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2018 IBM Corporation and others.
+ * Copyright (c) 2008, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -1964,6 +1964,10 @@ public class BaseApiAnalyzer implements IApiAnalyzer {
}
break;
}
+ case IDelta.REMOVED:{
+ this.fBuildState.addCompatibleChange(delta);
+ break;
+ }
default:
break;
}
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/ClassFileComparator.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/ClassFileComparator.java
index 37f1c13a7c..e62892bf53 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/ClassFileComparator.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/ClassFileComparator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2018 IBM Corporation and others.
+ * Copyright (c) 2008, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -975,6 +975,9 @@ public class ClassFileComparator {
if ((RestrictionModifiers.isImplementRestriction(restrictions2) && !RestrictionModifiers.isImplementRestriction(restrictions)) || (RestrictionModifiers.isExtendRestriction(restrictions2) && !RestrictionModifiers.isExtendRestriction(restrictions))) {
this.addDelta(getElementType(this.type1), IDelta.ADDED, IDelta.RESTRICTIONS, restrictions2, typeAccess, typeAccess2, this.type2, this.type2.getName(), Util.getDescriptorName(type1));
}
+ if ((!RestrictionModifiers.isImplementRestriction(restrictions2) && RestrictionModifiers.isImplementRestriction(restrictions)) || (!RestrictionModifiers.isExtendRestriction(restrictions2) && RestrictionModifiers.isExtendRestriction(restrictions))) {
+ this.addDelta(getElementType(this.type1), IDelta.REMOVED, IDelta.RESTRICTIONS, restrictions2, typeAccess, typeAccess2, this.type2, this.type2.getName(), Util.getDescriptorName(type1));
+ }
} else {
boolean reportChangedRestrictions = false;
if (!Flags.isFinal(typeAccess2) && !Flags.isFinal(typeAccess)) {
@@ -982,12 +985,22 @@ public class ClassFileComparator {
reportChangedRestrictions = true;
this.addDelta(getElementType(this.type1), IDelta.ADDED, IDelta.RESTRICTIONS, restrictions2, typeAccess, typeAccess2, this.type2, this.type2.getName(), Util.getDescriptorName(type1));
}
+ if (!RestrictionModifiers.isExtendRestriction(restrictions2) && RestrictionModifiers.isExtendRestriction(restrictions)) {
+ reportChangedRestrictions = true;
+ this.addDelta(getElementType(this.type1), IDelta.REMOVED, IDelta.RESTRICTIONS,restrictions2, typeAccess, typeAccess2, this.type2, this.type2.getName(),Util.getDescriptorName(type1));
+ }
}
if (!reportChangedRestrictions && !Flags.isAbstract(typeAccess2) && !Flags.isAbstract(typeAccess)) {
if (RestrictionModifiers.isInstantiateRestriction(restrictions2) && !RestrictionModifiers.isInstantiateRestriction(restrictions)) {
this.addDelta(getElementType(this.type1), IDelta.ADDED, IDelta.RESTRICTIONS, restrictions2, typeAccess, typeAccess2, this.type2, this.type2.getName(), Util.getDescriptorName(type1));
}
}
+ if (!reportChangedRestrictions && !Flags.isAbstract(typeAccess2)
+ && !Flags.isAbstract(typeAccess)) {
+ if (!RestrictionModifiers.isInstantiateRestriction(restrictions2) && RestrictionModifiers.isInstantiateRestriction(restrictions)) {
+ this.addDelta(getElementType(this.type1), IDelta.REMOVED, IDelta.RESTRICTIONS,restrictions2, typeAccess, typeAccess2, this.type2, this.type2.getName(),Util.getDescriptorName(type1));
+ }
+ }
}
}
}
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/Messages.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/Messages.java
index 571d0fc56a..7f922f8b0c 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/Messages.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/Messages.java
@@ -260,6 +260,8 @@ public class Messages extends NLS {
return 31;
}
return 32;
+ case IDelta.RESTRICTIONS:
+ return 112;
case IDelta.TYPE_MEMBER:
if (Flags.isProtected(delta.getOldModifiers())) {
return 33;
@@ -432,6 +434,8 @@ public class Messages extends NLS {
return 61;
case IDelta.DEPRECATION:
return 111;
+ case IDelta.RESTRICTIONS:
+ return 112;
default:
break;
}
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/compatible_delta_messages.properties b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/compatible_delta_messages.properties
index 8c5efa095d..bac51b35d9 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/compatible_delta_messages.properties
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/compatible_delta_messages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2008, 2017 IBM Corporation and others.
+# Copyright (c) 2008, 2019 IBM Corporation and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
@@ -227,4 +227,6 @@
# {0} given element
110=The deprecation modifiers has been added to {0}
# {0} given element
-111=The deprecation modifiers has been removed from {0} \ No newline at end of file
+111=The deprecation modifiers has been removed from {0}
+# {0} type name
+112 = Restrictions have been removed for type {0} \ No newline at end of file

Back to the top