diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-15 16:25:10 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-10-16 08:15:52 +0200 |
commit | fa22664be218c211c41342c6296616c316b2c3b1 (patch) | |
tree | 2118e12dffce57f5027ef4aed227d27acf8c6ed6 /toolkit/test | |
parent | java: replace 'new Short' with 'Short.valueOf' (diff) | |
download | core-fa22664be218c211c41342c6296616c316b2c3b1.tar.gz core-fa22664be218c211c41342c6296616c316b2c3b1.zip |
java: always use braces for while loops
Change-Id: Iff896b0cace8b8305528b3b0140004ea856169ce
Diffstat (limited to 'toolkit/test')
7 files changed, 18 insertions, 10 deletions
diff --git a/toolkit/test/accessibility/AccessibilityTreeModel.java b/toolkit/test/accessibility/AccessibilityTreeModel.java index 623507a70e5a..55b56fef0e0f 100644 --- a/toolkit/test/accessibility/AccessibilityTreeModel.java +++ b/toolkit/test/accessibility/AccessibilityTreeModel.java @@ -160,9 +160,10 @@ public class AccessibilityTreeModel else { // depth-first removal of children - while (aNode.getChildCount() > 0) + while (aNode.getChildCount() > 0) { if ( ! removeChild (aNode.getChildNoCreate (0))) break; + } // Remove node from its parent. AccessibleTreeNode aParent = aNode.getParent(); diff --git a/toolkit/test/accessibility/AccessibleTextHandler.java b/toolkit/test/accessibility/AccessibleTextHandler.java index d29eefdab6ae..dfecd974803c 100644 --- a/toolkit/test/accessibility/AccessibleTextHandler.java +++ b/toolkit/test/accessibility/AccessibleTextHandler.java @@ -650,13 +650,15 @@ class TextEditDialog extends TextActionDialog // count equal characters from front and end int nFront = 0; while( (nFront < nMinLength) && - (sNew.charAt(nFront) == sOld.charAt(nFront)) ) + (sNew.charAt(nFront) == sOld.charAt(nFront)) ) { nFront++; + } int nBack = 0; while( (nBack < nMinLength) && ( sNew.charAt(sNew.length()-nBack-1) == - sOld.charAt(sOld.length()-nBack-1) ) ) + sOld.charAt(sOld.length()-nBack-1) ) ) { nBack++; + } if( nFront + nBack > nMinLength ) nBack = nMinLength - nFront; diff --git a/toolkit/test/accessibility/AccessibleTreeCellRenderer.java b/toolkit/test/accessibility/AccessibleTreeCellRenderer.java index c46058c551da..cd032b9aa17e 100644 --- a/toolkit/test/accessibility/AccessibleTreeCellRenderer.java +++ b/toolkit/test/accessibility/AccessibleTreeCellRenderer.java @@ -79,8 +79,9 @@ public class AccessibleTreeCellRenderer */ public void addChangedLine (int nRow) { - while (maChangedLines.size() <= nRow) + while (maChangedLines.size() <= nRow) { maChangedLines.add(null); + } nRow -= 1; // row index is one to large for some reason. maChangedLines.set (nRow, true); } diff --git a/toolkit/test/accessibility/Canvas.java b/toolkit/test/accessibility/Canvas.java index c600a9e7f91d..aca2e1f209d5 100644 --- a/toolkit/test/accessibility/Canvas.java +++ b/toolkit/test/accessibility/Canvas.java @@ -144,9 +144,9 @@ class Canvas public void clear () { - while (maNodes.size() > 0) + while (maNodes.size() > 0) { removeNode (maNodes.get(0)); - + } maNodes.clear(); maObjects.clear(); maObjectList.clear(); diff --git a/toolkit/test/accessibility/InformationWriter.java b/toolkit/test/accessibility/InformationWriter.java index 8b1a373760ef..27950c24f579 100644 --- a/toolkit/test/accessibility/InformationWriter.java +++ b/toolkit/test/accessibility/InformationWriter.java @@ -222,8 +222,9 @@ public class InformationWriter { // Create indentation string. String sIndent = ""; - while (depth-- > 0) + while (depth-- > 0) { sIndent += " "; + } // Get XAccessibleContext object if given object does not // already support this interface. diff --git a/toolkit/test/accessibility/MessageArea.java b/toolkit/test/accessibility/MessageArea.java index b3108d9c0e53..5b3c1946db14 100644 --- a/toolkit/test/accessibility/MessageArea.java +++ b/toolkit/test/accessibility/MessageArea.java @@ -76,8 +76,9 @@ public class MessageArea */ public static synchronized void print (int nIndentation, String aMessage) { - while (nIndentation-- > 0) + while (nIndentation-- > 0) { aMessage = " " + aMessage; + } Instance().printMessage(aMessage); } diff --git a/toolkit/test/accessibility/TextUpdateListener.java b/toolkit/test/accessibility/TextUpdateListener.java index 7ab8deb5e73a..61b499655879 100644 --- a/toolkit/test/accessibility/TextUpdateListener.java +++ b/toolkit/test/accessibility/TextUpdateListener.java @@ -89,13 +89,15 @@ class TextUpdateListener implements TreeModelListener // count equal characters from front and end int nFront = 0; while( (nFront < nMinLength) && - (sNew.charAt(nFront) == sOld.charAt(nFront)) ) + (sNew.charAt(nFront) == sOld.charAt(nFront)) ) { nFront++; + } int nBack = 0; while( (nBack < nMinLength) && ( sNew.charAt(sNew.length()-nBack-1) == - sOld.charAt(sOld.length()-nBack-1) ) ) + sOld.charAt(sOld.length()-nBack-1) ) ) { nBack++; + } if( nFront + nBack > nMinLength ) nBack = nMinLength - nFront; |