bugged stringlengths 6 599k | fixed stringlengths 6 40.8M | __index_level_0__ int64 0 3.24M |
|---|---|---|
public IRubyObject capitalize_bang() { if (isEmpty()) { return getRuntime().getNil(); } StringBuffer buffer = new StringBuffer(getValue().toLowerCase()); char capital = buffer.charAt(0); if (Character.isLowerCase(capital)) { buffer.setCharAt(0, Character.toUpper... | public IRubyObject capitalize_bang() { if (isEmpty()) { return getRuntime().getNil(); } StringBuffer buffer = new StringBuffer(getValue().toLowerCase()); char capital = buffer.charAt(0); if (Character.isLowerCase(capital)) { buffer.setCharAt(0, Character.toUpper... | 3,230,429 |
public IRubyObject capitalize_bang() { if (isEmpty()) { return getRuntime().getNil(); } StringBuffer buffer = new StringBuffer(getValue().toLowerCase()); char capital = buffer.charAt(0); if (Character.isLowerCase(capital)) { buffer.setCharAt(0, Character.toUpper... | public IRubyObject capitalize_bang() { if (isEmpty()) { return getRuntime().getNil(); } StringBuffer buffer = new StringBuffer(getValue().toLowerCase()); char capital = buffer.charAt(0); if (Character.isLowerCase(capital)) { buffer.setCharAt(0, Character.toUpper... | 3,230,430 |
public IRubyObject casecmp(IRubyObject other) { RubyString thisLCString = getRuntime().newString(getValue().toLowerCase()); RubyString lcString = getRuntime().newString( stringValue(other).getValue().toLowerCase()); return ((StringMetaClass)thisLCString.getMetaClass()).op_cmp.call(getRuntime(), thisLCStri... | public IRubyObject casecmp(IRubyObject other) { RubyString thisLCString = getRuntime().newString(getValue().toLowerCase()); RubyString lcString = getRuntime().newString( stringValue(other).getValue().toLowerCase()); return ((StringMetaClass)thisLCString.getMetaClass()).op_cmp.call(getRuntime(), thisLCStri... | 3,230,431 |
public RubyString cat(String str) { setValue(getValue() + str); return this; } | public RubyString cat(String str) { setValue(getValue() + str); return this; } | 3,230,432 |
public IRubyObject center(IRubyObject arg) { int len = RubyNumeric.fix2int(arg); int strLen = getValue().length(); if (len <= strLen) { return dup(); } StringBuffer sbuf = new StringBuffer(len); int lead = (len - strLen) / 2; int pos = 0; while (pos < len) { if (pos == lead) { sbuf.append(getValue()); ... | public IRubyObject center(IRubyObject arg) { int len = RubyNumeric.fix2int(arg); int strLen = getValue().length(); if (len <= strLen) { return dup(); } StringBuffer sbuf = new StringBuffer(len); int lead = (len - strLen) / 2; int pos = 0; while (pos < len) { if (pos == lead) { sbuf.append(getValue()); ... | 3,230,433 |
public IRubyObject center(IRubyObject arg) { int len = RubyNumeric.fix2int(arg); int strLen = getValue().length(); if (len <= strLen) { return dup(); } StringBuffer sbuf = new StringBuffer(len); int lead = (len - strLen) / 2; int pos = 0; while (pos < len) { if (pos == lead) { sbuf.append(getValue()); ... | public IRubyObject center(IRubyObject arg) { int len = RubyNumeric.fix2int(arg); int strLen = getValue().length(); if (len <= strLen) { return dup(); } StringBuffer sbuf = new StringBuffer(len); int lead = (len - strLen) / 2; int pos = 0; while (pos < len) { if (pos == lead) { sbuf.append(getValue()); ... | 3,230,434 |
public IRubyObject chomp_bang(IRubyObject[] args) { if (isEmpty()) { return getRuntime().getNil(); } // Separator (a.k.a. $/) can be overriden by the -0 (zero) command line option String separator = (args.length == 0) ? getRuntime().getGlobalVariables().get("$/").... | public IRubyObject chomp_bang(IRubyObject[] args) { if (isEmpty()) { return getRuntime().getNil(); } // Separator (a.k.a. $/) can be overriden by the -0 (zero) command line option String separator = (args.length == 0) ? getRuntime().getGlobalVariables().get("$/").... | 3,230,436 |
public IRubyObject chomp_bang(IRubyObject[] args) { if (isEmpty()) { return getRuntime().getNil(); } // Separator (a.k.a. $/) can be overriden by the -0 (zero) command line option String separator = (args.length == 0) ? getRuntime().getGlobalVariables().get("$/").... | publicIRubyObjectchomp_bang(IRubyObject[]args){if(isEmpty()){returngetRuntime().getNil();}//Separator(a.k.a.$/)canbeoverridenbythe-0(zero)commandlineoptionStringseparator=(args.length==0)?getRuntime().getGlobalVariables().get("$/").asSymbol():args[0].asSymbol();if(separator.equals(DEFAULT_RS)){//Optimizedverycommoncas... | 3,230,437 |
public IRubyObject chomp_bang(IRubyObject[] args) { if (isEmpty()) { return getRuntime().getNil(); } // Separator (a.k.a. $/) can be overriden by the -0 (zero) command line option String separator = (args.length == 0) ? getRuntime().getGlobalVariables().get("$/").... | public IRubyObject chomp_bang(IRubyObject[] args) { if (isEmpty()) { return getRuntime().getNil(); } // Separator (a.k.a. $/) can be overriden by the -0 (zero) command line option String separator = (args.length == 0) ? getRuntime().getGlobalVariables().get("$/").... | 3,230,438 |
public IRubyObject chomp_bang(IRubyObject[] args) { if (isEmpty()) { return getRuntime().getNil(); } // Separator (a.k.a. $/) can be overriden by the -0 (zero) command line option String separator = (args.length == 0) ? getRuntime().getGlobalVariables().get("$/").... | public IRubyObject chomp_bang(IRubyObject[] args) { if (isEmpty()) { return getRuntime().getNil(); } // Separator (a.k.a. $/) can be overriden by the -0 (zero) command line option String separator = (args.length == 0) ? getRuntime().getGlobalVariables().get("$/").... | 3,230,439 |
public IRubyObject chomp_bang(IRubyObject[] args) { if (isEmpty()) { return getRuntime().getNil(); } // Separator (a.k.a. $/) can be overriden by the -0 (zero) command line option String separator = (args.length == 0) ? getRuntime().getGlobalVariables().get("$/").... | public IRubyObject chomp_bang(IRubyObject[] args) { if (isEmpty()) { return getRuntime().getNil(); } // Separator (a.k.a. $/) can be overriden by the -0 (zero) command line option String separator = (args.length == 0) ? getRuntime().getGlobalVariables().get("$/").... | 3,230,440 |
public IRubyObject chop() { String newStr = getChop(); if (newStr == null) { return dup(); } return newString(newStr); } | public IRubyObject chop() { String newStr = getChop(); if (newStr == null) { return dup(); } return newString(newStr); } | 3,230,441 |
public IRubyObject chop_bang() { String newStr = getChop(); if (newStr == null) { return getRuntime().getNil(); } setValue(newStr); return this; } | public IRubyObject chop_bang() { String newStr = getChop(); if (newStr == null) { return getRuntime().getNil(); } setValue(newStr); return this; } | 3,230,442 |
public int cmp(RubyString other) { int cmp = getValue().compareTo(other.getValue()); return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; } | public int cmp(RubyString other) { int cmp = getValue().compareTo(other.getValue()); return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; } | 3,230,443 |
public RubyString concat(IRubyObject other) { if ((other instanceof RubyFixnum) && ((RubyFixnum) other).getLongValue() < 256) { return cat("" + (char) ((RubyFixnum) other).getLongValue()); } return append(other); } | public RubyString concat(IRubyObject other) { if ((other instanceof RubyFixnum) && ((RubyFixnum) other).getLongValue() < 256) { return cat("" + (char) ((RubyFixnum) other).getLongValue()); } return append(other); } | 3,230,444 |
public IRubyObject count(IRubyObject[] args) { int argc = checkArgumentCount(args, 1, -1); String[] specs = new String[argc]; for (int i = 0; i < argc; i++) { specs[i] = stringValue(args[i]).getValue(); } String table = setupTable(specs); int count = 0; for (int j = 0; j < getValue().length(); j++) { if (ta... | public IRubyObject count(IRubyObject[] args) { int argc = checkArgumentCount(args, 1, -1); String[] specs = new String[argc]; for (int i = 0; i < argc; i++) { specs[i] = stringValue(args[i]).getValue(); } String table = setupTable(specs); int count = 0; for (int j = 0; j < getValue().length(); j++) { if (ta... | 3,230,445 |
public IRubyObject delete_bang(IRubyObject[] args) { String newStr = getDelete(args); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | public IRubyObject delete_bang(IRubyObject[] args) { String newStr = getDelete(args); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | 3,230,446 |
public IRubyObject delete_bang(IRubyObject[] args) { String newStr = getDelete(args); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | public IRubyObject delete_bang(IRubyObject[] args) { String newStr = getDelete(args); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | 3,230,447 |
public RubyString downcase() { return newString(getValue().toLowerCase()); } | public RubyString downcase() { return newString(getValue().toLowerCase()); } | 3,230,448 |
public IRubyObject downcase_bang() { String result = getValue().toLowerCase(); if (result.equals(getValue())) { return getRuntime().getNil(); } setValue(result); return this; } | public IRubyObject downcase_bang() { String result = getValue().toLowerCase(); if (result.equals(getValue())) { return getRuntime().getNil(); } setValue(result); return this; } | 3,230,449 |
public IRubyObject downcase_bang() { String result = getValue().toLowerCase(); if (result.equals(getValue())) { return getRuntime().getNil(); } setValue(result); return this; } | public IRubyObject downcase_bang() { String result = getValue().toLowerCase(); if (result.equals(getValue())) { return getRuntime().getNil(); } setValue(result); return this; } | 3,230,450 |
public IRubyObject dup() { return newString(getValue()).infectBy(this); } | public IRubyObject dup() { return newString(getValue()).infectBy(this); } | 3,230,451 |
public IRubyObject each_line(IRubyObject[] args) { int strLen = getValue().length(); if (strLen == 0) { return this; } String sep; if (checkArgumentCount(args, 0, 1) == 1) { sep = RubyRegexp.quote(stringValue(args[0]).getValue()); } else { sep = RubyRegexp.quote(getRuntime().getGlobalVariables().get("$/").... | public IRubyObject each_line(IRubyObject[] args) { int strLen = getValue().length(); if (strLen == 0) { return this; } String sep; if (checkArgumentCount(args, 0, 1) == 1) { sep = RubyRegexp.quote(stringValue(args[0]).getValue()); } else { sep = RubyRegexp.quote(getRuntime().getGlobalVariables().get("$/").... | 3,230,452 |
private static String expandTemplate(String spec, boolean invertOK) { int len = spec.length(); if (len <= 1) { return spec; } StringBuffer sbuf = new StringBuffer(); int pos = (invertOK && spec.startsWith("^")) ? 1 : 0; while (pos < len) { char c1 = spec.charAt(pos), c2; if (pos + 2 < len && spec.charAt(po... | private static String expandTemplate(String spec, boolean invertOK) { int len = spec.length(); if (len <= 1) { return spec; } StringBuffer sbuf = new StringBuffer(); int pos = (invertOK && spec.startsWith("^")) ? 1 : 0; while (pos < len) { char c1 = spec.charAt(pos), c2; if (pos + 2 < len && spec.charAt(po... | 3,230,453 |
private String getDelete(IRubyObject[] args) { int argc = checkArgumentCount(args, 1, -1); String[] specs = new String[argc]; for (int i = 0; i < argc; i++) { specs[i] = stringValue(args[i]).getValue(); } String table = setupTable(specs); int strLen = getValue().length(); StringBuffer sbuf = new StringBuffer(... | private String getDelete(IRubyObject[] args) { int argc = checkArgumentCount(args, 1, -1); String[] specs = new String[argc]; for (int i = 0; i < argc; i++) { specs[i] = stringValue(args[i]).getValue(); } String table = setupTable(specs); int strLen = getValue().length(); StringBuffer sbuf = new StringBuffer(... | 3,230,454 |
private String getSqueeze(IRubyObject[] args) { int argc = args.length; String[] specs = null; if (argc > 0) { specs = new String[argc]; for (int i = 0; i < argc; i++) { specs[i] = stringValue(args[i]).getValue(); } } String table = specs == null ? null : setupTable(specs); int strLen = getValue().lengt... | private String getSqueeze(IRubyObject[] args) { int argc = args.length; String[] specs = null; if (argc > 0) { specs = new String[argc]; for (int i = 0; i < argc; i++) { specs[i] = stringValue(args[i]).getValue(); } } String table = specs == null ? null : setupTable(specs); int strLen = getValue().lengt... | 3,230,455 |
private String getSqueeze(IRubyObject[] args) { int argc = args.length; String[] specs = null; if (argc > 0) { specs = new String[argc]; for (int i = 0; i < argc; i++) { specs[i] = stringValue(args[i]).getValue(); } } String table = specs == null ? null : setupTable(specs); int strLen = getValue().lengt... | private String getSqueeze(IRubyObject[] args) { int argc = args.length; String[] specs = null; if (argc > 0) { specs = new String[argc]; for (int i = 0; i < argc; i++) { specs[i] = stringValue(args[i]).getValue(); } } String table = specs == null ? null : setupTable(specs); int strLen = getValue().lengt... | 3,230,456 |
private String getSqueeze(IRubyObject[] args) { int argc = args.length; String[] specs = null; if (argc > 0) { specs = new String[argc]; for (int i = 0; i < argc; i++) { specs[i] = stringValue(args[i]).getValue(); } } String table = specs == null ? null : setupTable(specs); int strLen = getValue().lengt... | private String getSqueeze(IRubyObject[] args) { int argc = args.length; String[] specs = null; if (argc > 0) { specs = new String[argc]; for (int i = 0; i < argc; i++) { specs[i] = stringValue(args[i]).getValue(); } } String table = specs == null ? null : setupTable(specs); int strLen = getValue().lengt... | 3,230,457 |
public String getValue() { return value; } | public String getValue() { return value; } | 3,230,458 |
public RubyFixnum hash() { return getRuntime().newFixnum(getValue().hashCode()); } | public RubyFixnum hash() { return getRuntime().newFixnum(toString().hashCode()); } | 3,230,459 |
public RubyBoolean include(IRubyObject obj) { if (obj instanceof RubyFixnum) { char c = (char) RubyNumeric.fix2int(obj); return getRuntime().newBoolean(getValue().indexOf(c) != -1); } String str = stringValue(obj).getValue(); return getRuntime().newBoolean(getValue().indexOf(str) != -1); } | public RubyBoolean include(IRubyObject obj) { if (obj instanceof RubyFixnum) { char c = (char) RubyNumeric.fix2int(obj); return getRuntime().newBoolean(getValue().indexOf(c) != -1); } String str = stringValue(obj).getValue(); return getRuntime().newBoolean(getValue().indexOf(str) != -1); } | 3,230,460 |
public RubyBoolean include(IRubyObject obj) { if (obj instanceof RubyFixnum) { char c = (char) RubyNumeric.fix2int(obj); return getRuntime().newBoolean(getValue().indexOf(c) != -1); } String str = stringValue(obj).getValue(); return getRuntime().newBoolean(getValue().indexOf(str) != -1); } | public RubyBoolean include(IRubyObject obj) { if (obj instanceof RubyFixnum) { char c = (char) RubyNumeric.fix2int(obj); return getRuntime().newBoolean(getValue().indexOf(c) != -1); } String str = stringValue(obj).getValue(); return getRuntime().newBoolean(getValue().indexOf(str) != -1); } | 3,230,461 |
public RubySymbol intern() { return RubySymbol.newSymbol(getRuntime(), getValue()); } | public RubySymbol intern() { return RubySymbol.newSymbol(getRuntime(), getValue()); } | 3,230,462 |
public IRubyObject lstrip_bang() { RubyString newValue = (RubyString) lstrip(); if (newValue.getValue().equals(getValue())) { return getRuntime().getNil(); } setValue(newValue.getValue()); return this; } | public IRubyObject lstrip_bang() { RubyString newValue = (RubyString) lstrip(); if (newValue.getValue().equals(getValue())) { return getRuntime().getNil(); } setValue(newValue.getValue()); return this; } | 3,230,463 |
public void marshalTo(MarshalStream output) throws java.io.IOException { output.write('"'); output.dumpString(getValue()); } | public void marshalTo(MarshalStream output) throws java.io.IOException { output.write('"'); output.dumpString(getValue()); } | 3,230,464 |
public IRubyObject match3(IRubyObject pattern) { if (pattern instanceof RubyRegexp) { return ((RubyRegexp)pattern).search2(getValue()); } else if (pattern instanceof RubyString) { RubyRegexp regexp = RubyRegexp.newRegexp((RubyString) pattern, 0, null); return regexp.search2(getValue()); } return getRu... | public IRubyObject match3(IRubyObject pattern) { if (pattern instanceof RubyRegexp) { return ((RubyRegexp)pattern).search2(getValue()); } else if (pattern instanceof RubyString) { RubyRegexp regexp = RubyRegexp.newRegexp((RubyString) pattern, 0, null); return regexp.search2(getValue()); } return getRu... | 3,230,465 |
public IRubyObject match3(IRubyObject pattern) { if (pattern instanceof RubyRegexp) { return ((RubyRegexp)pattern).search2(getValue()); } else if (pattern instanceof RubyString) { RubyRegexp regexp = RubyRegexp.newRegexp((RubyString) pattern, 0, null); return regexp.search2(getValue()); } return getRu... | public IRubyObject match3(IRubyObject pattern) { if (pattern instanceof RubyRegexp) { return ((RubyRegexp)pattern).search2(getValue()); } else if (pattern instanceof RubyString) { RubyRegexp regexp = RubyRegexp.newRegexp((RubyString) pattern, 0, null); return regexp.search2(getValue()); } return getRu... | 3,230,466 |
public IRubyObject oct() { if (isEmpty()) { return getRuntime().newFixnum(0); } int base = 8; String str = getValue().trim(); int pos = (str.charAt(0) == '-' || str.charAt(0) == '+') ? 1 : 0; if (str.indexOf("0x") == pos || str.indexOf("0X") == pos) { base = 16; } else if (str.indexOf("0b") == pos || str.... | public IRubyObject oct() { if (isEmpty()) { return getRuntime().newFixnum(0); } int base = 8; String str = getValue().trim(); int pos = (str.charAt(0) == '-' || str.charAt(0) == '+') ? 1 : 0; if (str.indexOf("0x") == pos || str.indexOf("0X") == pos) { base = 16; } else if (str.indexOf("0b") == pos || str.... | 3,230,467 |
public RubyString replace(IRubyObject other) { RubyString str = stringValue(other); if (this == other || getValue().equals(str.getValue())) { return this; } setValue(str.getValue()); return (RubyString) infectBy(str); } | public RubyString replace(IRubyObject other) { RubyString str = stringValue(other); if (this == other || getValue().equals(str.getValue())) { return this; } setValue(str.getValue()); return (RubyString) infectBy(str); } | 3,230,468 |
public RubyString replace(IRubyObject other) { RubyString str = stringValue(other); if (this == other || getValue().equals(str.getValue())) { return this; } setValue(str.getValue()); return (RubyString) infectBy(str); } | public RubyString replace(IRubyObject other) { RubyString str = stringValue(other); if (this == other || getValue().equals(str.getValue())) { return this; } setValue(str.getValue()); return (RubyString) infectBy(str); } | 3,230,469 |
public RubyString reverse() { StringBuffer sb = new StringBuffer(getValue()); sb.reverse(); return newString(sb.toString()); } | public RubyString reverse() { StringBuffer sb = new StringBuffer(getValue()); sb.reverse(); return newString(sb.toString()); } | 3,230,470 |
public RubyString reverse_bang() { StringBuffer sb = new StringBuffer(getValue()); sb.reverse(); setValue(sb.toString()); return this; } | public RubyString reverse_bang() { StringBuffer sb = new StringBuffer(getValue()); sb.reverse(); setValue(sb.toString()); return this; } | 3,230,471 |
public IRubyObject rstrip_bang() { RubyString newValue = (RubyString) rstrip(); if (newValue.getValue().equals(getValue())) { return getRuntime().getNil(); } setValue(newValue.getValue()); return this; } | public IRubyObject rstrip_bang() { RubyString newValue = (RubyString) rstrip(); if (newValue.getValue().equals(getValue())) { return getRuntime().getNil(); } setValue(newValue.getValue()); return this; } | 3,230,472 |
public IRubyObject scan(IRubyObject arg) { RubyRegexp pat = RubyRegexp.regexpValue(arg); int start = 0; if (!getRuntime().getCurrentContext().isBlockGiven()) { RubyArray ary = getRuntime().newArray(); while (pat.search(this, start) != -1) { RubyMatchData md = (RubyMatchData) getRuntime().getCurrentContext().... | public IRubyObject scan(IRubyObject arg) { RubyRegexp pat = RubyRegexp.regexpValue(arg); int start = 0; if (!getRuntime().getCurrentContext().isBlockGiven()) { RubyArray ary = getRuntime().newArray(); while (pat.search(this, start) != -1) { RubyMatchData md = (RubyMatchData) getRuntime().getCurrentContext().... | 3,230,473 |
public IRubyObject scan(IRubyObject arg) { RubyRegexp pat = RubyRegexp.regexpValue(arg); int start = 0; if (!getRuntime().getCurrentContext().isBlockGiven()) { RubyArray ary = getRuntime().newArray(); while (pat.search(this, start) != -1) { RubyMatchData md = (RubyMatchData) getRuntime().getCurrentContext().... | public IRubyObject scan(IRubyObject arg) { RubyRegexp pat = RubyRegexp.regexpValue(arg); int start = 0; if (!getRuntime().getCurrentContext().isBlockGiven()) { RubyArray ary = getRuntime().newArray(); while (pat.search(this, start) != -1) { RubyMatchData md = (RubyMatchData) getRuntime().getCurrentContext().... | 3,230,474 |
public IRubyObject scan(IRubyObject arg) { RubyRegexp pat = RubyRegexp.regexpValue(arg); int start = 0; if (!getRuntime().getCurrentContext().isBlockGiven()) { RubyArray ary = getRuntime().newArray(); while (pat.search(this, start) != -1) { RubyMatchData md = (RubyMatchData) getRuntime().getCurrentContext().... | public IRubyObject scan(IRubyObject arg) { RubyRegexp pat = RubyRegexp.regexpValue(arg); int start = 0; if (!getRuntime().getCurrentContext().isBlockGiven()) { RubyArray ary = getRuntime().newArray(); while (pat.search(this, start) != -1) { RubyMatchData md = (RubyMatchData) getRuntime().getCurrentContext().... | 3,230,475 |
public IRubyObject scan(IRubyObject arg) { RubyRegexp pat = RubyRegexp.regexpValue(arg); int start = 0; if (!getRuntime().getCurrentContext().isBlockGiven()) { RubyArray ary = getRuntime().newArray(); while (pat.search(this, start) != -1) { RubyMatchData md = (RubyMatchData) getRuntime().getCurrentContext().... | public IRubyObject scan(IRubyObject arg) { RubyRegexp pat = RubyRegexp.regexpValue(arg); int start = 0; if (!getRuntime().getCurrentContext().isBlockGiven()) { RubyArray ary = getRuntime().newArray(); while (pat.search(this, start) != -1) { RubyMatchData md = (RubyMatchData) getRuntime().getCurrentContext().... | 3,230,476 |
public IRubyObject scan(IRubyObject arg) { RubyRegexp pat = RubyRegexp.regexpValue(arg); int start = 0; if (!getRuntime().getCurrentContext().isBlockGiven()) { RubyArray ary = getRuntime().newArray(); while (pat.search(this, start) != -1) { RubyMatchData md = (RubyMatchData) getRuntime().getCurrentContext().... | public IRubyObject scan(IRubyObject arg) { RubyRegexp pat = RubyRegexp.regexpValue(arg); int start = 0; if (!getRuntime().getCurrentContext().isBlockGiven()) { RubyArray ary = getRuntime().newArray(); while (pat.search(this, start) != -1) { RubyMatchData md = (RubyMatchData) getRuntime().getCurrentContext().... | 3,230,477 |
public void setValue(String value) { this.value = value; } | public void setValue(String value) { this.value = value; } | 3,230,478 |
private String setupTable(String[] specs) { int[] table = new int[256]; int numSets = 0; for (int i = 0; i < specs.length; i++) { String template = expandTemplate(specs[i], true); boolean invert = specs[i].length() > 1 && specs[i].startsWith("^"); for (int j = 0; j < 256; j++) { if (template.indexOf(j) != ... | private String setupTable(String[] specs) { int[] table = new int[256]; int numSets = 0; for (int i = 0; i < specs.length; i++) { String template = expandTemplate(specs[i], true); boolean invert = specs[i].length() > 1 && specs[i].startsWith("^"); for (int j = 0; j < 256; j++) { if (template.indexOf(j) != ... | 3,230,479 |
public RubyArray split(IRubyObject[] args) { return new Split(getRuntime(), this.getValue(), args).results(); } | public RubyArray split(IRubyObject[] args) { return new Split(getRuntime(), this.getValue(), args).results(); } | 3,230,480 |
public IRubyObject squeeze(IRubyObject[] args) { return newString(getSqueeze(args)).infectBy(this); } | public IRubyObject squeeze(IRubyObject[] args) { return newString(getSqueeze(args)).infectBy(this); } | 3,230,481 |
public IRubyObject squeeze_bang(IRubyObject[] args) { String newStr = getSqueeze(args); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | public IRubyObject squeeze_bang(IRubyObject[] args) { String newStr = getSqueeze(args); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | 3,230,482 |
public IRubyObject strip() { if (isEmpty()) { return dup(); } return newString(getValue().trim()); } | public IRubyObject strip() { if (isEmpty()) { return dup(); } return newString(getValue().trim()); } | 3,230,483 |
public IRubyObject strip_bang() { if (isEmpty()) { return getRuntime().getNil(); } String newStr = getValue().trim(); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | public IRubyObject strip_bang() { if (isEmpty()) { return getRuntime().getNil(); } String newStr = getValue().trim(); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | 3,230,484 |
public IRubyObject strip_bang() { if (isEmpty()) { return getRuntime().getNil(); } String newStr = getValue().trim(); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | public IRubyObject strip_bang() { if (isEmpty()) { return getRuntime().getNil(); } String newStr = getValue().trim(); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | 3,230,485 |
private IRubyObject substr(int beg, int len) { int strLen = getValue().length(); if (len < 0 || beg > strLen) { return getRuntime().getNil(); } if (beg < 0) { beg += strLen; if (beg < 0) { return getRuntime().getNil(); } } int end = Math.min(strLen, beg + len); return newString(getValue().substring(b... | private IRubyObject substr(int beg, int len) { int strLen = getValue().length(); if (len < 0 || beg > strLen) { return getRuntime().getNil(); } if (beg < 0) { beg += strLen; if (beg < 0) { return getRuntime().getNil(); } } int end = Math.min(strLen, beg + len); return newString(getValue().substring(b... | 3,230,486 |
private IRubyObject substr(int beg, int len) { int strLen = getValue().length(); if (len < 0 || beg > strLen) { return getRuntime().getNil(); } if (beg < 0) { beg += strLen; if (beg < 0) { return getRuntime().getNil(); } } int end = Math.min(strLen, beg + len); return newString(getValue().substring(b... | private IRubyObject substr(int beg, int len) { int strLen = getValue().length(); if (len < 0 || beg > strLen) { return getRuntime().getNil(); } if (beg < 0) { beg += strLen; if (beg < 0) { return getRuntime().getNil(); } } int end = Math.min(strLen, beg + len); return newString(getValue().substring(b... | 3,230,487 |
private IRubyObject substr(int beg, int len) { int strLen = getValue().length(); if (len < 0 || beg > strLen) { return getRuntime().getNil(); } if (beg < 0) { beg += strLen; if (beg < 0) { return getRuntime().getNil(); } } int end = Math.min(strLen, beg + len); return newString(getValue().substring(b... | private IRubyObject substr(int beg, int len) { int strLen = getValue().length(); if (len < 0 || beg > strLen) { return getRuntime().getNil(); } if (beg < 0) { beg += strLen; if (beg < 0) { return getRuntime().getNil(); } } int end = Math.min(strLen, beg + len); return newString(getValue().substring(b... | 3,230,488 |
public IRubyObject succ() { return succ(false); } | public IRubyObject succ() { return succ(false); } | 3,230,489 |
public IRubyObject succ_bang() { return succ(true); } | public IRubyObject succ_bang() { return succ(true); } | 3,230,490 |
public RubyInteger sum(IRubyObject[] args) { long bitSize = 16; if (args.length > 0) { bitSize = ((RubyInteger) args[0].convertType(RubyInteger.class, "Integer", "to_i")).getLongValue(); } int result = 0; char[] characters = getValue().toCharArray(); ... | public RubyInteger sum(IRubyObject[] args) { long bitSize = 16; if (args.length > 0) { bitSize = ((RubyInteger) args[0].convertType(RubyInteger.class, "Integer", "to_i")).getLongValue(); } int result = 0; char[] characters = toString().toCharArray(); ... | 3,230,491 |
public RubyString swapcase() { RubyString newString = newString(getValue()); IRubyObject swappedString = newString.swapcase_bang(); return (RubyString) (swappedString.isNil() ? newString : swappedString); } | public RubyString swapcase() { RubyString newString = newString(getValue()); IRubyObject swappedString = newString.swapcase_bang(); return (RubyString) (swappedString.isNil() ? newString : swappedString); } | 3,230,492 |
public IRubyObject swapcase_bang() { char[] chars = getValue().toCharArray(); StringBuffer sb = new StringBuffer(chars.length); boolean changesMade = false; for (int i = 0; i < chars.length; i++) { if (!Character.isLetter(chars[i])) { sb.append(chars[i]); } else if (Character.isLowerCase(chars[i])) { ... | public IRubyObject swapcase_bang() { char[] chars = getValue().toCharArray(); StringBuffer sb = new StringBuffer(chars.length); boolean changesMade = false; for (int i = 0; i < chars.length; i++) { if (!Character.isLetter(chars[i])) { sb.append(chars[i]); } else if (Character.isLowerCase(chars[i])) { ... | 3,230,493 |
public IRubyObject swapcase_bang() { char[] chars = getValue().toCharArray(); StringBuffer sb = new StringBuffer(chars.length); boolean changesMade = false; for (int i = 0; i < chars.length; i++) { if (!Character.isLetter(chars[i])) { sb.append(chars[i]); } else if (Character.isLowerCase(chars[i])) { ... | public IRubyObject swapcase_bang() { char[] chars = getValue().toCharArray(); StringBuffer sb = new StringBuffer(chars.length); boolean changesMade = false; for (int i = 0; i < chars.length; i++) { if (!Character.isLetter(chars[i])) { sb.append(chars[i]); } else if (Character.isLowerCase(chars[i])) { ... | 3,230,494 |
public IRubyObject swapcase_bang() { char[] chars = getValue().toCharArray(); StringBuffer sb = new StringBuffer(chars.length); boolean changesMade = false; for (int i = 0; i < chars.length; i++) { if (!Character.isLetter(chars[i])) { sb.append(chars[i]); } else if (Character.isLowerCase(chars[i])) { ... | public IRubyObject swapcase_bang() { char[] chars = getValue().toCharArray(); StringBuffer sb = new StringBuffer(chars.length); boolean changesMade = false; for (int i = 0; i < chars.length; i++) { if (!Character.isLetter(chars[i])) { sb.append(chars[i]); } else if (Character.isLowerCase(chars[i])) { ... | 3,230,495 |
public byte[] toByteArray() { return stringToBytes(getValue()); } | public byte[] toByteArray() { return stringToBytes(getValue()); } | 3,230,496 |
public String toString() { return getValue(); } | public String toString() { return getValue(); } | 3,230,497 |
public RubySymbol to_sym() { return RubySymbol.newSymbol(getRuntime(), getValue()); } | public RubySymbol to_sym() { return RubySymbol.newSymbol(getRuntime(), getValue()); } | 3,230,498 |
private String tr(IRubyObject search, IRubyObject replace, boolean squeeze) { String srchSpec = search.convertToString().getValue(); String srch = expandTemplate(srchSpec, true); if (srchSpec.startsWith("^")) { StringBuffer sbuf = new StringBuffer(256); for (int i = 0; i < 256; i++) { char c = (char) i; i... | private String tr(IRubyObject search, IRubyObject replace, boolean squeeze) { String srchSpec = search.convertToString().getValue(); String srch = expandTemplate(srchSpec, true); if (srchSpec.startsWith("^")) { StringBuffer sbuf = new StringBuffer(256); for (int i = 0; i < 256; i++) { char c = (char) i; i... | 3,230,499 |
private String tr(IRubyObject search, IRubyObject replace, boolean squeeze) { String srchSpec = search.convertToString().getValue(); String srch = expandTemplate(srchSpec, true); if (srchSpec.startsWith("^")) { StringBuffer sbuf = new StringBuffer(256); for (int i = 0; i < 256; i++) { char c = (char) i; i... | private String tr(IRubyObject search, IRubyObject replace, boolean squeeze) { String srchSpec = search.convertToString().getValue(); String srch = expandTemplate(srchSpec, true); if (srchSpec.startsWith("^")) { StringBuffer sbuf = new StringBuffer(256); for (int i = 0; i < 256; i++) { char c = (char) i; i... | 3,230,500 |
private String tr(IRubyObject search, IRubyObject replace, boolean squeeze) { String srchSpec = search.convertToString().getValue(); String srch = expandTemplate(srchSpec, true); if (srchSpec.startsWith("^")) { StringBuffer sbuf = new StringBuffer(256); for (int i = 0; i < 256; i++) { char c = (char) i; i... | private String tr(IRubyObject search, IRubyObject replace, boolean squeeze) { String srchSpec = search.convertToString().getValue(); String srch = expandTemplate(srchSpec, true); if (srchSpec.startsWith("^")) { StringBuffer sbuf = new StringBuffer(256); for (int i = 0; i < 256; i++) { char c = (char) i; i... | 3,230,501 |
public IRubyObject tr_bang(IRubyObject search, IRubyObject replace) { String newStr = tr(search, replace, false); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | public IRubyObject tr_bang(IRubyObject search, IRubyObject replace) { String newStr = tr(search, replace, false); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | 3,230,502 |
public IRubyObject tr_bang(IRubyObject search, IRubyObject replace) { String newStr = tr(search, replace, false); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | public IRubyObject tr_bang(IRubyObject search, IRubyObject replace) { String newStr = tr(search, replace, false); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | 3,230,503 |
public IRubyObject tr_s_bang(IRubyObject search, IRubyObject replace) { String newStr = tr(search, replace, true); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | public IRubyObject tr_s_bang(IRubyObject search, IRubyObject replace) { String newStr = tr(search, replace, true); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | 3,230,504 |
public IRubyObject tr_s_bang(IRubyObject search, IRubyObject replace) { String newStr = tr(search, replace, true); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | public IRubyObject tr_s_bang(IRubyObject search, IRubyObject replace) { String newStr = tr(search, replace, true); if (newStr.equals(getValue())) { return getRuntime().getNil(); } setValue(newStr); return this; } | 3,230,505 |
public RubyArray unpack(IRubyObject obj) { return Pack.unpack(this.getValue(), stringValue(obj)); } | public RubyArray unpack(IRubyObject obj) { return Pack.unpack(this.toString(), stringValue(obj)); } | 3,230,506 |
public RubyString upcase() { return newString(getValue().toUpperCase()); } | public RubyString upcase() { return newString(getValue().toUpperCase()); } | 3,230,507 |
public IRubyObject upcase_bang() { String result = getValue().toUpperCase(); if (result.equals(getValue())) { return getRuntime().getNil(); } setValue(result); return this; } | public IRubyObject upcase_bang() { String result = getValue().toUpperCase(); if (result.equals(getValue())) { return getRuntime().getNil(); } setValue(result); return this; } | 3,230,508 |
public IRubyObject upcase_bang() { String result = getValue().toUpperCase(); if (result.equals(getValue())) { return getRuntime().getNil(); } setValue(result); return this; } | public IRubyObject upcase_bang() { String result = getValue().toUpperCase(); if (result.equals(getValue())) { return getRuntime().getNil(); } setValue(result); return this; } | 3,230,509 |
public static void initOperatorTable(Ruby ruby) { ruby.setOperatorTable(new RubyOperatorEntry[] { new RubyOperatorEntry(ruby, Token.tDOT2, ".."), new RubyOperatorEntry(ruby, Token.tDOT3, "..."), new RubyOperatorEntry(ruby, '+', "+"), new RubyOperat... | public static void initOperatorTable(Ruby ruby) { ruby.setOperatorTable(new RubyOperatorEntry[] { new RubyOperatorEntry(ruby, Token.tDOT2, ".."), new RubyOperatorEntry(ruby, Token.tDOT3, "..."), new RubyOperatorEntry(ruby, '+', "+"), new RubyOperat... | 3,230,510 |
public void testThreeDigitOctal() { verifyTranslation("\\0177", "\\177",false); verifyTranslation("\\0277", "\\277",false); verifyTranslation("\\0377", "\\377",false); verifyTranslation("\\477", "\\477",false); } | public void testThreeDigitOctal() { verifyTranslation("\\0177", "\\177",false); verifyTranslation("\\0277", "\\277",false); verifyTranslation("\\0377", "\\377",false); verifyTranslation("\\477", "\\477",false); } | 3,230,511 |
String translatePattern(String regex, boolean commentsAllowed) { regex = COMMENT_PATTERN.matcher(regex).replaceAll(""); regex = HEX_SINGLE_DIGIT_PATTERN.matcher(regex).replaceAll("\\\\"+"x0$1"); regex = OCTAL_THREE_DIGIT_PATTERN.matcher(regex).replaceAll("\\\\"+"0$1"); regex = OCTAL_MISSING_ZERO_PATTERN.matcher(re... | String translatePattern(String regex, boolean commentsAllowed) { regex = COMMENT_PATTERN.matcher(regex).replaceAll(""); regex = HEX_SINGLE_DIGIT_PATTERN.matcher(regex).replaceAll("\\\\"+"x0$1"); regex = OCTAL_THREE_DIGIT_PATTERN.matcher(regex).replaceAll("\\\\"+"0$1"); regex = OCTAL_MISSING_ZERO_PATTERN.matcher(re... | 3,230,512 |
public final Object getProperty(final Object[] names) throws PropertyException, ContextException { if (_bean == null) { Object ret = getLocal(names); if (ret == null) { ret = getTool(names); } return ret; } else { return PropertyOperator.getPropert... | public final Object getProperty(final Object[] names) throws PropertyException, ContextException { if (_bean == null) { Object ret = getLocal(names); if (ret == null) { ret = getTool(names); } return ret; } else { return PropertyOperator.getPropert... | 3,230,513 |
public final Object getProperty(final Object[] names) throws PropertyException, ContextException { if (_bean == null) { Object ret = getLocal(names); if (ret == null) { ret = getTool(names); } return ret; } else { return PropertyOperator.getPropert... | public final Object getProperty(final Object[] names) throws PropertyException, ContextException { if (_bean == null) { Object ret = getLocal(names); if (ret == null) { ret = getTool(names); } return ret; } else { ret = PropertyOperator.getPropert... | 3,230,514 |
public void stateChanged(ChangeEvent e) { if (e.getSource() instanceof JTabbedPane) { JTabbedPane tab = (JTabbedPane) e.getSource(); Component c = tab.getSelectedComponent(); int index = tab.getSelectedIndex(); if (c instanceof DOInfo) { DOInfo in... | public void stateChanged(ChangeEvent e) { if (e.getSource() instanceof JTabbedPane) { JTabbedPane tab = (JTabbedPane) e.getSource(); Component c = tab.getSelectedComponent(); int index = tab.getSelectedIndex(); if (c instanceof DOInfo) { DOInfo in... | 3,230,516 |
public void stateChanged(ChangeEvent e) { if (e.getSource() instanceof JTabbedPane) { JTabbedPane tab = (JTabbedPane) e.getSource(); Component c = tab.getSelectedComponent(); int index = tab.getSelectedIndex(); if (c instanceof DOInfo) { DOInfo in... | public void stateChanged(ChangeEvent e) { if (e.getSource() instanceof JTabbedPane) { JTabbedPane tab = (JTabbedPane) e.getSource(); Component c = tab.getSelectedComponent(); int index = tab.getSelectedIndex(); if (c instanceof DOInfo) { DOInfo in... | 3,230,517 |
public void stateChanged(ChangeEvent e) { if (e.getSource() instanceof JTabbedPane) { JTabbedPane tab = (JTabbedPane) e.getSource(); Component c = tab.getSelectedComponent(); int index = tab.getSelectedIndex(); if (c instanceof DOInfo) { DOInfo in... | public void stateChanged(ChangeEvent e) { if (e.getSource() instanceof JTabbedPane) { JTabbedPane tab = (JTabbedPane) e.getSource(); Component c = tab.getSelectedComponent(); int index = tab.getSelectedIndex(); if (c instanceof DOInfo) { DOInfo in... | 3,230,518 |
public String toString(){ return "AnalysisChain"+(analysisChainId==null ? ":Hash"+this.hashCode() : ":"+analysisChainId); } | public String toString(){ return "AnalysisChain"+(analysisChainId==null ? ":Hash_"+this.hashCode() : ":Id_"+analysisChainId); } | 3,230,519 |
public RubyObject funcall(RubyId mid, RubyObject[] args) { return getRubyClass().call(this, mid, args, 1); } | public RubyObject funcall(RubyId mid, RubyObject[] args) { return funcall(mid, new RubyPointer(args)); } | 3,230,520 |
public RubyObject funcall3(RubyId mid, RubyObject[] args) { return getRubyClass().call(this, mid, args, 0); } | public RubyObject funcall3(RubyId mid, RubyPointer args) { return getRubyClass().call(this, mid, args, 0); } | 3,230,521 |
private void makeProperLink(GraphLayoutNode node,LayoutLink link,int i, HashSet newLinks) { // we know node is at i. GraphLayoutNode to = (GraphLayoutNode) link.getToNode(); //System.err.println("..link to "+to.getName()); int toLayer = to.getLayer(); if (toLayer == (i-1)) { // layer is correct newLinks.ad... | privateSystem.err.println("..link to "+to.getName()); voidSystem.err.println("..link to "+to.getName()); makeProperLink(GraphLayoutNodeSystem.err.println("..link to "+to.getName()); node,LayoutLinkSystem.err.println("..link to "+to.getName()); link,intSystem.err.println("..link to "+to.getName()); i, HashSetSystem.er... | 3,230,522 |
private void makeProperLink(GraphLayoutNode node,LayoutLink link,int i, HashSet newLinks) { // we know node is at i. GraphLayoutNode to = (GraphLayoutNode) link.getToNode(); //System.err.println("..link to "+to.getName()); int toLayer = to.getLayer(); if (toLayer == (i-1)) { // layer is correct newLinks.ad... | private void makeProperLink(GraphLayoutNode node,LayoutLink link,int i, HashSet newLinks) { // we know node is at i. GraphLayoutNode to = (GraphLayoutNode) link.getToNode(); //System.err.println("..link to "+to.getName()); int toLayer = to.getLayer(); if (toLayer == (i-1)) { // layer is correct newLinks.ad... | 3,230,523 |
private void makeProperLink(GraphLayoutNode node,LayoutLink link,int i, HashSet newLinks) { // we know node is at i. GraphLayoutNode to = (GraphLayoutNode) link.getToNode(); //System.err.println("..link to "+to.getName()); int toLayer = to.getLayer(); if (toLayer == (i-1)) { // layer is correct newLinks.ad... | private void makeProperLink(GraphLayoutNode node,LayoutLink link,int i, HashSet newLinks) { // we know node is at i. GraphLayoutNode to = (GraphLayoutNode) link.getToNode(); //System.err.println("..link to "+to.getName()); int toLayer = to.getLayer(); if (toLayer == (i-1)) { // layer is correct newLinks.ad... | 3,230,524 |
private void makeProperLink(GraphLayoutNode node,LayoutLink link,int i, HashSet newLinks) { // we know node is at i. GraphLayoutNode to = (GraphLayoutNode) link.getToNode(); //System.err.println("..link to "+to.getName()); int toLayer = to.getLayer(); if (toLayer == (i-1)) { // layer is correct newLinks.ad... | private void makeProperLink(GraphLayoutNode node,LayoutLink link,int i, HashSet newLinks) { // we know node is at i. GraphLayoutNode to = (GraphLayoutNode) link.getToNode(); //System.err.println("..link to "+to.getName()); int toLayer = to.getLayer(); if (toLayer == (i-1)) { // layer is correct newLinks.ad... | 3,230,525 |
private void makeProperLink(GraphLayoutNode node,LayoutLink link,int i, HashSet newLinks) { // we know node is at i. GraphLayoutNode to = (GraphLayoutNode) link.getToNode(); //System.err.println("..link to "+to.getName()); int toLayer = to.getLayer(); if (toLayer == (i-1)) { // layer is correct newLinks.ad... | private void makeProperLink(GraphLayoutNode node,LayoutLink link,int i, HashSet newLinks) { // we know node is at i. GraphLayoutNode to = (GraphLayoutNode) link.getToNode(); //System.err.println("..link to "+to.getName()); int toLayer = to.getLayer(); if (toLayer == (i-1)) { // layer is correct newLinks.ad... | 3,230,526 |
private void makeProperLink(GraphLayoutNode node,LayoutLink link,int i, HashSet newLinks) { // we know node is at i. GraphLayoutNode to = (GraphLayoutNode) link.getToNode(); //System.err.println("..link to "+to.getName()); int toLayer = to.getLayer(); if (toLayer == (i-1)) { // layer is correct newLinks.ad... | private void makeProperLink(GraphLayoutNode node,LayoutLink link,int i, HashSet newLinks) { // we know node is at i. GraphLayoutNode to = (GraphLayoutNode) link.getToNode(); //System.err.println("..link to "+to.getName()); int toLayer = to.getLayer(); if (toLayer == (i-1)) { // layer is correct newLinks.ad... | 3,230,527 |
public void write(Writer out, Context context) throws InvalidContextException, IOException { // now clobber values outside the loop: // Map listMap = new HashMap(); // listMap.include(context); Object list = _list; if (_macro) { while (list instanceof Macro) { list... | public void write(Writer out, Context context) throws InvalidContextException, IOException { // now clobber values outside the loop: // Map listMap = new HashMap(); // listMap.include(context); Object list = _list; if (_macro) { while (list instanceof Macro) { list... | 3,230,528 |
public String toString(){ return "Experimenter"+(attributeId==null ? ":Hash"+this.hashCode() : ":"+attributeId); } | public String toString(){ return "Experimenter"+(attributeId==null ? ":Hash_"+this.hashCode() : ":Id_"+attributeId); } | 3,230,529 |
public static RubyClass createNilClass(Ruby ruby) { RubyClass nilClass = ruby.defineClass("NilClass", ruby.getClasses().getObjectClass()); nilClass.defineMethod("type", CallbackFactory.getSingletonMethod(RubyNil.class, "type")); nilClass.defineMethod("to_i", CallbackFactory.getSingleton... | public static RubyClass createNilClass(Ruby ruby) { RubyClass nilClass = ruby.defineClass("NilClass", ruby.getClasses().getObjectClass()); nilClass.defineMethod("type", CallbackFactory.getSingletonMethod(RubyNil.class, "type")); nilClass.defineMethod("to_i", CallbackFactory.getSingleton... | 3,230,530 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.