diff options
author | Noel Grandin <noel@peralex.com> | 2014-07-31 10:38:38 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-07-31 10:38:38 +0200 |
commit | 7f9732e998e6e90cafa8bd36886af5e8bc7a71a1 (patch) | |
tree | dec926cc52851aa0c8ef8b381b8ddea4aca68ed7 /xmerge | |
parent | 4a39475e355b256dc0a922d21b21e695aaa5577b (diff) |
remove commented out code
and fix up some formatting
Change-Id: I8d24c66901eeaf8a6c7aa5e797821c807edaf6ee
Diffstat (limited to 'xmerge')
-rw-r--r-- | xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java | 52 |
1 files changed, 16 insertions, 36 deletions
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java index 1bf160df27d2..76b0792d96e6 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java @@ -31,14 +31,7 @@ import java.io.*; */ public final class ConverterInfoMgr { - private static ArrayList<ConverterInfo> converterInfoList; - - /** - * Constructor - */ - static { - converterInfoList = new ArrayList<ConverterInfo>(); - } + private static final ArrayList<ConverterInfo> converterInfoList = new ArrayList<ConverterInfo>(); /** * Adds a converter plug-in to the registry. The @@ -137,24 +130,12 @@ public final class ConverterInfoMgr { */ public static boolean removeByJar(String jar) { - ConverterInfo converterInfo; boolean rc = false; - // FIX (HJ): Has to use an iterator, since we are removing items - /*Enumeration ciEnum = converterInfoList.elements(); - while (ciEnum.hasMoreElements()) - { - converterInfo = (ConverterInfo)ciEnum.nextElement(); - if (jar.equals(converterInfo.getJarName())) { - converterInfoList.remove(converterInfo); - rc = true; - } - }*/ - Iterator<ConverterInfo> ciIter = converterInfoList.iterator(); while (ciIter.hasNext()) { - converterInfo = ciIter.next(); + ConverterInfo converterInfo = ciIter.next(); if (jar.equals(converterInfo.getJarName())) { ciIter.remove(); rc = true; @@ -215,7 +196,7 @@ public final class ConverterInfoMgr { String fromDeviceInfo = fromEnum.next(); if (deviceMime.trim().equals(fromDeviceInfo) && officeMime.trim().equals(toDeviceInfo)) { - return (converterInfo); + return converterInfo; } } } @@ -279,8 +260,7 @@ public final class ConverterInfoMgr { fromOfficeInfo.equals(toOfficeInfo)) { // Found a match - - return (converterInfo); + return converterInfo; } } } @@ -299,7 +279,7 @@ public final class ConverterInfoMgr { public static void main(String args[]) { ConverterInfoReader cir = null; - boolean validate = false; + boolean validate = false; InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); char c = ' '; @@ -314,7 +294,7 @@ public final class ConverterInfoMgr { System.out.println("(F)ind ConverterInfo"); System.out.println("(C)ind ConverterInfo chain"); System.out.println("(V)iew plug-ins"); - System.out.println("(T)oggle Validation"); + System.out.println("(T)oggle Validation"); System.out.println("(Q)uit\n"); try { @@ -360,14 +340,14 @@ public final class ConverterInfoMgr { // Unload by Display Name or Jarfile - } else if (c == 'T') { - if (validate== true){ - System.out.println("Validation switched off"); - validate=false; - }else{ - System.out.println("Validation switched on"); - validate=true; - } + } else if (c == 'T') { + if (validate== true){ + System.out.println("Validation switched off"); + validate=false; + } else { + System.out.println("Validation switched on"); + validate=true; + } } else if (c == 'D' || c == 'J') { if (c == 'D') { @@ -483,8 +463,8 @@ public final class ConverterInfoMgr { System.out.println(" Vendor : " + converterInfo.getVendor()); System.out.println(" ClassImpl : " + converterInfo.getClassImpl()); System.out.println(" XsltSerial : " + converterInfo.getXsltSerial()); - System.out.println(" XsltDeserial : " + converterInfo.getXsltDeserial()); - System.out.println(" Serialize : " + converterInfo.canSerialize()); + System.out.println(" XsltDeserial : " + converterInfo.getXsltDeserial()); + System.out.println(" Serialize : " + converterInfo.canSerialize()); System.out.println(" Deserialize : " + converterInfo.canDeserialize()); System.out.println(" Merge : " + converterInfo.canMerge()); ciCnt++; |