Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 9 commits
  • 55 files changed
  • 0 comments
  • 2 contributors

Showing 55 changed files with 265 additions and 261 deletions. Show diff stats Hide diff stats

  1. 6  jpos/src/main/java/org/jpos/bsh/BSHLogListener.java
  2. 4  jpos/src/main/java/org/jpos/core/VolatileSequencer.java
  3. 2  jpos/src/main/java/org/jpos/iso/ISOAmount.java
  4. 2  jpos/src/main/java/org/jpos/iso/ISOBinaryField.java
  5. 2  jpos/src/main/java/org/jpos/iso/ISOBitMap.java
  6. 2  jpos/src/main/java/org/jpos/iso/ISOMsg.java
  7. 6  jpos/src/main/java/org/jpos/iso/ISOServer.java
  8. 2  jpos/src/main/java/org/jpos/iso/LeftPadder.java
  9. 2  jpos/src/main/java/org/jpos/iso/channel/LogChannel.java
  10. 294  jpos/src/main/java/org/jpos/iso/channel/TelnetXMLChannel.java
  11. 2  jpos/src/main/java/org/jpos/iso/channel/XMLChannel.java
  12. 4  jpos/src/main/java/org/jpos/iso/packager/Base1Packager.java
  13. 4  jpos/src/main/java/org/jpos/iso/packager/Base1SubFieldPackager.java
  14. 6  jpos/src/main/java/org/jpos/iso/packager/CTCSubElementPackager.java
  15. 6  jpos/src/main/java/org/jpos/iso/packager/CTCSubFieldPackager.java
  16. 2  jpos/src/main/java/org/jpos/iso/packager/EuroPackager.java
  17. 2  jpos/src/main/java/org/jpos/iso/packager/GenericPackager.java
  18. 14  jpos/src/main/java/org/jpos/iso/packager/GenericValidatingPackager.java
  19. 2  jpos/src/main/java/org/jpos/iso/packager/ISOBaseValidatingPackager.java
  20. 2  jpos/src/main/java/org/jpos/iso/packager/PostPackager.java
  21. 2  jpos/src/main/java/org/jpos/iso/packager/VAPVIPPackager.java
  22. 2  jpos/src/main/java/org/jpos/iso/packager/VISA1Packager.java
  23. 2  jpos/src/main/java/org/jpos/iso/validator/MSGTEST.java
  24. 2  jpos/src/main/java/org/jpos/iso/validator/TEST0100.java
  25. 4  jpos/src/main/java/org/jpos/iso/validator/VErrorParser.java
  26. 2  jpos/src/main/java/org/jpos/q2/QFactory.java
  27. 2  jpos/src/main/java/org/jpos/q2/cli/MEM.java
  28. 2  jpos/src/main/java/org/jpos/q2/cli/TAIL.java
  29. 2  jpos/src/main/java/org/jpos/q2/cli/TMMON.java
  30. 10  jpos/src/main/java/org/jpos/q2/iso/QMUX.java
  31. 6  jpos/src/main/java/org/jpos/q2/iso/QServer.java
  32. 24  jpos/src/main/java/org/jpos/security/CryptographicServiceMessage.java
  33. 2  jpos/src/main/java/org/jpos/security/SimpleKeyFile.java
  34. 2  jpos/src/main/java/org/jpos/space/JDBMSpace.java
  35. 2  jpos/src/main/java/org/jpos/space/SpaceFactory.java
  36. 2  jpos/src/main/java/org/jpos/space/SpaceUtil.java
  37. 2  jpos/src/main/java/org/jpos/space/TSpace.java
  38. 4  jpos/src/main/java/org/jpos/transaction/TransactionManager.java
  39. 2  jpos/src/main/java/org/jpos/transaction/participant/BSHTransactionParticipant.java
  40. 2  jpos/src/main/java/org/jpos/ui/factory/HtmlFactory.java
  41. 2  jpos/src/main/java/org/jpos/ui/factory/LogListenerFactory.java
  42. 8  jpos/src/main/java/org/jpos/util/FSDMsg.java
  43. 2  jpos/src/main/java/org/jpos/util/NameRegistrar.java
  44. 4  jpos/src/main/java/org/jpos/util/Profiler.java
  45. 28  jpos/src/test/java/org/jpos/bsh/BSHLogListenerTest.java
  46. 4  jpos/src/test/java/org/jpos/iso/packager/Base1PackagerTest.java
  47. 6  jpos/src/test/java/org/jpos/iso/packager/Base1SubFieldPackagerTest.java
  48. 2  jpos/src/test/java/org/jpos/iso/packager/EuroPackagerTest.java
  49. 2  jpos/src/test/java/org/jpos/iso/packager/PostPackagerTest.java
  50. 2  jpos/src/test/java/org/jpos/q2/qbean/SystemMonitorTest.java
  51. 8  jpos/src/test/java/org/jpos/transaction/PausedTransactionTest.java
  52. 2  jpos/src/test/java/org/jpos/transaction/TestRetryParticipant.java
  53. 2  jpos/src/test/java/org/jpos/transaction/TransactionManagerTestCase.java
  54. 8  jpos/src/test/java/org/jpos/ui/factory/HtmlFactoryTest.java
  55. 2  jpos/src/test/java/org/jpos/util/ThreadPoolTest.java
6  jpos/src/main/java/org/jpos/bsh/BSHLogListener.java
@@ -100,7 +100,7 @@ public void setConfiguration(org.jpos.core.Configuration cfg) {
100 100
     protected static String[] replace(String[] src, String[] patterns, String[] to){
101 101
         String[] ret = new String[src.length];
102 102
         for(int i=0; i<src.length; i++){
103  
-            StringBuffer buff = new StringBuffer(2*src[i].length());
  103
+            StringBuilder buff = new StringBuilder(2*src[i].length());
104 104
             int begin, end=0;
105 105
             //begin is the position of the next pattern, end is the end of the last pattern
106 106
             while ((begin = src[i].indexOf('$',end))>=0 && begin<src[i].length()){
@@ -178,7 +178,7 @@ public LogEvent log(org.jpos.util.LogEvent ev) {
178 178
     }
179 179
     protected String loadCode(File f) throws IOException{
180 180
         FileReader r = new FileReader(f);
181  
-        StringBuffer buf = new StringBuffer((int)f.length());
  181
+        StringBuilder buf = new StringBuilder((int)f.length());
182 182
         char[] content = new char[(int)f.length()];
183 183
         int l;
184 184
         while((l=r.read(content))!=-1) buf.append(content,0,l);
@@ -192,7 +192,7 @@ protected ScriptInfo getScriptInfo(String filename){
192 192
     protected void addScriptInfo(String filename, String code, long lastModified){
193 193
         scripts.put(filename, new ScriptInfo(code, lastModified));
194 194
     }
195  
-    protected class ScriptInfo{
  195
+    protected static class ScriptInfo{
196 196
         String code;
197 197
         long lastModified;
198 198
         long lastCheck;
4  jpos/src/main/java/org/jpos/core/VolatileSequencer.java
@@ -45,7 +45,7 @@ synchronized public int get (String counterName, int add) {
45 45
         if (I != null)
46 46
             i = I.intValue();
47 47
         i += add;
48  
-        map.put (counterName, new Integer (i));
  48
+        map.put (counterName, Integer.valueOf(i));
49 49
         return i;
50 50
     }
51 51
     /**
@@ -65,7 +65,7 @@ synchronized public int set (String counterName, int newValue) {
65 65
         Integer I = (Integer) map.get (counterName);
66 66
         if (I != null)
67 67
             oldValue = I.intValue();
68  
-        map.put (counterName, new Integer (newValue));
  68
+        map.put (counterName, Integer.valueOf(newValue));
69 69
         return oldValue;
70 70
     }
71 71
     public String[] getCounterNames () {
2  jpos/src/main/java/org/jpos/iso/ISOAmount.java
@@ -105,7 +105,7 @@ public String getAmountAsLegacyString() throws ISOException {
105 105
         return ISOUtil.zeropad (amount.unscaledValue().toString(), 12);
106 106
     }
107 107
     public String getAmountAsString() throws ISOException {
108  
-        StringBuffer sb = new StringBuffer(16);
  108
+        StringBuilder sb = new StringBuilder(16);
109 109
         sb.append (ISOUtil.zeropad (Integer.toString (currencyCode),3));
110 110
         sb.append (Integer.toString(amount.scale() % 10));
111 111
         sb.append (ISOUtil.zeropad (amount.unscaledValue().toString(), 12));
2  jpos/src/main/java/org/jpos/iso/ISOBinaryField.java
@@ -109,7 +109,7 @@ public void unpack(InputStream in) throws ISOException {
109 109
      * @return Object representing this field number
110 110
      */
111 111
     public Object getKey() {
112  
-        return new Integer(fieldNumber);
  112
+        return Integer.valueOf(fieldNumber);
113 113
     }
114 114
     /**
115 115
      * @return Object representing this field value
2  jpos/src/main/java/org/jpos/iso/ISOBitMap.java
@@ -84,7 +84,7 @@ public void unpack(InputStream in) throws ISOException {
84 84
      * @return Object representing this field number
85 85
      */
86 86
     public Object getKey() {
87  
-        return new Integer(fieldNumber);
  87
+        return Integer.valueOf(fieldNumber);
88 88
     }
89 89
     /**
90 90
      * @return Object representing this field value
2  jpos/src/main/java/org/jpos/iso/ISOMsg.java
@@ -737,7 +737,7 @@ public void merge (ISOMsg m) {
737 737
      * @return a string suitable for a log
738 738
      */
739 739
     public String toString() {
740  
-        StringBuffer s = new StringBuffer();
  740
+        StringBuilder s = new StringBuilder();
741 741
         if (isIncoming())
742 742
             s.append("<-- ");
743 743
         else if (isOutgoing())
6  jpos/src/main/java/org/jpos/iso/ISOServer.java
@@ -460,7 +460,7 @@ public void setConfiguration (Configuration cfg) throws ConfigurationException {
460 460
         }
461 461
     }
462 462
     public String getISOChannelNames () {
463  
-        StringBuffer sb = new StringBuffer ();
  463
+        StringBuilder sb = new StringBuilder ();
464 464
         Iterator iter = channels.entrySet().iterator();
465 465
         for (int i=0; iter.hasNext(); i++) {
466 466
             Map.Entry entry = (Map.Entry) iter.next();
@@ -475,7 +475,7 @@ public String getISOChannelNames () {
475 475
         return sb.toString();
476 476
     }
477 477
     public String getCountersAsString () {
478  
-        StringBuffer sb = new StringBuffer ();
  478
+        StringBuilder sb = new StringBuilder ();
479 479
         int cnt[] = getCounters();
480 480
         sb.append ("connected=");
481 481
         sb.append (Integer.toString(cnt[0]));
@@ -554,7 +554,7 @@ public void dump (PrintStream p, String indent) {
554 554
             ISOChannel c = (ISOChannel) ref.get ();
555 555
             if (c != null && !LAST.equals (entry.getKey()) && c.isConnected()) {
556 556
                 if (c instanceof BaseChannel) {
557  
-                    StringBuffer sb = new StringBuffer ();
  557
+                    StringBuilder sb = new StringBuilder ();
558 558
                     int[] cc = ((BaseChannel)c).getCounters();
559 559
                     sb.append (inner);
560 560
                     sb.append (entry.getKey());
2  jpos/src/main/java/org/jpos/iso/LeftPadder.java
@@ -53,7 +53,7 @@ public LeftPadder(char pad)
53 53
 	 */
54 54
     public String pad(String data, int maxLength) throws ISOException
55 55
     {
56  
-        StringBuffer padded = new StringBuffer(maxLength);
  56
+        StringBuilder padded = new StringBuilder(maxLength);
57 57
         int len = data.length();
58 58
         if (len > maxLength)
59 59
         {
2  jpos/src/main/java/org/jpos/iso/channel/LogChannel.java
@@ -78,7 +78,7 @@ public LogChannel (ISOPackager p, ServerSocket serverSocket)
78 78
      * @exception IOException
79 79
      */
80 80
     protected byte[] streamReceive() throws IOException {
81  
-        StringBuffer sb = new StringBuffer();
  81
+        StringBuilder sb = new StringBuilder();
82 82
         boolean inMsg = false;
83 83
         while (reader != null) {
84 84
             String s = reader.readLine();
294  jpos/src/main/java/org/jpos/iso/channel/TelnetXMLChannel.java
@@ -16,150 +16,150 @@
16 16
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 17
  */
18 18
 
19  
-package org.jpos.iso.channel;
20  
-
21  
-import org.jpos.iso.*;
22  
-import org.jpos.iso.packager.XMLPackager;
23  
-
24  
-import java.io.BufferedReader;
25  
-import java.io.EOFException;
26  
-import java.io.IOException;
27  
-import java.io.InputStreamReader;
28  
-import java.net.ServerSocket;
29  
-import java.net.Socket;
30  
-
31  
-/**
32  
- * Implements an ISOChannel able to exchange <b>jPOS generated</b> (or
33  
- * compliant) XML based ISO-8583 messages through a Telnet session the telnet
34  
- * commands are simply ignored.
35  
- * 
36  
- * @author <a href="mailto:apr@cs.com.uy">Alejandro P. Revilla</a>
37  
- * @author <a href="mailto:marksalter@talktalk.net">Mark Salter</a>
38  
- * @version $Id: TelnetXMLChannel.java 2594 2008-01-22 16:41:31Z apr $
39  
- * 
40  
- * @see ISOMsg
41  
- * @see ISOException
42  
- * @see ISOChannel
43  
- */
44  
-public class TelnetXMLChannel extends BaseChannel {
45  
-    BufferedReader reader = null;
46  
-
47  
-    static final String isomsgStartTag = "<" + XMLPackager.ISOMSG_TAG + ">";
48  
-    static final String isomsgEndTag = "</" + XMLPackager.ISOMSG_TAG + ">";
49  
-
50  
-    /**
51  
-     * Public constructor (used by Class.forName("...").newInstance())
52  
-     */
53  
-    public TelnetXMLChannel() {
54  
-        super();
55  
-    }
56  
-
57  
-    /**
58  
-     * Constructs client ISOChannel
59  
-     * 
60  
-     * @param host
61  
-     *            server TCP Address
62  
-     * @param port
63  
-     *            server port number
64  
-     * @param p
65  
-     *            an ISOPackager
66  
-     * @see ISOPackager
67  
-     */
68  
-    public TelnetXMLChannel(String host, int port, ISOPackager p) {
69  
-        super(host, port, p);
70  
-    }
71  
-
72  
-    /**
73  
-     * Construct server ISOChannel
74  
-     * 
75  
-     * @param p
76  
-     *            an ISOPackager
77  
-     * @see ISOPackager
78  
-     * @exception IOException
79  
-     */
80  
-    public TelnetXMLChannel(ISOPackager p) throws IOException {
81  
-        super(p);
82  
-    }
83  
-
84  
-    /**
85  
-     * constructs a server ISOChannel associated with a Server Socket
86  
-     * 
87  
-     * @param p
88  
-     *            an ISOPackager
89  
-     * @param serverSocket
90  
-     *            where to accept a connection
91  
-     * @exception IOException
92  
-     * @see ISOPackager
93  
-     */
94  
-    public TelnetXMLChannel(ISOPackager p, ServerSocket serverSocket)
95  
-            throws IOException {
96  
-        super(p, serverSocket);
97  
-    }
98  
-
99  
-    /**
100  
-     * @return a byte array with the received message
101  
-     * @exception IOException
102  
-     */
103  
-    protected byte[] streamReceive() throws IOException {
104  
-        int sp = 0;
105  
-        StringBuffer sb = new StringBuffer();
106  
-        while (reader != null) {
107  
-            /*
108  
-             * Throw away any telnet commands - each is 3 bytes first being
109  
-             * x'FF'...
110  
-             */
111  
-            reader.mark(3); // Mark the current position in case there are no
112  
-                            // telnet commands (FFnnmm)
113  
-            while (reader.read() == 255) {
114  
-                reader.skip(2);
115  
-                reader.mark(3);
116  
-            }
117  
-            reader.reset(); // Return to the first byte that was *not* a telnet
118  
-                            // command (IAC).
119  
-
120  
-            // Now the commands are out of the way continue with the xml stream
121  
-            // until it closes with </isomsg>.
122  
-            String s = reader.readLine();
123  
-            if (s == null)
124  
-                throw new EOFException();
125  
-            int isomsgStart = s.indexOf(isomsgStartTag);
126  
-            if (isomsgStart >= 0) {
127  
-                sp++;
128  
-                sb.append(s, isomsgStart, s.length() - isomsgStart);
129  
-            } else {
130  
-                int isomsgEnd = s.indexOf(isomsgEndTag);
131  
-                if (isomsgEnd >= 0) {
132  
-                    sb.append(s,0,isomsgEnd + isomsgEndTag.length());
133  
-                    if (--sp <= 0)
134  
-                        break;
135  
-                } else {
136  
-                    if (sp > 0)
137  
-                        sb.append(s);
138  
-                }
139  
-            }
140  
-
141  
-        }
142  
-        return sb.toString().getBytes();
143  
-    }
144  
-
145  
-    protected int getHeaderLength() {
146  
-        // XML Channel does not support header
147  
-        return 0;
148  
-    }
149  
-
150  
-    protected void sendMessageHeader(ISOMsg m, int len) {
151  
-        // XML Channel does not support header
152  
-    }
153  
-
154  
-    protected void connect(Socket socket) throws IOException {
155  
-        super.connect(socket);
156  
-        reader = new BufferedReader(new InputStreamReader(serverIn));
157  
-    }
158  
-
159  
-    public void disconnect() throws IOException {
160  
-        super.disconnect();
161  
-        if (reader != null)
162  
-            reader.close();
163  
-        reader = null;
164  
-    }
165  
-}
  19
+package org.jpos.iso.channel;
  20
+
  21
+import org.jpos.iso.*;
  22
+import org.jpos.iso.packager.XMLPackager;
  23
+
  24
+import java.io.BufferedReader;
  25
+import java.io.EOFException;
  26
+import java.io.IOException;
  27
+import java.io.InputStreamReader;
  28
+import java.net.ServerSocket;
  29
+import java.net.Socket;
  30
+
  31
+/**
  32
+ * Implements an ISOChannel able to exchange <b>jPOS generated</b> (or
  33
+ * compliant) XML based ISO-8583 messages through a Telnet session the telnet
  34
+ * commands are simply ignored.
  35
+ * 
  36
+ * @author <a href="mailto:apr@cs.com.uy">Alejandro P. Revilla</a>
  37
+ * @author <a href="mailto:marksalter@talktalk.net">Mark Salter</a>
  38
+ * @version $Id: TelnetXMLChannel.java 2594 2008-01-22 16:41:31Z apr $
  39
+ * 
  40
+ * @see ISOMsg
  41
+ * @see ISOException
  42
+ * @see ISOChannel
  43
+ */
  44
+public class TelnetXMLChannel extends BaseChannel {
  45
+    BufferedReader reader = null;
  46
+
  47
+    static final String isomsgStartTag = "<" + XMLPackager.ISOMSG_TAG + ">";
  48
+    static final String isomsgEndTag = "</" + XMLPackager.ISOMSG_TAG + ">";
  49
+
  50
+    /**
  51
+     * Public constructor (used by Class.forName("...").newInstance())
  52
+     */
  53
+    public TelnetXMLChannel() {
  54
+        super();
  55
+    }
  56
+
  57
+    /**
  58
+     * Constructs client ISOChannel
  59
+     * 
  60
+     * @param host
  61
+     *            server TCP Address
  62
+     * @param port
  63
+     *            server port number
  64
+     * @param p
  65
+     *            an ISOPackager
  66
+     * @see ISOPackager
  67
+     */
  68
+    public TelnetXMLChannel(String host, int port, ISOPackager p) {
  69
+        super(host, port, p);
  70
+    }
  71
+
  72
+    /**
  73
+     * Construct server ISOChannel
  74
+     * 
  75
+     * @param p
  76
+     *            an ISOPackager
  77
+     * @see ISOPackager
  78
+     * @exception IOException
  79
+     */
  80
+    public TelnetXMLChannel(ISOPackager p) throws IOException {
  81
+        super(p);
  82
+    }
  83
+
  84
+    /**
  85
+     * constructs a server ISOChannel associated with a Server Socket
  86
+     * 
  87
+     * @param p
  88
+     *            an ISOPackager
  89
+     * @param serverSocket
  90
+     *            where to accept a connection
  91
+     * @exception IOException
  92
+     * @see ISOPackager
  93
+     */
  94
+    public TelnetXMLChannel(ISOPackager p, ServerSocket serverSocket)
  95
+            throws IOException {
  96
+        super(p, serverSocket);
  97
+    }
  98
+
  99
+    /**
  100
+     * @return a byte array with the received message
  101
+     * @exception IOException
  102
+     */
  103
+    protected byte[] streamReceive() throws IOException {
  104
+        int sp = 0;
  105
+        StringBuilder sb = new StringBuilder();
  106
+        while (reader != null) {
  107
+            /*
  108
+             * Throw away any telnet commands - each is 3 bytes first being
  109
+             * x'FF'...
  110
+             */
  111
+            reader.mark(3); // Mark the current position in case there are no
  112
+                            // telnet commands (FFnnmm)
  113
+            while (reader.read() == 255) {
  114
+                reader.skip(2);
  115
+                reader.mark(3);
  116
+            }
  117
+            reader.reset(); // Return to the first byte that was *not* a telnet
  118
+                            // command (IAC).
  119
+
  120
+            // Now the commands are out of the way continue with the xml stream
  121
+            // until it closes with </isomsg>.
  122
+            String s = reader.readLine();
  123
+            if (s == null)
  124
+                throw new EOFException();
  125
+            int isomsgStart = s.indexOf(isomsgStartTag);
  126
+            if (isomsgStart >= 0) {
  127
+                sp++;
  128
+                sb.append(s, isomsgStart, s.length() - isomsgStart);
  129
+            } else {
  130
+                int isomsgEnd = s.indexOf(isomsgEndTag);
  131
+                if (isomsgEnd >= 0) {
  132
+                    sb.append(s,0,isomsgEnd + isomsgEndTag.length());
  133
+                    if (--sp <= 0)
  134
+                        break;
  135
+                } else {
  136
+                    if (sp > 0)
  137
+                        sb.append(s);
  138
+                }
  139
+            }
  140
+
  141
+        }
  142
+        return sb.toString().getBytes();
  143
+    }
  144
+
  145
+    protected int getHeaderLength() {
  146
+        // XML Channel does not support header
  147
+        return 0;
  148
+    }
  149
+
  150
+    protected void sendMessageHeader(ISOMsg m, int len) {
  151
+        // XML Channel does not support header
  152
+    }
  153
+
  154
+    protected void connect(Socket socket) throws IOException {
  155
+        super.connect(socket);
  156
+        reader = new BufferedReader(new InputStreamReader(serverIn));
  157
+    }
  158
+
  159
+    public void disconnect() throws IOException {
  160
+        super.disconnect();
  161
+        if (reader != null)
  162
+            reader.close();
  163
+        reader = null;
  164
+    }
  165
+}
2  jpos/src/main/java/org/jpos/iso/channel/XMLChannel.java
@@ -83,7 +83,7 @@ public XMLChannel (ISOPackager p, ServerSocket serverSocket)
83 83
      */
84 84
     protected byte[] streamReceive() throws IOException {
85 85
         int sp = 0;
86  
-        StringBuffer sb = new StringBuffer();
  86
+        StringBuilder sb = new StringBuilder();
87 87
         while (reader != null) {
88 88
             String s = reader.readLine();
89 89
             if (s == null)
4  jpos/src/main/java/org/jpos/iso/packager/Base1Packager.java
@@ -169,7 +169,7 @@
169 169
 /*128*/ new IFB_BINARY  (  8, "MAC 2")
170 170
     };
171 171
 
172  
-    protected class F126Packager extends Base1SubFieldPackager
  172
+    protected static class F126Packager extends Base1SubFieldPackager
173 173
     {
174 174
         protected ISOFieldPackager fld126[] =
175 175
         {
@@ -193,7 +193,7 @@ protected F126Packager ()
193 193
         }
194 194
     }
195 195
 
196  
-    protected class F127Packager extends ISOBasePackager 
  196
+    protected static class F127Packager extends ISOBasePackager 
197 197
     {
198 198
         protected ISOFieldPackager fld127[] = 
199 199
         {
4  jpos/src/main/java/org/jpos/iso/packager/Base1SubFieldPackager.java
@@ -131,7 +131,7 @@ public int unpack (ISOComponent m, byte[] b) throws ISOException
131 131
             if (emitBitMap()) 
132 132
             {
133 133
                 // BITMAP (-1 in HashTable)
134  
-                c = (ISOComponent) fields.get (new Integer(-1));
  134
+                c = (ISOComponent) fields.get (Integer.valueOf(-1));
135 135
                 byte[] b = getBitMapfieldPackager().pack(c);
136 136
                 len += b.length;
137 137
                 l.add(b);
@@ -139,7 +139,7 @@ public int unpack (ISOComponent m, byte[] b) throws ISOException
139 139
 
140 140
             for (int i=getFirstField(); i<=m.getMaxField(); i++) 
141 141
             {
142  
-                if ((c = (ISOComponent) fields.get (new Integer(i))) != null)
  142
+                if ((c = (ISOComponent) fields.get (Integer.valueOf(i))) != null)
143 143
                 {
144 144
                     try 
145 145
                     {
6  jpos/src/main/java/org/jpos/iso/packager/CTCSubElementPackager.java
@@ -47,9 +47,9 @@ public CTCSubElementPackager() {
47 47
     public byte[] pack ( ISOComponent c ) throws ISOException {
48 48
         try     {
49 49
             Map tab = c.getChildren();
50  
-            StringBuffer sb = new StringBuffer();
  50
+            StringBuilder sb = new StringBuilder();
51 51
             for ( int i = 0; i < fld.length; i++ ) {
52  
-                ISOMsg f = (ISOMsg) tab.get (new Integer(i));
  52
+                ISOMsg f = (ISOMsg) tab.get (Integer.valueOf(i));
53 53
                 if ( f != null ) {
54 54
                     sb.append ( ISOUtil.zeropad( ((Integer)f.getKey()).toString(), 2 ) + new String( fld[i].pack( f ) ) );
55 55
                 }
@@ -98,7 +98,7 @@ public ISOComponent validate( ISOComponent c ) throws org.jpos.iso.ISOException
98 98
         try {
99 99
             Map tab = c.getChildren();
100 100
             for ( int i = 0; i < fldVld.length; i++ ) {
101  
-                ISOMsg f = (ISOMsg) tab.get (new Integer(i));
  101
+                ISOMsg f = (ISOMsg) tab.get (Integer.valueOf(i));
102 102
                 if ( f != null )
103 103
                     c.set( (ISOMsg)fldVld[i].validate( f ) );
104 104
             }
6  jpos/src/main/java/org/jpos/iso/packager/CTCSubFieldPackager.java
@@ -46,9 +46,9 @@ public CTCSubFieldPackager() {
46 46
     public byte[] pack ( ISOComponent c ) throws ISOException {
47 47
         try     {
48 48
             Map tab = c.getChildren();
49  
-            StringBuffer sb = new StringBuffer();
  49
+            StringBuilder sb = new StringBuilder();
50 50
             for ( int i = 0; i < fld.length; i++ ) {
51  
-                ISOField f = (ISOField) tab.get (new Integer(i));
  51
+                ISOField f = (ISOField) tab.get (Integer.valueOf(i));
52 52
                 if ( f != null ) {
53 53
                     sb.append ( new String( fld[i].pack( f ) ) );
54 54
                 }
@@ -94,7 +94,7 @@ public ISOComponent validate( ISOComponent c ) throws org.jpos.iso.ISOException
94 94
         try {
95 95
             Map tab = c.getChildren();
96 96
             for ( int i = 0; i < fldVld.length; i++ ) {
97  
-                ISOField f = (ISOField) tab.get (new Integer(i));
  97
+                ISOField f = (ISOField) tab.get (Integer.valueOf(i));
98 98
                 if ( f != null )
99 99
                     c.set( fldVld[i].validate( f ) );
100 100
             }
2  jpos/src/main/java/org/jpos/iso/packager/EuroPackager.java
@@ -177,7 +177,7 @@ public void setLogger (Logger logger, String realm) {
177 177
         f48Packager.setLogger (logger, realm + ".field-48");
178 178
     }
179 179
 
180  
-    protected class Euro48Packager extends EuroSubFieldPackager
  180
+    protected static class Euro48Packager extends EuroSubFieldPackager
181 181
     { 
182 182
         // EuroPay refers to the message subfields as 
183 183
         // Private Data Subelements (PDS)
2  jpos/src/main/java/org/jpos/iso/packager/GenericPackager.java
@@ -288,7 +288,7 @@ protected void setGenericPackagerParams (Attributes atts)
288 288
         	setHeaderLength(Integer.parseInt(headerLenStr));
289 289
     }
290 290
 
291  
-    public class GenericEntityResolver implements EntityResolver
  291
+    public static class GenericEntityResolver implements EntityResolver
292 292
     {
293 293
         /**
294 294
          * Allow the application to resolve external entities.
14  jpos/src/main/java/org/jpos/iso/packager/GenericValidatingPackager.java
@@ -141,7 +141,7 @@ public ISOComponent validate(ISOComponent m) throws ISOException {
141 141
             Map<Object,ISOComponent> fields = m.getChildren();
142 142
             /** Field  validations **/
143 143
             for (ISOValidator val :fvlds) {
144  
-                if ( (c=fields.get (new Integer ( ((ISOFieldValidator)val).getFieldId() ))) != null ){
  144
+                if ( (c=fields.get (Integer.valueOf( ((ISOFieldValidator)val).getFieldId() ))) != null ){
145 145
                     try {
146 146
                         m.set( val.validate( c ) );
147 147
                     } catch ( ISOVException e ) {
@@ -182,7 +182,7 @@ public ISOComponent validate(ISOComponent m) throws ISOException {
182 182
     /** incr used to put validators in the same hashtable of
183 183
      *  fieldpackagers. packagers will stay on index 1, 2, 3...
184 184
      *  and validators in inc+1, inc+2, inc+3,... **/
185  
-    final int inc = 500;
  185
+    static final int inc = 500;
186 186
 
187 187
 
188 188
     public class GenericValidatorContentHandler extends DefaultHandler {
@@ -208,7 +208,7 @@ public void startElement( String namespaceURI, String localName, String qName, A
208 208
 
209 209
                     /** used to insert msg-level validators **/
210 210
                     Map m = new TreeMap();
211  
-                    m.put( new Integer( VALIDATOR_INDEX ), new ArrayList() );
  211
+                    m.put( Integer.valueOf( VALIDATOR_INDEX ), new ArrayList() );
212 212
 
213 213
                     validatorStack.push( m );
214 214
                     setGenericPackagerParams ( atts );
@@ -295,7 +295,7 @@ public void startElement( String namespaceURI, String localName, String qName, A
295 295
                     v = (ISOBaseValidatingPackager) Class.forName(validator).newInstance();
296 296
                     validatorStack.push( v );
297 297
                     Map m = new TreeMap();
298  
-                    m.put( new Integer( VALIDATOR_INDEX ), new ArrayList() );
  298
+                    m.put( Integer.valueOf( VALIDATOR_INDEX ), new ArrayList() );
299 299
                     validatorStack.push( m );
300 300
                     fieldStack.push( new TreeMap() );
301 301
                 }
@@ -366,7 +366,7 @@ public void endElement(String namespaceURI, String localName, String qName) {
366 366
                     }
367 367
                 }
368 368
                 /** add validator to the has **/
369  
-                ((List)((Map)validatorStack.peek()).get( new Integer(VALIDATOR_INDEX) )).add( v );
  369
+                ((List)((Map)validatorStack.peek()).get( Integer.valueOf(VALIDATOR_INDEX) )).add( v );
370 370
             }
371 371
             if (localName.equals("isofieldpackager")){
372 372
                 // Pop the 4 entries off the stack in the correct order
@@ -408,7 +408,7 @@ public void endElement(String namespaceURI, String localName, String qName) {
408 408
 
409 409
         ISOBaseValidator[] makeMsgValidatorArray ( Map m ){
410 410
             // First find the count
411  
-            List<ISOBaseValidator> l = (List)m.get( new Integer( VALIDATOR_INDEX ) );
  411
+            List<ISOBaseValidator> l = (List)m.get( Integer.valueOf( VALIDATOR_INDEX ) );
412 412
             return l.toArray(new ISOBaseValidator[l.size()]);
413 413
         }
414 414
 
@@ -425,7 +425,7 @@ public void fatalError (SAXParseException ex) throws SAXException
425 425
             throw ex;
426 426
         }
427 427
 
428  
-        final int VALIDATOR_INDEX = -3 ;
  428
+        static final int VALIDATOR_INDEX = -3 ;
429 429
         private Stack<Object> fieldStack, validatorStack;
430 430
         private String fldID;
431 431
 
2  jpos/src/main/java/org/jpos/iso/packager/ISOBaseValidatingPackager.java
@@ -49,7 +49,7 @@ public ISOComponent validate(ISOComponent m) throws ISOException {
49 49
             Map fields = m.getChildren();
50 50
             /** Field  validations **/
51 51
             for (int i=0; i<fldVld.length; i++) {
52  
-                if ( fldVld[i] != null && (c=(ISOComponent) fields.get (new Integer ( ((ISOFieldValidator)fldVld[i]).getFieldId() ))) != null ){
  52
+                if ( fldVld[i] != null && (c=(ISOComponent) fields.get (Integer.valueOf( ((ISOFieldValidator)fldVld[i]).getFieldId() ))) != null ){
53 53
                     try {
54 54
                         m.set( fldVld[i].validate( c ) );
55 55
                     } catch ( ISOVException e ) {
2  jpos/src/main/java/org/jpos/iso/packager/PostPackager.java
@@ -203,7 +203,7 @@
203 203
             ),
204 204
             new IFA_LLLCHAR (999, "MAC 2")
205 205
         };
206  
-        protected class PostPrivatePackager extends ISOBasePackager
  206
+        protected static class PostPrivatePackager extends ISOBasePackager
207 207
         { 
208 208
                 protected ISOFieldPackager fld127[] = 
209 209
                 {
2  jpos/src/main/java/org/jpos/iso/packager/VAPVIPPackager.java
@@ -169,7 +169,7 @@
169 169
             new IFB_BINARY  (  8, "MAC 2")
170 170
         };
171 171
 
172  
-    protected class F127Packager extends ISOBasePackager {
  172
+    protected static class F127Packager extends ISOBasePackager {
173 173
         protected ISOFieldPackager fld127[] = {
174 174
             new IFE_CHAR    (1,   "FILE UPDATE COD"),
175 175
             new IFB_LLHNUM  (19,  "ACCOUNT NUMBER", true),
2  jpos/src/main/java/org/jpos/iso/packager/VISA1Packager.java
@@ -136,7 +136,7 @@ else if (m.hasField(fld)) {
136 136
     }
137 137
 
138 138
     public String guessAutNumber (String s) {
139  
-        StringBuffer buf = new StringBuffer();
  139
+        StringBuilder buf = new StringBuilder();
140 140
         for (int i=0; i<s.length(); i++)
141 141
             if (Character.isDigit(s.charAt(i))) 
142 142
                 buf.append (s.charAt(i));
2  jpos/src/main/java/org/jpos/iso/validator/MSGTEST.java
@@ -43,7 +43,7 @@ public MSGTEST( boolean breakOnError ) {
43 43
 
44 44
     private String makeStrFromArray( int[] validFields ){
45 45
         if ( validFields == null ) return null;
46  
-        StringBuffer result = new StringBuffer();
  46
+        StringBuilder result = new StringBuilder();
47 47
         for (int i = 0; i < validFields.length; i++){
48 48
             result.append( validFields[i] );
49 49
             result.append( ", " );
2  jpos/src/main/java/org/jpos/iso/validator/TEST0100.java
@@ -77,7 +77,7 @@ public ISOComponent validate(ISOComponent m) throws org.jpos.iso.ISOException {
77 77
 
78 78
     private String makeStrFromArray( int[] validFields ){
79 79
         if ( validFields == null ) return null;
80  
-        StringBuffer result = new StringBuffer();
  80
+        StringBuilder result = new StringBuilder();
81 81
         for (int i = 0; i < validFields.length; i++){
82 82
             result.append( validFields[i] );
83 83
             result.append( ", " );
4  jpos/src/main/java/org/jpos/iso/validator/VErrorParser.java
@@ -127,8 +127,8 @@ else if ( c instanceof ISOMsg ){
127 127
             Map fields = c.getChildren();
128 128
             int max = ((ISOMsg)c).getMaxField();
129 129
             for (int i = 0; i <= max ; i++)
130  
-                if ((c=(ISOComponent) fields.get (new Integer (i))) != null )
131  
-                    _getErr( c, list, id +  String.valueOf( ( new Integer (i)).intValue() ) + " " );
  130
+                if ((c=(ISOComponent) fields.get (Integer.valueOf(i))) != null )
  131
+                    _getErr( c, list, id +  Integer.toString(i) + " " );
132 132
         }
133 133
     }
134 134
 
2  jpos/src/main/java/org/jpos/q2/QFactory.java
@@ -300,7 +300,7 @@ protected Collection getCollection(Class type, Element e)
300 300
      */
301 301
     public String getAttributeName(String name)
302 302
     {
303  
-        StringBuffer tmp = new StringBuffer(name);
  303
+        StringBuilder tmp = new StringBuilder(name);
304 304
         tmp.setCharAt(0,name.toUpperCase().charAt(0)) ;
305 305
         return tmp.toString();
306 306
     }
2  jpos/src/main/java/org/jpos/q2/cli/MEM.java
@@ -30,7 +30,7 @@ public void exec(CLIContext cli, String[] args) throws Exception
30 30
             System.gc();
31 31
         }
32 32
         Runtime r = Runtime.getRuntime();
33  
-        StringBuffer sb = new StringBuffer();
  33
+        StringBuilder sb = new StringBuilder();
34 34
         sb.append("total=");
35 35
         sb.append(r.totalMemory());
36 36
         sb.append(" free=");
2  jpos/src/main/java/org/jpos/q2/cli/TAIL.java
@@ -101,7 +101,7 @@ private void showLoggers(CLIContext cli)
101 101
         NameRegistrar nr = NameRegistrar.getInstance();
102 102
         int maxw = 0;
103 103
         Iterator iter = nr.getMap().entrySet().iterator();
104  
-        StringBuffer sb = new StringBuffer("available loggers:");
  104
+        StringBuilder sb = new StringBuilder("available loggers:");
105 105
         while (iter.hasNext())
106 106
         {
107 107
             Map.Entry entry = (Map.Entry) iter.next();
2  jpos/src/main/java/org/jpos/q2/cli/TMMON.java
@@ -92,7 +92,7 @@ private void showTMs(CLIContext cli)
92 92
         NameRegistrar nr = NameRegistrar.getInstance();
93 93
         int maxw = 0;
94 94
         Iterator iter = NameRegistrar.getMap().entrySet().iterator();
95  
-        StringBuffer sb = new StringBuffer("available transaction managers:");
  95
+        StringBuilder sb = new StringBuilder("available transaction managers:");
96 96
         while (iter.hasNext())
97 97
         {
98 98
             Map.Entry entry = (Map.Entry) iter.next();
10  jpos/src/main/java/org/jpos/q2/iso/QMUX.java
@@ -45,8 +45,8 @@
45 45
     extends QBeanSupport
46 46
     implements SpaceListener, MUX, QMUXMBean, Loggeable, ISOSource
47 47
 {
48  
-    final String nomap = "0123456789";
49  
-    final String DEFAULT_KEY = "41, 11";
  48
+    static final String nomap = "0123456789";
  49
+    static final String DEFAULT_KEY = "41, 11";
50 50
     private boolean headerIsKey;
51 51
     protected LocalSpace sp;
52 52
     protected String in, out, unhandled;
@@ -175,7 +175,7 @@ public void notify (Object k, Object value) {
175 175
     }
176 176
 
177 177
     public String getKey (ISOMsg m) throws ISOException {
178  
-        StringBuffer sb = new StringBuffer (out);
  178
+        StringBuilder sb = new StringBuilder (out);
179 179
         sb.append ('.');
180 180
         sb.append (mapMTI(m.getMTI()));
181 181
         if (headerIsKey && m.getHeader()!=null) {
@@ -206,7 +206,7 @@ public String getKey (ISOMsg m) throws ISOException {
206 206
         return sb.toString();
207 207
     }
208 208
     private String mapMTI (String mti) {
209  
-        StringBuffer sb = new StringBuffer();
  209
+        StringBuilder sb = new StringBuilder();
210 210
         if (mti != null && mti.length() == 4) {
211 211
             for (int i=0; i<mtiMapping.length; i++) {
212 212
                 int c = mti.charAt (i) - '0';
@@ -433,7 +433,7 @@ private void append (StringBuffer sb, String name, int value) {
433 433
         sb.append (name);
434 434
         sb.append (value);
435 435
     }
436  
-    public class AsyncRequest extends TimerTask {
  436
+    public static class AsyncRequest extends TimerTask {
437 437
         ISOResponseListener rl;
438 438
         Object handBack;
439 439
         public AsyncRequest (ISOResponseListener rl, Object handBack) {
6  jpos/src/main/java/org/jpos/q2/iso/QServer.java
@@ -169,7 +169,7 @@ public void destroyService () {
169 169
      */
170 170
     public synchronized void setPort (int port) {
171 171
         this.port = port;
172  
-        setAttr (getAttrs (), "port", new Integer (port));
  172
+        setAttr (getAttrs (), "port", Integer.valueOf(port));
173 173
         setModified (true);
174 174
     }
175 175
 
@@ -217,7 +217,7 @@ public String getChannel () {
217 217
      */
218 218
     public synchronized void setMaxSessions (int maxSessions) {
219 219
         this.maxSessions = maxSessions;
220  
-        setAttr (getAttrs (), "maxSessions", new Integer (maxSessions));
  220
+        setAttr (getAttrs (), "maxSessions", Integer.valueOf(maxSessions));
221 221
         setModified (true);
222 222
     }
223 223
     /**
@@ -231,7 +231,7 @@ public int getMaxSessions () {
231 231
      */
232 232
     public synchronized void setMinSessions (int minSessions) {
233 233
         this.minSessions = minSessions;
234  
-        setAttr (getAttrs (), "minSessions", new Integer (minSessions));
  234
+        setAttr (getAttrs (), "minSessions", Integer.valueOf(minSessions));
235 235
         setModified (true);
236 236
     }
237 237
     /**
24  jpos/src/main/java/org/jpos/security/CryptographicServiceMessage.java
@@ -116,15 +116,20 @@ public String getFieldContent(String tag) {
116 116
      * @return the CSM in string format
117 117
      */
118 118
     public String toString() {
119  
-        String csm="CSM(MCL/" + getMCL() + " ";
120  
-        Enumeration tags = orderedTags.elements();
121  
-        while (tags.hasMoreElements()) {
122  
-            String tag = (String) tags.nextElement();
123  
-            csm = csm + tag + "/" + getFieldContent(tag) + " ";
  119
+        StringBuilder csm = new StringBuilder();
  120
+        csm.append("CSM(MCL/");
  121
+        csm.append(getMCL());
  122
+        csm.append(" ");
  123
+        for (Object tagObject : orderedTags) {
  124
+            String tag = (String) tagObject;
  125
+            csm.append(tag);
  126
+            csm.append("/");
  127
+            csm.append(getFieldContent(tag));
  128
+            csm.append(" ");
124 129
         }
125 130
 
126  
-        csm = csm + ")";
127  
-        return csm;
  131
+        csm.append(")");
  132
+        return csm.toString();
128 133
     }
129 134
 
130 135
 
@@ -139,9 +144,8 @@ public void dump (PrintStream p, String indent) {
139 144
         p.print(indent + "<csm");
140 145
         p.print(" class=\"" + getMCL() + "\"");
141 146
         p.println(">");
142  
-        Enumeration tags = orderedTags.elements();
143  
-        while (tags.hasMoreElements()) {
144  
-            String tag = ((String) tags.nextElement());
  147
+        for (Object tagObject : orderedTags) {
  148
+            String tag = (String) tagObject;
145 149
             p.println(inner + "<field tag=\"" + tag + "\" value=\"" + getFieldContent(tag) + "\"/>");
146 150
         }
147 151
         p.println(indent + "</csm>");
2  jpos/src/main/java/org/jpos/security/SimpleKeyFile.java
@@ -134,7 +134,7 @@ public synchronized void setKey (String alias, SecureKey secureKey) throws Secur
134 134
             load();                 // load new changes (possibly made manually on the file)
135 135
             setProperty(alias, "class", secureKey.getClass().getName());
136 136
             setProperty(alias, "key", ISOUtil.hexString(secureKey.getKeyBytes()));
137  
-            setProperty(alias, "length", new Short(secureKey.getKeyLength()).toString());
  137
+            setProperty(alias, "length",  Short.toString(secureKey.getKeyLength()));
138 138
             setProperty(alias, "type", secureKey.getKeyType());
139 139
             String keyCheckValueHexString = ISOUtil.hexString(((SecureDESKey)secureKey).getKeyCheckValue());
140 140
             setProperty(alias, "checkvalue", keyCheckValueHexString);
2  jpos/src/main/java/org/jpos/space/JDBMSpace.java
@@ -485,7 +485,7 @@ public void gc () {
485 485
         }
486 486
     }
487 487
     public String getKeys () {
488  
-        StringBuffer sb = new StringBuffer();
  488
+        StringBuilder sb = new StringBuilder();
489 489
         try {
490 490
             FastIterator iter = htree.keys ();
491 491
             Object obj;
2  jpos/src/main/java/org/jpos/space/SpaceFactory.java
@@ -139,7 +139,7 @@ private static Space createSpace (String scheme, String name, String param)
139 139
         return sp;
140 140
     }
141 141
     private static String normalize (String scheme, String name, String param) {
142  
-        StringBuffer sb = new StringBuffer (scheme);
  142
+        StringBuilder sb = new StringBuilder (scheme);
143 143
         sb.append (':');
144 144
         sb.append (name);
145 145
         if (param != null) {
2  jpos/src/main/java/org/jpos/space/SpaceUtil.java
@@ -79,7 +79,7 @@ public static long nextLong (Space sp, Object key) {
79 79
             wipe (sp, key); // just in case
80 80
             if (obj instanceof Long) 
81 81
                 l = ((Long)obj).longValue();
82  
-            sp.out (key, new Long (++l));
  82
+            sp.out (key, Long.valueOf(++l));
83 83
         }
84 84
         return l;
85 85
     }
2  jpos/src/main/java/org/jpos/space/TSpace.java
@@ -189,7 +189,7 @@ public Set getKeySet() {
189 189
         return entries.keySet();
190 190
     }
191 191
     public String getKeysAsString () {
192  
-        StringBuffer sb = new StringBuffer();
  192
+        StringBuilder sb = new StringBuilder();
193 193
         Object[] keys;
194 194
         synchronized (this) {
195 195
             keys = entries.keySet().toArray();
4  jpos/src/main/java/org/jpos/transaction/TransactionManager.java
@@ -624,7 +624,7 @@ public int getOutstandingTransactions() {
624 624
         return -1;
625 625
     }
626 626
     protected String getKey (String prefix, long id) {
627  
-        StringBuffer sb = new StringBuffer (getName());
  627
+        StringBuilder sb = new StringBuilder (getName());
628 628
         sb.append ('.');
629 629
         sb.append (prefix);
630 630
         sb.append (Long.toString (id));
@@ -792,7 +792,7 @@ protected synchronized void checkRetryTask () {
792 792
             new Thread(retryTask).start();
793 793
         }
794 794
     }
795  
-    public class PausedMonitor extends TimerTask {
  795
+    public static class PausedMonitor extends TimerTask {
796 796
         Pausable context;
797 797
         public PausedMonitor (Pausable context) {
798 798
             super();
2  jpos/src/main/java/org/jpos/transaction/participant/BSHTransactionParticipant.java
@@ -155,7 +155,7 @@ protected Object executeMethod(BSHMethod m, long id, Serializable context, LogEv
155 155
     throws EvalError, FileNotFoundException, IOException {
156 156
         Map params = new HashMap();
157 157
         params.put("context", context);
158  
-        params.put("id", new Long(id));
  158
+        params.put("id", Long.valueOf(id));
159 159
         params.put("evt", evt);
160 160
         params.put("self", this);
161 161
         return m.execute(params, resultName);
2  jpos/src/main/java/org/jpos/ui/factory/HtmlFactory.java
@@ -54,7 +54,7 @@ public JComponent create (UI ui, Element e) {
54 54
             return new JLabel (ex.getMessage());
55 55
         }
56 56
     }
57  
-    class Listener implements HyperlinkListener {
  57
+    static class Listener implements HyperlinkListener {
58 58
         public void hyperlinkUpdate(HyperlinkEvent e) {
59 59
             if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
60 60
                 JEditorPane pane = (JEditorPane) e.getSource();
2  jpos/src/main/java/org/jpos/ui/factory/LogListenerFactory.java
@@ -68,7 +68,7 @@ public JComponent create (UI ui, Element e) {
68 68
         }
69 69
         return textArea;
70 70
     }
71  
-    public class Listener implements LogListener, Runnable {
  71
+    public static class Listener implements LogListener, Runnable {
72 72
         final LogProducer logger;
73 73
         JTextArea text;
74 74
         UI ui;
8  jpos/src/main/java/org/jpos/util/FSDMsg.java
@@ -161,7 +161,7 @@ public String getBaseSchema() {
161 161
      *  @param separator       char representing type
162 162
      */
163 163
     public void setSeparator(String separatorName, char separator) {
164  
-        separators.put(separatorName,new Character(separator));
  164
+        separators.put(separatorName, Character.valueOf(separator));
165 165
     }
166 166
     
167 167
     /*
@@ -314,7 +314,7 @@ private boolean isBinary(String type) {
314 314
     }
315 315
     
316 316
     public boolean isSeparator(byte b) {
317  
-        return separators.containsValue(new Character((char)b));
  317
+        return separators.containsValue( Character.valueOf((char)b));
318 318
     }
319 319
     
320 320
     private String getSeparatorType(String type) {
@@ -442,7 +442,7 @@ private String getId (Element e) {
442 442
     protected String read (InputStream is, int len, String type, String separator) 
443 443
         throws IOException 
444 444
     {
445  
-        StringBuffer sb = new StringBuffer();
  445
+        StringBuilder sb = new StringBuilder();
446 446
         byte[] b = new byte[1];
447 447
         boolean expectSeparator = isSeparated(separator);
448 448
         boolean separated = expectSeparator;
@@ -599,7 +599,7 @@ protected Element getSchema (String prefix, String suffix, String defSuffix)
599 599
                 }
600 600
             }
601 601
             if (schema == null){
602  
-                throw new RuntimeException(f.getCanonicalPath().toString() + " not found");
  602
+                throw new RuntimeException(f.getCanonicalPath() + " not found");
603 603
             }
604 604
             sp.out (uri, schema);
605 605
         }
2  jpos/src/main/java/org/jpos/util/NameRegistrar.java
@@ -116,7 +116,7 @@ public void dump(PrintStream p, String indent, boolean detail) {
116 116
                 key = "null";
117 117
             }
118 118
             String objectClassName = (obj == null) ? "<NULL>" : obj.getClass().getName();
119  
-            p.println(inner + key.toString() + ": " + objectClassName);
  119
+            p.println(inner + key + ": " + objectClassName);
120 120
             if (detail && obj instanceof Loggeable) {
121 121
                 ((Loggeable) obj).dump(p, inner + "  ");
122 122
             }
4  jpos/src/main/java/org/jpos/util/Profiler.java
@@ -96,7 +96,7 @@ public Entry getEntry(String eventName) {
96 96
          return (Entry)events.get(eventName);         
97 97
     }
98 98
 
99  
-    public class Entry  {
  99
+    public static class Entry  {
100 100
         String  eventName;
101 101
         long    duration;
102 102
         long    totalDuration;          
@@ -130,7 +130,7 @@ public long getTotalDurationInNanos () {
130 130
             return totalDuration;
131 131
         }
132 132
         public String toString()  {
133  
-            StringBuffer sb = new StringBuffer (eventName);
  133
+            StringBuilder sb = new StringBuilder (eventName);
134 134
             sb.append (" [");
135 135
             sb.append (getDuration());
136 136
             sb.append ('.');
28  jpos/src/test/java/org/jpos/bsh/BSHLogListenerTest.java
@@ -490,7 +490,7 @@ public void testReplaceThrowsNullPointerException9() throws Throwable {
490 490
 
491 491
     @Test
492 492
     public void testScriptInfoConstructor() throws Throwable {
493  
-        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener().new ScriptInfo("testScriptInfoCode", 100L);
  493
+        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener.ScriptInfo("testScriptInfoCode", 100L);
494 494
         assertEquals("scriptInfo.lastModified", 100L, scriptInfo.lastModified);
495 495
         assertEquals("scriptInfo.code", "testScriptInfoCode", scriptInfo.code);
496 496
     }
@@ -498,37 +498,37 @@ public void testScriptInfoConstructor() throws Throwable {
498 498
     @Test
499 499
     public void testScriptInfoConstructor1() throws Throwable {
500 500
         NameSpace ns = NameSpace.JAVACODE;
501  
-        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener().new ScriptInfo(ns);
  501
+        BSHLogListener.ScriptInfo scriptInfo =  new BSHLogListener.ScriptInfo(ns);
502 502
         assertSame("scriptInfo.nameSpace", ns, scriptInfo.nameSpace);
503 503
     }
504 504
 
505 505
     @Test
506 506
     public void testScriptInfoConstructor2() throws Throwable {
507  
-        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener().new ScriptInfo();
  507
+        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener.ScriptInfo();
508 508
         assertNull("scriptInfo.getCode()", scriptInfo.getCode());
509 509
     }
510 510
 
511 511
     @Test
512 512
     public void testScriptInfoGetCode() throws Throwable {
513  
-        String result = new BSHLogListener().new ScriptInfo("testScriptInfoCode", 100L).getCode();
  513
+        String result = new BSHLogListener.ScriptInfo("testScriptInfoCode", 100L).getCode();
514 514
         assertEquals("result", "testScriptInfoCode", result);
515 515
     }
516 516
 
517 517
     @Test
518 518
     public void testScriptInfoGetCode1() throws Throwable {
519  
-        String result = new BSHLogListener().new ScriptInfo().getCode();
  519
+        String result = new BSHLogListener.ScriptInfo().getCode();
520 520
         assertNull("result", result);
521 521
     }
522 522
 
523 523
     @Test
524 524
     public void testScriptInfoGetLastCheck() throws Throwable {
525  
-        long result = new BSHLogListener().new ScriptInfo("testScriptInfoCode", 100L).getLastCheck();
  525
+        long result = new BSHLogListener.ScriptInfo("testScriptInfoCode", 100L).getLastCheck();
526 526
         assertEquals("result", 0L, result);
527 527
     }
528 528
 
529 529
     @Test
530 530
     public void testScriptInfoGetLastCheck1() throws Throwable {
531  
-        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener().new ScriptInfo("testScriptInfoCode", 100L);
  531
+        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener.ScriptInfo("testScriptInfoCode", 100L);
532 532
         scriptInfo.setLastCheck(100L);
533 533
         long result = scriptInfo.getLastCheck();
534 534
         assertEquals("result", 100L, result);
@@ -536,13 +536,13 @@ public void testScriptInfoGetLastCheck1() throws Throwable {
536 536
 
537 537
     @Test
538 538
     public void testScriptInfoGetLastModified() throws Throwable {
539  
-        long result = new BSHLogListener().new ScriptInfo(NameSpace.JAVACODE).getLastModified();
  539
+        long result = new BSHLogListener.ScriptInfo(NameSpace.JAVACODE).getLastModified();
540 540
         assertEquals("result", 0L, result);
541 541
     }
542 542
 
543 543
     @Test
544 544
     public void testScriptInfoGetLastModified1() throws Throwable {
545  
-        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener().new ScriptInfo();
  545
+        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener.ScriptInfo();
546 546
         scriptInfo.setLastModified(100L);
547 547
         long result = scriptInfo.getLastModified();
548 548
         assertEquals("result", 100L, result);
@@ -551,27 +551,27 @@ public void testScriptInfoGetLastModified1() throws Throwable {
551 551
     @Test
552 552
     public void testScriptInfoGetNameSpace() throws Throwable {
553 553
         NameSpace ns = NameSpace.JAVACODE;
554  
-        NameSpace result = new BSHLogListener().new ScriptInfo(ns).getNameSpace();
  554
+        NameSpace result = new BSHLogListener.ScriptInfo(ns).getNameSpace();
555 555
         assertSame("result", ns, result);
556 556
     }
557 557
 
558 558
     @Test
559 559
     public void testScriptInfoSetCode() throws Throwable {
560  
-        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener().new ScriptInfo();
  560
+        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener.ScriptInfo();
561 561
         scriptInfo.setCode("testScriptInfoCode");
562 562
         assertEquals("scriptInfo.code", "testScriptInfoCode", scriptInfo.code);
563 563
     }
564 564
 
565 565
     @Test
566 566
     public void testScriptInfoSetLastCheck() throws Throwable {
567  
-        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener().new ScriptInfo("testScriptInfoCode", 100L);
  567
+        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener.ScriptInfo("testScriptInfoCode", 100L);
568 568
         scriptInfo.setLastCheck(100L);
569 569
         assertEquals("scriptInfo.lastCheck", 100L, scriptInfo.lastCheck);
570 570
     }
571 571
 
572 572
     @Test
573 573
     public void testScriptInfoSetLastModified() throws Throwable {
574  
-        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener().new ScriptInfo(NameSpace.JAVACODE);
  574
+        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener.ScriptInfo(NameSpace.JAVACODE);
575 575
         scriptInfo.setLastModified(100L);
576 576
         assertEquals("scriptInfo.lastModified", 100L, scriptInfo.lastModified);
577 577
     }
@@ -579,7 +579,7 @@ public void testScriptInfoSetLastModified() throws Throwable {
579 579
     @Test
580 580
     public void testScriptInfoSetNameSpace() throws Throwable {
581 581
         NameSpace ns = NameSpace.JAVACODE;
582  
-        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener().new ScriptInfo(ns);
  582
+        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener.ScriptInfo(ns);
583 583
         scriptInfo.getNameSpace();
584 584
         scriptInfo.setNameSpace(ns);
585 585
         assertSame("scriptInfo.nameSpace", ns, scriptInfo.nameSpace);
4  jpos/src/test/java/org/jpos/iso/packager/Base1PackagerTest.java
@@ -35,7 +35,7 @@ public void testConstructor() throws Throwable {
35 35
 
36 36
     @Test
37 37
     public void testF126PackagerConstructor() throws Throwable {
38  
-        Base1Packager.F126Packager f126Packager = new Base1Packager().new F126Packager();
  38
+        Base1Packager.F126Packager f126Packager = new Base1Packager.F126Packager();
39 39
         assertNull("f126Packager.getLogger()", f126Packager.getLogger());
40 40
         assertNull("f126Packager.getRealm()", f126Packager.getRealm());
41 41
         assertEquals("f126Packager.fld126.length", 11, f126Packager.fld126.length);
@@ -43,7 +43,7 @@ public void testF126PackagerConstructor() throws Throwable {
43 43
 
44 44
     @Test
45 45
     public void testF127PackagerConstructor() throws Throwable {
46  
-        Base1Packager.F127Packager f127Packager = new Base1Packager().new F127Packager();
  46
+        Base1Packager.F127Packager f127Packager = new Base1Packager.F127Packager();
47 47
         assertNull("f127Packager.getLogger()", f127Packager.getLogger());
48 48
         assertNull("f127Packager.getRealm()", f127Packager.getRealm());
49 49
         assertEquals("f127Packager.fld127.length", 6, f127Packager.fld127.length);
6  jpos/src/test/java/org/jpos/iso/packager/Base1SubFieldPackagerTest.java
@@ -53,7 +53,7 @@ public void testEmitBitMap() throws Throwable {
53 53
 
54 54
     @Test
55 55
     public void testEmitBitMapThrowsArrayIndexOutOfBoundsException() throws Throwable {
56  
-        Base1SubFieldPackager f126Packager = mock(Base1Packager.class).new F126Packager();
  56
+        Base1SubFieldPackager f126Packager = new Base1Packager.F126Packager();
57 57
         ISOFieldPackager[] fld = new ISOFieldPackager[0];
58 58
         f126Packager.setFieldPackager(fld);
59 59
 
@@ -68,7 +68,7 @@ public void testEmitBitMapThrowsArrayIndexOutOfBoundsException() throws Throwabl
68 68
 
69 69
     @Test
70 70
     public void testGetBitMapfieldPackager() throws Throwable {
71  
-        Base1SubFieldPackager f126Packager = new Base1Packager().new F126Packager();
  71
+        Base1SubFieldPackager f126Packager = new Base1Packager.F126Packager();
72 72
         Base1_BITMAP126 result = (Base1_BITMAP126) f126Packager.getBitMapfieldPackager();
73 73
         assertEquals("result.getMaxPackedLength()", 2, result.getMaxPackedLength());
74 74
     }
@@ -97,7 +97,7 @@ public void testGetFirstField() throws Throwable {
97 97
     @Test
98 98
     public void testGetFirstField1() throws Throwable {
99 99
         ISOFieldPackager[] fld = new ISOFieldPackager[1];
100  
-        Base1SubFieldPackager f126Packager = new Base1Packager().new F126Packager();
  100
+        Base1SubFieldPackager f126Packager = new Base1Packager.F126Packager();
101 101
         f126Packager.setFieldPackager(fld);
102 102
         int result = f126Packager.getFirstField();
103 103
         assertEquals("result", 0, result);
2  jpos/src/test/java/org/jpos/iso/packager/EuroPackagerTest.java
@@ -39,7 +39,7 @@ public void testConstructor() throws Throwable {
39 39
 
40 40
     @Test
41 41
     public void testEuro48PackagerConstructor() throws Throwable {
42  
-        EuroPackager.Euro48Packager euro48Packager = new EuroPackager().new Euro48Packager();
  42
+        EuroPackager.Euro48Packager euro48Packager = new EuroPackager.Euro48Packager();
43 43
         assertNull("euro48Packager.getLogger()", euro48Packager.getLogger());
44 44
         assertNull("euro48Packager.getRealm()", euro48Packager.getRealm());
45 45
     }
2  jpos/src/test/java/org/jpos/iso/packager/PostPackagerTest.java
@@ -39,7 +39,7 @@ public void testConstructor() throws Throwable {
39 39
 
40 40
     @Test
41 41
     public void testPostPrivatePackagerConstructor() throws Throwable {
42  
-        PostPackager.PostPrivatePackager postPrivatePackager = new PostPackager().new PostPrivatePackager();
  42
+        PostPackager.PostPrivatePackager postPrivatePackager = new PostPackager.PostPrivatePackager();
43 43
         assertNull("postPrivatePackager.getLogger()", postPrivatePackager.getLogger());
44 44
         assertEquals("postPrivatePackager.fld127.length", 26, postPrivatePackager.fld127.length);
45 45
         assertNull("postPrivatePackager.getRealm()", postPrivatePackager.getRealm());
2  jpos/src/test/java/org/jpos/q2/qbean/SystemMonitorTest.java
@@ -111,7 +111,7 @@ public void testDump() {
111 111
 			containsString("##--- name-registrar ---")));
112 112
     }
113 113
 
114  
-    class SystemMonitorExtendedForTesting extends SystemMonitor {