Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 102084 Details for
Bug 234023
Tag scanner does not respect source level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
234023.patch (text/plain), 9.54 KB, created by
Michael Rennie
on 2008-05-26 21:47:27 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Michael Rennie
Created:
2008-05-26 21:47:27 EDT
Size:
9.54 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.api.tools.tests >Index: src/org/eclipse/pde/api/tools/model/tests/TagScannerTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/model/tests/TagScannerTests.java,v >retrieving revision 1.10 >diff -u -r1.10 TagScannerTests.java >--- src/org/eclipse/pde/api/tools/model/tests/TagScannerTests.java 8 Apr 2008 20:06:42 -0000 1.10 >+++ src/org/eclipse/pde/api/tools/model/tests/TagScannerTests.java 27 May 2008 01:42:47 -0000 >@@ -79,7 +79,7 @@ > */ > protected void doScan(String name, IApiDescription manifest, IClassFileContainer cfc) { > try { >- TagScanner.newScanner().scan(getCompilationUnit(name), manifest, cfc); >+ TagScanner.newScanner().scan(getCompilationUnit(name), manifest, cfc, null); > } > catch(CoreException e) { > fail(MessageFormat.format("Error scanning: {0}", new String[] {name})); >@@ -93,7 +93,7 @@ > */ > protected void doScan(String name, IApiDescription manifest) { > try { >- TagScanner.newScanner().scan(getCompilationUnit(name), manifest, null); >+ TagScanner.newScanner().scan(getCompilationUnit(name), manifest, null, null); > } > catch(CoreException e) { > fail(MessageFormat.format("Error scanning: {0}", new String[] {name})); >@@ -152,7 +152,7 @@ > }; > IApiDescription manifest = newDescription(); > try { >- TagScanner.newScanner().scan(getCompilationUnit("a/b/c/TestMethod10.java"), manifest, container); >+ TagScanner.newScanner().scan(getCompilationUnit("a/b/c/TestMethod10.java"), manifest, container, null); > } catch (CoreException e) { > return; > } >#P org.eclipse.pde.api.tools >Index: src_ant/org/eclipse/pde/api/tools/internal/tasks/ApiFileGeneratorTask.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.api.tools/src_ant/org/eclipse/pde/api/tools/internal/tasks/ApiFileGeneratorTask.java,v >retrieving revision 1.3 >diff -u -r1.3 ApiFileGeneratorTask.java >--- src_ant/org/eclipse/pde/api/tools/internal/tasks/ApiFileGeneratorTask.java 26 May 2008 16:38:05 -0000 1.3 >+++ src_ant/org/eclipse/pde/api/tools/internal/tasks/ApiFileGeneratorTask.java 27 May 2008 01:42:49 -0000 >@@ -30,6 +30,7 @@ > import org.apache.tools.ant.BuildException; > import org.apache.tools.ant.Task; > import org.eclipse.core.runtime.CoreException; >+import org.eclipse.jdt.core.JavaCore; > import org.eclipse.osgi.util.ManifestElement; > import org.eclipse.pde.api.tools.internal.ApiDescription; > import org.eclipse.pde.api.tools.internal.ApiSettingsXmlVisitor; >@@ -167,7 +168,11 @@ > System.out.println("Unit name[" + i + "] : " + unit.getName()); //$NON-NLS-1$ //$NON-NLS-2$ > } > try { >- tagScanner.scan(unit, apiDescription, classFileContainer); >+ //default to highest, since we have no EE context >+ //TODO should use EE context to resolve a compliance level >+ Map options = JavaCore.getOptions(); >+ options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_6); >+ tagScanner.scan(unit, apiDescription, classFileContainer, options); > } catch (CoreException e) { > ApiPlugin.log(e); > } >Index: src/org/eclipse/pde/api/tools/internal/provisional/scanner/TagScanner.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/provisional/scanner/TagScanner.java,v >retrieving revision 1.12 >diff -u -r1.12 TagScanner.java >--- src/org/eclipse/pde/api/tools/internal/provisional/scanner/TagScanner.java 7 May 2008 15:53:16 -0000 1.12 >+++ src/org/eclipse/pde/api/tools/internal/provisional/scanner/TagScanner.java 27 May 2008 01:42:49 -0000 >@@ -24,6 +24,7 @@ > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.NullProgressMonitor; > import org.eclipse.core.runtime.Status; >+import org.eclipse.jdt.core.ICompilationUnit; > import org.eclipse.jdt.core.JavaCore; > import org.eclipse.jdt.core.Signature; > import org.eclipse.jdt.core.dom.AST; >@@ -461,7 +462,7 @@ > private TagScanner() {} > > /** >- * Scans the specified source {@linkplain CompilationUnit} for contributed API javadoc tags. >+ * Scans the specified source {@linkplain CompilationUnit} for contributed API Javadoc tags. > * Tags on methods will have unresolved signatures. > * > * @param source the source file to scan for tags >@@ -469,20 +470,37 @@ > * @throws CoreException > */ > public void scan(CompilationUnit source, IApiDescription description) throws CoreException { >- scan(source, description, null); >+ scan(source, description, null, null); >+ } >+ >+ /** >+ * Scans the specified {@link ICompilationUnit} for contributed API Javadoc tags. >+ * Tags on methods will have unresolved signatures. >+ * @param unit the compilation unit source >+ * @param description the API description to annotate with any new tag rules found >+ * @param container optional class file container containing the class file for the given source >+ * that can be used to resolve method signatures if required (for tags on methods). If >+ * not provided (<code>null</code>), method signatures will be unresolved. >+ * @throws CoreException >+ */ >+ public void scan(ICompilationUnit unit, IApiDescription description, IClassFileContainer container) throws CoreException { >+ scan(new CompilationUnit(unit), description, container, unit.getJavaProject().getOptions(true)); > } > > /** > * Scans the specified source {@linkplain CompilationUnit} for contributed API javadoc tags. >+ * Tags on methods will have unresolved signatures. > * > * @param source the source file to scan for tags > * @param description the API description to annotate with any new tag rules found > * @param container optional class file container containing the class file for the given source > * that can be used to resolve method signatures if required (for tags on methods). If > * not provided (<code>null</code>), method signatures will be unresolved. >+ * @param options a map of Java compiler options to use when creating the AST to scan >+ * > * @throws CoreException > */ >- public void scan(CompilationUnit source, IApiDescription description, IClassFileContainer container) throws CoreException { >+ public void scan(CompilationUnit source, IApiDescription description, IClassFileContainer container, Map options) throws CoreException { > ASTParser parser = ASTParser.newParser(AST.JLS3); > InputStream inputStream = null; > try { >@@ -506,7 +524,9 @@ > } > } > } >- Map options = JavaCore.getOptions(); >+ if(options == null) { >+ options = JavaCore.getOptions(); >+ } > options.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED); > parser.setCompilerOptions(options); > org.eclipse.jdt.core.dom.CompilationUnit cunit = (org.eclipse.jdt.core.dom.CompilationUnit) parser.createAST(new NullProgressMonitor()); >Index: src/org/eclipse/pde/api/tools/internal/PluginProjectApiComponent.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/PluginProjectApiComponent.java,v >retrieving revision 1.29 >diff -u -r1.29 PluginProjectApiComponent.java >--- src/org/eclipse/pde/api/tools/internal/PluginProjectApiComponent.java 22 May 2008 16:09:46 -0000 1.29 >+++ src/org/eclipse/pde/api/tools/internal/PluginProjectApiComponent.java 27 May 2008 01:42:48 -0000 >@@ -196,18 +196,16 @@ > } > TagScanner scanner = TagScanner.newScanner(); > Iterator iterator = sourceRoots.iterator(); >+ ICompilationUnit[] units = null; >+ IJavaElement[] pkgs = null; > while (iterator.hasNext()) { >- IPackageFragmentRoot root = (IPackageFragmentRoot) iterator.next(); >- IJavaElement[] pkgs = root.getChildren(); >+ pkgs = ((IPackageFragmentRoot) iterator.next()).getChildren(); > for (int i = 0; i < pkgs.length; i++) { > if (pkgs[i] instanceof IPackageFragment) { >- IPackageFragment pkg = (IPackageFragment) pkgs[i]; >- ICompilationUnit[] units = pkg.getCompilationUnits(); >+ units = ((IPackageFragment) pkgs[i]).getCompilationUnits(); > for (int j = 0; j < units.length; j++) { >- ICompilationUnit unit = units[j]; >- CompilationUnit cu = new CompilationUnit(unit.getResource().getLocation().toOSString()); > try { >- scanner.scan(cu, apiDescription, this); >+ scanner.scan(units[j], apiDescription, this); > } catch (CoreException e) { > abort("Unable to initialize from Javadoc tags", e); //$NON-NLS-1$ > } >Index: src/org/eclipse/pde/api/tools/internal/ProjectApiDescription.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/ProjectApiDescription.java,v >retrieving revision 1.20 >diff -u -r1.20 ProjectApiDescription.java >--- src/org/eclipse/pde/api/tools/internal/ProjectApiDescription.java 26 May 2008 15:30:12 -0000 1.20 >+++ src/org/eclipse/pde/api/tools/internal/ProjectApiDescription.java 27 May 2008 01:42:49 -0000 >@@ -227,7 +227,7 @@ > restrictions = RestrictionModifiers.NO_RESTRICTIONS; > fTimeStamp = resource.getModificationStamp(); > try { >- TagScanner.newScanner().scan(new CompilationUnit(unit), ProjectApiDescription.this, >+ TagScanner.newScanner().scan(unit, ProjectApiDescription.this, > getClassFileContainer((IPackageFragmentRoot) fType.getPackageFragment().getParent())); > } catch (CoreException e) { > ApiPlugin.log(e.getStatus());
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 234023
:
102084
|
104190
|
104371