summaryrefslogtreecommitdiff
path: root/javaunohelper
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-10-15 16:25:10 +0200
committerNoel Grandin <noel@peralex.com>2014-10-16 08:15:52 +0200
commitfa22664be218c211c41342c6296616c316b2c3b1 (patch)
tree2118e12dffce57f5027ef4aed227d27acf8c6ed6 /javaunohelper
parent94ae3e827b71da5be77ff04522ff156770801b25 (diff)
java: always use braces for while loops
Change-Id: Iff896b0cace8b8305528b3b0140004ea856169ce
Diffstat (limited to 'javaunohelper')
-rw-r--r--javaunohelper/com/sun/star/lib/uno/adapter/XOutputStreamToByteArrayAdapter.java3
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java6
-rw-r--r--javaunohelper/test/com/sun/star/lib/uno/helper/InterfaceContainer_Test.java9
3 files changed, 12 insertions, 6 deletions
diff --git a/javaunohelper/com/sun/star/lib/uno/adapter/XOutputStreamToByteArrayAdapter.java b/javaunohelper/com/sun/star/lib/uno/adapter/XOutputStreamToByteArrayAdapter.java
index 9ebcb0684894..f8e738d0d8f8 100644
--- a/javaunohelper/com/sun/star/lib/uno/adapter/XOutputStreamToByteArrayAdapter.java
+++ b/javaunohelper/com/sun/star/lib/uno/adapter/XOutputStreamToByteArrayAdapter.java
@@ -87,8 +87,9 @@ public final class XOutputStreamToByteArrayAdapter
{
if ( externalBuffer )
throw new BufferSizeExceededException("out of buffer space, cannot grow external buffer");
- while ( values.length > size-position )
+ while ( values.length > size-position ) {
size *= 2;
+ }
byte[] newBuffer = new byte[size];
System.arraycopy(buffer, 0, newBuffer, 0, position);
buffer = newBuffer;
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java b/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java
index 2437f364bbb6..10a39694d9dc 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java
@@ -138,14 +138,16 @@ public class MultiTypeInterfaceContainer
{
it= map.values().iterator();
}
- while (it.hasNext() )
+ while (it.hasNext() ) {
it.next().disposeAndClear(evt);
+ }
}
synchronized public void clear()
{
Iterator<InterfaceContainer> it= map.values().iterator();
- while (it.hasNext())
+ while (it.hasNext()) {
it.next().clear();
+ }
}
}
diff --git a/javaunohelper/test/com/sun/star/lib/uno/helper/InterfaceContainer_Test.java b/javaunohelper/test/com/sun/star/lib/uno/helper/InterfaceContainer_Test.java
index 7459fae4085a..d9488114d420 100644
--- a/javaunohelper/test/com/sun/star/lib/uno/helper/InterfaceContainer_Test.java
+++ b/javaunohelper/test/com/sun/star/lib/uno/helper/InterfaceContainer_Test.java
@@ -571,11 +571,13 @@ public class InterfaceContainer_Test
cont.addAll(list1);
// go to the end of our list and list1
ListIterator it= cont.listIterator();
- while (it.hasNext())
+ while (it.hasNext()) {
it.next();
+ }
ListIterator it_list1= list1.listIterator();
- while (it_list1.hasNext())
+ while (it_list1.hasNext()) {
it_list1.next();
+ }
while (it.hasPrevious())
{
@@ -612,8 +614,9 @@ public class InterfaceContainer_Test
ListIterator it;
cont.addAll(list1);
it= cont.listIterator();
- while (it.hasNext())
+ while (it.hasNext()) {
it.next();
+ }
assertEquals(it.previousIndex(), 2);
it.previous();