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 165609 Details for
Bug 310002
ToolFactory.createScanner(..) should use workspace compliance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_310002.txt (text/plain), 3.65 KB, created by
Olivier Thomann
on 2010-04-21 13:45:15 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2010-04-21 13:45:15 EDT
Size:
3.65 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/core/ToolFactory.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ToolFactory.java,v >retrieving revision 1.81 >diff -u -r1.81 ToolFactory.java >--- model/org/eclipse/jdt/core/ToolFactory.java 21 Apr 2010 13:06:32 -0000 1.81 >+++ model/org/eclipse/jdt/core/ToolFactory.java 21 Apr 2010 17:44:30 -0000 >@@ -395,8 +395,19 @@ > * @see org.eclipse.jdt.core.compiler.IScanner > */ > public static IScanner createScanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean assertMode, boolean recordLineSeparator){ >- >- PublicScanner scanner = new PublicScanner(tokenizeComments, tokenizeWhiteSpace, false/*nls*/, assertMode ? ClassFileConstants.JDK1_4 : ClassFileConstants.JDK1_3/*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/); >+ // use default workspace compliance >+ long complianceLevelValue = CompilerOptions.versionToJdkLevel(JavaCore.getOption(JavaCore.COMPILER_COMPLIANCE)); >+ if (complianceLevelValue == 0) complianceLevelValue = ClassFileConstants.JDK1_4; // fault-tolerance >+ PublicScanner scanner = >+ new PublicScanner( >+ tokenizeComments, >+ tokenizeWhiteSpace, >+ false/*nls*/, >+ assertMode ? ClassFileConstants.JDK1_4 : ClassFileConstants.JDK1_3/*sourceLevel*/, >+ complianceLevelValue, >+ null/*taskTags*/, >+ null/*taskPriorities*/, >+ true/*taskCaseSensitive*/); > scanner.recordLineSeparator = recordLineSeparator; > return scanner; > } >@@ -437,10 +448,21 @@ > * @since 3.0 > */ > public static IScanner createScanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean recordLineSeparator, String sourceLevel) { >- PublicScanner scanner = null; >- long level = CompilerOptions.versionToJdkLevel(sourceLevel); >- if (level == 0) level = ClassFileConstants.JDK1_3; // fault-tolerance >- scanner = new PublicScanner(tokenizeComments, tokenizeWhiteSpace, false/*nls*/,level /*sourceLevel*/, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/); >+ // use default workspace compliance >+ long complianceLevelValue = CompilerOptions.versionToJdkLevel(JavaCore.getOption(JavaCore.COMPILER_COMPLIANCE)); >+ if (complianceLevelValue == 0) complianceLevelValue = ClassFileConstants.JDK1_4; // fault-tolerance >+ long sourceLevelValue = CompilerOptions.versionToJdkLevel(sourceLevel); >+ if (sourceLevelValue == 0) sourceLevelValue = ClassFileConstants.JDK1_3; // fault-tolerance >+ PublicScanner scanner = >+ new PublicScanner( >+ tokenizeComments, >+ tokenizeWhiteSpace, >+ false/*nls*/, >+ sourceLevelValue /*sourceLevel*/, >+ complianceLevelValue, >+ null/*taskTags*/, >+ null/*taskPriorities*/, >+ true/*taskCaseSensitive*/); > scanner.recordLineSeparator = recordLineSeparator; > return scanner; > } >@@ -488,7 +510,7 @@ > long sourceLevelValue = CompilerOptions.versionToJdkLevel(sourceLevel); > if (sourceLevelValue == 0) sourceLevelValue = ClassFileConstants.JDK1_3; // fault-tolerance > long complianceLevelValue = CompilerOptions.versionToJdkLevel(complianceLevel); >- if (complianceLevelValue == 0) complianceLevelValue = ClassFileConstants.JDK1_3; // fault-tolerance >+ if (complianceLevelValue == 0) complianceLevelValue = ClassFileConstants.JDK1_4; // fault-tolerance > scanner = new PublicScanner(tokenizeComments, tokenizeWhiteSpace, false/*nls*/,sourceLevelValue /*sourceLevel*/, complianceLevelValue, null/*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/); > scanner.recordLineSeparator = recordLineSeparator; > return scanner;
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 310002
: 165609 |
165615