rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
grow(result, sNil10, occurrences); }
grow(result, sNil10, occurrences); }
public static RubyString pack(List list, RubyString formatString) { IRuby runtime = formatString.getRuntime(); PtrList format = new PtrList(formatString.getValue()); StringBuffer result = new StringBuffer(); int listSize = list.size(); char type = format.nextChar(); int idx = 0; String lCurElemString; while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); if (Character.isWhitespace(type)) { // skip all spaces type = next; continue; } if (next == '!' || next == '_') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } next = format.nextChar(); } // Determine how many of type are needed (default: 1) boolean isStar = false; int occurrences = 1; if (next == '*') { if ("@Xxu".indexOf(type) != -1) { occurrences = 0; } else { occurrences = listSize; isStar = true; } next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); // an exception may occur here if an int can't hold this but ... occurrences = format.nextAsciiNumber(); next = format.nextChar(); } Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { idx = encode(runtime, occurrences, result, list, idx, converter); type = next; continue; } switch (type) { case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : case 'a' : case 'Z' : case 'B' : case 'b' : case 'H' : case 'h' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (isStar) { occurrences = lCurElemString.length(); } switch (type) { case 'a' : case 'A' : case 'Z' : if (lCurElemString.length() >= occurrences) { result.append(lCurElemString.toCharArray(), 0, occurrences); } else {//need padding //I'm fairly sure there is a library call to create a //string filled with a given char with a given length but I couldn't find it result.append(lCurElemString); occurrences -= lCurElemString.length(); grow(result, (type == 'a') ? sNil10 : sSp10, occurrences); } break; //I believe there is a bug in the b and B case we skip a char too easily case 'b' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { if ((lCurElemString.charAt(i++) & 1) != 0) {//if the low bit is set currentByte |= 128; //set the high bit of the result } if ((i & 7) == 0) { result.append((char) (currentByte & 0xff)); currentByte = 0; continue; } //if the index is not a multiple of 8, we are not on a byte boundary currentByte >>= 1; //shift the byte } if ((occurrences & 7) != 0) { //if the length is not a multiple of 8 currentByte >>= 7 - (occurrences & 7); //we need to pad the last byte result.append((char) (currentByte & 0xff)); } //do some padding, I don't understand the padding strategy result.setLength(result.length() + padLength); } break; case 'B' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { currentByte |= lCurElemString.charAt(i++) & 1; // we filled up current byte; append it and create next one if ((i & 7) == 0) { result.append((char) (currentByte & 0xff)); currentByte = 0; continue; } //if the index is not a multiple of 8, we are not on a byte boundary currentByte <<= 1; } if ((occurrences & 7) != 0) { //if the length is not a multiple of 8 currentByte <<= 7 - (occurrences & 7); //we need to pad the last byte result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; case 'h' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { char currentChar = lCurElemString.charAt(i++); if (Character.isJavaIdentifierStart(currentChar)) { //this test may be too lax but it is the same as in MRI currentByte |= (((currentChar & 15) + 9) & 15) << 4; } else { currentByte |= (currentChar & 15) << 4; } if ((i & 1) != 0) { currentByte >>= 4; } else { result.append((char) (currentByte & 0xff)); currentByte = 0; } } if ((occurrences & 1) != 0) { result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; case 'H' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { char currentChar = lCurElemString.charAt(i++); if (Character.isJavaIdentifierStart(currentChar)) { //this test may be too lax but it is the same as in MRI currentByte |= ((currentChar & 15) + 9) & 15; } else { currentByte |= currentChar & 15; } if ((i & 1) != 0) { currentByte <<= 4; } else { result.append((char) (currentByte & 0xff)); currentByte = 0; } } if ((occurrences & 1) != 0) { result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; } break; } case 'x' : grow(result, sNil10, occurrences); break; case 'X' : try { shrink(result, occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `pack': X outside of string"); } break; case '@' : occurrences -= result.length(); if (occurrences > 0) { grow(result, sNil10, occurrences); } occurrences = -occurrences; if (occurrences > 0) { shrink(result, occurrences); } break; case 'u' : case 'm' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); occurrences = occurrences <= 2 ? 45 : occurrences / 3 * 3; for (;;) { encodes(runtime, result, lCurElemString, occurrences, type); if (occurrences >= lCurElemString.length()) { break; } lCurElemString = lCurElemString.substring(occurrences); } } break; case 'M' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (occurrences <= 1) { occurrences = 72; } qpencode(result, lCurElemString, occurrences); } break; case 'U' : char[] c = new char[occurrences]; for (int cIndex = 0; occurrences-- > 0; cIndex++) { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); long l = from == runtime.getNil() ? 0 : RubyNumeric.num2long(from); c[cIndex] = (char) l; } try { byte[] bytes = new String(c).getBytes("UTF-8"); result.append(RubyString.bytesToString(bytes)); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert to UTF8"; } break; } type = next; } return runtime.newString(result.toString()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
shrink(result, occurrences); }
shrink(result, occurrences); }
public static RubyString pack(List list, RubyString formatString) { IRuby runtime = formatString.getRuntime(); PtrList format = new PtrList(formatString.getValue()); StringBuffer result = new StringBuffer(); int listSize = list.size(); char type = format.nextChar(); int idx = 0; String lCurElemString; while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); if (Character.isWhitespace(type)) { // skip all spaces type = next; continue; } if (next == '!' || next == '_') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } next = format.nextChar(); } // Determine how many of type are needed (default: 1) boolean isStar = false; int occurrences = 1; if (next == '*') { if ("@Xxu".indexOf(type) != -1) { occurrences = 0; } else { occurrences = listSize; isStar = true; } next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); // an exception may occur here if an int can't hold this but ... occurrences = format.nextAsciiNumber(); next = format.nextChar(); } Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { idx = encode(runtime, occurrences, result, list, idx, converter); type = next; continue; } switch (type) { case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : case 'a' : case 'Z' : case 'B' : case 'b' : case 'H' : case 'h' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (isStar) { occurrences = lCurElemString.length(); } switch (type) { case 'a' : case 'A' : case 'Z' : if (lCurElemString.length() >= occurrences) { result.append(lCurElemString.toCharArray(), 0, occurrences); } else {//need padding //I'm fairly sure there is a library call to create a //string filled with a given char with a given length but I couldn't find it result.append(lCurElemString); occurrences -= lCurElemString.length(); grow(result, (type == 'a') ? sNil10 : sSp10, occurrences); } break; //I believe there is a bug in the b and B case we skip a char too easily case 'b' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { if ((lCurElemString.charAt(i++) & 1) != 0) {//if the low bit is set currentByte |= 128; //set the high bit of the result } if ((i & 7) == 0) { result.append((char) (currentByte & 0xff)); currentByte = 0; continue; } //if the index is not a multiple of 8, we are not on a byte boundary currentByte >>= 1; //shift the byte } if ((occurrences & 7) != 0) { //if the length is not a multiple of 8 currentByte >>= 7 - (occurrences & 7); //we need to pad the last byte result.append((char) (currentByte & 0xff)); } //do some padding, I don't understand the padding strategy result.setLength(result.length() + padLength); } break; case 'B' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { currentByte |= lCurElemString.charAt(i++) & 1; // we filled up current byte; append it and create next one if ((i & 7) == 0) { result.append((char) (currentByte & 0xff)); currentByte = 0; continue; } //if the index is not a multiple of 8, we are not on a byte boundary currentByte <<= 1; } if ((occurrences & 7) != 0) { //if the length is not a multiple of 8 currentByte <<= 7 - (occurrences & 7); //we need to pad the last byte result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; case 'h' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { char currentChar = lCurElemString.charAt(i++); if (Character.isJavaIdentifierStart(currentChar)) { //this test may be too lax but it is the same as in MRI currentByte |= (((currentChar & 15) + 9) & 15) << 4; } else { currentByte |= (currentChar & 15) << 4; } if ((i & 1) != 0) { currentByte >>= 4; } else { result.append((char) (currentByte & 0xff)); currentByte = 0; } } if ((occurrences & 1) != 0) { result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; case 'H' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { char currentChar = lCurElemString.charAt(i++); if (Character.isJavaIdentifierStart(currentChar)) { //this test may be too lax but it is the same as in MRI currentByte |= ((currentChar & 15) + 9) & 15; } else { currentByte |= currentChar & 15; } if ((i & 1) != 0) { currentByte <<= 4; } else { result.append((char) (currentByte & 0xff)); currentByte = 0; } } if ((occurrences & 1) != 0) { result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; } break; } case 'x' : grow(result, sNil10, occurrences); break; case 'X' : try { shrink(result, occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `pack': X outside of string"); } break; case '@' : occurrences -= result.length(); if (occurrences > 0) { grow(result, sNil10, occurrences); } occurrences = -occurrences; if (occurrences > 0) { shrink(result, occurrences); } break; case 'u' : case 'm' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); occurrences = occurrences <= 2 ? 45 : occurrences / 3 * 3; for (;;) { encodes(runtime, result, lCurElemString, occurrences, type); if (occurrences >= lCurElemString.length()) { break; } lCurElemString = lCurElemString.substring(occurrences); } } break; case 'M' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (occurrences <= 1) { occurrences = 72; } qpencode(result, lCurElemString, occurrences); } break; case 'U' : char[] c = new char[occurrences]; for (int cIndex = 0; occurrences-- > 0; cIndex++) { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); long l = from == runtime.getNil() ? 0 : RubyNumeric.num2long(from); c[cIndex] = (char) l; } try { byte[] bytes = new String(c).getBytes("UTF-8"); result.append(RubyString.bytesToString(bytes)); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert to UTF8"; } break; } type = next; } return runtime.newString(result.toString()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
{ if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); }
{ if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); }
public static RubyString pack(List list, RubyString formatString) { IRuby runtime = formatString.getRuntime(); PtrList format = new PtrList(formatString.getValue()); StringBuffer result = new StringBuffer(); int listSize = list.size(); char type = format.nextChar(); int idx = 0; String lCurElemString; while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); if (Character.isWhitespace(type)) { // skip all spaces type = next; continue; } if (next == '!' || next == '_') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } next = format.nextChar(); } // Determine how many of type are needed (default: 1) boolean isStar = false; int occurrences = 1; if (next == '*') { if ("@Xxu".indexOf(type) != -1) { occurrences = 0; } else { occurrences = listSize; isStar = true; } next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); // an exception may occur here if an int can't hold this but ... occurrences = format.nextAsciiNumber(); next = format.nextChar(); } Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { idx = encode(runtime, occurrences, result, list, idx, converter); type = next; continue; } switch (type) { case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : case 'a' : case 'Z' : case 'B' : case 'b' : case 'H' : case 'h' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (isStar) { occurrences = lCurElemString.length(); } switch (type) { case 'a' : case 'A' : case 'Z' : if (lCurElemString.length() >= occurrences) { result.append(lCurElemString.toCharArray(), 0, occurrences); } else {//need padding //I'm fairly sure there is a library call to create a //string filled with a given char with a given length but I couldn't find it result.append(lCurElemString); occurrences -= lCurElemString.length(); grow(result, (type == 'a') ? sNil10 : sSp10, occurrences); } break; //I believe there is a bug in the b and B case we skip a char too easily case 'b' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { if ((lCurElemString.charAt(i++) & 1) != 0) {//if the low bit is set currentByte |= 128; //set the high bit of the result } if ((i & 7) == 0) { result.append((char) (currentByte & 0xff)); currentByte = 0; continue; } //if the index is not a multiple of 8, we are not on a byte boundary currentByte >>= 1; //shift the byte } if ((occurrences & 7) != 0) { //if the length is not a multiple of 8 currentByte >>= 7 - (occurrences & 7); //we need to pad the last byte result.append((char) (currentByte & 0xff)); } //do some padding, I don't understand the padding strategy result.setLength(result.length() + padLength); } break; case 'B' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { currentByte |= lCurElemString.charAt(i++) & 1; // we filled up current byte; append it and create next one if ((i & 7) == 0) { result.append((char) (currentByte & 0xff)); currentByte = 0; continue; } //if the index is not a multiple of 8, we are not on a byte boundary currentByte <<= 1; } if ((occurrences & 7) != 0) { //if the length is not a multiple of 8 currentByte <<= 7 - (occurrences & 7); //we need to pad the last byte result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; case 'h' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { char currentChar = lCurElemString.charAt(i++); if (Character.isJavaIdentifierStart(currentChar)) { //this test may be too lax but it is the same as in MRI currentByte |= (((currentChar & 15) + 9) & 15) << 4; } else { currentByte |= (currentChar & 15) << 4; } if ((i & 1) != 0) { currentByte >>= 4; } else { result.append((char) (currentByte & 0xff)); currentByte = 0; } } if ((occurrences & 1) != 0) { result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; case 'H' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { char currentChar = lCurElemString.charAt(i++); if (Character.isJavaIdentifierStart(currentChar)) { //this test may be too lax but it is the same as in MRI currentByte |= ((currentChar & 15) + 9) & 15; } else { currentByte |= currentChar & 15; } if ((i & 1) != 0) { currentByte <<= 4; } else { result.append((char) (currentByte & 0xff)); currentByte = 0; } } if ((occurrences & 1) != 0) { result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; } break; } case 'x' : grow(result, sNil10, occurrences); break; case 'X' : try { shrink(result, occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `pack': X outside of string"); } break; case '@' : occurrences -= result.length(); if (occurrences > 0) { grow(result, sNil10, occurrences); } occurrences = -occurrences; if (occurrences > 0) { shrink(result, occurrences); } break; case 'u' : case 'm' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); occurrences = occurrences <= 2 ? 45 : occurrences / 3 * 3; for (;;) { encodes(runtime, result, lCurElemString, occurrences, type); if (occurrences >= lCurElemString.length()) { break; } lCurElemString = lCurElemString.substring(occurrences); } } break; case 'M' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (occurrences <= 1) { occurrences = 72; } qpencode(result, lCurElemString, occurrences); } break; case 'U' : char[] c = new char[occurrences]; for (int cIndex = 0; occurrences-- > 0; cIndex++) { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); long l = from == runtime.getNil() ? 0 : RubyNumeric.num2long(from); c[cIndex] = (char) l; } try { byte[] bytes = new String(c).getBytes("UTF-8"); result.append(RubyString.bytesToString(bytes)); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert to UTF8"; } break; } type = next; } return runtime.newString(result.toString()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
encodes(runtime, result, lCurElemString, occurrences, type); if (occurrences >= lCurElemString.length()) { break; } lCurElemString = lCurElemString.substring(occurrences); } }
encodes(runtime, result, lCurElemString, occurrences, type); if (occurrences >= lCurElemString.length()) { break; } lCurElemString = lCurElemString.substring(occurrences); } }
public static RubyString pack(List list, RubyString formatString) { IRuby runtime = formatString.getRuntime(); PtrList format = new PtrList(formatString.getValue()); StringBuffer result = new StringBuffer(); int listSize = list.size(); char type = format.nextChar(); int idx = 0; String lCurElemString; while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); if (Character.isWhitespace(type)) { // skip all spaces type = next; continue; } if (next == '!' || next == '_') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } next = format.nextChar(); } // Determine how many of type are needed (default: 1) boolean isStar = false; int occurrences = 1; if (next == '*') { if ("@Xxu".indexOf(type) != -1) { occurrences = 0; } else { occurrences = listSize; isStar = true; } next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); // an exception may occur here if an int can't hold this but ... occurrences = format.nextAsciiNumber(); next = format.nextChar(); } Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { idx = encode(runtime, occurrences, result, list, idx, converter); type = next; continue; } switch (type) { case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : case 'a' : case 'Z' : case 'B' : case 'b' : case 'H' : case 'h' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (isStar) { occurrences = lCurElemString.length(); } switch (type) { case 'a' : case 'A' : case 'Z' : if (lCurElemString.length() >= occurrences) { result.append(lCurElemString.toCharArray(), 0, occurrences); } else {//need padding //I'm fairly sure there is a library call to create a //string filled with a given char with a given length but I couldn't find it result.append(lCurElemString); occurrences -= lCurElemString.length(); grow(result, (type == 'a') ? sNil10 : sSp10, occurrences); } break; //I believe there is a bug in the b and B case we skip a char too easily case 'b' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { if ((lCurElemString.charAt(i++) & 1) != 0) {//if the low bit is set currentByte |= 128; //set the high bit of the result } if ((i & 7) == 0) { result.append((char) (currentByte & 0xff)); currentByte = 0; continue; } //if the index is not a multiple of 8, we are not on a byte boundary currentByte >>= 1; //shift the byte } if ((occurrences & 7) != 0) { //if the length is not a multiple of 8 currentByte >>= 7 - (occurrences & 7); //we need to pad the last byte result.append((char) (currentByte & 0xff)); } //do some padding, I don't understand the padding strategy result.setLength(result.length() + padLength); } break; case 'B' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { currentByte |= lCurElemString.charAt(i++) & 1; // we filled up current byte; append it and create next one if ((i & 7) == 0) { result.append((char) (currentByte & 0xff)); currentByte = 0; continue; } //if the index is not a multiple of 8, we are not on a byte boundary currentByte <<= 1; } if ((occurrences & 7) != 0) { //if the length is not a multiple of 8 currentByte <<= 7 - (occurrences & 7); //we need to pad the last byte result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; case 'h' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { char currentChar = lCurElemString.charAt(i++); if (Character.isJavaIdentifierStart(currentChar)) { //this test may be too lax but it is the same as in MRI currentByte |= (((currentChar & 15) + 9) & 15) << 4; } else { currentByte |= (currentChar & 15) << 4; } if ((i & 1) != 0) { currentByte >>= 4; } else { result.append((char) (currentByte & 0xff)); currentByte = 0; } } if ((occurrences & 1) != 0) { result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; case 'H' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { char currentChar = lCurElemString.charAt(i++); if (Character.isJavaIdentifierStart(currentChar)) { //this test may be too lax but it is the same as in MRI currentByte |= ((currentChar & 15) + 9) & 15; } else { currentByte |= currentChar & 15; } if ((i & 1) != 0) { currentByte <<= 4; } else { result.append((char) (currentByte & 0xff)); currentByte = 0; } } if ((occurrences & 1) != 0) { result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; } break; } case 'x' : grow(result, sNil10, occurrences); break; case 'X' : try { shrink(result, occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `pack': X outside of string"); } break; case '@' : occurrences -= result.length(); if (occurrences > 0) { grow(result, sNil10, occurrences); } occurrences = -occurrences; if (occurrences > 0) { shrink(result, occurrences); } break; case 'u' : case 'm' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); occurrences = occurrences <= 2 ? 45 : occurrences / 3 * 3; for (;;) { encodes(runtime, result, lCurElemString, occurrences, type); if (occurrences >= lCurElemString.length()) { break; } lCurElemString = lCurElemString.substring(occurrences); } } break; case 'M' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (occurrences <= 1) { occurrences = 72; } qpencode(result, lCurElemString, occurrences); } break; case 'U' : char[] c = new char[occurrences]; for (int cIndex = 0; occurrences-- > 0; cIndex++) { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); long l = from == runtime.getNil() ? 0 : RubyNumeric.num2long(from); c[cIndex] = (char) l; } try { byte[] bytes = new String(c).getBytes("UTF-8"); result.append(RubyString.bytesToString(bytes)); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert to UTF8"; } break; } type = next; } return runtime.newString(result.toString()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
{ if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (occurrences <= 1) { occurrences = 72; }
{ if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); }
public static RubyString pack(List list, RubyString formatString) { IRuby runtime = formatString.getRuntime(); PtrList format = new PtrList(formatString.getValue()); StringBuffer result = new StringBuffer(); int listSize = list.size(); char type = format.nextChar(); int idx = 0; String lCurElemString; while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); if (Character.isWhitespace(type)) { // skip all spaces type = next; continue; } if (next == '!' || next == '_') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } next = format.nextChar(); } // Determine how many of type are needed (default: 1) boolean isStar = false; int occurrences = 1; if (next == '*') { if ("@Xxu".indexOf(type) != -1) { occurrences = 0; } else { occurrences = listSize; isStar = true; } next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); // an exception may occur here if an int can't hold this but ... occurrences = format.nextAsciiNumber(); next = format.nextChar(); } Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { idx = encode(runtime, occurrences, result, list, idx, converter); type = next; continue; } switch (type) { case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : case 'a' : case 'Z' : case 'B' : case 'b' : case 'H' : case 'h' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (isStar) { occurrences = lCurElemString.length(); } switch (type) { case 'a' : case 'A' : case 'Z' : if (lCurElemString.length() >= occurrences) { result.append(lCurElemString.toCharArray(), 0, occurrences); } else {//need padding //I'm fairly sure there is a library call to create a //string filled with a given char with a given length but I couldn't find it result.append(lCurElemString); occurrences -= lCurElemString.length(); grow(result, (type == 'a') ? sNil10 : sSp10, occurrences); } break; //I believe there is a bug in the b and B case we skip a char too easily case 'b' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { if ((lCurElemString.charAt(i++) & 1) != 0) {//if the low bit is set currentByte |= 128; //set the high bit of the result } if ((i & 7) == 0) { result.append((char) (currentByte & 0xff)); currentByte = 0; continue; } //if the index is not a multiple of 8, we are not on a byte boundary currentByte >>= 1; //shift the byte } if ((occurrences & 7) != 0) { //if the length is not a multiple of 8 currentByte >>= 7 - (occurrences & 7); //we need to pad the last byte result.append((char) (currentByte & 0xff)); } //do some padding, I don't understand the padding strategy result.setLength(result.length() + padLength); } break; case 'B' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { currentByte |= lCurElemString.charAt(i++) & 1; // we filled up current byte; append it and create next one if ((i & 7) == 0) { result.append((char) (currentByte & 0xff)); currentByte = 0; continue; } //if the index is not a multiple of 8, we are not on a byte boundary currentByte <<= 1; } if ((occurrences & 7) != 0) { //if the length is not a multiple of 8 currentByte <<= 7 - (occurrences & 7); //we need to pad the last byte result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; case 'h' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { char currentChar = lCurElemString.charAt(i++); if (Character.isJavaIdentifierStart(currentChar)) { //this test may be too lax but it is the same as in MRI currentByte |= (((currentChar & 15) + 9) & 15) << 4; } else { currentByte |= (currentChar & 15) << 4; } if ((i & 1) != 0) { currentByte >>= 4; } else { result.append((char) (currentByte & 0xff)); currentByte = 0; } } if ((occurrences & 1) != 0) { result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; case 'H' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { char currentChar = lCurElemString.charAt(i++); if (Character.isJavaIdentifierStart(currentChar)) { //this test may be too lax but it is the same as in MRI currentByte |= ((currentChar & 15) + 9) & 15; } else { currentByte |= currentChar & 15; } if ((i & 1) != 0) { currentByte <<= 4; } else { result.append((char) (currentByte & 0xff)); currentByte = 0; } } if ((occurrences & 1) != 0) { result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; } break; } case 'x' : grow(result, sNil10, occurrences); break; case 'X' : try { shrink(result, occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `pack': X outside of string"); } break; case '@' : occurrences -= result.length(); if (occurrences > 0) { grow(result, sNil10, occurrences); } occurrences = -occurrences; if (occurrences > 0) { shrink(result, occurrences); } break; case 'u' : case 'm' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); occurrences = occurrences <= 2 ? 45 : occurrences / 3 * 3; for (;;) { encodes(runtime, result, lCurElemString, occurrences, type); if (occurrences >= lCurElemString.length()) { break; } lCurElemString = lCurElemString.substring(occurrences); } } break; case 'M' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (occurrences <= 1) { occurrences = 72; } qpencode(result, lCurElemString, occurrences); } break; case 'U' : char[] c = new char[occurrences]; for (int cIndex = 0; occurrences-- > 0; cIndex++) { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); long l = from == runtime.getNil() ? 0 : RubyNumeric.num2long(from); c[cIndex] = (char) l; } try { byte[] bytes = new String(c).getBytes("UTF-8"); result.append(RubyString.bytesToString(bytes)); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert to UTF8"; } break; } type = next; } return runtime.newString(result.toString()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
qpencode(result, lCurElemString, occurrences); }
IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (occurrences <= 1) { occurrences = 72; } qpencode(result, lCurElemString, occurrences); }
public static RubyString pack(List list, RubyString formatString) { IRuby runtime = formatString.getRuntime(); PtrList format = new PtrList(formatString.getValue()); StringBuffer result = new StringBuffer(); int listSize = list.size(); char type = format.nextChar(); int idx = 0; String lCurElemString; while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); if (Character.isWhitespace(type)) { // skip all spaces type = next; continue; } if (next == '!' || next == '_') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } next = format.nextChar(); } // Determine how many of type are needed (default: 1) boolean isStar = false; int occurrences = 1; if (next == '*') { if ("@Xxu".indexOf(type) != -1) { occurrences = 0; } else { occurrences = listSize; isStar = true; } next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); // an exception may occur here if an int can't hold this but ... occurrences = format.nextAsciiNumber(); next = format.nextChar(); } Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { idx = encode(runtime, occurrences, result, list, idx, converter); type = next; continue; } switch (type) { case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : case 'a' : case 'Z' : case 'B' : case 'b' : case 'H' : case 'h' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (isStar) { occurrences = lCurElemString.length(); } switch (type) { case 'a' : case 'A' : case 'Z' : if (lCurElemString.length() >= occurrences) { result.append(lCurElemString.toCharArray(), 0, occurrences); } else {//need padding //I'm fairly sure there is a library call to create a //string filled with a given char with a given length but I couldn't find it result.append(lCurElemString); occurrences -= lCurElemString.length(); grow(result, (type == 'a') ? sNil10 : sSp10, occurrences); } break; //I believe there is a bug in the b and B case we skip a char too easily case 'b' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { if ((lCurElemString.charAt(i++) & 1) != 0) {//if the low bit is set currentByte |= 128; //set the high bit of the result } if ((i & 7) == 0) { result.append((char) (currentByte & 0xff)); currentByte = 0; continue; } //if the index is not a multiple of 8, we are not on a byte boundary currentByte >>= 1; //shift the byte } if ((occurrences & 7) != 0) { //if the length is not a multiple of 8 currentByte >>= 7 - (occurrences & 7); //we need to pad the last byte result.append((char) (currentByte & 0xff)); } //do some padding, I don't understand the padding strategy result.setLength(result.length() + padLength); } break; case 'B' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { currentByte |= lCurElemString.charAt(i++) & 1; // we filled up current byte; append it and create next one if ((i & 7) == 0) { result.append((char) (currentByte & 0xff)); currentByte = 0; continue; } //if the index is not a multiple of 8, we are not on a byte boundary currentByte <<= 1; } if ((occurrences & 7) != 0) { //if the length is not a multiple of 8 currentByte <<= 7 - (occurrences & 7); //we need to pad the last byte result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; case 'h' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { char currentChar = lCurElemString.charAt(i++); if (Character.isJavaIdentifierStart(currentChar)) { //this test may be too lax but it is the same as in MRI currentByte |= (((currentChar & 15) + 9) & 15) << 4; } else { currentByte |= (currentChar & 15) << 4; } if ((i & 1) != 0) { currentByte >>= 4; } else { result.append((char) (currentByte & 0xff)); currentByte = 0; } } if ((occurrences & 1) != 0) { result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; case 'H' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { char currentChar = lCurElemString.charAt(i++); if (Character.isJavaIdentifierStart(currentChar)) { //this test may be too lax but it is the same as in MRI currentByte |= ((currentChar & 15) + 9) & 15; } else { currentByte |= currentChar & 15; } if ((i & 1) != 0) { currentByte <<= 4; } else { result.append((char) (currentByte & 0xff)); currentByte = 0; } } if ((occurrences & 1) != 0) { result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; } break; } case 'x' : grow(result, sNil10, occurrences); break; case 'X' : try { shrink(result, occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `pack': X outside of string"); } break; case '@' : occurrences -= result.length(); if (occurrences > 0) { grow(result, sNil10, occurrences); } occurrences = -occurrences; if (occurrences > 0) { shrink(result, occurrences); } break; case 'u' : case 'm' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); occurrences = occurrences <= 2 ? 45 : occurrences / 3 * 3; for (;;) { encodes(runtime, result, lCurElemString, occurrences, type); if (occurrences >= lCurElemString.length()) { break; } lCurElemString = lCurElemString.substring(occurrences); } } break; case 'M' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (occurrences <= 1) { occurrences = 72; } qpencode(result, lCurElemString, occurrences); } break; case 'U' : char[] c = new char[occurrences]; for (int cIndex = 0; occurrences-- > 0; cIndex++) { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); long l = from == runtime.getNil() ? 0 : RubyNumeric.num2long(from); c[cIndex] = (char) l; } try { byte[] bytes = new String(c).getBytes("UTF-8"); result.append(RubyString.bytesToString(bytes)); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert to UTF8"; } break; } type = next; } return runtime.newString(result.toString()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
char[] c = new char[occurrences]; for (int cIndex = 0; occurrences-- > 0; cIndex++) { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); long l = from == runtime.getNil() ? 0 : RubyNumeric.num2long(from); c[cIndex] = (char) l; }
char[] c = new char[occurrences]; for (int cIndex = 0; occurrences-- > 0; cIndex++) { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); long l = from == runtime.getNil() ? 0 : RubyNumeric.num2long(from); c[cIndex] = (char) l; }
public static RubyString pack(List list, RubyString formatString) { IRuby runtime = formatString.getRuntime(); PtrList format = new PtrList(formatString.getValue()); StringBuffer result = new StringBuffer(); int listSize = list.size(); char type = format.nextChar(); int idx = 0; String lCurElemString; while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); if (Character.isWhitespace(type)) { // skip all spaces type = next; continue; } if (next == '!' || next == '_') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } next = format.nextChar(); } // Determine how many of type are needed (default: 1) boolean isStar = false; int occurrences = 1; if (next == '*') { if ("@Xxu".indexOf(type) != -1) { occurrences = 0; } else { occurrences = listSize; isStar = true; } next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); // an exception may occur here if an int can't hold this but ... occurrences = format.nextAsciiNumber(); next = format.nextChar(); } Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { idx = encode(runtime, occurrences, result, list, idx, converter); type = next; continue; } switch (type) { case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : case 'a' : case 'Z' : case 'B' : case 'b' : case 'H' : case 'h' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (isStar) { occurrences = lCurElemString.length(); } switch (type) { case 'a' : case 'A' : case 'Z' : if (lCurElemString.length() >= occurrences) { result.append(lCurElemString.toCharArray(), 0, occurrences); } else {//need padding //I'm fairly sure there is a library call to create a //string filled with a given char with a given length but I couldn't find it result.append(lCurElemString); occurrences -= lCurElemString.length(); grow(result, (type == 'a') ? sNil10 : sSp10, occurrences); } break; //I believe there is a bug in the b and B case we skip a char too easily case 'b' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { if ((lCurElemString.charAt(i++) & 1) != 0) {//if the low bit is set currentByte |= 128; //set the high bit of the result } if ((i & 7) == 0) { result.append((char) (currentByte & 0xff)); currentByte = 0; continue; } //if the index is not a multiple of 8, we are not on a byte boundary currentByte >>= 1; //shift the byte } if ((occurrences & 7) != 0) { //if the length is not a multiple of 8 currentByte >>= 7 - (occurrences & 7); //we need to pad the last byte result.append((char) (currentByte & 0xff)); } //do some padding, I don't understand the padding strategy result.setLength(result.length() + padLength); } break; case 'B' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { currentByte |= lCurElemString.charAt(i++) & 1; // we filled up current byte; append it and create next one if ((i & 7) == 0) { result.append((char) (currentByte & 0xff)); currentByte = 0; continue; } //if the index is not a multiple of 8, we are not on a byte boundary currentByte <<= 1; } if ((occurrences & 7) != 0) { //if the length is not a multiple of 8 currentByte <<= 7 - (occurrences & 7); //we need to pad the last byte result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; case 'h' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { char currentChar = lCurElemString.charAt(i++); if (Character.isJavaIdentifierStart(currentChar)) { //this test may be too lax but it is the same as in MRI currentByte |= (((currentChar & 15) + 9) & 15) << 4; } else { currentByte |= (currentChar & 15) << 4; } if ((i & 1) != 0) { currentByte >>= 4; } else { result.append((char) (currentByte & 0xff)); currentByte = 0; } } if ((occurrences & 1) != 0) { result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; case 'H' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { char currentChar = lCurElemString.charAt(i++); if (Character.isJavaIdentifierStart(currentChar)) { //this test may be too lax but it is the same as in MRI currentByte |= ((currentChar & 15) + 9) & 15; } else { currentByte |= currentChar & 15; } if ((i & 1) != 0) { currentByte <<= 4; } else { result.append((char) (currentByte & 0xff)); currentByte = 0; } } if ((occurrences & 1) != 0) { result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; } break; } case 'x' : grow(result, sNil10, occurrences); break; case 'X' : try { shrink(result, occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `pack': X outside of string"); } break; case '@' : occurrences -= result.length(); if (occurrences > 0) { grow(result, sNil10, occurrences); } occurrences = -occurrences; if (occurrences > 0) { shrink(result, occurrences); } break; case 'u' : case 'm' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); occurrences = occurrences <= 2 ? 45 : occurrences / 3 * 3; for (;;) { encodes(runtime, result, lCurElemString, occurrences, type); if (occurrences >= lCurElemString.length()) { break; } lCurElemString = lCurElemString.substring(occurrences); } } break; case 'M' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (occurrences <= 1) { occurrences = 72; } qpencode(result, lCurElemString, occurrences); } break; case 'U' : char[] c = new char[occurrences]; for (int cIndex = 0; occurrences-- > 0; cIndex++) { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); long l = from == runtime.getNil() ? 0 : RubyNumeric.num2long(from); c[cIndex] = (char) l; } try { byte[] bytes = new String(c).getBytes("UTF-8"); result.append(RubyString.bytesToString(bytes)); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert to UTF8"; } break; } type = next; } return runtime.newString(result.toString()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
byte[] bytes = new String(c).getBytes("UTF-8"); result.append(RubyString.bytesToString(bytes));
byte[] bytes = new String(c).getBytes("UTF-8"); result.append(RubyString.bytesToString(bytes));
public static RubyString pack(List list, RubyString formatString) { IRuby runtime = formatString.getRuntime(); PtrList format = new PtrList(formatString.getValue()); StringBuffer result = new StringBuffer(); int listSize = list.size(); char type = format.nextChar(); int idx = 0; String lCurElemString; while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); if (Character.isWhitespace(type)) { // skip all spaces type = next; continue; } if (next == '!' || next == '_') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } next = format.nextChar(); } // Determine how many of type are needed (default: 1) boolean isStar = false; int occurrences = 1; if (next == '*') { if ("@Xxu".indexOf(type) != -1) { occurrences = 0; } else { occurrences = listSize; isStar = true; } next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); // an exception may occur here if an int can't hold this but ... occurrences = format.nextAsciiNumber(); next = format.nextChar(); } Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { idx = encode(runtime, occurrences, result, list, idx, converter); type = next; continue; } switch (type) { case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : case 'a' : case 'Z' : case 'B' : case 'b' : case 'H' : case 'h' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (isStar) { occurrences = lCurElemString.length(); } switch (type) { case 'a' : case 'A' : case 'Z' : if (lCurElemString.length() >= occurrences) { result.append(lCurElemString.toCharArray(), 0, occurrences); } else {//need padding //I'm fairly sure there is a library call to create a //string filled with a given char with a given length but I couldn't find it result.append(lCurElemString); occurrences -= lCurElemString.length(); grow(result, (type == 'a') ? sNil10 : sSp10, occurrences); } break; //I believe there is a bug in the b and B case we skip a char too easily case 'b' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { if ((lCurElemString.charAt(i++) & 1) != 0) {//if the low bit is set currentByte |= 128; //set the high bit of the result } if ((i & 7) == 0) { result.append((char) (currentByte & 0xff)); currentByte = 0; continue; } //if the index is not a multiple of 8, we are not on a byte boundary currentByte >>= 1; //shift the byte } if ((occurrences & 7) != 0) { //if the length is not a multiple of 8 currentByte >>= 7 - (occurrences & 7); //we need to pad the last byte result.append((char) (currentByte & 0xff)); } //do some padding, I don't understand the padding strategy result.setLength(result.length() + padLength); } break; case 'B' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { currentByte |= lCurElemString.charAt(i++) & 1; // we filled up current byte; append it and create next one if ((i & 7) == 0) { result.append((char) (currentByte & 0xff)); currentByte = 0; continue; } //if the index is not a multiple of 8, we are not on a byte boundary currentByte <<= 1; } if ((occurrences & 7) != 0) { //if the length is not a multiple of 8 currentByte <<= 7 - (occurrences & 7); //we need to pad the last byte result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; case 'h' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { char currentChar = lCurElemString.charAt(i++); if (Character.isJavaIdentifierStart(currentChar)) { //this test may be too lax but it is the same as in MRI currentByte |= (((currentChar & 15) + 9) & 15) << 4; } else { currentByte |= (currentChar & 15) << 4; } if ((i & 1) != 0) { currentByte >>= 4; } else { result.append((char) (currentByte & 0xff)); currentByte = 0; } } if ((occurrences & 1) != 0) { result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; case 'H' : { int currentByte = 0; int padLength = 0; if (occurrences > lCurElemString.length()) { padLength = occurrences - lCurElemString.length(); occurrences = lCurElemString.length(); } for (int i = 0; i < occurrences;) { char currentChar = lCurElemString.charAt(i++); if (Character.isJavaIdentifierStart(currentChar)) { //this test may be too lax but it is the same as in MRI currentByte |= ((currentChar & 15) + 9) & 15; } else { currentByte |= currentChar & 15; } if ((i & 1) != 0) { currentByte <<= 4; } else { result.append((char) (currentByte & 0xff)); currentByte = 0; } } if ((occurrences & 1) != 0) { result.append((char) (currentByte & 0xff)); } result.setLength(result.length() + padLength); } break; } break; } case 'x' : grow(result, sNil10, occurrences); break; case 'X' : try { shrink(result, occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `pack': X outside of string"); } break; case '@' : occurrences -= result.length(); if (occurrences > 0) { grow(result, sNil10, occurrences); } occurrences = -occurrences; if (occurrences > 0) { shrink(result, occurrences); } break; case 'u' : case 'm' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); occurrences = occurrences <= 2 ? 45 : occurrences / 3 * 3; for (;;) { encodes(runtime, result, lCurElemString, occurrences, type); if (occurrences >= lCurElemString.length()) { break; } lCurElemString = lCurElemString.substring(occurrences); } } break; case 'M' : { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); lCurElemString = from == runtime.getNil() ? "" : convert2String(from); if (occurrences <= 1) { occurrences = 72; } qpencode(result, lCurElemString, occurrences); } break; case 'U' : char[] c = new char[occurrences]; for (int cIndex = 0; occurrences-- > 0; cIndex++) { if (listSize-- <= 0) { throw runtime.newArgumentError(sTooFew); } IRubyObject from = (IRubyObject) list.get(idx++); long l = from == runtime.getNil() ? 0 : RubyNumeric.num2long(from); c[cIndex] = (char) l; } try { byte[] bytes = new String(c).getBytes("UTF-8"); result.append(RubyString.bytesToString(bytes)); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert to UTF8"; } break; } type = next; } return runtime.newString(result.toString()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES);
throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES);
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
occurrences = 1;
occurrences = 1;
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
occurrences = IS_STAR; next = format.nextChar();
occurrences = IS_STAR; next = format.nextChar();
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar();
format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar();
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
decode(runtime, encode, occurrences, result, converter); type = next; continue;
decode(runtime, encode, occurrences, result, converter); type = next; continue;
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
case '@' : encode.setPosition(occurrences); break;
case '@' : encode.setPosition(occurrences); break;
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
{
{
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
occurrences = encode.remaining(); }
occurrences = encode.remaining(); }
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
char c = potential.charAt(t);
char c = potential.charAt(t);
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
if (c != '\0' && c != ' ') { break; }
if (c != '\0' && c != ' ') { break; }
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
{
{
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
occurrences = encode.remaining(); }
occurrences = encode.remaining(); }
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
char c = potential.charAt(t);
char c = potential.charAt(t);
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
if (c != '\0') { break; }
if (c != '\0') { break; }
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
}
}
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
occurrences = encode.remaining(); }
occurrences = encode.remaining(); }
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
occurrences = encode.remaining() * 8; }
occurrences = encode.remaining() * 8; }
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
occurrences = encode.remaining() * 8; }
occurrences = encode.remaining() * 8; }
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
occurrences = encode.remaining() * 2; }
occurrences = encode.remaining() * 2; }
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
occurrences = encode.remaining() * 2; }
occurrences = encode.remaining() * 2; }
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
occurrences = encode.remaining(); }
occurrences = encode.remaining(); }
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break;
if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break;
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
type = next;
type = next;
public static RubyArray unpack(String encodedString, RubyString formatString) { IRuby runtime = formatString.getRuntime(); RubyArray result = runtime.newArray(); PtrList format = new PtrList(formatString.getValue()); PtrList encode = new PtrList(encodedString); char type = format.nextChar(); // Type to be unpacked while(!format.isAtEnd()) { // Possible next type, format of current type, occurrences of type char next = format.nextChar(); // Next indicates to decode using native encoding format if (next == '_' || next == '!') { if (NATIVE_CODES.indexOf(type) == -1) { throw runtime.newArgumentError("'" + next + "' allowed only after types " + NATIVE_CODES); } // We advance in case occurences follows next = format.nextChar(); } // How many occurrences of 'type' we want int occurrences = 0; if (format.isAtEnd()) { occurrences = 1; } else if (next == '*') { occurrences = IS_STAR; next = format.nextChar(); } else if (Character.isDigit(next)) { format.backup(1); occurrences = format.nextAsciiNumber(); next = format.nextChar(); } else { occurrences = type == '@' ? 0 : 1; } // See if we have a converter for the job... Converter converter = (Converter) converters.get(new Character(type)); if (converter != null) { decode(runtime, encode, occurrences, result, converter); type = next; continue; } // Otherwise the unpack should be here... switch (type) { case '@' : encode.setPosition(occurrences); break; case '%' : throw runtime.newArgumentError("% is not supported"); case 'A' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0' && c != ' ') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'Z' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } String potential = encode.nextSubstring(occurrences); for (int t = occurrences - 1; occurrences > 0; occurrences--, t--) { char c = potential.charAt(t); if (c != '\0') { break; } } potential = potential.substring(0, occurrences); result.append(runtime.newString(potential)); } break; case 'a' : if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } result.append(runtime.newString(encode.nextSubstring(occurrences))); break; case 'b' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) { bits >>>= 1; } else { bits = encode.nextChar(); } lElem.append((bits & 1) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'B' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 8) { occurrences = encode.remaining() * 8; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 7) != 0) bits <<= 1; else bits = encode.nextChar(); lElem.append((bits & 128) != 0 ? '1' : '0'); } result.append(runtime.newString(lElem.toString())); } break; case 'h' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) { bits >>>= 4; } else { bits = encode.nextChar(); } lElem.append(sHexDigits[bits & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'H' : { if (occurrences == IS_STAR || occurrences > encode.remaining() * 2) { occurrences = encode.remaining() * 2; } int bits = 0; StringBuffer lElem = new StringBuffer(occurrences); for (int lCurByte = 0; lCurByte < occurrences; lCurByte++) { if ((lCurByte & 1) != 0) bits <<= 4; else bits = encode.nextChar(); lElem.append(sHexDigits[(bits >>> 4) & 15]); } result.append(runtime.newString(lElem.toString())); } break; case 'U' : { if (occurrences == IS_STAR || occurrences > encode.remaining()) { occurrences = encode.remaining(); } //get the correct substring String toUnpack = encode.nextSubstring(occurrences); String lUtf8 = null; try { lUtf8 = new String(toUnpack.getBytes("iso8859-1"), "UTF-8"); } catch (java.io.UnsupportedEncodingException e) { assert false : "can't convert from UTF8"; } char[] c = lUtf8.toCharArray(); for (int lCurCharIdx = 0; occurrences-- > 0 && lCurCharIdx < c.length; lCurCharIdx++) result.append(runtime.newFixnum(c[lCurCharIdx])); } break; case 'X': if (occurrences == IS_STAR) { occurrences = encode.getLength() - encode.remaining(); } try { encode.backup(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': X outside of string"); } break; case 'x': if (occurrences == IS_STAR) { occurrences = encode.remaining(); } try { encode.nextSubstring(occurrences); } catch (IllegalArgumentException e) { throw runtime.newArgumentError("in `unpack': x outside of string"); } break; } type = next; } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/415b1e0db282c02d672a7e34a34a2bea0f69ccb2/Pack.java/clean/src/org/jruby/util/Pack.java
public CreatePojosFixture( ServiceFactory rootFactory ) { IAdmin rootAdmin = rootFactory.getAdminService(); String G_NAME = UUID.randomUUID().toString(); g = new ExperimenterGroup(); g.setName(G_NAME); g = new ExperimenterGroup( rootAdmin.createGroup(g), false ); TESTER = "TESTER-"+UUID.randomUUID().toString(); e = new Experimenter(); e.setOmeName(TESTER); e.setFirstName("Mr."); e.setLastName("Allen"); e = new Experimenter( rootAdmin.createUser(e), false ); rootAdmin.addGroups(e, g); rootAdmin.setDefaultGroup(e, g); init = true; Login testLogin = new Login(TESTER,"ome",G_NAME,"Test"); ServiceFactory factory = new ServiceFactory(testLogin); iAdmin = factory.getAdminService(); iQuery = factory.getQueryService(); iUpdate = factory.getUpdateService(); }
private CreatePojosFixture() {}
public CreatePojosFixture( ServiceFactory rootFactory ) { IAdmin rootAdmin = rootFactory.getAdminService(); String G_NAME = UUID.randomUUID().toString(); g = new ExperimenterGroup(); g.setName(G_NAME); g = new ExperimenterGroup( rootAdmin.createGroup(g), false ); TESTER = "TESTER-"+UUID.randomUUID().toString(); e = new Experimenter(); e.setOmeName(TESTER); e.setFirstName("Mr."); e.setLastName("Allen"); e = new Experimenter( rootAdmin.createUser(e), false ); rootAdmin.addGroups(e, g); rootAdmin.setDefaultGroup(e, g); init = true; Login testLogin = new Login(TESTER,"ome",G_NAME,"Test"); ServiceFactory factory = new ServiceFactory(testLogin); iAdmin = factory.getAdminService(); iQuery = factory.getQueryService(); iUpdate = factory.getUpdateService(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3dc405b5f110ef3a96fe6c7a1b789ed1d8f2c871/CreatePojosFixture.java/clean/components/common/src/ome/testing/CreatePojosFixture.java
add(scrollPane, new GridBagConstraints(0, 0, 1, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(5, 5, 5, 5), 0, 0));
add(scrollPane, new GridBagConstraints(0, 0, 1, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(5, 5, 5, 5), 30, 0));
public PreferencesPanel(Iterator preferences) { this.setLayout(new GridBagLayout()); titleLabel.setText(Res.getString("title.preferences")); titleLabel.setFont(new Font("Dialog", Font.BOLD, 15)); JScrollPane scrollPane = new JScrollPane(list); scrollPane.setPreferredSize(new Dimension(125, 0)); list.setFixedCellHeight(70); add(scrollPane, new GridBagConstraints(0, 0, 1, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(5, 5, 5, 5), 0, 0)); add(flowPanel, new GridBagConstraints(1, 0, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0)); list.setCellRenderer(new JLabelIconRenderer()); list.addListSelectionListener(this); // Populate with current preferences while (preferences.hasNext()) { Preference preference = (Preference)preferences.next(); listModel.addElement(new PreferenceUI(preference)); } list.setSelectedIndex(0); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d146fe0558b3a9a3c79746e51b1aa990ebe519a4/PreferencesPanel.java/buggy/src/java/org/jivesoftware/sparkimpl/preference/PreferencesPanel.java
case END:
final public BlockBuilder Block(Subdirective[] subdirectives) throws ParseException { ParserBlockBuilder block = new ParserBlockBuilder(); Token t; blockStack.push(subdirectives); if (jj_2_23(2147483647)) { jj_consume_token(LBRACE); EatWsNlIfNl(block); label_11: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[71] = jj_gen; break label_11; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: WMContent(block); break; case BEGIN: case END: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: t = jj_consume_token(BEGIN); break; case END: t = jj_consume_token(END); break; default: jj_la1[72] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[73] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: jj_consume_token(BEGIN); EatWsNlOrSpace(block); break; default: jj_la1[74] = jj_gen; ; } label_12: while (true) { if (jj_2_21(1)) { ; } else { break label_12; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: WMContentNoDirective(block); break; case LBRACE: case RBRACE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: t = jj_consume_token(LBRACE); break; case RBRACE: t = jj_consume_token(RBRACE); break; default: jj_la1[75] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[76] = jj_gen; if (jj_2_22(2147483647) && (lookahead_not_breaking_subd())) { Directive(block); } else { jj_consume_token(-1); throw new ParseException(); } } } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case END: jj_consume_token(END); block.eatOneWs(); break; default: jj_la1[77] = jj_gen; ; } } blockStack.pop(); {if (true) return block;} throw new Error("Missing return statement in function"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
case END:
final public BlockBuilder Block(Subdirective[] subdirectives) throws ParseException { ParserBlockBuilder block = new ParserBlockBuilder(); Token t; blockStack.push(subdirectives); if (jj_2_23(2147483647)) { jj_consume_token(LBRACE); EatWsNlIfNl(block); label_11: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[71] = jj_gen; break label_11; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: WMContent(block); break; case BEGIN: case END: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: t = jj_consume_token(BEGIN); break; case END: t = jj_consume_token(END); break; default: jj_la1[72] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[73] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: jj_consume_token(BEGIN); EatWsNlOrSpace(block); break; default: jj_la1[74] = jj_gen; ; } label_12: while (true) { if (jj_2_21(1)) { ; } else { break label_12; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: WMContentNoDirective(block); break; case LBRACE: case RBRACE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: t = jj_consume_token(LBRACE); break; case RBRACE: t = jj_consume_token(RBRACE); break; default: jj_la1[75] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[76] = jj_gen; if (jj_2_22(2147483647) && (lookahead_not_breaking_subd())) { Directive(block); } else { jj_consume_token(-1); throw new ParseException(); } } } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case END: jj_consume_token(END); block.eatOneWs(); break; default: jj_la1[77] = jj_gen; ; } } blockStack.pop(); {if (true) return block;} throw new Error("Missing return statement in function"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
case RBRACE:
final public BlockBuilder Block(Subdirective[] subdirectives) throws ParseException { ParserBlockBuilder block = new ParserBlockBuilder(); Token t; blockStack.push(subdirectives); if (jj_2_23(2147483647)) { jj_consume_token(LBRACE); EatWsNlIfNl(block); label_11: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[71] = jj_gen; break label_11; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: WMContent(block); break; case BEGIN: case END: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: t = jj_consume_token(BEGIN); break; case END: t = jj_consume_token(END); break; default: jj_la1[72] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[73] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: jj_consume_token(BEGIN); EatWsNlOrSpace(block); break; default: jj_la1[74] = jj_gen; ; } label_12: while (true) { if (jj_2_21(1)) { ; } else { break label_12; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: WMContentNoDirective(block); break; case LBRACE: case RBRACE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: t = jj_consume_token(LBRACE); break; case RBRACE: t = jj_consume_token(RBRACE); break; default: jj_la1[75] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[76] = jj_gen; if (jj_2_22(2147483647) && (lookahead_not_breaking_subd())) { Directive(block); } else { jj_consume_token(-1); throw new ParseException(); } } } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case END: jj_consume_token(END); block.eatOneWs(); break; default: jj_la1[77] = jj_gen; ; } } blockStack.pop(); {if (true) return block;} throw new Error("Missing return statement in function"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
case END:
final public BlockBuilder LiteralBlock() throws ParseException { ParserBlockBuilder block = new ParserBlockBuilder(); Token t; if (jj_2_20(2147483647)) { jj_consume_token(LBRACE); label_9: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[63] = jj_gen; break label_9; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: LiteralWMContent(block); break; case BEGIN: case END: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: t = jj_consume_token(BEGIN); break; case END: t = jj_consume_token(END); break; default: jj_la1[64] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[65] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case LBRACE: case RBRACE: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: jj_consume_token(BEGIN); break; default: jj_la1[66] = jj_gen; ; } label_10: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case LBRACE: case RBRACE: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[67] = jj_gen; break label_10; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: LiteralWMContent(block); break; case LBRACE: case RBRACE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: t = jj_consume_token(LBRACE); break; case RBRACE: t = jj_consume_token(RBRACE); break; default: jj_la1[68] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[69] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(END); break; default: jj_la1[70] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } {if (true) return block;} throw new Error("Missing return statement in function"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
case END:
final public BlockBuilder LiteralBlock() throws ParseException { ParserBlockBuilder block = new ParserBlockBuilder(); Token t; if (jj_2_20(2147483647)) { jj_consume_token(LBRACE); label_9: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[63] = jj_gen; break label_9; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: LiteralWMContent(block); break; case BEGIN: case END: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: t = jj_consume_token(BEGIN); break; case END: t = jj_consume_token(END); break; default: jj_la1[64] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[65] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case LBRACE: case RBRACE: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: jj_consume_token(BEGIN); break; default: jj_la1[66] = jj_gen; ; } label_10: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case LBRACE: case RBRACE: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[67] = jj_gen; break label_10; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: LiteralWMContent(block); break; case LBRACE: case RBRACE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: t = jj_consume_token(LBRACE); break; case RBRACE: t = jj_consume_token(RBRACE); break; default: jj_la1[68] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[69] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(END); break; default: jj_la1[70] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } {if (true) return block;} throw new Error("Missing return statement in function"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
case END:
final public BlockBuilder LiteralBlock() throws ParseException { ParserBlockBuilder block = new ParserBlockBuilder(); Token t; if (jj_2_20(2147483647)) { jj_consume_token(LBRACE); label_9: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[63] = jj_gen; break label_9; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: LiteralWMContent(block); break; case BEGIN: case END: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: t = jj_consume_token(BEGIN); break; case END: t = jj_consume_token(END); break; default: jj_la1[64] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[65] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case LBRACE: case RBRACE: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: jj_consume_token(BEGIN); break; default: jj_la1[66] = jj_gen; ; } label_10: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case LBRACE: case RBRACE: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[67] = jj_gen; break label_10; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: LiteralWMContent(block); break; case LBRACE: case RBRACE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: t = jj_consume_token(LBRACE); break; case RBRACE: t = jj_consume_token(RBRACE); break; default: jj_la1[68] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[69] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(END); break; default: jj_la1[70] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } {if (true) return block;} throw new Error("Missing return statement in function"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
case RBRACE:
final public BlockBuilder LiteralBlock() throws ParseException { ParserBlockBuilder block = new ParserBlockBuilder(); Token t; if (jj_2_20(2147483647)) { jj_consume_token(LBRACE); label_9: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[63] = jj_gen; break label_9; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: LiteralWMContent(block); break; case BEGIN: case END: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: t = jj_consume_token(BEGIN); break; case END: t = jj_consume_token(END); break; default: jj_la1[64] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[65] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case LBRACE: case RBRACE: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: jj_consume_token(BEGIN); break; default: jj_la1[66] = jj_gen; ; } label_10: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case LBRACE: case RBRACE: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[67] = jj_gen; break label_10; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: LiteralWMContent(block); break; case LBRACE: case RBRACE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: t = jj_consume_token(LBRACE); break; case RBRACE: t = jj_consume_token(RBRACE); break; default: jj_la1[68] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[69] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(END); break; default: jj_la1[70] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } {if (true) return block;} throw new Error("Missing return statement in function"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
case RBRACE:
final public BlockBuilder LiteralBlock() throws ParseException { ParserBlockBuilder block = new ParserBlockBuilder(); Token t; if (jj_2_20(2147483647)) { jj_consume_token(LBRACE); label_9: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[63] = jj_gen; break label_9; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: LiteralWMContent(block); break; case BEGIN: case END: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: t = jj_consume_token(BEGIN); break; case END: t = jj_consume_token(END); break; default: jj_la1[64] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[65] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case LBRACE: case RBRACE: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: jj_consume_token(BEGIN); break; default: jj_la1[66] = jj_gen; ; } label_10: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case LBRACE: case RBRACE: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[67] = jj_gen; break label_10; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: LiteralWMContent(block); break; case LBRACE: case RBRACE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: t = jj_consume_token(LBRACE); break; case RBRACE: t = jj_consume_token(RBRACE); break; default: jj_la1[68] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[69] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(END); break; default: jj_la1[70] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } {if (true) return block;} throw new Error("Missing return statement in function"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
case RBRACE:
final public BlockBuilder LiteralBlock() throws ParseException { ParserBlockBuilder block = new ParserBlockBuilder(); Token t; if (jj_2_20(2147483647)) { jj_consume_token(LBRACE); label_9: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[63] = jj_gen; break label_9; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: LiteralWMContent(block); break; case BEGIN: case END: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: t = jj_consume_token(BEGIN); break; case END: t = jj_consume_token(END); break; default: jj_la1[64] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[65] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case LBRACE: case RBRACE: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: jj_consume_token(BEGIN); break; default: jj_la1[66] = jj_gen; ; } label_10: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case LBRACE: case RBRACE: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[67] = jj_gen; break label_10; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: LiteralWMContent(block); break; case LBRACE: case RBRACE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: t = jj_consume_token(LBRACE); break; case RBRACE: t = jj_consume_token(RBRACE); break; default: jj_la1[68] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[69] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(END); break; default: jj_la1[70] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } {if (true) return block;} throw new Error("Missing return statement in function"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
case END:
final public BlockBuilder WMDocument() throws ParseException { ParserBlockBuilder block = new ParserBlockBuilder(); Token t; label_13: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case LBRACE: case RBRACE: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[78] = jj_gen; break label_13; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: WMContent(block); break; case BEGIN: case END: case LBRACE: case RBRACE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: t = jj_consume_token(BEGIN); break; case END: t = jj_consume_token(END); break; case LBRACE: t = jj_consume_token(LBRACE); break; case RBRACE: t = jj_consume_token(RBRACE); break; default: jj_la1[79] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[80] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(0); {if (true) return block;} throw new Error("Missing return statement in function"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
case RBRACE:
final public BlockBuilder WMDocument() throws ParseException { ParserBlockBuilder block = new ParserBlockBuilder(); Token t; label_13: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case LBRACE: case RBRACE: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[78] = jj_gen; break label_13; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: WMContent(block); break; case BEGIN: case END: case LBRACE: case RBRACE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: t = jj_consume_token(BEGIN); break; case END: t = jj_consume_token(END); break; case LBRACE: t = jj_consume_token(LBRACE); break; case RBRACE: t = jj_consume_token(RBRACE); break; default: jj_la1[79] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[80] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(0); {if (true) return block;} throw new Error("Missing return statement in function"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
case END:
final public BlockBuilder WMDocument() throws ParseException { ParserBlockBuilder block = new ParserBlockBuilder(); Token t; label_13: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case LBRACE: case RBRACE: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[78] = jj_gen; break label_13; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: WMContent(block); break; case BEGIN: case END: case LBRACE: case RBRACE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: t = jj_consume_token(BEGIN); break; case END: t = jj_consume_token(END); break; case LBRACE: t = jj_consume_token(LBRACE); break; case RBRACE: t = jj_consume_token(RBRACE); break; default: jj_la1[79] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[80] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(0); {if (true) return block;} throw new Error("Missing return statement in function"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
case RBRACE:
final public BlockBuilder WMDocument() throws ParseException { ParserBlockBuilder block = new ParserBlockBuilder(); Token t; label_13: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case BEGIN: case END: case LBRACE: case RBRACE: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: ; break; default: jj_la1[78] = jj_gen; break label_13; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STUFF: case POUNDPOUND: case DOLLAR: case QCHAR: case SLASH: case POUND: WMContent(block); break; case BEGIN: case END: case LBRACE: case RBRACE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BEGIN: t = jj_consume_token(BEGIN); break; case END: t = jj_consume_token(END); break; case LBRACE: t = jj_consume_token(LBRACE); break; case RBRACE: t = jj_consume_token(RBRACE); break; default: jj_la1[79] = jj_gen; jj_consume_token(-1); throw new ParseException(); } block.addElement(t.image); break; default: jj_la1[80] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(0); {if (true) return block;} throw new Error("Missing return statement in function"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(WS)) return true;
if (jj_scan_token(BEGIN)) return true;
final private boolean jj_3R_15() { if (jj_scan_token(WS)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(WS)) return true;
if (jj_scan_token(LBRACE)) return true;
final private boolean jj_3R_16() { if (jj_scan_token(WS)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(OP_MULT)) return true;
if (jj_scan_token(WS)) return true;
final private boolean jj_3R_18() { if (jj_scan_token(OP_MULT)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(OP_DIV)) return true;
if (jj_scan_token(WS)) return true;
final private boolean jj_3R_19() { if (jj_scan_token(OP_DIV)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(WS)) return true;
if (jj_scan_token(OP_MULT)) return true;
final private boolean jj_3R_20() { if (jj_scan_token(WS)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
Token xsp; xsp = jj_scanpos; if (jj_3R_42()) { jj_scanpos = xsp; if (jj_3R_43()) { jj_scanpos = xsp; if (jj_3R_44()) { jj_scanpos = xsp; if (jj_3R_45()) { jj_scanpos = xsp; if (jj_3R_46()) { jj_scanpos = xsp; if (jj_3R_47()) { jj_scanpos = xsp; if (jj_3R_48()) { jj_scanpos = xsp; if (jj_3R_49()) { jj_scanpos = xsp; if (jj_3R_50()) { jj_scanpos = xsp; if (jj_3R_51()) return true;
if (jj_scan_token(OP_DIV)) return true;
final private boolean jj_3R_21() { Token xsp; xsp = jj_scanpos; if (jj_3R_42()) { jj_scanpos = xsp; if (jj_3R_43()) { jj_scanpos = xsp; if (jj_3R_44()) { jj_scanpos = xsp; if (jj_3R_45()) { jj_scanpos = xsp; if (jj_3R_46()) { jj_scanpos = xsp; if (jj_3R_47()) { jj_scanpos = xsp; if (jj_3R_48()) { jj_scanpos = xsp; if (jj_3R_49()) { jj_scanpos = xsp; if (jj_3R_50()) { jj_scanpos = xsp; if (jj_3R_51()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
} else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
final private boolean jj_3R_21() { Token xsp; xsp = jj_scanpos; if (jj_3R_42()) { jj_scanpos = xsp; if (jj_3R_43()) { jj_scanpos = xsp; if (jj_3R_44()) { jj_scanpos = xsp; if (jj_3R_45()) { jj_scanpos = xsp; if (jj_3R_46()) { jj_scanpos = xsp; if (jj_3R_47()) { jj_scanpos = xsp; if (jj_3R_48()) { jj_scanpos = xsp; if (jj_3R_49()) { jj_scanpos = xsp; if (jj_3R_50()) { jj_scanpos = xsp; if (jj_3R_51()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(OP_PLUS)) return true;
Token xsp; xsp = jj_scanpos; if (jj_3R_44()) { jj_scanpos = xsp; if (jj_3R_45()) { jj_scanpos = xsp; if (jj_3R_46()) { jj_scanpos = xsp; if (jj_3R_47()) { jj_scanpos = xsp; if (jj_3R_48()) { jj_scanpos = xsp; if (jj_3R_49()) { jj_scanpos = xsp; if (jj_3R_50()) { jj_scanpos = xsp; if (jj_3R_51()) { jj_scanpos = xsp; if (jj_3R_52()) { jj_scanpos = xsp; if (jj_3R_53()) return true;
final private boolean jj_3R_23() { if (jj_scan_token(OP_PLUS)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
} else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
final private boolean jj_3R_23() { if (jj_scan_token(OP_PLUS)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(OP_MINUS)) return true;
if (jj_scan_token(WS)) return true;
final private boolean jj_3R_24() { if (jj_scan_token(OP_MINUS)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(WS)) return true;
if (jj_scan_token(OP_PLUS)) return true;
final private boolean jj_3R_25() { if (jj_scan_token(WS)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_21()) return true;
if (jj_scan_token(OP_MINUS)) return true;
final private boolean jj_3R_26() { if (jj_3R_21()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
Token xsp; xsp = jj_scanpos; if (jj_3R_52()) { jj_scanpos = xsp; if (jj_3R_53()) { jj_scanpos = xsp; if (jj_3R_54()) { jj_scanpos = xsp; if (jj_3R_55()) { jj_scanpos = xsp; if (jj_3R_56()) { jj_scanpos = xsp; if (jj_3R_57()) { jj_scanpos = xsp; if (jj_3R_58()) return true;
if (jj_3R_23()) return true;
final private boolean jj_3R_28() { Token xsp; xsp = jj_scanpos; if (jj_3R_52()) { jj_scanpos = xsp; if (jj_3R_53()) { jj_scanpos = xsp; if (jj_3R_54()) { jj_scanpos = xsp; if (jj_3R_55()) { jj_scanpos = xsp; if (jj_3R_56()) { jj_scanpos = xsp; if (jj_3R_57()) { jj_scanpos = xsp; if (jj_3R_58()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
} else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
final private boolean jj_3R_28() { Token xsp; xsp = jj_scanpos; if (jj_3R_52()) { jj_scanpos = xsp; if (jj_3R_53()) { jj_scanpos = xsp; if (jj_3R_54()) { jj_scanpos = xsp; if (jj_3R_55()) { jj_scanpos = xsp; if (jj_3R_56()) { jj_scanpos = xsp; if (jj_3R_57()) { jj_scanpos = xsp; if (jj_3R_58()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_26()) return true;
Token xsp; xsp = jj_scanpos; if (jj_3R_54()) { jj_scanpos = xsp; if (jj_3R_55()) { jj_scanpos = xsp; if (jj_3R_56()) { jj_scanpos = xsp; if (jj_3R_57()) { jj_scanpos = xsp; if (jj_3R_58()) { jj_scanpos = xsp; if (jj_3R_59()) { jj_scanpos = xsp; if (jj_3R_60()) return true;
final private boolean jj_3R_30() { if (jj_3R_26()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
} else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
final private boolean jj_3R_30() { if (jj_3R_26()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(WS)) return true;
if (jj_3R_28()) return true;
final private boolean jj_3R_32() { if (jj_scan_token(WS)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_30()) return true;
if (jj_scan_token(WS)) return true;
final private boolean jj_3R_33() { if (jj_3R_30()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(WS)) return true;
if (jj_3R_32()) return true;
final private boolean jj_3R_35() { if (jj_scan_token(WS)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_33()) return true;
if (jj_scan_token(WS)) return true;
final private boolean jj_3R_36() { if (jj_3R_33()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(DOLLAR)) return true;
if (jj_scan_token(WS)) return true;
final private boolean jj_3R_37() { if (jj_scan_token(DOLLAR)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(LPAREN)) return true;
if (jj_3R_35()) return true;
final private boolean jj_3R_38() { if (jj_scan_token(LPAREN)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_59()) return true;
if (jj_scan_token(DOLLAR)) return true;
final private boolean jj_3R_39() { if (jj_3R_59()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
Token xsp; xsp = jj_scanpos; if (jj_3R_60()) { jj_scanpos = xsp; if (jj_3R_61()) return true;
if (jj_scan_token(LPAREN)) return true;
final private boolean jj_3R_40() { Token xsp; xsp = jj_scanpos; if (jj_3R_60()) { jj_scanpos = xsp; if (jj_3R_61()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
} else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
final private boolean jj_3R_40() { Token xsp; xsp = jj_scanpos; if (jj_3R_60()) { jj_scanpos = xsp; if (jj_3R_61()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_62()) return true;
if (jj_3R_61()) return true;
final private boolean jj_3R_41() { if (jj_3R_62()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
} else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
final private boolean jj_3R_42() { if (jj_3R_63()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(LPAREN)) return true;
if (jj_3R_64()) return true;
final private boolean jj_3R_43() { if (jj_scan_token(LPAREN)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_64()) return true;
if (jj_3R_65()) return true;
final private boolean jj_3R_44() { if (jj_3R_64()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_65()) return true;
if (jj_scan_token(LPAREN)) return true;
final private boolean jj_3R_45() { if (jj_3R_65()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(NULL)) return true;
if (jj_3R_66()) return true;
final private boolean jj_3R_46() { if (jj_scan_token(NULL)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(TRUE)) return true;
if (jj_3R_67()) return true;
final private boolean jj_3R_47() { if (jj_scan_token(TRUE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(FALSE)) return true;
if (jj_scan_token(NULL)) return true;
final private boolean jj_3R_48() { if (jj_scan_token(FALSE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(OP_NOT)) return true;
if (jj_scan_token(TRUE)) return true;
final private boolean jj_3R_49() { if (jj_scan_token(OP_NOT)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(NUMBER)) return true;
if (jj_scan_token(FALSE)) return true;
final private boolean jj_3R_50() { if (jj_scan_token(NUMBER)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(OP_MINUS)) return true;
if (jj_scan_token(OP_NOT)) return true;
final private boolean jj_3R_51() { if (jj_scan_token(OP_MINUS)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(OP_EQ)) return true;
if (jj_scan_token(NUMBER)) return true;
final private boolean jj_3R_52() { if (jj_scan_token(OP_EQ)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(OP_SET)) return true;
if (jj_scan_token(OP_MINUS)) return true;
final private boolean jj_3R_53() { if (jj_scan_token(OP_SET)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(OP_NE)) return true;
if (jj_scan_token(OP_EQ)) return true;
final private boolean jj_3R_54() { if (jj_scan_token(OP_NE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(OP_GT)) return true;
if (jj_scan_token(OP_SET)) return true;
final private boolean jj_3R_55() { if (jj_scan_token(OP_GT)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(OP_GE)) return true;
if (jj_scan_token(OP_NE)) return true;
final private boolean jj_3R_56() { if (jj_scan_token(OP_GE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(OP_LE)) return true;
if (jj_scan_token(OP_GT)) return true;
final private boolean jj_3R_57() { if (jj_scan_token(OP_LE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(OP_LT)) return true;
if (jj_scan_token(OP_GE)) return true;
final private boolean jj_3R_58() { if (jj_scan_token(OP_LT)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
Token xsp; xsp = jj_scanpos; if (jj_3R_66()) { jj_scanpos = xsp; if (jj_3R_67()) { jj_scanpos = xsp; if (jj_3R_68()) { jj_scanpos = xsp; if (jj_3R_69()) { jj_scanpos = xsp; if (jj_3R_70()) return true;
if (jj_scan_token(OP_LE)) return true;
final private boolean jj_3R_59() { Token xsp; xsp = jj_scanpos; if (jj_3R_66()) { jj_scanpos = xsp; if (jj_3R_67()) { jj_scanpos = xsp; if (jj_3R_68()) { jj_scanpos = xsp; if (jj_3R_69()) { jj_scanpos = xsp; if (jj_3R_70()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
} else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
final private boolean jj_3R_59() { Token xsp; xsp = jj_scanpos; if (jj_3R_66()) { jj_scanpos = xsp; if (jj_3R_67()) { jj_scanpos = xsp; if (jj_3R_68()) { jj_scanpos = xsp; if (jj_3R_69()) { jj_scanpos = xsp; if (jj_3R_70()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(LBRACE)) return true;
if (jj_scan_token(OP_LT)) return true;
final private boolean jj_3R_60() { if (jj_scan_token(LBRACE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(RBRACE)) return true;
Token xsp; xsp = jj_scanpos; if (jj_3R_68()) { jj_scanpos = xsp; if (jj_3R_69()) { jj_scanpos = xsp; if (jj_3R_70()) { jj_scanpos = xsp; if (jj_3R_71()) { jj_scanpos = xsp; if (jj_3R_72()) return true;
final private boolean jj_3R_61() { if (jj_scan_token(RBRACE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
} else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
final private boolean jj_3R_61() { if (jj_scan_token(RBRACE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(POUND)) return true;
if (jj_scan_token(LBRACE)) return true;
final private boolean jj_3R_62() { if (jj_scan_token(POUND)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(DOLLAR)) return true;
if (jj_scan_token(RBRACE)) return true;
final private boolean jj_3R_63() { if (jj_scan_token(DOLLAR)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
Token xsp; xsp = jj_scanpos; if (jj_3R_71()) { jj_scanpos = xsp; if (jj_3R_72()) return true;
if (jj_scan_token(POUND)) return true;
final private boolean jj_3R_64() { Token xsp; xsp = jj_scanpos; if (jj_3R_71()) { jj_scanpos = xsp; if (jj_3R_72()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
} else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
final private boolean jj_3R_64() { Token xsp; xsp = jj_scanpos; if (jj_3R_71()) { jj_scanpos = xsp; if (jj_3R_72()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(LBRACKET)) return true;
if (jj_scan_token(DOLLAR)) return true;
final private boolean jj_3R_65() { if (jj_scan_token(LBRACKET)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(STUFF)) return true;
Token xsp; xsp = jj_scanpos; if (jj_3R_73()) { jj_scanpos = xsp; if (jj_3R_74()) return true;
final private boolean jj_3R_66() { if (jj_scan_token(STUFF)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e88c3a52c24e9e3115286b7b792ccb08ca7a24a/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java