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 165959 Details for
Bug 155015
Plugin Export build does not respect text encoding from IDE
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
encodings8.patch (text/plain), 30.54 KB, created by
Darin Wright
on 2010-04-23 15:51:25 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Darin Wright
Created:
2010-04-23 15:51:25 EDT
Size:
30.54 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.core >Index: src/org/eclipse/pde/internal/core/PDECoreMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java,v >retrieving revision 1.80 >diff -u -r1.80 PDECoreMessages.java >--- src/org/eclipse/pde/internal/core/PDECoreMessages.java 22 Apr 2010 19:44:33 -0000 1.80 >+++ src/org/eclipse/pde/internal/core/PDECoreMessages.java 23 Apr 2010 19:50:11 -0000 >@@ -301,6 +301,18 @@ > > public static String SearchablePluginsManager_createProjectTaskName; > >+ public static String SourceEntryErrorReporter_0; >+ public static String SourceEntryErrorReporter_1; >+ public static String SourceEntryErrorReporter_10; >+ public static String SourceEntryErrorReporter_2; >+ public static String SourceEntryErrorReporter_3; >+ public static String SourceEntryErrorReporter_4; >+ public static String SourceEntryErrorReporter_5; >+ public static String SourceEntryErrorReporter_6; >+ public static String SourceEntryErrorReporter_7; >+ public static String SourceEntryErrorReporter_8; >+ public static String SourceEntryErrorReporter_9; >+ > public static String SourceEntryErrorReporter_DifferentTargetLibrary; > public static String SourceEntryErrorReporter_DupeOutputFolder; > public static String SourceEntryErrorReporter_DupeSourceFolder; >Index: src/org/eclipse/pde/internal/core/PreferenceInitializer.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PreferenceInitializer.java,v >retrieving revision 1.20 >diff -u -r1.20 PreferenceInitializer.java >--- src/org/eclipse/pde/internal/core/PreferenceInitializer.java 22 Apr 2010 13:10:16 -0000 1.20 >+++ src/org/eclipse/pde/internal/core/PreferenceInitializer.java 23 Apr 2010 19:50:11 -0000 >@@ -71,6 +71,7 @@ > prefs.putInt(CompilerFlags.P_BUILD_BIN_INCLUDES, CompilerFlags.WARNING); > prefs.putInt(CompilerFlags.P_BUILD_JAVA_COMPLIANCE, CompilerFlags.WARNING); > prefs.putInt(CompilerFlags.P_BUILD_JAVA_COMPILER, CompilerFlags.IGNORE); >+ prefs.putInt(CompilerFlags.P_BUILD_ENCODINGS, CompilerFlags.IGNORE); > > prefs.putInt(CompilerFlags.P_INCOMPATIBLE_ENV, CompilerFlags.WARNING); > prefs.putInt(CompilerFlags.P_MISSING_EXPORT_PKGS, CompilerFlags.IGNORE); >Index: src/org/eclipse/pde/internal/core/pderesources.properties >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties,v >retrieving revision 1.126 >diff -u -r1.126 pderesources.properties >--- src/org/eclipse/pde/internal/core/pderesources.properties 22 Apr 2010 19:44:33 -0000 1.126 >+++ src/org/eclipse/pde/internal/core/pderesources.properties 23 Apr 2010 19:50:11 -0000 >@@ -237,6 +237,18 @@ > > SearchablePluginsManager_createProjectTaskName=Creating {0} project > >+SourceEntryErrorReporter_0=Workspace encoding ({0}) does not match specified default encoding ({1}) for library "{2}". >+SourceEntryErrorReporter_1=Default encoding ({0}) for library "{1}" should be removed as the workspace does not specify an explicit encoding. >+SourceEntryErrorReporter_10=Custom encoding ({0}) should be specified for "{1}" to match workspace settings. >+SourceEntryErrorReporter_2=Only one default encoding can be specified for library "{0}". >+SourceEntryErrorReporter_3=Custom encoding ({0}) should be removed for file or folder that does not exist: "{1}" >+SourceEntryErrorReporter_4=Syntax error: expecting ''<path>[encoding]'' >+SourceEntryErrorReporter_5=Custom encodings should be removed for library "{0}" as the workspace settings does not specify any explicit encodings. >+SourceEntryErrorReporter_6=Custom encoding ({0}) should be removed for "{0}" as the workspace does not specify an explicit encoding. >+SourceEntryErrorReporter_7=Workspace encoding ({0}) for "{1}" does not match specified encoding ({2}). >+SourceEntryErrorReporter_8=Custom encoding ({0}) should be specified for "{1}" to match workspace settings. >+SourceEntryErrorReporter_9=Default encoding ({0}) should be specified for library "{1}" to match workspace settings. >+ > SourceEntryErrorReporter_DifferentTargetLibrary=Source folders ''{0}'' share the same output folder but are targeted to different libraries. > SourceEntryErrorReporter_DupeOutputFolder=Multiple entries for output folder ''{0}'' in build entry ''{1}''. > SourceEntryErrorReporter_DupeSourceFolder=Multiple entries for source folder ''{0}'' in build entry ''{1}''. >Index: src/org/eclipse/pde/internal/core/builders/BuildErrorReporter.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/BuildErrorReporter.java,v >retrieving revision 1.59 >diff -u -r1.59 BuildErrorReporter.java >--- src/org/eclipse/pde/internal/core/builders/BuildErrorReporter.java 22 Apr 2010 19:44:33 -0000 1.59 >+++ src/org/eclipse/pde/internal/core/builders/BuildErrorReporter.java 23 Apr 2010 19:50:11 -0000 >@@ -114,6 +114,7 @@ > protected int fMissingOutputLibSeverity; > protected int fSrcLibSeverity; > protected int fOututLibSeverity; >+ protected int fEncodingSeverity; > > public BuildErrorReporter(IFile buildFile) { > super(buildFile); >@@ -126,6 +127,7 @@ > fJavaCompilerSeverity = CompilerFlags.getFlag(fFile.getProject(), CompilerFlags.P_BUILD_JAVA_COMPILER); > fSrcInclSeverity = CompilerFlags.getFlag(fFile.getProject(), CompilerFlags.P_BUILD_SRC_INCLUDES); > fBinInclSeverity = CompilerFlags.getFlag(fFile.getProject(), CompilerFlags.P_BUILD_BIN_INCLUDES); >+ fEncodingSeverity = CompilerFlags.getFlag(fFile.getProject(), CompilerFlags.P_BUILD_ENCODINGS); > } > > public void validate(IProgressMonitor monitor) { >@@ -228,7 +230,7 @@ > IClasspathEntry[] cpes = jp.getRawClasspath(); > validateMissingLibraries(sourceEntryKeys, cpes); > validateSourceEntries(sourceEntries, cpes); >- SourceEntryErrorReporter srcEntryErrReporter = new SourceEntryErrorReporter(fFile); >+ SourceEntryErrorReporter srcEntryErrReporter = new SourceEntryErrorReporter(fFile, build); > srcEntryErrReporter.initialize(sourceEntries, outputEntries, cpes, fProject); > srcEntryErrReporter.validate(); > ArrayList problems = srcEntryErrReporter.getProblemList(); >@@ -246,27 +248,8 @@ > validateBinIncludes(binIncludes); > validateExecutionEnvironment(javacSource, javacTarget, jreCompilationProfile, javacWarnings, javacErrors, getSourceLibraries(sourceEntries)); > validateJavaCompilerSettings(javaProjectWarnings); >- //validateDefaultEncoding(sourceEntries, encodingEntries); > } > >-// private void validateDefaultEncoding(ArrayList sourceEntries, Map encodingEntries) { >-// String defaultEncoding = System.getProperty("file.encoding"); //$NON-NLS-1$ >-// for (int i = 0; i < sourceEntries.size(); i++) { >-// try { >-// String name = ((IBuildEntry) sourceEntries.get(i)).getName(); >-// String library = name.substring(name.indexOf('.') + 1, name.length()); >-// String encoding = fProject.getDefaultCharset(false); >-// String encodingId = PROPERTY_JAVAC_DEFAULT_ENCODING_PREFIX + library; >-// String libraryEncoding = (String) encodingEntries.get(encodingId); >-// if (encoding != null && !defaultEncoding.equalsIgnoreCase(encoding) && libraryEncoding == null) { >-// prepareError(encodingId, encoding, NLS.bind(PDECoreMessages.BuildErrorReporter_defaultEncodingMissing, new Object[] {defaultEncoding, encoding}), PDEMarkerFactory.B_ADDDITION, PDEMarkerFactory.CAT_OTHER); >-// } >-// } catch (CoreException e) { >-// PDECore.logException(e); >-// } >-// } >-// } >- > /** > * Given a list of source library entries, returns the list of library names. > * >Index: src/org/eclipse/pde/internal/core/builders/CompilerFlags.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/CompilerFlags.java,v >retrieving revision 1.18 >diff -u -r1.18 CompilerFlags.java >--- src/org/eclipse/pde/internal/core/builders/CompilerFlags.java 21 Apr 2010 21:48:50 -0000 1.18 >+++ src/org/eclipse/pde/internal/core/builders/CompilerFlags.java 23 Apr 2010 19:50:11 -0000 >@@ -61,6 +61,7 @@ > public static final String P_BUILD_BIN_INCLUDES = "compilers.p.build.bin.includes"; //$NON-NLS-1$ > public static final String P_BUILD_JAVA_COMPLIANCE = "compilers.p.build.java.compliance"; //$NON-NLS-1$ > public static final String P_BUILD_JAVA_COMPILER = "compilers.p.build.java.compiler"; //$NON-NLS-1$ >+ public static final String P_BUILD_ENCODINGS = "compilers.p.build.encodings"; //$NON-NLS-1$ > public static final String P_INCOMPATIBLE_ENV = "compilers.incompatible-environment"; //$NON-NLS-1$ > public static final String P_MISSING_EXPORT_PKGS = "compilers.p.missing-packages"; //$NON-NLS-1$ > public static final String P_DEPRECATED = "compilers.p.deprecated"; //$NON-NLS-1$ >Index: src/org/eclipse/pde/internal/core/builders/SourceEntryErrorReporter.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/SourceEntryErrorReporter.java,v >retrieving revision 1.9 >diff -u -r1.9 SourceEntryErrorReporter.java >--- src/org/eclipse/pde/internal/core/builders/SourceEntryErrorReporter.java 30 Mar 2010 18:54:17 -0000 1.9 >+++ src/org/eclipse/pde/internal/core/builders/SourceEntryErrorReporter.java 23 Apr 2010 19:50:11 -0000 >@@ -11,18 +11,22 @@ > package org.eclipse.pde.internal.core.builders; > > import java.util.*; >+import java.util.Map.Entry; > import org.eclipse.core.resources.*; >-import org.eclipse.core.runtime.IPath; >-import org.eclipse.core.runtime.Path; >+import org.eclipse.core.runtime.*; > import org.eclipse.jdt.core.*; > import org.eclipse.osgi.util.NLS; >+import org.eclipse.pde.core.build.IBuild; > import org.eclipse.pde.core.build.IBuildEntry; >+import org.eclipse.pde.internal.core.PDECore; > import org.eclipse.pde.internal.core.PDECoreMessages; >+import org.eclipse.pde.internal.core.project.PDEProject; > > public class SourceEntryErrorReporter extends BuildErrorReporter { > >- public SourceEntryErrorReporter(IFile file) { >+ public SourceEntryErrorReporter(IFile file, IBuild model) { > super(file); >+ fBuild = model; > } > > class ProjectFolder { >@@ -131,8 +135,146 @@ > > } > >+ /** >+ * Represents a default or custom encoding property for a resource >+ * within a library. >+ */ >+ class EncodingEntry { >+ >+ private String fEncoding; >+ private IResource fResource; >+ >+ /** >+ * Constructs an encoding entry for the given resource. >+ * >+ * @param resource resource >+ * @param encoding the encoding identifier >+ */ >+ EncodingEntry(IResource resource, String encoding) { >+ fEncoding = encoding; >+ fResource = resource; >+ } >+ >+ /** >+ * Returns the explicit encoding for this entry. >+ * >+ * @return explicit encoding >+ */ >+ public String getEncoding() { >+ return fEncoding; >+ } >+ >+ /** >+ * Returns the resource this encoding is associated with. >+ * >+ * @return associated resource >+ */ >+ public IResource getResource() { >+ return fResource; >+ } >+ >+ /* (non-Javadoc) >+ * @see java.lang.Object#toString() >+ */ >+ public String toString() { >+ return getValue(); >+ } >+ >+ /* (non-Javadoc) >+ * @see java.lang.Object#equals(java.lang.Object) >+ */ >+ public boolean equals(Object obj) { >+ if (obj instanceof EncodingEntry) { >+ EncodingEntry other = (EncodingEntry) obj; >+ return other.fEncoding.equals(fEncoding) && other.fResource.equals(fResource); >+ } >+ return false; >+ } >+ >+ /* (non-Javadoc) >+ * @see java.lang.Object#hashCode() >+ */ >+ public int hashCode() { >+ return fEncoding.hashCode() + fResource.hashCode(); >+ } >+ >+ /** >+ * Returns the generated value of this entry for the build.properties file. >+ * >+ * @return value to enter into build.properties >+ */ >+ String getValue() { >+ StringBuffer buf = new StringBuffer(); >+ IContainer root = PDEProject.getBundleRoot(fResource.getProject()); >+ buf.append(fResource.getFullPath().makeRelativeTo(root.getFullPath()).makeAbsolute()); >+ buf.append('['); >+ buf.append(fEncoding); >+ buf.append(']'); >+ return buf.toString(); >+ } >+ >+ } >+ >+ /** >+ * Visits a source folder gathering encodings. >+ */ >+ class Visitor implements IResourceVisitor { >+ >+ String[] fLibs = null; >+ >+ Visitor(SourceFolder folder) { >+ ArrayList list = folder.getLibs(); >+ fLibs = (String[]) list.toArray(new String[list.size()]); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.core.resources.IResourceVisitor#visit(org.eclipse.core.resources.IResource) >+ */ >+ public boolean visit(IResource resource) throws CoreException { >+ String encoding = null; >+ switch (resource.getType()) { >+ case IResource.FOLDER : >+ encoding = ((IFolder) resource).getDefaultCharset(false); >+ break; >+ case IResource.FILE : >+ IFile file = (IFile) resource; >+ // only worry about .java files >+ if (file.getFileExtension().equals("java")) { //$NON-NLS-1$ >+ encoding = file.getCharset(false); >+ } >+ break; >+ } >+ if (encoding != null) { >+ EncodingEntry entry = new EncodingEntry(resource, encoding); >+ for (int i = 0; i < fLibs.length; i++) { >+ String lib = fLibs[i]; >+ List encodings = (List) fCustomEncodings.get(lib); >+ if (encodings == null) { >+ encodings = new ArrayList(); >+ fCustomEncodings.put(lib, encodings); >+ } >+ encodings.add(entry); >+ } >+ } >+ return true; >+ } >+ >+ } >+ > private HashMap fSourceFolderMap = new HashMap(4); > private HashMap fOutputFolderMap = new HashMap(4); >+ private IBuild fBuild = null; >+ >+ /** >+ * Maps library name to default encoding for that library (or not present if there is no >+ * explicit default encoding specified). >+ */ >+ Map fDefaultLibraryEncodings = new HashMap(); >+ >+ /** >+ * Maps library name to custom {@link EncodingEntry}'s for this library. >+ */ >+ Map fCustomEncodings = new HashMap(); > > public void initialize(ArrayList sourceEntries, ArrayList outputEntries, IClasspathEntry[] cpes, IProject project) { > >@@ -297,6 +439,7 @@ > } > } > >+ List toValidate = new ArrayList(); // list of source folders to perform encoding validation on > for (Iterator iterator = fSourceFolderMap.keySet().iterator(); iterator.hasNext();) { > IPath sourcePath = (IPath) iterator.next(); > SourceFolder sourceFolder = (SourceFolder) fSourceFolderMap.get(sourcePath); >@@ -339,6 +482,8 @@ > String message = NLS.bind(PDECoreMessages.SourceEntryErrorReporter_DupeSourceFolder, sourcePath.toString(), PROPERTY_SOURCE_PREFIX + sourceFolder.getDupeLibName()); > prepareError(PROPERTY_SOURCE_PREFIX + sourceFolder.getDupeLibName(), sourceFolder.getToken(), message, PDEMarkerFactory.NO_RESOLUTION, fSrcLibSeverity, PDEMarkerFactory.CAT_OTHER); > } >+ >+ toValidate.add(sourceFolder); > } > } > >@@ -348,6 +493,178 @@ > String message = NLS.bind(PDECoreMessages.SourceEntryErrorReporter_MissingOutputEntry, errorEntry.get(errorEntry.fSsrcFolders), PROPERTY_OUTPUT_PREFIX + libName); > prepareError(PROPERTY_OUTPUT_PREFIX + libName, errorEntry.get(errorEntry.fOutputFolders), message, PDEMarkerFactory.B_ADDITION, fMissingOutputLibSeverity, PDEMarkerFactory.CAT_OTHER); > } >+ >+ // validate workspace encodings with those specified in build.properties >+ >+ if (fEncodingSeverity == CompilerFlags.ERROR || fEncodingSeverity == CompilerFlags.WARNING) { >+ // build map of expected encodings >+ Iterator iterator = toValidate.iterator(); >+ while (iterator.hasNext()) { >+ SourceFolder sourceFolder = (SourceFolder) iterator.next(); >+ IPath sourcePath = sourceFolder.getPath(); >+ IFolder folder = fProject.getFolder(sourcePath); >+ try { >+ ArrayList list = sourceFolder.getLibs(); >+ String[] libs = (String[]) list.toArray(new String[list.size()]); >+ String encoding = getExplicitEncoding(folder); >+ if (encoding != null) { >+ for (int i = 0; i < libs.length; i++) { >+ fDefaultLibraryEncodings.put(libs[i], encoding); >+ } >+ } >+ folder.accept(new Visitor(sourceFolder)); >+ } catch (CoreException e) { >+ // Can't validate if unable to retrieve encoding >+ PDECore.log(e); >+ } >+ >+ } >+ >+ // Compare to encodings specified in build.properties (if any) >+ IBuildEntry[] entries = fBuild.getBuildEntries(); >+ for (int i = 0; i < entries.length; i++) { >+ IBuildEntry entry = entries[i]; >+ String name = entry.getName(); >+ if (name.startsWith(PROPERTY_JAVAC_DEFAULT_ENCODING_PREFIX)) { >+ String lib = name.substring(PROPERTY_JAVAC_DEFAULT_ENCODING_PREFIX.length()); >+ String[] tokens = entry.getTokens(); >+ if (tokens.length > 0) { >+ if (tokens.length == 1) { >+ // compare >+ String specified = tokens[0]; >+ String expected = (String) fDefaultLibraryEncodings.remove(lib); >+ if (expected != null) { >+ if (!specified.equals(expected)) { >+ prepareError(name, specified, NLS.bind(PDECoreMessages.SourceEntryErrorReporter_0, new String[] {expected, specified, lib}), PDEMarkerFactory.NO_RESOLUTION, fEncodingSeverity, PDEMarkerFactory.CAT_OTHER); >+ } >+ } else { >+ // encoding is specified, but workspace does not specify one >+ prepareError(name, null, NLS.bind(PDECoreMessages.SourceEntryErrorReporter_1, new String[] {specified, lib}), PDEMarkerFactory.B_REMOVAL, fEncodingSeverity, PDEMarkerFactory.CAT_OTHER); >+ } >+ } else { >+ // syntax error >+ fDefaultLibraryEncodings.remove(lib); >+ prepareError(name, null, NLS.bind(PDECoreMessages.SourceEntryErrorReporter_2, lib), PDEMarkerFactory.NO_RESOLUTION, fEncodingSeverity, PDEMarkerFactory.CAT_OTHER); >+ } >+ } >+ } else if (name.startsWith(PROPERTY_JAVAC_CUSTOM_ENCODINGS_PREFIX)) { >+ IContainer bundleRoot = PDEProject.getBundleRoot(fProject); >+ String lib = name.substring(PROPERTY_JAVAC_CUSTOM_ENCODINGS_PREFIX.length()); >+ String[] tokens = entry.getTokens(); >+ if (tokens.length > 0) { >+ List encodings = new ArrayList(); >+ for (int j = 0; j < tokens.length; j++) { >+ String special = tokens[j]; >+ int index = special.indexOf('['); >+ if (index >= 0 && special.endsWith("]")) { //$NON-NLS-1$ >+ String path = special.substring(0, index); >+ String encoding = special.substring(index + 1, special.length() - 1); >+ IResource member = bundleRoot.findMember(path); >+ if (member == null) { >+ // error - missing resource >+ String message = NLS.bind(PDECoreMessages.SourceEntryErrorReporter_3, new String[] {encoding, path}); >+ prepareError(name, special, message, PDEMarkerFactory.B_REMOVAL, fEncodingSeverity, PDEMarkerFactory.CAT_OTHER); >+ } else { >+ encodings.add(new EncodingEntry(member, encoding)); >+ } >+ } else { >+ // syntax error - invalid >+ String message = PDECoreMessages.SourceEntryErrorReporter_4; >+ prepareError(name, special, message, PDEMarkerFactory.NO_RESOLUTION, fEncodingSeverity, PDEMarkerFactory.CAT_OTHER); >+ } >+ } >+ // compare with workspace encodings >+ List workspace = (List) fCustomEncodings.remove(lib); >+ if (workspace == null) { >+ prepareError(name, null, NLS.bind(PDECoreMessages.SourceEntryErrorReporter_5, lib), PDEMarkerFactory.B_REMOVAL, fEncodingSeverity, PDEMarkerFactory.CAT_OTHER); >+ } else { >+ Map map = new HashMap(); >+ Iterator iter = workspace.iterator(); >+ while (iter.hasNext()) { >+ EncodingEntry ee = (EncodingEntry) iter.next(); >+ map.put(ee.getResource(), ee.getEncoding()); >+ } >+ iter = encodings.iterator(); >+ while (iter.hasNext()) { >+ EncodingEntry ee = (EncodingEntry) iter.next(); >+ String specified = ee.getEncoding(); >+ String expected = (String) map.remove(ee.getResource()); >+ if (expected == null) { >+ prepareError(name, ee.getValue(), NLS.bind(PDECoreMessages.SourceEntryErrorReporter_6, new String[] {expected, ee.getResource().getProjectRelativePath().toString()}), PDEMarkerFactory.B_REMOVAL, fEncodingSeverity, PDEMarkerFactory.CAT_OTHER); >+ } else { >+ if (!specified.equals(expected)) { >+ prepareError(name, ee.getValue(), NLS.bind(PDECoreMessages.SourceEntryErrorReporter_7, new String[] {expected, ee.getResource().getProjectRelativePath().toString(), specified}), PDEMarkerFactory.NO_RESOLUTION, fEncodingSeverity, PDEMarkerFactory.CAT_OTHER); >+ } >+ } >+ } >+ // anything left in the workspace map? >+ if (!map.isEmpty()) { >+ iter = map.entrySet().iterator(); >+ while (iter.hasNext()) { >+ Entry en = (Entry) iter.next(); >+ IResource res = (IResource) en.getKey(); >+ String expected = (String) en.getValue(); >+ EncodingEntry missing = new EncodingEntry(res, expected); >+ String m = NLS.bind(PDECoreMessages.SourceEntryErrorReporter_8, new String[] {expected, res.getProjectRelativePath().toString()}); >+ prepareError(name, missing.getValue(), m, PDEMarkerFactory.B_ADDITION, fEncodingSeverity, PDEMarkerFactory.CAT_OTHER); >+ } >+ } >+ } >+ } >+ >+ } >+ } >+ >+ // check for unspecified default encodings >+ Iterator iter = fDefaultLibraryEncodings.entrySet().iterator(); >+ while (iter.hasNext()) { >+ Entry entry = (Entry) iter.next(); >+ String lib = (String) entry.getKey(); >+ String expected = (String) entry.getValue(); >+ prepareError(PROPERTY_JAVAC_DEFAULT_ENCODING_PREFIX + lib, expected, NLS.bind(PDECoreMessages.SourceEntryErrorReporter_9, new String[] {expected, lib}), PDEMarkerFactory.B_ADDITION, fEncodingSeverity, PDEMarkerFactory.CAT_OTHER); >+ } >+ >+ // check for unspecified custom encodings >+ iter = fCustomEncodings.entrySet().iterator(); >+ while (iter.hasNext()) { >+ Entry entry = (Entry) iter.next(); >+ String lib = (String) entry.getKey(); >+ List encodings = (List) entry.getValue(); >+ Iterator iterator2 = encodings.iterator(); >+ while (iterator2.hasNext()) { >+ EncodingEntry encoding = (EncodingEntry) iterator2.next(); >+ String m = NLS.bind(PDECoreMessages.SourceEntryErrorReporter_10, new String[] {encoding.getEncoding(), encoding.getResource().getProjectRelativePath().toString()}); >+ prepareError(PROPERTY_JAVAC_CUSTOM_ENCODINGS_PREFIX + lib, encoding.getValue(), m, PDEMarkerFactory.B_ADDITION, fEncodingSeverity, PDEMarkerFactory.CAT_OTHER); >+ } >+ } >+ } >+ } >+ >+ /** >+ * Returns any explicit encoding set on the given container or one of its parents >+ * up to and including its project. >+ * >+ * @param container container >+ * @return any explicit encoding or <code>null</code> if none >+ * @throws CoreException >+ */ >+ private String getExplicitEncoding(IContainer container) throws CoreException { >+ String encoding = container.getDefaultCharset(false); >+ if (encoding == null) { >+ IContainer parent = container.getParent(); >+ if (parent != null) { >+ switch (parent.getType()) { >+ case IResource.FOLDER : >+ return getExplicitEncoding(parent); >+ case IResource.PROJECT : >+ return getExplicitEncoding(parent); >+ default : >+ // don't consider workspace encoding >+ return null; >+ } >+ } >+ } >+ return encoding; > } > > private String join(ProjectFolder[] folders) { >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/PDEUIMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEUIMessages.java,v >retrieving revision 1.475 >diff -u -r1.475 PDEUIMessages.java >--- src/org/eclipse/pde/internal/ui/PDEUIMessages.java 22 Apr 2010 00:31:15 -0000 1.475 >+++ src/org/eclipse/pde/internal/ui/PDEUIMessages.java 23 Apr 2010 19:50:14 -0000 >@@ -103,6 +103,7 @@ > public static String PDECompilersConfigurationBlock_4; > public static String PDECompilersConfigurationBlock_5; > public static String PDECompilersConfigurationBlock_6; >+ public static String PDECompilersConfigurationBlock_7; > > public static String PDECompilersConfigurationBlock_general; > public static String PDECompilersConfigurationBlock_versioning; >Index: src/org/eclipse/pde/internal/ui/pderesources.properties >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties,v >retrieving revision 1.1136 >diff -u -r1.1136 pderesources.properties >--- src/org/eclipse/pde/internal/ui/pderesources.properties 23 Apr 2010 18:41:18 -0000 1.1136 >+++ src/org/eclipse/pde/internal/ui/pderesources.properties 23 Apr 2010 19:50:16 -0000 >@@ -61,6 +61,7 @@ > PDECompilersConfigurationBlock_4=Problems with 'src.inclu&des' entry: > PDECompilersConfigurationBlock_5=Missing or incompatible &Java compliance properties: > PDECompilersConfigurationBlock_6=Missing project specific Java compiler settings: >+PDECompilersConfigurationBlock_7=Missing or incorrect file encodings > PDECompilersConfigurationBlock_general=General > PDECompilersConfigurationBlock_versioning=Versioning > PDECompilersConfigurationBlock_references=References >Index: src/org/eclipse/pde/internal/ui/preferences/PDECompilersConfigurationBlock.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/PDECompilersConfigurationBlock.java,v >retrieving revision 1.16 >diff -u -r1.16 PDECompilersConfigurationBlock.java >--- src/org/eclipse/pde/internal/ui/preferences/PDECompilersConfigurationBlock.java 22 Apr 2010 00:31:15 -0000 1.16 >+++ src/org/eclipse/pde/internal/ui/preferences/PDECompilersConfigurationBlock.java 23 Apr 2010 19:50:16 -0000 >@@ -215,6 +215,7 @@ > private static final Key KEY_P_BUILD_BIN_INCLUDES = getPDEPrefKey(CompilerFlags.P_BUILD_BIN_INCLUDES); > private static final Key KEY_P_BUILD_JAVA_COMPLIANCE = getPDEPrefKey(CompilerFlags.P_BUILD_JAVA_COMPLIANCE); > private static final Key KEY_P_BUILD_JAVA_COMPILER = getPDEPrefKey(CompilerFlags.P_BUILD_JAVA_COMPILER); >+ private static final Key KEY_P_BUILD_ENCODINGS = getPDEPrefKey(CompilerFlags.P_BUILD_ENCODINGS); > private static final Key KEY_P_BUILD = getPDEPrefKey(CompilerFlags.P_BUILD); > > // versioning >@@ -228,7 +229,7 @@ > > private static String[] SEVERITIES = {PDEUIMessages.PDECompilersConfigurationBlock_error, PDEUIMessages.PDECompilersConfigurationBlock_warning, PDEUIMessages.PDECompilersConfigurationBlock_ignore}; > >- private static Key[] fgAllKeys = {KEY_F_UNRESOLVED_FEATURES, KEY_F_UNRESOLVED_PLUGINS, KEY_P_BUILD, KEY_P_BUILD_MISSING_OUTPUT, KEY_P_BUILD_SOURCE_LIBRARY, KEY_P_BUILD_OUTPUT_LIBRARY, KEY_P_BUILD_SRC_INCLUDES, KEY_P_BUILD_BIN_INCLUDES, KEY_P_BUILD_JAVA_COMPLIANCE, KEY_P_BUILD_JAVA_COMPILER, KEY_P_INTERNAL, KEY_P_DEPRECATED, KEY_P_DISCOURAGED_CLASS, KEY_P_INCOMPATIBLE_ENV, KEY_P_MISSING_EXPORT_PKGS, KEY_P_NO_REQUIRED_ATT, KEY_P_NOT_EXTERNALIZED, KEY_P_UNKNOWN_ATTRIBUTE, KEY_P_UNKNOWN_CLASS, KEY_P_UNKNOWN_ELEMENT, KEY_P_UNKNOWN_IDENTIFIER, KEY_P_UNKNOWN_RESOURCE, KEY_P_UNRESOLVED_EX_POINTS, KEY_P_UNRESOLVED_IMPORTS, KEY_P_VERSION_EXP_PKG, KEY_P_VERSION_IMP_PKG, KEY_P_VERSION_REQ_BUNDLE, KEY_S_CREATE_DOCS, KEY_S_DOC_FOLDER, KEY_S_OPEN_TAGS}; >+ private static Key[] fgAllKeys = {KEY_F_UNRESOLVED_FEATURES, KEY_F_UNRESOLVED_PLUGINS, KEY_P_BUILD, KEY_P_BUILD_MISSING_OUTPUT, KEY_P_BUILD_SOURCE_LIBRARY, KEY_P_BUILD_OUTPUT_LIBRARY, KEY_P_BUILD_SRC_INCLUDES, KEY_P_BUILD_BIN_INCLUDES, KEY_P_BUILD_JAVA_COMPLIANCE, KEY_P_BUILD_JAVA_COMPILER, KEY_P_BUILD_ENCODINGS, KEY_P_INTERNAL, KEY_P_DEPRECATED, KEY_P_DISCOURAGED_CLASS, KEY_P_INCOMPATIBLE_ENV, KEY_P_MISSING_EXPORT_PKGS, KEY_P_NO_REQUIRED_ATT, KEY_P_NOT_EXTERNALIZED, KEY_P_UNKNOWN_ATTRIBUTE, KEY_P_UNKNOWN_CLASS, KEY_P_UNKNOWN_ELEMENT, KEY_P_UNKNOWN_IDENTIFIER, KEY_P_UNKNOWN_RESOURCE, KEY_P_UNRESOLVED_EX_POINTS, KEY_P_UNRESOLVED_IMPORTS, KEY_P_VERSION_EXP_PKG, KEY_P_VERSION_IMP_PKG, KEY_P_VERSION_REQ_BUNDLE, KEY_S_CREATE_DOCS, KEY_S_DOC_FOLDER, KEY_S_OPEN_TAGS}; > > /** > * Constant representing the {@link IDialogSettings} section for this block >@@ -521,7 +522,7 @@ > initializeComboControls(client, new String[] {PDEUIMessages.compilers_p_no_required_att, PDEUIMessages.CompilersConfigurationTab_incompatEnv, PDEUIMessages.compilers_p_exported_pkgs}, new Key[] {KEY_P_NO_REQUIRED_ATT, KEY_P_INCOMPATIBLE_ENV, KEY_P_MISSING_EXPORT_PKGS}, CompilerFlags.PLUGIN_FLAGS); > //build.properties > client = createExpansibleComposite(sbody, PDEUIMessages.PDECompilersConfigurationBlock_build); >- initializeComboControls(client, new String[] {PDEUIMessages.PDECompilersConfigurationBlock_1, PDEUIMessages.PDECompilersConfigurationBlock_2, PDEUIMessages.PDECompilersConfigurationBlock_0, PDEUIMessages.PDECompilersConfigurationBlock_3, PDEUIMessages.PDECompilersConfigurationBlock_4, PDEUIMessages.PDECompilersConfigurationBlock_5, PDEUIMessages.PDECompilersConfigurationBlock_6, PDEUIMessages.CompilersConfigurationTab_buildPropertiesErrors}, new Key[] {KEY_P_BUILD_SOURCE_LIBRARY, KEY_P_BUILD_OUTPUT_LIBRARY, KEY_P_BUILD_MISSING_OUTPUT, KEY_P_BUILD_BIN_INCLUDES, KEY_P_BUILD_SRC_INCLUDES, KEY_P_BUILD_JAVA_COMPLIANCE, KEY_P_BUILD_JAVA_COMPILER, KEY_P_BUILD}, CompilerFlags.PLUGIN_FLAGS); >+ initializeComboControls(client, new String[] {PDEUIMessages.PDECompilersConfigurationBlock_1, PDEUIMessages.PDECompilersConfigurationBlock_2, PDEUIMessages.PDECompilersConfigurationBlock_0, PDEUIMessages.PDECompilersConfigurationBlock_3, PDEUIMessages.PDECompilersConfigurationBlock_4, PDEUIMessages.PDECompilersConfigurationBlock_5, PDEUIMessages.PDECompilersConfigurationBlock_6, PDEUIMessages.PDECompilersConfigurationBlock_7, PDEUIMessages.CompilersConfigurationTab_buildPropertiesErrors}, new Key[] {KEY_P_BUILD_SOURCE_LIBRARY, KEY_P_BUILD_OUTPUT_LIBRARY, KEY_P_BUILD_MISSING_OUTPUT, KEY_P_BUILD_BIN_INCLUDES, KEY_P_BUILD_SRC_INCLUDES, KEY_P_BUILD_JAVA_COMPLIANCE, KEY_P_BUILD_JAVA_COMPILER, KEY_P_BUILD_ENCODINGS, KEY_P_BUILD}, CompilerFlags.PLUGIN_FLAGS); > // Versioning > client = createExpansibleComposite(sbody, PDEUIMessages.PDECompilersConfigurationBlock_versioning); > initializeComboControls(client, new String[] {PDEUIMessages.compilers_p_missing_require_bundle, PDEUIMessages.compilers_p_missing_exp_pkg, PDEUIMessages.compilers_p_missing_imp_pkg}, new Key[] {KEY_P_VERSION_REQ_BUNDLE, KEY_P_VERSION_EXP_PKG, KEY_P_VERSION_IMP_PKG}, CompilerFlags.PLUGIN_FLAGS);
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 155015
:
121890
|
165625
|
165674
|
165764
|
165850
| 165959