rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
public TreeContextMenuController(DisplayedDocument displayedDocument) { super(displayedDocument); | public TreeContextMenuController(NoteTree tree) { this.tree = tree; | public TreeContextMenuController(DisplayedDocument displayedDocument) { super(displayedDocument); } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/57d4036eb7167d2d27117abe1f0280376377dbaa/TreeContextMenuController.java/buggy/trunk/src/de/berlios/koalanotes/controllers/TreeContextMenuController.java |
String className = getClass().getCanonicalName(); if (!methodDescriptor.startsWith(className)) return null; int separator = className.length(); | String controllerSignature = getControllerSignature(); if (!methodDescriptor.startsWith(controllerSignature)) return null; int separator = controllerSignature.length(); | protected Method getMethod(String methodDescriptor) { String className = getClass().getCanonicalName(); if (!methodDescriptor.startsWith(className)) return null; int separator = className.length(); try { return getClass().getMethod(methodDescriptor.substring(separator + 1), METHOD_ARGS); } catch (NoSuchMethodException ex) { return null; } } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/57d4036eb7167d2d27117abe1f0280376377dbaa/Controller.java/buggy/trunk/src/de/berlios/koalanotes/controllers/Controller.java |
fileClass = RubyFile.createFileClass(ruby); | public void initCoreClasses() { RubyClass metaClass; objectClass = defineBootClass("Object", null); moduleClass = defineBootClass("Module", objectClass); classClass = defineBootClass("Class", moduleClass); metaClass = classClass.newSingletonClass(); objectClass.setRubyClass(metaClass); metaClass.attachSingletonClass(objectClass); metaClass = metaClass.newSingletonClass(); moduleClass.setRubyClass(metaClass); metaClass.attachSingletonClass(moduleClass); metaClass = metaClass.newSingletonClass(); classClass.setRubyClass(metaClass); metaClass.attachSingletonClass(classClass); kernelModule = ruby.defineModule("Kernel"); objectClass.includeModule(kernelModule); objectClass.definePrivateMethod("initialize", CallbackFactory.getNilMethod()); classClass.definePrivateMethod("inherited", CallbackFactory.getNilMethod()); RubyObject.createObjectClass(kernelModule); RubyKernel.createKernelModule(ruby); RubyClass.createClassClass(classClass); RubyModule.createModuleClass(moduleClass); symbolClass = RubySymbol.createSymbolClass(ruby); nilClass = RubyNil.createNilClass(ruby); falseClass = RubyBoolean.createFalseClass(ruby); trueClass = RubyBoolean.createTrueClass(ruby); comparableModule = RubyComparable.createComparable(ruby); enumerableModule = RubyEnumerable.createEnumerableModule(ruby); numericClass = RubyNumeric.createNumericClass(ruby); integerClass = RubyInteger.createIntegerClass(ruby); fixnumClass = RubyFixnum.createFixnumClass(ruby); bignumClass = RubyBignum.createBignumClass(ruby); floatClass = RubyFloat.createFloatClass(ruby); stringClass = RubyString.createStringClass(ruby); regExpClass = RubyRegexp.createRegexpClass(ruby); matchDataClass = RubyMatchData.createMatchDataClass(ruby); arrayClass = RubyArray.createArrayClass(ruby); hashClass = RubyHash.createHashClass(ruby); rangeClass = RubyRange.createRangeClass(ruby); javaModule = RubyJava.createJavaModule(ruby); javaObjectClass = RubyJavaObject.createJavaObjectClass(ruby); javaInterfaceClass = RubyJavaInterface.createJavaInterfaceClass(ruby); ioClass = RubyIO.createIOClass(ruby); exceptionClass = RubyException.createExceptionClass(ruby); methodClass = RubyMethod.createMethodClass(ruby); procClass = RubyProc.createProcClass(ruby); objectSpaceModule = RubyObjectSpace.createObjectSpaceModule(ruby); mathModule = RubyMath.createMathModule(ruby); timeClass = RubyTime.createTimeClass(ruby); RubyGlobal.createGlobals(ruby); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/56a7977143634286f5c14d96df0538899b2fcb1f/RubyClasses.java/buggy/org/jruby/RubyClasses.java |
|
public static Callback getNilMethod() { | public static Callback getNilMethod(final int arity) { | public static Callback getNilMethod() { return new Callback() { public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { return ruby.getNil(); } }; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/CallbackFactory.java/buggy/org/jruby/runtime/CallbackFactory.java |
public int getArity() { return arity; } | public static Callback getNilMethod() { return new Callback() { public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { return ruby.getNil(); } }; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/CallbackFactory.java/buggy/org/jruby/runtime/CallbackFactory.java |
|
symbolClass.defineMethod("id", CallbackFactory.getMethod(RubySymbol.class, "id")); | public static RubyClass createSymbolClass(Ruby ruby) { RubyClass symbolClass = ruby.defineClass("Symbol", ruby.getClasses().getObjectClass()); symbolClass.getRubyClass().undefMethod("new"); symbolClass.defineMethod("to_i", CallbackFactory.getMethod(RubySymbol.class, "to_i")); symbolClass.defineMethod("to_int", CallbackFactory.getMethod(RubySymbol.class, "to_i")); symbolClass.defineMethod("id2name", CallbackFactory.getMethod(RubySymbol.class, "to_s")); symbolClass.defineMethod("to_s", CallbackFactory.getMethod(RubySymbol.class, "to_s")); symbolClass.defineMethod("==", CallbackFactory.getMethod(RubySymbol.class, "equal", RubyObject.class)); symbolClass.defineMethod("inspect", CallbackFactory.getMethod(RubySymbol.class, "inspect")); symbolClass.defineMethod("hash", CallbackFactory.getMethod(RubySymbol.class, "hash")); symbolClass.defineMethod("dup", CallbackFactory.getMethod(RubySymbol.class, "rbClone")); symbolClass.defineMethod("clone", CallbackFactory.getMethod(RubySymbol.class, "rbClone")); symbolClass.defineMethod("freeze", CallbackFactory.getSelfMethod()); symbolClass.defineMethod("taint", CallbackFactory.getSelfMethod()); return symbolClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0d05f52f4b20deb7938755dd220bb81c2c2b208e/RubySymbol.java/buggy/org/jruby/RubySymbol.java |
|
nilClass.defineMethod("to_f", callbackFactory.getSingletonMethod(RubyNil.class, "to_f")); | public static RubyClass createNilClass(Ruby runtime) { RubyClass nilClass = runtime.defineClass("NilClass", runtime.getClasses().getObjectClass()); CallbackFactory callbackFactory = runtime.callbackFactory(); nilClass.defineMethod("type", callbackFactory.getSingletonMethod(RubyNil.class, "type")); nilClass.defineMethod("to_i", callbackFactory.getSingletonMethod(RubyNil.class, "to_i")); nilClass.defineMethod("to_s", callbackFactory.getSingletonMethod(RubyNil.class, "to_s")); nilClass.defineMethod("to_a", callbackFactory.getSingletonMethod(RubyNil.class, "to_a")); nilClass.defineMethod("inspect", callbackFactory.getSingletonMethod(RubyNil.class, "inspect")); nilClass.defineMethod("&", callbackFactory.getSingletonMethod(RubyNil.class, "op_and", IRubyObject.class)); nilClass.defineMethod("|", callbackFactory.getSingletonMethod(RubyNil.class, "op_or", IRubyObject.class)); nilClass.defineMethod("^", callbackFactory.getSingletonMethod(RubyNil.class, "op_xor", IRubyObject.class)); nilClass.defineMethod("nil?", callbackFactory.getTrueMethod(0)); nilClass.defineMethod("id", callbackFactory.getSingletonMethod(RubyNil.class, "id")); nilClass.defineMethod("taint", callbackFactory.getSelfMethod(0)); nilClass.defineMethod("freeze", callbackFactory.getSelfMethod(0)); nilClass.getMetaClass().undefineMethod("new"); runtime.defineGlobalConstant("NIL", runtime.getNil()); return nilClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/39c53cd7958c3b95ef4124a65a62d1e1cac24c84/RubyNil.java/buggy/src/org/jruby/RubyNil.java |
|
comparableModule.defineMethod( "==", CallbackFactory.getSingletonMethod(RubyComparable.class, "equal", RubyObject.class)); | comparableModule.defineMethod("==", CallbackFactory.getSingletonMethod(RubyComparable.class, "equal", RubyObject.class)); | public static RubyModule createComparable(Ruby ruby) { RubyModule comparableModule = ruby.defineModule("Comparable"); comparableModule.defineMethod( "==", CallbackFactory.getSingletonMethod(RubyComparable.class, "equal", RubyObject.class)); comparableModule.defineMethod(">", CallbackFactory.getSingletonMethod(RubyComparable.class, "op_gt", RubyObject.class)); comparableModule.defineMethod( ">=", CallbackFactory.getSingletonMethod(RubyComparable.class, "op_ge", RubyObject.class)); comparableModule.defineMethod("<", CallbackFactory.getSingletonMethod(RubyComparable.class, "op_lt", RubyObject.class)); comparableModule.defineMethod( "<=", CallbackFactory.getSingletonMethod(RubyComparable.class, "op_le", RubyObject.class)); comparableModule.defineMethod( "between?", CallbackFactory.getSingletonMethod(RubyComparable.class, "between_p", RubyObject.class, RubyObject.class)); return comparableModule; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/RubyComparable.java/buggy/org/jruby/RubyComparable.java |
comparableModule.defineMethod( ">=", CallbackFactory.getSingletonMethod(RubyComparable.class, "op_ge", RubyObject.class)); | comparableModule.defineMethod(">=", CallbackFactory.getSingletonMethod(RubyComparable.class, "op_ge", RubyObject.class)); | public static RubyModule createComparable(Ruby ruby) { RubyModule comparableModule = ruby.defineModule("Comparable"); comparableModule.defineMethod( "==", CallbackFactory.getSingletonMethod(RubyComparable.class, "equal", RubyObject.class)); comparableModule.defineMethod(">", CallbackFactory.getSingletonMethod(RubyComparable.class, "op_gt", RubyObject.class)); comparableModule.defineMethod( ">=", CallbackFactory.getSingletonMethod(RubyComparable.class, "op_ge", RubyObject.class)); comparableModule.defineMethod("<", CallbackFactory.getSingletonMethod(RubyComparable.class, "op_lt", RubyObject.class)); comparableModule.defineMethod( "<=", CallbackFactory.getSingletonMethod(RubyComparable.class, "op_le", RubyObject.class)); comparableModule.defineMethod( "between?", CallbackFactory.getSingletonMethod(RubyComparable.class, "between_p", RubyObject.class, RubyObject.class)); return comparableModule; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/RubyComparable.java/buggy/org/jruby/RubyComparable.java |
comparableModule.defineMethod( "<=", CallbackFactory.getSingletonMethod(RubyComparable.class, "op_le", RubyObject.class)); | comparableModule.defineMethod("<=", CallbackFactory.getSingletonMethod(RubyComparable.class, "op_le", RubyObject.class)); | public static RubyModule createComparable(Ruby ruby) { RubyModule comparableModule = ruby.defineModule("Comparable"); comparableModule.defineMethod( "==", CallbackFactory.getSingletonMethod(RubyComparable.class, "equal", RubyObject.class)); comparableModule.defineMethod(">", CallbackFactory.getSingletonMethod(RubyComparable.class, "op_gt", RubyObject.class)); comparableModule.defineMethod( ">=", CallbackFactory.getSingletonMethod(RubyComparable.class, "op_ge", RubyObject.class)); comparableModule.defineMethod("<", CallbackFactory.getSingletonMethod(RubyComparable.class, "op_lt", RubyObject.class)); comparableModule.defineMethod( "<=", CallbackFactory.getSingletonMethod(RubyComparable.class, "op_le", RubyObject.class)); comparableModule.defineMethod( "between?", CallbackFactory.getSingletonMethod(RubyComparable.class, "between_p", RubyObject.class, RubyObject.class)); return comparableModule; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/RubyComparable.java/buggy/org/jruby/RubyComparable.java |
result.defineMethod("<=>", callbackFactory.getMethod(RubyBignum.class, "cmp", RubyNumeric.class)); | result.defineMethod("<=>", callbackFactory.getMethod(RubyNumeric.class, "cmp", RubyNumeric.class)); | public static RubyClass createNumericClass(Ruby ruby) { RubyClass result = ruby.defineClass("Numeric", ruby.getClasses().getObjectClass()); CallbackFactory callbackFactory = ruby.callbackFactory(); result.includeModule(ruby.getClasses().getComparableModule()); result.defineMethod("+@", callbackFactory.getMethod(RubyNumeric.class, "op_uplus")); result.defineMethod("-@", callbackFactory.getMethod(RubyNumeric.class, "op_uminus")); result.defineMethod("<=>", callbackFactory.getMethod(RubyBignum.class, "cmp", RubyNumeric.class)); result.defineMethod("==", callbackFactory.getMethod(RubyNumeric.class, "equal", IRubyObject.class)); result.defineMethod("equal?", callbackFactory.getMethod(RubyNumeric.class, "veryEqual", IRubyObject.class)); result.defineMethod("===", callbackFactory.getMethod(RubyNumeric.class, "equal", IRubyObject.class)); result.defineMethod("abs", callbackFactory.getMethod(RubyNumeric.class, "abs")); result.defineMethod("ceil", callbackFactory.getMethod(RubyNumeric.class, "ceil")); result.defineMethod("coerce", callbackFactory.getMethod(RubyNumeric.class, "coerce", RubyNumeric.class)); result.defineMethod("clone", callbackFactory.getMethod(RubyNumeric.class, "rbClone")); result.defineMethod("divmod", callbackFactory.getMethod(RubyNumeric.class, "divmod", RubyNumeric.class)); result.defineMethod("eql?", callbackFactory.getMethod(RubyNumeric.class, "eql", IRubyObject.class)); result.defineMethod("floor", callbackFactory.getMethod(RubyNumeric.class, "floor")); result.defineMethod("integer?", callbackFactory.getMethod(RubyNumeric.class, "int_p")); result.defineMethod("modulo", callbackFactory.getMethod(RubyNumeric.class, "modulo", RubyNumeric.class)); result.defineMethod("nonzero?", callbackFactory.getMethod(RubyNumeric.class, "nonzero_p")); result.defineMethod("remainder", callbackFactory.getMethod(RubyNumeric.class, "remainder", RubyNumeric.class)); result.defineMethod("round", callbackFactory.getMethod(RubyNumeric.class, "round")); result.defineMethod("truncate", callbackFactory.getMethod(RubyNumeric.class, "truncate")); result.defineMethod("zero?", callbackFactory.getMethod(RubyNumeric.class, "zero_p")); return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/01b5828197be55fd807321e9abb8f856ff501ad6/RubyNumeric.java/buggy/src/org/jruby/RubyNumeric.java |
hashClass.defineMethod("shift", CallbackFactory.getMethod(RubyHash.class, "shift")); | public static RubyClass createHashClass(Ruby ruby) { RubyClass hashClass = ruby.defineClass("Hash", ruby.getClasses().getObjectClass()); hashClass.includeModule(ruby.getClasses().getEnumerableModule()); hashClass.defineSingletonMethod("new", CallbackFactory.getOptSingletonMethod(RubyHash.class, "newInstance")); hashClass.defineSingletonMethod("[]", CallbackFactory.getOptSingletonMethod(RubyHash.class, "create")); hashClass.defineMethod("initialize", CallbackFactory.getOptMethod(RubyHash.class, "initialize")); // rb_define_method(rb_cHash,"clone", rb_hash_clone, 0); // rb_define_method(rb_cHash,"rehash", rb_hash_rehash, 0); hashClass.defineMethod("to_hash", CallbackFactory.getMethod(RubyHash.class, "to_hash")); hashClass.defineMethod("to_a", CallbackFactory.getMethod(RubyHash.class, "to_a")); hashClass.defineMethod("to_s", CallbackFactory.getMethod(RubyHash.class, "to_s")); hashClass.defineMethod("inspect", CallbackFactory.getMethod(RubyHash.class, "inspect")); hashClass.defineMethod("==", CallbackFactory.getMethod(RubyHash.class, "equal", RubyObject.class)); hashClass.defineMethod("[]", CallbackFactory.getMethod(RubyHash.class, "aref", RubyObject.class)); // rb_define_method(rb_cHash,"fetch", rb_hash_fetch, -1); hashClass.defineMethod("[]=", CallbackFactory.getMethod(RubyHash.class, "aset", RubyObject.class, RubyObject.class)); hashClass.defineMethod("store", CallbackFactory.getMethod(RubyHash.class, "aset", RubyObject.class, RubyObject.class)); // rb_define_method(rb_cHash,"default", rb_hash_default, 0); // rb_define_method(rb_cHash,"default=", rb_hash_set_default, 1); // rb_define_method(rb_cHash,"index", rb_hash_index, 1); hashClass.defineMethod("indexes", CallbackFactory.getOptMethod(RubyHash.class, "indexes")); hashClass.defineMethod("indices", CallbackFactory.getOptMethod(RubyHash.class, "indexes")); hashClass.defineMethod("size", CallbackFactory.getMethod(RubyHash.class, "size")); hashClass.defineMethod("length", CallbackFactory.getMethod(RubyHash.class, "size")); hashClass.defineMethod("empty?", CallbackFactory.getMethod(RubyHash.class, "empty_p")); hashClass.defineMethod("each", CallbackFactory.getMethod(RubyHash.class, "each")); hashClass.defineMethod("each_pair", CallbackFactory.getMethod(RubyHash.class, "each")); // rb_define_method(rb_cHash,"each", rb_hash_each_pair, 0); // rb_define_method(rb_cHash,"each_value", rb_hash_each_value, 0); // rb_define_method(rb_cHash,"each_key", rb_hash_each_key, 0); // rb_define_method(rb_cHash,"each_pair", rb_hash_each_pair, 0); // rb_define_method(rb_cHash,"sort", rb_hash_sort, 0); hashClass.defineMethod("keys", CallbackFactory.getMethod(RubyHash.class, "keys")); hashClass.defineMethod("values", CallbackFactory.getMethod(RubyHash.class, "values")); // rb_define_method(rb_cHash,"shift", rb_hash_shift, 0); // rb_define_method(rb_cHash,"delete", rb_hash_delete, 1); // rb_define_method(rb_cHash,"delete_if", rb_hash_delete_if, 0); // rb_define_method(rb_cHash,"reject", rb_hash_reject, 0); // rb_define_method(rb_cHash,"reject!", rb_hash_reject_bang, 0); // rb_define_method(rb_cHash,"clear", rb_hash_clear, 0); // rb_define_method(rb_cHash,"invert", rb_hash_invert, 0); // rb_define_method(rb_cHash,"update", rb_hash_update, 1); // rb_define_method(rb_cHash,"replace", rb_hash_replace, 1); hashClass.defineMethod("include?", CallbackFactory.getMethod(RubyHash.class, "has_key", RubyObject.class)); hashClass.defineMethod("member?", CallbackFactory.getMethod(RubyHash.class, "has_key", RubyObject.class)); hashClass.defineMethod("has_key?", CallbackFactory.getMethod(RubyHash.class, "has_key", RubyObject.class)); hashClass.defineMethod("has_value?", CallbackFactory.getMethod(RubyHash.class, "has_value", RubyObject.class)); hashClass.defineMethod("key?", CallbackFactory.getMethod(RubyHash.class, "has_key", RubyObject.class)); hashClass.defineMethod("value?", CallbackFactory.getMethod(RubyHash.class, "has_value", RubyObject.class)); return hashClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/2f13ba47385b7584839c7f6f6f1abfee251cbe53/RubyHash.java/buggy/org/jruby/RubyHash.java |
|
javaModule.defineModuleFunction("primitive_to_java", CallbackFactory.getSingletonMethod(RubyJava.class, "primitive_to_java", IRubyObject.class)); | public static RubyModule createJavaModule(Ruby runtime) { RubyModule javaModule = runtime.defineModule("Java"); javaModule.defineModuleFunction("import", CallbackFactory.getSingletonMethod(RubyJava.class, "rbImport", RubyString.class)); javaModule.defineModuleFunction("name", CallbackFactory.getSingletonMethod(RubyJava.class, "name", RubyString.class, RubyString.class)); javaModule.defineModuleFunction("define_exception_handler", CallbackFactory.getOptSingletonMethod(RubyJava.class, "define_exception_handler")); JavaClassClass.createJavaClassClass(runtime, javaModule); JavaMethodClass.createJavaMethodClass(runtime, javaModule); JavaConstructorClass.createJavaConstructorClass(runtime, javaModule); return javaModule; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/89272e383891a75366988c82cce7c8626dcf5e2d/RubyJava.java/buggy/org/jruby/RubyJava.java |
|
result.includeModule(ruby.getClasses().getClass("Enumerable")); | result.includeModule(ruby.getClasses().getEnumerableModule()); | public static RubyClass createIOClass(Ruby ruby) { RubyClass result = ruby.defineClass("IO", ruby.getClasses().getObjectClass()); result.includeModule(ruby.getClasses().getClass("Enumerable")); // TODO: Implement tty? and isatty. We have no real capability to // determine this from java, but if we could set tty status, then // we could invoke jruby differently to allow stdin to return true // on this. This would allow things like cgi.rb to work properly. CallbackFactory callbackFactory = ruby.callbackFactory(); result.defineMethod("<<", callbackFactory.getMethod(RubyIO.class, "addString", IRubyObject.class)); result.defineMethod("clone", callbackFactory.getMethod(RubyIO.class, "clone_IO")); result.defineMethod("close", callbackFactory.getMethod(RubyIO.class, "close")); result.defineMethod("closed?", callbackFactory.getMethod(RubyIO.class, "closed")); result.defineMethod("each", callbackFactory.getOptMethod(RubyIO.class, "each_line")); result.defineMethod("each_byte", callbackFactory.getMethod(RubyIO.class, "each_byte")); result.defineMethod("each_line", callbackFactory.getOptMethod(RubyIO.class, "each_line")); result.defineMethod("eof", callbackFactory.getMethod(RubyIO.class, "eof")); result.defineMethod("eof?", callbackFactory.getMethod(RubyIO.class, "eof")); result.defineMethod("fileno", callbackFactory.getMethod(RubyIO.class, "fileno")); result.defineMethod("flush", callbackFactory.getMethod(RubyIO.class, "flush")); result.defineMethod("fsync", callbackFactory.getMethod(RubyIO.class, "fsync")); result.defineMethod("getc", callbackFactory.getMethod(RubyIO.class, "getc")); result.defineMethod("gets", callbackFactory.getOptMethod(RubyIO.class, "gets")); result.defineMethod("initialize", callbackFactory.getOptMethod(RubyIO.class, "initialize", RubyFixnum.class)); result.defineMethod("lineno", callbackFactory.getMethod(RubyIO.class, "lineno")); result.defineMethod("lineno=", callbackFactory.getMethod(RubyIO.class, "lineno_set", RubyFixnum.class)); result.defineMethod("pid", callbackFactory.getMethod(RubyIO.class, "pid")); result.defineMethod("pos", callbackFactory.getMethod(RubyIO.class, "pos")); result.defineMethod("pos=", callbackFactory.getMethod(RubyIO.class, "pos_set", RubyFixnum.class)); result.defineMethod("print", callbackFactory.getOptSingletonMethod(RubyIO.class, "print")); result.defineMethod("printf", callbackFactory.getOptSingletonMethod(RubyIO.class, "printf")); result.defineMethod("putc", callbackFactory.getMethod(RubyIO.class, "putc", IRubyObject.class)); result.defineMethod("puts", callbackFactory.getOptSingletonMethod(RubyIO.class, "puts")); result.defineMethod("read", callbackFactory.getOptMethod(RubyIO.class, "read")); result.defineMethod("readchar", callbackFactory.getMethod(RubyIO.class, "readchar")); result.defineMethod("readline", callbackFactory.getOptMethod(RubyIO.class, "readline")); result.defineMethod("readlines", callbackFactory.getOptMethod(RubyIO.class, "readlines")); result.defineMethod("reopen", callbackFactory.getOptMethod(RubyIO.class, "reopen", IRubyObject.class)); result.defineMethod("rewind", callbackFactory.getMethod(RubyIO.class, "rewind")); result.defineMethod("seek", callbackFactory.getOptMethod(RubyIO.class, "seek")); result.defineMethod("sync", callbackFactory.getMethod(RubyIO.class, "sync")); result.defineMethod("sync=", callbackFactory.getMethod(RubyIO.class, "sync_set", RubyBoolean.class)); result.defineMethod("sysread", callbackFactory.getMethod(RubyIO.class, "sysread", RubyFixnum.class)); result.defineMethod("syswrite", callbackFactory.getMethod(RubyIO.class, "syswrite", IRubyObject.class)); result.defineMethod("tell", callbackFactory.getMethod(RubyIO.class, "pos")); result.defineMethod("to_i", callbackFactory.getMethod(RubyIO.class, "fileno")); result.defineMethod("ungetc", callbackFactory.getMethod(RubyIO.class, "ungetc", RubyFixnum.class)); result.defineMethod("write", callbackFactory.getMethod(RubyIO.class, "write", IRubyObject.class)); result.defineSingletonMethod("new", callbackFactory.getOptSingletonMethod(RubyIO.class, "newInstance")); result.defineSingletonMethod("foreach", callbackFactory.getOptSingletonMethod(RubyIO.class, "foreach", IRubyObject.class)); result.defineSingletonMethod("readlines", callbackFactory.getOptSingletonMethod(RubyIO.class, "readlines")); // Constants for seek result.setConstant("SEEK_SET", RubyFixnum.newFixnum(ruby, IOHandler.SEEK_SET)); result.setConstant("SEEK_CUR", RubyFixnum.newFixnum(ruby, IOHandler.SEEK_CUR)); result.setConstant("SEEK_END", RubyFixnum.newFixnum(ruby, IOHandler.SEEK_END)); return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyIO.java/buggy/src/org/jruby/RubyIO.java |
RubyCallbackMethod arity = new ReflectionCallbackMethod(RubyMethod.class, "arity"); RubyCallbackMethod call = new ReflectionCallbackMethod(RubyMethod.class, "call", true); | RubyCallbackMethod arity = new ReflectionCallbackMethod(RubyMethod.class, "arity"); RubyCallbackMethod call = new ReflectionCallbackMethod(RubyMethod.class, "call", true); | public static RubyClass createMethodClass(Ruby ruby) { RubyCallbackMethod arity = new ReflectionCallbackMethod(RubyMethod.class, "arity"); RubyCallbackMethod call = new ReflectionCallbackMethod(RubyMethod.class, "call", true); RubyClass methodClass = ruby.defineClass("Method", ruby.getClasses().getObjectClass()); methodClass.defineMethod("arity", arity); methodClass.defineMethod("[]", call); methodClass.defineMethod("call", call); return methodClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java |
RubyClass methodClass = ruby.defineClass("Method", ruby.getClasses().getObjectClass()); | RubyClass methodClass = ruby.defineClass("Method", ruby.getClasses().getObjectClass()); | public static RubyClass createMethodClass(Ruby ruby) { RubyCallbackMethod arity = new ReflectionCallbackMethod(RubyMethod.class, "arity"); RubyCallbackMethod call = new ReflectionCallbackMethod(RubyMethod.class, "call", true); RubyClass methodClass = ruby.defineClass("Method", ruby.getClasses().getObjectClass()); methodClass.defineMethod("arity", arity); methodClass.defineMethod("[]", call); methodClass.defineMethod("call", call); return methodClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java |
methodClass.defineMethod("arity", arity); methodClass.defineMethod("[]", call); methodClass.defineMethod("call", call); | methodClass.defineMethod("arity", arity); methodClass.defineMethod("[]", call); methodClass.defineMethod("call", call); | public static RubyClass createMethodClass(Ruby ruby) { RubyCallbackMethod arity = new ReflectionCallbackMethod(RubyMethod.class, "arity"); RubyCallbackMethod call = new ReflectionCallbackMethod(RubyMethod.class, "call", true); RubyClass methodClass = ruby.defineClass("Method", ruby.getClasses().getObjectClass()); methodClass.defineMethod("arity", arity); methodClass.defineMethod("[]", call); methodClass.defineMethod("call", call); return methodClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java |
return methodClass; } | return methodClass; } | public static RubyClass createMethodClass(Ruby ruby) { RubyCallbackMethod arity = new ReflectionCallbackMethod(RubyMethod.class, "arity"); RubyCallbackMethod call = new ReflectionCallbackMethod(RubyMethod.class, "call", true); RubyClass methodClass = ruby.defineClass("Method", ruby.getClasses().getObjectClass()); methodClass.defineMethod("arity", arity); methodClass.defineMethod("[]", call); methodClass.defineMethod("call", call); return methodClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyMethod.java/buggy/org/jruby/RubyMethod.java |
RubyCallbackMethod each_object = new ReflectionCallbackMethod(RubyObjectSpace.class, "each_object", true, true); | RubyCallbackMethod each_object = new ReflectionCallbackMethod(RubyObjectSpace.class, "each_object", true, true); | public static RubyModule createObjectSpaceModule(Ruby ruby) { RubyCallbackMethod each_object = new ReflectionCallbackMethod(RubyObjectSpace.class, "each_object", true, true); RubyModule objectSpaceModule = ruby.defineModule("ObjectSpace"); objectSpaceModule.defineModuleFunction("each_object", each_object); return objectSpaceModule; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyObjectSpace.java/buggy/org/jruby/RubyObjectSpace.java |
RubyModule objectSpaceModule = ruby.defineModule("ObjectSpace"); | RubyModule objectSpaceModule = ruby.defineModule("ObjectSpace"); | public static RubyModule createObjectSpaceModule(Ruby ruby) { RubyCallbackMethod each_object = new ReflectionCallbackMethod(RubyObjectSpace.class, "each_object", true, true); RubyModule objectSpaceModule = ruby.defineModule("ObjectSpace"); objectSpaceModule.defineModuleFunction("each_object", each_object); return objectSpaceModule; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyObjectSpace.java/buggy/org/jruby/RubyObjectSpace.java |
objectSpaceModule.defineModuleFunction("each_object", each_object); | objectSpaceModule.defineModuleFunction("each_object", each_object); | public static RubyModule createObjectSpaceModule(Ruby ruby) { RubyCallbackMethod each_object = new ReflectionCallbackMethod(RubyObjectSpace.class, "each_object", true, true); RubyModule objectSpaceModule = ruby.defineModule("ObjectSpace"); objectSpaceModule.defineModuleFunction("each_object", each_object); return objectSpaceModule; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyObjectSpace.java/buggy/org/jruby/RubyObjectSpace.java |
return objectSpaceModule; } | return objectSpaceModule; } | public static RubyModule createObjectSpaceModule(Ruby ruby) { RubyCallbackMethod each_object = new ReflectionCallbackMethod(RubyObjectSpace.class, "each_object", true, true); RubyModule objectSpaceModule = ruby.defineModule("ObjectSpace"); objectSpaceModule.defineModuleFunction("each_object", each_object); return objectSpaceModule; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyObjectSpace.java/buggy/org/jruby/RubyObjectSpace.java |
public static RubyModule createMathModule(Ruby ruby) { RubyModule mathModule = new MathDefinition(ruby).getModule(); | public static RubyModule createMathModule(Ruby runtime) { RubyModule result = runtime.defineModule("Math"); CallbackFactory callbackFactory = runtime.callbackFactory(); result.defineConstant("E", RubyFloat.newFloat(runtime, Math.E)); result.defineConstant("PI", RubyFloat.newFloat(runtime, Math.PI)); | public static RubyModule createMathModule(Ruby ruby) { RubyModule mathModule = new MathDefinition(ruby).getModule(); mathModule.defineConstant("E", RubyFloat.newFloat(ruby, Math.E)); mathModule.defineConstant("PI", RubyFloat.newFloat(ruby, Math.PI)); return mathModule; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
mathModule.defineConstant("E", RubyFloat.newFloat(ruby, Math.E)); mathModule.defineConstant("PI", RubyFloat.newFloat(ruby, Math.PI)); return mathModule; | result.defineSingletonMethod("atan2", callbackFactory.getSingletonMethod(RubyMath.class, "atan2", RubyNumeric.class, RubyNumeric.class)); result.defineSingletonMethod("cos", callbackFactory.getSingletonMethod(RubyMath.class, "cos", RubyNumeric.class)); result.defineSingletonMethod("exp", callbackFactory.getSingletonMethod(RubyMath.class, "exp", RubyNumeric.class)); result.defineSingletonMethod("frexp", callbackFactory.getSingletonMethod(RubyMath.class, "frexp", RubyNumeric.class)); result.defineSingletonMethod("ldexp", callbackFactory.getSingletonMethod(RubyMath.class, "ldexp", RubyNumeric.class, RubyNumeric.class)); result.defineSingletonMethod("log", callbackFactory.getSingletonMethod(RubyMath.class, "log", RubyNumeric.class)); result.defineSingletonMethod("log10", callbackFactory.getSingletonMethod(RubyMath.class, "log10", RubyNumeric.class)); result.defineSingletonMethod("sin", callbackFactory.getSingletonMethod(RubyMath.class, "sin", RubyNumeric.class)); result.defineSingletonMethod("sqrt", callbackFactory.getSingletonMethod(RubyMath.class, "sqrt", RubyNumeric.class)); result.defineSingletonMethod("tan", callbackFactory.getSingletonMethod(RubyMath.class, "tan", RubyNumeric.class)); return result; | public static RubyModule createMathModule(Ruby ruby) { RubyModule mathModule = new MathDefinition(ruby).getModule(); mathModule.defineConstant("E", RubyFloat.newFloat(ruby, Math.E)); mathModule.defineConstant("PI", RubyFloat.newFloat(ruby, Math.PI)); return mathModule; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
Callback s_new = new ReflectionCallbackMethod(RubyTime.class, "s_new", false, true); | Callback s_new = CallbackFactory.getSingletonMethod(RubyTime.class, "s_new"); | public static RubyClass createTimeClass(Ruby ruby) { RubyClass timeClass = ruby.defineClass("Time", ruby.getClasses().getObjectClass()); Callback s_new = new ReflectionCallbackMethod(RubyTime.class, "s_new", false, true); timeClass.defineSingletonMethod("new", s_new); timeClass.defineSingletonMethod("now", s_new); timeClass.defineMethod("-", CallbackFactory.getMethod(RubyTime.class, "op_minus", RubyObject.class)); timeClass.defineMethod("to_s", CallbackFactory.getMethod(RubyTime.class, "to_s")); timeClass.defineMethod("inspect", CallbackFactory.getMethod(RubyTime.class, "to_s")); return timeClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/RubyTime.java/buggy/org/jruby/RubyTime.java |
ruby.getGlobalVariables().defineReadonly("$*", new ValueAccessor(RubyArray.newArray(ruby))); | public static void createGlobals(Ruby ruby) { // Version information: IRubyObject version = RubyString.newString(ruby, Constants.RUBY_VERSION).freeze(); IRubyObject release = RubyString.newString(ruby, Constants.COMPILE_DATE).freeze(); IRubyObject platform = RubyString.newString(ruby, Constants.PLATFORM).freeze(); ruby.defineGlobalConstant("RUBY_VERSION", version); ruby.defineGlobalConstant("RUBY_RELEASE_DATE", release); ruby.defineGlobalConstant("RUBY_PLATFORM", platform); ruby.defineGlobalConstant("VERSION", version); ruby.defineGlobalConstant("RELEASE_DATE", release); ruby.defineGlobalConstant("PLATFORM", platform); ruby.defineVariable(new StringGlobalVariable(ruby, "$/", RubyString.newString(ruby, "\n"))); ruby.defineVariable(new StringGlobalVariable(ruby, "$\\", ruby.getNil())); ruby.defineVariable(new StringGlobalVariable(ruby, "$,", ruby.getNil())); ruby.defineVariable(new LineNumberGlobalVariable(ruby, "$.", RubyFixnum.one(ruby))); ruby.defineVariable(new LastlineGlobalVariable(ruby, "$_")); ruby.defineVariable(new ErrorInfoGlobalVariable(ruby, "$!", ruby.getNil())); ruby.defineVariable(new SafeGlobalVariable(ruby, "$SAFE")); ruby.defineVariable(new BacktraceGlobalVariable(ruby, "$@")); IRubyObject stdin = RubyIO.stdin(ruby, ruby.getClasses().getIoClass(), System.in); IRubyObject stdout = RubyIO.stdout(ruby, ruby.getClasses().getIoClass(), System.out); IRubyObject stderr = RubyIO.stderr(ruby, ruby.getClasses().getIoClass(), System.err); ruby.defineVariable(new InputGlobalVariable(ruby, "$stdin", stdin)); ruby.defineVariable(new OutputGlobalVariable(ruby, "$stdout", stdout)); ruby.defineVariable(new OutputGlobalVariable(ruby, "$stderr", stderr)); ruby.defineVariable(new OutputGlobalVariable(ruby, "$>", stdout)); ruby.defineVariable(new OutputGlobalVariable(ruby, "$defout", stdout)); ruby.defineGlobalConstant("STDIN", stdin); ruby.defineGlobalConstant("STDOUT", stdout); ruby.defineGlobalConstant("STDERR", stderr); ruby.defineVariable(new LoadedFeatures(ruby, "$\"")); // FIXME: add an argv accessor ruby.getGlobalVariables().defineReadonly("$*", new ValueAccessor(RubyArray.newArray(ruby))); ruby.defineVariable(new LoadPath(ruby, "$:")); ruby.defineVariable(new LoadPath(ruby, "$-I")); ruby.defineVariable(new LoadPath(ruby, "$LOAD_PATH")); // ARGF, $< object RubyArgsFile argsFile = new RubyArgsFile(ruby); argsFile.initArgsFile(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/05c7de156620b4e1926ea77f476287db1b42b4cc/RubyGlobal.java/buggy/src/org/jruby/RubyGlobal.java |
|
String str = arg.getValue().trim(); | String str = arg.toString().trim(); | public static RubyFloat str2fnum(IRuby runtime, RubyString arg) { String str = arg.getValue().trim(); double d = 0.0; int pos = str.length(); for (int i = 0; i < pos; i++) { if ("0123456789eE+-.".indexOf(str.charAt(i)) == -1) { pos = i + 1; break; } } for (; pos > 0; pos--) { try { d = Double.parseDouble(str.substring(0, pos)); } catch (NumberFormatException ex) { continue; } break; } return new RubyFloat(runtime, d); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/RubyNumeric.java/buggy/src/org/jruby/RubyNumeric.java |
StringBuffer sbuf = new StringBuffer(str.getValue().trim()); | StringBuffer sbuf = new StringBuffer(str.toString().trim()); | public static RubyInteger str2inum(IRuby runtime, RubyString str, int base) { StringBuffer sbuf = new StringBuffer(str.getValue().trim()); if (sbuf.length() == 0) { return RubyFixnum.zero(runtime); } int pos = 0; int radix = (base != 0) ? base : 10; boolean digitsFound = false; if (sbuf.charAt(pos) == '-') { pos++; } else if (sbuf.charAt(pos) == '+') { sbuf.deleteCharAt(pos); } if (pos == sbuf.length()) { return RubyFixnum.zero(runtime); } if (sbuf.charAt(pos) == '0') { sbuf.deleteCharAt(pos); if (pos == sbuf.length()) { return RubyFixnum.zero(runtime); } if (sbuf.charAt(pos) == 'x' || sbuf.charAt(pos) == 'X') { if (base == 0 || base == 16) { radix = 16; sbuf.deleteCharAt(pos); } } else if (sbuf.charAt(pos) == 'b' || sbuf.charAt(pos) == 'B') { if (base == 0 || base == 2) { radix = 2; sbuf.deleteCharAt(pos); } } else { radix = (base == 0) ? 8 : base; } } while (pos < sbuf.length()) { if (sbuf.charAt(pos) == '_') { sbuf.deleteCharAt(pos); } else if (Character.digit(sbuf.charAt(pos), radix) != -1) { digitsFound = true; pos++; } else { break; } } if (!digitsFound) { return RubyFixnum.zero(runtime); } try { long l = Long.parseLong(sbuf.substring(0, pos), radix); return runtime.newFixnum(l); } catch (NumberFormatException ex) { BigInteger bi = new BigInteger(sbuf.substring(0, pos), radix); return new RubyBignum(runtime, bi); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/RubyNumeric.java/buggy/src/org/jruby/RubyNumeric.java |
return multiplyWith(numericValue(num)); | return numericValue(num).multiplyWith(this); | public RubyNumeric op_mul(IRubyObject num) { return multiplyWith(numericValue(num)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8ae8f38ab1546a14304108515ca0d070412cc6c2/RubyFloat.java/buggy/src/org/jruby/RubyFloat.java |
if (member.isNil()) { throw new RubyBugException("uninitialized struct"); } | Asserts.assertTrue(!member.isNil(), "uninitialized struct"); | public IRubyObject get() { String name = runtime.getCurrentFrame().getLastFunc(); RubyArray member = (RubyArray) getInstanceVariable(classOf(), "__member__"); if (member.isNil()) { throw new RubyBugException("uninitialized struct"); } for (int i = 0; i < member.getLength(); i++) { if (member.entry(i).toId().equals(name)) { return values[i]; } } throw new NameError(runtime, name + " is not struct member"); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/071973606d94103b2d5cb6c793aa1e8809fc7b2a/RubyStruct.java/buggy/org/jruby/RubyStruct.java |
if (member.isNil()) { throw new RubyBugException("uninitialized struct"); } | Asserts.assertTrue(!member.isNil(), "uninitialized struct"); | private IRubyObject getByName(String name) { RubyArray member = (RubyArray) getInstanceVariable(classOf(), "__member__"); if (member.isNil()) { throw new RubyBugException("uninitialized struct"); } for (int i = 0; i < member.getLength(); i++) { if (member.entry(i).toId().equals(name)) { return values[i]; } } throw new NameError(runtime, name + " is not struct member"); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/071973606d94103b2d5cb6c793aa1e8809fc7b2a/RubyStruct.java/buggy/org/jruby/RubyStruct.java |
if (member.isNil()) { throw new RubyBugException("uninitialized struct"); } | Asserts.assertTrue(!member.isNil(), "uninitialized struct"); | public RubyString inspect() { RubyArray member = (RubyArray) getInstanceVariable(classOf(), "__member__"); if (member.isNil()) { throw new RubyBugException("uninitialized struct"); } StringBuffer sb = new StringBuffer(100); sb.append("#<").append(getInternalClass().toName()).append(' '); for (int i = 0; i < member.getLength(); i++) { if (i > 0) { sb.append(", "); } sb.append(member.entry(i).toId()).append("="); sb.append(values[i].callMethod("inspect")); } sb.append('>'); return RubyString.newString(runtime, sb.toString()); // OBJ_INFECT } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/071973606d94103b2d5cb6c793aa1e8809fc7b2a/RubyStruct.java/buggy/org/jruby/RubyStruct.java |
if (member.isNil()) { throw new RubyBugException("uninitialized struct"); } | Asserts.assertTrue(!member.isNil(), "uninitialized struct"); | public static RubyArray members(IRubyObject recv) { RubyArray member = (RubyArray) getInstanceVariable((RubyClass) recv, "__member__"); if (member.isNil()) { throw new RubyBugException("uninitialized struct"); } RubyArray result = RubyArray.newArray(recv.getRuntime(), member.getLength()); for (int i = 0; i < member.getLength(); i++) { result.append(RubyString.newString(recv.getRuntime(), member.entry(i).toId())); } return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/071973606d94103b2d5cb6c793aa1e8809fc7b2a/RubyStruct.java/buggy/org/jruby/RubyStruct.java |
if (member.isNil()) { throw new RubyBugException("uninitialized struct"); } | Asserts.assertTrue(!member.isNil(), "uninitialized struct"); | public IRubyObject set(IRubyObject value) { String name = runtime.getCurrentFrame().getLastFunc(); if (name.endsWith("=")) { name = name.substring(0, name.length() - 1); } RubyArray member = (RubyArray) getInstanceVariable(classOf(), "__member__"); if (member.isNil()) { throw new RubyBugException("uninitialized struct"); } modify(); for (int i = 0; i < member.getLength(); i++) { if (member.entry(i).toId().equals(name)) { return values[i] = value; } } throw new NameError(runtime, name + " is not struct member"); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/071973606d94103b2d5cb6c793aa1e8809fc7b2a/RubyStruct.java/buggy/org/jruby/RubyStruct.java |
if (member.isNil()) { throw new RubyBugException("uninitialized struct"); } | Asserts.assertTrue(!member.isNil(), "uninitialized struct"); | private IRubyObject setByName(String name, IRubyObject value) { RubyArray member = (RubyArray) getInstanceVariable(classOf(), "__member__"); if (member.isNil()) { throw new RubyBugException("uninitialized struct"); } modify(); for (int i = 0; i < member.getLength(); i++) { if (member.entry(i).toId().equals(name)) { return values[i] = value; } } throw new NameError(runtime, name + " is not struct member"); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/071973606d94103b2d5cb6c793aa1e8809fc7b2a/RubyStruct.java/buggy/org/jruby/RubyStruct.java |
return "Module"+(moduleId==null ? ":Hash"+this.hashCode() : ":"+moduleId); | return "Module"+(moduleId==null ? ":Hash_"+this.hashCode() : ":Id_"+moduleId); | public String toString(){ return "Module"+(moduleId==null ? ":Hash"+this.hashCode() : ":"+moduleId); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51a3c546dfc7a7a98b29771a459df19094fc5b51/Module.java/clean/components/common/src/ome/model/Module.java |
c.linkCategoryGroup((CategoryGroup) mapper.map(this.getGroup())); | CategoryGroup cg = (CategoryGroup) mapper.map(this.getGroup()); if ( ! linked( cg.findCategoryGroupCategoryLink( c ))) c.linkCategoryGroup( cg ); | public IObject fillIObject( IObject obj, ReverseModelMapper mapper) { if ( obj instanceof Category) { Category c = (Category) obj; if (super.fill(c)) { c.setName(this.getName()); c.setDescription(this.getDescription()); c.linkCategoryGroup((CategoryGroup) mapper.map(this.getGroup())); if (this.getImages() != null) { for (Iterator it = this.getImages().iterator(); it.hasNext();) { ImageData i = (ImageData) it.next(); c.linkImage((Image) mapper.map(i)); } } } return c; } else { throw new IllegalArgumentException( "CategoryData can only fill Category."); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b7d44d4a82558acd2336a661072dda1f38cfc0b3/CategoryData.java/clean/components/shoola-adapter/src/pojos/CategoryData.java |
ImageData i = (ImageData) it.next(); c.linkImage((Image) mapper.map(i)); | ImageData id = (ImageData) it.next(); Image i = (Image) mapper.map( id ); if ( ! linked( i.findCategoryImageLink( c ))) c.linkImage( i ); | public IObject fillIObject( IObject obj, ReverseModelMapper mapper) { if ( obj instanceof Category) { Category c = (Category) obj; if (super.fill(c)) { c.setName(this.getName()); c.setDescription(this.getDescription()); c.linkCategoryGroup((CategoryGroup) mapper.map(this.getGroup())); if (this.getImages() != null) { for (Iterator it = this.getImages().iterator(); it.hasNext();) { ImageData i = (ImageData) it.next(); c.linkImage((Image) mapper.map(i)); } } } return c; } else { throw new IllegalArgumentException( "CategoryData can only fill Category."); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b7d44d4a82558acd2336a661072dda1f38cfc0b3/CategoryData.java/clean/components/shoola-adapter/src/pojos/CategoryData.java |
IncludeDirective(Object fileName) { | IncludeDirective(Macro fileName) { | IncludeDirective(Object fileName) { _fileName = fileName; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/b9aa11c88aa91e9043d6504a59b31aee8d1ad8c7/IncludeDirective.java/clean/webmacro/src/org/webmacro/engine/IncludeDirective.java |
public static Object build(BuildContext rc, Object target) | public static Object build(BuildContext rc, Object target) throws BuildException | public static Object build(BuildContext rc, Object target) { IncludeDirective id = new IncludeDirective(target); if (! (target instanceof Macro)) { try { return (id.evaluate(null)); } catch (Exception e) { // try again at runtime } } return id; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/b9aa11c88aa91e9043d6504a59b31aee8d1ad8c7/IncludeDirective.java/clean/webmacro/src/org/webmacro/engine/IncludeDirective.java |
IncludeDirective id = new IncludeDirective(target); if (! (target instanceof Macro)) { | if (target instanceof Macro) { return new IncludeDirective((Macro) target); } else { if (target == null) { throw new BuildException("Cannot #include null filename"); } | public static Object build(BuildContext rc, Object target) { IncludeDirective id = new IncludeDirective(target); if (! (target instanceof Macro)) { try { return (id.evaluate(null)); } catch (Exception e) { // try again at runtime } } return id; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/b9aa11c88aa91e9043d6504a59b31aee8d1ad8c7/IncludeDirective.java/clean/webmacro/src/org/webmacro/engine/IncludeDirective.java |
return (id.evaluate(null)); } catch (Exception e) { | return getFile(rc,target.toString()); } catch(GetFileException e) { throw new BuildException(e.getMessage()); | public static Object build(BuildContext rc, Object target) { IncludeDirective id = new IncludeDirective(target); if (! (target instanceof Macro)) { try { return (id.evaluate(null)); } catch (Exception e) { // try again at runtime } } return id; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/b9aa11c88aa91e9043d6504a59b31aee8d1ad8c7/IncludeDirective.java/clean/webmacro/src/org/webmacro/engine/IncludeDirective.java |
} return id; | } | public static Object build(BuildContext rc, Object target) { IncludeDirective id = new IncludeDirective(target); if (! (target instanceof Macro)) { try { return (id.evaluate(null)); } catch (Exception e) { // try again at runtime } } return id; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/b9aa11c88aa91e9043d6504a59b31aee8d1ad8c7/IncludeDirective.java/clean/webmacro/src/org/webmacro/engine/IncludeDirective.java |
Object fname = null; | Object fname = _fileName.evaluate(context); if (fname == null) { throw new InvalidContextException( "#include could not resolve filename: " + "target argument resolved to a null."); } | final public Object evaluate(Context context) throws InvalidContextException { Object fname = null; try { fname = (_fileName instanceof Macro) ? ((Macro) _fileName).evaluate(context) : _fileName; if (fname == null) { throw new InvalidContextException("Attempt to include " + _fileName + " which evaluates to null"); } return context.getBroker().getValue("url",fname.toString()); } catch (NotFoundException e) { throw new InvalidContextException("Attempt to include " + _fileName + " which evaluates to the non-existant " + fname + ": " + e); } catch (InvalidTypeException e) { throw new InvalidContextException("Attempt to load URLs failed " + " broker does not have a URL provider:" + e); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/b9aa11c88aa91e9043d6504a59b31aee8d1ad8c7/IncludeDirective.java/clean/webmacro/src/org/webmacro/engine/IncludeDirective.java |
fname = (_fileName instanceof Macro) ? ((Macro) _fileName).evaluate(context) : _fileName; if (fname == null) { throw new InvalidContextException("Attempt to include " + _fileName + " which evaluates to null"); } return context.getBroker().getValue("url",fname.toString()); } catch (NotFoundException e) { throw new InvalidContextException("Attempt to include " + _fileName + " which evaluates to the non-existant " + fname + ": " + e); } catch (InvalidTypeException e) { throw new InvalidContextException("Attempt to load URLs failed " + " broker does not have a URL provider:" + e); | return getFile(context, fname.toString()); } catch (GetFileException e) { throw new InvalidContextException(e.getMessage()); | final public Object evaluate(Context context) throws InvalidContextException { Object fname = null; try { fname = (_fileName instanceof Macro) ? ((Macro) _fileName).evaluate(context) : _fileName; if (fname == null) { throw new InvalidContextException("Attempt to include " + _fileName + " which evaluates to null"); } return context.getBroker().getValue("url",fname.toString()); } catch (NotFoundException e) { throw new InvalidContextException("Attempt to include " + _fileName + " which evaluates to the non-existant " + fname + ": " + e); } catch (InvalidTypeException e) { throw new InvalidContextException("Attempt to load URLs failed " + " broker does not have a URL provider:" + e); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/b9aa11c88aa91e9043d6504a59b31aee8d1ad8c7/IncludeDirective.java/clean/webmacro/src/org/webmacro/engine/IncludeDirective.java |
pref.setSpellCheckerEnabled(!panel.isSpellCheckerOn()); pref.setChatRoomNotifications(!panel.isGroupChatNotificationsOn()); | pref.setSpellCheckerEnabled(panel.isSpellCheckerOn()); pref.setChatRoomNotifications(panel.isGroupChatNotificationsOn()); | public void commit() { LocalPreferences pref = SettingsManager.getLocalPreferences(); pref.setTimeDisplayedInChat(panel.getShowTime()); pref.setSpellCheckerEnabled(!panel.isSpellCheckerOn()); pref.setChatRoomNotifications(!panel.isGroupChatNotificationsOn()); pref.setHideChatHistory(panel.isChatHistoryHidden()); SettingsManager.saveSettings(); // Do not commit if not changed. if (ModelUtil.hasLength(panel.getPassword()) && ModelUtil.hasLength(panel.getConfirmationPassword())) { try { SparkManager.getConnection().getAccountManager().changePassword(panel.getPassword()); } catch (XMPPException passwordEx) { JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "Unable to change password. Please see your server admin.", "Password Change Error", JOptionPane.ERROR_MESSAGE); Log.error("Unable to change password", passwordEx); } } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/a5615a9f6d3fee3b3b93773551675bfb27682c86/ChatPreference.java/buggy/src/java/org/jivesoftware/sparkimpl/preference/chat/ChatPreference.java |
public RubyFile(IRuby runtime, String path, final Reader reader) { this(runtime, path, new InputStream() { public int read() throws IOException { return reader.read(); } }); | public RubyFile(IRuby runtime, RubyClass type) { super(runtime, type); | public RubyFile(IRuby runtime, String path, final Reader reader) { this(runtime, path, new InputStream() { public int read() throws IOException { return reader.read(); } }); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/24fc00ac9f647542a77f440ea686cea2d209f347/RubyFile.java/buggy/src/org/jruby/RubyFile.java |
public final static void endCallArgs(final Ruby ruby, final Block actBlock) { | public final static void endCallArgs( final Ruby ruby, final Block actBlock) { | public final static void endCallArgs(final Ruby ruby, final Block actBlock) { if (actBlock != null) { // XXX ruby.getBlock().push(actBlock); // Refresh the next attribute. } ruby.getIterStack().pop(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/906555370ad101fdbc9a48d880e926215e2b5949/ArgsUtil.java/clean/org/jruby/ast/util/ArgsUtil.java |
public final static RubyObject[] setupArgs(final Ruby ruby, final EvaluateVisitor visitor, final INode node) { | public final static RubyObject[] setupArgs( final Ruby ruby, final EvaluateVisitor visitor, final INode node) { | public final static RubyObject[] setupArgs(final Ruby ruby, final EvaluateVisitor visitor, final INode node) { if (node == null) { return new RubyObject[0]; } final String file = ruby.getSourceFile(); final int line = ruby.getSourceLine(); final RubyObject args = visitor.eval(node); ruby.setSourceFile(file); ruby.setSourceLine(line); if (args instanceof RubyArray) { return ((RubyArray) args).toJavaArray(); } else { return new RubyObject[] { args }; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/906555370ad101fdbc9a48d880e926215e2b5949/ArgsUtil.java/clean/org/jruby/ast/util/ArgsUtil.java |
if (node instanceof ArrayNode) { final int size = ((ArrayNode) node).size(); final ArrayList list = new ArrayList(size); final Iterator iterator = ((ArrayNode) node).iterator(); for (int i = 0; i < size; i++) { final INode next = (INode) iterator.next(); if (next instanceof ExpandArrayNode) { list.addAll(((RubyArray) visitor.eval(next)).getList()); } else { list.add(visitor.eval(next)); } } ruby.setSourceFile(file); ruby.setSourceLine(line); return (RubyObject[]) list.toArray(new RubyObject[list.size()]); } | public final static RubyObject[] setupArgs(final Ruby ruby, final EvaluateVisitor visitor, final INode node) { if (node == null) { return new RubyObject[0]; } final String file = ruby.getSourceFile(); final int line = ruby.getSourceLine(); final RubyObject args = visitor.eval(node); ruby.setSourceFile(file); ruby.setSourceLine(line); if (args instanceof RubyArray) { return ((RubyArray) args).toJavaArray(); } else { return new RubyObject[] { args }; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/906555370ad101fdbc9a48d880e926215e2b5949/ArgsUtil.java/clean/org/jruby/ast/util/ArgsUtil.java |
|
SessionFactory sf = getHibernateTemplate().getSessionFactory(); Session s = SessionFactoryUtils.getSession(sf,false); try { s.connection().rollback(); } catch (SQLException sqle){ getHibernateTemplate().getJdbcExceptionTranslator(). translate("Attempting to rollback from SessionFactory",null,sqle); } | getHibernateTemplate().execute( new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException ,SQLException { session.connection().rollback(); return null; }; }); | public void rollback() { SessionFactory sf = getHibernateTemplate().getSessionFactory(); Session s = SessionFactoryUtils.getSession(sf,false); try { s.connection().rollback(); } catch (SQLException sqle){ getHibernateTemplate().getJdbcExceptionTranslator(). translate("Attempting to rollback from SessionFactory",null,sqle); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/149c7633fd9b60929f706ce4783c5e19a9f34bd2/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java |
public UpdateFilter(HibernateOperations hibernateOperations) { this.hibernateOps = hibernateOperations; } | private UpdateFilter(){} | public UpdateFilter(HibernateOperations hibernateOperations) { this.hibernateOps = hibernateOperations; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0039ef3c66932163f0ec9bfa2b7f37eaa70abe47/UpdateFilter.java/buggy/components/server/src/ome/tools/hibernate/UpdateFilter.java |
addArg("-d"); | addArg("--destination"); | public void execute() throws BuildException { initArgs(); if (toDir != null) { addArg("-d"); addArg(toDir.toString()); } // TODO: ignoreRegex.setRegex() is never called if (ignoreRegex != null) { addArg("-ignore"); addArg(ignoreRegex.getRegex()); } Set filenames = new HashSet(); Iterator i = fileSets.iterator(); while (i.hasNext()) { FileSet fileSet = (FileSet)i.next(); addArg("-basedir"); addArg(baseDir(fileSet)); filenames.addAll(Arrays.asList(getFilenames(fileSet))); } coverage((String[])filenames.toArray(new String[filenames.size()])); unInitArgs(); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/eaf2267474ed505073f1abfd841ab9ef7b9dd935/InstrumentTask.java/buggy/cobertura/src/net/sourceforge/cobertura/ant/InstrumentTask.java |
addArg("-ignore"); | addArg("--ignore"); | public void execute() throws BuildException { initArgs(); if (toDir != null) { addArg("-d"); addArg(toDir.toString()); } // TODO: ignoreRegex.setRegex() is never called if (ignoreRegex != null) { addArg("-ignore"); addArg(ignoreRegex.getRegex()); } Set filenames = new HashSet(); Iterator i = fileSets.iterator(); while (i.hasNext()) { FileSet fileSet = (FileSet)i.next(); addArg("-basedir"); addArg(baseDir(fileSet)); filenames.addAll(Arrays.asList(getFilenames(fileSet))); } coverage((String[])filenames.toArray(new String[filenames.size()])); unInitArgs(); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/eaf2267474ed505073f1abfd841ab9ef7b9dd935/InstrumentTask.java/buggy/cobertura/src/net/sourceforge/cobertura/ant/InstrumentTask.java |
addArg("-basedir"); | addArg("--basedir"); | public void execute() throws BuildException { initArgs(); if (toDir != null) { addArg("-d"); addArg(toDir.toString()); } // TODO: ignoreRegex.setRegex() is never called if (ignoreRegex != null) { addArg("-ignore"); addArg(ignoreRegex.getRegex()); } Set filenames = new HashSet(); Iterator i = fileSets.iterator(); while (i.hasNext()) { FileSet fileSet = (FileSet)i.next(); addArg("-basedir"); addArg(baseDir(fileSet)); filenames.addAll(Arrays.asList(getFilenames(fileSet))); } coverage((String[])filenames.toArray(new String[filenames.size()])); unInitArgs(); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/eaf2267474ed505073f1abfd841ab9ef7b9dd935/InstrumentTask.java/buggy/cobertura/src/net/sourceforge/cobertura/ant/InstrumentTask.java |
String baseDir(FileSet fileSet) { | String baseDir(FileSet fileSet) { | String baseDir(FileSet fileSet) { return fileSet.getDirectoryScanner(getProject()).getBasedir() .toString(); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/CommonMatchingTask.java/buggy/cobertura/src/net/sourceforge/cobertura/ant/CommonMatchingTask.java |
String[] getFilenames(FileSet fileSet) { | String[] getFilenames(FileSet fileSet) { | String[] getFilenames(FileSet fileSet) { String[] filesToReturn = getIncludedFiles(fileSet); if (toDir != null) { IdentityMapper m = new IdentityMapper(); SourceFileScanner sfs = new SourceFileScanner(this); filesToReturn = sfs.restrict(getIncludedFiles(fileSet), fileSet .getDir(getProject()), toDir, m); } return filesToReturn; } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/12464e2c222b85c4fe40070c50e015403ce5acfe/CommonMatchingTask.java/buggy/cobertura/src/net/sourceforge/cobertura/ant/CommonMatchingTask.java |
public int countImageAttributes(String typeName, List imageIDList) | public int countImageAttributes(SemanticType type, List imageIDList) | public int countImageAttributes(String typeName, List imageIDList) throws DSOutOfServiceException, DSAccessException; | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a82d641ae8b6aae180291dcfe5e2b1c45e55ea11/SemanticTypesService.java/buggy/SRC/org/openmicroscopy/shoola/env/data/SemanticTypesService.java |
Attribute createNewData(String semanticTypeName) throws DSOutOfServiceException, DSAccessException | DataInterface createNewData(Class dto) throws DSOutOfServiceException, DSAccessException | Attribute createNewData(String semanticTypeName) throws DSOutOfServiceException, DSAccessException { Attribute retVal = null; try { retVal = getDataFactory().createNew(semanticTypeName); } catch (Exception e) { handleException(e, "Can't create Attribute: "+semanticTypeName+"."); } return retVal; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/be05737de1d1d14e7b06c2042110ca9b6f994539/OMEDSGateway.java/buggy/SRC/org/openmicroscopy/shoola/env/data/OMEDSGateway.java |
Attribute retVal = null; | DataInterface retVal = null; | Attribute createNewData(String semanticTypeName) throws DSOutOfServiceException, DSAccessException { Attribute retVal = null; try { retVal = getDataFactory().createNew(semanticTypeName); } catch (Exception e) { handleException(e, "Can't create Attribute: "+semanticTypeName+"."); } return retVal; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/be05737de1d1d14e7b06c2042110ca9b6f994539/OMEDSGateway.java/buggy/SRC/org/openmicroscopy/shoola/env/data/OMEDSGateway.java |
retVal = getDataFactory().createNew(semanticTypeName); | retVal = getDataFactory().createNew(dto); | Attribute createNewData(String semanticTypeName) throws DSOutOfServiceException, DSAccessException { Attribute retVal = null; try { retVal = getDataFactory().createNew(semanticTypeName); } catch (Exception e) { handleException(e, "Can't create Attribute: "+semanticTypeName+"."); } return retVal; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/be05737de1d1d14e7b06c2042110ca9b6f994539/OMEDSGateway.java/buggy/SRC/org/openmicroscopy/shoola/env/data/OMEDSGateway.java |
handleException(e, "Can't create Attribute: "+semanticTypeName+"."); | handleException(e, "Can't create DataInterface: "+dto+"."); | Attribute createNewData(String semanticTypeName) throws DSOutOfServiceException, DSAccessException { Attribute retVal = null; try { retVal = getDataFactory().createNew(semanticTypeName); } catch (Exception e) { handleException(e, "Can't create Attribute: "+semanticTypeName+"."); } return retVal; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/be05737de1d1d14e7b06c2042110ca9b6f994539/OMEDSGateway.java/buggy/SRC/org/openmicroscopy/shoola/env/data/OMEDSGateway.java |
public List retrieveImageAttributes(String typeName, List imageIDs) | public List retrieveImageAttributes(SemanticType type, List imageIDs) | public List retrieveImageAttributes(String typeName, List imageIDs) throws DSOutOfServiceException, DSAccessException; | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a82d641ae8b6aae180291dcfe5e2b1c45e55ea11/SemanticTypesService.java/buggy/SRC/org/openmicroscopy/shoola/env/data/SemanticTypesService.java |
this.pattern = new File(pattern); | this.pattern = new File(pattern); if (!this.pattern.getPath().equals(this.pattern.getAbsolutePath())) { patternIsRelative = true; this.pattern = new File(cwd, pattern); } this.newPattern = pattern; | public Glob(String pattern) { // Java File will strip trailing path delimeter. // Make a boolean for this special case (how about multiple slashes?) if (pattern.endsWith("/")) { patternEndsWithPathDelimeter = true; } this.pattern = new File(pattern); //.getAbsoluteFile(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ef40ec2399c82f77074c649c2bb4d8db0bce46f3/Glob.java/clean/src/org/jruby/util/Glob.java |
public File[] getFiles() { | private File[] getFiles() { | public File[] getFiles() { String[] dirs = splitPattern(); File root = new File(dirs[0]); int idx = 1; if (dirs[0].indexOf('*') > -1 || dirs[0].indexOf('?') > -1) { root = new File("."); idx = 0; } for (int size = dirs.length; idx < size; idx++) { if (dirs[idx].indexOf('*') == -1 && dirs[idx].indexOf('?') == -1) { root = new File(root, dirs[idx]); } else { break; } } if (idx == dirs.length) { return new File[] {root}; } ArrayList matchingFiles = new ArrayList(); matchingFiles.add(root); for (int length = dirs.length; idx < length; idx++) { ArrayList currentMatchingFiles = new ArrayList(); for (int i = 0, size = matchingFiles.size(); i < size; i++) { boolean isDirectory = idx + 1 != length; String pattern = dirs[idx]; File parent = (File) matchingFiles.get(i); currentMatchingFiles.addAll(getMatchingFiles(parent, pattern, isDirectory)); } matchingFiles = currentMatchingFiles; } return (File[])matchingFiles.toArray(new File[matchingFiles.size()]); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ef40ec2399c82f77074c649c2bb4d8db0bce46f3/Glob.java/clean/src/org/jruby/util/Glob.java |
for (int i = 0; i < dirs.length; i++) System.out.println("dir" + dirs[i]); | public File[] getFiles() { String[] dirs = splitPattern(); File root = new File(dirs[0]); int idx = 1; if (dirs[0].indexOf('*') > -1 || dirs[0].indexOf('?') > -1) { root = new File("."); idx = 0; } for (int size = dirs.length; idx < size; idx++) { if (dirs[idx].indexOf('*') == -1 && dirs[idx].indexOf('?') == -1) { root = new File(root, dirs[idx]); } else { break; } } if (idx == dirs.length) { return new File[] {root}; } ArrayList matchingFiles = new ArrayList(); matchingFiles.add(root); for (int length = dirs.length; idx < length; idx++) { ArrayList currentMatchingFiles = new ArrayList(); for (int i = 0, size = matchingFiles.size(); i < size; i++) { boolean isDirectory = idx + 1 != length; String pattern = dirs[idx]; File parent = (File) matchingFiles.get(i); currentMatchingFiles.addAll(getMatchingFiles(parent, pattern, isDirectory)); } matchingFiles = currentMatchingFiles; } return (File[])matchingFiles.toArray(new File[matchingFiles.size()]); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ef40ec2399c82f77074c649c2bb4d8db0bce46f3/Glob.java/clean/src/org/jruby/util/Glob.java |
|
if (pattern.equals("**")) { return Collections.EMPTY_LIST; } return Arrays.asList(parent.listFiles(new FileFilter() { | FileFilter filter = new FileFilter() { | private static Collection getMatchingFiles(final File parent, final String pattern, final boolean isDirectory) { if (pattern.equals("**")) { // TODO: This kind of recursive globbing pattern needs to be implemented! return Collections.EMPTY_LIST; } return Arrays.asList(parent.listFiles(new FileFilter() { FilenameFilter filter = new GlobFilenameFilter(pattern); /** * @see java.io.FileFilter#accept(File) */ public boolean accept(File pathname) { return (pathname.isDirectory() || !isDirectory) && filter.accept(parent, pathname.getName()); } })); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ef40ec2399c82f77074c649c2bb4d8db0bce46f3/Glob.java/clean/src/org/jruby/util/Glob.java |
return (pathname.isDirectory() || !isDirectory) && filter.accept(parent, pathname.getName()); | return (pathname.isDirectory() || !isDirectory) && SelectorUtils.matchPath(pattern, pathname.getName()); | private static Collection getMatchingFiles(final File parent, final String pattern, final boolean isDirectory) { if (pattern.equals("**")) { // TODO: This kind of recursive globbing pattern needs to be implemented! return Collections.EMPTY_LIST; } return Arrays.asList(parent.listFiles(new FileFilter() { FilenameFilter filter = new GlobFilenameFilter(pattern); /** * @see java.io.FileFilter#accept(File) */ public boolean accept(File pathname) { return (pathname.isDirectory() || !isDirectory) && filter.accept(parent, pathname.getName()); } })); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ef40ec2399c82f77074c649c2bb4d8db0bce46f3/Glob.java/clean/src/org/jruby/util/Glob.java |
})); | }; File[] matchArray = parent.listFiles(filter); Collection matchingFiles = new ArrayList(); for (int i = 0; i < matchArray.length; i++) { matchingFiles.add(matchArray[i]); if (pattern.equals("**")) { if (matchArray[i].isDirectory()) { matchingFiles.addAll(getMatchingFiles(matchArray[i], pattern, isDirectory)); } } } return matchingFiles; | private static Collection getMatchingFiles(final File parent, final String pattern, final boolean isDirectory) { if (pattern.equals("**")) { // TODO: This kind of recursive globbing pattern needs to be implemented! return Collections.EMPTY_LIST; } return Arrays.asList(parent.listFiles(new FileFilter() { FilenameFilter filter = new GlobFilenameFilter(pattern); /** * @see java.io.FileFilter#accept(File) */ public boolean accept(File pathname) { return (pathname.isDirectory() || !isDirectory) && filter.accept(parent, pathname.getName()); } })); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ef40ec2399c82f77074c649c2bb4d8db0bce46f3/Glob.java/clean/src/org/jruby/util/Glob.java |
return (pathname.isDirectory() || !isDirectory) && filter.accept(parent, pathname.getName()); | return (pathname.isDirectory() || !isDirectory) && SelectorUtils.matchPath(pattern, pathname.getName()); | public boolean accept(File pathname) { return (pathname.isDirectory() || !isDirectory) && filter.accept(parent, pathname.getName()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ef40ec2399c82f77074c649c2bb4d8db0bce46f3/Glob.java/clean/src/org/jruby/util/Glob.java |
names[i] = files[i].getPath() + (patternEndsWithPathDelimeter ? "/" : ""); | if (patternIsRelative && files[i].getPath().startsWith(cwd)) { names[i] = files[i].getPath().substring(cwd.length()) + (patternEndsWithPathDelimeter ? "/" : ""); } else { names[i] = files[i].getPath() + (patternEndsWithPathDelimeter ? "/" : ""); } | public String[] getNames() { File[] files = getFiles(); String[] names = new String[files.length]; for (int i = 0, size = files.length; i < size; i++) { names[i] = files[i].getPath() + (patternEndsWithPathDelimeter ? "/" : ""); } return names; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ef40ec2399c82f77074c649c2bb4d8db0bce46f3/Glob.java/clean/src/org/jruby/util/Glob.java |
if (path.charAt(i) == File.separatorChar) { | if (path.charAt(i) == '/' || path.charAt(i) == '\\') { | private String[] splitPattern() { ArrayList dirs = new ArrayList(); String path = pattern.getPath(); StringBuffer sb = new StringBuffer(); for(int i = 0, size = path.length(); i < size; i++) { if (path.charAt(i) == File.separatorChar) { if (sb.length() > 0) { dirs.add(sb.toString()); sb = new StringBuffer(); } // to handle /unix/ and \\windows-server\ files if (dirs.size() == 0) { sb.append(File.separator); } } else { sb.append(path.charAt(i)); } } if (sb.length() > 0) { dirs.add(sb.toString()); } return (String[])dirs.toArray(new String[dirs.size()]); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ef40ec2399c82f77074c649c2bb4d8db0bce46f3/Glob.java/clean/src/org/jruby/util/Glob.java |
sb.append(File.separator); | sb.append(path.charAt(i)); | private String[] splitPattern() { ArrayList dirs = new ArrayList(); String path = pattern.getPath(); StringBuffer sb = new StringBuffer(); for(int i = 0, size = path.length(); i < size; i++) { if (path.charAt(i) == File.separatorChar) { if (sb.length() > 0) { dirs.add(sb.toString()); sb = new StringBuffer(); } // to handle /unix/ and \\windows-server\ files if (dirs.size() == 0) { sb.append(File.separator); } } else { sb.append(path.charAt(i)); } } if (sb.length() > 0) { dirs.add(sb.toString()); } return (String[])dirs.toArray(new String[dirs.size()]); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ef40ec2399c82f77074c649c2bb4d8db0bce46f3/Glob.java/clean/src/org/jruby/util/Glob.java |
boundCameraPosition(); | public void updateConstraints() { Dimension dimension = getSize(); double width = dimension.getWidth(); double height = dimension.getHeight(); double xRatio = width / footprint.getWidth(); double yRatio = height / footprint.getHeight(); // for some reason, setting setViewScale(0) screws things up // in a big way. if(scaleToShow) { if((xRatio < 1 || yRatio < 1) && (xRatio != 0 && yRatio != 0)) { double min = Math.min(xRatio,yRatio); getCamera().setViewScale(min); } else { getCamera().setViewScale(1); } } double viewScale = getCamera().getViewScale(); backgroundNode.setBounds(0,0,width/viewScale,height/viewScale); // update things for(Iterator iter = regionSensitive.iterator(); iter.hasNext();) { RegionSensitive rs = (RegionSensitive)iter.next(); rs.setActiveRegion(footprint); } overlayCamera.cameraResized(new Rectangle2D.Double(0,0,width,height)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2ebbcadad041defe8ddeaf2234f791a2934648d2/BrowserView.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/ui/BrowserView.java |
|
runtime.getLoadService().init(getClassPath(mgr)); | public void initialize(BSFManager mgr, String lang, Vector declaredBeans) throws BSFException { super.initialize(mgr, lang, declaredBeans); runtime = Ruby.getDefaultInstance(); for (int i = 0, size = declaredBeans.size(); i < size; i++) { BSFDeclaredBean bean = (BSFDeclaredBean) declaredBeans.elementAt(i); runtime.getGlobalVariables().define( GlobalVariable.variableName(bean.name), new BeanGlobalVariable(runtime, bean)); } runtime.getGlobalVariables().defineReadonly("$bsf", new FunctionsGlobalVariable(runtime, new BSFFunctions(mgr, this))); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/61503e7396c70acb6ed9f50922ff044d1fcc4bcc/JRubyEngine.java/clean/src/org/jruby/javasupport/bsf/JRubyEngine.java |
|
Object javaObject = JavaUtil.convertRubyToJava(object); | Object javaObject; if (object.isNil()) { javaObject = null; } else if (object instanceof RubyFixnum) { javaObject = new Long(((RubyFixnum) object).getLongValue()); } else if (object instanceof RubyBignum) { javaObject = ((RubyBignum) object).getValue(); } else if (object instanceof RubyString) { javaObject = ((RubyString) object).getValue(); } else if (object instanceof RubyBoolean) { javaObject = new Boolean(object.isTrue()); } else { javaObject = object; } | public static IRubyObject primitive_to_java(IRubyObject recv, IRubyObject object) { Ruby runtime = recv.getRuntime(); Object javaObject = JavaUtil.convertRubyToJava(object); return JavaObject.wrap(runtime, javaObject); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/5d9f406ad45d94138d41a8420d4904ddaa6b8483/Java.java/buggy/src/org/jruby/javasupport/Java.java |
Object nodeKey; | public Object get(Object key) { int hash = (System.identityHashCode(key) & 0x7FFFFFFF) % tab.length; Node last = null; Object nodeKey; synchronized (locks[hash]) { Node node = tab[hash]; while (node != null) { if (node.get() == key) { if (last != null) { last.next = node.next; node.next = tab[hash]; tab[hash] = node; } return node.value; } last = node; node = node.next; } } return null; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8f5880751893a7e5dd9da25d036747a39c9b25b5/SimpleIdentityMap.java/buggy/webmacro/src/org/webmacro/util/SimpleIdentityMap.java |
|
boolean found = false; | public void put(Object key, Object value) { processQueue(); if (key == null) { return; } if (value == null) { remove(key); return; } int hash = (System.identityHashCode(key) & 0x7FFFFFFF) % tab.length; boolean found = false; synchronized (locks[hash]) { Node node = tab[hash]; while (node != null) { if (node.get() == key) { node.value = value; return; } node = node.next; } node = new Node(key, queue); node.value = value; node.next = tab[hash]; tab[hash] = node; } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8f5880751893a7e5dd9da25d036747a39c9b25b5/SimpleIdentityMap.java/buggy/webmacro/src/org/webmacro/util/SimpleIdentityMap.java |
|
public static RubyFloat atan2(IRubyObject recv, IRubyObject other, IRubyObject other2) { double x = RubyNumeric.numericValue(other).getDoubleValue(); double y = RubyNumeric.numericValue(other2).getDoubleValue(); return RubyFloat.newFloat(recv.getRuntime(), Math.atan2(x, y)); | public static RubyFloat atan2(IRubyObject recv, RubyNumeric x, RubyNumeric y) { return RubyFloat.newFloat(recv.getRuntime(), Math.atan2(x.getDoubleValue(), y.getDoubleValue())); | public static RubyFloat atan2(IRubyObject recv, IRubyObject other, IRubyObject other2) { double x = RubyNumeric.numericValue(other).getDoubleValue(); double y = RubyNumeric.numericValue(other2).getDoubleValue(); return RubyFloat.newFloat(recv.getRuntime(), Math.atan2(x, y)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
public static RubyFloat cos(IRubyObject recv, IRubyObject other) { double x = RubyNumeric.numericValue(other).getDoubleValue(); return RubyFloat.newFloat(recv.getRuntime(), Math.cos(x)); | public static RubyFloat cos(IRubyObject recv, RubyNumeric x) { return RubyFloat.newFloat(recv.getRuntime(), Math.cos(x.getDoubleValue())); | public static RubyFloat cos(IRubyObject recv, IRubyObject other) { double x = RubyNumeric.numericValue(other).getDoubleValue(); return RubyFloat.newFloat(recv.getRuntime(), Math.cos(x)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
public static RubyFloat exp(IRubyObject recv, IRubyObject other) { double exponent = RubyNumeric.numericValue(other).getDoubleValue(); return RubyFloat.newFloat(recv.getRuntime(), Math.exp(exponent)); | public static RubyFloat exp(IRubyObject recv, RubyNumeric exponent) { return RubyFloat.newFloat(recv.getRuntime(), Math.exp(exponent.getDoubleValue())); | public static RubyFloat exp(IRubyObject recv, IRubyObject other) { double exponent = RubyNumeric.numericValue(other).getDoubleValue(); return RubyFloat.newFloat(recv.getRuntime(), Math.exp(exponent)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
public static RubyArray frexp(IRubyObject recv, IRubyObject other) { double mantissa = RubyNumeric.numericValue(other).getDoubleValue(); short sign = 1; double exponent = 0; | public static RubyArray frexp(IRubyObject recv, RubyNumeric other) { double mantissa = other.getDoubleValue(); short sign = 1; double exponent = 0; | public static RubyArray frexp(IRubyObject recv, IRubyObject other) { double mantissa = RubyNumeric.numericValue(other).getDoubleValue(); short sign = 1; double exponent = 0; if (mantissa != 0.0) { // Make mantissa same sign so we only have one code path. if (mantissa < 0) { mantissa = -mantissa; sign = -1; } // Increase value to hit lower range. for (; mantissa < 0.5; mantissa *= 2.0, exponent -=1) { } // Decrease value to hit upper range. for (; mantissa >= 1.0; mantissa *= 0.5, exponent +=1) { } } RubyArray result = RubyArray.newArray(recv.getRuntime(), 2); result.append(RubyFloat.newFloat(recv.getRuntime(), sign * mantissa)); result.append(RubyFloat.newFloat(recv.getRuntime(), exponent)); return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
if (mantissa != 0.0) { if (mantissa < 0) { mantissa = -mantissa; sign = -1; } | if (mantissa != 0.0) { if (mantissa < 0) { mantissa = -mantissa; sign = -1; } | public static RubyArray frexp(IRubyObject recv, IRubyObject other) { double mantissa = RubyNumeric.numericValue(other).getDoubleValue(); short sign = 1; double exponent = 0; if (mantissa != 0.0) { // Make mantissa same sign so we only have one code path. if (mantissa < 0) { mantissa = -mantissa; sign = -1; } // Increase value to hit lower range. for (; mantissa < 0.5; mantissa *= 2.0, exponent -=1) { } // Decrease value to hit upper range. for (; mantissa >= 1.0; mantissa *= 0.5, exponent +=1) { } } RubyArray result = RubyArray.newArray(recv.getRuntime(), 2); result.append(RubyFloat.newFloat(recv.getRuntime(), sign * mantissa)); result.append(RubyFloat.newFloat(recv.getRuntime(), exponent)); return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
for (; mantissa < 0.5; mantissa *= 2.0, exponent -=1) { } | for (; mantissa < 0.5; mantissa *= 2.0, exponent -=1) { } | public static RubyArray frexp(IRubyObject recv, IRubyObject other) { double mantissa = RubyNumeric.numericValue(other).getDoubleValue(); short sign = 1; double exponent = 0; if (mantissa != 0.0) { // Make mantissa same sign so we only have one code path. if (mantissa < 0) { mantissa = -mantissa; sign = -1; } // Increase value to hit lower range. for (; mantissa < 0.5; mantissa *= 2.0, exponent -=1) { } // Decrease value to hit upper range. for (; mantissa >= 1.0; mantissa *= 0.5, exponent +=1) { } } RubyArray result = RubyArray.newArray(recv.getRuntime(), 2); result.append(RubyFloat.newFloat(recv.getRuntime(), sign * mantissa)); result.append(RubyFloat.newFloat(recv.getRuntime(), exponent)); return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
for (; mantissa >= 1.0; mantissa *= 0.5, exponent +=1) { } } | for (; mantissa >= 1.0; mantissa *= 0.5, exponent +=1) { } } | public static RubyArray frexp(IRubyObject recv, IRubyObject other) { double mantissa = RubyNumeric.numericValue(other).getDoubleValue(); short sign = 1; double exponent = 0; if (mantissa != 0.0) { // Make mantissa same sign so we only have one code path. if (mantissa < 0) { mantissa = -mantissa; sign = -1; } // Increase value to hit lower range. for (; mantissa < 0.5; mantissa *= 2.0, exponent -=1) { } // Decrease value to hit upper range. for (; mantissa >= 1.0; mantissa *= 0.5, exponent +=1) { } } RubyArray result = RubyArray.newArray(recv.getRuntime(), 2); result.append(RubyFloat.newFloat(recv.getRuntime(), sign * mantissa)); result.append(RubyFloat.newFloat(recv.getRuntime(), exponent)); return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
RubyArray result = RubyArray.newArray(recv.getRuntime(), 2); result.append(RubyFloat.newFloat(recv.getRuntime(), sign * mantissa)); result.append(RubyFloat.newFloat(recv.getRuntime(), exponent)); | RubyArray result = RubyArray.newArray(recv.getRuntime(), 2); result.append(RubyFloat.newFloat(recv.getRuntime(), sign * mantissa)); result.append(RubyFloat.newFloat(recv.getRuntime(), exponent)); | public static RubyArray frexp(IRubyObject recv, IRubyObject other) { double mantissa = RubyNumeric.numericValue(other).getDoubleValue(); short sign = 1; double exponent = 0; if (mantissa != 0.0) { // Make mantissa same sign so we only have one code path. if (mantissa < 0) { mantissa = -mantissa; sign = -1; } // Increase value to hit lower range. for (; mantissa < 0.5; mantissa *= 2.0, exponent -=1) { } // Decrease value to hit upper range. for (; mantissa >= 1.0; mantissa *= 0.5, exponent +=1) { } } RubyArray result = RubyArray.newArray(recv.getRuntime(), 2); result.append(RubyFloat.newFloat(recv.getRuntime(), sign * mantissa)); result.append(RubyFloat.newFloat(recv.getRuntime(), exponent)); return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
return result; | return result; | public static RubyArray frexp(IRubyObject recv, IRubyObject other) { double mantissa = RubyNumeric.numericValue(other).getDoubleValue(); short sign = 1; double exponent = 0; if (mantissa != 0.0) { // Make mantissa same sign so we only have one code path. if (mantissa < 0) { mantissa = -mantissa; sign = -1; } // Increase value to hit lower range. for (; mantissa < 0.5; mantissa *= 2.0, exponent -=1) { } // Decrease value to hit upper range. for (; mantissa >= 1.0; mantissa *= 0.5, exponent +=1) { } } RubyArray result = RubyArray.newArray(recv.getRuntime(), 2); result.append(RubyFloat.newFloat(recv.getRuntime(), sign * mantissa)); result.append(RubyFloat.newFloat(recv.getRuntime(), exponent)); return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
public static RubyFloat ldexp(IRubyObject recv, IRubyObject x, IRubyObject y) { double mantissa = RubyNumeric.numericValue(x).getDoubleValue(); double exponent = RubyNumeric.numericValue(y).getDoubleValue(); | public static RubyFloat ldexp(IRubyObject recv, RubyNumeric mantissa, RubyNumeric exponent) { | public static RubyFloat ldexp(IRubyObject recv, IRubyObject x, IRubyObject y) { double mantissa = RubyNumeric.numericValue(x).getDoubleValue(); double exponent = RubyNumeric.numericValue(y).getDoubleValue(); return RubyFloat.newFloat(recv.getRuntime(), mantissa * Math.pow(2.0, exponent)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
mantissa * Math.pow(2.0, exponent)); | mantissa.getDoubleValue() * Math.pow(2.0, exponent.getDoubleValue())); | public static RubyFloat ldexp(IRubyObject recv, IRubyObject x, IRubyObject y) { double mantissa = RubyNumeric.numericValue(x).getDoubleValue(); double exponent = RubyNumeric.numericValue(y).getDoubleValue(); return RubyFloat.newFloat(recv.getRuntime(), mantissa * Math.pow(2.0, exponent)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
public static RubyFloat log(IRubyObject recv, IRubyObject other) { double x = RubyNumeric.numericValue(other).getDoubleValue(); return RubyFloat.newFloat(recv.getRuntime(), Math.log(x)); | public static RubyFloat log(IRubyObject recv, RubyNumeric x) { return RubyFloat.newFloat(recv.getRuntime(), Math.log(x.getDoubleValue())); | public static RubyFloat log(IRubyObject recv, IRubyObject other) { double x = RubyNumeric.numericValue(other).getDoubleValue(); return RubyFloat.newFloat(recv.getRuntime(), Math.log(x)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
public static RubyFloat log10(IRubyObject recv, IRubyObject other) { double x = RubyNumeric.numericValue(other).getDoubleValue(); | public static RubyFloat log10(IRubyObject recv, RubyNumeric x) { | public static RubyFloat log10(IRubyObject recv, IRubyObject other) { double x = RubyNumeric.numericValue(other).getDoubleValue(); return RubyFloat.newFloat(recv.getRuntime(), Math.log(x) / Math.log(10)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
Math.log(x) / Math.log(10)); | Math.log(x.getDoubleValue()) / Math.log(10)); | public static RubyFloat log10(IRubyObject recv, IRubyObject other) { double x = RubyNumeric.numericValue(other).getDoubleValue(); return RubyFloat.newFloat(recv.getRuntime(), Math.log(x) / Math.log(10)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
public static RubyFloat sin(IRubyObject recv, IRubyObject other) { double x = RubyNumeric.numericValue(other).getDoubleValue(); return RubyFloat.newFloat(recv.getRuntime(), Math.sin(x)); | public static RubyFloat sin(IRubyObject recv, RubyNumeric x) { return RubyFloat.newFloat(recv.getRuntime(), Math.sin(x.getDoubleValue())); | public static RubyFloat sin(IRubyObject recv, IRubyObject other) { double x = RubyNumeric.numericValue(other).getDoubleValue(); return RubyFloat.newFloat(recv.getRuntime(), Math.sin(x)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
public static RubyFloat sqrt(IRubyObject recv, IRubyObject other) { double x = RubyNumeric.numericValue(other).getDoubleValue(); | public static RubyFloat sqrt(IRubyObject recv, RubyNumeric other) { double x = other.getDoubleValue(); | public static RubyFloat sqrt(IRubyObject recv, IRubyObject other) { double x = RubyNumeric.numericValue(other).getDoubleValue(); if (x < 0) { throw new ArgumentError(recv.getRuntime(), "square root for negative number"); } return RubyFloat.newFloat(recv.getRuntime(), Math.sqrt(x)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
if (x < 0) { throw new ArgumentError(recv.getRuntime(), "square root for negative number"); } | if (x < 0) { throw new ArgumentError(recv.getRuntime(), "square root for negative number"); } | public static RubyFloat sqrt(IRubyObject recv, IRubyObject other) { double x = RubyNumeric.numericValue(other).getDoubleValue(); if (x < 0) { throw new ArgumentError(recv.getRuntime(), "square root for negative number"); } return RubyFloat.newFloat(recv.getRuntime(), Math.sqrt(x)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
public static RubyFloat tan(IRubyObject recv, IRubyObject other) { double x = RubyNumeric.numericValue(other).getDoubleValue(); return RubyFloat.newFloat(recv.getRuntime(), Math.tan(x)); | public static RubyFloat tan(IRubyObject recv, RubyNumeric x) { return RubyFloat.newFloat(recv.getRuntime(), Math.tan(x.getDoubleValue())); | public static RubyFloat tan(IRubyObject recv, IRubyObject other) { double x = RubyNumeric.numericValue(other).getDoubleValue(); return RubyFloat.newFloat(recv.getRuntime(), Math.tan(x)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyMath.java/buggy/src/org/jruby/RubyMath.java |
if (ChainBuilderAgent.DEBUG) { long end = System.currentTimeMillis()-start; System.err.println("time to layout module palette.."+end); } | public void buildGUI(ModulesData modData) { Container content = getContentPane(); content.setLayout(new BorderLayout()); // what is the window that the chain modules are in? ChainModuleData.setMainWindow(this); JToolBar tb = new JToolBar(); Icon smallChain = icons.getIcon("chains-small.png"); JButton newChain = new JButton(smallChain); newChain.setToolTipText("Create a new chain"); newChain.addActionListener(cmdTable.lookupActionListener("new chain")); tb.setFloatable(false); tb.add(newChain); content.add(tb,BorderLayout.NORTH); moduleCanvas = new ModulePaletteCanvas(this); moduleCanvas.setContents(modData); moduleCanvas.layoutContents(); split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,null,moduleCanvas); split.setPreferredSize(new Dimension(2*SIDE,SIDE)); configureTreeNode(); content.add(split,BorderLayout.CENTER); addComponentListener(this); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { uiManager.closeWindows(); setVisible(false); } }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a806bf744289bb0eed666b235887c8680d549d94/ModulePaletteWindow.java/clean/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ui/ModulePaletteWindow.java |
|
if (dataManager.getDatasets() != null || dataManager.getProjects() != null) { | if (dataManager.getChains() != null || dataManager.getModules() != null) { long guiStart =System.currentTimeMillis(); | public void contentComplete() { if (dataManager.getDatasets() != null || dataManager.getProjects() != null) { buildGUI((ModulesData) modLoader.getContents()); uiManager.contentComplete(); topWindowManager.continueHandleDisplay(); dataState = LOADED; } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a806bf744289bb0eed666b235887c8680d549d94/ModulePaletteWindow.java/clean/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ui/ModulePaletteWindow.java |
if (ChainBuilderAgent.DEBUG) { totalTime = System.currentTimeMillis()-start; System.err.println("time for chainbuilder start..."+totalTime); } | public void contentComplete() { if (dataManager.getDatasets() != null || dataManager.getProjects() != null) { buildGUI((ModulesData) modLoader.getContents()); uiManager.contentComplete(); topWindowManager.continueHandleDisplay(); dataState = LOADED; } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a806bf744289bb0eed666b235887c8680d549d94/ModulePaletteWindow.java/clean/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ui/ModulePaletteWindow.java |
|
start = System.currentTimeMillis(); | public void preHandleDisplay(TopWindowManager manager) { if (dataState == NOT_LOADED) { topWindowManager = manager; ContentGroup group = new ContentGroup(this); modLoader = new ModuleLoader(dataManager,group); ChainExecutionLoader execLoader = new ChainExecutionLoader(dataManager,group); ChainLoader chainLoader = new ChainLoader(dataManager,group); group.setAllLoadersAdded(); dataState = LOADING; } else if (dataState == LOADED) topWindowManager.continueHandleDisplay(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a806bf744289bb0eed666b235887c8680d549d94/ModulePaletteWindow.java/clean/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ui/ModulePaletteWindow.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.