target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void testProtect20() throws Throwable { String result = ISOUtil.protect("\u6D1D^KI"); assertEquals("_^KI", result, "result"); } | public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.indexOf('^'... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... |
@Test public void testProtect21() throws Throwable { String result = ISOUtil.protect("=7G^=^"); assertEquals("=__^=^", result, "result"); } | public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.indexOf('^'... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... |
@Test public void testProtect3() throws Throwable { String result = ISOUtil.protect("^D==N^=r=\u0002^g)=="); assertEquals("^D==_^=_=_^g)==", result, "result"); } | public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.indexOf('^'... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... |
@Test public void testProtect4() throws Throwable { String result = ISOUtil.protect("="); assertEquals("=", result, "result"); } | public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.indexOf('^'... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... |
@Test public void testProtect5() throws Throwable { String result = ISOUtil.protect(""); assertEquals("", result, "result"); } | public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.indexOf('^'... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... |
@Test public void testProtect6() throws Throwable { String result = ISOUtil.protect("VqM_'"); assertEquals("_____", result, "result"); } | public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.indexOf('^'... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... |
@Test public void testProtect7() throws Throwable { String result = ISOUtil.protect("\\7.=^6C3"); assertEquals("\\7.=^6C3", result, "result"); } | public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.indexOf('^'... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... |
@Test public void testparseCommand_NoQuotes() throws IOException { String line = "arg1 arg2 arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)) .containsSequence("arg1", "arg2", "arg3"); } | public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find()) { if (regexMatcher.gr... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... |
@Test public void testProtect8() throws Throwable { String result = ISOUtil.protect("#<gF=uG!"); assertEquals("#<gF=___", result, "result"); } | public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.indexOf('^'... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... |
@Test public void testProtect9() throws Throwable { String result = ISOUtil.protect("^9a{=o;G"); assertEquals("^9a{=___", result, "result"); } | public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.indexOf('^'... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... |
@Test public void testProtectT2D1() throws Throwable { String result = ISOUtil.protect("#<gFDuG!"); assertEquals("#<gFD___", result, "result"); } | public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.indexOf('^'... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... |
@Test public void testProtectT2D2() throws Throwable { String result = ISOUtil.protect("9a{#<gFuG!53Do;G"); assertEquals("9a{#<g__G!53D___", result, "result"); } | public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.indexOf('^'... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... |
@Test public void testProtectT1D1() throws Throwable { String result = ISOUtil.protect("a{#<gFuG!53o;G609^FOO/BAR COM^67890o;G"); assertEquals("a{#<gF_______G609^FOO/BAR COM^________", result, "result"); } | public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.indexOf('^'... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... |
@Test public void testProtectT1D2() throws Throwable { String result = ISOUtil.protect("9a{#<gFuG!^FOO/BAR COM^67890o;G"); assertEquals("9a{#<gFuG!^FOO/BAR COM^________", result, "result"); } | public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.indexOf('^'... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... |
@Test public void testProtectT1D3() throws Throwable { String result = ISOUtil.protect("9a{D<gFuG!^FOO/BAR COM^67890o;G"); assertEquals("9a{D<gFuG!^FOO/BAR COM^________", result, "result"); } | public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.indexOf('^'... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... |
@Test public void testProtectThrowsNullPointerException() throws Throwable { assertThrows(NullPointerException.class, () -> { ISOUtil.protect(null); }); } | public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.indexOf('^'... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... | ISOUtil { public static String protect (String s, char mask) { StringBuilder sb = new StringBuilder(); int len = s.length(); int clear = len > 6 ? 6 : 0; int lastFourIndex = -1; if (clear > 0) { lastFourIndex = s.indexOf ('=') - 4; if (lastFourIndex < 0) lastFourIndex = s.indexOf ('^') - 4; if (lastFourIndex < 0 && s.i... |
@Test public void testSleep() throws Throwable { ISOUtil.sleep(100L); assertTrue(true, "Test completed without Exception"); } | public static void sleep (long millis) { try { Thread.sleep (millis); } catch (InterruptedException ignored) { } } | ISOUtil { public static void sleep (long millis) { try { Thread.sleep (millis); } catch (InterruptedException ignored) { } } } | ISOUtil { public static void sleep (long millis) { try { Thread.sleep (millis); } catch (InterruptedException ignored) { } } ISOUtil(); } | ISOUtil { public static void sleep (long millis) { try { Thread.sleep (millis); } catch (InterruptedException ignored) { } } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e... | ISOUtil { public static void sleep (long millis) { try { Thread.sleep (millis); } catch (InterruptedException ignored) { } } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e... |
@Test public void testSleepThrowsIllegalArgumentException() throws Throwable { try { ISOUtil.sleep(-30L); fail("Expected IllegalArgumentException to be thrown"); } catch (IllegalArgumentException ex) { assertEquals("timeout value is negative", ex.getMessage(), "ex.getMessage()"); } } | public static void sleep (long millis) { try { Thread.sleep (millis); } catch (InterruptedException ignored) { } } | ISOUtil { public static void sleep (long millis) { try { Thread.sleep (millis); } catch (InterruptedException ignored) { } } } | ISOUtil { public static void sleep (long millis) { try { Thread.sleep (millis); } catch (InterruptedException ignored) { } } ISOUtil(); } | ISOUtil { public static void sleep (long millis) { try { Thread.sleep (millis); } catch (InterruptedException ignored) { } } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e... | ISOUtil { public static void sleep (long millis) { try { Thread.sleep (millis); } catch (InterruptedException ignored) { } } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e... |
@Test public void testparseCommand_SimpleQuotesArmuredArgWithoutSpaceWithin() throws IOException { String line = "arg1 'arg2' arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)) .containsSequence("arg1", "arg2", "arg3"); } | public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find()) { if (regexMatcher.gr... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... |
@Test public void testStr2bcd() throws Throwable { byte[] result = ISOUtil.str2bcd(" ", true); assertEquals(1, result.length, "result.length"); assertEquals((byte) -16, result[0], "result[0]"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcd1() throws Throwable { byte[] result = ISOUtil.str2bcd("testISOUtils", true); assertEquals(6, result.length, "result.length"); assertEquals((byte) 117, result[0], "result[0]"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcd10() throws Throwable { byte[] result = ISOUtil.str2bcd("", true); assertEquals(0, result.length, "result.length"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcd11() throws Throwable { byte[] result = ISOUtil.str2bcd("", true, (byte) 0); assertEquals(0, result.length, "result.length"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcd12() throws Throwable { byte[] result = ISOUtil.str2bcd("testISOUtils1", true, (byte) 0); assertEquals(7, result.length, "result.length"); assertEquals((byte) 68, result[0], "result[0]"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcd13() throws Throwable { byte[] result = ISOUtil.str2bcd("testISOUtils", true, (byte) 0); assertEquals(6, result.length, "result.length"); assertEquals((byte) 117, result[0], "result[0]"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcd14() throws Throwable { byte[] result = ISOUtil.str2bcd(" ", true, (byte) 0); assertEquals(1, result.length, "result.length"); assertEquals((byte) -16, result[0], "result[0]"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcd15() throws Throwable { byte[] result = ISOUtil.str2bcd(" ", false, (byte) 0); assertEquals(1, result.length, "result.length"); assertEquals((byte) 0, result[0], "result[0]"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcd16() throws Throwable { byte[] result = ISOUtil.str2bcd("testISOUtils1", false, (byte) 0); assertEquals(7, result.length, "result.length"); assertEquals((byte) 117, result[0], "result[0]"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcd2() throws Throwable { byte[] d = new byte[0]; byte[] result = ISOUtil.str2bcd("", true, d, 100); assertSame(d, result, "result"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testparseCommand_SimpleQuotesArmuredArgWithSpacesWithin() throws IOException { String line = "arg1 'arg2 with spaces within' arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)).containsSequence("arg1", "arg2 with spaces within", "arg3"); } | public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find()) { if (regexMatcher.gr... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... |
@Test public void testStr2bcd3() throws Throwable { byte[] d = new byte[1]; byte[] result = ISOUtil.str2bcd("", true, d, 100); assertSame(d, result, "result"); assertEquals((byte) 0, d[0], "d[0]"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcd4() throws Throwable { byte[] d = new byte[2]; byte[] result = ISOUtil.str2bcd("3Ch", true, d, 0); assertEquals((byte) 3, d[0], "d[0]"); assertSame(d, result, "result"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcd5() throws Throwable { byte[] d = new byte[2]; byte[] result = ISOUtil.str2bcd(" ", false, d, 0); assertSame(d, result, "result"); assertEquals((byte) 0, d[0], "d[0]"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcd6() throws Throwable { byte[] d = new byte[69]; byte[] result = ISOUtil.str2bcd("testISOUtils1", false, d, 0); assertEquals((byte) 117, d[0], "d[0]"); assertSame(d, result, "result"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcd7() throws Throwable { byte[] d = new byte[2]; byte[] result = ISOUtil.str2bcd(" ", true, d, 0); assertEquals((byte) -16, d[0], "d[0]"); assertSame(d, result, "result"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcd8() throws Throwable { byte[] d = new byte[4]; byte[] result = ISOUtil.str2bcd("2C", true, d, 0); assertEquals((byte) 51, d[0], "d[0]"); assertSame(d, result, "result"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcd9() throws Throwable { byte[] result = ISOUtil.str2bcd(" ", false); assertEquals(1, result.length, "result.length"); assertEquals((byte) 0, result[0], "result[0]"); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcdThrowsArrayIndexOutOfBoundsException() throws Throwable { byte[] d = new byte[2]; try { ISOUtil.str2bcd("testISOUtils1", true, d, 0); fail("Expected ArrayIndexOutOfBoundsException to be thrown"); } catch (ArrayIndexOutOfBoundsException ex) { assertEquals((byte) 68, d[0], "d[0]"); } } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcdThrowsArrayIndexOutOfBoundsException1() throws Throwable { byte[] d = new byte[2]; try { ISOUtil.str2bcd("testISOUtils1", false, d, 0); fail("Expected ArrayIndexOutOfBoundsException to be thrown"); } catch (ArrayIndexOutOfBoundsException ex) { assertEquals((byte) 117, d[0], "d[0]"); } } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcdThrowsArrayIndexOutOfBoundsException2() throws Throwable { byte[] d = new byte[2]; try { ISOUtil.str2bcd("testISOUtils", true, d, 0); fail("Expected ArrayIndexOutOfBoundsException to be thrown"); } catch (ArrayIndexOutOfBoundsException ex) { assertEquals((byte) 117, d[0], "d[0]"); } } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testparseCommand_SimpleQuotesArmuredArgWithSpacesAndDoubleQuotesWithin() throws IOException { String line = "arg1 'arg2 with spaces and \"double quotes\" within' arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)).containsSequence("arg1", "arg2 with spaces an... | public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find()) { if (regexMatcher.gr... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... |
@Test public void testStr2bcdThrowsArrayIndexOutOfBoundsException4() throws Throwable { assertThrows(ArrayIndexOutOfBoundsException.class, () -> { byte[] d = new byte[2]; ISOUtil.str2bcd("testISOUtils1", false, d, 100); }); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcdThrowsNullPointerException() throws Throwable { assertThrows(NullPointerException.class, () -> { ISOUtil.str2bcd(null, true); }); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcdThrowsNullPointerException1() throws Throwable { assertThrows(NullPointerException.class, () -> { ISOUtil.str2bcd(null, true, (byte) 0); }); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcdThrowsNullPointerException2() throws Throwable { assertThrows(NullPointerException.class, () -> { ISOUtil.str2bcd("testISOUtils1", true, null, 100); }); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcdThrowsNullPointerException3() throws Throwable { assertThrows(NullPointerException.class, () -> { ISOUtil.str2bcd("testISOUtils", true, null, 100); }); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStr2bcdThrowsNullPointerException4() throws Throwable { assertThrows(NullPointerException.class, () -> { byte[] d = new byte[2]; ISOUtil.str2bcd(null, true, d, 100); }); } | public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); } | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... | ISOUtil { public static byte[] str2bcd(String s, boolean padLeft, byte[] d, int offset) { int len = s.length(); int start = (len & 1) == 1 && padLeft ? 1 : 0; for (int i=start; i < len+start; i++) d [offset + (i >> 1)] |= s.charAt(i-start)-'0' << ((i & 1) == 1 ? 0 : 4); return d; } ISOUtil(); static String ebcdicToAsci... |
@Test public void testStrpad() throws Throwable { String result = ISOUtil.strpad("testISOUtils", 0); assertEquals("testISOUtils", result, "result"); } | public static String strpad(String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append(' '); return d.toString(); } | ISOUtil { public static String strpad(String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append(' '); return d.toString(); } } | ISOUtil { public static String strpad(String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append(' '); return d.toString(); } ISOUtil(); } | ISOUtil { public static String strpad(String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append(' '); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); stat... | ISOUtil { public static String strpad(String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append(' '); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); stat... |
@Test public void testStrpad1() throws Throwable { String result = ISOUtil.strpad("testISOUtils", 100); assertEquals( "testISOUtils ", result, "result"); } | public static String strpad(String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append(' '); return d.toString(); } | ISOUtil { public static String strpad(String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append(' '); return d.toString(); } } | ISOUtil { public static String strpad(String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append(' '); return d.toString(); } ISOUtil(); } | ISOUtil { public static String strpad(String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append(' '); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); stat... | ISOUtil { public static String strpad(String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append(' '); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); stat... |
@Test public void testStrpadf() throws Throwable { String result = ISOUtil.strpadf("testISOUtils", 0); assertEquals("testISOUtils", result, "result"); } | public static String strpadf (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('F'); return d.toString(); } | ISOUtil { public static String strpadf (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('F'); return d.toString(); } } | ISOUtil { public static String strpadf (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('F'); return d.toString(); } ISOUtil(); } | ISOUtil { public static String strpadf (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('F'); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); st... | ISOUtil { public static String strpadf (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('F'); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); st... |
@Test public void testStrpadf1() throws Throwable { String result = ISOUtil.strpadf("", 100); assertEquals( "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", result, "result"); } | public static String strpadf (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('F'); return d.toString(); } | ISOUtil { public static String strpadf (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('F'); return d.toString(); } } | ISOUtil { public static String strpadf (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('F'); return d.toString(); } ISOUtil(); } | ISOUtil { public static String strpadf (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('F'); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); st... | ISOUtil { public static String strpadf (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('F'); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); st... |
@Test public void testparseCommand_DoubleQuotesArmuredArgWithoutSpacesWithin() throws IOException { String line = "arg1 \"arg2\" arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)) .containsSequence("arg1", "arg2", "arg3"); } | public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find()) { if (regexMatcher.gr... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... |
@Test public void testStrpadfThrowsNullPointerException() throws Throwable { assertThrows(NullPointerException.class, () -> { ISOUtil.strpadf(null, 100); }); } | public static String strpadf (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('F'); return d.toString(); } | ISOUtil { public static String strpadf (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('F'); return d.toString(); } } | ISOUtil { public static String strpadf (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('F'); return d.toString(); } ISOUtil(); } | ISOUtil { public static String strpadf (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('F'); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); st... | ISOUtil { public static String strpadf (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('F'); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); st... |
@Test public void testStrpadThrowsNullPointerException() throws Throwable { assertThrows(NullPointerException.class, () -> { ISOUtil.strpad(null, 100); }); } | public static String strpad(String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append(' '); return d.toString(); } | ISOUtil { public static String strpad(String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append(' '); return d.toString(); } } | ISOUtil { public static String strpad(String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append(' '); return d.toString(); } ISOUtil(); } | ISOUtil { public static String strpad(String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append(' '); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); stat... | ISOUtil { public static String strpad(String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append(' '); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); stat... |
@Test public void testToIntArray() throws Throwable { int[] result = ISOUtil.toIntArray("42"); assertEquals(1, result.length, "result.length"); assertEquals(42, result[0], "result[0]"); } | public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } | ISOUtil { public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } } | ISOUtil { public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } ISOUtil(); } | ISOUtil { public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(... | ISOUtil { public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(... |
@Test public void testToIntArray1() throws Throwable { int[] result = ISOUtil.toIntArray(""); assertEquals(0, result.length, "result.length"); } | public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } | ISOUtil { public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } } | ISOUtil { public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } ISOUtil(); } | ISOUtil { public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(... | ISOUtil { public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(... |
@Test public void testToIntArrayThrowsNullPointerException() throws Throwable { assertThrows(NullPointerException.class, () -> { ISOUtil.toIntArray(null); }); } | public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } | ISOUtil { public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } } | ISOUtil { public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } ISOUtil(); } | ISOUtil { public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(... | ISOUtil { public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(... |
@Test public void testToIntArrayThrowsNumberFormatException() throws Throwable { try { ISOUtil.toIntArray("testISOUtils"); fail("Expected NumberFormatException to be thrown"); } catch (NumberFormatException ex) { assertEquals("For input string: \"testISOUtils\"", ex.getMessage(), "ex.getMessage()"); } } | public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } | ISOUtil { public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } } | ISOUtil { public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } ISOUtil(); } | ISOUtil { public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(... | ISOUtil { public static int[] toIntArray(String s) { StringTokenizer st = new StringTokenizer (s); int[] array = new int [st.countTokens()]; for (int i=0; st.hasMoreTokens(); i++) array[i] = Integer.parseInt (st.nextToken()); return array; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(... |
@Test public void testTrim() throws Throwable { byte[] array = new byte[2]; byte[] result = ISOUtil.trim(array, 1); assertEquals(1, result.length, "result.length"); assertEquals((byte) 0, result[0], "result[0]"); } | public static String trim (String s) { return s != null ? s.trim() : null; } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] ... | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] ... |
@Test public void testTrim1() throws Throwable { byte[] array = new byte[2]; byte[] result = ISOUtil.trim(array, 0); assertEquals(0, result.length, "result.length"); } | public static String trim (String s) { return s != null ? s.trim() : null; } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] ... | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] ... |
@Test public void testTrim2() throws Throwable { String result = ISOUtil.trim("testISOUtils"); assertEquals("testISOUtils", result, "result"); } | public static String trim (String s) { return s != null ? s.trim() : null; } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] ... | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] ... |
@Test public void testTrimNullReturnsNull() throws Throwable { String result = ISOUtil.trim(null); assertNull(result, "result"); } | public static String trim (String s) { return s != null ? s.trim() : null; } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] ... | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] ... |
@Test public void testparseCommand_DoubleQuotesArmuredArgWithSpacesWithin() throws IOException { String line = "arg1 \"arg2 with spaces within\" arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)).containsSequence("arg1", "arg2 with spaces within", "arg3"); } | public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find()) { if (regexMatcher.gr... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... |
@Test public void testTrimf() throws Throwable { String result = ISOUtil.trimf(""); assertEquals("", result, "result"); } | public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); s... | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); s... |
@Test public void testTrimf1() throws Throwable { String result = ISOUtil.trimf("2C"); assertEquals("2C", result, "result"); } | public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); s... | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); s... |
@Test public void testTrimf2() throws Throwable { String result = ISOUtil.trimf("FF"); assertEquals("", result, "result"); } | public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); s... | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); s... |
@Test public void testTrimf3() throws Throwable { String result = ISOUtil.trimf("F"); assertEquals("", result, "result"); } | public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); s... | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); s... |
@Test public void testTrimf4() throws Throwable { String result = ISOUtil.trimf(" "); assertEquals("", result, "result"); } | public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); s... | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); s... |
@Test public void testTrimf5() throws Throwable { String result = ISOUtil.trimf(null); assertNull(result, "result"); } | public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); } | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); s... | ISOUtil { public static String trimf (String s) { if (s != null) { int l = s.length(); if (l > 0) { while (--l >= 0) { if (s.charAt (l) != 'F') break; } s = l == 0 ? "" : s.substring (0, l+1); } } return s; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); s... |
@Test public void testTrimThrowsArrayIndexOutOfBoundsException() throws Throwable { assertThrows(ArrayIndexOutOfBoundsException.class, () -> { byte[] array = new byte[2]; ISOUtil.trim(array, 100); }); } | public static String trim (String s) { return s != null ? s.trim() : null; } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] ... | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] ... |
@Test public void testTrimThrowsNegativeArraySizeException() throws Throwable { assertThrows(NegativeArraySizeException.class, () -> { byte[] array = new byte[3]; ISOUtil.trim(array, -1); }); } | public static String trim (String s) { return s != null ? s.trim() : null; } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] ... | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] ... |
@Test public void testTrimThrowsNullPointerException() throws Throwable { assertThrows(NullPointerException.class, () -> { ISOUtil.trim(null, 100); }); } | public static String trim (String s) { return s != null ? s.trim() : null; } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); } | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] ... | ISOUtil { public static String trim (String s) { return s != null ? s.trim() : null; } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] ... |
@Test public void testUnPadLeft() throws Throwable { String result = ISOUtil.unPadLeft("", ' '); assertEquals("", result, "result"); } | public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } | ISOUtil { public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } } | ISOUtil { public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } ISOUtil(); } | ISOUtil { public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAsc... | ISOUtil { public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAsc... |
@Test public void testparseCommand_DoubleQuotesArmuredArgWithSpacesAndSimplequotesWithin() throws IOException { String line = "arg1 \"arg2 with spaces and 'simple quotes' within\" arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)).containsSequence("arg1", "arg2 with spaces an... | public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find()) { if (regexMatcher.gr... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... |
@Test public void testUnPadLeft1() throws Throwable { String result = ISOUtil.unPadLeft("", '\u001F'); assertEquals("", result, "result"); } | public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } | ISOUtil { public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } } | ISOUtil { public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } ISOUtil(); } | ISOUtil { public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAsc... | ISOUtil { public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAsc... |
@Test public void testUnPadLeft3() throws Throwable { String result = ISOUtil.unPadLeft("testISOUtils", 't'); assertEquals("estISOUtils", result, "result"); } | public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } | ISOUtil { public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } } | ISOUtil { public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } ISOUtil(); } | ISOUtil { public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAsc... | ISOUtil { public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAsc... |
@Test public void testUnPadLeftThrowsNullPointerException() throws Throwable { assertThrows(NullPointerException.class, () -> { ISOUtil.unPadLeft(null, ' '); }); } | public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } | ISOUtil { public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } } | ISOUtil { public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } ISOUtil(); } | ISOUtil { public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAsc... | ISOUtil { public static String unPadLeft(String s, char c) { int fill = 0, end = s.length(); if (end == 0) return s; while ( fill < end && s.charAt(fill) == c) fill ++; return fill < end ? s.substring( fill, end ): s.substring( fill-1, end ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAsc... |
@Test public void testUnPadRight() throws Throwable { String result = ISOUtil.unPadRight("f", 'f'); assertEquals("f", result, "result"); } | public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, ... | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, ... |
@Test public void testUnPadRight1() throws Throwable { String result = ISOUtil.unPadRight("", ' '); assertEquals("", result, "result"); } | public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, ... | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, ... |
@Test public void testUnPadRight2() throws Throwable { String result = ISOUtil.unPadRight("", 'A'); assertEquals("", result, "result"); } | public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, ... | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, ... |
@Test public void testUnPadRight3() throws Throwable { String result = ISOUtil.unPadRight("f", ' '); assertEquals("f", result, "result"); } | public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, ... | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, ... |
@Test public void testUnPadRight4() throws Throwable { String result = ISOUtil.unPadRight(" &ON\\.!Wio=p^'@*xS'*ItLh|_g[,K2H|FkD]RPGQ", 'Q'); assertEquals(" &ON\\.!Wio=p^'@*xS'*ItLh|_g[,K2H|FkD]RPG", result, "result"); } | public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, ... | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, ... |
@Test public void testUnPadRightThrowsNullPointerException() throws Throwable { assertThrows(NullPointerException.class, () -> { ISOUtil.unPadRight(null, ' '); }); } | public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); } | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, ... | ISOUtil { public static String unPadRight(String s, char c) { int end = s.length(); if (end == 0) return s; while ( 0 < end && s.charAt(end-1) == c) end --; return 0 < end ? s.substring( 0, end ): s.substring( 0, 1 ); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, ... |
@Test public void testXor() throws Throwable { byte[] op2 = new byte[0]; byte[] result = ISOUtil.xor(ISOUtil.str2bcd("testISOUtils", true), op2); assertEquals(0, result.length, "result.length"); } | public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } } | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } ISOUtil(); } | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } ISOUtil(); static String ebcdicToAscii(by... | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } ISOUtil(); static String ebcdicToAscii(by... |
@Test public void testparseCommand_SimpleQuotesArmuredEmptyArg() throws IOException { String line = "arg1 '' arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)) .containsSequence("arg1", "", "arg3"); } | public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find()) { if (regexMatcher.gr... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... |
@Test public void testUnpackOneTag() { instance.unpack("02008ValueXyZ"); assertAll( () -> assertEquals(1, instance.size()), () -> assertEquals("02", instance.get("02").getTagId()), () -> assertEquals("ValueXyZ", instance.get("02").getValue()) ); } | public void unpack(CharSequence data) throws IllegalArgumentException { if (data == null) throw new IllegalArgumentException("TLV data are required to unpack"); CharBuffer buffer = CharBuffer.wrap(data); CharTag currentTag; while (buffer.hasRemaining()) { currentTag = getTLVMsg(buffer); put(currentTag.getTagId(), curre... | CharTagMap extends HashMap<String, CharTag> { public void unpack(CharSequence data) throws IllegalArgumentException { if (data == null) throw new IllegalArgumentException("TLV data are required to unpack"); CharBuffer buffer = CharBuffer.wrap(data); CharTag currentTag; while (buffer.hasRemaining()) { currentTag = getTL... | CharTagMap extends HashMap<String, CharTag> { public void unpack(CharSequence data) throws IllegalArgumentException { if (data == null) throw new IllegalArgumentException("TLV data are required to unpack"); CharBuffer buffer = CharBuffer.wrap(data); CharTag currentTag; while (buffer.hasRemaining()) { currentTag = getTL... | CharTagMap extends HashMap<String, CharTag> { public void unpack(CharSequence data) throws IllegalArgumentException { if (data == null) throw new IllegalArgumentException("TLV data are required to unpack"); CharBuffer buffer = CharBuffer.wrap(data); CharTag currentTag; while (buffer.hasRemaining()) { currentTag = getTL... | CharTagMap extends HashMap<String, CharTag> { public void unpack(CharSequence data) throws IllegalArgumentException { if (data == null) throw new IllegalArgumentException("TLV data are required to unpack"); CharBuffer buffer = CharBuffer.wrap(data); CharTag currentTag; while (buffer.hasRemaining()) { currentTag = getTL... |
@Test public void testXor1() throws Throwable { byte[] op2 = new byte[4]; byte[] op1 = new byte[0]; byte[] result = ISOUtil.xor(op1, op2); assertEquals(0, result.length, "result.length"); } | public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } } | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } ISOUtil(); } | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } ISOUtil(); static String ebcdicToAscii(by... | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } ISOUtil(); static String ebcdicToAscii(by... |
@Test public void testXor2() throws Throwable { byte[] op1 = new byte[3]; byte[] op2 = new byte[2]; byte[] result = ISOUtil.xor(op1, op2); assertEquals(2, result.length, "result.length"); assertEquals((byte) 0, result[0], "result[0]"); } | public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } } | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } ISOUtil(); } | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } ISOUtil(); static String ebcdicToAscii(by... | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } ISOUtil(); static String ebcdicToAscii(by... |
@Test public void testXor3() throws Throwable { byte[] op1 = new byte[3]; byte[] op2 = new byte[5]; byte[] result = ISOUtil.xor(op1, op2); assertEquals(3, result.length, "result.length"); assertEquals((byte) 0, result[0], "result[0]"); } | public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } } | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } ISOUtil(); } | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } ISOUtil(); static String ebcdicToAscii(by... | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } ISOUtil(); static String ebcdicToAscii(by... |
@Test public void testXorThrowsNullPointerException() throws Throwable { assertThrows(NullPointerException.class, () -> { byte[] op2 = new byte[0]; ISOUtil.xor(null, op2); }); } | public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } } | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } ISOUtil(); } | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } ISOUtil(); static String ebcdicToAscii(by... | ISOUtil { public static byte[] xor (byte[] op1, byte[] op2) { byte[] result; if (op2.length > op1.length) { result = new byte[op1.length]; } else { result = new byte[op2.length]; } for (int i = 0; i < result.length; i++) { result[i] = (byte)(op1[i] ^ op2[i]); } return result; } ISOUtil(); static String ebcdicToAscii(by... |
@Test public void testZeropad() throws Throwable { String result = ISOUtil.zeropad("testISOUtils", 100); assertEquals( "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000testISOUtils", result, "result"); } | public static String zeropad(String s, int len) throws ISOException { return padleft(s, len, '0'); } | ISOUtil { public static String zeropad(String s, int len) throws ISOException { return padleft(s, len, '0'); } } | ISOUtil { public static String zeropad(String s, int len) throws ISOException { return padleft(s, len, '0'); } ISOUtil(); } | ISOUtil { public static String zeropad(String s, int len) throws ISOException { return padleft(s, len, '0'); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, ... | ISOUtil { public static String zeropad(String s, int len) throws ISOException { return padleft(s, len, '0'); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, ... |
@Test public void testZeropadRight() throws Throwable { String result = ISOUtil.zeropadRight("testISOUtils", 0); assertEquals("testISOUtils", result, "result"); } | public static String zeropadRight (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('0'); return d.toString(); } | ISOUtil { public static String zeropadRight (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('0'); return d.toString(); } } | ISOUtil { public static String zeropadRight (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('0'); return d.toString(); } ISOUtil(); } | ISOUtil { public static String zeropadRight (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('0'); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e... | ISOUtil { public static String zeropadRight (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('0'); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e... |
@Test public void testZeropadRight1() throws Throwable { String result = ISOUtil.zeropadRight("", 100); assertEquals( "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", result, "result"); } | public static String zeropadRight (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('0'); return d.toString(); } | ISOUtil { public static String zeropadRight (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('0'); return d.toString(); } } | ISOUtil { public static String zeropadRight (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('0'); return d.toString(); } ISOUtil(); } | ISOUtil { public static String zeropadRight (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('0'); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e... | ISOUtil { public static String zeropadRight (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('0'); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e... |
@Test public void testZeropadRightThrowsNullPointerException() throws Throwable { assertThrows(NullPointerException.class, () -> { ISOUtil.zeropadRight(null, 100); }); } | public static String zeropadRight (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('0'); return d.toString(); } | ISOUtil { public static String zeropadRight (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('0'); return d.toString(); } } | ISOUtil { public static String zeropadRight (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('0'); return d.toString(); } ISOUtil(); } | ISOUtil { public static String zeropadRight (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('0'); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e... | ISOUtil { public static String zeropadRight (String s, int len) { StringBuilder d = new StringBuilder(s); while (d.length() < len) d.append('0'); return d.toString(); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e... |
@Test public void testZeropadThrowsISOException() throws Throwable { try { ISOUtil.zeropad("testISOUtils", 0); fail("Expected ISOException to be thrown"); } catch (ISOException ex) { assertEquals("invalid len 12/0", ex.getMessage(), "ex.getMessage()"); assertNull(ex.nested, "ex.nested"); } } | public static String zeropad(String s, int len) throws ISOException { return padleft(s, len, '0'); } | ISOUtil { public static String zeropad(String s, int len) throws ISOException { return padleft(s, len, '0'); } } | ISOUtil { public static String zeropad(String s, int len) throws ISOException { return padleft(s, len, '0'); } ISOUtil(); } | ISOUtil { public static String zeropad(String s, int len) throws ISOException { return padleft(s, len, '0'); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, ... | ISOUtil { public static String zeropad(String s, int len) throws ISOException { return padleft(s, len, '0'); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, ... |
@Test public void testZeropadThrowsNullPointerException() throws Throwable { assertThrows(NullPointerException.class, () -> { ISOUtil.zeropad(null, 100); }); } | public static String zeropad(String s, int len) throws ISOException { return padleft(s, len, '0'); } | ISOUtil { public static String zeropad(String s, int len) throws ISOException { return padleft(s, len, '0'); } } | ISOUtil { public static String zeropad(String s, int len) throws ISOException { return padleft(s, len, '0'); } ISOUtil(); } | ISOUtil { public static String zeropad(String s, int len) throws ISOException { return padleft(s, len, '0'); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, ... | ISOUtil { public static String zeropad(String s, int len) throws ISOException { return padleft(s, len, '0'); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, ... |
@Test public void testparseCommand_DoubleQuotesArmuredEmptyArg() throws IOException { String line = "arg1 \"\" arg3"; String[] args = cliCommandInterface.parseCommand(line); assertThat(Arrays.asList(args)) .containsSequence("arg1", "", "arg3"); } | public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find()) { if (regexMatcher.gr... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... | CLICommandInterface { public String[] parseCommand(String line) throws IOException { if (line == null) { return new String[0]; } List<String> matchList = new ArrayList<String>(); Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher regexMatcher = regex.matcher(line); while (regexMatcher.find())... |
@Test public void testZeroUnPad1() throws Throwable { String result = ISOUtil.zeroUnPad(""); assertEquals("", result, "result"); } | public static String zeroUnPad( String s ) { return unPadLeft(s, '0'); } | ISOUtil { public static String zeroUnPad( String s ) { return unPadLeft(s, '0'); } } | ISOUtil { public static String zeroUnPad( String s ) { return unPadLeft(s, '0'); } ISOUtil(); } | ISOUtil { public static String zeroUnPad( String s ) { return unPadLeft(s, '0'); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] asci... | ISOUtil { public static String zeroUnPad( String s ) { return unPadLeft(s, '0'); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] asci... |
@Test public void testZeroUnPadThrowsNullPointerException() throws Throwable { assertThrows(NullPointerException.class, () -> { ISOUtil.zeroUnPad(null); }); } | public static String zeroUnPad( String s ) { return unPadLeft(s, '0'); } | ISOUtil { public static String zeroUnPad( String s ) { return unPadLeft(s, '0'); } } | ISOUtil { public static String zeroUnPad( String s ) { return unPadLeft(s, '0'); } ISOUtil(); } | ISOUtil { public static String zeroUnPad( String s ) { return unPadLeft(s, '0'); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] asci... | ISOUtil { public static String zeroUnPad( String s ) { return unPadLeft(s, '0'); } ISOUtil(); static String ebcdicToAscii(byte[] e); static String ebcdicToAscii(byte[] e, int offset, int len); static byte[] ebcdicToAsciiBytes(byte[] e); static byte[] ebcdicToAsciiBytes(byte[] e, int offset, int len); static byte[] asci... |
@Test public void testFormatAmtConvRate() throws Exception { double rate = 3456.78; String expResult = "33456780"; String result = ISOUtil.formatAmountConversionRate(rate); assertEquals(expResult, result); } | public static String formatAmountConversionRate(double convRate) throws ISOException { if (convRate == 0) return null; BigDecimal cr = new BigDecimal(convRate); int x = 7 - cr.precision() + cr.scale(); String bds = cr.movePointRight(cr.scale()).toString(); if (x > 9) bds = ISOUtil.zeropad(bds, bds.length() + x - 9); St... | ISOUtil { public static String formatAmountConversionRate(double convRate) throws ISOException { if (convRate == 0) return null; BigDecimal cr = new BigDecimal(convRate); int x = 7 - cr.precision() + cr.scale(); String bds = cr.movePointRight(cr.scale()).toString(); if (x > 9) bds = ISOUtil.zeropad(bds, bds.length() + ... | ISOUtil { public static String formatAmountConversionRate(double convRate) throws ISOException { if (convRate == 0) return null; BigDecimal cr = new BigDecimal(convRate); int x = 7 - cr.precision() + cr.scale(); String bds = cr.movePointRight(cr.scale()).toString(); if (x > 9) bds = ISOUtil.zeropad(bds, bds.length() + ... | ISOUtil { public static String formatAmountConversionRate(double convRate) throws ISOException { if (convRate == 0) return null; BigDecimal cr = new BigDecimal(convRate); int x = 7 - cr.precision() + cr.scale(); String bds = cr.movePointRight(cr.scale()).toString(); if (x > 9) bds = ISOUtil.zeropad(bds, bds.length() + ... | ISOUtil { public static String formatAmountConversionRate(double convRate) throws ISOException { if (convRate == 0) return null; BigDecimal cr = new BigDecimal(convRate); int x = 7 - cr.precision() + cr.scale(); String bds = cr.movePointRight(cr.scale()).toString(); if (x > 9) bds = ISOUtil.zeropad(bds, bds.length() + ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.