Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Rennie2014-03-17 14:57:27 +0000
committerMike Rennie2014-03-17 14:57:27 +0000
commitf3a53a4d0fceb0f4ea727928a79242786da55e80 (patch)
treef64b0727c68f0fa1256c2d6993e050f7a1af340b
parent88ec304becf6e8a11ffef46bbd2daa21939d0374 (diff)
parentabb117132844c0b2dc8007cd51dfe327059ca61a (diff)
downloadeclipse.pde.ui-I20140318-0830.tar.gz
eclipse.pde.ui-I20140318-0830.tar.xz
eclipse.pde.ui-I20140318-0830.zip
Merge remote-tracking branch 'origin/BETA_JAVA8_LUNA'I20140318-0830
-rw-r--r--apitools/org.eclipse.pde.api.tools.ee.feature/feature.xml8
-rw-r--r--apitools/org.eclipse.pde.api.tools.ee.javase18/.classpath7
-rw-r--r--apitools/org.eclipse.pde.api.tools.ee.javase18/.project28
-rw-r--r--apitools/org.eclipse.pde.api.tools.ee.javase18/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--apitools/org.eclipse.pde.api.tools.ee.javase18/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--apitools/org.eclipse.pde.api.tools.ee.javase18/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--apitools/org.eclipse.pde.api.tools.ee.javase18/META-INF/MANIFEST.MF8
-rw-r--r--apitools/org.eclipse.pde.api.tools.ee.javase18/OSGI-INF/l10n/bundle.properties3
-rw-r--r--apitools/org.eclipse.pde.api.tools.ee.javase18/about.html28
-rw-r--r--apitools/org.eclipse.pde.api.tools.ee.javase18/build.properties17
-rw-r--r--apitools/org.eclipse.pde.api.tools.ee.javase18/pom.xml24
-rw-r--r--apitools/org.eclipse.pde.api.tools.ee.javase18/src/org/eclipse/pde/api/tools/internal/api_stubs/JavaSE-1.8.zipbin0 -> 1988538 bytes
-rw-r--r--apitools/org.eclipse.pde.api.tools.generator/API Tools EEGenerator.launch16
-rw-r--r--apitools/org.eclipse.pde.api.tools.generator/META-INF/MANIFEST.MF2
-rw-r--r--apitools/org.eclipse.pde.api.tools.generator/profiles/JavaSE-1.8/JavaSE-1.8.profile202
-rw-r--r--apitools/org.eclipse.pde.api.tools.generator/profiles/JavaSE-1.8/whiteList.txt8
-rw-r--r--apitools/org.eclipse.pde.api.tools.generator/profiles/configuration.properties40
-rw-r--r--apitools/org.eclipse.pde.api.tools.generator/src/org/eclipse/pde/api/tools/generator/EEGenerator.java203
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/META-INF/MANIFEST.MF3
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/ApiTestingEnvironment.java5
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/java8/Java8TypeAnnotationTests.java219
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidInterfaceMethodTagTests.java20
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidJava8InterfaceMethodTagTests.java70
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidMethodTagTests.java20
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/TagTest.java12
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidJava8IntefaceMethodTagTests.java65
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidMethodTagTests.java17
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/TagScannerTests.java54
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/TestSuiteHelper.java4
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/tests/ApiToolsPluginTestSuite.java7
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/tests/util/ProjectUtils.java14
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/util/tests/ApiBaselineManagerTests.java4
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/util/tests/ApiDescriptionProcessorTests.java4
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test1.java35
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test2.java28
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test3.java33
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test4.java22
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test5.java21
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test6.java25
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/tags/interface/test1.java33
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/tags/interface/valid/test1.java37
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/.classpath7
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/.project34
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/META-INF/MANIFEST.MF8
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/build.properties14
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/src/a/b/c/Dummy.txt0
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-source/a/b/c/TestJava8DefaultMethod1.java28
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-source/a/b/c/TestJava8DefaultMethod2.java27
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-source/a/b/c/TestJava8DefaultMethod3.java29
-rw-r--r--apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/completion/APIToolsJavadocCompletionProposalComputer.java8
-rw-r--r--apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/ApiMarkerResolutionGenerator.java8
-rw-r--r--apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/JavadocTagOperation.java4
-rw-r--r--apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/NodeFinder.java2
-rw-r--r--apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/RemoveUnsupportedAnnotationOperation.java2
-rw-r--r--apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/RemoveUnsupportedTagOperation.java4
-rw-r--r--apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/UpdateSinceTagOperation.java4
-rw-r--r--apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/preferences/ApiErrorsWarningsConfigurationBlock.java8
-rw-r--r--apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/preferences/PreferenceMessages.java3
-rw-r--r--apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/preferences/preferencemessages.properties3
-rw-r--r--apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/wizards/JavadocConversionPage.java2
-rw-r--r--apitools/org.eclipse.pde.api.tools/META-INF/MANIFEST.MF2
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/ApiDescriptionProcessor.java4
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/ApiPluginPreferenceInitializer.java3
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/CoreMessages.java3
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/JavadocTagManager.java3
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/AbstractIllegalTypeReference.java4
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/AbstractProblemDetector.java4
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/BaseApiAnalyzer.java50
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/BuilderMessages.java3
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/ReferenceExtractor.java24
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/TagValidator.java6
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/buildermessages.properties3
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/SignatureDecoder.java6
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/coremessages.properties3
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/BundleComponent.java6
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/TypeStructureBuilder.java140
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/problems/ApiProblemFactory.java8
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/problems/problemmessages.properties5
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/ProfileModifiers.java36
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/problems/IApiProblem.java10
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/problems/IApiProblemTypes.java3
-rw-r--r--apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/scanner/TagScanner.java18
-rw-r--r--pom.xml3
84 files changed, 1564 insertions, 343 deletions
diff --git a/apitools/org.eclipse.pde.api.tools.ee.feature/feature.xml b/apitools/org.eclipse.pde.api.tools.ee.feature/feature.xml
index 8755a89bea..24e56bead3 100644
--- a/apitools/org.eclipse.pde.api.tools.ee.feature/feature.xml
+++ b/apitools/org.eclipse.pde.api.tools.ee.feature/feature.xml
@@ -103,4 +103,12 @@
version="0.0.0"
fragment="true"/>
+ <plugin
+ id="org.eclipse.pde.api.tools.ee.javase18"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"
+ unpack="false"/>
+
</feature>
diff --git a/apitools/org.eclipse.pde.api.tools.ee.javase18/.classpath b/apitools/org.eclipse.pde.api.tools.ee.javase18/.classpath
new file mode 100644
index 0000000000..2fbb7a23e1
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.ee.javase18/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/apitools/org.eclipse.pde.api.tools.ee.javase18/.project b/apitools/org.eclipse.pde.api.tools.ee.javase18/.project
new file mode 100644
index 0000000000..42851b4567
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.ee.javase18/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.pde.api.tools.ee.javase18</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/apitools/org.eclipse.pde.api.tools.ee.javase18/.settings/org.eclipse.core.resources.prefs b/apitools/org.eclipse.pde.api.tools.ee.javase18/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000000..99f26c0203
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.ee.javase18/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/apitools/org.eclipse.pde.api.tools.ee.javase18/.settings/org.eclipse.core.runtime.prefs b/apitools/org.eclipse.pde.api.tools.ee.javase18/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000000..c522e1f4ae
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.ee.javase18/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/apitools/org.eclipse.pde.api.tools.ee.javase18/.settings/org.eclipse.jdt.core.prefs b/apitools/org.eclipse.pde.api.tools.ee.javase18/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..2e5a376f63
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.ee.javase18/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.3
diff --git a/apitools/org.eclipse.pde.api.tools.ee.javase18/META-INF/MANIFEST.MF b/apitools/org.eclipse.pde.api.tools.ee.javase18/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..d3c4e3b094
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.ee.javase18/META-INF/MANIFEST.MF
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.pde.api.tools.ee.javase18
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: %Bundle-Vendor
+Fragment-Host: org.eclipse.pde.api.tools;bundle-version="1.0.501"
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/apitools/org.eclipse.pde.api.tools.ee.javase18/OSGI-INF/l10n/bundle.properties b/apitools/org.eclipse.pde.api.tools.ee.javase18/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 0000000000..126aa0f6e9
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.ee.javase18/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.pde.api.tools.ee.javase18
+Bundle-Vendor = Eclipse.org
+Bundle-Name = JavaSE-1.8 Execution Environment Description \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools.ee.javase18/about.html b/apitools/org.eclipse.pde.api.tools.ee.javase18/about.html
new file mode 100644
index 0000000000..d5033fa425
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.ee.javase18/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>February 27, 2014</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools.ee.javase18/build.properties b/apitools/org.eclipse.pde.api.tools.ee.javase18/build.properties
new file mode 100644
index 0000000000..0d436ad4ab
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.ee.javase18/build.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2014 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
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/l10n/bundle.properties,\
+ OSGI-INF/,\
+ about.html
diff --git a/apitools/org.eclipse.pde.api.tools.ee.javase18/pom.xml b/apitools/org.eclipse.pde.api.tools.ee.javase18/pom.xml
new file mode 100644
index 0000000000..af4aec944f
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.ee.javase18/pom.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2014 Eclipse Foundation and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Distribution License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/org/documents/edl-v10.php
+
+ Contributors:
+ Igor Fedorenko - initial implementation
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>eclipse.pde.ui</artifactId>
+ <groupId>eclipse.pde.ui</groupId>
+ <version>4.4.0-SNAPSHOT</version>
+ <relativePath>../../</relativePath>
+ </parent>
+ <groupId>org.eclipse.pde</groupId>
+ <artifactId>org.eclipse.pde.api.tools.ee.javase18</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/apitools/org.eclipse.pde.api.tools.ee.javase18/src/org/eclipse/pde/api/tools/internal/api_stubs/JavaSE-1.8.zip b/apitools/org.eclipse.pde.api.tools.ee.javase18/src/org/eclipse/pde/api/tools/internal/api_stubs/JavaSE-1.8.zip
new file mode 100644
index 0000000000..d35f64f7b0
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.ee.javase18/src/org/eclipse/pde/api/tools/internal/api_stubs/JavaSE-1.8.zip
Binary files differ
diff --git a/apitools/org.eclipse.pde.api.tools.generator/API Tools EEGenerator.launch b/apitools/org.eclipse.pde.api.tools.generator/API Tools EEGenerator.launch
new file mode 100644
index 0000000000..ba9915d4dc
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.generator/API Tools EEGenerator.launch
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.pde.api.tools.generator/src/org/eclipse/pde/api/tools/generator/EEGenerator.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.debug.ui.ATTR_CAPTURE_IN_FILE" value="${workspace_loc:/org.eclipse.pde.api.tools.generator/profiles/debug-output.txt}"/>
+<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.pde.api.tools.generator.EEGenerator"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-output ${folder_prompt} -config ${file_prompt} -EEs JavaSE-1.8"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.pde.api.tools.generator"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-DDEBUG=true"/>
+</launchConfiguration>
diff --git a/apitools/org.eclipse.pde.api.tools.generator/META-INF/MANIFEST.MF b/apitools/org.eclipse.pde.api.tools.generator/META-INF/MANIFEST.MF
index b80bc9e364..22e912a273 100644
--- a/apitools/org.eclipse.pde.api.tools.generator/META-INF/MANIFEST.MF
+++ b/apitools/org.eclipse.pde.api.tools.generator/META-INF/MANIFEST.MF
@@ -5,7 +5,7 @@ Bundle-SymbolicName: org.eclipse.pde.api.tools.generator;singleton:=true
Bundle-Version: 1.0.200.qualifier
Bundle-Vendor: %providerName
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Require-Bundle: org.objectweb.asm;bundle-version="3.3.1",
+Require-Bundle: org.objectweb.asm;bundle-version="[5.0.0,6.0.0)",
org.eclipse.pde.api.tools;bundle-version="1.0.600",
org.eclipse.jdt.core;bundle-version="3.8.1",
org.eclipse.core.runtime;bundle-version="3.8.0"
diff --git a/apitools/org.eclipse.pde.api.tools.generator/profiles/JavaSE-1.8/JavaSE-1.8.profile b/apitools/org.eclipse.pde.api.tools.generator/profiles/JavaSE-1.8/JavaSE-1.8.profile
new file mode 100644
index 0000000000..894a9ecbfa
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.generator/profiles/JavaSE-1.8/JavaSE-1.8.profile
@@ -0,0 +1,202 @@
+###############################################################################
+# Copyright (c) 2009, 2013 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
+###############################################################################
+org.osgi.framework.system.packages = \
+ javax.accessibility,\
+ javax.activation,\
+ javax.activity,\
+ javax.annotation,\
+ javax.annotation.processing,\
+ javax.crypto,\
+ javax.crypto.interfaces,\
+ javax.crypto.spec,\
+ javax.imageio,\
+ javax.imageio.event,\
+ javax.imageio.metadata,\
+ javax.imageio.plugins.bmp,\
+ javax.imageio.plugins.jpeg,\
+ javax.imageio.spi,\
+ javax.imageio.stream,\
+ javax.jws,\
+ javax.jws.soap,\
+ javax.lang.model,\
+ javax.lang.model.element,\
+ javax.lang.model.type,\
+ javax.lang.model.util,\
+ javax.management,\
+ javax.management.loading,\
+ javax.management.modelmbean,\
+ javax.management.monitor,\
+ javax.management.openmbean,\
+ javax.management.relation,\
+ javax.management.remote,\
+ javax.management.remote.rmi,\
+ javax.management.timer,\
+ javax.naming,\
+ javax.naming.directory,\
+ javax.naming.event,\
+ javax.naming.ldap,\
+ javax.naming.spi,\
+ javax.net,\
+ javax.net.ssl,\
+ javax.print,\
+ javax.print.attribute,\
+ javax.print.attribute.standard,\
+ javax.print.event,\
+ javax.rmi,\
+ javax.rmi.CORBA,\
+ javax.rmi.ssl,\
+ javax.script,\
+ javax.security.auth,\
+ javax.security.auth.callback,\
+ javax.security.auth.kerberos,\
+ javax.security.auth.login,\
+ javax.security.auth.spi,\
+ javax.security.auth.x500,\
+ javax.security.cert,\
+ javax.security.sasl,\
+ javax.sound.midi,\
+ javax.sound.midi.spi,\
+ javax.sound.sampled,\
+ javax.sound.sampled.spi,\
+ javax.sql,\
+ javax.sql.rowset,\
+ javax.sql.rowset.serial,\
+ javax.sql.rowset.spi,\
+ javax.swing,\
+ javax.swing.border,\
+ javax.swing.colorchooser,\
+ javax.swing.event,\
+ javax.swing.filechooser,\
+ javax.swing.plaf,\
+ javax.swing.plaf.basic,\
+ javax.swing.plaf.metal,\
+ javax.swing.plaf.multi,\
+ javax.swing.plaf.nimbus,\
+ javax.swing.plaf.synth,\
+ javax.swing.table,\
+ javax.swing.text,\
+ javax.swing.text.html,\
+ javax.swing.text.html.parser,\
+ javax.swing.text.rtf,\
+ javax.swing.tree,\
+ javax.swing.undo,\
+ javax.tools,\
+ javax.transaction,\
+ javax.transaction.xa,\
+ javax.xml,\
+ javax.xml.bind,\
+ javax.xml.bind.annotation,\
+ javax.xml.bind.annotation.adapters,\
+ javax.xml.bind.attachment,\
+ javax.xml.bind.helpers,\
+ javax.xml.bind.util,\
+ javax.xml.crypto,\
+ javax.xml.crypto.dom,\
+ javax.xml.crypto.dsig,\
+ javax.xml.crypto.dsig.dom,\
+ javax.xml.crypto.dsig.keyinfo,\
+ javax.xml.crypto.dsig.spec,\
+ javax.xml.datatype,\
+ javax.xml.namespace,\
+ javax.xml.parsers,\
+ javax.xml.soap,\
+ javax.xml.stream,\
+ javax.xml.stream.events,\
+ javax.xml.stream.util,\
+ javax.xml.transform,\
+ javax.xml.transform.dom,\
+ javax.xml.transform.sax,\
+ javax.xml.transform.stax,\
+ javax.xml.transform.stream,\
+ javax.xml.validation,\
+ javax.xml.ws,\
+ javax.xml.ws.handler,\
+ javax.xml.ws.handler.soap,\
+ javax.xml.ws.http,\
+ javax.xml.ws.soap,\
+ javax.xml.ws.spi,\
+ javax.xml.ws.spi.http,\
+ javax.xml.ws.wsaddressing,\
+ javax.xml.xpath,\
+ org.ietf.jgss,\
+ org.omg.CORBA,\
+ org.omg.CORBA_2_3,\
+ org.omg.CORBA_2_3.portable,\
+ org.omg.CORBA.DynAnyPackage,\
+ org.omg.CORBA.ORBPackage,\
+ org.omg.CORBA.portable,\
+ org.omg.CORBA.TypeCodePackage,\
+ org.omg.CosNaming,\
+ org.omg.CosNaming.NamingContextExtPackage,\
+ org.omg.CosNaming.NamingContextPackage,\
+ org.omg.Dynamic,\
+ org.omg.DynamicAny,\
+ org.omg.DynamicAny.DynAnyFactoryPackage,\
+ org.omg.DynamicAny.DynAnyPackage,\
+ org.omg.IOP,\
+ org.omg.IOP.CodecFactoryPackage,\
+ org.omg.IOP.CodecPackage,\
+ org.omg.Messaging,\
+ org.omg.PortableInterceptor,\
+ org.omg.PortableInterceptor.ORBInitInfoPackage,\
+ org.omg.PortableServer,\
+ org.omg.PortableServer.CurrentPackage,\
+ org.omg.PortableServer.POAManagerPackage,\
+ org.omg.PortableServer.POAPackage,\
+ org.omg.PortableServer.portable,\
+ org.omg.PortableServer.ServantLocatorPackage,\
+ org.omg.SendingContext,\
+ org.omg.stub.java.rmi,\
+ org.w3c.dom,\
+ org.w3c.dom.bootstrap,\
+ org.w3c.dom.css,\
+ org.w3c.dom.events,\
+ org.w3c.dom.html,\
+ org.w3c.dom.ls,\
+ org.w3c.dom.ranges,\
+ org.w3c.dom.stylesheets,\
+ org.w3c.dom.traversal,\
+ org.w3c.dom.views,\
+ org.w3c.dom.xpath,\
+ org.xml.sax,\
+ org.xml.sax.ext,\
+ org.xml.sax.helpers
+org.osgi.framework.bootdelegation = \
+ javax.*,\
+ org.ietf.jgss,\
+ org.omg.*,\
+ org.w3c.*,\
+ org.xml.*,\
+ sun.*,\
+ com.sun.*
+org.osgi.framework.executionenvironment = \
+ OSGi/Minimum-1.0,\
+ OSGi/Minimum-1.1,\
+ OSGi/Minimum-1.2,\
+ JRE-1.1,\
+ J2SE-1.2,\
+ J2SE-1.3,\
+ J2SE-1.4,\
+ J2SE-1.5,\
+ JavaSE-1.6,\
+ JavaSE-1.7,\
+ JavaSE-1.8
+org.osgi.framework.system.capabilities = \
+ osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0, 1.1, 1.2",\
+ osgi.ee; osgi.ee="JRE"; version:List<Version>="1.0, 1.1",\
+ osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8"
+osgi.java.profile.name = JavaSE-1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools.generator/profiles/JavaSE-1.8/whiteList.txt b/apitools/org.eclipse.pde.api.tools.generator/profiles/JavaSE-1.8/whiteList.txt
new file mode 100644
index 0000000000..d512ff74a2
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.generator/profiles/JavaSE-1.8/whiteList.txt
@@ -0,0 +1,8 @@
+org.w3c.dom.css
+org.w3c.dom.events
+org.w3c.dom.html
+org.w3c.dom.ls
+org.w3c.dom.ranges
+org.w3c.dom.stylesheets
+org.w3c.dom.traversal
+org.w3c.dom.views \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools.generator/profiles/configuration.properties b/apitools/org.eclipse.pde.api.tools.generator/profiles/configuration.properties
index 6c8bc26063..141226d53d 100644
--- a/apitools/org.eclipse.pde.api.tools.generator/profiles/configuration.properties
+++ b/apitools/org.eclipse.pde.api.tools.generator/profiles/configuration.properties
@@ -1,5 +1,5 @@
####################################################################################################################
-# Copyright (c) 2012 IBM Corporation and others.
+# Copyright (c) 2013, 2014 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
@@ -7,11 +7,8 @@
#
# Contributors:
# IBM Corporation - initial API and implementation
-####################################################################################################################
-####################################################################################################################
# Each EE description needs the following to be properly set up
-# - jreLib: absolute path to the directory from which all jar files (including inside sub-folders) will be retrieved. This
-# directory must be in the lib directory within the /jre root sub-directory to work properly
+# - jreLib: absolute path to the directory from which all jar files (including inside sub-folders) will be retrieved
# - osgiProfile: the absolute path to the OSGi *.profile file from which the list of packages is extracted
# - jreDoc: the absolute path to the archived (*.zip) file that corresponds to the documentation for the given JRE
# - jreUrl: in case the zip doc is not available, a URL pointing to the online documentation can also be used
@@ -23,13 +20,13 @@
#
# EXAMPLE - Settings for generating a 1.4 EE description
#
-# J2SE-1.4.jreLib=c:\vms\jdk1.4.2_35\jre\lib
-# J2SE-1.4.osgiProfile=c:\OSGi_profiles\J2SE-1.4\J2SE-1.4.profile
-# J2SE-1.4.jreDoc=c:\OSGi_profiles\J2SE-1.4\j2sdk-1_4_2-doc.zip
+# J2SE-1.4.jreLib=c:/vms/jdk1.4.2_35/lib
+# J2SE-1.4.osgiProfile=c:/OSGi_profiles/J2SE-1.4/J2SE-1.4.profile
+# J2SE-1.4.jreDoc=c:/OSGi_profiles/J2SE-1.4/j2sdk-1_4_2-doc.zip
# J2SE-1.4.jreURL=http://docs.oracle.com/javase/1.4.2/
# J2SE-1.4.docRoot=docs/api/
-# J2SE-1.4.cacheLocation=c:\Users\usr\OSGi_profiles\cache
-# J2SE-1.4.whiteList=c:\OSGi_profiles\J2SE-1.4\whiteList.txt
+# J2SE-1.4.cacheLocation=c:/Users/usr/OSGi_profiles/cache
+# J2SE-1.4.whiteList=c:/OSGi_profiles/J2SE-1.4/whiteList.txt
#
####################################################################################################################
@@ -71,10 +68,10 @@
############# JDK 1.5 configuration #############
#J2SE-1.5.jreLib=
-#2SE-1.5.osgiProfile=
+#J2SE-1.5.osgiProfile=
#J2SE-1.5.jreDoc=
-#J2SE-1.5.jreURL=http://docs.oracle.com/javase/1.5.0/
-#J2SE-1.5.docRoot=docs/api/
+#J2SE-1.5.jreURL=
+#J2SE-1.5.docRoot=
#J2SE-1.5.cacheLocation=
#J2SE-1.5.whiteList=
@@ -82,8 +79,8 @@
#JavaSE-1.6.jreLib=
#JavaSE-1.6.osgiProfile=
#JavaSE-1.6.jreDoc=
-#JavaSE-1.6.jreURL=http://docs.oracle.com/javase/6/
-#JavaSE-1.6.docRoot=docs/api/
+#JavaSE-1.6.jreURL=
+#JavaSE-1.6.docRoot=
#JavaSE-1.6.cacheLocation=
#JavaSE-1.6.whiteList=
@@ -91,11 +88,20 @@
#JavaSE-1.7.jreLib=
#JavaSE-1.7.osgiProfile=
#JavaSE-1.7.jreDoc=
-#JavaSE-1.7.jreURL=http://docs.oracle.com/javase/7/
-#JavaSE-1.7.docRoot=docs/api/
+#JavaSE-1.7.jreURL=
+#JavaSE-1.7.docRoot=
#JavaSE-1.7.cacheLocation=
#JavaSE-1.7.whiteList=
+############# JDK 1.8 configuration #############
+#JavaSE-1.8.jreLib=
+#JavaSE-1.8.osgiProfile=
+#JavaSE-1.8.jreDoc=
+#JavaSE-1.8.jreURL=
+#JavaSE-1.8.docRoot=
+#JavaSE-1.8.cacheLocation=
+#JavaSE-1.8.whiteList=
+
############# CDC 1.0 configuration #############
#CDC-1.0_Foundation-1.0.jreLib=
#CDC-1.0_Foundation-1.0.osgiProfile=
diff --git a/apitools/org.eclipse.pde.api.tools.generator/src/org/eclipse/pde/api/tools/generator/EEGenerator.java b/apitools/org.eclipse.pde.api.tools.generator/src/org/eclipse/pde/api/tools/generator/EEGenerator.java
index ef6802451d..fa32d11059 100644
--- a/apitools/org.eclipse.pde.api.tools.generator/src/org/eclipse/pde/api/tools/generator/EEGenerator.java
+++ b/apitools/org.eclipse.pde.api.tools.generator/src/org/eclipse/pde/api/tools/generator/EEGenerator.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2011, 2013 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * Copyright (c) 2011, 2014 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -62,11 +62,10 @@ import org.eclipse.pde.api.tools.internal.IApiXmlConstants;
import org.eclipse.pde.api.tools.internal.provisional.ProfileModifiers;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.Attribute;
-import org.objectweb.asm.ClassAdapter;
import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.FieldVisitor;
-import org.objectweb.asm.MethodAdapter;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.w3c.dom.DOMException;
@@ -87,6 +86,7 @@ import org.w3c.dom.Element;
* <li>J2SE-1.5,</li>
* <li>JavaSE-1.6,</li>
* <li>JavaSE-1.7,</li>
+ * <li>JavaSE-1.8,</li>
* <li>CDC-1.0_Foundation-1.0,</li>
* <li>CDC-1.1_Foundation-1.1,</li>
* <li>OSGi_Minimum-1.0</li>,
@@ -95,9 +95,10 @@ import org.w3c.dom.Element;
* </ol>
* This can be called using: -output c:/EE_descriptions -config
* C:\OSGi_profiles\configuration.properties -EEs
- * JRE-1.1,J2SE-1.2,J2SE-1.3,J2SE-1.4,J2SE-1.5,JavaSE-1.6,JavaSE-1.7,CDC-
- * 1.0_Foundation-1.0,CDC-1.1_Foundation-1.1,OSGi_Minimum-1.0,OSGi_Minimum-1.1,OSGi_Min
- * i m u m - 1 . 2
+ * JRE-1.1,J2SE-1.2,J2SE-1.3,J2SE-
+ * 1.4,J2SE-1.5,JavaSE-1.6,JavaSE-1.7,JavaSE-1.8,CDC-
+ * 1.0_Foundation-1.0,CDC-1.1_Foundation-1.1,OSGi_Minimum-1.0,OSGi_Minimum-1.1,OSGi_Minimum-1.
+ * 2
*/
public class EEGenerator {
static class AbstractNode {
@@ -126,7 +127,6 @@ public class EEGenerator {
}
this.addedProfileValue = value;
}
-
public void setRemovedProfileValue(int value) {
if (this.removedProfileValue != -1) {
System.err.println("Remove profile value is already set"); //$NON-NLS-1$
@@ -134,7 +134,6 @@ public class EEGenerator {
this.removedProfileValue = value;
}
}
-
static class Field extends AbstractNode implements Comparable<Field> {
char[] name;
char[] type;
@@ -145,12 +144,9 @@ public class EEGenerator {
this.type = CharOperation.replaceOnCopy(ftype, '/', '.');
}
}
-
- @Override
public int compareTo(Field field) {
return CharOperation.compareTo(this.name, field.name);
}
-
@Override
public boolean equals(Object obj) {
if (this == obj) {
@@ -201,7 +197,6 @@ public class EEGenerator {
return String.valueOf(builder);
}
}
-
static class Method extends AbstractNode implements Comparable<Method> {
public static final char[] NO_GENERIC_SIGNATURE = new char[0];
char[] genericSignature;
@@ -219,8 +214,6 @@ public class EEGenerator {
this.genericSignature = genericsig;
}
}
-
- @Override
public int compareTo(Method method) {
int compare = CharOperation.compareTo(this.selector, method.selector);
if (compare == 0) {
@@ -300,14 +293,12 @@ public class EEGenerator {
public Package(String pname) {
this.name = pname;
}
-
public void addType(Type type) {
if (this.types == null) {
this.types = new ArrayList<Type>();
}
this.types.add(type);
}
-
public void collectTypes(Map<String, Type> result) {
Collections.sort(this.types);
for (Iterator<Type> iterator2 = this.types.iterator(); iterator2.hasNext();) {
@@ -316,12 +307,9 @@ public class EEGenerator {
result.put(typeName, type);
}
}
-
- @Override
public int compareTo(Package package1) {
return this.name.compareTo(package1.name);
}
-
@Override
public boolean equals(Object obj) {
if (this == obj) {
@@ -354,7 +342,6 @@ public class EEGenerator {
}
return null;
}
-
@Override
public int hashCode() {
final int prime = 31;
@@ -362,7 +349,6 @@ public class EEGenerator {
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
-
public void persistAsClassStubsForZip(ZipOutputStream zipOutputStream, ProfileInfo info) throws IOException {
if (this.types == null) {
return;
@@ -379,7 +365,6 @@ public class EEGenerator {
}
}
}
-
public void persistXML(Document document, Element element, String OSGiProfileName) {
Element pkg = document.createElement(IApiXmlConstants.ELEMENT_PACKAGE);
pkg.setAttribute(IApiXmlConstants.ATTR_NAME, this.name);
@@ -392,11 +377,9 @@ public class EEGenerator {
iterator2.next().persistXML(document, pkg, OSGiProfileName);
}
}
-
public int size() {
return this.types == null ? 0 : this.types.size();
}
-
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
@@ -479,7 +462,6 @@ public class EEGenerator {
}
return knownPackages;
}
-
private static Set<String> initializeWhiteList(String fileName) {
if (fileName == null) {
return Collections.emptySet();
@@ -792,7 +774,6 @@ public class EEGenerator {
}
long time = System.currentTimeMillis();
this.allFiles = Util.getAllFiles(new File(this.JRElib), new FileFilter() {
- @Override
public boolean accept(File pathname) {
return pathname.isDirectory() || pathname.getName().toLowerCase().endsWith(".jar"); //$NON-NLS-1$
}
@@ -820,7 +801,8 @@ public class EEGenerator {
try {
for (Enumeration<? extends ZipEntry> enumeration = zipFile.entries(); enumeration.hasMoreElements();) {
ZipEntry zipEntry = enumeration.nextElement();
- if (!zipEntry.getName().endsWith(".class")) { //$NON-NLS-1$
+ if (!zipEntry.getName().endsWith(".class")) //$NON-NLS-1$
+ {
continue;
}
InputStream inputStream = new BufferedInputStream(zipFile.getInputStream(zipEntry));
@@ -945,15 +927,12 @@ public class EEGenerator {
this.blackList = initializeBlackList();
return this.blackList.contains(typeName);
}
-
private boolean isOnWhiteList(String packageName) {
return packageName.startsWith("java.") || packageName.startsWith("javax.") || this.whiteList.contains(packageName); //$NON-NLS-1$ //$NON-NLS-2$
}
-
private boolean isOnWhiteList(Type type) {
return isOnWhiteList(type.getPackage());
}
-
private void persistBlackList() {
if (this.blackList == null || this.blackList.isEmpty()) {
return;
@@ -1009,7 +988,6 @@ public class EEGenerator {
}
}
}
-
private void persistData(String rootName, String subDirName) {
try {
Document document = org.eclipse.pde.api.tools.internal.util.Util.newDocument();
@@ -1070,8 +1048,6 @@ public class EEGenerator {
System.out.println("Its generated size is " + this.generatedSize + " bytes."); //$NON-NLS-1$ //$NON-NLS-2$
System.out.println("Ratio : " + (((double) this.generatedSize / (double) this.totalSize) * 100.0) + "%"); //$NON-NLS-1$ //$NON-NLS-2$
}
-
- @Override
public String toString() {
return this.getProfileName();
}
@@ -1180,7 +1156,7 @@ public class EEGenerator {
/**
* Class adapter
*/
- static class StubClassAdapter extends ClassAdapter {
+ static class StubClassAdapter extends ClassVisitor {
static final int IGNORE_CLASS_FILE = 0x100;
int flags;
@@ -1190,11 +1166,10 @@ public class EEGenerator {
/**
* Constructor
- *
* @param stubtype
*/
public StubClassAdapter(Type stubtype) {
- super(new ClassWriter(0));
+ super(Opcodes.ASM5, new ClassWriter(0));
this.type = stubtype;
}
@@ -1214,7 +1189,6 @@ public class EEGenerator {
* @see org.objectweb.asm.ClassAdapter#visit(int, int, java.lang.String,
* java.lang.String, java.lang.String, java.lang.String[])
*/
- @Override
public void visit(int version, int access, String className, String signature, String superName, String[] interfaces) {
this.name = className;
this.stub = new StubClass(access, className, superName, interfaces);
@@ -1231,7 +1205,6 @@ public class EEGenerator {
* org.objectweb.asm.ClassAdapter#visitAttribute(org.objectweb.asm.Attribute
* )
*/
- @Override
public void visitAttribute(Attribute attr) {
if ("Synthetic".equals(attr.type)) { //$NON-NLS-1$
this.flags |= IGNORE_CLASS_FILE;
@@ -1247,7 +1220,6 @@ public class EEGenerator {
* @see org.objectweb.asm.ClassAdapter#visitField(int, java.lang.String,
* java.lang.String, java.lang.String, java.lang.Object)
*/
- @Override
public FieldVisitor visitField(int access, String fieldName, String desc, String signature, Object value) {
if (type.getField(fieldName) == null) {
return null;
@@ -1261,7 +1233,6 @@ public class EEGenerator {
* @see org.objectweb.asm.ClassAdapter#visitInnerClass(java.lang.String,
* java.lang.String, java.lang.String, int)
*/
- @Override
public void visitInnerClass(String innerClassName, String outerName, String innerName, int access) {
if (this.name.equals(innerClassName) && (outerName == null)) {
// local class
@@ -1275,7 +1246,6 @@ public class EEGenerator {
* java.lang.String, java.lang.String, java.lang.String,
* java.lang.String[])
*/
- @Override
public MethodVisitor visitMethod(int access, String methodName, String desc, String signature, String[] exceptions) {
if ("<clinit>".equals(methodName)) { //$NON-NLS-1$
return null;
@@ -1290,7 +1260,7 @@ public class EEGenerator {
return null;
}
final StubMethod method = this.stub.addMethod(methodName, desc);
- return new MethodAdapter(super.visitMethod(access, methodName, desc, signature, exceptions)) {
+ return new MethodVisitor(Opcodes.ASM5, super.visitMethod(access, methodName, desc, signature, exceptions)) {
@Override
public AnnotationVisitor visitAnnotation(String sig, boolean visible) {
if (visible && "Ljava/lang/invoke/MethodHandle$PolymorphicSignature;".equals(sig)) { //$NON-NLS-1$
@@ -1300,12 +1270,10 @@ public class EEGenerator {
}
};
}
-
@Override
public void visitOuterClass(String arg0, String arg1, String arg2) {
// ignore
}
-
@Override
public void visitSource(String arg0, String arg1) {
// ignore
@@ -1336,91 +1304,19 @@ public class EEGenerator {
}
static class Type extends AbstractNode implements Comparable<Type> {
- private static boolean checkDocStatus(IFieldInfo fieldInfo, char[] contents) {
- if (contents == null) {
- return true;
- }
- StringBuffer buffer = new StringBuffer();
- buffer.append(ANCHOR_PREFIX_START).append(fieldInfo.getName()).append(ANCHOR_PREFIX_END);
- char[] anchor = String.valueOf(buffer).toCharArray();
- return CharOperation.indexOf(anchor, contents, false) != -1;
- }
-
- private static boolean checkDocStatus(int startingIndex, int accessFlags, char[] selector, char[] signature, char[] contents) {
- if (contents == null) {
- return true;
- }
- // retrieve the generic signature if any
- char[] newsignature = CharOperation.replaceOnCopy(signature, '/', '.');
- char[] anchor = org.eclipse.jdt.internal.core.util.Util.toAnchor(startingIndex, newsignature, selector, Flags.isVarargs(accessFlags));
- return CharOperation.indexOf(anchor, contents, true) != -1;
- }
-
- static char[] getDocContents(ProfileInfo info, Type type, ZipFile docZip, String docURL, String docRoot) {
- if (docZip == null && docURL == null) {
- if (DEBUG) {
- System.out.println("No javadoc zip or url specified for " + info.getProfileFileName()); //$NON-NLS-1$
- }
- return null;
- }
- String typeName = ProfileInfo.getDocTypeName(docRoot, type);
- if (DEBUG) {
- System.out.println("Retrieve javadoc for type " + typeName); //$NON-NLS-1$
- }
- if (docZip == null) {
- // docURL is not null
- if (DEBUG) {
- System.out.println("Retrieve javadoc for type " + typeName + " using javadoc url"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return info.getOnlineDocContents(docURL, typeName);
- }
- if (DEBUG) {
- System.out.println("Retrieve javadoc for type " + typeName + " using javadoc zip"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- ZipEntry entry = docZip.getEntry(typeName);
- if (entry == null) {
- if (DEBUG) {
- System.out.println("No entry found in javadoc zip for " + typeName); //$NON-NLS-1$
- }
- return null;
- }
- if (DEBUG) {
- System.out.println("Got an entry found in javadoc zip for " + typeName); //$NON-NLS-1$
- }
- InputStream inputStream = null;
- try {
- inputStream = docZip.getInputStream(entry);
- return Util.getInputStreamAsCharArray(inputStream, -1, null);
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- if (inputStream != null) {
- try {
- inputStream.close();
- } catch (IOException e) {
- // ignore
- }
- }
- }
- return null;
- }
static boolean isFinal(int accessFlags) {
return (accessFlags & Flags.AccFinal) != 0;
}
-
static boolean isPrivate(int accessFlags) {
return (accessFlags & Flags.AccPrivate) != 0;
}
-
static boolean isProtected(int accessFlags) {
return (accessFlags & Flags.AccProtected) != 0;
}
-
static boolean isPublic(int accessFlags) {
return (accessFlags & Flags.AccPublic) != 0;
}
-
static boolean isStatic(int accessFlags) {
return (accessFlags & Flags.AccStatic) != 0;
}
@@ -1507,12 +1403,11 @@ public class EEGenerator {
}
this.superinterfacesNames = interfaceNames;
this.modifiers = reader.getAccessFlags();
- char[] contents = getDocContents(info, this, docZip, docURL, docRoot);
IFieldInfo[] fieldInfos = reader.getFieldInfos();
int length = fieldInfos.length;
for (int i = 0; i < length; i++) {
IFieldInfo fieldInfo = fieldInfos[i];
- if (isVisibleField(this.modifiers, fieldInfo.getAccessFlags()) && checkDocStatus(fieldInfo, contents)) {
+ if (isVisibleField(this.modifiers, fieldInfo.getAccessFlags())) {
if (fields == null) {
this.fields = new HashSet<Field>();
}
@@ -1544,24 +1439,13 @@ public class EEGenerator {
}
int accessFlags = methodInfo.getAccessFlags();
if (isVisibleMethod(this.modifiers, accessFlags)) {
- char[] methodDocName = null;
- int index = startingIndex;
- if (methodInfo.isConstructor()) {
- // use the type simple name
- methodDocName = Util.getSimpleNameAsCharArray(this.name);
- } else {
- methodDocName = methodInfo.getName();
- index = 0;
+ if (methods == null) {
+ this.methods = new HashSet<Method>();
}
- if (checkDocStatus(index, accessFlags, methodDocName, signature, contents)) {
- if (methods == null) {
- this.methods = new HashSet<Method>();
- }
- Method method = new Method(accessFlags, methodInfo.getName(), methodInfo.getDescriptor(), signatureAttribute == null ? null : signature);
- methods.add(method);
- if (DEBUG) {
- System.out.println("Adding method: " + method); //$NON-NLS-1$
- }
+ Method method = new Method(accessFlags, methodInfo.getName(), methodInfo.getDescriptor(), signatureAttribute == null ? null : signature);
+ methods.add(method);
+ if (DEBUG) {
+ System.out.println("Adding method: " + method); //$NON-NLS-1$
}
}
}
@@ -1585,15 +1469,12 @@ public class EEGenerator {
}
this.fields.add(f);
}
-
public void addMethod(Method m) {
if (this.methods == null) {
this.methods = new HashSet<Method>();
}
this.methods.add(m);
}
-
- @Override
public int compareTo(Type type) {
return this.getSimpleName().compareTo(type.getSimpleName());
}
@@ -1612,7 +1493,6 @@ public class EEGenerator {
Type other = (Type) obj;
return Arrays.equals(name, other.name);
}
-
public Field getField(String fname) {
if (this.fields == null) {
return null;
@@ -1630,14 +1510,12 @@ public class EEGenerator {
public String getFullQualifiedName() {
return String.valueOf(this.name);
}
-
public String getSuperclassName() {
if (this.superclassName == null) {
return null;
}
return String.valueOf(this.superclassName);
}
-
public Method getMethod(String selector, String signature) {
if (this.methods == null) {
return null;
@@ -1651,12 +1529,10 @@ public class EEGenerator {
}
return null;
}
-
public String getPackage() {
int index = CharOperation.lastIndexOf('.', this.name);
return new String(CharOperation.subarray(this.name, 0, index));
}
-
public String getSimpleName() {
return Util.getSimpleName(this.name);
}
@@ -1706,7 +1582,6 @@ public class EEGenerator {
}
}
}
-
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
@@ -1735,26 +1610,6 @@ public class EEGenerator {
return String.valueOf(buffer);
}
}
-
- /**
- * Start of a HTML link
- *
- * @since 1.0.200
- */
- static final char[] ANCHOR_PREFIX_START = "<A NAME=\"".toCharArray(); //$NON-NLS-1$
- /**
- * End of a HTML link in a single tag
- *
- * @since 1.0.200
- */
- static final String ANCHOR_PREFIX_END = "\""; //$NON-NLS-1$
- /**
- * End of a HTML link
- *
- * @since 1.0.200
- */
- static final char[] ANCHOR_SUFFIX = "</A>".toCharArray(); //$NON-NLS-1$
-
static SortedSet<String> ACCEPTED_EEs;
static boolean CACHE_ENABLED = true;
static boolean DEBUG = false;
@@ -1775,6 +1630,7 @@ public class EEGenerator {
"J2SE-1.5", //$NON-NLS-1$
"JavaSE-1.6", //$NON-NLS-1$
"JavaSE-1.7", //$NON-NLS-1$
+ "JavaSE-1.8", //$NON-NLS-1$
"CDC-1.0_Foundation-1.0", //$NON-NLS-1$
"CDC-1.1_Foundation-1.1", //$NON-NLS-1$
"OSGi_Minimum-1.0", //$NON-NLS-1$
@@ -1786,7 +1642,6 @@ public class EEGenerator {
ACCEPTED_EEs.add(ee);
}
}
-
private static String getAllEEValues() {
StringBuffer buffer = new StringBuffer();
for (String ee : ACCEPTED_EEs) {
@@ -1798,7 +1653,7 @@ public class EEGenerator {
return String.valueOf(buffer);
}
- public static void main(String[] args) {
+ public static void main(String[] args) throws IOException {
EEGenerator generator = new EEGenerator();
generator.configure(args);
if (!generator.isInitialized()) {
@@ -1809,7 +1664,6 @@ public class EEGenerator {
DEBUG = (property != null) && "true".equalsIgnoreCase(property); //$NON-NLS-1$
generator.run();
}
-
private ProfileInfo[] allProfiles;
String configurationFile;
@@ -1847,21 +1701,24 @@ public class EEGenerator {
switch (mode) {
case DEFAULT:
if ("-output".equals(currentArg)) { //$NON-NLS-1$
- if (this.output != null) {
+ if (this.output != null)
+ {
throw new IllegalArgumentException("output value is already set"); //$NON-NLS-1$
}
mode = OUTPUT;
continue;
}
if ("-config".equals(currentArg)) { //$NON-NLS-1$
- if (this.configurationFile != null) {
+ if (this.configurationFile != null)
+ {
throw new IllegalArgumentException("configuration value is already set"); //$NON-NLS-1$
}
mode = CONFIG;
continue;
}
if ("-EEs".equals(currentArg)) { //$NON-NLS-1$
- if (this.EEToGenerate != null) {
+ if (this.EEToGenerate != null)
+ {
throw new IllegalArgumentException("EEs value is already set"); //$NON-NLS-1$
}
mode = EEs;
@@ -2018,4 +1875,4 @@ public class EEGenerator {
}
}
}
-}
+} \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools.tests/META-INF/MANIFEST.MF b/apitools/org.eclipse.pde.api.tools.tests/META-INF/MANIFEST.MF
index 4f50a9a648..5f6f25dd4f 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/META-INF/MANIFEST.MF
+++ b/apitools/org.eclipse.pde.api.tools.tests/META-INF/MANIFEST.MF
@@ -22,7 +22,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.jdt.core.tests.builder;bundle-version="[3.8.0,4.0.0)",
org.eclipse.jdt.core.tests.compiler;bundle-version="[3.8.0,4.0.0)",
org.eclipse.ant.core,
- org.objectweb.asm;bundle-version="[3.2.0,4.0.0)",
+ org.objectweb.asm;bundle-version="[5.0.0,6.0.0)",
org.eclipse.jface;bundle-version="3.8.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.eclipse.pde.api.tools.anttasks.tests,
@@ -30,6 +30,7 @@ Export-Package: org.eclipse.pde.api.tools.anttasks.tests,
org.eclipse.pde.api.tools.builder.tests,
org.eclipse.pde.api.tools.builder.tests.annotations,
org.eclipse.pde.api.tools.builder.tests.compatibility,
+ org.eclipse.pde.api.tools.builder.tests.java8,
org.eclipse.pde.api.tools.builder.tests.leak,
org.eclipse.pde.api.tools.builder.tests.performance,
org.eclipse.pde.api.tools.builder.tests.tags,
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/ApiTestingEnvironment.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/ApiTestingEnvironment.java
index 50d0186b7f..d79cbee84c 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/ApiTestingEnvironment.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/ApiTestingEnvironment.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -104,6 +104,9 @@ public class ApiTestingEnvironment extends TestingEnvironment {
} else if (JavaCore.VERSION_1_7.equals(compliance)) {
requiredComplianceFlag = AbstractCompilerTest.F_1_7;
compilerVersion = JavaCore.VERSION_1_7;
+ } else if (JavaCore.VERSION_1_8.equals(compliance)) {
+ requiredComplianceFlag = AbstractCompilerTest.F_1_8;
+ compilerVersion = JavaCore.VERSION_1_8;
} else if (!JavaCore.VERSION_1_4.equals(compliance) && !JavaCore.VERSION_1_3.equals(compliance)) {
throw new UnsupportedOperationException("Test framework doesn't support compliance level: " + compliance); //$NON-NLS-1$
}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/java8/Java8TypeAnnotationTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/java8/Java8TypeAnnotationTests.java
new file mode 100644
index 0000000000..94cb932e0c
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/java8/Java8TypeAnnotationTests.java
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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 org.eclipse.pde.api.tools.builder.tests.java8;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.pde.api.tools.builder.tests.ApiBuilderTest;
+import org.eclipse.pde.api.tools.builder.tests.ApiProblem;
+import org.eclipse.pde.api.tools.builder.tests.ApiTestingEnvironment;
+import org.eclipse.pde.api.tools.model.tests.TestSuiteHelper;
+
+/**
+ * Tests classes with type annotations in them do not cause any problems.
+ * <br><br>
+ * This test class reuses the Java 8 project used for tag checking
+ */
+public class Java8TypeAnnotationTests extends ApiBuilderTest {
+
+ public Java8TypeAnnotationTests(String name) {
+ super(name);
+ }
+
+ /**
+ * @return the test class for this suite
+ */
+ public static Test suite() {
+ return buildTestSuite(Java8TypeAnnotationTests.class);
+ }
+ @Override
+ protected void setBuilderOptions() {
+ enableUnsupportedTagOptions(true);
+ enableBaselineOptions(true);
+ enableCompatibilityOptions(true);
+ enableLeakOptions(true);
+ enableSinceTagOptions(true);
+ enableUsageOptions(true);
+ enableVersionNumberOptions(true);
+ }
+
+ @Override
+ protected String getTestCompliance() {
+ return JavaCore.VERSION_1_8;
+ }
+
+ @Override
+ protected IPath getTestSourcePath() {
+ return new Path("java8").append("annotations").append("types"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ @Override
+ protected int getDefaultProblemId() {
+ return 0;
+ }
+
+ @Override
+ protected String getTestingProjectName() {
+ return "java8tags"; //$NON-NLS-1$
+ }
+
+ /**
+ * @see org.eclipse.pde.api.tools.builder.tests.ApiBuilderTest#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ // If we have an existing environment, set it to revert rather than delete the workspace to improve performance
+ ApiTestingEnvironment env = getEnv();
+ if (env != null) {
+ env.setRevert(true);
+ env.setRevertSourcePath(null);
+ }
+ super.setUp();
+
+ IProject project = getEnv().getWorkspace().getRoot().getProject(getTestingProjectName());
+ if (!project.exists()) {
+ IPath path = TestSuiteHelper.getPluginDirectoryPath().append(TEST_SOURCE_ROOT).append("tagprojects").append(getTestingProjectName()); //$NON-NLS-1$
+ File dir = path.toFile();
+ assertTrue("Test data directory does not exist for: " + path.toOSString(), dir.exists()); //$NON-NLS-1$
+ createExistingProject(dir, true, true);
+ }
+ }
+
+ /**
+ * Runs the test using the default testing env
+ * @param typename
+ * @param incremental
+ */
+ void deployTest(String typename, boolean incremental, boolean hasproblems) {
+ try {
+ IPath typepath = new Path(getTestingProjectName()).append("src").append(typename).addFileExtension("java"); //$NON-NLS-1$ //$NON-NLS-2$
+ createWorkspaceFile(typepath, TestSuiteHelper.getPluginDirectoryPath().append(TEST_SOURCE_ROOT).append(getTestSourcePath()).append(typename).addFileExtension("java")); //$NON-NLS-1$
+ if(incremental) {
+ incrementalBuild();
+ }
+ else {
+ fullBuild();
+ }
+ if(!hasproblems) {
+ expectingNoJDTProblemsFor(typepath);
+ expectingNoProblemsFor(typepath);
+ } else {
+ ApiProblem[] problems = getEnv().getProblemsFor(typepath, null);
+ assertProblems(problems);
+ }
+ }
+ catch(Exception e) {
+ fail(e.getMessage());
+ }
+ }
+
+ public void test1I() throws Exception {
+ x1(true);
+ }
+
+ public void test1F() throws Exception {
+ x1(false);
+ }
+ /**
+ * Tests there are no problems with type annotations in method decls
+ * @param inc
+ * @throws Exception
+ */
+ void x1(boolean inc) throws Exception{
+ deployTest("test1", inc, false); //$NON-NLS-1$
+ }
+
+ public void test2I() throws Exception {
+ x2(true);
+ }
+
+ public void test2F() throws Exception {
+ x2(false);
+ }
+ /**
+ * Tests there are no problems with type annotations in field decls
+ * @param inc
+ * @throws Exception
+ */
+ void x2(boolean inc) throws Exception{
+ deployTest("test2", inc, false); //$NON-NLS-1$
+ }
+
+ public void test3I() throws Exception {
+ x3(true);
+ }
+
+ public void test3F() throws Exception {
+ x3(false);
+ }
+ /**
+ * Tests there are no problems with type annotations in type decls
+ * @param inc
+ * @throws Exception
+ */
+ void x3(boolean inc) throws Exception{
+ deployTest("test3", inc, false); //$NON-NLS-1$
+ }
+
+ public void test4I() throws Exception {
+ //x4(true); TODO uncomment in Luna
+ }
+
+ public void test4F() throws Exception {
+ //x4(false); TODO uncomment in Luna
+ }
+ /**
+ * Tests there are problems with API tools annotations used in type annotation case in method decls
+ * @param inc
+ * @throws Exception
+ */
+ void x4(boolean inc) throws Exception{
+ deployTest("test4", inc, true); //$NON-NLS-1$
+ }
+
+ public void test5I() throws Exception {
+ //x5(true); TODO uncomment in Luna
+ }
+
+ public void test5F() throws Exception {
+ //x5(false); TODO uncomment in Luna
+ }
+ /**
+ * Tests there are problems with API tools annotations used in type annotation case in field decls
+ * @param inc
+ * @throws Exception
+ */
+ void x5(boolean inc) throws Exception{
+ deployTest("test5", inc, true); //$NON-NLS-1$
+ }
+
+ public void test6I() throws Exception {
+ //x6(true); TODO uncomment in Luna
+ }
+
+ public void test6F() throws Exception {
+ //x6(false); TODO uncomment in Luna
+ }
+ /**
+ * Tests there are problems with API tools annotations used in type annotation case in type decls
+ * @param inc
+ * @throws Exception
+ */
+ void x6(boolean inc) throws Exception{
+ deployTest("test6", inc, true); //$NON-NLS-1$
+ }
+}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidInterfaceMethodTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidInterfaceMethodTagTests.java
index 43bbe3db8e..72f0b4288f 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidInterfaceMethodTagTests.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidInterfaceMethodTagTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -16,7 +16,7 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.pde.api.tools.internal.builder.BuilderMessages;
/**
- * Tests invalid javadoc tags on interface methods
+ * Tests invalid Javadoc tags on interface methods
*
* @since 1.0
*/
@@ -192,12 +192,12 @@ public class InvalidInterfaceMethodTagTests extends InvalidMethodTagTests {
private void x7(boolean inc) {
setExpectedProblemIds(getDefaultProblemSet(6));
setExpectedMessageArgs(new String[][] {
- {"@nooverride", BuilderMessages.TagValidator_an_interface_method}, //$NON-NLS-1$
- {"@nooverride", BuilderMessages.TagValidator_an_interface_method}, //$NON-NLS-1$
- {"@nooverride", BuilderMessages.TagValidator_an_interface_method}, //$NON-NLS-1$
- {"@nooverride", BuilderMessages.TagValidator_an_interface_method}, //$NON-NLS-1$
- {"@nooverride", BuilderMessages.TagValidator_an_interface_method}, //$NON-NLS-1$
- {"@nooverride", BuilderMessages.TagValidator_an_interface_method} //$NON-NLS-1$
+ {"@nooverride", BuilderMessages.TagValidator_nondefault_interface_method}, //$NON-NLS-1$
+ {"@nooverride", BuilderMessages.TagValidator_nondefault_interface_method}, //$NON-NLS-1$
+ {"@nooverride", BuilderMessages.TagValidator_not_visible_interface_method}, //$NON-NLS-1$
+ {"@nooverride", BuilderMessages.TagValidator_not_visible_interface_method}, //$NON-NLS-1$
+ {"@nooverride", BuilderMessages.TagValidator_nondefault_interface_method}, //$NON-NLS-1$
+ {"@nooverride", BuilderMessages.TagValidator_nondefault_interface_method} //$NON-NLS-1$
});
deployTagTest("test7.java", inc, false); //$NON-NLS-1$
}
@@ -216,8 +216,8 @@ public class InvalidInterfaceMethodTagTests extends InvalidMethodTagTests {
private void x8(boolean inc) {
setExpectedProblemIds(getDefaultProblemSet(2));
setExpectedMessageArgs(new String[][] {
- {"@nooverride", BuilderMessages.TagValidator_an_interface_method}, //$NON-NLS-1$
- {"@nooverride", BuilderMessages.TagValidator_an_interface_method} //$NON-NLS-1$
+ {"@nooverride", BuilderMessages.TagValidator_nondefault_interface_method}, //$NON-NLS-1$
+ {"@nooverride", BuilderMessages.TagValidator_nondefault_interface_method} //$NON-NLS-1$
});
deployTagTest("test8.java", inc, true); //$NON-NLS-1$
}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidJava8InterfaceMethodTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidJava8InterfaceMethodTagTests.java
new file mode 100644
index 0000000000..178ade6cca
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidJava8InterfaceMethodTagTests.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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 org.eclipse.pde.api.tools.builder.tests.tags;
+
+import junit.framework.Test;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.pde.api.tools.internal.builder.BuilderMessages;
+
+/**
+ * Tests invalid tags in Java 8 interface methods
+ */
+public class InvalidJava8InterfaceMethodTagTests extends InvalidInterfaceMethodTagTests {
+
+ public InvalidJava8InterfaceMethodTagTests(String name) {
+ super(name);
+ }
+
+ @Override
+ protected String getTestCompliance() {
+ return JavaCore.VERSION_1_8;
+ }
+
+ @Override
+ protected IPath getTestSourcePath() {
+ return new Path("java8").append("tags").append("interface"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ @Override
+ protected String getTestingProjectName() {
+ return "java8tags"; //$NON-NLS-1$
+ }
+
+ /**
+ * @return the test for this class
+ */
+ public static Test suite() {
+ return buildTestSuite(InvalidJava8InterfaceMethodTagTests.class);
+ }
+
+ public void testInvalidJava8InterfaceMethodTag1I() {
+ x1(true);
+ }
+
+ public void testInvalidJava8InterfaceMethodTag1F() {
+ x1(false);
+ }
+
+ /**
+ * Tests the unsupported @nooverride tag on non-default interface methods in Java 8 interfaces
+ */
+ private void x1(boolean inc) {
+ setExpectedProblemIds(getDefaultProblemSet(2));
+ setExpectedMessageArgs(new String[][] {
+ {"@nooverride", BuilderMessages.TagValidator_nondefault_interface_method}, //$NON-NLS-1$
+ {"@nooverride", BuilderMessages.TagValidator_nondefault_interface_method} //$NON-NLS-1$
+ });
+ deployTagTest("test1.java", inc, false); //$NON-NLS-1$
+ }
+}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidMethodTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidMethodTagTests.java
index a7362f56e9..ad482471cf 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidMethodTagTests.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidMethodTagTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -12,6 +12,7 @@ package org.eclipse.pde.api.tools.builder.tests.tags;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.util.ArrayList;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -21,6 +22,7 @@ import org.eclipse.jdt.core.tests.junit.extension.TestCase;
import org.eclipse.pde.api.tools.internal.problems.ApiProblemFactory;
import org.eclipse.pde.api.tools.internal.provisional.descriptors.IElementDescriptor;
import org.eclipse.pde.api.tools.internal.provisional.problems.IApiProblem;
+import org.eclipse.pde.api.tools.tests.util.ProjectUtils;
/**
* Test unsupported javadoc tags on methods in classes, interfaces, enums and
@@ -74,13 +76,15 @@ public class InvalidMethodTagTests extends TagTest {
* @return all of the child test classes of this class
*/
private static Class<?>[] getAllTestClasses() {
- Class<?>[] classes = new Class[] {
- InvalidAnnotationMethodTagTests.class,
- InvalidEnumMethodTagTests.class,
- InvalidClassMethodTagTests.class,
- InvalidClassConstructorTagTests.class,
- InvalidInterfaceMethodTagTests.class };
- return classes;
+ ArrayList<Class<?>> classes = new ArrayList<Class<?>>();
+ classes.add(InvalidAnnotationMethodTagTests.class);
+ classes.add(InvalidEnumMethodTagTests.class);
+ classes.add(InvalidClassMethodTagTests.class);
+ classes.add(InvalidInterfaceMethodTagTests.class);
+ if(ProjectUtils.isJava8Compatible()) {
+ classes.add(InvalidJava8InterfaceMethodTagTests.class);
+ }
+ return classes.toArray(new Class[classes.size()]);
}
/**
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/TagTest.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/TagTest.java
index 2e6ba964f6..d5658acdda 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/TagTest.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/TagTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -33,8 +33,8 @@ import org.eclipse.pde.api.tools.model.tests.TestSuiteHelper;
*/
public abstract class TagTest extends ApiBuilderTest {
- protected static IPath WORKSPACE_PATH = new Path("tagproject/src/a/b/c"); //$NON-NLS-1$
- protected static IPath WORKSPACE_PATH_DEFAULT = new Path("tagproject/src"); //$NON-NLS-1$
+ protected static IPath WORKSPACE_PATH = new Path("src/a/b/c"); //$NON-NLS-1$
+ protected static IPath WORKSPACE_PATH_DEFAULT = new Path("src"); //$NON-NLS-1$
/**
* Constructor
@@ -197,9 +197,9 @@ public abstract class TagTest extends ApiBuilderTest {
*/
protected void deployTagTest(String sourcename, boolean incremental, boolean usedefault) {
try {
- IPath path = WORKSPACE_PATH.append(sourcename);
+ IPath path = new Path(getTestingProjectName()).append(WORKSPACE_PATH).append(sourcename);
if (usedefault) {
- path = WORKSPACE_PATH_DEFAULT.append(sourcename);
+ path = new Path(getTestingProjectName()).append(WORKSPACE_PATH_DEFAULT).append(sourcename);
}
createWorkspaceFile(path, TestSuiteHelper.getPluginDirectoryPath().append(TEST_SOURCE_ROOT).append(getTestSourcePath()).append(sourcename));
if (incremental) {
@@ -246,4 +246,4 @@ public abstract class TagTest extends ApiBuilderTest {
env.setRevert(false);
}
}
-}
+} \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidJava8IntefaceMethodTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidJava8IntefaceMethodTagTests.java
new file mode 100644
index 0000000000..c88a5d1b76
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidJava8IntefaceMethodTagTests.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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 org.eclipse.pde.api.tools.builder.tests.tags;
+
+import junit.framework.Test;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.JavaCore;
+
+/**
+ * Tests valid tags on Java 8 interface methods
+ */
+public class ValidJava8IntefaceMethodTagTests extends
+ ValidInterfaceMethodTagTests {
+
+ public ValidJava8IntefaceMethodTagTests(String name) {
+ super(name);
+ }
+
+ @Override
+ protected String getTestCompliance() {
+ return JavaCore.VERSION_1_8;
+ }
+
+ @Override
+ protected IPath getTestSourcePath() {
+ return new Path("java8").append("tags").append("interface").append("valid"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$
+ }
+
+ @Override
+ protected String getTestingProjectName() {
+ return "java8tags"; //$NON-NLS-1$
+ }
+
+ /**
+ * @return the test for this class
+ */
+ public static Test suite() {
+ return buildTestSuite(ValidJava8IntefaceMethodTagTests.class);
+ }
+
+ public void testNoOverrideOnDefaultI() {
+ x1(true);
+ }
+
+ public void testNoOverrideOnDefaultF() {
+ x1(false);
+ }
+
+ /**
+ * Tests the @nooverride tag on a default method
+ */
+ private void x1(boolean inc) {
+ deployTagTest("test1.java", inc, false); //$NON-NLS-1$
+ }
+}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidMethodTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidMethodTagTests.java
index 4318bdb779..6cec8677e5 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidMethodTagTests.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidMethodTagTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -12,12 +12,14 @@ package org.eclipse.pde.api.tools.builder.tests.tags;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.util.ArrayList;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.tests.junit.extension.TestCase;
+import org.eclipse.pde.api.tools.tests.util.ProjectUtils;
/**
* Tests valid javadoc tags on methods in classes, interfaces, enums and
@@ -60,11 +62,14 @@ public class ValidMethodTagTests extends InvalidMethodTagTests {
* @return all of the child test classes of this class
*/
private static Class<?>[] getAllTestClasses() {
- Class<?>[] classes = new Class[] {
- ValidClassMethodTagTests.class,
- ValidInterfaceMethodTagTests.class,
- ValidEnumMethodTagTests.class };
- return classes;
+ ArrayList<Class<?>> classes = new ArrayList<Class<?>>();
+ classes.add(ValidClassMethodTagTests.class);
+ classes.add(ValidInterfaceMethodTagTests.class);
+ classes.add(ValidEnumMethodTagTests.class);
+ if (ProjectUtils.isJava8Compatible()) {
+ classes.add(ValidJava8IntefaceMethodTagTests.class);
+ }
+ return classes.toArray(new Class[classes.size()]);
}
/**
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/TagScannerTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/TagScannerTests.java
index aeaf6369cf..34f5aa3e6b 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/TagScannerTests.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/TagScannerTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -1169,4 +1169,56 @@ public class TagScannerTests extends TestCase {
IApiAnnotations description = manifest.resolveAnnotations(Factory.fieldDescriptor("a.b.c.InvalidTagScanField3", "field")); //$NON-NLS-1$ //$NON-NLS-2$
assertNull("there should be no annotations for field 'field'", description); //$NON-NLS-1$
}
+
+ /**
+ * Tests only default methods annotate API descriptions with @nooverride
+ *
+ * @throws Exception
+ * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=427495
+ */
+ public void testJava8InterfaceMethod1() throws Exception {
+ IApiDescription manifest = newDescription();
+ doScan("a/b/c/TestJava8DefaultMethod1.java", manifest); //$NON-NLS-1$
+ IApiAnnotations description = manifest.resolveAnnotations(Factory.methodDescriptor("a.b.c.TestJava8DefaultMethod1", "m2", "()I")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ assertNotNull("there should be annotations for method 'm2'", description); //$NON-NLS-1$
+ assertTrue("The annotations should include nooverride", (description.getRestrictions() & RestrictionModifiers.NO_OVERRIDE) > 0); //$NON-NLS-1$
+ description = manifest.resolveAnnotations(Factory.methodDescriptor("a.b.c.TestJava8DefaultMethod1", "m1", "()I")); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+ assertNotNull("There should be API annotations for the non-default method", description); //$NON-NLS-1$
+ assertTrue("The annotations for the non-default method should be API", description.getRestrictions() == RestrictionModifiers.NO_RESTRICTIONS); //$NON-NLS-1$
+ }
+
+ /**
+ * Tests default methods annotate API descriptions with @noreference
+ *
+ * @throws Exception
+ * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=427495
+ */
+ public void testJava8InterfaceMethod2() throws Exception {
+ IApiDescription manifest = newDescription();
+ doScan("a/b/c/TestJava8DefaultMethod2.java", manifest); //$NON-NLS-1$
+ IApiAnnotations description = manifest.resolveAnnotations(Factory.methodDescriptor("a.b.c.TestJava8DefaultMethod2", "m2", "()I")); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+ assertNotNull("there should be annotations for method 'm2'", description); //$NON-NLS-1$
+ assertTrue("The annotations should include noreference", (description.getRestrictions() & RestrictionModifiers.NO_REFERENCE) > 0); //$NON-NLS-1$
+ description = manifest.resolveAnnotations(Factory.methodDescriptor("a.b.c.TestJava8DefaultMethod2", "m1", "()I")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ assertNotNull("There should be API annotations for the non-default method", description); //$NON-NLS-1$
+ assertTrue("The annotations for the non-default method should be API", description.getRestrictions() == RestrictionModifiers.NO_RESTRICTIONS); //$NON-NLS-1$
+ }
+
+ /**
+ * Tests default methods annotate API descriptions with @noreference and @nooverride
+ *
+ * @throws Exception
+ * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=427495
+ */
+ public void testJava8InterfaceMethod3() throws Exception {
+ IApiDescription manifest = newDescription();
+ doScan("a/b/c/TestJava8DefaultMethod3.java", manifest); //$NON-NLS-1$
+ IApiAnnotations description = manifest.resolveAnnotations(Factory.methodDescriptor("a.b.c.TestJava8DefaultMethod3", "m2", "()I")); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+ assertNotNull("there should be annotations for method 'm2'", description); //$NON-NLS-1$
+ assertTrue("The annotations should include noreference", (description.getRestrictions() & RestrictionModifiers.NO_REFERENCE) > 0); //$NON-NLS-1$
+ assertTrue("The annotations should include noreference", (description.getRestrictions() & RestrictionModifiers.NO_OVERRIDE) > 0); //$NON-NLS-1$
+ description = manifest.resolveAnnotations(Factory.methodDescriptor("a.b.c.TestJava8DefaultMethod3", "m1", "()I")); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
+ assertNotNull("There should be API annotations for the non-default method", description); //$NON-NLS-1$
+ assertTrue("The annotations for the non-default method should be API", description.getRestrictions() == RestrictionModifiers.NO_RESTRICTIONS); //$NON-NLS-1$
+ }
}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/TestSuiteHelper.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/TestSuiteHelper.java
index 1a6ee2bf8d..dc425de4dc 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/TestSuiteHelper.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/TestSuiteHelper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -718,4 +718,4 @@ public class TestSuiteHelper {
return new Path(System.getProperty("user.dir")); //$NON-NLS-1$
}
-}
+} \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/tests/ApiToolsPluginTestSuite.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/tests/ApiToolsPluginTestSuite.java
index 299cbe90a0..2b0f11c1a0 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/tests/ApiToolsPluginTestSuite.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/tests/ApiToolsPluginTestSuite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -15,9 +15,11 @@ import junit.framework.TestSuite;
import org.eclipse.pde.api.tools.anttasks.tests.ApiToolsAntTasksTestSuite;
import org.eclipse.pde.api.tools.builder.tests.ApiBuilderTest;
+import org.eclipse.pde.api.tools.builder.tests.java8.Java8TypeAnnotationTests;
import org.eclipse.pde.api.tools.model.tests.ApiFilterStoreTests;
import org.eclipse.pde.api.tools.model.tests.FilterStoreTests;
import org.eclipse.pde.api.tools.problems.tests.ApiProblemTests;
+import org.eclipse.pde.api.tools.tests.util.ProjectUtils;
import org.eclipse.pde.api.tools.util.tests.ApiBaselineManagerTests;
import org.eclipse.pde.api.tools.util.tests.ApiDescriptionProcessorTests;
import org.eclipse.pde.api.tools.util.tests.PreferencesTests;
@@ -54,5 +56,8 @@ public class ApiToolsPluginTestSuite extends TestSuite {
addTest(ApiBuilderTest.suite());
addTest(ApiToolsAntTasksTestSuite.suite());
//addTest(ExternalDependencyTestSuite.suite());
+ if(ProjectUtils.isJava8Compatible()) {
+ addTest(new TestSuite(Java8TypeAnnotationTests.class));
+ }
}
}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/tests/util/ProjectUtils.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/tests/util/ProjectUtils.java
index 9d3bfe9550..d1af437aeb 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/tests/util/ProjectUtils.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/tests/util/ProjectUtils.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -94,10 +94,20 @@ public class ProjectUtils {
}
/**
+ * Returns if the currently running VM is version compatible with Java 8
+ *
+ * @return <code>true</code> if a Java 8 (or greater) VM is running
+ * <code>false</code> otherwise
+ */
+ public static boolean isJava8Compatible() {
+ return isCompatible(8);
+ }
+
+ /**
* Returns if the current running system is compatible with the given Java
* minor version
*
- * @param ver the version to test - either 4, 5, 6 or 7
+ * @param ver the version to test - either 4, 5, 6 , 7 or 8
* @return <code>true</code> if compatible <code>false</code> otherwise
*/
static boolean isCompatible(int ver) {
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/util/tests/ApiBaselineManagerTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/util/tests/ApiBaselineManagerTests.java
index 62a0a954f3..751090ba43 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/util/tests/ApiBaselineManagerTests.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/util/tests/ApiBaselineManagerTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -445,7 +445,7 @@ public class ApiBaselineManagerTests extends AbstractApiTest {
* @throws BadLocationException
*/
private void updateTagInSource(ICompilationUnit unit, String membername, String signature, String tagname, boolean remove) throws CoreException, MalformedTreeException, BadLocationException {
- ASTParser parser = ASTParser.newParser(AST.JLS4);
+ ASTParser parser = ASTParser.newParser(AST.JLS8);
parser.setSource(unit);
CompilationUnit cunit = (CompilationUnit) parser.createAST(new NullProgressMonitor());
assertNotNull("the ast compilation unit cannot be null", cunit); //$NON-NLS-1$
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/util/tests/ApiDescriptionProcessorTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/util/tests/ApiDescriptionProcessorTests.java
index 75f561346c..9c66c73041 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/util/tests/ApiDescriptionProcessorTests.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/util/tests/ApiDescriptionProcessorTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -305,7 +305,7 @@ public class ApiDescriptionProcessorTests extends AbstractApiTest {
IJavaProject project = getTestingJavaProject(TESTING_PROJECT_NAME);
IType type = project.findType("javadoc", typename); //$NON-NLS-1$
assertNotNull("the type for javadoc." + typename + " must exist", type); //$NON-NLS-1$ //$NON-NLS-2$
- ASTParser parser = ASTParser.newParser(AST.JLS4);
+ ASTParser parser = ASTParser.newParser(AST.JLS8);
parser.setSource(type.getCompilationUnit());
CompilationUnit cunit = (CompilationUnit) parser.createAST(new NullProgressMonitor());
ChangeVisitor visitor = new ChangeVisitor(typename, innertypename, membername, signature, expectedtags);
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test1.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test1.java
new file mode 100644
index 0000000000..2d6bf9c79f
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test1.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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
+ *******************************************************************************/
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * Tests type annotations being used in method decls
+ */
+public class test1 {
+
+ void method() throws @test1Annotation Exception {
+
+ }
+
+ void method2(@test1Annotation String arg) {
+
+ }
+
+ @test1Annotation String name() {
+ return null;
+ }
+}
+
+@Target({ElementType.TYPE_USE})
+@interface test1Annotation {
+
+}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test2.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test2.java
new file mode 100644
index 0000000000..08aa7917de
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test2.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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
+ *******************************************************************************/
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+import java.util.ArrayList;
+
+/**
+ * Tests type annotations in field decls
+ */
+public class test2 {
+
+ ArrayList<String> list = new @test2Annotation ArrayList<>();
+
+ String s = (@test2Annotation String) "foo";
+}
+
+@Target({ElementType.TYPE_USE})
+@interface test2Annotation {
+
+} \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test3.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test3.java
new file mode 100644
index 0000000000..8d00edb569
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test3.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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
+ *******************************************************************************/
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * Tests type annotations in type decls
+ */
+public class test3 {
+ interface I {}
+
+ class inner implements @test3Annotation I {
+
+ }
+
+ class inner2 extends @test3Annotation inner implements @test3Annotation I {
+
+ }
+}
+
+@Target({ElementType.TYPE_USE})
+@interface test3Annotation {
+
+} \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test4.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test4.java
new file mode 100644
index 0000000000..c02760b174
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test4.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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
+ *******************************************************************************/
+import org.eclipse.pde.api.tools.annotations.NoReference;
+
+public class test4 {
+
+ void method() throws @NoReference Exception {
+
+ }
+
+ void method2(@NoReference String arg) {
+
+ }
+}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test5.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test5.java
new file mode 100644
index 0000000000..75622b8961
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test5.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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
+ *******************************************************************************/
+import java.util.ArrayList;
+
+import org.eclipse.pde.api.tools.annotations.NoReference;
+
+
+public class test5 {
+
+ ArrayList<String> list = new @NoReference ArrayList<>();
+
+ String s = (@NoReference String) "foo";
+}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test6.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test6.java
new file mode 100644
index 0000000000..0860292344
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/annotations/types/test6.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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
+ *******************************************************************************/
+import org.eclipse.pde.api.tools.annotations.NoReference;
+
+public class test6 {
+ interface I {}
+
+ class inner implements @NoReference I {
+
+ }
+
+ class inner2 extends @NoReference inner implements @NoReference I {
+
+ }
+}
+
+
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/tags/interface/test1.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/tags/interface/test1.java
new file mode 100644
index 0000000000..6ec0df83f1
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/tags/interface/test1.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.b.c;
+
+/**
+ * Tests invalid @nooverride tags on nested inner interfaces
+ */
+public interface test1 {
+
+ /**
+ * @nooverride
+ * @return
+ */
+ int m1();
+
+ interface inner {
+ /**
+ * @nooverride
+ * @return
+ */
+ int m1();
+ }
+
+}
+
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/tags/interface/valid/test1.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/tags/interface/valid/test1.java
new file mode 100644
index 0000000000..e1c74a30b6
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/java8/tags/interface/valid/test1.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.b.c;
+
+/**
+ * Test valid tags on an interface default method
+ */
+public interface test1 {
+
+ /**
+ * @noreference
+ * @nooverride
+ * @return
+ */
+ default int m1() {
+ return 1;
+ }
+
+ interface inner {
+ /**
+ * @noreference
+ * @nooverride
+ * @return
+ */
+ default int m1() {
+ return 1;
+ }
+ }
+}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/.classpath b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/.classpath
new file mode 100644
index 0000000000..eca7bdba8f
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/.project b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/.project
new file mode 100644
index 0000000000..c3a0c864ba
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>java8tags</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/.settings/org.eclipse.jdt.core.prefs b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..28df0e7c7f
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Thu Jul 16 11:12:55 CDT 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/META-INF/MANIFEST.MF b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..473db98a71
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/META-INF/MANIFEST.MF
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: java8tags
+Bundle-SymbolicName: java8tags
+Bundle-Version: 1.0.0.qualifier
+Require-Bundle: org.eclipse.core.runtime
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Export-Package: a.b.c
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/build.properties b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/build.properties
new file mode 100644
index 0000000000..c7c86928df
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/build.properties
@@ -0,0 +1,14 @@
+###############################################################################
+# Copyright (c) 2014 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
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/src/a/b/c/Dummy.txt b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/src/a/b/c/Dummy.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tagprojects/java8tags/src/a/b/c/Dummy.txt
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-source/a/b/c/TestJava8DefaultMethod1.java b/apitools/org.eclipse.pde.api.tools.tests/test-source/a/b/c/TestJava8DefaultMethod1.java
new file mode 100644
index 0000000000..3fcdb608ef
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-source/a/b/c/TestJava8DefaultMethod1.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.b.c;
+
+public interface TestJava8DefaultMethod1 {
+
+ /**
+ * @nooverride
+ * @return
+ */
+ int m1();
+
+ /**
+ * @nooverride
+ * @return
+ */
+ default int m2() {
+ return 0;
+ }
+}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-source/a/b/c/TestJava8DefaultMethod2.java b/apitools/org.eclipse.pde.api.tools.tests/test-source/a/b/c/TestJava8DefaultMethod2.java
new file mode 100644
index 0000000000..5f541528e6
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-source/a/b/c/TestJava8DefaultMethod2.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.b.c;
+
+public interface TestJava8DefaultMethod2 {
+
+ /**
+ * @return
+ */
+ int m1();
+
+ /**
+ * @noreference
+ * @return
+ */
+ default int m2() {
+ return 0;
+ }
+}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-source/a/b/c/TestJava8DefaultMethod3.java b/apitools/org.eclipse.pde.api.tools.tests/test-source/a/b/c/TestJava8DefaultMethod3.java
new file mode 100644
index 0000000000..3e2927c8ff
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-source/a/b/c/TestJava8DefaultMethod3.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.b.c;
+
+public interface TestJava8DefaultMethod3 {
+
+ /**
+ * @nooverride
+ * @return
+ */
+ int m1();
+
+ /**
+ * @nooverride
+ * @noreference
+ * @return
+ */
+ default int m2() {
+ return 0;
+ }
+}
diff --git a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/completion/APIToolsJavadocCompletionProposalComputer.java b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/completion/APIToolsJavadocCompletionProposalComputer.java
index d6a3f79e0e..84153892cc 100644
--- a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/completion/APIToolsJavadocCompletionProposalComputer.java
+++ b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/completion/APIToolsJavadocCompletionProposalComputer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -53,8 +53,8 @@ import org.eclipse.pde.api.tools.ui.internal.ApiUIPlugin;
import org.eclipse.swt.graphics.Image;
/**
- * This class creates completion proposals to javadoc header blocks for the
- * javadoc tags contributed via the apiJavadocTags extension point. <br>
+ * This class creates completion proposals to Javadoc header blocks for the
+ * Javadoc tags contributed via the apiJavadocTags extension point. <br>
* <br>
* Any changes to the visibility logic here also must be updated in the
* {@link TagValidator}
@@ -435,7 +435,7 @@ public class APIToolsJavadocCompletionProposalComputer implements IJavaCompletio
*/
@Override
public void sessionStarted() {
- fParser = ASTParser.newParser(AST.JLS4);
+ fParser = ASTParser.newParser(AST.JLS8);
fErrorMessage = null;
}
diff --git a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/ApiMarkerResolutionGenerator.java b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/ApiMarkerResolutionGenerator.java
index 9816d00776..fd620aea6f 100644
--- a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/ApiMarkerResolutionGenerator.java
+++ b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/ApiMarkerResolutionGenerator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -100,7 +100,11 @@ public class ApiMarkerResolutionGenerator implements IMarkerResolutionGenerator2
case IApiMarkerConstants.DUPLICATE_ANNOTATION_MARKER_ID: {
return new IMarkerResolution[] { new DuplicateAnnotationResolution(marker) };
}
- case IApiMarkerConstants.API_COMPONENT_RESOLUTION_MARKER_ID: {
+ case IApiMarkerConstants.API_COMPONENT_RESOLUTION_MARKER_ID: {
+ int id = ApiProblemFactory.getProblemId(marker);
+ if(id > -1 && ApiProblemFactory.getProblemKind(id) == IApiProblem.UNSUPPORTED_BYTECODES) {
+ return NO_RESOLUTIONS;
+ }
return new IMarkerResolution[] { new UpdateProjectSettingResolution(marker) };
}
case IApiMarkerConstants.UNUSED_PROBLEM_FILTER_MARKER_ID: {
diff --git a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/JavadocTagOperation.java b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/JavadocTagOperation.java
index e9b0e12e3f..463024b828 100644
--- a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/JavadocTagOperation.java
+++ b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/JavadocTagOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -89,7 +89,7 @@ public class JavadocTagOperation {
* @return a new {@link AST}
*/
protected CompilationUnit createAST(final ICompilationUnit unit, int focalposition, boolean resolvebindings) {
- ASTParser parser = ASTParser.newParser(AST.JLS4);
+ ASTParser parser = ASTParser.newParser(AST.JLS8);
parser.setSource(unit);
parser.setFocalPosition(focalposition);
parser.setResolveBindings(resolvebindings);
diff --git a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/NodeFinder.java b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/NodeFinder.java
index 03aefb2654..dd011e31b0 100644
--- a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/NodeFinder.java
+++ b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/NodeFinder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
diff --git a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/RemoveUnsupportedAnnotationOperation.java b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/RemoveUnsupportedAnnotationOperation.java
index 99565e61b2..b3b7a4653f 100644
--- a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/RemoveUnsupportedAnnotationOperation.java
+++ b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/RemoveUnsupportedAnnotationOperation.java
@@ -146,7 +146,7 @@ public class RemoveUnsupportedAnnotationOperation extends UIJob {
Util.updateMonitor(localMonitor, 1);
}
Util.updateMonitor(localMonitor, 1);
- ASTParser parser = ASTParser.newParser(AST.JLS4);
+ ASTParser parser = ASTParser.newParser(AST.JLS8);
parser.setSource(compilationUnit);
Integer charStartAttribute = null;
charStartAttribute = (Integer) fMarkers[i].getAttribute(IMarker.CHAR_START);
diff --git a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/RemoveUnsupportedTagOperation.java b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/RemoveUnsupportedTagOperation.java
index b645816224..8eb88f28e8 100644
--- a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/RemoveUnsupportedTagOperation.java
+++ b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/RemoveUnsupportedTagOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -95,7 +95,7 @@ public class RemoveUnsupportedTagOperation extends UIJob {
Util.updateMonitor(localMonitor, 1);
}
Util.updateMonitor(localMonitor, 1);
- ASTParser parser = ASTParser.newParser(AST.JLS4);
+ ASTParser parser = ASTParser.newParser(AST.JLS8);
parser.setSource(compilationUnit);
Integer charStartAttribute = null;
charStartAttribute = (Integer) this.markers[i].getAttribute(IMarker.CHAR_START);
diff --git a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/UpdateSinceTagOperation.java b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/UpdateSinceTagOperation.java
index 523ae9fc1b..c66ee1086f 100644
--- a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/UpdateSinceTagOperation.java
+++ b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/markers/UpdateSinceTagOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -85,7 +85,7 @@ public class UpdateSinceTagOperation {
// quickfix change
JavaUI.openInEditor(compilationUnit);
}
- ASTParser parser = ASTParser.newParser(AST.JLS4);
+ ASTParser parser = ASTParser.newParser(AST.JLS8);
parser.setSource(compilationUnit);
if (intValue <= 0) {
// try to use the name range of the corresponding element
diff --git a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/preferences/ApiErrorsWarningsConfigurationBlock.java b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/preferences/ApiErrorsWarningsConfigurationBlock.java
index 706101cb40..553739df1f 100644
--- a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/preferences/ApiErrorsWarningsConfigurationBlock.java
+++ b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/preferences/ApiErrorsWarningsConfigurationBlock.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -349,7 +349,7 @@ public class ApiErrorsWarningsConfigurationBlock extends ConfigurationBlock {
private static final Key KEY_REPORT_API_BREAKAGE_WHEN_MAJOR_VERSION_INCREMENTED = getApiToolsKey(IApiProblemTypes.REPORT_API_BREAKAGE_WHEN_MAJOR_VERSION_INCREMENTED);
private static final Key KEY_REPORT_RESOLUTION_ERRORS_API_COMPONENT = getApiToolsKey(IApiProblemTypes.REPORT_RESOLUTION_ERRORS_API_COMPONENT);
-
+ private static final Key KEY_UNSUPPORTED_BYTECODES = getApiToolsKey(IApiProblemTypes.UNSUPPORTED_BYTECODES);
// External Dependencies' Keys
private static final Key KEY_API_USE_SCAN_TYPE_PROBLEM = getApiToolsKey(IApiProblemTypes.API_USE_SCAN_TYPE_SEVERITY);
private static final Key KEY_API_USE_SCAN_METHOD_PROBLEM = getApiToolsKey(IApiProblemTypes.API_USE_SCAN_METHOD_SEVERITY);
@@ -367,6 +367,7 @@ public class ApiErrorsWarningsConfigurationBlock extends ConfigurationBlock {
static Key[] fgAllApiComponentResolutionKeys = {
KEY_REPORT_RESOLUTION_ERRORS_API_COMPONENT,
+ KEY_UNSUPPORTED_BYTECODES,
KEY_UNUSED_PROBLEM_FILTERS,
KEY_AUTOMATICALLY_REMOVE_PROBLEM_FILTERS };
@@ -540,6 +541,7 @@ public class ApiErrorsWarningsConfigurationBlock extends ConfigurationBlock {
KEY_INCOMPATIBLE_API_COMPONENT_VERSION_INCLUDE_INCLUDE_MAJOR_WITHOUT_BREAKING_CHANGE,
KEY_REPORT_API_BREAKAGE_WHEN_MAJOR_VERSION_INCREMENTED,
KEY_REPORT_RESOLUTION_ERRORS_API_COMPONENT,
+ KEY_UNSUPPORTED_BYTECODES,
KEY_AUTOMATICALLY_REMOVE_PROBLEM_FILTERS,
KEY_API_USE_SCAN_TYPE_PROBLEM, KEY_API_USE_SCAN_METHOD_PROBLEM,
KEY_API_USE_SCAN_FIELD_PROBLEM };
@@ -1078,8 +1080,10 @@ public class ApiErrorsWarningsConfigurationBlock extends ConfigurationBlock {
Composite vcomp = SWTFactory.createComposite(page, 2, 1, GridData.FILL_BOTH);
initializeComboControls(vcomp, new String[] {
PreferenceMessages.ReportApiComponentResolutionFailure,
+ PreferenceMessages.ApiBaselinesConfigurationBlock_unsupported_bytecodes,
PreferenceMessages.ApiErrorsWarningsConfigurationBlock_unused_problem_filters, }, new Key[] {
KEY_REPORT_RESOLUTION_ERRORS_API_COMPONENT,
+ KEY_UNSUPPORTED_BYTECODES,
KEY_UNUSED_PROBLEM_FILTERS });
addCheckBox(vcomp, PreferenceMessages.ApiErrorsWarningsConfigurationBlock_automatically_remove_problem_filters, KEY_AUTOMATICALLY_REMOVE_PROBLEM_FILTERS, CHECKBOX_VALUES, 0);
}
diff --git a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/preferences/PreferenceMessages.java b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/preferences/PreferenceMessages.java
index c71422883d..ccc4326789 100644
--- a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/preferences/PreferenceMessages.java
+++ b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/preferences/PreferenceMessages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -14,6 +14,7 @@ import org.eclipse.osgi.util.NLS;
public class PreferenceMessages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.pde.api.tools.ui.internal.preferences.preferencemessages"; //$NON-NLS-1$
+ public static String ApiBaselinesConfigurationBlock_unsupported_bytecodes;
public static String ApiErrorsWarningsConfigurationBlock_0;
public static String ApiErrorsWarningsConfigurationBlock_1;
public static String ApiErrorsWarningsConfigurationBlock_2;
diff --git a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/preferences/preferencemessages.properties b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/preferences/preferencemessages.properties
index f4471682cf..ed1fede9d7 100644
--- a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/preferences/preferencemessages.properties
+++ b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/preferences/preferencemessages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2008, 2013 IBM Corporation and others.
+# Copyright (c) 2008, 2014 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
@@ -8,6 +8,7 @@
# Contributors:
# IBM Corporation - initial API and implementation
###############################################################################
+ApiBaselinesConfigurationBlock_unsupported_bytecodes=&Unsupported bytecodes:
ApiErrorsWarningsConfigurationBlock_0=Error and warning settings have changed. A full build is required for the changes to take effect.\n\nDo a full build now?
ApiErrorsWarningsConfigurationBlock_1=Error and warning settings have changed. A rebuild of the project is required for the changes to take effect.\n\nRebuild {0} now?
ApiErrorsWarningsConfigurationBlock_2=Settings Changed
diff --git a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/wizards/JavadocConversionPage.java b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/wizards/JavadocConversionPage.java
index ce6bd0d5bb..c0b4504004 100644
--- a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/wizards/JavadocConversionPage.java
+++ b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/wizards/JavadocConversionPage.java
@@ -196,7 +196,7 @@ public class JavadocConversionPage extends UserInputWizardPage {
* @throws CoreException
*/
void collectUpdates(IType type, IElementDescriptor element, IApiDescription description) throws CoreException {
- ASTParser parser = ASTParser.newParser(AST.JLS4);
+ ASTParser parser = ASTParser.newParser(AST.JLS8);
ICompilationUnit cunit = type.getCompilationUnit();
if (cunit != null) {
this.monitor.setTaskName(NLS.bind(WizardMessages.JavadocConversionPage_scan_javadoc_to_convert, new Object[] { type.getFullyQualifiedName() }));
diff --git a/apitools/org.eclipse.pde.api.tools/META-INF/MANIFEST.MF b/apitools/org.eclipse.pde.api.tools/META-INF/MANIFEST.MF
index c19b26fc5b..e7d77791c1 100644
--- a/apitools/org.eclipse.pde.api.tools/META-INF/MANIFEST.MF
+++ b/apitools/org.eclipse.pde.api.tools/META-INF/MANIFEST.MF
@@ -14,7 +14,7 @@ Require-Bundle: org.eclipse.osgi;bundle-version="[3.4.0,4.0.0)",
org.eclipse.text;bundle-version="[3.4.0,4.0.0)",
org.eclipse.core.filebuffers;bundle-version="[3.4.0,4.0.0)",
org.eclipse.ant.core;bundle-version="[3.1.300,4.0.0)",
- org.objectweb.asm;bundle-version="[3.2.0,4.0.0)",
+ org.objectweb.asm;bundle-version="[5.0.0,6.0.0)",
org.eclipse.team.core;bundle-version="[3.4.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="[1.2.0,2.0.0)",
org.eclipse.equinox.frameworkadmin;bundle-version="[2.0.0,3.0.0)",
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/ApiDescriptionProcessor.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/ApiDescriptionProcessor.java
index 8809bd59f1..52ae7f8328 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/ApiDescriptionProcessor.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/ApiDescriptionProcessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -580,7 +580,7 @@ public class ApiDescriptionProcessor {
* @throws BadLocationException
*/
static void processTagUpdates(IType type, IReferenceTypeDescriptor desc, IApiDescription description, List<IElementDescriptor> members, Map<IFile, Set<TextEdit>> collector) throws CoreException, BadLocationException {
- ASTParser parser = ASTParser.newParser(AST.JLS4);
+ ASTParser parser = ASTParser.newParser(AST.JLS8);
ICompilationUnit cunit = type.getCompilationUnit();
if (cunit != null) {
parser.setSource(cunit);
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/ApiPluginPreferenceInitializer.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/ApiPluginPreferenceInitializer.java
index 7efa60a434..950a9f7050 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/ApiPluginPreferenceInitializer.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/ApiPluginPreferenceInitializer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -67,6 +67,7 @@ public class ApiPluginPreferenceInitializer extends AbstractPreferenceInitialize
node.put(IApiProblemTypes.INCOMPATIBLE_API_COMPONENT_VERSION_INCLUDE_INCLUDE_MAJOR_WITHOUT_BREAKING_CHANGE, ApiPlugin.VALUE_DISABLED);
node.put(IApiProblemTypes.MISSING_DEFAULT_API_BASELINE, ApiPlugin.VALUE_ERROR);
+ node.put(IApiProblemTypes.UNSUPPORTED_BYTECODES, ApiPlugin.VALUE_WARNING);
node.put(IApiProblemTypes.MISSING_EE_DESCRIPTIONS, ApiPlugin.VALUE_ERROR);
// api component resolution
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/CoreMessages.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/CoreMessages.java
index 3c93beeb6e..7c84ba7704 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/CoreMessages.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/CoreMessages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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 @@ public class CoreMessages extends NLS {
public static String JavadocTagManager_class_no_reference;
public static String JavadocTagManager_class_no_subclass;
public static String JavadocTagManager_constructor_no_reference;
+ public static String JavadocTagManager_default_method_no_override;
public static String JavadocTagManager_enum_field_no_reference;
public static String JavadocTagManager_enum_method_no_reference;
public static String JavadocTagManager_enum_no_reference;
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/JavadocTagManager.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/JavadocTagManager.java
index de8a80fed3..ebfcf77044 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/JavadocTagManager.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/JavadocTagManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -276,6 +276,7 @@ public final class JavadocTagManager {
newtag = new ApiJavadocTag(IApiJavadocTag.NO_OVERRIDE_TAG_ID, "nooverride", //$NON-NLS-1$
RestrictionModifiers.NO_OVERRIDE);
newtag.setApplicableTo(IApiJavadocTag.TYPE_CLASS, IApiJavadocTag.MEMBER_METHOD, CoreMessages.JavadocTagManager_method_no_overried);
+ newtag.setApplicableTo(IApiJavadocTag.TYPE_INTERFACE, IApiJavadocTag.MEMBER_METHOD, CoreMessages.JavadocTagManager_default_method_no_override);
tagcache.put(newtag.getTagId(), newtag);
list.add(newtag);
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/AbstractIllegalTypeReference.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/AbstractIllegalTypeReference.java
index 99c786e8ec..c9bbc881ae 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/AbstractIllegalTypeReference.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/AbstractIllegalTypeReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -130,7 +130,7 @@ public abstract class AbstractIllegalTypeReference extends AbstractProblemDetect
String name = ltype.getSimpleName();
ICompilationUnit cunit = type.getCompilationUnit();
if (cunit.isWorkingCopy()) {
- cunit.reconcile(AST.JLS4, false, null, null);
+ cunit.reconcile(AST.JLS8, false, null, null);
}
IType localtype = type;
method = getEnclosingMethod(type, reference, doc);
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/AbstractProblemDetector.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/AbstractProblemDetector.java
index dbbc4c5678..d6856ea33c 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/AbstractProblemDetector.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/AbstractProblemDetector.java
@@ -629,7 +629,7 @@ public abstract class AbstractProblemDetector implements IApiProblemDetector {
String name = apitype.getSimpleName();
ICompilationUnit cunit = type.getCompilationUnit();
if (cunit.isWorkingCopy()) {
- cunit.reconcile(AST.JLS4, false, null, null);
+ cunit.reconcile(AST.JLS8, false, null, null);
}
IMethod method = getEnclosingMethod(type, reference, doc);
if (method != null) {
@@ -687,7 +687,7 @@ public abstract class AbstractProblemDetector implements IApiProblemDetector {
if (method == null) {
// look it up the hard way
ISourceRange range = jtype.getCompilationUnit().getSourceRange();
- ASTParser parser = ASTParser.newParser(AST.JLS4);
+ ASTParser parser = ASTParser.newParser(AST.JLS8);
parser.setSource(jtype.getCompilationUnit());
parser.setSourceRange(range.getOffset(), range.getLength());
parser.setResolveBindings(true);
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/BaseApiAnalyzer.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/BaseApiAnalyzer.java
index db11899922..358df80563 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/BaseApiAnalyzer.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/BaseApiAnalyzer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -228,7 +228,8 @@ public class BaseApiAnalyzer implements IApiAnalyzer {
bcontext = new BuildContext();
}
boolean checkfilters = false;
- if (baseline != null) {
+ boolean unsupported = unsupportedByteCodes();
+ if (baseline != null && !unsupported) {
IApiComponent reference = baseline.getApiComponent(component.getSymbolicName());
this.fBuildState = state;
if (fBuildState == null) {
@@ -258,12 +259,16 @@ public class BaseApiAnalyzer implements IApiAnalyzer {
Util.updateMonitor(localMonitor);
checkfilters = true;
} else {
- // check default baseline
- checkDefaultBaselineSet();
+ if (unsupported) {
+ reportUnsupportedBytecodes();
+ } else {
+ // check default baseline
+ checkDefaultBaselineSet();
+ }
Util.updateMonitor(localMonitor);
}
- // check E description status
+ // check EE description status
checkEEDescriptions();
// usage checks
@@ -295,6 +300,37 @@ public class BaseApiAnalyzer implements IApiAnalyzer {
}
/**
+ * Returns if the component is using bytecodes that are not supported by the
+ * current version of ASM. Checks the JDT core settings for class file +
+ * compiler options<br>
+ * <br>
+ * For Luna there are no unsupported bytecodes, for Kepler, Java 8 is
+ * unsupported
+ *
+ * @return true if the backing project is configured to create bytecodes
+ * that are not supported
+ */
+ private boolean unsupportedByteCodes() {
+ return false;
+ // fJavaProject != null &&
+ // JavaCore.VERSION_1_8.equals(fJavaProject.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM,
+ // true)) &&
+ // JavaCore.VERSION_1_8.equals(fJavaProject.getOption(JavaCore.COMPILER_COMPLIANCE,
+ // true));
+ }
+
+ /**
+ * Creates a new problem marker on the project using the unsupported
+ * bytecodes
+ */
+ private void reportUnsupportedBytecodes() {
+ if (fJavaProject != null && (ApiPlugin.getDefault().getSeverityLevel(IApiProblemTypes.UNSUPPORTED_BYTECODES, fJavaProject.getProject()) != ApiPlugin.SEVERITY_IGNORE)) {
+ IApiProblem pb = ApiProblemFactory.newApiComponentResolutionProblem(Path.EMPTY.toString(), new String[] { fJavaProject.getElementName() }, new String[] { IApiMarkerConstants.API_MARKER_ATTR_ID }, new Object[] { new Integer(IApiMarkerConstants.API_COMPONENT_RESOLUTION_MARKER_ID) }, IElementDescriptor.RESOURCE, IApiProblem.UNSUPPORTED_BYTECODES);
+ addProblem(pb);
+ }
+ }
+
+ /**
* Sets whether to continue analyzing a component even if it has resolution
* errors. By default this is false. The workspace builder should not
* analyze components with errors to avoid polluting the project with
@@ -811,7 +847,7 @@ public class BaseApiAnalyzer implements IApiAnalyzer {
if (fJavaProject == null) {
return null;
}
- ASTParser parser = ASTParser.newParser(AST.JLS4);
+ ASTParser parser = ASTParser.newParser(AST.JLS8);
parser.setFocalPosition(offset);
parser.setResolveBindings(false);
parser.setSource(root);
@@ -2303,4 +2339,4 @@ public class BaseApiAnalyzer implements IApiAnalyzer {
}
return false;
}
-}
+} \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/BuilderMessages.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/BuilderMessages.java
index 0f31e81431..b06d2ae57b 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/BuilderMessages.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/BuilderMessages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -86,6 +86,7 @@ public class BuilderMessages extends NLS {
public static String TagValidator_enum_field;
public static String TagValidator_enum_not_visible;
public static String TagValidator_final_constructor;
+ public static String TagValidator_nondefault_interface_method;
public static String TagValidator_not_visible_constructor;
public static String TagValidator_not_visible_enum_field;
public static String TagValidator_not_visible_enum_method;
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/ReferenceExtractor.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/ReferenceExtractor.java
index 619d454b59..225758cd6e 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/ReferenceExtractor.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/ReferenceExtractor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -36,11 +36,10 @@ import org.eclipse.pde.api.tools.internal.util.Signatures;
import org.eclipse.pde.api.tools.internal.util.Util;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.Attribute;
-import org.objectweb.asm.ClassAdapter;
import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.Label;
-import org.objectweb.asm.MethodAdapter;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
@@ -53,7 +52,7 @@ import org.objectweb.asm.tree.ClassNode;
*
* @since 1.0.0
*/
-public class ReferenceExtractor extends ClassAdapter {
+public class ReferenceExtractor extends ClassVisitor {
/**
* A visitor for visiting java 5+ signatures
@@ -66,7 +65,7 @@ public class ReferenceExtractor extends ClassAdapter {
* visitArrayType | (visitClassType visitTypeArgument* (visitInnerClassType
* visitTypeArgument* )* visitEnd</tt> ) )
*/
- class ClassFileSignatureVisitor implements SignatureVisitor {
+ class ClassFileSignatureVisitor extends SignatureVisitor {
protected int kind = -1;
protected int originalkind = -1;
@@ -77,6 +76,7 @@ public class ReferenceExtractor extends ClassAdapter {
protected List<Reference> references;
public ClassFileSignatureVisitor() {
+ super(Opcodes.ASM5);
this.references = new ArrayList<Reference>();
}
@@ -288,7 +288,7 @@ public class ReferenceExtractor extends ClassAdapter {
* visit<i>X</i>Insn | visitLabel | visitTryCatchBlock | visitLocalVariable
* | visitLineNumber)* visitMaxs ] visitEnd
*/
- class ClassFileMethodVisitor extends MethodAdapter {
+ class ClassFileMethodVisitor extends MethodVisitor {
int argumentcount = 0;
LinePositionTracker linePositionTracker;
/**
@@ -309,7 +309,7 @@ public class ReferenceExtractor extends ClassAdapter {
* @param mv
*/
public ClassFileMethodVisitor(MethodVisitor mv, String name, int argumentcount) {
- super(mv);
+ super(Opcodes.ASM5, mv);
this.argumentcount = argumentcount;
this.linePositionTracker = new LinePositionTracker();
this.lastLineNumber = -1;
@@ -704,7 +704,11 @@ public class ReferenceExtractor extends ClassAdapter {
*
* @since 1.0.600
*/
- class ClassFileFieldVisitor implements FieldVisitor {
+ class ClassFileFieldVisitor extends FieldVisitor {
+
+ ClassFileFieldVisitor() {
+ super(Opcodes.ASM5);
+ }
/*
* (non-Javadoc)
@@ -1078,7 +1082,7 @@ public class ReferenceExtractor extends ClassAdapter {
* {@link ReferenceModifiers}
*/
public ReferenceExtractor(IApiType type, Set<Reference> collector, int referenceKinds) {
- super(new ClassNode());
+ super(Opcodes.ASM5, new ClassNode());
fType = type;
this.collector = collector;
fReferenceKinds = referenceKinds;
@@ -1095,7 +1099,7 @@ public class ReferenceExtractor extends ClassAdapter {
* @param tracker
*/
protected ReferenceExtractor(IApiType type, Set<Reference> collector, int referenceKinds, FieldTracker tracker) {
- super(new ClassNode());
+ super(Opcodes.ASM5, new ClassNode());
fType = type;
this.collector = collector;
fReferenceKinds = referenceKinds;
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/TagValidator.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/TagValidator.java
index ea2eae51b2..c3fb67c585 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/TagValidator.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/TagValidator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -376,6 +376,8 @@ public class TagValidator extends Validator {
createTagProblem(item.typename, tag, IElementDescriptor.METHOD, IApiProblem.UNSUPPORTED_TAG_USE, IApiMarkerConstants.UNSUPPORTED_TAG_MARKER_ID, BuilderMessages.TagValidator_an_interface_method);
} else if (!item.visible) {
createTagProblem(item.typename, tag, IElementDescriptor.METHOD, IApiProblem.UNSUPPORTED_TAG_USE, IApiMarkerConstants.UNSUPPORTED_TAG_MARKER_ID, BuilderMessages.TagValidator_not_visible_interface_method);
+ } else if (!Flags.isDefaultMethod(mods) && JavadocTagManager.TAG_NOOVERRIDE.equals(tagname)) {
+ createTagProblem(item.typename, tag, IElementDescriptor.METHOD, IApiProblem.UNSUPPORTED_TAG_USE, IApiMarkerConstants.UNSUPPORTED_TAG_MARKER_ID, BuilderMessages.TagValidator_nondefault_interface_method);
}
break;
}
@@ -692,6 +694,8 @@ public class TagValidator extends Validator {
createAnnotationProblem(item.typename, node, IElementDescriptor.METHOD, IApiProblem.UNSUPPORTED_ANNOTATION_USE, IApiMarkerConstants.UNSUPPORTED_ANNOTATION_MARKER_ID, BuilderMessages.TagValidator_an_interface_method);
} else if (!item.visible) {
createAnnotationProblem(item.typename, node, IElementDescriptor.METHOD, IApiProblem.UNSUPPORTED_ANNOTATION_USE, IApiMarkerConstants.UNSUPPORTED_ANNOTATION_MARKER_ID, BuilderMessages.TagValidator_not_visible_interface_method);
+ } else if (!Flags.isDefaultMethod(flags) && JavadocTagManager.TAG_NOOVERRIDE.equals(name)) {
+ createAnnotationProblem(item.typename, node, IElementDescriptor.METHOD, IApiProblem.UNSUPPORTED_ANNOTATION_USE, IApiMarkerConstants.UNSUPPORTED_ANNOTATION_MARKER_ID, BuilderMessages.TagValidator_nondefault_interface_method);
}
break;
}
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/buildermessages.properties b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/buildermessages.properties
index 7cd3e41f0c..1208f6abde 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/buildermessages.properties
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/buildermessages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2008, 2013 IBM Corporation and others.
+# Copyright (c) 2008, 2014 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
@@ -74,6 +74,7 @@ TagValidator_constructor_in_final_class=a constructor in a final class
TagValidator_enum_field=an enum field
TagValidator_enum_not_visible=an enum that is not visible
TagValidator_final_constructor=a final constructor
+TagValidator_nondefault_interface_method=a non-default interface method
TagValidator_not_visible_constructor=a constructor that is not visible
TagValidator_not_visible_enum_field=an enum field that is not visible
TagValidator_not_visible_enum_method=an enum method that is not visible
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/SignatureDecoder.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/SignatureDecoder.java
index 8b5f353821..d33c6d7088 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/SignatureDecoder.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/comparator/SignatureDecoder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -10,12 +10,13 @@
*******************************************************************************/
package org.eclipse.pde.api.tools.internal.comparator;
+import org.objectweb.asm.Opcodes;
import org.objectweb.asm.signature.SignatureVisitor;
/**
* This class is used to decode a generic signature for class or method
*/
-final class SignatureDecoder implements SignatureVisitor {
+final class SignatureDecoder extends SignatureVisitor {
static final int CLASS_BOUND = 1;
static final int DEFAULT = 0;
static final int INTERFACE_BOUND = 2;
@@ -28,6 +29,7 @@ final class SignatureDecoder implements SignatureVisitor {
SignatureDescriptor signatureDescriptor;
public SignatureDecoder(SignatureDescriptor signatureDescriptor) {
+ super(Opcodes.ASM5);
this.signatureDescriptor = signatureDescriptor;
}
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/coremessages.properties b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/coremessages.properties
index 76c69fa9a4..d6704e610b 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/coremessages.properties
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/coremessages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2008, 2013 IBM Corporation and others.
+# Copyright (c) 2008, 2014 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
@@ -21,6 +21,7 @@ JavadocTagManager_class_no_instantiate=This class is not intended to be instanti
JavadocTagManager_class_no_reference=This class is not intended to be referenced by clients.
JavadocTagManager_class_no_subclass=This class is not intended to be subclassed by clients.
JavadocTagManager_constructor_no_reference=This constructor is not intended to be referenced by clients.
+JavadocTagManager_default_method_no_override=This default method is not intended to be re-implemented or extended by clients.
JavadocTagManager_enum_field_no_reference=This enum field is not intended to be referenced by clients.
JavadocTagManager_enum_method_no_reference=This enum method is not intended to be referenced by clients.
JavadocTagManager_enum_no_reference=This enum is not intended to be referenced by clients.
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/BundleComponent.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/BundleComponent.java
index d9256fe290..51a9d7bf3a 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/BundleComponent.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/BundleComponent.java
@@ -1244,9 +1244,11 @@ public class BundleComponent extends Component {
temp = new String[] { ProfileModifiers.J2SE_1_5_NAME };
} else if (ProfileModifiers.isJAVASE_1_6(values)) {
temp = new String[] { ProfileModifiers.JAVASE_1_6_NAME };
- } else {
- // this is 1.7
+ } else if (ProfileModifiers.isJAVASE_1_7(values)) {
temp = new String[] { ProfileModifiers.JAVASE_1_7_NAME };
+ } else {
+ // this is 1.8
+ temp = new String[] { ProfileModifiers.JAVASE_1_8_NAME };
}
}
if (ProfileModifiers.isCDC_Foundation(values)) {
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/TypeStructureBuilder.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/TypeStructureBuilder.java
index 41ba0de3ee..42a019d528 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/TypeStructureBuilder.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/TypeStructureBuilder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -14,8 +14,6 @@ package org.eclipse.pde.api.tools.internal.model;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
@@ -30,21 +28,18 @@ import org.eclipse.pde.api.tools.internal.provisional.model.IApiComponent;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiType;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiTypeRoot;
import org.objectweb.asm.AnnotationVisitor;
-import org.objectweb.asm.ClassAdapter;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.Label;
-import org.objectweb.asm.MethodAdapter;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.util.TraceAnnotationVisitor;
/**
* Class adapter used to create an API type structure
*/
-public class TypeStructureBuilder extends ClassAdapter {
+public class TypeStructureBuilder extends ClassVisitor {
ApiType fType;
IApiComponent fComponent;
IApiTypeRoot fFile;
@@ -59,14 +54,15 @@ public class TypeStructureBuilder extends ClassAdapter {
* unknown
*/
TypeStructureBuilder(ClassVisitor cv, IApiComponent component, IApiTypeRoot file) {
- super(cv);
+ super(Opcodes.ASM5, cv);
fComponent = component;
fFile = file;
}
- /**
- * @see org.objectweb.asm.ClassAdapter#visit(int, int, java.lang.String,
- * java.lang.String, java.lang.String, java.lang.String[])
+ /*
+ * (non-Javadoc)
+ * @see org.objectweb.asm.ClassVisitor#visit(int, int, java.lang.String,
+ * java.lang.String, java.lang.String, java.lang.String[])
*/
@Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
@@ -100,9 +96,10 @@ public class TypeStructureBuilder extends ClassAdapter {
super.visit(version, laccess, name, signature, superName, interfaces);
}
- /**
- * @see org.objectweb.asm.ClassAdapter#visitInnerClass(java.lang.String,
- * java.lang.String, java.lang.String, int)
+ /*
+ * (non-Javadoc)
+ * @see org.objectweb.asm.ClassVisitor#visitInnerClass(java.lang.String,
+ * java.lang.String, java.lang.String, int)
*/
@Override
public void visitInnerClass(String name, String outerName, String innerName, int access) {
@@ -135,7 +132,7 @@ public class TypeStructureBuilder extends ClassAdapter {
/*
* (non-Javadoc)
- * @see org.objectweb.asm.ClassAdapter#visitOuterClass(java.lang.String,
+ * @see org.objectweb.asm.ClassVisitor#visitOuterClass(java.lang.String,
* java.lang.String, java.lang.String)
*/
@Override
@@ -145,7 +142,7 @@ public class TypeStructureBuilder extends ClassAdapter {
/*
* (non-Javadoc)
- * @see org.objectweb.asm.ClassAdapter#visitField(int, java.lang.String,
+ * @see org.objectweb.asm.ClassVisitor#visitField(int, java.lang.String,
* java.lang.String, java.lang.String, java.lang.Object)
*/
@Override
@@ -161,7 +158,7 @@ public class TypeStructureBuilder extends ClassAdapter {
/*
* (non-Javadoc)
- * @see org.objectweb.asm.ClassAdapter#visitMethod(int, java.lang.String,
+ * @see org.objectweb.asm.ClassVisitor#visitMethod(int, java.lang.String,
* java.lang.String, java.lang.String, java.lang.String[])
*/
@Override
@@ -179,7 +176,7 @@ public class TypeStructureBuilder extends ClassAdapter {
}
}
final ApiMethod method = fType.addMethod(name, desc, signature, laccess, names);
- return new MethodAdapter(super.visitMethod(laccess, name, desc, signature, exceptions)) {
+ return new MethodVisitor(Opcodes.ASM5, super.visitMethod(laccess, name, desc, signature, exceptions)) {
@Override
public AnnotationVisitor visitAnnotation(String sig, boolean visible) {
if (visible && "Ljava/lang/invoke/MethodHandle$PolymorphicSignature;".equals(sig)) { //$NON-NLS-1$
@@ -190,23 +187,88 @@ public class TypeStructureBuilder extends ClassAdapter {
@Override
public AnnotationVisitor visitAnnotationDefault() {
- return new TraceAnnotationVisitor() {
- @Override
- public void visitEnd() {
- super.visitEnd();
- StringWriter stringWriter = new StringWriter();
- PrintWriter writer = new PrintWriter(stringWriter);
- print(writer);
- writer.flush();
- writer.close();
- String def = String.valueOf(stringWriter.getBuffer());
- method.setDefaultValue(def);
- }
- };
+ return new AnnotationDefaultVisitor(method);
}
};
}
+ private static IApiType logAndReturn(IApiTypeRoot file, Exception e) {
+ if (ApiPlugin.DEBUG_BUILDER) {
+ IStatus status = new Status(IStatus.ERROR, ApiPlugin.PLUGIN_ID, NLS.bind(Messages.TypeStructureBuilder_badClassFileEncountered, file.getTypeName()), e);
+ ApiPlugin.log(status);
+ }
+ return null;
+ }
+
+ /**
+ * Visit the default value for an annotation
+ */
+ static class AnnotationDefaultVisitor extends AnnotationVisitor {
+ ApiMethod method;
+ Object value;
+ StringBuffer buff = new StringBuffer();
+ boolean trace = false;
+ int traceCount = 0;
+
+ public AnnotationDefaultVisitor(ApiMethod method) {
+ super(Opcodes.ASM5);
+ this.method = method;
+ }
+
+ @Override
+ public void visit(String name, Object value) {
+ if (trace) {
+ appendValue(value);
+ traceCount++;
+ return;
+ }
+ this.value = value;
+ }
+
+ @Override
+ public AnnotationVisitor visitAnnotation(String name, String desc) {
+ trace = true;
+ return this;
+ }
+
+ @Override
+ public void visitEnum(String name, String desc, String value) {
+ if (trace) {
+ appendValue(value);
+ traceCount++;
+ return;
+ }
+ this.value = value;
+ }
+
+ @Override
+ public AnnotationVisitor visitArray(String name) {
+ trace = true;
+ return this;
+ }
+
+ @Override
+ public void visitEnd() {
+ if (trace) {
+ this.value = buff.toString();
+ traceCount--;
+ trace = traceCount != 0;
+ } else {
+ method.setDefaultValue(this.value == null ? null : this.value.toString());
+ }
+ }
+
+ void appendValue(Object val) {
+ if (val != null) {
+ if (buff.length() < 1) {
+ buff.append(val.toString());
+ } else {
+ buff.append(',').append(val.toString());
+ }
+ }
+ }
+ }
+
/**
* Builds a type structure with the given .class file bytes in the specified
* API component.
@@ -222,11 +284,11 @@ public class TypeStructureBuilder extends ClassAdapter {
ClassReader classReader = new ClassReader(bytes);
classReader.accept(visitor, ClassReader.SKIP_CODE | ClassReader.SKIP_FRAMES);
} catch (ArrayIndexOutOfBoundsException e) {
- if (ApiPlugin.DEBUG_BUILDER) {
- IStatus status = new Status(IStatus.ERROR, ApiPlugin.PLUGIN_ID, NLS.bind(Messages.TypeStructureBuilder_badClassFileEncountered, file.getTypeName()), e);
- ApiPlugin.log(status);
- }
+ logAndReturn(file, e);
return null;
+ } catch (IllegalArgumentException iae) {
+ // thrown from ASM 5.0 for bad bytecodes
+ return logAndReturn(file, iae);
}
return visitor.fType;
}
@@ -260,14 +322,14 @@ public class TypeStructureBuilder extends ClassAdapter {
}
}
- static class EnclosingMethodSetter extends ClassAdapter {
+ static class EnclosingMethodSetter extends ClassVisitor {
String name;
String signature;
boolean found = false;
String typeName;
public EnclosingMethodSetter(ClassVisitor cv, String typeName) {
- super(cv);
+ super(Opcodes.ASM5, cv);
this.typeName = typeName.replace('.', '/');
}
@@ -296,11 +358,11 @@ public class TypeStructureBuilder extends ClassAdapter {
}
}
- static class TypeNameFinder extends MethodAdapter {
+ static class TypeNameFinder extends MethodVisitor {
protected EnclosingMethodSetter setter;
public TypeNameFinder(MethodVisitor mv, EnclosingMethodSetter enclosingMethodSetter) {
- super(mv);
+ super(Opcodes.ASM5, mv);
this.setter = enclosingMethodSetter;
}
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/problems/ApiProblemFactory.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/problems/ApiProblemFactory.java
index babe2252ea..b7e144c1a5 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/problems/ApiProblemFactory.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/problems/ApiProblemFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -932,6 +932,8 @@ public class ApiProblemFactory {
switch (kind) {
case IApiProblem.API_COMPONENT_RESOLUTION:
return 99;
+ case IApiProblem.UNSUPPORTED_BYTECODES:
+ return 43;
default:
break;
}
@@ -990,6 +992,8 @@ public class ApiProblemFactory {
switch (problem.getKind()) {
case IApiProblem.API_COMPONENT_RESOLUTION:
return IApiProblemTypes.REPORT_RESOLUTION_ERRORS_API_COMPONENT;
+ case IApiProblem.UNSUPPORTED_BYTECODES:
+ return IApiProblemTypes.UNSUPPORTED_BYTECODES;
default:
break;
}
@@ -1090,4 +1094,4 @@ public class ApiProblemFactory {
}
return null;
}
-}
+} \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/problems/problemmessages.properties b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/problems/problemmessages.properties
index 5e824146b2..f8caaea6d9 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/problems/problemmessages.properties
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/problems/problemmessages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2008, 2013 IBM Corporation and others.
+# Copyright (c) 2008, 2014 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
@@ -14,7 +14,8 @@
#API baseline
1 = An API baseline has not been set for the current workspace.
31 = API analysis aborted for ''{0}'' since its build path is incomplete
-38 = Execution environment references were not checked for ''{0}'' because no environment descriptions are installed.
+38 = Execution environment references were not checked for ''{0}'' because no environment descriptions are installed.
+43 = API compatibility analysis aborted for ''{0}'' since its class files contains unsupported bytecodes.
#invalid since tag problems
2 = Invalid @since {0} tag on {2}; expecting @since {1}
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/ProfileModifiers.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/ProfileModifiers.java
index bc3e760515..48d6e81ab8 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/ProfileModifiers.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/ProfileModifiers.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -22,6 +22,8 @@ package org.eclipse.pde.api.tools.internal.provisional;
* <li>J2SE-1.4</li>
* <li>J2SE-1.5</li>
* <li>JavaSE-1.6</li>
+ * <li>JavaSE-1.7</li>
+ * <li>JavaSE-1.8</li>
* <li>JRE-1.1</li>
* <li>OSGi_Minimum-1.0</li>
* <li>OSGi_Minimum-1.1</li>
@@ -42,6 +44,7 @@ public final class ProfileModifiers {
public static final String J2SE_1_5_NAME = "J2SE-1.5"; //$NON-NLS-1$
public static final String JAVASE_1_6_NAME = "JavaSE-1.6"; //$NON-NLS-1$
public static final String JAVASE_1_7_NAME = "JavaSE-1.7"; //$NON-NLS-1$
+ public static final String JAVASE_1_8_NAME = "JavaSE-1.8"; //$NON-NLS-1$
public static final String JRE_1_1_NAME = "JRE-1.1"; //$NON-NLS-1$
public static final String OSGI_MINIMUM_1_0_NAME = "OSGi/Minimum-1.0"; //$NON-NLS-1$
public static final String OSGI_MINIMUM_1_1_NAME = "OSGi/Minimum-1.1"; //$NON-NLS-1$
@@ -97,12 +100,18 @@ public final class ProfileModifiers {
/**
* Constant indicating the corresponding element has been defined in the
- * JavaSE-1.6 profile
+ * JavaSE-1.7 profile
*/
public static final int JAVASE_1_7 = 0x0100;
/**
* Constant indicating the corresponding element has been defined in the
+ * JavaSE-1.8 profile
+ */
+ public static final int JAVASE_1_8 = 0x1000;
+
+ /**
+ * /** Constant indicating the corresponding element has been defined in the
* OSGi_Minimum-1.0 profile
*/
public static final int OSGI_MINIMUM_1_0 = 0x0200;
@@ -132,7 +141,7 @@ public final class ProfileModifiers {
/**
* Constant indicating all the jres profiles are defined
*/
- public static final int JRES_MAX = JRE_1_1 | J2SE_1_2 | J2SE_1_3 | J2SE_1_4 | J2SE_1_5 | JAVASE_1_6 | JAVASE_1_7;
+ public static final int JRES_MAX = JRE_1_1 | J2SE_1_2 | J2SE_1_3 | J2SE_1_4 | J2SE_1_5 | JAVASE_1_6 | JAVASE_1_7 | JAVASE_1_8;
/**
* Constructor no instantiating
@@ -231,6 +240,17 @@ public final class ProfileModifiers {
}
/**
+ * Returns if the JAVASE_1_8 modifier has been set in the given modifiers.
+ *
+ * @param modifiers the given modifiers
+ * @return true if the JAVASE_1_8 modifier has been set in the specified
+ * modifiers, false otherwise
+ */
+ public static boolean isJAVASE_1_8(int modifiers) {
+ return (modifiers & JAVASE_1_8) > 0;
+ }
+
+ /**
* Returns if the JRE_1_1 modifier has been set in the given modifiers.
*
* @param modifiers the given modifiers
@@ -305,6 +325,9 @@ public final class ProfileModifiers {
if (JAVASE_1_7_NAME.equals(profileName)) {
return JAVASE_1_7;
}
+ if (JAVASE_1_8_NAME.equals(profileName)) {
+ return JAVASE_1_8;
+ }
if (JRE_1_1_NAME.equals(profileName)) {
return JRE_1_1;
}
@@ -338,6 +361,8 @@ public final class ProfileModifiers {
return JAVASE_1_6_NAME;
case JAVASE_1_7:
return JAVASE_1_7_NAME;
+ case JAVASE_1_8:
+ return JAVASE_1_8_NAME;
case JRE_1_1:
return JRE_1_1_NAME;
case OSGI_MINIMUM_1_0:
@@ -382,6 +407,7 @@ public final class ProfileModifiers {
return new int[] {
CDC_1_0_FOUNDATION_1_0, CDC_1_1_FOUNDATION_1_1, JRE_1_1,
J2SE_1_2, J2SE_1_3, J2SE_1_4, J2SE_1_5, JAVASE_1_6, JAVASE_1_7,
- OSGI_MINIMUM_1_0, OSGI_MINIMUM_1_1, OSGI_MINIMUM_1_2, };
+ JAVASE_1_8, OSGI_MINIMUM_1_0, OSGI_MINIMUM_1_1,
+ OSGI_MINIMUM_1_2, };
}
-}
+} \ No newline at end of file
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/problems/IApiProblem.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/problems/IApiProblem.java
index c66123f101..066681244b 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/problems/IApiProblem.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/problems/IApiProblem.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -464,6 +464,14 @@ public interface IApiProblem {
*/
public static final int API_COMPONENT_RESOLUTION = 1;
/**
+ * Constant representing the problem kind for unsupported bytecodes <br>
+ * Value is: <code>2</code>
+ *
+ * @see #getKind()
+ * @see #CATEGORY_API_COMPONENT_RESOLUTION
+ */
+ public static final int UNSUPPORTED_BYTECODES = 2;
+ /**
* Constant representing the value of a workspace baseline resolution
* {@link IApiProblem} kind. <br>
* Value is: <code>1</code>
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/problems/IApiProblemTypes.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/problems/IApiProblemTypes.java
index 1268270198..35713f8751 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/problems/IApiProblemTypes.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/problems/IApiProblemTypes.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 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
@@ -123,6 +123,7 @@ public interface IApiProblemTypes {
public static final String INCOMPATIBLE_API_COMPONENT_VERSION_INCLUDE_INCLUDE_MAJOR_WITHOUT_BREAKING_CHANGE = "incompatible_api_component_version_include_major_without_breaking_change"; //$NON-NLS-1$
public static final String MISSING_DEFAULT_API_BASELINE = "missing_default_api_profile"; //$NON-NLS-1$
+ public static final String UNSUPPORTED_BYTECODES = "unsupported_bytecodes"; //$NON-NLS-1$
public static final String REPORT_RESOLUTION_ERRORS_API_COMPONENT = "report_resolution_errors_api_component"; //$NON-NLS-1$
// API usage problems
diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/scanner/TagScanner.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/scanner/TagScanner.java
index a1e947634a..837e13602f 100644
--- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/scanner/TagScanner.java
+++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/scanner/TagScanner.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
+ * Copyright (c) 2007, 2014 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
@@ -68,7 +68,7 @@ import org.eclipse.pde.api.tools.internal.util.Util;
public class TagScanner {
/**
- * Visitor to scan a compilation unit. We only care about javadoc nodes that
+ * Visitor to scan a compilation unit. We only care about Javadoc nodes that
* have either type or enum declarations as parents, so we have to override
* the ones we don't care about.
*/
@@ -249,7 +249,11 @@ public class TagScanner {
ASTNode parent = node.getParent();
if (parent instanceof TypeDeclaration) {
TypeDeclaration type = (TypeDeclaration) parent;
- if (!Flags.isFinal(type.getModifiers())) {
+ if (type.isInterface()) {
+ if (Flags.isDefaultMethod(node.getModifiers())) {
+ restrictions |= RestrictionModifiers.NO_OVERRIDE;
+ }
+ } else if (!Flags.isFinal(type.getModifiers())) {
restrictions |= RestrictionModifiers.NO_OVERRIDE;
}
} else if (parent instanceof AnonymousClassDeclaration) {
@@ -525,7 +529,11 @@ public class TagScanner {
ASTNode parent = node.getParent();
if (parent instanceof TypeDeclaration) {
TypeDeclaration type = (TypeDeclaration) parent;
- if (!Flags.isFinal(type.getModifiers())) {
+ if (type.isInterface()) {
+ if (Flags.isDefaultMethod(node.getModifiers())) {
+ restrictions |= RestrictionModifiers.NO_OVERRIDE;
+ }
+ } else if (!Flags.isFinal(type.getModifiers())) {
restrictions |= RestrictionModifiers.NO_OVERRIDE;
}
} else if (parent instanceof AnonymousClassDeclaration) {
@@ -701,7 +709,7 @@ public class TagScanner {
*/
public void scan(CompilationUnit source, IApiDescription description, IApiTypeContainer container, Map<String, String> options, IProgressMonitor monitor) throws CoreException {
SubMonitor localmonitor = SubMonitor.convert(monitor, 2);
- ASTParser parser = ASTParser.newParser(AST.JLS4);
+ ASTParser parser = ASTParser.newParser(AST.JLS8);
InputStream inputStream = null;
try {
inputStream = source.getInputStream();
diff --git a/pom.xml b/pom.xml
index 6e18dacb16..0f4366132b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2013 Eclipse Foundation and others.
+ Copyright (c) 2012, 2014 Eclipse Foundation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
@@ -53,6 +53,7 @@
<module>apitools/org.eclipse.pde.api.tools.ee.j2se15</module>
<module>apitools/org.eclipse.pde.api.tools.ee.javase16</module>
<module>apitools/org.eclipse.pde.api.tools.ee.javase17</module>
+ <module>apitools/org.eclipse.pde.api.tools.ee.javase18</module>
<module>apitools/org.eclipse.pde.api.tools.ee.jre11</module>
<module>apitools/org.eclipse.pde.api.tools.ee.osgiminimum10</module>
<module>apitools/org.eclipse.pde.api.tools.ee.osgiminimum11</module>

Back to the top