/hg/icedtea-web: 3 new changesets

gitne at icedtea.classpath.org gitne at icedtea.classpath.org
Thu Jul 3 21:27:55 UTC 2014


changeset bbd28d09a3ff in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=bbd28d09a3ff
author: Jacob Wisor <gitne at gmx.de>
date: Thu Jun 26 19:35:23 2014 +0200

	Fix handling of UI controls in Java console

	2014-06-XX  Jacob Wisor  <gitne at gmx.de>

		* netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java: Fix
		handling of UI controls
		(ConsoleOutputPane) Add set enabled state of headers JCheckBoxes with new
		setHeadersCheckBoxesEnabled() method depending on showHeaders' saved
		configuration selected state
		Add set enabled state of messages JCheckBox with new
		setMessagesCheckBoxesEnabled method depending on showMessage's selected
		state on initialization
		Add set enabled state of refresh JButton reciprocally to autorefresh
		JCheckBox's selected state on initialization
		(createDefaultAction) Add null check on argument of public method
		Add call to new setHeadersCheckBoxesEnabled() method with showHeaders'
		selected state when clicked
		Add call to new setMessagesCheckBoxesEnabled() method with showMessage's
		selected state when clicked
		Add set enabled state of refresh JButton reciprocally to autorefresh
		JCheckBox's selected state
		(initComponents) Add default ActionListener to autorefresh JCheckBox
		(setHeadersCheckBoxesEnabled) Add new method
		Sets enabled state of showUser, showOrigin, showLevel, showDate, showCode,
		showThread1, and showThread2 depending on parameter passed in
		(setMessagesCheckBoxesEnabled) Add new method
		Sets enabled state of showOut, showErr, showJava, showPlugin, showDebug,
		showInfo, showItw, and showApp depending on parameter passed in


changeset eabc9aba2aac in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=eabc9aba2aac
author: Jacob Wisor <gitne at gmx.de>
date: Thu Jul 03 23:06:47 2014 +0200

	Add current date for last commit in ChangeLog

	2014-07-03  Jacob Wisor  <gitne at gmx.de>

		* ChangeLog: Add current date for last commit in ChangeLog


changeset 3fa789df69e7 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=3fa789df69e7
author: Jacob Wisor <gitne at gmx.de>
date: Thu Jul 03 23:25:18 2014 +0200

	Merge


diffstat:

 ChangeLog                                                                  |   46 +++
 netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java          |   53 ++-
 netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java              |   47 ++-
 tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java |  142 ++++-----
 4 files changed, 182 insertions(+), 106 deletions(-)

diffs (495 lines):

diff -r 1c5922c7b7b0 -r 3fa789df69e7 ChangeLog
--- a/ChangeLog	Thu Jun 26 17:22:11 2014 +0200
+++ b/ChangeLog	Thu Jul 03 23:25:18 2014 +0200
@@ -1,3 +1,49 @@
+2014-07-03  Jacob Wisor  <gitne at gmx.de>
+
+	* netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java: Fix
+	handling of UI controls
+	(ConsoleOutputPane) Add set enabled state of headers JCheckBoxes with new
+	setHeadersCheckBoxesEnabled() method depending on showHeaders' saved
+	configuration selected state
+	Add set enabled state of messages JCheckBox with new
+	setMessagesCheckBoxesEnabled method depending on showMessage's selected
+	state on initialization
+	Add set enabled state of refresh JButton reciprocally to autorefresh
+	JCheckBox's selected state on initialization
+	(createDefaultAction) Add null check on argument of public method
+	Add call to new setHeadersCheckBoxesEnabled() method with showHeaders'
+	selected state when clicked
+	Add call to new setMessagesCheckBoxesEnabled() method with showMessage's
+	selected state when clicked
+	Add set enabled state of refresh JButton reciprocally to autorefresh
+	JCheckBox's selected state
+	(initComponents) Add default ActionListener to autorefresh JCheckBox
+	(setHeadersCheckBoxesEnabled) Add new method
+	Sets enabled state of showUser, showOrigin, showLevel, showDate, showCode,
+	showThread1, and showThread2 depending on parameter passed in
+	(setMessagesCheckBoxesEnabled) Add new method
+	Sets enabled state of showOut, showErr, showJava, showPlugin, showDebug,
+	showInfo, showItw, and showApp depending on parameter passed in
+
+2014-07-03  Jiri Vanek  <jvanek at redhat.com>
+
+	* tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java
+	removed useless iterations of all resources against all. Kept only all against
+	default.  Preferred diamonds and for each against full declarations and old-style
+	fors.
+
+2014-06-30  Andrew Azores  <aazores at redhat.com>
+
+	Runnables to be invoked on the EDT are invoked immediately if the current
+	thread is already the EDT, rather than being queued for invocation later.
+	invokeRunnableOrEnqueueLater replaces SwingUtilities.invokeLater to
+	achieve this.
+	* netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java
+	(updateCheckboxes): uses invokeRunnableOrEnqueueAndWait
+	(updateCheckboxesInvokeAndWait): removed
+	(invokeRunnableOrEnqueueAndWait, invokeRunnableOrEnqueueLater): new
+	methods
+
 2014-06-26  Jacob Wisor  <gitne at gmx.de>
 
 	* netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java: Formatting
diff -r 1c5922c7b7b0 -r 3fa789df69e7 netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java
--- a/netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java	Thu Jun 26 17:22:11 2014 +0200
+++ b/netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java	Thu Jul 03 23:25:18 2014 +0200
@@ -377,7 +377,7 @@
         viewCustomButtonAction = new ActionListener() {
             @Override
             public void actionPerformed(final ActionEvent e) {
-                SwingUtilities.invokeLater(new Runnable() {
+                invokeRunnableOrEnqueueLater(new Runnable() {
                     @Override
                     public void run() {
                         String codebase = getSelectedCodebase();
@@ -732,7 +732,7 @@
             model = codebase;
         }
         policyEditorController.addCodebase(codebase);
-        SwingUtilities.invokeLater(new Runnable() {
+        invokeRunnableOrEnqueueLater(new Runnable() {
             @Override
             public void run() {
                 if (!listModel.contains(model)) {
@@ -761,7 +761,7 @@
      * policy file model.
      */
     public void addNewCodebaseInteractive() {
-        SwingUtilities.invokeLater(new Runnable() {
+        invokeRunnableOrEnqueueLater(new Runnable() {
             @Override
             public void run() {
                 String codebase = "";
@@ -790,7 +790,7 @@
         }
         policyEditorController.removeCodebase(codebase);
         final int fIndex = previousIndex;
-        SwingUtilities.invokeLater(new Runnable() {
+        invokeRunnableOrEnqueueLater(new Runnable() {
             @Override
             public void run() {
                 listModel.removeElement(codebase);
@@ -876,17 +876,34 @@
         policyEditorController.clearCustomCodebase(codebase);
     }
 
+    private void invokeRunnableOrEnqueueLater(final Runnable runnable) {
+        if (SwingUtilities.isEventDispatchThread()) {
+            runnable.run();
+        } else {
+            SwingUtilities.invokeLater(runnable);
+        }
+    }
+
+    private void invokeRunnableOrEnqueueAndWait(final Runnable runnable) throws InvocationTargetException, InterruptedException {
+        if (SwingUtilities.isEventDispatchThread()) {
+            runnable.run();
+        } else {
+            SwingUtilities.invokeAndWait(runnable);
+        }
+    }
+
     /**
      * Update the checkboxes to show the permissions granted to the specified codebase
      * @param codebase whose permissions to display
      */
     private void updateCheckboxes(final String codebase) {
         try {
-            if (SwingUtilities.isEventDispatchThread()) {
-                updateCheckboxesImpl(codebase);
-            } else {
-                updateCheckboxesInvokeAndWait(codebase);
-            }
+            invokeRunnableOrEnqueueAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    updateCheckboxesImpl(codebase);
+                }
+            });
         } catch (InterruptedException ex) {
             OutputController.getLogger().log(ex);
         } catch (InvocationTargetException ex) {
@@ -894,16 +911,6 @@
         }
     }
 
-    private void updateCheckboxesInvokeAndWait(final String codebase) throws InterruptedException, InvocationTargetException {
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
-                updateCheckboxesImpl(codebase);
-            }
-        });
-
-    }
-
     private void updateCheckboxesImpl(final String codebase) {
         for (final PolicyEditorPermissions perm : PolicyEditorPermissions.values()) {
             final JCheckBox box = checkboxMap.get(perm);
@@ -1233,7 +1240,7 @@
             protected Void doInBackground() throws Exception {
                 try {
                     if (parentWindow != null) {
-                        SwingUtilities.invokeLater(new Runnable() {
+                        invokeRunnableOrEnqueueLater(new Runnable() {
                             @Override
                             public void run() {
                                 progressIndicator.setLocationRelativeTo(parentWindow);
@@ -1298,7 +1305,7 @@
             public Void doInBackground() throws Exception {
                 try {
                     if (parentWindow != null) {
-                        SwingUtilities.invokeLater(new Runnable() {
+                        invokeRunnableOrEnqueueLater(new Runnable() {
                             @Override
                             public void run() {
                                 progressIndicator.setLocationRelativeTo(parentWindow);
@@ -1331,7 +1338,7 @@
         // This dialog is often displayed when closing the editor, and so PolicyEditor
         // may already be disposed when this dialog appears. Give a weak reference so
         // that this dialog doesn't prevent the JVM from exiting
-        SwingUtilities.invokeLater(new Runnable() {
+        invokeRunnableOrEnqueueLater(new Runnable() {
             @Override
             public void run() {
                 JOptionPane.showMessageDialog(parentPolicyEditor.get(), R("PEChangesSaved"));
@@ -1346,7 +1353,7 @@
         // This dialog is often displayed when closing the editor, and so PolicyEditor
         // may already be disposed when this dialog appears. Give a weak reference so
         // that this dialog doesn't prevent the JVM from exiting
-        SwingUtilities.invokeLater(new Runnable() {
+        invokeRunnableOrEnqueueLater(new Runnable() {
             @Override
             public void run() {
                 JOptionPane.showMessageDialog(parentPolicyEditor.get(), R("PECouldNotSave"), R("Error"), JOptionPane.ERROR_MESSAGE);
diff -r 1c5922c7b7b0 -r 3fa789df69e7 netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java
--- a/netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java	Thu Jun 26 17:22:11 2014 +0200
+++ b/netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java	Thu Jul 03 23:25:18 2014 +0200
@@ -137,9 +137,10 @@
         insertChars = new JPopupMenu();
         initComponents();
         regExFilter.setText(ConsoleOutputPaneModel.defaultPattern.pattern());
-        if (!LogConfig.getLogConfig().isEnableHeaders()) {
-            showHeaders.setSelected(false);
-        }
+        showHeaders.setSelected(LogConfig.getLogConfig().isEnableHeaders());
+        setHeadersCheckBoxesEnabled(showHeaders.isSelected());
+        setMessagesCheckBoxesEnabled(showMessage.isSelected());
+        refresh.setEnabled(!autorefresh.isSelected());
         if (JNLPRuntime.isWebstartApplication()) {
             showPlugin.setSelected(false);
             showPreInit.setSelected(false);
@@ -214,10 +215,10 @@
 
                     @Override
                     public final void run() {
-                        try{
-                        insertChars.setLocation(regExFilter.getLocationOnScreen());
-                        insertChars.setVisible(!insertChars.isVisible());
-                             } catch (Exception ex) {
+                        try {
+                            insertChars.setLocation(regExFilter.getLocationOnScreen());
+                            insertChars.setVisible(!insertChars.isVisible());
+                        } catch (Exception ex) {
                             OutputController.getLogger().log(ex);
                         }
                     }
@@ -238,6 +239,16 @@
 
             @Override
             public final void actionPerformed(final ActionEvent evt) {
+                if (evt == null) return;
+
+                final Object source;
+                if ((source = evt.getSource()) == showHeaders) {
+                    setHeadersCheckBoxesEnabled(showHeaders.isSelected());
+                } else if (source == showMessage) {
+                    setMessagesCheckBoxesEnabled(showMessage.isSelected());
+                } else if (source == autorefresh) {
+                    refresh.setEnabled(!autorefresh.isSelected());
+                }
                 refreshAction();
             }
         };
@@ -395,6 +406,7 @@
 
         autorefresh.setSelected(true);
         autorefresh.setText(Translator.R("COPautoRefresh"));
+        autorefresh.addActionListener(getDefaultActionSingleton());
 
         refresh.setText(Translator.R("COPrefresh"));
         refresh.addActionListener(getDefaultActionSingleton());
@@ -740,6 +752,27 @@
         validate();
     }
 
+    private final void setHeadersCheckBoxesEnabled(final boolean enable) {
+        showUser.setEnabled(enable);
+        showOrigin.setEnabled(enable);
+        showLevel.setEnabled(enable);
+        showDate.setEnabled(enable);
+        showCode.setEnabled(enable);
+        showThread1.setEnabled(enable);
+        showThread2.setEnabled(enable);
+    }
+
+    private final void setMessagesCheckBoxesEnabled(final boolean enable) {
+        showOut.setEnabled(enable);
+        showErr.setEnabled(enable);
+        showJava.setEnabled(enable);
+        showPlugin.setEnabled(enable);
+        showDebug.setEnabled(enable);
+        showInfo.setEnabled(enable);
+        showItw.setEnabled(enable);
+        showApp.setEnabled(enable);
+    }
+
     private final void refreshAction() {
         updateModel();
         refreshPane();
diff -r 1c5922c7b7b0 -r 3fa789df69e7 tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java
--- a/tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java	Thu Jun 26 17:22:11 2014 +0200
+++ b/tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java	Thu Jul 03 23:25:18 2014 +0200
@@ -138,8 +138,8 @@
         
     }
    
-    public static LocalesIdentifier main;
-    public static LocalesIdentifier[] secondary;
+    private static LocalesIdentifier main;
+    private static LocalesIdentifier[] secondary;
 
     @BeforeClass
     public static void loadResourceBoundels() {
@@ -148,61 +148,54 @@
         assertNotNull(main);
         secondary= new LocalesIdentifier[] {LocalesIdentifier.CZ, LocalesIdentifier.DE, LocalesIdentifier.PL};
         assertNotNull(secondary);
-        for (int i = 0; i < secondary.length; i++) {
-            assertNotNull(secondary[i]);
-         
+        for (LocalesIdentifier secondary1 : secondary) {
+            assertNotNull(secondary1);
         }
     }
 
     @Test
     public void allResourcesAreReallyDifferent() {
-        List<LocalesIdentifier> bundles = new ArrayList<LocalesIdentifier>(secondary.length + 1);
+        List<LocalesIdentifier> bundles = new ArrayList<>(secondary.length + 1);
         String detailResults="";
-        bundles.add(main);
         int errors = 0;
         bundles.addAll(Arrays.asList(secondary));
-        for (int i = 0; i < bundles.size(); i++) {
-            LocalesIdentifier resourceBundle1 = bundles.get(i);
+        for (LocalesIdentifier resourceBundle1 : bundles) {
             Enumeration<String> keys1 = resourceBundle1.getBundle().getKeys();
-            for (int j = 0; j < bundles.size(); j++) {
-                LocalesIdentifier resourceBundle2 = bundles.get(j);
-                if (resourceBundle1.getLanguage().equals(resourceBundle2.getLanguage())) {
-                    //do not compare same language groups
-                    allLog("Skipping same language " + resourceBundle1.getLocale() + " x " + resourceBundle2.getLocale() + " (should be " + resourceBundle1.getIdentifier() + " x " + resourceBundle2.getIdentifier() + ")");
-                    break;
+            LocalesIdentifier resourceBundle2 = main;
+            allLog("Checking for same items between " + resourceBundle1.getLocale() + " x " + resourceBundle2.getLocale() + " (should be " + resourceBundle1.getIdentifier() + " x " + resourceBundle2.getIdentifier() + ")");
+            int localErrors=0;
+            while (keys1.hasMoreElements()) {
+                String key = keys1.nextElement();
+                String val1 = getMissingResourceAsEmpty(resourceBundle1.getBundle(), key);
+                if (val1.length() > 1000) {
+                    errLog("Skipping check of: " + key + " too long. (" + val1.length() + ")"); 
+                    continue;
                 }
-                allLog("Checking for same items between " + resourceBundle1.getLocale() + " x " + resourceBundle2.getLocale() + " (should be " + resourceBundle1.getIdentifier() + " x " + resourceBundle2.getIdentifier() + ")");
-                int localErrors=0;
-                while (keys1.hasMoreElements()) {
-                    String key = keys1.nextElement();
-                    String val1 = getMissingResourceAsEmpty(resourceBundle1.getBundle(), key);
-                    String val2 = getMissingResourceAsEmpty(resourceBundle2.getBundle(), key);
-                    outLog("\""+val1+"\" x \""+val2);
-                    if (val1.trim().equalsIgnoreCase(val2.trim())) {
-                        if (val1.trim().length() <= 5 /* short words like"ok", "", ...*/
-                                || val1.toLowerCase().contains("://") /*urls...*/
-                                || !val1.trim().contains(" ") /*one word*/
-                                || val1.replaceAll("\\{\\d\\}", "").trim().length()<5 /*only vars and short words*/
-                                //white list
-                                || (val1.trim().equals("std. err"))
-                                || (val1.trim().equals("std. out"))
-                                || (val1.trim().equals("Policy Editor"))
-                                || (val1.trim().equals("Java Reflection")))
-                        {
-                            errLog("Warning! Items equals for: " + key + " = " + val1 + " but are in allowed subset");
-                        } else {
-                            errors++;
-                            localErrors++;
-                            errLog("Error! Items equals for: " + key + " = " + val1);
-                        }
+                String val2 = getMissingResourceAsEmpty(resourceBundle2.getBundle(), key);
+                outLog("\""+val1+"\" x \""+val2);
+                if (val1.trim().equalsIgnoreCase(val2.trim())) {
+                    if (val1.trim().length() <= 5 /* short words like"ok", "", ...*/
+                            || val1.toLowerCase().contains("://") /*urls...*/
+                            || !val1.trim().contains(" ") /*one word*/
+                            || val1.replaceAll("\\{\\d\\}", "").trim().length()<5 /*only vars and short words*/
+                            //white list
+                            || (val1.trim().equals("std. err"))
+                            || (val1.trim().equals("std. out"))
+                            || (val1.trim().equals("Policy Editor"))
+                            || (val1.trim().equals("Java Reflection")))
+                    {
+                        errLog("Warning! Items equals for: " + key + " = " + val1 + " but are in allowed subset");
+                    } else {
+                        errors++;
+                        localErrors++;
+                        errLog("Error! Items equals for: " + key + " = " + val1);
                     }
                 }
-                if (localErrors > 0){
-                    detailResults+=resourceBundle1.getIdentifier()+" x "+resourceBundle2.getIdentifier()+": "+localErrors+";";
-                }
-                errLog(localErrors+" errors allResourcesAreReallyDifferent fo "+resourceBundle1.getIdentifier()+" x "+resourceBundle2.getIdentifier());
-
             }
+            if (localErrors > 0){
+                detailResults+=resourceBundle1.getIdentifier()+" x "+resourceBundle2.getIdentifier()+": "+localErrors+";";
+            }
+            errLog(localErrors+" errors allResourcesAreReallyDifferent fo "+resourceBundle1.getIdentifier()+" x "+resourceBundle2.getIdentifier());
         }
         assertTrue("Several - " + errors + " - items are same in  bundles. See error logs for details: "+detailResults, errors == 0);
     }
@@ -221,10 +214,10 @@
     public void warnForNotLocalisedStrings() {
         int errors = 0;
         Enumeration<String> keys = main.getBundle().getKeys();
-        for (int i = 0; i < secondary.length; i++) {
+        for (LocalesIdentifier secondary1 : secondary) {
             int localErrors = 0;
-            ResourceBundle sec = secondary[i].getBundle();
-            String id = secondary[i].getIdentifier();
+            ResourceBundle sec = secondary1.getBundle();
+            String id = secondary1.getIdentifier();
             allLog("Checking for missing  strings in " + sec.getLocale() + " (should be " + id + ") compared with default");
             while (keys.hasMoreElements()) {
                 String key = keys.nextElement();
@@ -234,15 +227,14 @@
                 if (val1.trim().isEmpty()) {
                 } else {
                     if (val2.trim().isEmpty()){
-                    errors++;
-                    localErrors++;
-                    errLog("Error! There is value for default: " + key + ", but for " + id+" is missing");
+                        errors++;
+                        localErrors++;
+                        errLog("Error! There is value for default: " + key + ", but for " + id+" is missing");
                     }
 
                 }
             }
             errLog(localErrors+" warnForNotLocalisedStrings errors for "+id);
-
         }
         assertTrue("Several - " + errors + " - items have missing localization. See error logs for details", errors == 0);
     }
@@ -251,29 +243,28 @@
     
     @Test
     public void noEmptyResources() {
-         List<LocalesIdentifier> bundles = new ArrayList<LocalesIdentifier>(secondary.length + 1);
+         List<LocalesIdentifier> bundles = new ArrayList<>(secondary.length + 1);
         bundles.add(main);
         int errors = 0;
         bundles.addAll(Arrays.asList(secondary));
-        for (int i = 0; i < bundles.size(); i++) {
-            ResourceBundle resourceBundle = bundles.get(i).getBundle();
-            String id = bundles.get(i).getIdentifier();
+        for (LocalesIdentifier bundle : bundles) {
+            ResourceBundle resourceBundle = bundle.getBundle();
+            String id = bundle.getIdentifier();
             Enumeration<String> keys = resourceBundle.getKeys();
-                allLog("Checking for empty items in " + resourceBundle.getLocale() + "  (should be " + id + ")");
-                int localErrors=0;
-                while (keys.hasMoreElements()) {
-                    String key = keys.nextElement();
-                    String val = getMissingResourceAsEmpty(resourceBundle, key);
-                    outLog("\""+key+"\" = \""+val);
-                        if (val.trim().isEmpty()) {
-                            errors++;
-                            localErrors++;
-                            errLog("Error! Key: " + key + " have no vlue");
-                        }
-                    
+            allLog("Checking for empty items in " + resourceBundle.getLocale() + "  (should be " + id + ")");
+            int localErrors=0;
+            while (keys.hasMoreElements()) {
+                String key = keys.nextElement();
+                String val = getMissingResourceAsEmpty(resourceBundle, key);
+                outLog("\""+key+"\" = \""+val);
+                if (val.trim().isEmpty()) {
+                    errors++;
+                    localErrors++;
+                    errLog("Error! Key: " + key + " have no vlue");
                 }
-                errLog(localErrors+" noEmptyResources errors for "+id);
-
+                
+            }
+            errLog(localErrors+" noEmptyResources errors for "+id);
         }
         assertTrue("Several - " + errors + " - items  have no values", errors == 0);
     }
@@ -282,11 +273,11 @@
     @Test
     public void findKeysWhichAreInLocalisedButNotInDefault() {
         int errors = 0;
-        for (int i = 0; i < secondary.length; i++) {
+        for (LocalesIdentifier secondary1 : secondary) {
             int localErrors = 0;
-            ResourceBundle sec = secondary[i].getBundle();
+            ResourceBundle sec = secondary1.getBundle();
             Enumeration<String> keys = sec.getKeys();
-            String id = secondary[i].getId();
+            String id = secondary1.getId();
             outLog("Checking for redundant keys in " + sec.getLocale() + " (should be " + id + ") compared with default");
             errLog("Checking for redundant keys in " + sec.getLocale() + " (should be " + id + ") compared with default");
             while (keys.hasMoreElements()) {
@@ -294,15 +285,14 @@
                 String val2 = getMissingResourceAsEmpty(main.getBundle(), key);
                 String val1 = getMissingResourceAsEmpty(sec, key);
                 outLog("\""+val1+"\" x \""+val2);
-                    if (val2.trim().isEmpty() && !val1.trim().isEmpty()){
+                if (val2.trim().isEmpty() && !val1.trim().isEmpty()){
                     errors++;
                     localErrors++;
                     errLog("Error! There is value for "+id+", key " + key + ", but for default is missing");
-                    }
-
+                }
+                
             }
             errLog(localErrors+" findKeysWhichAreInLocalisedButNotInDefault errors for "+id);
-
         }
         assertTrue("Several - " + errors + " - items  have value in localized version but not in default one", errors == 0);
     }


More information about the distro-pkg-dev mailing list