Bug 11613 import fix from default branch RCL_2_4
authordadubrow
Wed, 07 Jul 2010 11:49:33 -0500
branchRCL_2_4
changeset 1589 f8fc355016ca
parent 1588 be9ca32c0fe2
child 1595 2c13daed43da
Bug 11613 import fix from default branch
project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestMMPView5.java
project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/cpp/epoc/engine/model/mmp/EMMPLanguage.java
project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/internal/cpp/epoc/engine/model/mmp/MMPView.java
--- a/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestMMPView5.java	Wed Jul 07 11:42:30 2010 -0500
+++ b/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestMMPView5.java	Wed Jul 07 11:49:33 2010 -0500
@@ -489,6 +489,22 @@
 		// ensure the unknown languages don't abort processing
 		assertEquals(3, seen.size());
 	}
+	public void testMissingLanguagesBug10958() {
+		// this has unknown languages
+		String text = 
+			"LANG 01 02 1000 1001 33\n";
+		IMMPView view;
+		makeModel(text);
+		view = getView(mmpConfig);
+		List<EMMPLanguage> languages = view.getLanguages();
+		
+		// add new entries
+		languages.add(EMMPLanguage.Punjabi);
+		
+		// should not remove unknown entries 
+		commitTest(view, "LANG 01 02 1000 1001 33 77\n");
+
+	}
 	
 	public void testUnterminatedCrossDocumentParseBug7886() {
 		String text =
--- a/project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/cpp/epoc/engine/model/mmp/EMMPLanguage.java	Wed Jul 07 11:42:30 2010 -0500
+++ b/project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/cpp/epoc/engine/model/mmp/EMMPLanguage.java	Wed Jul 07 11:49:33 2010 -0500
@@ -236,6 +236,13 @@
     /*
      * Discontinuity
      */
+    E14346("14346", 14346),  //$NON-NLS-1$
+    E14387("14387", 14387),  //$NON-NLS-1$
+    E14412("14412", 14412),  //$NON-NLS-1$
+    E14419("14419", 14419),  //$NON-NLS-1$
+    /*
+     * Discontinuity
+     */
     SC_NonLocalized(Messages.getString("EMMPLanguage.NonLocalized"), 0); //$NON-NLS-1$
 
 	private String key;
--- a/project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/internal/cpp/epoc/engine/model/mmp/MMPView.java	Wed Jul 07 11:42:30 2010 -0500
+++ b/project/com.nokia.carbide.cpp.epoc.engine/src/com/nokia/carbide/internal/cpp/epoc/engine/model/mmp/MMPView.java	Wed Jul 07 11:49:33 2010 -0500
@@ -213,12 +213,14 @@
 			try {
 				list.add(EMMPLanguage.fromCode(node.getValue()));
 			} catch (IllegalArgumentException e) {
-				// ignore unknown language
+				// ignore unknown language... completely! (I'm tired of these bug reports)
+				/*
 				EpocEnginePlugin.log(
 						Logging.newStatus(EpocEnginePlugin.getDefault(), 
 								new IllegalArgumentException(
 										"Warning, ignoring unknown language code: " + node.getValue() + " in " + stmt)
 				));
+				*/
 			}
 		}
 		return list;