summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Liu2011-07-21 11:39:02 (EDT)
committerVivian Kong2011-07-21 11:39:02 (EDT)
commit525d976ae7aed53c563bb9ed664a63f468b6d80f (patch)
treea8c1a44a26bbf8821a7566377f5c2fde741a6d38
parent55f4dd7a52aaebf4d6d29c1de442eaa2a64b10a8 (diff)
downloadorg.eclipse.cdt-525d976ae7aed53c563bb9ed664a63f468b6d80f.zip
org.eclipse.cdt-525d976ae7aed53c563bb9ed664a63f468b6d80f.tar.gz
org.eclipse.cdt-525d976ae7aed53c563bb9ed664a63f468b6d80f.tar.bz2
Bug 352775 - The function registerFileEncoding in FileEncodingRegistry
should check default encoding first
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/FileEncodingRegistry.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/FileEncodingRegistry.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/FileEncodingRegistry.java
index c54544e..5bb7155 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/FileEncodingRegistry.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/FileEncodingRegistry.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2011 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 Rational Software - Initial API and implementation
+ * IBM Corporation - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.indexer;
@@ -41,6 +41,9 @@ public class FileEncodingRegistry implements Serializable {
}
public void registerFileEncoding(String filename, String encoding) {
+ if(defaultEncoding.equals(encoding)){
+ return;
+ }
if (fFilePathToEncodingMap != null) {
fFilePathToEncodingMap.put(filename, encoding);
}