summaryrefslogtreecommitdiff
path: root/odk/examples/DevelopersGuide
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-01-09 14:51:38 +0200
committerNoel Grandin <noel@peralex.com>2015-01-09 15:10:51 +0200
commit3757c03fc8f138427e21c41ef5e66e8c5a98159c (patch)
tree64d58e7d94aa60c4da475ac038e59d5c1a517437 /odk/examples/DevelopersGuide
parent8912e6dab98eabbdeea870a387d30ef1de938acb (diff)
java: simplify array creation
and remove the need to worry about keeping indexes correct Change-Id: I9a5fc00f7e28f305279b41099274c96daebebb95
Diffstat (limited to 'odk/examples/DevelopersGuide')
-rw-r--r--odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java8
-rw-r--r--odk/examples/DevelopersGuide/Config/ConfigExamples.java9
2 files changed, 6 insertions, 11 deletions
diff --git a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
index 253ca608b503..2c1aa7cce227 100644
--- a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
+++ b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
@@ -190,10 +190,10 @@ public class DialogComponent {
}
public String[] getSupportedMethodNames() {
- String[] retValue= new String[3];
- retValue[0]= aHandlerMethod1;
- retValue[1]= aHandlerMethod2;
- retValue[2]= aHandlerMethod3;
+ String[] retValue= new String[] {
+ aHandlerMethod1,
+ aHandlerMethod2,
+ aHandlerMethod3 };
return retValue;
}
diff --git a/odk/examples/DevelopersGuide/Config/ConfigExamples.java b/odk/examples/DevelopersGuide/Config/ConfigExamples.java
index 510425d57e32..e197fd529897 100644
--- a/odk/examples/DevelopersGuide/Config/ConfigExamples.java
+++ b/odk/examples/DevelopersGuide/Config/ConfigExamples.java
@@ -401,10 +401,7 @@ public class ConfigExamples
UnoRuntime.queryInterface(XMultiPropertySet.class, xSubdivision);
// variables for multi-element access
- String[] aElementNames = new String[2];
-
- aElementNames[0] = "XAxis";
- aElementNames[1] = "YAxis";
+ String[] aElementNames = new String[] { "XAxis", "YAxis" };
Object[] aElementValues = xSubdivProperties.getPropertyValues(aElementNames);
@@ -869,9 +866,7 @@ public class ConfigExamples
aSettings[0] = new com.sun.star.beans.NamedValue("HeaderLine",Boolean.TRUE);
aSettings[1] = new com.sun.star.beans.NamedValue("FieldDelimiter",";");
- String [] aTableFilter = new String[2];
- aTableFilter[0] = "table.txt";
- aTableFilter[1] = "othertable.txt";
+ String [] aTableFilter = new String[] { "table.txt", "othertable.txt" };
storeDataSource(sSampleDataSourceName,sSampleDataSourceURL,"",false,0,aSettings,aTableFilter);
}