diff options
| author | Olivier Thomann | 2016-04-11 15:52:36 +0000 |
|---|---|---|
| committer | Olivier Thomann | 2016-04-11 15:52:36 +0000 |
| commit | 23572f6241d42dbeddb6371c0b3a822c5d6bd658 (patch) | |
| tree | 6534702ae7e0a25123c89d990701cadffdff5b19 | |
| parent | c449e7867786526cbf7019d92c07b90169be6afc (diff) | |
| download | eclipse.pde.ui-23572f6241d42dbeddb6371c0b3a822c5d6bd658.tar.gz eclipse.pde.ui-23572f6241d42dbeddb6371c0b3a822c5d6bd658.tar.xz eclipse.pde.ui-23572f6241d42dbeddb6371c0b3a822c5d6bd658.zip | |
Revert "Revert "Bug 490770 - Freeze report should mention compatible changes""I20160412-0800
This reverts commit c449e7867786526cbf7019d92c07b90169be6afc.
9 files changed, 161 insertions, 272 deletions
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/FieldDeltaTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/FieldDeltaTests.java index 855d96eed4..c9c2ab053d 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/FieldDeltaTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/FieldDeltaTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * 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 @@ -29,10 +29,10 @@ import junit.framework.TestSuite; public class FieldDeltaTests extends DeltaTestSetup { public static Test suite() { - return new TestSuite(FieldDeltaTests.class); -// TestSuite suite = new TestSuite(FieldDeltaTests.class.getName()); -// suite.addTest(new FieldDeltaTests("test75")); -// return suite; + // return new TestSuite(FieldDeltaTests.class); + TestSuite suite = new TestSuite(FieldDeltaTests.class.getName()); + suite.addTest(new FieldDeltaTests("test78")); //$NON-NLS-1$ + return suite; } public FieldDeltaTests(String name) { @@ -1809,6 +1809,31 @@ public class FieldDeltaTests extends DeltaTestSetup { assertEquals("Wrong element type", IDelta.FIELD_ELEMENT_TYPE, child.getElementType()); //$NON-NLS-1$ assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$ } + + /** + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=490770 Non-compile time + * constant to compile time constant + */ + public void test78() { + deployBundles("test78"); //$NON-NLS-1$ + IApiBaseline before = getBeforeState(); + IApiBaseline after = getAfterState(); + IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME); + assertNotNull("no api component", beforeApiComponent); //$NON-NLS-1$ + IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME); + assertNotNull("no api component", afterApiComponent); //$NON-NLS-1$ + 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$ + IDelta child = allLeavesDeltas[0]; + assertEquals("Wrong kind", IDelta.ADDED, child.getKind()); //$NON-NLS-1$ + assertEquals("Wrong flag", IDelta.VALUE, child.getFlags()); //$NON-NLS-1$ + assertEquals("Wrong element type", IDelta.FIELD_ELEMENT_TYPE, child.getElementType()); //$NON-NLS-1$ + assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$ + } + /** * Check decrease field visibility - public to private */ diff --git a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test78/after/X.java b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test78/after/X.java new file mode 100644 index 0000000000..92078aa318 --- /dev/null +++ b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test78/after/X.java @@ -0,0 +1,14 @@ +/******************************************************************************* + * Copyright (c) 2016 IBM Corporation and others. + * 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: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +public class X { + public static final int i = 1; + public static final int j = Integer.valueOf(0).intValue(); +} diff --git a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test78/before/X.java b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test78/before/X.java new file mode 100644 index 0000000000..6f871e03d4 --- /dev/null +++ b/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test78/before/X.java @@ -0,0 +1,14 @@ +/******************************************************************************* + * Copyright (c) 2016 IBM Corporation and others. + * 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: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +public class X { + public static final int i = Integer.valueOf(1).intValue(); + public static final int j = Integer.valueOf(0).intValue(); +} diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/DeltaXmlVisitor.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/DeltaXmlVisitor.java index 61dd200046..186eec4fa1 100644 --- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/DeltaXmlVisitor.java +++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/DeltaXmlVisitor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2013 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * 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 @@ -61,7 +61,7 @@ public class DeltaXmlVisitor extends DeltaVisitor { protected void processLeafDelta(IDelta delta) { Element deltaElement = fDoc.createElement(IApiXmlConstants.DELTA_ELEMENT_NAME); - deltaElement.setAttribute(IApiXmlConstants.ATTR_FLAGS, Integer.toString(delta.getFlags())); + deltaElement.setAttribute(IApiXmlConstants.ATTR_FLAGS, Util.getDeltaFlagsName(delta.getFlags())); deltaElement.setAttribute(IApiXmlConstants.ATTR_KIND, Util.getDeltaKindName(delta)); deltaElement.setAttribute(IApiXmlConstants.ATTR_NAME_ELEMENT_TYPE, Util.getDeltaElementType(delta)); deltaElement.setAttribute(IApiXmlConstants.ATTR_KEY, delta.getKey()); diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/util/Util.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/util/Util.java index f1d7e9f176..dbce8f1c4d 100644 --- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/util/Util.java +++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/util/Util.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2013 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * 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 @@ -29,6 +29,7 @@ import java.io.PrintWriter; import java.io.StringReader; import java.io.UnsupportedEncodingException; import java.lang.reflect.Field; +import java.lang.reflect.Modifier; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; @@ -141,6 +142,21 @@ public final class Util { public static final String DOT_TAR_GZ = ".tar.gz"; //$NON-NLS-1$ public static final String DOT_JAR = ".jar"; //$NON-NLS-1$ public static final String DOT_ZIP = ".zip"; //$NON-NLS-1$ + public static Map<Integer, String> flagsNames = new HashMap<>(); + + static { + Field[] declaredFields = IDelta.class.getDeclaredFields(); + for (Field field : declaredFields) { + try { + if (Modifier.isFinal(field.getModifiers()) && Modifier.isStatic(field.getModifiers()) && Modifier.isPublic(field.getModifiers())) { + Integer value = Integer.valueOf(field.getInt(null)); + flagsNames.put(value, field.getName()); + } + } catch (IllegalAccessException e) { + // ignore + } + } + } public static final char VERSION_SEPARATOR = '('; @@ -687,6 +703,30 @@ public final class Util { } /** + * Return an int value that represents the given flag value. Returns -1 if + * the flag value cannot be determined. + * + * @param flagName the given element type + * @return an int that represents the given flag value constant. + */ + public static int getDeltaFlagValue(String flagName) { + Class<IDelta> IDeltaClass = IDelta.class; + try { + Field field = IDeltaClass.getField(flagName); + return field.getInt(null); + } catch (SecurityException e) { + // ignore + } catch (IllegalArgumentException e) { + // ignore + } catch (NoSuchFieldException e) { + // ignore + } catch (IllegalAccessException e) { + // ignore + } + return -1; + } + + /** * Return a string that represents the given element type Returns * {@link #UNKNOWN_ELEMENT_KIND} if the element type cannot be determined. * @@ -729,141 +769,9 @@ public final class Util { * @return a string that represents the given flags. */ public static String getDeltaFlagsName(int flags) { - switch (flags) { - case IDelta.ABSTRACT_TO_NON_ABSTRACT: - return "ABSTRACT_TO_NON_ABSTRACT"; //$NON-NLS-1$ - case IDelta.ANNOTATION_DEFAULT_VALUE: - return "ANNOTATION_DEFAULT_VALUE"; //$NON-NLS-1$ - case IDelta.API_COMPONENT: - return "API_COMPONENT"; //$NON-NLS-1$ - case IDelta.ARRAY_TO_VARARGS: - return "ARRAY_TO_VARARGS"; //$NON-NLS-1$ - case IDelta.CHECKED_EXCEPTION: - return "CHECKED_EXCEPTION"; //$NON-NLS-1$ - case IDelta.CLASS_BOUND: - return "CLASS_BOUND"; //$NON-NLS-1$ - case IDelta.CLINIT: - return "CLINIT"; //$NON-NLS-1$ - case IDelta.CONSTRUCTOR: - return "CONSTRUCTOR"; //$NON-NLS-1$ - case IDelta.CONTRACTED_SUPERINTERFACES_SET: - return "CONTRACTED_SUPERINTERFACES_SET"; //$NON-NLS-1$ - case IDelta.DECREASE_ACCESS: - return "DECREASE_ACCESS"; //$NON-NLS-1$ - case IDelta.ENUM_CONSTANT: - return "ENUM_CONSTANT"; //$NON-NLS-1$ - case IDelta.EXECUTION_ENVIRONMENT: - return "EXECUTION_ENVIRONMENT"; //$NON-NLS-1$ - case IDelta.EXPANDED_SUPERINTERFACES_SET: - return "EXPANDED_SUPERINTERFACES_SET"; //$NON-NLS-1$ - case IDelta.FIELD: - return "FIELD"; //$NON-NLS-1$ - case IDelta.FIELD_MOVED_UP: - return "FIELD_MOVED_UP"; //$NON-NLS-1$ - case IDelta.FINAL_TO_NON_FINAL: - return "FINAL_TO_NON_FINAL"; //$NON-NLS-1$ - case IDelta.FINAL_TO_NON_FINAL_NON_STATIC: - return "FINAL_TO_NON_FINAL_NON_STATIC"; //$NON-NLS-1$ - case IDelta.FINAL_TO_NON_FINAL_STATIC_CONSTANT: - return "FINAL_TO_NON_FINAL_STATIC_CONSTANT"; //$NON-NLS-1$ - case IDelta.FINAL_TO_NON_FINAL_STATIC_NON_CONSTANT: - return "FINAL_TO_NON_FINAL_STATIC_NON_CONSTANT"; //$NON-NLS-1$ - case IDelta.INCREASE_ACCESS: - return "INCREASE_ACCESS"; //$NON-NLS-1$ - case IDelta.INTERFACE_BOUND: - return "INTERFACE_BOUND"; //$NON-NLS-1$ - case IDelta.METHOD: - return "METHOD"; //$NON-NLS-1$ - case IDelta.METHOD_MOVED_UP: - return "METHOD_MOVED_UP"; //$NON-NLS-1$ - case IDelta.METHOD_WITH_DEFAULT_VALUE: - return "METHOD_WITH_DEFAULT_VALUE"; //$NON-NLS-1$ - case IDelta.METHOD_WITHOUT_DEFAULT_VALUE: - return "METHOD_WITHOUT_DEFAULT_VALUE"; //$NON-NLS-1$ - case IDelta.NATIVE_TO_NON_NATIVE: - return "NATIVE_TO_NON_NATIVE"; //$NON-NLS-1$ - case IDelta.NON_ABSTRACT_TO_ABSTRACT: - return "NON_ABSTRACT_TO_ABSTRACT"; //$NON-NLS-1$ - case IDelta.NON_FINAL_TO_FINAL: - return "NON_FINAL_TO_FINAL"; //$NON-NLS-1$ - case IDelta.NON_NATIVE_TO_NATIVE: - return "NON_NATIVE_TO_NATIVE"; //$NON-NLS-1$ - case IDelta.NON_STATIC_TO_STATIC: - return "NON_STATIC_TO_STATIC"; //$NON-NLS-1$ - case IDelta.NON_SYNCHRONIZED_TO_SYNCHRONIZED: - return "NON_SYNCHRONIZED_TO_SYNCHRONIZED"; //$NON-NLS-1$ - case IDelta.NON_TRANSIENT_TO_TRANSIENT: - return "NON_TRANSIENT_TO_TRANSIENT"; //$NON-NLS-1$ - case IDelta.OVERRIDEN_METHOD: - return "OVERRIDEN_METHOD"; //$NON-NLS-1$ - case IDelta.STATIC_TO_NON_STATIC: - return "STATIC_TO_NON_STATIC"; //$NON-NLS-1$ - case IDelta.SUPERCLASS: - return "SUPERCLASS"; //$NON-NLS-1$ - case IDelta.SYNCHRONIZED_TO_NON_SYNCHRONIZED: - return "SYNCHRONIZED_TO_NON_SYNCHRONIZED"; //$NON-NLS-1$ - case IDelta.TYPE_CONVERSION: - return "TYPE_CONVERSION"; //$NON-NLS-1$ - case IDelta.TRANSIENT_TO_NON_TRANSIENT: - return "TRANSIENT_TO_NON_TRANSIENT"; //$NON-NLS-1$ - case IDelta.TYPE: - return "TYPE"; //$NON-NLS-1$ - case IDelta.TYPE_ARGUMENTS: - return "TYPE_ARGUMENTS"; //$NON-NLS-1$ - case IDelta.TYPE_MEMBER: - return "TYPE_MEMBER"; //$NON-NLS-1$ - case IDelta.TYPE_PARAMETER: - return "TYPE_PARAMETER"; //$NON-NLS-1$ - case IDelta.TYPE_PARAMETER_NAME: - return "TYPE_PARAMETER_NAME"; //$NON-NLS-1$ - case IDelta.TYPE_PARAMETERS: - return "TYPE_PARAMETERS"; //$NON-NLS-1$ - case IDelta.TYPE_VISIBILITY: - return "TYPE_VISIBILITY"; //$NON-NLS-1$ - case IDelta.UNCHECKED_EXCEPTION: - return "UNCHECKED_EXCEPTION"; //$NON-NLS-1$ - case IDelta.VALUE: - return "VALUE"; //$NON-NLS-1$ - case IDelta.VARARGS_TO_ARRAY: - return "VARARGS_TO_ARRAY"; //$NON-NLS-1$ - case IDelta.RESTRICTIONS: - return "RESTRICTIONS"; //$NON-NLS-1$ - case IDelta.API_TYPE: - return "API_TYPE"; //$NON-NLS-1$ - case IDelta.NON_VOLATILE_TO_VOLATILE: - return "NON_VOLATILE_TO_VOLATILE"; //$NON-NLS-1$ - case IDelta.VOLATILE_TO_NON_VOLATILE: - return "VOLATILE_TO_NON_VOLATILE"; //$NON-NLS-1$ - case IDelta.MINOR_VERSION: - return "MINOR_VERSION"; //$NON-NLS-1$ - case IDelta.MAJOR_VERSION: - return "MAJOR_VERSION"; //$NON-NLS-1$ - case IDelta.API_FIELD: - return "API_FIELD"; //$NON-NLS-1$ - case IDelta.API_METHOD: - return "API_METHOD"; //$NON-NLS-1$ - case IDelta.API_CONSTRUCTOR: - return "API_CONSTRUCTOR"; //$NON-NLS-1$ - case IDelta.API_ENUM_CONSTANT: - return "API_ENUM_CONSTANT"; //$NON-NLS-1$ - case IDelta.API_METHOD_WITH_DEFAULT_VALUE: - return "API_METHOD_WITH_DEFAULT_VALUE"; //$NON-NLS-1$ - case IDelta.API_METHOD_WITHOUT_DEFAULT_VALUE: - return "API_METHOD_WITHOUT_DEFAULT_VALUE"; //$NON-NLS-1$ - case IDelta.TYPE_ARGUMENT: - return "TYPE_ARGUMENT"; //$NON-NLS-1$ - case IDelta.SUPER_INTERFACE_WITH_METHODS: - return "SUPER_INTERFACE_WITH_METHODS"; //$NON-NLS-1$ - case IDelta.REEXPORTED_API_TYPE: - return "REEXPORTED_API_TYPE"; //$NON-NLS-1$ - case IDelta.REEXPORTED_TYPE: - return "REEXPORTED_TYPE"; //$NON-NLS-1$ - case IDelta.METHOD_MOVED_DOWN: - return "METHOD_MOVED_DOWN"; //$NON-NLS-1$ - case IDelta.DEPRECATION: - return "DEPRECATION"; //$NON-NLS-1$ - default: - break; + String fieldName = flagsNames.get(Integer.valueOf(flags)); + if (fieldName != null) { + return fieldName; } return UNKNOWN_FLAGS; } @@ -1400,7 +1308,7 @@ public final class Util { /** * Rewrite a parameter type signature with type erasure and using the * parameterized type bounds lookup table. For example: - * + * * <pre> * expand("QList<QE;>;", {"E" → "Ljava.lang.Object;"}) = "QList;" * expand("QE;", {"E" → "Ljava.lang.Object;"}) = "Ljava.lang.Object;" @@ -2372,8 +2280,18 @@ public final class Util { default: return arguments[0]; } + case IDelta.EXECUTION_ENVIRONMENT: + StringBuilder builder = new StringBuilder(); + int i = 0; + for (String argument : arguments) { + if (i != 0) { + builder.append(','); + } + builder.append(argument); + i++; + } + return String.valueOf(builder); default: - break; } return EMPTY_STRING; } diff --git a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/APIFreezeReportConversionTask.java b/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/APIFreezeReportConversionTask.java index 4b1b74baee..6585155dd9 100644 --- a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/APIFreezeReportConversionTask.java +++ b/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/APIFreezeReportConversionTask.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2013 IBM Corporation and others. + * Copyright (c) 2008, 2016 IBM Corporation and others. * 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 @@ -154,7 +154,7 @@ public class APIFreezeReportConversionTask extends Task { } else { this.componentID = value; } - this.flags = Integer.parseInt(attributes.getValue(IApiXmlConstants.ATTR_FLAGS)); + this.flags = Util.getDeltaFlagValue(attributes.getValue(IApiXmlConstants.ATTR_FLAGS)); this.elementType = Util.getDeltaElementTypeValue(attributes.getValue(IApiXmlConstants.ATTR_NAME_ELEMENT_TYPE)); this.typename = attributes.getValue(IApiXmlConstants.ATTR_NAME_TYPE_NAME); this.key = attributes.getValue(IApiXmlConstants.ATTR_KEY); @@ -209,6 +209,7 @@ public class APIFreezeReportConversionTask extends Task { case IDelta.METHOD: case IDelta.METHOD_WITH_DEFAULT_VALUE: case IDelta.METHOD_WITHOUT_DEFAULT_VALUE: + case IDelta.ARRAY_TO_VARARGS: int indexOf = this.key.indexOf('('); if (indexOf == -1) { return null; @@ -235,8 +236,10 @@ public class APIFreezeReportConversionTask extends Task { case IDelta.API_FIELD: case IDelta.ENUM_CONSTANT: case IDelta.API_ENUM_CONSTANT: - buffer.append('#'); - buffer.append(this.key); + buffer.append('#').append(this.key); + break; + case IDelta.VALUE: + buffer.append('#').append(this.key).append('(').append(Messages.deltaReportTask_compile_time_constant).append(')'); break; case IDelta.TYPE_MEMBER: case IDelta.API_TYPE: @@ -298,6 +301,9 @@ public class APIFreezeReportConversionTask extends Task { case IDelta.API_BASELINE_ELEMENT_TYPE: buffer.append(this.key); break; + case IDelta.EXECUTION_ENVIRONMENT: + buffer.append(this.key).append('#').append(arguments[0]).append('(').append(Messages.deltaReportTask_entry_execution_environment).append(')'); + break; default: break; } diff --git a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/FilterListDeltaVisitor.java b/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/FilterListDeltaVisitor.java index 913723beea..a93c774c1f 100644 --- a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/FilterListDeltaVisitor.java +++ b/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/FilterListDeltaVisitor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2013 IBM Corporation and others. + * Copyright (c) 2008, 2016 IBM Corporation and others. * 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 @@ -101,6 +101,8 @@ public class FilterListDeltaVisitor extends DeltaXmlVisitor { case IDelta.REEXPORTED_API_TYPE: case IDelta.REEXPORTED_TYPE: case IDelta.DEPRECATION: + case IDelta.ARRAY_TO_VARARGS: + case IDelta.VALUE: buffer.append('#').append(delta.getKey()); break; case IDelta.MAJOR_VERSION: @@ -110,7 +112,11 @@ public class FilterListDeltaVisitor extends DeltaXmlVisitor { case IDelta.API_COMPONENT: buffer.append(Util.getDeltaKindName(delta.getKind())).append('#').append(delta.getKey()); break; + case IDelta.EXECUTION_ENVIRONMENT: + buffer.append(delta.getComponentId()).append(':').append(Util.getDeltaFlagsName(delta.getFlags())).append('=').append(delta.getArguments()[0]); + break; default: + buffer.append(delta.getElementType()).append('|').append(Util.getDeltaKindName(delta.getKind())).append('|').append(Util.getDeltaFlagsName(delta.getFlags())).append('|').append(Util.getDeltaArgumentString(delta)); break; } @@ -145,27 +151,12 @@ public class FilterListDeltaVisitor extends DeltaXmlVisitor { } } if ((this.flags & CHECK_OTHER) != 0) { - switch (delta.getFlags()) { - case IDelta.TYPE_MEMBER: - case IDelta.METHOD: - case IDelta.CONSTRUCTOR: - case IDelta.ENUM_CONSTANT: - case IDelta.METHOD_WITH_DEFAULT_VALUE: - case IDelta.METHOD_WITHOUT_DEFAULT_VALUE: - case IDelta.FIELD: - case IDelta.TYPE: - case IDelta.API_TYPE: - case IDelta.API_METHOD: - case IDelta.API_FIELD: - case IDelta.API_CONSTRUCTOR: - case IDelta.API_ENUM_CONSTANT: - case IDelta.REEXPORTED_TYPE: - if (!checkExclude(delta)) { - super.processLeafDelta(delta); - } - break; - default: - break; + if (delta.getFlags() == IDelta.OVERRIDEN_METHOD && delta.getElementType() == IDelta.INTERFACE_ELEMENT_TYPE) { + // org.eclipse.core.resources.IWorkspaceRunnable#run(..) + return; + } + if (!checkExclude(delta)) { + super.processLeafDelta(delta); } } } else if (Flags.isProtected(modifiers) && !RestrictionModifiers.isExtendRestriction(delta.getCurrentRestrictions())) { @@ -181,53 +172,23 @@ public class FilterListDeltaVisitor extends DeltaXmlVisitor { } } if ((this.flags & CHECK_OTHER) != 0) { - switch (delta.getFlags()) { - case IDelta.TYPE_MEMBER: - case IDelta.METHOD: - case IDelta.CONSTRUCTOR: - case IDelta.ENUM_CONSTANT: - case IDelta.FIELD: - case IDelta.TYPE: - case IDelta.API_TYPE: - case IDelta.API_METHOD: - case IDelta.API_FIELD: - case IDelta.API_CONSTRUCTOR: - case IDelta.API_ENUM_CONSTANT: - case IDelta.REEXPORTED_TYPE: - if (!checkExclude(delta)) { - super.processLeafDelta(delta); - } - break; - default: - break; + if (!checkExclude(delta)) { + super.processLeafDelta(delta); } } } if (delta.getElementType() == IDelta.API_BASELINE_ELEMENT_TYPE && ((this.flags & CHECK_OTHER) != 0)) { - switch (delta.getKind()) { - case IDelta.ADDED: - if (delta.getFlags() == IDelta.API_COMPONENT) { - if (!checkExclude(delta)) { - super.processLeafDelta(delta); - } - } - break; - default: - break; + if (delta.getFlags() == IDelta.API_COMPONENT) { + if (!checkExclude(delta)) { + super.processLeafDelta(delta); + } } } break; case IDelta.CHANGED: if ((this.flags & CHECK_OTHER) != 0) { - switch (delta.getFlags()) { - case IDelta.MAJOR_VERSION: - case IDelta.MINOR_VERSION: - if (!checkExclude(delta)) { - super.processLeafDelta(delta); - } - break; - default: - break; + if (!checkExclude(delta)) { + super.processLeafDelta(delta); } } break; @@ -242,73 +203,20 @@ public class FilterListDeltaVisitor extends DeltaXmlVisitor { default: break; } + } else if ((this.flags & CHECK_OTHER) != 0) { + if (!checkExclude(delta)) { + super.processLeafDelta(delta); + } } break; default: break; } } else if ((this.flags & CHECK_OTHER) != 0) { - switch (delta.getKind()) { - case IDelta.ADDED: - switch (delta.getFlags()) { - case IDelta.TYPE_MEMBER: - case IDelta.METHOD: - case IDelta.CONSTRUCTOR: - case IDelta.ENUM_CONSTANT: - case IDelta.METHOD_WITH_DEFAULT_VALUE: - case IDelta.METHOD_WITHOUT_DEFAULT_VALUE: - case IDelta.FIELD: - case IDelta.TYPE: - case IDelta.API_TYPE: - case IDelta.API_METHOD: - case IDelta.API_FIELD: - case IDelta.API_CONSTRUCTOR: - case IDelta.API_ENUM_CONSTANT: - case IDelta.REEXPORTED_TYPE: - if (Util.isVisible(delta.getNewModifiers())) { - if (!checkExclude(delta)) { - super.processLeafDelta(delta); - } - } - break; - default: - break; - } - break; - case IDelta.REMOVED: - switch (delta.getFlags()) { - case IDelta.TYPE_MEMBER: - case IDelta.METHOD: - case IDelta.CONSTRUCTOR: - case IDelta.ENUM_CONSTANT: - case IDelta.METHOD_WITH_DEFAULT_VALUE: - case IDelta.METHOD_WITHOUT_DEFAULT_VALUE: - case IDelta.FIELD: - case IDelta.TYPE: - case IDelta.API_TYPE: - case IDelta.API_METHOD: - case IDelta.API_FIELD: - case IDelta.API_CONSTRUCTOR: - case IDelta.API_ENUM_CONSTANT: - case IDelta.REEXPORTED_API_TYPE: - case IDelta.REEXPORTED_TYPE: - if (Util.isVisible(delta.getOldModifiers())) { - if (!checkExclude(delta)) { - super.processLeafDelta(delta); - } - } - break; - case IDelta.API_COMPONENT: - if (!checkExclude(delta)) { - super.processLeafDelta(delta); - } - break; - default: - break; - } - break; - default: - break; + if (Util.isVisible(delta.getNewModifiers())) { + if (!checkExclude(delta)) { + super.processLeafDelta(delta); + } } } } diff --git a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/Messages.java b/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/Messages.java index dd59e81bc2..ef446335f4 100644 --- a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/Messages.java +++ b/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/Messages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2013 IBM Corporation and others. + * Copyright (c) 2008, 2016 IBM Corporation and others. * 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 @@ -32,6 +32,8 @@ public class Messages extends NLS { public static String deltaReportTask_missingXmlFile; public static String deltaReportTask_xmlFileLocationMustBeAFile; public static String deltaReportTask_hmlFileLocationMustBeAFile; + public static String deltaReportTask_compile_time_constant; + public static String deltaReportTask_entry_execution_environment; public static String fullReportTask_bundlesheader; public static String fullReportTask_bundlesentry_even; diff --git a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/messages.properties b/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/messages.properties index c7e87d0344..3705e7e4ac 100644 --- a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/messages.properties +++ b/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/messages.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2008, 2013 IBM Corporation and others. +# Copyright (c) 2008, 2016 IBM Corporation and others. # 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 @@ -47,6 +47,8 @@ deltaReportTask_missingXmlFile=The xml report file {0} does not exist deltaReportTask_xmlFileLocationMustBeAFile=The xml report file {0} must be a file and not a directory deltaReportTask_hmlFileLocationMustBeAFile=The html report file {0} must be a file and not a directory deltaReportTask_couldNotCreateSAXParser=Could not create a sax parser +deltaReportTask_compile_time_constant=Compile-time constant +deltaReportTask_entry_execution_environment=Execution Environment missing_xml_files_location=The directory that contains xml reports must be specified invalid_directory_name=''{0}'' is not a valid directory name could_not_create_sax_parser=Could not create a sax parser |
