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 118041 Details for
Bug 255501
EncodingTests failing when run by itself
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix and regression test
255501.txt (text/plain), 4.31 KB, created by
Jerome Lanneluc
on 2008-11-17 07:16:31 EST
(
hide
)
Description:
Proposed fix and regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2008-11-17 07:16:31 EST
Size:
4.31 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/EncodingTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/EncodingTests.java,v >retrieving revision 1.49 >diff -u -r1.49 EncodingTests.java >--- src/org/eclipse/jdt/core/tests/model/EncodingTests.java 14 Nov 2008 12:05:56 -0000 1.49 >+++ src/org/eclipse/jdt/core/tests/model/EncodingTests.java 17 Nov 2008 12:15:28 -0000 >@@ -715,7 +715,7 @@ > deleteFile("Encoding/Test34.txt"); > } > } >- >+ > /** > * Bug 66898: refactor-rename: encoding is not preserved > * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=66898" >@@ -910,6 +910,27 @@ > } > } > >+ /** >+ * Bug 255501: EncodingTests failing when run by itself >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=255501" >+ */ >+ public void testBug255501() throws Exception { >+ String savedEncoding = null; >+ String resourcesPluginId = ResourcesPlugin.getPlugin().getBundle().getSymbolicName(); >+ IEclipsePreferences preferences = new InstanceScope().getNode(resourcesPluginId); >+ try { >+ savedEncoding = preferences.get(ResourcesPlugin.PREF_ENCODING, ""); >+ JavaCore.getOptions(); // force options to be cached >+ preferences.put(ResourcesPlugin.PREF_ENCODING, "UTF-16"); >+ preferences.flush(); >+ String encoding = (String) JavaCore.getOptions().get(JavaCore.CORE_ENCODING); >+ assertEquals("Unexpected encoding", "UTF-16", encoding); >+ } finally { >+ preferences.put(ResourcesPlugin.PREF_ENCODING, savedEncoding); >+ preferences.flush(); >+ } >+ } >+ > private void verifyUtf8BOM(IFile file) throws CoreException { > assertNull("File should not have any explicit charset", file.getCharset(false)); > IContentDescription contentDescription = file.getContentDescription(); >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/JavaModelManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java,v >retrieving revision 1.418 >diff -u -r1.418 JavaModelManager.java >--- model/org/eclipse/jdt/internal/core/JavaModelManager.java 13 Nov 2008 09:03:55 -0000 1.418 >+++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 17 Nov 2008 12:15:30 -0000 >@@ -1423,11 +1423,8 @@ > /** > * Listener on properties changes. > */ >- IEclipsePreferences.IPreferenceChangeListener propertyListener = new IEclipsePreferences.IPreferenceChangeListener() { >- public void preferenceChange(PreferenceChangeEvent event) { >- JavaModelManager.this.optionsCache = null; >- } >- }; >+ IEclipsePreferences.IPreferenceChangeListener propertyListener; >+ IEclipsePreferences.IPreferenceChangeListener resourcesPropertyListener; > > /** > * Constructs a new JavaModelManager >@@ -4465,6 +4462,17 @@ > } > }; > new InstanceScope().getNode(JavaCore.PLUGIN_ID).addPreferenceChangeListener(this.propertyListener); >+ >+ // listen for encoding changes (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=255501 ) >+ this.resourcesPropertyListener = new IEclipsePreferences.IPreferenceChangeListener() { >+ public void preferenceChange(PreferenceChangeEvent event) { >+ if (ResourcesPlugin.PREF_ENCODING.equals(event.getKey())) { >+ JavaModelManager.this.optionsCache = null; >+ } >+ } >+ }; >+ String resourcesPluginId = ResourcesPlugin.getPlugin().getBundle().getSymbolicName(); >+ new InstanceScope().getNode(resourcesPluginId).addPreferenceChangeListener(this.resourcesPropertyListener); > > // Listen to content-type changes > Platform.getContentTypeManager().addContentTypeChangeListener(this); >@@ -4561,6 +4569,8 @@ > ((IEclipsePreferences) this.preferencesLookup[PREF_INSTANCE].parent()).removeNodeChangeListener(this.instanceNodeListener); > this.preferencesLookup[PREF_INSTANCE].removePreferenceChangeListener(this.instancePreferencesListener); > this.preferencesLookup[PREF_INSTANCE] = null; >+ String resourcesPluginId = ResourcesPlugin.getPlugin().getBundle().getSymbolicName(); >+ new InstanceScope().getNode(resourcesPluginId).removePreferenceChangeListener(this.resourcesPropertyListener); > > // wait for the initialization job to finish > try {
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 255501
: 118041