Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 265844 Details for
Bug 507701
@noreference should not exclude all overriding methods from API change analysis
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix with test case
patch_with_test_case.patch (text/plain), 7.65 KB, created by
Vikas Chandra
on 2016-12-13 05:16:41 EST
(
hide
)
Description:
Fix with test case
Filename:
MIME Type:
Creator:
Vikas Chandra
Created:
2016-12-13 05:16:41 EST
Size:
7.65 KB
patch
obsolete
>diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/compatibility/MissingSinceTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/compatibility/MissingSinceTagTests.java >index cbc2c4e..4efdbdd 100644 >--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/compatibility/MissingSinceTagTests.java >+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/compatibility/MissingSinceTagTests.java >@@ -191,6 +191,25 @@ > } > > /** >+ * Tests that @noreference should not exclude all overriding methods from >+ * API change analysis - See bug 507701 >+ */ >+ private void xAddInheritedMethod2(boolean incremental) throws Exception { >+ IPath filePath = WORKSPACE_CLASSES_PACKAGE_A.append("AddInheritedMethod2.java"); //$NON-NLS-1$ >+ // expect a since tag >+ configureExpectedProblems(IDelta.METHOD_ELEMENT_TYPE, "newMethod()"); //$NON-NLS-1$ >+ performCompatibilityTest(filePath, incremental); >+ } >+ >+ public void testAddInheritedMethodI2() throws Exception { >+ xAddInheritedMethod2(true); >+ } >+ >+ public void testAddInheritedMethodF2() throws Exception { >+ xAddInheritedMethod2(false); >+ } >+ >+ /** > * Tests adding a non-visible method > */ > private void xAddNonVisibleMethod(boolean incremental) throws Exception { >diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/baseline/bundle.a/src/a/since/AddInheritedBase.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/baseline/bundle.a/src/a/since/AddInheritedBase.java >new file mode 100644 >index 0000000..7600390 >--- /dev/null >+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/baseline/bundle.a/src/a/since/AddInheritedBase.java >@@ -0,0 +1,24 @@ >+/******************************************************************************* >+ * 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 >+ *******************************************************************************/ >+package a.since; >+ >+/** >+ * >+ */ >+public class AddInheritedBase { >+ /** >+ * >+ * @noreference >+ */ >+ public void newMethod() { >+ } >+ >+} >diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/baseline/bundle.a/src/a/since/AddInheritedMethod2.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/baseline/bundle.a/src/a/since/AddInheritedMethod2.java >new file mode 100644 >index 0000000..0d06c69 >--- /dev/null >+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/baseline/bundle.a/src/a/since/AddInheritedMethod2.java >@@ -0,0 +1,18 @@ >+/******************************************************************************* >+ * 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 >+ *******************************************************************************/ >+package a.since; >+ >+/** >+ * >+ */ >+public class AddInheritedMethod2 extends AddInheritedBase{ >+ >+} >diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/compat/since/AddInheritedBase.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/compat/since/AddInheritedBase.java >new file mode 100644 >index 0000000..7600390 >--- /dev/null >+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/compat/since/AddInheritedBase.java >@@ -0,0 +1,24 @@ >+/******************************************************************************* >+ * 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 >+ *******************************************************************************/ >+package a.since; >+ >+/** >+ * >+ */ >+public class AddInheritedBase { >+ /** >+ * >+ * @noreference >+ */ >+ public void newMethod() { >+ } >+ >+} >diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/compat/since/AddInheritedMethod2.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/compat/since/AddInheritedMethod2.java >new file mode 100644 >index 0000000..ba75c90 >--- /dev/null >+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/compat/since/AddInheritedMethod2.java >@@ -0,0 +1,20 @@ >+/******************************************************************************* >+ * 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 >+ *******************************************************************************/ >+package a.since; >+ >+/** >+ * >+ */ >+public class AddInheritedMethod2 extends AddInheritedBase{ >+ public void newMethod() { >+ } >+ >+} >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 7257030..4790310 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 >@@ -2104,6 +2104,18 @@ > } else { > int access3 = method3.getModifiers(); > if (Flags.isPublic(access3) || Flags.isProtected(access3)) { >+ IApiAnnotations apiAnnotations = null; >+ if (apiDescription != null) { >+ apiAnnotations = apiDescription.resolveAnnotations(method3.getHandle()); >+ } >+ if (apiAnnotations != null) { >+ int restrictions = apiAnnotations.getRestrictions(); >+ // if overriding no reference method, break the loop and report method addition >+ if (RestrictionModifiers.isReferenceRestriction(restrictions)) { >+ found = false; >+ break loop; >+ } >+ } > // method has been move up in the > // hierarchy - report the delta and > // abort loop >@@ -2153,6 +2165,21 @@ > } else { > int access3 = method3.getModifiers(); > if (Flags.isPublic(access3) || Flags.isProtected(access3)) { >+ IApiAnnotations apiAnnotations = null; >+ if (apiDescription != null) { >+ apiAnnotations = apiDescription.resolveAnnotations(method3.getHandle()); >+ } >+ if (apiAnnotations != null) { >+ int restrictions = apiAnnotations.getRestrictions(); >+ // if overriding no reference >+ // method, break the loop and >+ // report method addition >+ if (RestrictionModifiers.isReferenceRestriction(restrictions)) { >+ found = false; >+ break loop; >+ } >+ >+ } > // method has been pushed down in > // the hierarchy - report the delta > // and abort loop
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 507701
:
265830
| 265844