Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 490770 | Differences between
and this patch

Collapse All | Expand All

(-)a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/BundlesDeltaTests.java (-15 / +9 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2010 IBM Corporation and others.
2
 * Copyright (c) 2007, 2016 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 10-18 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.pde.api.tools.comparator.tests;
11
package org.eclipse.pde.api.tools.comparator.tests;
12
12
13
import junit.framework.Test;
14
import junit.framework.TestSuite;
15
16
import org.eclipse.core.runtime.CoreException;
13
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.pde.api.tools.internal.provisional.VisibilityModifiers;
14
import org.eclipse.pde.api.tools.internal.provisional.VisibilityModifiers;
18
import org.eclipse.pde.api.tools.internal.provisional.comparator.ApiComparator;
15
import org.eclipse.pde.api.tools.internal.provisional.comparator.ApiComparator;
Lines 21-26 Link Here
21
import org.eclipse.pde.api.tools.internal.provisional.model.IApiBaseline;
18
import org.eclipse.pde.api.tools.internal.provisional.model.IApiBaseline;
22
import org.eclipse.pde.api.tools.internal.provisional.model.IApiComponent;
19
import org.eclipse.pde.api.tools.internal.provisional.model.IApiComponent;
23
import org.eclipse.pde.api.tools.internal.provisional.model.IApiTypeRoot;
20
import org.eclipse.pde.api.tools.internal.provisional.model.IApiTypeRoot;
21
22
import junit.framework.Test;
23
import junit.framework.TestSuite;
24
24
25
/**
25
/**
26
 * Delta tests for class
26
 * Delta tests for class
Lines 135-156 Link Here
135
		IDelta delta = ApiComparator.compare(getBeforeState(), getAfterState(), VisibilityModifiers.ALL_VISIBILITIES, false, null);
135
		IDelta delta = ApiComparator.compare(getBeforeState(), getAfterState(), VisibilityModifiers.ALL_VISIBILITIES, false, null);
136
		assertNotNull("No delta", delta); //$NON-NLS-1$
136
		assertNotNull("No delta", delta); //$NON-NLS-1$
137
		IDelta[] allLeavesDeltas = collectLeaves(delta);
137
		IDelta[] allLeavesDeltas = collectLeaves(delta);
138
		assertEquals("Wrong size", 2, allLeavesDeltas.length); //$NON-NLS-1$
138
		assertEquals("Wrong size", 1, allLeavesDeltas.length); //$NON-NLS-1$
139
		IDelta child = allLeavesDeltas[0];
139
		IDelta child = allLeavesDeltas[0];
140
		assertEquals("Wrong kind", IDelta.ADDED, child.getKind()); //$NON-NLS-1$
140
		assertEquals("Wrong kind", IDelta.CHANGED, child.getKind()); //$NON-NLS-1$
141
		assertEquals("Wrong flag", IDelta.EXECUTION_ENVIRONMENT, child.getFlags()); //$NON-NLS-1$
141
		assertEquals("Wrong flag", IDelta.EXECUTION_ENVIRONMENT, child.getFlags()); //$NON-NLS-1$
142
		assertEquals("Wrong element type", IDelta.API_COMPONENT_ELEMENT_TYPE, child.getElementType()); //$NON-NLS-1$
142
		assertEquals("Wrong element type", IDelta.API_COMPONENT_ELEMENT_TYPE, child.getElementType()); //$NON-NLS-1$
143
		String[] arguments = child.getArguments();
143
		String[] arguments = child.getArguments();
144
		assertEquals("Wrong size", 2, arguments.length); //$NON-NLS-1$
144
		assertEquals("Wrong size", 3, arguments.length); //$NON-NLS-1$
145
		assertEquals("Wrong value", "J2SE-1.4", arguments[0]); //$NON-NLS-1$ //$NON-NLS-2$
146
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$
147
		child = allLeavesDeltas[1];
148
		assertEquals("Wrong kind", IDelta.REMOVED, child.getKind()); //$NON-NLS-1$
149
		assertEquals("Wrong flag", IDelta.EXECUTION_ENVIRONMENT, child.getFlags()); //$NON-NLS-1$
150
		assertEquals("Wrong element type", IDelta.API_COMPONENT_ELEMENT_TYPE, child.getElementType()); //$NON-NLS-1$
151
		arguments = child.getArguments();
152
		assertEquals("Wrong size", 2, arguments.length); //$NON-NLS-1$
153
		assertEquals("Wrong value", "J2SE-1.5", arguments[0]); //$NON-NLS-1$ //$NON-NLS-2$
145
		assertEquals("Wrong value", "J2SE-1.5", arguments[0]); //$NON-NLS-1$ //$NON-NLS-2$
146
		assertEquals("Wrong value", "J2SE-1.4", arguments[1]); //$NON-NLS-1$ //$NON-NLS-2$
147
		assertEquals("Wrong value", "deltatest1_1.0.1", arguments[2]); //$NON-NLS-1$ //$NON-NLS-2$
154
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$
148
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$
155
	}
149
	}
156
150
(-)a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/comparator/tests/FieldDeltaTests.java (-4 / +29 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2010 IBM Corporation and others.
2
 * Copyright (c) 2007, 2016 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 30-38 Link Here
30
public class FieldDeltaTests extends DeltaTestSetup {
30
public class FieldDeltaTests extends DeltaTestSetup {
31
	public static Test suite() {
31
	public static Test suite() {
32
		return new TestSuite(FieldDeltaTests.class);
32
		return new TestSuite(FieldDeltaTests.class);
33
//		TestSuite suite = new TestSuite(FieldDeltaTests.class.getName());
33
		// TestSuite suite = new TestSuite(FieldDeltaTests.class.getName());
34
//		suite.addTest(new FieldDeltaTests("test75"));
34
		// suite.addTest(new FieldDeltaTests("test78")); //$NON-NLS-1$
35
//		return suite;
35
		// return suite;
36
	}
36
	}
37
37
38
	public FieldDeltaTests(String name) {
38
	public FieldDeltaTests(String name) {
Lines 1809-1814 Link Here
1809
		assertEquals("Wrong element type", IDelta.FIELD_ELEMENT_TYPE, child.getElementType()); //$NON-NLS-1$
1809
		assertEquals("Wrong element type", IDelta.FIELD_ELEMENT_TYPE, child.getElementType()); //$NON-NLS-1$
1810
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$
1810
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$
1811
	}
1811
	}
1812
1813
	/**
1814
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=490770 Non-compile time
1815
	 * constant to compile time constant
1816
	 */
1817
	public void test78() {
1818
		deployBundles("test78"); //$NON-NLS-1$
1819
		IApiBaseline before = getBeforeState();
1820
		IApiBaseline after = getAfterState();
1821
		IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);
1822
		assertNotNull("no api component", beforeApiComponent); //$NON-NLS-1$
1823
		IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);
1824
		assertNotNull("no api component", afterApiComponent); //$NON-NLS-1$
1825
		IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after,
1826
				VisibilityModifiers.API, null);
1827
		assertNotNull("No delta", delta); //$NON-NLS-1$
1828
		IDelta[] allLeavesDeltas = collectLeaves(delta);
1829
		assertEquals("Wrong size", 1, allLeavesDeltas.length); //$NON-NLS-1$
1830
		IDelta child = allLeavesDeltas[0];
1831
		assertEquals("Wrong kind", IDelta.ADDED, child.getKind()); //$NON-NLS-1$
1832
		assertEquals("Wrong flag", IDelta.VALUE, child.getFlags()); //$NON-NLS-1$
1833
		assertEquals("Wrong element type", IDelta.FIELD_ELEMENT_TYPE, child.getElementType()); //$NON-NLS-1$
1834
		assertTrue("Not compatible", DeltaProcessor.isCompatible(child)); //$NON-NLS-1$
1835
	}
1836
1812
	/**
1837
	/**
1813
	 * Check decrease field visibility - public to private
1838
	 * Check decrease field visibility - public to private
1814
	 */
1839
	 */
(-)a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test78/after/X.java (+14 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2016 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
public class X {
12
	public static final int i = 1;
13
	public static final int j = Integer.valueOf(0).intValue();
14
}
(-)a/apitools/org.eclipse.pde.api.tools.tests/tests-deltas/field/test78/before/X.java (+14 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2016 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
public class X {
12
	public static final int i = Integer.valueOf(1).intValue();
13
	public static final int j = Integer.valueOf(0).intValue();
14
}
(-)a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/ClassFileComparator.java (-8 / +4 lines)
Lines 1324-1336 Link Here
1324
		}
1324
		}
1325
		if (Flags.isDeprecated(access)) {
1325
		if (Flags.isDeprecated(access)) {
1326
			if (!Flags.isDeprecated(access2)) {
1326
			if (!Flags.isDeprecated(access2)) {
1327
				this.addDelta(IDelta.FIELD_ELEMENT_TYPE, IDelta.REMOVED, IDelta.DEPRECATION, restrictions, access, access2, this.type1, name, new String[] {
1327
				this.addDelta(IDelta.FIELD_ELEMENT_TYPE, IDelta.REMOVED, IDelta.DEPRECATION, restrictions, access, access2, this.type1, name, Util.getDescriptorName(this.type1) + '#' + name);
1328
						Util.getDescriptorName(this.type1), name });
1329
			}
1328
			}
1330
		} else if (Flags.isDeprecated(access2)) {
1329
		} else if (Flags.isDeprecated(access2)) {
1331
			// report delta - non-volatile to volatile
1330
			// report delta - non-volatile to volatile
1332
			this.addDelta(IDelta.FIELD_ELEMENT_TYPE, IDelta.ADDED, IDelta.DEPRECATION, restrictions, access, access2, this.type1, name, new String[] {
1331
			this.addDelta(IDelta.FIELD_ELEMENT_TYPE, IDelta.ADDED, IDelta.DEPRECATION, restrictions, access, access2, this.type1, name, Util.getDescriptorName(this.type1) + '#' + name);
1333
					Util.getDescriptorName(this.type1), name });
1334
		}
1332
		}
1335
		if (field.getConstantValue() != null) {
1333
		if (field.getConstantValue() != null) {
1336
			if (field2.getConstantValue() == null) {
1334
			if (field2.getConstantValue() == null) {
Lines 1821-1833 Link Here
1821
		}
1819
		}
1822
		if (Flags.isDeprecated(access)) {
1820
		if (Flags.isDeprecated(access)) {
1823
			if (!Flags.isDeprecated(access2)) {
1821
			if (!Flags.isDeprecated(access2)) {
1824
				this.addDelta(getElementType(method), IDelta.REMOVED, IDelta.DEPRECATION, restrictions, access, access2, this.type1, key, new String[] {
1822
				this.addDelta(getElementType(method), IDelta.REMOVED, IDelta.DEPRECATION, restrictions, access, access2, this.type1, key, Util.getDescriptorName(this.type1) + '#' + methodDisplayName);
1825
						Util.getDescriptorName(this.type1), methodDisplayName });
1826
			}
1823
			}
1827
		} else if (Flags.isDeprecated(access2)) {
1824
		} else if (Flags.isDeprecated(access2)) {
1828
			// report delta - non-volatile to volatile
1825
			// report delta - non-volatile to volatile
1829
			this.addDelta(getElementType(method), IDelta.ADDED, IDelta.DEPRECATION, restrictions, access, access2, this.type1, key, new String[] {
1826
			this.addDelta(getElementType(method), IDelta.ADDED, IDelta.DEPRECATION, restrictions, access, access2, this.type1, key, Util.getDescriptorName(this.type1) + '#' + methodDisplayName);
1830
					Util.getDescriptorName(this.type1), methodDisplayName });
1831
		}
1827
		}
1832
		// check type parameters
1828
		// check type parameters
1833
		String signature1 = method.getGenericSignature();
1829
		String signature1 = method.getGenericSignature();
(-)a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/Messages.java (+2 lines)
Lines 146-151 Link Here
146
								return 95;
146
								return 95;
147
							case IDelta.MINOR_VERSION:
147
							case IDelta.MINOR_VERSION:
148
								return 96;
148
								return 96;
149
							case IDelta.EXECUTION_ENVIRONMENT:
150
								return 112;
149
							default:
151
							default:
150
								break;
152
								break;
151
						}
153
						}
(-)a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/compatible_delta_messages.properties (-1 / +3 lines)
Lines 222-225 Link Here
222
# {0} given element
222
# {0} given element
223
110=The deprecation modifiers has been added to {0}
223
110=The deprecation modifiers has been added to {0}
224
# {0} given element
224
# {0} given element
225
111=The deprecation modifiers has been removed from {0}
225
111=The deprecation modifiers has been removed from {0}
226
# {0} reference EE, {1} new EE, {2} component id
227
112=The execution environment for {2} has been changed from {0} to {1}
(-)a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/comparator/ApiComparator.java (-12 / +23 lines)
Lines 267-287 Link Here
267
			// check the EE first
267
			// check the EE first
268
			Set<String> referenceEEs = Util.convertAsSet(referenceComponent.getExecutionEnvironments());
268
			Set<String> referenceEEs = Util.convertAsSet(referenceComponent.getExecutionEnvironments());
269
			Set<String> componentsEEs = Util.convertAsSet(component2.getExecutionEnvironments());
269
			Set<String> componentsEEs = Util.convertAsSet(component2.getExecutionEnvironments());
270
			SubMonitor referencesLoopMonitor = localmonitor.split(1).setWorkRemaining(referenceEEs.size());
270
271
			for (String currentEE : referenceEEs) {
271
			if (componentsEEs.size() == 1 && referenceEEs.size() == 1) {
272
				referencesLoopMonitor.split(1);
272
				String componentsEE = componentsEEs.iterator().next();
273
				if (!componentsEEs.remove(currentEE)) {
273
				String referenceEE = referenceEEs.iterator().next();
274
					globalDelta.add(new Delta(Util.getDeltaComponentVersionsId(referenceComponent), IDelta.API_COMPONENT_ELEMENT_TYPE, IDelta.REMOVED, IDelta.EXECUTION_ENVIRONMENT, RestrictionModifiers.NO_RESTRICTIONS, RestrictionModifiers.NO_RESTRICTIONS, 0, 0, null, referenceComponentId, new String[] {
274
				if (!componentsEE.equals(referenceEE)) {
275
					globalDelta.add(new Delta(Util.getDeltaComponentVersionsId(referenceComponent), IDelta.API_COMPONENT_ELEMENT_TYPE, IDelta.CHANGED, IDelta.EXECUTION_ENVIRONMENT, RestrictionModifiers.NO_RESTRICTIONS, RestrictionModifiers.NO_RESTRICTIONS, 0, 0, null, referenceComponentId, new String[] {
276
							referenceEE, componentsEE,
277
							Util.getComponentVersionsId(component2) }));
278
				}
279
			} else {
280
				SubMonitor referencesLoopMonitor = localmonitor.split(1).setWorkRemaining(referenceEEs.size());
281
				for (String currentEE : referenceEEs) {
282
					referencesLoopMonitor.split(1);
283
					if (!componentsEEs.remove(currentEE)) {
284
						globalDelta.add(new Delta(Util.getDeltaComponentVersionsId(referenceComponent), IDelta.API_COMPONENT_ELEMENT_TYPE, IDelta.REMOVED, IDelta.EXECUTION_ENVIRONMENT, RestrictionModifiers.NO_RESTRICTIONS, RestrictionModifiers.NO_RESTRICTIONS, 0, 0, null, referenceComponentId, new String[] {
285
								currentEE,
286
								Util.getComponentVersionsId(referenceComponent) }));
287
					}
288
				}
289
				SubMonitor componentsLoopMonitor = localmonitor.split(1).setWorkRemaining(componentsEEs.size());
290
				for (String currentEE : componentsEEs) {
291
					componentsLoopMonitor.split(1);
292
					globalDelta.add(new Delta(Util.getDeltaComponentVersionsId(referenceComponent), IDelta.API_COMPONENT_ELEMENT_TYPE, IDelta.ADDED, IDelta.EXECUTION_ENVIRONMENT, RestrictionModifiers.NO_RESTRICTIONS, RestrictionModifiers.NO_RESTRICTIONS, 0, 0, null, referenceComponentId, new String[] {
275
							currentEE,
293
							currentEE,
276
							Util.getComponentVersionsId(referenceComponent) }));
294
							Util.getComponentVersionsId(referenceComponent) }));
277
				}
295
				}
278
			}
279
			SubMonitor componentsLoopMonitor = localmonitor.split(1).setWorkRemaining(componentsEEs.size());
280
			for (String currentEE : componentsEEs) {
281
				componentsLoopMonitor.split(1);
282
				globalDelta.add(new Delta(Util.getDeltaComponentVersionsId(referenceComponent), IDelta.API_COMPONENT_ELEMENT_TYPE, IDelta.ADDED, IDelta.EXECUTION_ENVIRONMENT, RestrictionModifiers.NO_RESTRICTIONS, RestrictionModifiers.NO_RESTRICTIONS, 0, 0, null, referenceComponentId, new String[] {
283
						currentEE,
284
						Util.getComponentVersionsId(referenceComponent) }));
285
			}
296
			}
286
			return internalCompare(referenceComponent, component2, referenceBaseline, baseline, visibilityModifiers, globalDelta, localmonitor.split(1));
297
			return internalCompare(referenceComponent, component2, referenceBaseline, baseline, visibilityModifiers, globalDelta, localmonitor.split(1));
287
		} catch (CoreException e) {
298
		} catch (CoreException e) {
(-)a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/util/Util.java (-138 / +56 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2013 IBM Corporation and others.
2
 * Copyright (c) 2007, 2016 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 29-34 Link Here
29
import java.io.StringReader;
29
import java.io.StringReader;
30
import java.io.UnsupportedEncodingException;
30
import java.io.UnsupportedEncodingException;
31
import java.lang.reflect.Field;
31
import java.lang.reflect.Field;
32
import java.lang.reflect.Modifier;
32
import java.nio.ByteBuffer;
33
import java.nio.ByteBuffer;
33
import java.nio.CharBuffer;
34
import java.nio.CharBuffer;
34
import java.nio.charset.Charset;
35
import java.nio.charset.Charset;
Lines 141-146 Link Here
141
	public static final String DOT_TAR_GZ = ".tar.gz"; //$NON-NLS-1$
142
	public static final String DOT_TAR_GZ = ".tar.gz"; //$NON-NLS-1$
142
	public static final String DOT_JAR = ".jar"; //$NON-NLS-1$
143
	public static final String DOT_JAR = ".jar"; //$NON-NLS-1$
143
	public static final String DOT_ZIP = ".zip"; //$NON-NLS-1$
144
	public static final String DOT_ZIP = ".zip"; //$NON-NLS-1$
145
	public static Map<Integer, String> flagsNames = new HashMap<>();
146
147
	static {
148
		Field[] declaredFields = IDelta.class.getDeclaredFields();
149
		for (Field field : declaredFields) {
150
			try {
151
				if (Modifier.isFinal(field.getModifiers()) && Modifier.isStatic(field.getModifiers()) && Modifier.isPublic(field.getModifiers())) {
152
					Integer value = Integer.valueOf(field.getInt(null));
153
					flagsNames.put(value, field.getName());
154
				}
155
			} catch (IllegalAccessException e) {
156
				// ignore
157
			}
158
		}
159
	}
144
160
145
	public static final char VERSION_SEPARATOR = '(';
161
	public static final char VERSION_SEPARATOR = '(';
146
162
Lines 687-692 Link Here
687
	}
703
	}
688
704
689
	/**
705
	/**
706
	 * Return an int value that represents the given flag value. Returns -1 if
707
	 * the flag value cannot be determined.
708
	 *
709
	 * @param flagName the given element type
710
	 * @return an int that represents the given flag value constant.
711
	 */
712
	public static int getDeltaFlagValue(String flagName) {
713
		Class<IDelta> IDeltaClass = IDelta.class;
714
		try {
715
			Field field = IDeltaClass.getField(flagName);
716
			return field.getInt(null);
717
		} catch (SecurityException e) {
718
			// ignore
719
		} catch (IllegalArgumentException e) {
720
			// ignore
721
		} catch (NoSuchFieldException e) {
722
			// ignore
723
		} catch (IllegalAccessException e) {
724
			// ignore
725
		}
726
		return -1;
727
	}
728
729
	/**
690
	 * Return a string that represents the given element type Returns
730
	 * Return a string that represents the given element type Returns
691
	 * {@link #UNKNOWN_ELEMENT_KIND} if the element type cannot be determined.
731
	 * {@link #UNKNOWN_ELEMENT_KIND} if the element type cannot be determined.
692
	 *
732
	 *
Lines 729-869 Link Here
729
	 * @return a string that represents the given flags.
769
	 * @return a string that represents the given flags.
730
	 */
770
	 */
731
	public static String getDeltaFlagsName(int flags) {
771
	public static String getDeltaFlagsName(int flags) {
732
		switch (flags) {
772
		String fieldName = flagsNames.get(Integer.valueOf(flags));
733
			case IDelta.ABSTRACT_TO_NON_ABSTRACT:
773
		if (fieldName != null) {
734
				return "ABSTRACT_TO_NON_ABSTRACT"; //$NON-NLS-1$
774
			return fieldName;
735
			case IDelta.ANNOTATION_DEFAULT_VALUE:
736
				return "ANNOTATION_DEFAULT_VALUE"; //$NON-NLS-1$
737
			case IDelta.API_COMPONENT:
738
				return "API_COMPONENT"; //$NON-NLS-1$
739
			case IDelta.ARRAY_TO_VARARGS:
740
				return "ARRAY_TO_VARARGS"; //$NON-NLS-1$
741
			case IDelta.CHECKED_EXCEPTION:
742
				return "CHECKED_EXCEPTION"; //$NON-NLS-1$
743
			case IDelta.CLASS_BOUND:
744
				return "CLASS_BOUND"; //$NON-NLS-1$
745
			case IDelta.CLINIT:
746
				return "CLINIT"; //$NON-NLS-1$
747
			case IDelta.CONSTRUCTOR:
748
				return "CONSTRUCTOR"; //$NON-NLS-1$
749
			case IDelta.CONTRACTED_SUPERINTERFACES_SET:
750
				return "CONTRACTED_SUPERINTERFACES_SET"; //$NON-NLS-1$
751
			case IDelta.DECREASE_ACCESS:
752
				return "DECREASE_ACCESS"; //$NON-NLS-1$
753
			case IDelta.ENUM_CONSTANT:
754
				return "ENUM_CONSTANT"; //$NON-NLS-1$
755
			case IDelta.EXECUTION_ENVIRONMENT:
756
				return "EXECUTION_ENVIRONMENT"; //$NON-NLS-1$
757
			case IDelta.EXPANDED_SUPERINTERFACES_SET:
758
				return "EXPANDED_SUPERINTERFACES_SET"; //$NON-NLS-1$
759
			case IDelta.FIELD:
760
				return "FIELD"; //$NON-NLS-1$
761
			case IDelta.FIELD_MOVED_UP:
762
				return "FIELD_MOVED_UP"; //$NON-NLS-1$
763
			case IDelta.FINAL_TO_NON_FINAL:
764
				return "FINAL_TO_NON_FINAL"; //$NON-NLS-1$
765
			case IDelta.FINAL_TO_NON_FINAL_NON_STATIC:
766
				return "FINAL_TO_NON_FINAL_NON_STATIC"; //$NON-NLS-1$
767
			case IDelta.FINAL_TO_NON_FINAL_STATIC_CONSTANT:
768
				return "FINAL_TO_NON_FINAL_STATIC_CONSTANT"; //$NON-NLS-1$
769
			case IDelta.FINAL_TO_NON_FINAL_STATIC_NON_CONSTANT:
770
				return "FINAL_TO_NON_FINAL_STATIC_NON_CONSTANT"; //$NON-NLS-1$
771
			case IDelta.INCREASE_ACCESS:
772
				return "INCREASE_ACCESS"; //$NON-NLS-1$
773
			case IDelta.INTERFACE_BOUND:
774
				return "INTERFACE_BOUND"; //$NON-NLS-1$
775
			case IDelta.METHOD:
776
				return "METHOD"; //$NON-NLS-1$
777
			case IDelta.METHOD_MOVED_UP:
778
				return "METHOD_MOVED_UP"; //$NON-NLS-1$
779
			case IDelta.METHOD_WITH_DEFAULT_VALUE:
780
				return "METHOD_WITH_DEFAULT_VALUE"; //$NON-NLS-1$
781
			case IDelta.METHOD_WITHOUT_DEFAULT_VALUE:
782
				return "METHOD_WITHOUT_DEFAULT_VALUE"; //$NON-NLS-1$
783
			case IDelta.NATIVE_TO_NON_NATIVE:
784
				return "NATIVE_TO_NON_NATIVE"; //$NON-NLS-1$
785
			case IDelta.NON_ABSTRACT_TO_ABSTRACT:
786
				return "NON_ABSTRACT_TO_ABSTRACT"; //$NON-NLS-1$
787
			case IDelta.NON_FINAL_TO_FINAL:
788
				return "NON_FINAL_TO_FINAL"; //$NON-NLS-1$
789
			case IDelta.NON_NATIVE_TO_NATIVE:
790
				return "NON_NATIVE_TO_NATIVE"; //$NON-NLS-1$
791
			case IDelta.NON_STATIC_TO_STATIC:
792
				return "NON_STATIC_TO_STATIC"; //$NON-NLS-1$
793
			case IDelta.NON_SYNCHRONIZED_TO_SYNCHRONIZED:
794
				return "NON_SYNCHRONIZED_TO_SYNCHRONIZED"; //$NON-NLS-1$
795
			case IDelta.NON_TRANSIENT_TO_TRANSIENT:
796
				return "NON_TRANSIENT_TO_TRANSIENT"; //$NON-NLS-1$
797
			case IDelta.OVERRIDEN_METHOD:
798
				return "OVERRIDEN_METHOD"; //$NON-NLS-1$
799
			case IDelta.STATIC_TO_NON_STATIC:
800
				return "STATIC_TO_NON_STATIC"; //$NON-NLS-1$
801
			case IDelta.SUPERCLASS:
802
				return "SUPERCLASS"; //$NON-NLS-1$
803
			case IDelta.SYNCHRONIZED_TO_NON_SYNCHRONIZED:
804
				return "SYNCHRONIZED_TO_NON_SYNCHRONIZED"; //$NON-NLS-1$
805
			case IDelta.TYPE_CONVERSION:
806
				return "TYPE_CONVERSION"; //$NON-NLS-1$
807
			case IDelta.TRANSIENT_TO_NON_TRANSIENT:
808
				return "TRANSIENT_TO_NON_TRANSIENT"; //$NON-NLS-1$
809
			case IDelta.TYPE:
810
				return "TYPE"; //$NON-NLS-1$
811
			case IDelta.TYPE_ARGUMENTS:
812
				return "TYPE_ARGUMENTS"; //$NON-NLS-1$
813
			case IDelta.TYPE_MEMBER:
814
				return "TYPE_MEMBER"; //$NON-NLS-1$
815
			case IDelta.TYPE_PARAMETER:
816
				return "TYPE_PARAMETER"; //$NON-NLS-1$
817
			case IDelta.TYPE_PARAMETER_NAME:
818
				return "TYPE_PARAMETER_NAME"; //$NON-NLS-1$
819
			case IDelta.TYPE_PARAMETERS:
820
				return "TYPE_PARAMETERS"; //$NON-NLS-1$
821
			case IDelta.TYPE_VISIBILITY:
822
				return "TYPE_VISIBILITY"; //$NON-NLS-1$
823
			case IDelta.UNCHECKED_EXCEPTION:
824
				return "UNCHECKED_EXCEPTION"; //$NON-NLS-1$
825
			case IDelta.VALUE:
826
				return "VALUE"; //$NON-NLS-1$
827
			case IDelta.VARARGS_TO_ARRAY:
828
				return "VARARGS_TO_ARRAY"; //$NON-NLS-1$
829
			case IDelta.RESTRICTIONS:
830
				return "RESTRICTIONS"; //$NON-NLS-1$
831
			case IDelta.API_TYPE:
832
				return "API_TYPE"; //$NON-NLS-1$
833
			case IDelta.NON_VOLATILE_TO_VOLATILE:
834
				return "NON_VOLATILE_TO_VOLATILE"; //$NON-NLS-1$
835
			case IDelta.VOLATILE_TO_NON_VOLATILE:
836
				return "VOLATILE_TO_NON_VOLATILE"; //$NON-NLS-1$
837
			case IDelta.MINOR_VERSION:
838
				return "MINOR_VERSION"; //$NON-NLS-1$
839
			case IDelta.MAJOR_VERSION:
840
				return "MAJOR_VERSION"; //$NON-NLS-1$
841
			case IDelta.API_FIELD:
842
				return "API_FIELD"; //$NON-NLS-1$
843
			case IDelta.API_METHOD:
844
				return "API_METHOD"; //$NON-NLS-1$
845
			case IDelta.API_CONSTRUCTOR:
846
				return "API_CONSTRUCTOR"; //$NON-NLS-1$
847
			case IDelta.API_ENUM_CONSTANT:
848
				return "API_ENUM_CONSTANT"; //$NON-NLS-1$
849
			case IDelta.API_METHOD_WITH_DEFAULT_VALUE:
850
				return "API_METHOD_WITH_DEFAULT_VALUE"; //$NON-NLS-1$
851
			case IDelta.API_METHOD_WITHOUT_DEFAULT_VALUE:
852
				return "API_METHOD_WITHOUT_DEFAULT_VALUE"; //$NON-NLS-1$
853
			case IDelta.TYPE_ARGUMENT:
854
				return "TYPE_ARGUMENT"; //$NON-NLS-1$
855
			case IDelta.SUPER_INTERFACE_WITH_METHODS:
856
				return "SUPER_INTERFACE_WITH_METHODS"; //$NON-NLS-1$
857
			case IDelta.REEXPORTED_API_TYPE:
858
				return "REEXPORTED_API_TYPE"; //$NON-NLS-1$
859
			case IDelta.REEXPORTED_TYPE:
860
				return "REEXPORTED_TYPE"; //$NON-NLS-1$
861
			case IDelta.METHOD_MOVED_DOWN:
862
				return "METHOD_MOVED_DOWN"; //$NON-NLS-1$
863
			case IDelta.DEPRECATION:
864
				return "DEPRECATION"; //$NON-NLS-1$
865
			default:
866
				break;
867
		}
775
		}
868
		return UNKNOWN_FLAGS;
776
		return UNKNOWN_FLAGS;
869
	}
777
	}
Lines 1371-1377 Link Here
1371
	/**
1279
	/**
1372
	 * Rewrite a parameter type signature with type erasure and using the
1280
	 * Rewrite a parameter type signature with type erasure and using the
1373
	 * parameterized type bounds lookup table. For example:
1281
	 * parameterized type bounds lookup table. For example:
1374
	 * 
1282
	 *
1375
	 * <pre>
1283
	 * <pre>
1376
	 *     expand("QList&lt;QE;&gt;;", {"E" &rarr; "Ljava.lang.Object;"}) = "QList;"
1284
	 *     expand("QList&lt;QE;&gt;;", {"E" &rarr; "Ljava.lang.Object;"}) = "QList;"
1377
	 *     expand("QE;", {"E" &rarr; "Ljava.lang.Object;"}) = "Ljava.lang.Object;"
1285
	 *     expand("QE;", {"E" &rarr; "Ljava.lang.Object;"}) = "Ljava.lang.Object;"
Lines 2343-2350 Link Here
2343
					default:
2251
					default:
2344
						return arguments[0];
2252
						return arguments[0];
2345
				}
2253
				}
2254
			case IDelta.EXECUTION_ENVIRONMENT:
2255
				StringBuilder builder = new StringBuilder();
2256
				int i = 0;
2257
				for (String argument : arguments) {
2258
					if (i != 0) {
2259
						builder.append(',');
2260
					}
2261
					builder.append(argument);
2262
					i++;
2263
				}
2264
				return String.valueOf(builder);
2346
			default:
2265
			default:
2347
				break;
2348
		}
2266
		}
2349
		return EMPTY_STRING;
2267
		return EMPTY_STRING;
2350
	}
2268
	}
(-)a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/APIDeprecationReportConversionTask.java (-1 / +8 lines)
Lines 89-94 Link Here
89
			System.out.println("\t" + name + " = " + String.valueOf(attributes.getValue(name))); //$NON-NLS-1$ //$NON-NLS-2$
89
			System.out.println("\t" + name + " = " + String.valueOf(attributes.getValue(name))); //$NON-NLS-1$ //$NON-NLS-2$
90
		}
90
		}
91
91
92
		/*
93
		 * Only used in debug mode
94
		 */
95
		private void printFlagsAttribute(Attributes attributes, String name) {
96
			System.out.println("\t" + name + " = " + String.valueOf(Util.getDeltaFlagsName(Integer.valueOf(attributes.getValue(name))))); //$NON-NLS-1$ //$NON-NLS-2$
97
		}
98
92
		@Override
99
		@Override
93
		public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException {
100
		public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException {
94
			if (IApiXmlConstants.DELTA_ELEMENT_NAME.equals(name)) {
101
			if (IApiXmlConstants.DELTA_ELEMENT_NAME.equals(name)) {
Lines 107-113 Link Here
107
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_COMPATIBLE);
114
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_COMPATIBLE);
108
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_COMPONENT_ID);
115
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_COMPONENT_ID);
109
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_ELEMENT_TYPE);
116
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_ELEMENT_TYPE);
110
					printAttribute(attributes, IApiXmlConstants.ATTR_FLAGS);
117
					printFlagsAttribute(attributes, IApiXmlConstants.ATTR_FLAGS);
111
					printAttribute(attributes, IApiXmlConstants.ATTR_KEY);
118
					printAttribute(attributes, IApiXmlConstants.ATTR_KEY);
112
					printAttribute(attributes, IApiXmlConstants.ATTR_KIND);
119
					printAttribute(attributes, IApiXmlConstants.ATTR_KIND);
113
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_NEW_MODIFIERS);
120
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_NEW_MODIFIERS);
(-)a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/APIFreezeReportConversionTask.java (-110 / +18 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2008, 2013 IBM Corporation and others.
2
 * Copyright (c) 2008, 2016 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 27-36 Link Here
27
27
28
import org.apache.tools.ant.BuildException;
28
import org.apache.tools.ant.BuildException;
29
import org.apache.tools.ant.Task;
29
import org.apache.tools.ant.Task;
30
import org.eclipse.jdt.core.Signature;
31
import org.eclipse.osgi.util.NLS;
30
import org.eclipse.osgi.util.NLS;
32
import org.eclipse.pde.api.tools.internal.IApiXmlConstants;
31
import org.eclipse.pde.api.tools.internal.IApiXmlConstants;
33
import org.eclipse.pde.api.tools.internal.provisional.comparator.IDelta;
34
import org.eclipse.pde.api.tools.internal.util.Util;
32
import org.eclipse.pde.api.tools.internal.util.Util;
35
import org.xml.sax.Attributes;
33
import org.xml.sax.Attributes;
36
import org.xml.sax.SAXException;
34
import org.xml.sax.SAXException;
Lines 53-58 Link Here
53
		private Map<String, List<Entry>> map;
51
		private Map<String, List<Entry>> map;
54
		private String typename;
52
		private String typename;
55
		private int elementType;
53
		private int elementType;
54
		private String message;
55
56
		/**
56
		/**
57
		 * String component id to ArrayList of String resolver error messages
57
		 * String component id to ArrayList of String resolver error messages
58
		 */
58
		 */
Lines 70-76 Link Here
70
			if (IApiXmlConstants.ELEMENT_RESOLVER_ERRORS.equals(name)) {
70
			if (IApiXmlConstants.ELEMENT_RESOLVER_ERRORS.equals(name)) {
71
				isResolverSection = false;
71
				isResolverSection = false;
72
			} else if (IApiXmlConstants.DELTA_ELEMENT_NAME.equals(name)) {
72
			} else if (IApiXmlConstants.DELTA_ELEMENT_NAME.equals(name)) {
73
				Entry entry = new Entry(this.flags, this.elementType, this.key, this.typename, this.arguments, this.kind);
73
				Entry entry = new Entry(this.flags, this.elementType, this.key, this.typename, this.arguments, this.kind, this.message);
74
				List<Entry> list = this.map.get(this.componentID);
74
				List<Entry> list = this.map.get(this.componentID);
75
				if (list != null) {
75
				if (list != null) {
76
					list.add(entry);
76
					list.add(entry);
Lines 103-108 Link Here
103
		 */
103
		 */
104
		private void printAttribute(Attributes attributes, String name) {
104
		private void printAttribute(Attributes attributes, String name) {
105
			System.out.println("\t" + name + " = " + String.valueOf(attributes.getValue(name))); //$NON-NLS-1$ //$NON-NLS-2$
105
			System.out.println("\t" + name + " = " + String.valueOf(attributes.getValue(name))); //$NON-NLS-1$ //$NON-NLS-2$
106
		}
107
108
		/*
109
		 * Only used in debug mode
110
		 */
111
		private void printFlagsAttribute(Attributes attributes, String name) {
112
			System.out.println("\t" + name + " = " + String.valueOf(Util.getDeltaFlagsName(Integer.valueOf(attributes.getValue(name))))); //$NON-NLS-1$ //$NON-NLS-2$
106
		}
113
		}
107
114
108
		@Override
115
		@Override
Lines 139-151 Link Here
139
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_COMPATIBLE);
146
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_COMPATIBLE);
140
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_COMPONENT_ID);
147
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_COMPONENT_ID);
141
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_ELEMENT_TYPE);
148
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_ELEMENT_TYPE);
142
					printAttribute(attributes, IApiXmlConstants.ATTR_FLAGS);
149
					printFlagsAttribute(attributes, IApiXmlConstants.ATTR_FLAGS);
143
					printAttribute(attributes, IApiXmlConstants.ATTR_KEY);
150
					printAttribute(attributes, IApiXmlConstants.ATTR_KEY);
144
					printAttribute(attributes, IApiXmlConstants.ATTR_KIND);
151
					printAttribute(attributes, IApiXmlConstants.ATTR_KIND);
145
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_NEW_MODIFIERS);
152
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_NEW_MODIFIERS);
146
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_OLD_MODIFIERS);
153
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_OLD_MODIFIERS);
147
					printAttribute(attributes, IApiXmlConstants.ATTR_RESTRICTIONS);
154
					printAttribute(attributes, IApiXmlConstants.ATTR_RESTRICTIONS);
148
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_TYPE_NAME);
155
					printAttribute(attributes, IApiXmlConstants.ATTR_NAME_TYPE_NAME);
156
					printAttribute(attributes, IApiXmlConstants.ATTR_MESSAGE);
149
				}
157
				}
150
				final String value = attributes.getValue(IApiXmlConstants.ATTR_NAME_COMPONENT_ID);
158
				final String value = attributes.getValue(IApiXmlConstants.ATTR_NAME_COMPONENT_ID);
151
				if (value == null) {
159
				if (value == null) {
Lines 159-164 Link Here
159
				this.typename = attributes.getValue(IApiXmlConstants.ATTR_NAME_TYPE_NAME);
167
				this.typename = attributes.getValue(IApiXmlConstants.ATTR_NAME_TYPE_NAME);
160
				this.key = attributes.getValue(IApiXmlConstants.ATTR_KEY);
168
				this.key = attributes.getValue(IApiXmlConstants.ATTR_KEY);
161
				this.kind = attributes.getValue(IApiXmlConstants.ATTR_KIND);
169
				this.kind = attributes.getValue(IApiXmlConstants.ATTR_KIND);
170
				this.message = attributes.getValue(IApiXmlConstants.ATTR_MESSAGE);
162
			} else if (IApiXmlConstants.ELEMENT_DELTA_MESSAGE_ARGUMENTS.equals(name)) {
171
			} else if (IApiXmlConstants.ELEMENT_DELTA_MESSAGE_ARGUMENTS.equals(name)) {
163
				if (this.argumentsList == null) {
172
				if (this.argumentsList == null) {
164
					this.argumentsList = new ArrayList<>();
173
					this.argumentsList = new ArrayList<>();
Lines 183-193 Link Here
183
		String key;
192
		String key;
184
		String typeName;
193
		String typeName;
185
		String kind;
194
		String kind;
195
		String message;
186
196
187
		private static final String ADDED = "ADDED"; //$NON-NLS-1$
197
		private static final String ADDED = "ADDED"; //$NON-NLS-1$
188
		private static final String REMOVED = "REMOVED"; //$NON-NLS-1$
198
		private static final String REMOVED = "REMOVED"; //$NON-NLS-1$
189
199
190
		public Entry(int flags, int elementType, String key, String typeName, String[] arguments, String kind) {
200
		public Entry(int flags, int elementType, String key, String typeName, String[] arguments, String kind, String message) {
191
			this.flags = flags;
201
			this.flags = flags;
192
			this.key = key.replace('/', '.');
202
			this.key = key.replace('/', '.');
193
			if (typeName != null) {
203
			if (typeName != null) {
Lines 196-308 Link Here
196
			this.arguments = arguments;
206
			this.arguments = arguments;
197
			this.kind = kind;
207
			this.kind = kind;
198
			this.elementType = elementType;
208
			this.elementType = elementType;
209
			this.message = message;
199
		}
210
		}
200
211
201
		public String getDisplayString() {
212
		public String getDisplayString() {
202
			StringBuffer buffer = new StringBuffer();
213
			return this.message;
203
			if (this.typeName != null && this.typeName.length() != 0) {
204
				buffer.append(this.typeName);
205
				switch (this.flags) {
206
					case IDelta.API_METHOD_WITH_DEFAULT_VALUE:
207
					case IDelta.API_METHOD_WITHOUT_DEFAULT_VALUE:
208
					case IDelta.API_METHOD:
209
					case IDelta.METHOD:
210
					case IDelta.METHOD_WITH_DEFAULT_VALUE:
211
					case IDelta.METHOD_WITHOUT_DEFAULT_VALUE:
212
						int indexOf = this.key.indexOf('(');
213
						if (indexOf == -1) {
214
							return null;
215
						}
216
						int index = indexOf;
217
						String selector = key.substring(0, index);
218
						String descriptor = key.substring(index, key.length());
219
						buffer.append('#');
220
						buffer.append(Signature.toString(descriptor, selector, null, false, true));
221
						break;
222
					case IDelta.API_CONSTRUCTOR:
223
					case IDelta.CONSTRUCTOR:
224
						indexOf = key.indexOf('(');
225
						if (indexOf == -1) {
226
							return null;
227
						}
228
						index = indexOf;
229
						selector = key.substring(0, index);
230
						descriptor = key.substring(index, key.length());
231
						buffer.append('#');
232
						buffer.append(Signature.toString(descriptor, selector, null, false, false));
233
						break;
234
					case IDelta.FIELD:
235
					case IDelta.API_FIELD:
236
					case IDelta.ENUM_CONSTANT:
237
					case IDelta.API_ENUM_CONSTANT:
238
						buffer.append('#');
239
						buffer.append(this.key);
240
						break;
241
					case IDelta.TYPE_MEMBER:
242
					case IDelta.API_TYPE:
243
					case IDelta.REEXPORTED_TYPE:
244
					case IDelta.REEXPORTED_API_TYPE:
245
						buffer.append('.');
246
						buffer.append(this.key);
247
						break;
248
					case IDelta.DEPRECATION:
249
						switch (this.elementType) {
250
							case IDelta.ANNOTATION_ELEMENT_TYPE:
251
							case IDelta.INTERFACE_ELEMENT_TYPE:
252
							case IDelta.ENUM_ELEMENT_TYPE:
253
							case IDelta.CLASS_ELEMENT_TYPE:
254
								buffer.append('.');
255
								buffer.append(this.key);
256
								break;
257
							case IDelta.CONSTRUCTOR_ELEMENT_TYPE:
258
								indexOf = key.indexOf('(');
259
								if (indexOf == -1) {
260
									return null;
261
								}
262
								index = indexOf;
263
								selector = key.substring(0, index);
264
								descriptor = key.substring(index, key.length());
265
								buffer.append('#');
266
								buffer.append(Signature.toString(descriptor, selector, null, false, false));
267
								break;
268
							case IDelta.METHOD_ELEMENT_TYPE:
269
								indexOf = key.indexOf('(');
270
								if (indexOf == -1) {
271
									return null;
272
								}
273
								index = indexOf;
274
								selector = key.substring(0, index);
275
								descriptor = key.substring(index, key.length());
276
								buffer.append('#');
277
								buffer.append(Signature.toString(descriptor, selector, null, false, true));
278
								break;
279
							case IDelta.FIELD_ELEMENT_TYPE:
280
								buffer.append('#');
281
								buffer.append(this.key);
282
								break;
283
							default:
284
								break;
285
						}
286
						break;
287
					default:
288
						break;
289
				}
290
			} else {
291
				switch (this.flags) {
292
					case IDelta.MAJOR_VERSION:
293
						buffer.append(NLS.bind(Messages.deltaReportTask_entry_major_version, this.arguments));
294
						break;
295
					case IDelta.MINOR_VERSION:
296
						buffer.append(NLS.bind(Messages.deltaReportTask_entry_minor_version, this.arguments));
297
						break;
298
					case IDelta.API_BASELINE_ELEMENT_TYPE:
299
						buffer.append(this.key);
300
						break;
301
					default:
302
						break;
303
				}
304
			}
305
			return CommonUtilsTask.convertToHtml(String.valueOf(buffer));
306
		}
214
		}
307
215
308
		public String getDisplayKind() {
216
		public String getDisplayKind() {
(-)a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/FilterListDeltaVisitor.java (-123 / +28 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2008, 2013 IBM Corporation and others.
2
 * Copyright (c) 2008, 2016 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 101-106 Link Here
101
			case IDelta.REEXPORTED_API_TYPE:
101
			case IDelta.REEXPORTED_API_TYPE:
102
			case IDelta.REEXPORTED_TYPE:
102
			case IDelta.REEXPORTED_TYPE:
103
			case IDelta.DEPRECATION:
103
			case IDelta.DEPRECATION:
104
			case IDelta.ARRAY_TO_VARARGS:
105
			case IDelta.VALUE:
104
				buffer.append('#').append(delta.getKey());
106
				buffer.append('#').append(delta.getKey());
105
				break;
107
				break;
106
			case IDelta.MAJOR_VERSION:
108
			case IDelta.MAJOR_VERSION:
Lines 110-116 Link Here
110
			case IDelta.API_COMPONENT:
112
			case IDelta.API_COMPONENT:
111
				buffer.append(Util.getDeltaKindName(delta.getKind())).append('#').append(delta.getKey());
113
				buffer.append(Util.getDeltaKindName(delta.getKind())).append('#').append(delta.getKey());
112
				break;
114
				break;
115
			case IDelta.EXECUTION_ENVIRONMENT:
116
				buffer.append(delta.getComponentId()).append(':').append(Util.getDeltaFlagsName(delta.getFlags())).append('=').append(delta.getArguments()[0]);
117
				break;
113
			default:
118
			default:
119
				buffer.append('|').append(Util.getDeltaElementType(delta.getElementType())).append('|').append(Util.getDeltaKindName(delta.getKind())).append('|').append(Util.getDeltaFlagsName(delta.getFlags())).append('|').append(Util.getDeltaArgumentString(delta));
114
				break;
120
				break;
115
		}
121
		}
116
122
Lines 145-171 Link Here
145
							}
151
							}
146
						}
152
						}
147
						if ((this.flags & CHECK_OTHER) != 0) {
153
						if ((this.flags & CHECK_OTHER) != 0) {
148
							switch (delta.getFlags()) {
154
							if (delta.getFlags() == IDelta.OVERRIDEN_METHOD && delta.getElementType() == IDelta.INTERFACE_ELEMENT_TYPE) {
149
								case IDelta.TYPE_MEMBER:
155
								// org.eclipse.core.resources.IWorkspaceRunnable#run(..)
150
								case IDelta.METHOD:
156
								return;
151
								case IDelta.CONSTRUCTOR:
157
							}
152
								case IDelta.ENUM_CONSTANT:
158
							if (!checkExclude(delta)) {
153
								case IDelta.METHOD_WITH_DEFAULT_VALUE:
159
								super.processLeafDelta(delta);
154
								case IDelta.METHOD_WITHOUT_DEFAULT_VALUE:
155
								case IDelta.FIELD:
156
								case IDelta.TYPE:
157
								case IDelta.API_TYPE:
158
								case IDelta.API_METHOD:
159
								case IDelta.API_FIELD:
160
								case IDelta.API_CONSTRUCTOR:
161
								case IDelta.API_ENUM_CONSTANT:
162
								case IDelta.REEXPORTED_TYPE:
163
									if (!checkExclude(delta)) {
164
										super.processLeafDelta(delta);
165
									}
166
									break;
167
								default:
168
									break;
169
							}
160
							}
170
						}
161
						}
171
					} else if (Flags.isProtected(modifiers) && !RestrictionModifiers.isExtendRestriction(delta.getCurrentRestrictions())) {
162
					} else if (Flags.isProtected(modifiers) && !RestrictionModifiers.isExtendRestriction(delta.getCurrentRestrictions())) {
Lines 181-233 Link Here
181
							}
172
							}
182
						}
173
						}
183
						if ((this.flags & CHECK_OTHER) != 0) {
174
						if ((this.flags & CHECK_OTHER) != 0) {
184
							switch (delta.getFlags()) {
175
							if (!checkExclude(delta)) {
185
								case IDelta.TYPE_MEMBER:
176
								super.processLeafDelta(delta);
186
								case IDelta.METHOD:
187
								case IDelta.CONSTRUCTOR:
188
								case IDelta.ENUM_CONSTANT:
189
								case IDelta.FIELD:
190
								case IDelta.TYPE:
191
								case IDelta.API_TYPE:
192
								case IDelta.API_METHOD:
193
								case IDelta.API_FIELD:
194
								case IDelta.API_CONSTRUCTOR:
195
								case IDelta.API_ENUM_CONSTANT:
196
								case IDelta.REEXPORTED_TYPE:
197
									if (!checkExclude(delta)) {
198
										super.processLeafDelta(delta);
199
									}
200
									break;
201
								default:
202
									break;
203
							}
177
							}
204
						}
178
						}
205
					}
179
					} else if ((this.flags & CHECK_OTHER) != 0) {
206
					if (delta.getElementType() == IDelta.API_BASELINE_ELEMENT_TYPE && ((this.flags & CHECK_OTHER) != 0)) {
180
						if (!checkExclude(delta)) {
207
						switch (delta.getKind()) {
181
							super.processLeafDelta(delta);
208
							case IDelta.ADDED:
209
								if (delta.getFlags() == IDelta.API_COMPONENT) {
210
									if (!checkExclude(delta)) {
211
										super.processLeafDelta(delta);
212
									}
213
								}
214
								break;
215
							default:
216
								break;
217
						}
182
						}
218
					}
183
					}
219
					break;
184
					break;
220
				case IDelta.CHANGED:
185
				case IDelta.CHANGED:
221
					if ((this.flags & CHECK_OTHER) != 0) {
186
					if ((this.flags & CHECK_OTHER) != 0) {
222
						switch (delta.getFlags()) {
187
						if (!checkExclude(delta)) {
223
							case IDelta.MAJOR_VERSION:
188
							super.processLeafDelta(delta);
224
							case IDelta.MINOR_VERSION:
225
								if (!checkExclude(delta)) {
226
									super.processLeafDelta(delta);
227
								}
228
								break;
229
							default:
230
								break;
231
						}
189
						}
232
					}
190
					}
233
					break;
191
					break;
Lines 242-314 Link Here
242
							default:
200
							default:
243
								break;
201
								break;
244
						}
202
						}
203
					} else if ((this.flags & CHECK_OTHER) != 0) {
204
						if (!checkExclude(delta)) {
205
							super.processLeafDelta(delta);
206
						}
245
					}
207
					}
246
					break;
208
					break;
247
				default:
209
				default:
248
					break;
210
					break;
249
			}
211
			}
250
		} else if ((this.flags & CHECK_OTHER) != 0) {
212
		} else if ((this.flags & CHECK_OTHER) != 0) {
251
			switch (delta.getKind()) {
213
			if (Util.isVisible(delta.getNewModifiers())) {
252
				case IDelta.ADDED:
214
				if (!checkExclude(delta)) {
253
					switch (delta.getFlags()) {
215
					super.processLeafDelta(delta);
254
						case IDelta.TYPE_MEMBER:
216
				}
255
						case IDelta.METHOD:
256
						case IDelta.CONSTRUCTOR:
257
						case IDelta.ENUM_CONSTANT:
258
						case IDelta.METHOD_WITH_DEFAULT_VALUE:
259
						case IDelta.METHOD_WITHOUT_DEFAULT_VALUE:
260
						case IDelta.FIELD:
261
						case IDelta.TYPE:
262
						case IDelta.API_TYPE:
263
						case IDelta.API_METHOD:
264
						case IDelta.API_FIELD:
265
						case IDelta.API_CONSTRUCTOR:
266
						case IDelta.API_ENUM_CONSTANT:
267
						case IDelta.REEXPORTED_TYPE:
268
							if (Util.isVisible(delta.getNewModifiers())) {
269
								if (!checkExclude(delta)) {
270
									super.processLeafDelta(delta);
271
								}
272
							}
273
							break;
274
						default:
275
							break;
276
					}
277
					break;
278
				case IDelta.REMOVED:
279
					switch (delta.getFlags()) {
280
						case IDelta.TYPE_MEMBER:
281
						case IDelta.METHOD:
282
						case IDelta.CONSTRUCTOR:
283
						case IDelta.ENUM_CONSTANT:
284
						case IDelta.METHOD_WITH_DEFAULT_VALUE:
285
						case IDelta.METHOD_WITHOUT_DEFAULT_VALUE:
286
						case IDelta.FIELD:
287
						case IDelta.TYPE:
288
						case IDelta.API_TYPE:
289
						case IDelta.API_METHOD:
290
						case IDelta.API_FIELD:
291
						case IDelta.API_CONSTRUCTOR:
292
						case IDelta.API_ENUM_CONSTANT:
293
						case IDelta.REEXPORTED_API_TYPE:
294
						case IDelta.REEXPORTED_TYPE:
295
							if (Util.isVisible(delta.getOldModifiers())) {
296
								if (!checkExclude(delta)) {
297
									super.processLeafDelta(delta);
298
								}
299
							}
300
							break;
301
						case IDelta.API_COMPONENT:
302
							if (!checkExclude(delta)) {
303
								super.processLeafDelta(delta);
304
							}
305
							break;
306
						default:
307
							break;
308
					}
309
					break;
310
				default:
311
					break;
312
			}
217
			}
313
		}
218
		}
314
	}
219
	}
(-)a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/Messages.java (-1 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2008, 2013 IBM Corporation and others.
2
 * Copyright (c) 2008, 2016 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 32-37 Link Here
32
	public static String deltaReportTask_missingXmlFile;
32
	public static String deltaReportTask_missingXmlFile;
33
	public static String deltaReportTask_xmlFileLocationMustBeAFile;
33
	public static String deltaReportTask_xmlFileLocationMustBeAFile;
34
	public static String deltaReportTask_hmlFileLocationMustBeAFile;
34
	public static String deltaReportTask_hmlFileLocationMustBeAFile;
35
	public static String deltaReportTask_compile_time_constant;
36
	public static String deltaReportTask_entry_execution_environment;
35
37
36
	public static String fullReportTask_bundlesheader;
38
	public static String fullReportTask_bundlesheader;
37
	public static String fullReportTask_bundlesentry_even;
39
	public static String fullReportTask_bundlesentry_even;
(-)a/apitools/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/messages.properties (-1 / +3 lines)
Lines 1-5 Link Here
1
###############################################################################
1
###############################################################################
2
# Copyright (c) 2008, 2013 IBM Corporation and others.
2
# Copyright (c) 2008, 2016 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
5
# which accompanies this distribution, and is available at
Lines 47-52 Link Here
47
deltaReportTask_xmlFileLocationMustBeAFile=The xml report file {0} must be a file and not a directory
47
deltaReportTask_xmlFileLocationMustBeAFile=The xml report file {0} must be a file and not a directory
48
deltaReportTask_hmlFileLocationMustBeAFile=The html report file {0} must be a file and not a directory
48
deltaReportTask_hmlFileLocationMustBeAFile=The html report file {0} must be a file and not a directory
49
deltaReportTask_couldNotCreateSAXParser=Could not create a sax parser
49
deltaReportTask_couldNotCreateSAXParser=Could not create a sax parser
50
deltaReportTask_compile_time_constant=Compile-time constant
51
deltaReportTask_entry_execution_environment=Execution Environment
50
missing_xml_files_location=The directory that contains xml reports must be specified
52
missing_xml_files_location=The directory that contains xml reports must be specified
51
invalid_directory_name=''{0}'' is not a valid directory name
53
invalid_directory_name=''{0}'' is not a valid directory name
52
could_not_create_sax_parser=Could not create a sax parser
54
could_not_create_sax_parser=Could not create a sax parser

Return to bug 490770