Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Chandra2019-06-28 06:00:32 +0000
committerVikas Chandra2019-06-28 08:57:27 +0000
commit399ef731b990dbfa81d5a1f5f7e319d01bf7f8dc (patch)
tree8d7baf31e1b95745482036934461dea4cbfa9686
parent1187e7a81c72d7e3303fc09b1006d1984844ea23 (diff)
downloadeclipse.pde.ui-399ef731b990dbfa81d5a1f5f7e319d01bf7f8dc.tar.gz
eclipse.pde.ui-399ef731b990dbfa81d5a1f5f7e319d01bf7f8dc.tar.xz
eclipse.pde.ui-399ef731b990dbfa81d5a1f5f7e319d01bf7f8dc.zip
Bug 548731 - Restriction has been added/removed should mention the
restriction added or removed. Change-Id: Ia69a5989eb5c45243b91d28a922639b61f5bcc85 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.xml4
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/compatibility/ClassCompatibilityRestrictionTests.java6
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/compatibility/InterfaceCompatibilityRestrictionTests.java8
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/ClassFileComparator.java21
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/compatible_delta_messages.properties4
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/problems/problemmessages.properties4
7 files changed, 27 insertions, 22 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 927d18ffa1..8aa79110ff 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.500.qualifier
+Bundle-Version: 1.1.600.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 35f0a5bd72..d7cb38fb80 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/pom.xml
+++ b/apitools/org.eclipse.pde.api.tools.tests/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2017 Eclipse Foundation and others.
+ Copyright (c) 2012, 2019 Eclipse Foundation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
@@ -19,7 +19,7 @@
</parent>
<groupId>org.eclipse.pde</groupId>
<artifactId>org.eclipse.pde.api.tools.tests</artifactId>
- <version>1.1.500-SNAPSHOT</version>
+ <version>1.1.600-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<build>
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/compatibility/ClassCompatibilityRestrictionTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/compatibility/ClassCompatibilityRestrictionTests.java
index 49b8b000f7..1f01faaddb 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/compatibility/ClassCompatibilityRestrictionTests.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/compatibility/ClassCompatibilityRestrictionTests.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
@@ -83,7 +83,7 @@ public class ClassCompatibilityRestrictionTests extends ClassCompatibilityTests
};
setExpectedProblemIds(ids);
String[][] args = new String[1][];
- args[0] = new String[]{PACKAGE_PREFIX + "AddNoExtend"}; //$NON-NLS-1$
+ args[0] = new String[] { "@noextend", PACKAGE_PREFIX + "AddNoExtend" }; //$NON-NLS-1$ //$NON-NLS-2$
setExpectedMessageArgs(args);
performCompatibilityTest(filePath, incremental);
}
@@ -106,7 +106,7 @@ public class ClassCompatibilityRestrictionTests extends ClassCompatibilityTests
};
setExpectedProblemIds(ids);
String[][] args = new String[1][];
- args[0] = new String[]{PACKAGE_PREFIX + "AddNoInstantiate"}; //$NON-NLS-1$
+ args[0] = new String[] { "@noinstantiate", PACKAGE_PREFIX + "AddNoInstantiate" }; //$NON-NLS-1$ //$NON-NLS-2$
setExpectedMessageArgs(args);
performCompatibilityTest(filePath, incremental);
}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/compatibility/InterfaceCompatibilityRestrictionTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/compatibility/InterfaceCompatibilityRestrictionTests.java
index a5c263bdff..5d46e48a33 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/compatibility/InterfaceCompatibilityRestrictionTests.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/compatibility/InterfaceCompatibilityRestrictionTests.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
@@ -106,7 +106,7 @@ public class InterfaceCompatibilityRestrictionTests extends InterfaceCompatibili
};
setExpectedProblemIds(ids);
String[][] args = new String[1][];
- args[0] = new String[]{PACKAGE_PREFIX + "AddNoImplement"}; //$NON-NLS-1$
+ args[0] = new String[] { "@noimplement", PACKAGE_PREFIX + "AddNoImplement" }; //$NON-NLS-1$ //$NON-NLS-2$
setExpectedMessageArgs(args);
performCompatibilityTest(filePath, incremental);
}
@@ -158,7 +158,7 @@ public class InterfaceCompatibilityRestrictionTests extends InterfaceCompatibili
};
setExpectedProblemIds(ids);
String[][] args = new String[1][];
- args[0] = new String[]{PACKAGE_PREFIX + "AddNoExtend"}; //$NON-NLS-1$
+ args[0] = new String[] { "@noextend", PACKAGE_PREFIX + "AddNoExtend" }; //$NON-NLS-1$ //$NON-NLS-2$
setExpectedMessageArgs(args);
performCompatibilityTest(filePath, inc);
}
@@ -189,7 +189,7 @@ public class InterfaceCompatibilityRestrictionTests extends InterfaceCompatibili
};
setExpectedProblemIds(ids);
String[][] args = new String[1][];
- args[0] = new String[]{PACKAGE_PREFIX + "AddNoExtendNoImplement"}; //$NON-NLS-1$
+ args[0] = new String[] { "@noimplement", PACKAGE_PREFIX + "AddNoExtendNoImplement" }; //$NON-NLS-1$ //$NON-NLS-2$
setExpectedMessageArgs(args);
performCompatibilityTest(filePath, inc);
}
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 86ec728ae8..8f3b89b604 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
@@ -972,34 +972,39 @@ public class ClassFileComparator {
// adding/removing no extend on a final class is ok
// adding/removing no instantiate on an abstract class
// is ok
+ String NO_EXTEND = "@noextend"; //$NON-NLS-1$
+ String NO_IMPLEMENT = "@noimplement"; //$NON-NLS-1$
+ String NO_INSTANSTIATE = "@noinstantiate"; //$NON-NLS-1$
if (this.type1.isInterface()) {
- 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));
+ boolean noImplementAdded = (RestrictionModifiers.isImplementRestriction(restrictions2) && !RestrictionModifiers.isImplementRestriction(restrictions));
+ if (noImplementAdded || (RestrictionModifiers.isExtendRestriction(restrictions2) && !RestrictionModifiers.isExtendRestriction(restrictions))) {
+ this.addDelta(getElementType(this.type1), IDelta.ADDED, IDelta.RESTRICTIONS, restrictions2, typeAccess, typeAccess2, this.type2, this.type2.getName(), new String[] {noImplementAdded? NO_IMPLEMENT:NO_EXTEND, 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));
+ boolean noImplementRemoved = (!RestrictionModifiers.isImplementRestriction(restrictions2) && RestrictionModifiers.isImplementRestriction(restrictions)) ;
+ if (noImplementRemoved || (!RestrictionModifiers.isExtendRestriction(restrictions2) && RestrictionModifiers.isExtendRestriction(restrictions))) {
+ this.addDelta(getElementType(this.type1), IDelta.REMOVED, IDelta.RESTRICTIONS, restrictions2, typeAccess, typeAccess2, this.type2, this.type2.getName(), new String[] {noImplementRemoved? NO_IMPLEMENT:NO_EXTEND, Util.getDescriptorName(type1) });
}
} else {
boolean reportChangedRestrictions = false;
if (!Flags.isFinal(typeAccess2) && !Flags.isFinal(typeAccess)) {
if (RestrictionModifiers.isExtendRestriction(restrictions2) && !RestrictionModifiers.isExtendRestriction(restrictions)) {
reportChangedRestrictions = true;
- this.addDelta(getElementType(this.type1), IDelta.ADDED, IDelta.RESTRICTIONS, restrictions2, typeAccess, typeAccess2, this.type2, this.type2.getName(), Util.getDescriptorName(type1));
+ this.addDelta(getElementType(this.type1), IDelta.ADDED, IDelta.RESTRICTIONS,restrictions2, typeAccess, typeAccess2, this.type2, this.type2.getName(), new String[] { NO_EXTEND, 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));
+ this.addDelta(getElementType(this.type1), IDelta.REMOVED, IDelta.RESTRICTIONS,restrictions2, typeAccess, typeAccess2, this.type2, this.type2.getName(),new String[] { NO_EXTEND, 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));
+ this.addDelta(getElementType(this.type1), IDelta.ADDED, IDelta.RESTRICTIONS, restrictions2, typeAccess, typeAccess2, this.type2, this.type2.getName(), new String[] { NO_INSTANSTIATE, 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));
+ this.addDelta(getElementType(this.type1), IDelta.REMOVED, IDelta.RESTRICTIONS,restrictions2, typeAccess, typeAccess2, this.type2, this.type2.getName(),new String[] { NO_INSTANSTIATE, Util.getDescriptorName(type1) });
}
}
}
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 bac51b35d9..8d7da17a9d 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
@@ -221,7 +221,7 @@
# {0} interface name {1} super interface name
107 = The interface {1} adds method {2} to {0} that is tagged as @noimplement
# {0} type name
-108 = Restrictions have been added for type {0}
+108 = The {0} restriction have been added for type {1}
# {0} type name, {1} component id
109 = The re-exported type {0} has been added to {1}
# {0} given element
@@ -229,4 +229,4 @@
# {0} given element
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
+112 = The {0} restriction have been removed for type {1} \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/problems/problemmessages.properties b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/problems/problemmessages.properties
index b82b51f404..6e2f963198 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/problems/problemmessages.properties
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/problems/problemmessages.properties
@@ -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
@@ -98,7 +98,7 @@
66 = The ''abstract'' keyword has been added for class {0}
67 = The ''final'' keyword has been added for the type {0}
69 = The ''static'' keyword has been added for field {0}.{1}
-72 = Restrictions have been added for type {0}
+72 = The {0} restriction have been added for type {1}
73 = The static member type {0} has been converted to a non-static member type
74 = The superclass for {0} has changed
# This message is using ChoiceFormat in order to fill the argument {1} and {2}

Back to the top