rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
c.addWantedField("module_execution.experimenter", "id");
public static void fillAnnotationCriteria(Criteria c) { //c.addWantedField("id"); c.addWantedField("Content"); c.addWantedField("module_execution"); c.addWantedField("module_execution", "timestamp"); c.addWantedField("module_execution", "experimenter"); //Specify which fields we want for the owner. c.addWantedField("module_execution.experimenter", "id"); c.addWantedField("module_execution.experimenter", "FirstName"); c.addWantedField("module_execution.experimenter", "LastName"); c.addFilter("Valid", Boolean.TRUE); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/01a27ecff15f0a14ff349eccd47a12de073ae838/AnnotationMapper.java/clean/SRC/org/openmicroscopy/shoola/env/data/map/AnnotationMapper.java
runLevel2( klass, new PojoOptions() );
runLevel( klass, level2objects, new PojoOptions() );
private void runLevel2( Class klass ) { runLevel2( klass, new PojoOptions() ); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5a7691e42b193b6eb28c3405cac3380da0cd70ab/LoadContainersQueryTest.java/buggy/components/server/test/ome/server/itests/query/LoadContainersQueryTest.java
runLevel2( klass, new PojoOptions().leaves() );
runLevel( klass, level2objects, new PojoOptions().leaves() );
private void runLevel2WithLeaves( Class klass ) { runLevel2( klass, new PojoOptions().leaves() ); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5a7691e42b193b6eb28c3405cac3380da0cd70ab/LoadContainersQueryTest.java/buggy/components/server/test/ome/server/itests/query/LoadContainersQueryTest.java
PojoOptions po = new PojoOptions().exp( 10000L ); QueryParameter filterForUser = PojosQP.options( po.map() ); QueryParameter noFilter = PojosQP.options( null );
QueryParameter ids;
public void test_owner_filter() throws Exception { PojoOptions po = new PojoOptions().exp( 10000L ); QueryParameter filterForUser = PojosQP.options( po.map() ); QueryParameter noFilter = PojosQP.options( null ); QueryParameter ids = PojosQP.ids(Arrays.asList( 9990L )); q= new PojosLoadHierarchyQueryDefinition( PojosQP.Class( QP.CLASS, Project.class ), ids, noFilter); list = (List) iQuery.execute(q); assertTrue( list.size() > 0 ); q= new PojosLoadHierarchyQueryDefinition( PojosQP.Class( QP.CLASS, Project.class ), ids, filterForUser ); list = (List) iQuery.execute(q); assertTrue( list.size() > 0 ); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5a7691e42b193b6eb28c3405cac3380da0cd70ab/LoadContainersQueryTest.java/buggy/components/server/test/ome/server/itests/query/LoadContainersQueryTest.java
QueryParameter ids = PojosQP.ids(Arrays.asList( 9990L ));
ids = PojosQP.ids(Arrays.asList( 9990L ));
public void test_owner_filter() throws Exception { PojoOptions po = new PojoOptions().exp( 10000L ); QueryParameter filterForUser = PojosQP.options( po.map() ); QueryParameter noFilter = PojosQP.options( null ); QueryParameter ids = PojosQP.ids(Arrays.asList( 9990L )); q= new PojosLoadHierarchyQueryDefinition( PojosQP.Class( QP.CLASS, Project.class ), ids, noFilter); list = (List) iQuery.execute(q); assertTrue( list.size() > 0 ); q= new PojosLoadHierarchyQueryDefinition( PojosQP.Class( QP.CLASS, Project.class ), ids, filterForUser ); list = (List) iQuery.execute(q); assertTrue( list.size() > 0 ); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5a7691e42b193b6eb28c3405cac3380da0cd70ab/LoadContainersQueryTest.java/buggy/components/server/test/ome/server/itests/query/LoadContainersQueryTest.java
ids = PojosQP.ids(Arrays.asList( 9090L )); q= new PojosLoadHierarchyQueryDefinition( PojosQP.Class( QP.CLASS, Project.class ), ids, noFilter); list = (List) iQuery.execute(q); assertTrue( list.size() > 0 ); q= new PojosLoadHierarchyQueryDefinition( PojosQP.Class( QP.CLASS, Project.class ), ids, filterForUser ); list = (List) iQuery.execute(q); assertTrue( list.size() == 0 ); run_null_filter_check_size(Project.class, 3); run_null_filter_check_size(CategoryGroup.class, 8); run_null_filter_check_size(Dataset.class, 3); run_null_filter_check_size(Category.class, 10);
public void test_owner_filter() throws Exception { PojoOptions po = new PojoOptions().exp( 10000L ); QueryParameter filterForUser = PojosQP.options( po.map() ); QueryParameter noFilter = PojosQP.options( null ); QueryParameter ids = PojosQP.ids(Arrays.asList( 9990L )); q= new PojosLoadHierarchyQueryDefinition( PojosQP.Class( QP.CLASS, Project.class ), ids, noFilter); list = (List) iQuery.execute(q); assertTrue( list.size() > 0 ); q= new PojosLoadHierarchyQueryDefinition( PojosQP.Class( QP.CLASS, Project.class ), ids, filterForUser ); list = (List) iQuery.execute(q); assertTrue( list.size() > 0 ); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5a7691e42b193b6eb28c3405cac3380da0cd70ab/LoadContainersQueryTest.java/buggy/components/server/test/ome/server/itests/query/LoadContainersQueryTest.java
DisplayedNote dn = dd.getTree().getSelectedNote(); Note note = dn.getNote();
public void ok(Event e) { DisplayedNote dn = dd.getTree().getSelectedNote(); Note note = dn.getNote(); DisplayedNote newDn; if (after) { Note newNote = new Note(addNoteDialog.getName(), note.getHolder(), note.getIndex() + 1, ""); newDn = new DisplayedNote(dn.getHolder(), dd.getTree(), newNote); } else { Note newNote = new Note(addNoteDialog.getName(), note, 0, ""); newDn = new DisplayedNote(dn, dd.getTree(), newNote); } dn.setSelected(false); newDn.setSelected(true); newDn.displayTab(dd.getTabFolder(), d); addNoteDialog.dispose(); deregister(); }
57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/070b419b009cdaec26992a4f38fa244f53d78efc/AddNoteController.java/buggy/trunk/src/de/berlios/koalanotes/display/notes/AddNoteController.java
if (after) { Note newNote = new Note(addNoteDialog.getName(), note.getHolder(), note.getIndex() + 1, ""); newDn = new DisplayedNote(dn.getHolder(), dd.getTree(), newNote);
if (dd.getTree().isEmpty()) { Note newNote = new Note(addNoteDialog.getName(), dd.getDocument(), ""); newDn = new DisplayedNote(dd, dd.getTree(), newNote);
public void ok(Event e) { DisplayedNote dn = dd.getTree().getSelectedNote(); Note note = dn.getNote(); DisplayedNote newDn; if (after) { Note newNote = new Note(addNoteDialog.getName(), note.getHolder(), note.getIndex() + 1, ""); newDn = new DisplayedNote(dn.getHolder(), dd.getTree(), newNote); } else { Note newNote = new Note(addNoteDialog.getName(), note, 0, ""); newDn = new DisplayedNote(dn, dd.getTree(), newNote); } dn.setSelected(false); newDn.setSelected(true); newDn.displayTab(dd.getTabFolder(), d); addNoteDialog.dispose(); deregister(); }
57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/070b419b009cdaec26992a4f38fa244f53d78efc/AddNoteController.java/buggy/trunk/src/de/berlios/koalanotes/display/notes/AddNoteController.java
Note newNote = new Note(addNoteDialog.getName(), note, 0, ""); newDn = new DisplayedNote(dn, dd.getTree(), newNote);
DisplayedNote dn = dd.getTree().getSelectedNote(); Note note = dn.getNote(); if (after) { Note newNote = new Note(addNoteDialog.getName(), note.getHolder(), note.getIndex() + 1, ""); newDn = new DisplayedNote(dn.getHolder(), dd.getTree(), newNote); } else { Note newNote = new Note(addNoteDialog.getName(), note, 0, ""); newDn = new DisplayedNote(dn, dd.getTree(), newNote); } dn.setSelected(false);
public void ok(Event e) { DisplayedNote dn = dd.getTree().getSelectedNote(); Note note = dn.getNote(); DisplayedNote newDn; if (after) { Note newNote = new Note(addNoteDialog.getName(), note.getHolder(), note.getIndex() + 1, ""); newDn = new DisplayedNote(dn.getHolder(), dd.getTree(), newNote); } else { Note newNote = new Note(addNoteDialog.getName(), note, 0, ""); newDn = new DisplayedNote(dn, dd.getTree(), newNote); } dn.setSelected(false); newDn.setSelected(true); newDn.displayTab(dd.getTabFolder(), d); addNoteDialog.dispose(); deregister(); }
57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/070b419b009cdaec26992a4f38fa244f53d78efc/AddNoteController.java/buggy/trunk/src/de/berlios/koalanotes/display/notes/AddNoteController.java
dn.setSelected(false);
public void ok(Event e) { DisplayedNote dn = dd.getTree().getSelectedNote(); Note note = dn.getNote(); DisplayedNote newDn; if (after) { Note newNote = new Note(addNoteDialog.getName(), note.getHolder(), note.getIndex() + 1, ""); newDn = new DisplayedNote(dn.getHolder(), dd.getTree(), newNote); } else { Note newNote = new Note(addNoteDialog.getName(), note, 0, ""); newDn = new DisplayedNote(dn, dd.getTree(), newNote); } dn.setSelected(false); newDn.setSelected(true); newDn.displayTab(dd.getTabFolder(), d); addNoteDialog.dispose(); deregister(); }
57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/070b419b009cdaec26992a4f38fa244f53d78efc/AddNoteController.java/buggy/trunk/src/de/berlios/koalanotes/display/notes/AddNoteController.java
public void ok(Event e) { DisplayedNote dn = dd.getTree().getSelectedNote(); Note note = dn.getNote(); DisplayedNote newDn; if (after) { Note newNote = new Note(addNoteDialog.getName(), note.getHolder(), note.getIndex() + 1, ""); newDn = new DisplayedNote(dn.getHolder(), dd.getTree(), newNote); } else { Note newNote = new Note(addNoteDialog.getName(), note, 0, ""); newDn = new DisplayedNote(dn, dd.getTree(), newNote); } dn.setSelected(false); newDn.setSelected(true); newDn.displayTab(dd.getTabFolder(), d); addNoteDialog.dispose(); deregister(); }
57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/070b419b009cdaec26992a4f38fa244f53d78efc/AddNoteController.java/buggy/trunk/src/de/berlios/koalanotes/display/notes/AddNoteController.java
runtime.getGlobalVariables().defineReadonly("$bsf", new FunctionsGlobalVariable(runtime, new BSFFunctions(mgr, this)));
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)); } // ruby.defineGlobalFunction("declareBean", method); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a427f315ae3c71573e36810225bf3a9c51df15d5/JRubyEngine.java/buggy/src/org/jruby/javasupport/bsf/JRubyEngine.java
loadingWin = new LoadingWin(parentModel.getUI());
private void init() { annotatedObjectID = -1; annotatedObjectIndex = -1; annotationStatus = INITIAL; sorter = new ViewerSorter(); sorter.setAscending(false); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3feec30057da68977528d8509d07bff5c080fb40/ClipBoardModel.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/ClipBoardModel.java
int status = 0;
int status = 1;
public static IRubyObject exit(IRubyObject recv, IRubyObject[] args) { recv.getRuntime().secure(4); int status = 0; if (args.length > 0) { status = RubyNumeric.fix2int(args[0]); } throw new SystemExit(recv.getRuntime(), status); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1b49885a163e431540bbe2190b485631ad7ce78a/RubyKernel.java/clean/src/org/jruby/RubyKernel.java
status = RubyNumeric.fix2int(args[0]);
RubyObject argument = (RubyObject)args[0]; if (argument instanceof RubyFixnum) { status = RubyNumeric.fix2int(argument); } else { status = argument.isFalse() ? 1 : 0; }
public static IRubyObject exit(IRubyObject recv, IRubyObject[] args) { recv.getRuntime().secure(4); int status = 0; if (args.length > 0) { status = RubyNumeric.fix2int(args[0]); } throw new SystemExit(recv.getRuntime(), status); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1b49885a163e431540bbe2190b485631ad7ce78a/RubyKernel.java/clean/src/org/jruby/RubyKernel.java
RubyId key = (RubyId)_key;
RubyId key = null; try { key = (RubyId)_key; } catch (ClassCastException ccExcptn) { key = getRuby().intern((String)_key); System.out.println("key isn't ID: \"" + _key + "\""); } if (!(_value instanceof RubyObject)) { return RubyMapMethod.CONTINUE; }
public int execute(Object _key, Object _value, Object _res) { // Cast the values. RubyId key = (RubyId)_key; RubyObject value = (RubyObject)_value; FindClassPathResult res = (FindClassPathResult)_res; RubyString path = null; if (!key.isConstId()) { return RubyMapMethod.CONTINUE; } String name = key.toName(); if (res.path != null) { path = (RubyString)res.path.m_dup(); path.m_cat("::"); path.m_cat(name); } else { path = RubyString.m_newString(getRuby(), name); } if (value == res.klass) { res.name = key; res.path = path; return RubyMapMethod.STOP; } if (value.m_kind_of(getRuby().getModuleClass()).isTrue()) { if (value.getInstanceVariables() == null) { return RubyMapMethod.CONTINUE; } FindClassPathResult list = res; while (list != null) { if (list.track == value) { return RubyMapMethod.CONTINUE; } list = list.prev; } FindClassPathResult arg = new FindClassPathResult(); arg.name = null; arg.path = path; arg.klass = res.klass; arg.track = value; arg.prev = res; value.getInstanceVariables().foreach(this, arg); if (arg.name != null) { res.name = arg.name; res.path = arg.path; return RubyMapMethod.STOP; } } return RubyMapMethod.CONTINUE; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/RubyModule.java/clean/org/jruby/RubyModule.java
path = (RubyString)getInstanceVariables().get("__classpath__");
path = (RubyString)getInstanceVariables().get(getRuby().intern("__classpath__"));
public RubyString getClassname() { RubyString path = null; RubyModule rbModule = this; while (rbModule.isIncluded() || rbModule.isSingleton()) { rbModule = ((RubyClass)rbModule).getSuperClass(); } if (rbModule == null) { rbModule = getRuby().getObjectClass(); } path = (RubyString)getInstanceVariables().get("__classpath__"); if (path == null) { if (getInstanceVariables().get("__classid__") != null) { path = RubyString.m_newString(getRuby(), ((RubyId)getInstanceVariables().get("__classid__")).toName()); // todo: convert from symbol to string getInstanceVariables().put("__classpath__", path); getInstanceVariables().remove("__classid__"); } } if (path == null) { RubyObject tmp = rbModule.findClassPath(); if (tmp.isNil()) { return null; } return (RubyString)tmp; } /*if (!(path instanceof RubyString)) { throw new RubyBugException("class path is not set properly"); }*/ return path; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/RubyModule.java/clean/org/jruby/RubyModule.java
if (getInstanceVariables().get("__classid__") != null) { path = RubyString.m_newString(getRuby(), ((RubyId)getInstanceVariables().get("__classid__")).toName());
if (getInstanceVariables().get(getRuby().intern("__classid__")) != null) { path = RubyString.m_newString(getRuby(), ((RubyId)getInstanceVariables().get(getRuby().intern("__classid__"))).toName());
public RubyString getClassname() { RubyString path = null; RubyModule rbModule = this; while (rbModule.isIncluded() || rbModule.isSingleton()) { rbModule = ((RubyClass)rbModule).getSuperClass(); } if (rbModule == null) { rbModule = getRuby().getObjectClass(); } path = (RubyString)getInstanceVariables().get("__classpath__"); if (path == null) { if (getInstanceVariables().get("__classid__") != null) { path = RubyString.m_newString(getRuby(), ((RubyId)getInstanceVariables().get("__classid__")).toName()); // todo: convert from symbol to string getInstanceVariables().put("__classpath__", path); getInstanceVariables().remove("__classid__"); } } if (path == null) { RubyObject tmp = rbModule.findClassPath(); if (tmp.isNil()) { return null; } return (RubyString)tmp; } /*if (!(path instanceof RubyString)) { throw new RubyBugException("class path is not set properly"); }*/ return path; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/RubyModule.java/clean/org/jruby/RubyModule.java
getInstanceVariables().put("__classpath__", path); getInstanceVariables().remove("__classid__");
getInstanceVariables().put(getRuby().intern("__classpath__"), path); getInstanceVariables().remove(getRuby().intern("__classid__"));
public RubyString getClassname() { RubyString path = null; RubyModule rbModule = this; while (rbModule.isIncluded() || rbModule.isSingleton()) { rbModule = ((RubyClass)rbModule).getSuperClass(); } if (rbModule == null) { rbModule = getRuby().getObjectClass(); } path = (RubyString)getInstanceVariables().get("__classpath__"); if (path == null) { if (getInstanceVariables().get("__classid__") != null) { path = RubyString.m_newString(getRuby(), ((RubyId)getInstanceVariables().get("__classid__")).toName()); // todo: convert from symbol to string getInstanceVariables().put("__classpath__", path); getInstanceVariables().remove("__classid__"); } } if (path == null) { RubyObject tmp = rbModule.findClassPath(); if (tmp.isNil()) { return null; } return (RubyString)tmp; } /*if (!(path instanceof RubyString)) { throw new RubyBugException("class path is not set properly"); }*/ return path; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/RubyModule.java/clean/org/jruby/RubyModule.java
getInstanceVariables().put("__classpath__", value);
getInstanceVariables().put(getRuby().intern("__classpath__"), value);
public void setClassPath(RubyModule under, String name) { RubyString value = null; if (under == getRuby().getObjectClass()) { value = RubyString.m_newString(getRuby(), name); } else { value = (RubyString)under.getClassPath().m_dup(); value.m_cat("::"); value.m_cat(name); } getInstanceVariables().put("__classpath__", value); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/RubyModule.java/clean/org/jruby/RubyModule.java
getInstanceVariables().put("__classid__", id);
getInstanceVariables().put(getRuby().intern("__classid__"), id);
public void setName(RubyId id) { getInstanceVariables().put("__classid__", id); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/RubyModule.java/clean/org/jruby/RubyModule.java
new NoteTreeNode(tree, root);
new DisplayedNote(tree, root);
public void loadTree(Note root) { tree.removeAll(); new NoteTreeNode(tree, root); init(); }
57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/a21e67d29e81a4038ecb2d55530f57396df4085c/NoteTree.java/buggy/trunk/src/de/berlios/koalanotes/display/NoteTree.java
Login rootLogin = (Login) factory.getContext().getBean("rootLogin"); ServiceFactory rootFactory = new ServiceFactory( rootLogin ); fixture = new CreatePojosFixture( rootFactory ); fixture.createAllPojos();
protected void setUp() throws Exception { data = (OMEData) factory.getContext().getBean("data"); iPojos = factory.getPojosService(); iQuery = factory.getQueryService(); iUpdate = factory.getUpdateService(); try { iQuery.get(Experimenter.class,0l); } catch (Throwable t){ // TODO no, no, really. This is ok. (And temporary) } iQuery.get(Experimenter.class,0l); // if this one fails, skip rest. }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/975967c2ebf5a196f315cce5d47f2ae779d574fc/PojosServiceTest.java/buggy/components/client/test/ome/adapters/pojos/itests/PojosServiceTest.java
pd.setX(0); pd.setY(0); pd.setZ(0);
pd.setZ(0);
public void testAndForTheFunOfItLetsGetTheREWorking() throws Exception { Pixels pix = (Pixels) iQuery.findAll(Pixels.class,null).get(0); IPixels pixDB = factory.getPixelsService(); RenderingEngine re = factory.createRenderingEngine(); PlaneDef pd = new PlaneDef(0,0); pd.setX(0); pd.setY(0); pd.setZ(0); re.render(pd); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/975967c2ebf5a196f315cce5d47f2ae779d574fc/PojosServiceTest.java/buggy/components/client/test/ome/adapters/pojos/itests/PojosServiceTest.java
((Integer) original.getDetails().getCounts().get( Dataset.ANNOTATIONS)).intValue() > 0
((Long) original.getDetails().getCounts().get( Dataset.ANNOTATIONS)).intValue() > 0
public void test_annotating_a_dataset() throws Exception { String name = " two rows "+System.currentTimeMillis(); String text = " two rows content "+System.currentTimeMillis(); String desc = " new description "+System.currentTimeMillis(); // Setup: original is our in-memory, used every where object. Dataset original = new Dataset(); original.setName( name ); original = (Dataset) iPojos.createDataObject( original, null ); assertTrue( original.getDetails().getCounts() == null || original.getDetails().getCounts().get( Dataset.ANNOTATIONS ) == null ); original.setDescription( desc ); DatasetAnnotation annotation = new DatasetAnnotation(); annotation.setContent( text ); annotation.setDataset( original ); annotation = (DatasetAnnotation) iPojos.createDataObject( annotation, null ); original = annotation.getDataset(); // TODO is this okay? assertUniqueAnnotationCreation(name, text); Dataset test = (Dataset) iQuery.get( Dataset.class, original.getId().longValue() ); assertTrue( desc.equals( test.getDescription() )); assertNotNull(original.getDetails().getCounts()); assertNotNull(original.getDetails().getCounts().get( Dataset.ANNOTATIONS )); assertTrue( ((Integer) original.getDetails().getCounts().get( Dataset.ANNOTATIONS)).intValue() > 0 ); System.out.println( original.getDetails().getCounts()); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/975967c2ebf5a196f315cce5d47f2ae779d574fc/PojosServiceTest.java/buggy/components/client/test/ome/adapters/pojos/itests/PojosServiceTest.java
assertTrue( original.getClass().equals( annotation.getClass() ));
assertTrue( String.format("Class %s should equal class %s", object.getClass(), annotation.getClass()), object.getClass().equals( annotation.getClass() ));
public void test_annotating_a_dataset_cglib_issue() throws Exception { // Setup: original is our in-memory, used every where object. Dataset original = new Dataset(); original.setName( " two rows " ); original = (Dataset) iPojos.createDataObject( original, null ); DatasetData annotatedObject = new DatasetData( original ); Dataset annotated = (Dataset) iPojos.updateDataObject( annotatedObject.asIObject(), null); // Dataset m = new Dataset( original.getId(), false); DatasetAnnotation annotation = new DatasetAnnotation(); annotation.setContent( " two rows content " ); annotation.setDataset( annotated ); // CGLIB DatasetAnnotation object = (DatasetAnnotation) iPojos.createDataObject( annotation , null ); DataObject returnedToUser = new AnnotationData( object ); // Now working but iPojos is still returning a CGLIB class. assertTrue( original.getClass().equals( annotation.getClass() )); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/975967c2ebf5a196f315cce5d47f2ae779d574fc/PojosServiceTest.java/buggy/components/client/test/ome/adapters/pojos/itests/PojosServiceTest.java
counts = getCounts( Dataset.class, new Long(7770L), null );
counts = getCounts( Dataset.class, fixture.du7770.getId(), null );
public void test_counts() throws Exception { Map counts; counts = getCounts( Dataset.class, new Long(7770L), null ); assertNull( counts ); PojoOptions po = new PojoOptions().leaves(); counts = getCounts( Dataset.class, new Long(7770L), po.map() ); assertTrue( counts == null || null == counts.get( Image.ANNOTATIONS )); assertTrue( counts == null || null == counts.get( Dataset.ANNOTATIONS ) ); counts = getCounts( Dataset.class, new Long(7771L), null ); assertNull( counts.get( Image.ANNOTATIONS )); assertTrue( counts.containsKey( Dataset.ANNOTATIONS )); assertTrue( ( (Long) counts.get( Dataset.ANNOTATIONS) ).intValue() == 1 ); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/975967c2ebf5a196f315cce5d47f2ae779d574fc/PojosServiceTest.java/buggy/components/client/test/ome/adapters/pojos/itests/PojosServiceTest.java
counts = getCounts( Dataset.class, new Long(7770L), po.map() );
counts = getCounts( Dataset.class, fixture.du7770.getId(), po.map() );
public void test_counts() throws Exception { Map counts; counts = getCounts( Dataset.class, new Long(7770L), null ); assertNull( counts ); PojoOptions po = new PojoOptions().leaves(); counts = getCounts( Dataset.class, new Long(7770L), po.map() ); assertTrue( counts == null || null == counts.get( Image.ANNOTATIONS )); assertTrue( counts == null || null == counts.get( Dataset.ANNOTATIONS ) ); counts = getCounts( Dataset.class, new Long(7771L), null ); assertNull( counts.get( Image.ANNOTATIONS )); assertTrue( counts.containsKey( Dataset.ANNOTATIONS )); assertTrue( ( (Long) counts.get( Dataset.ANNOTATIONS) ).intValue() == 1 ); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/975967c2ebf5a196f315cce5d47f2ae779d574fc/PojosServiceTest.java/buggy/components/client/test/ome/adapters/pojos/itests/PojosServiceTest.java
counts = getCounts( Dataset.class, new Long(7771L), null );
counts = getCounts( Dataset.class, fixture.du7771.getId(), null );
public void test_counts() throws Exception { Map counts; counts = getCounts( Dataset.class, new Long(7770L), null ); assertNull( counts ); PojoOptions po = new PojoOptions().leaves(); counts = getCounts( Dataset.class, new Long(7770L), po.map() ); assertTrue( counts == null || null == counts.get( Image.ANNOTATIONS )); assertTrue( counts == null || null == counts.get( Dataset.ANNOTATIONS ) ); counts = getCounts( Dataset.class, new Long(7771L), null ); assertNull( counts.get( Image.ANNOTATIONS )); assertTrue( counts.containsKey( Dataset.ANNOTATIONS )); assertTrue( ( (Long) counts.get( Dataset.ANNOTATIONS) ).intValue() == 1 ); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/975967c2ebf5a196f315cce5d47f2ae779d574fc/PojosServiceTest.java/buggy/components/client/test/ome/adapters/pojos/itests/PojosServiceTest.java
Long id = new Long(5551);
Long id = fixture.iu5551.getId();
public void test_getCollectionCount() throws Exception { Long id = new Long(5551); Map m = iPojos.getCollectionCount( Image.class.getName(), Image.ANNOTATIONS, Collections.singleton(id), null); Integer count = (Integer) m.get(id); assertTrue(count.intValue() > 0); id = new Long(7771); m = iPojos.getCollectionCount( Dataset.class.getName(), Dataset.IMAGELINKS, Collections.singleton( id ), null); count = (Integer) m.get(id); assertTrue(count.intValue() > 0); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/975967c2ebf5a196f315cce5d47f2ae779d574fc/PojosServiceTest.java/buggy/components/client/test/ome/adapters/pojos/itests/PojosServiceTest.java
id = new Long(7771);
id = fixture.du7771.getId();
public void test_getCollectionCount() throws Exception { Long id = new Long(5551); Map m = iPojos.getCollectionCount( Image.class.getName(), Image.ANNOTATIONS, Collections.singleton(id), null); Integer count = (Integer) m.get(id); assertTrue(count.intValue() > 0); id = new Long(7771); m = iPojos.getCollectionCount( Dataset.class.getName(), Dataset.IMAGELINKS, Collections.singleton( id ), null); count = (Integer) m.get(id); assertTrue(count.intValue() > 0); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/975967c2ebf5a196f315cce5d47f2ae779d574fc/PojosServiceTest.java/buggy/components/client/test/ome/adapters/pojos/itests/PojosServiceTest.java
results = iPojos.getUserImages(new PojoOptions().exp(new Long(10000)).map());
results = iPojos.getUserImages( new PojoOptions().exp(fixture.e.getId()).map());
public void test_getUserImages() throws Exception { try { results = iPojos.getUserImages(null); fail("APIUsage: experimenter/group option must be set."); } catch (ApiUsageException e) { // ok. } catch (EJBException ejbe) { log.warn("Should not be here."); //TODO } results = iPojos.getUserImages(new PojoOptions().exp(new Long(10000)).map()); assertTrue(results.size() > 0); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/975967c2ebf5a196f315cce5d47f2ae779d574fc/PojosServiceTest.java/buggy/components/client/test/ome/adapters/pojos/itests/PojosServiceTest.java
Image i = (Image) iQuery.get(Image.class,5551);
Image i = (Image) iQuery.get(Image.class,fixture.iu5551.getId());
public void test_retrieveCollection() throws Exception { Image i = (Image) iQuery.get(Image.class,5551); i.unload(); Set annotations = (Set) iPojos.retrieveCollection(i,Image.ANNOTATIONS,null); assertTrue(annotations.size() > 0); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/975967c2ebf5a196f315cce5d47f2ae779d574fc/PojosServiceTest.java/buggy/components/client/test/ome/adapters/pojos/itests/PojosServiceTest.java
d2 = (Dataset) iPojos.createDataObject( d2, null );
public void test_two_datasets_and_a_project() throws Exception { String name = " 2&1 "+System.currentTimeMillis(); Project p = new Project(); p.setName( name ); p = (Project) iPojos.createDataObject( p, null ); Dataset d1 = new Dataset(); d1.setName( name ); Dataset d2 = new Dataset(); d2.setName( name ); ProjectDatasetLink l1 = new ProjectDatasetLink(); ProjectDatasetLink l2 = new ProjectDatasetLink(); l1.setParent( p ); l1.setChild( d1 ); l2.setParent( p ); l2.setChild( d2 ); p.addProjectDatasetLink( l1, true ); p.addProjectDatasetLink( l2, true ); p = (Project) iPojos.updateDataObject( p, null ); Iterator it = p.iterateDatasetLinks(); while ( it.hasNext() ) { ProjectDatasetLink link = (ProjectDatasetLink) it.next(); if ( link.child().getId().equals( d1.getId() )) { l1 = link; d1 = link.child(); } else if ( link.child().getId().equals( d2.getId() )) { l2 = link; d2 = link.child(); } else { fail( " Links aren't set up propertly"); } } d1.setDescription( name ); Dataset test = (Dataset) iPojos.updateDataObject( d1, null ); ProjectDatasetLink link1 = (ProjectDatasetLink) iQuery.get( ProjectDatasetLink.class, l1.getId().longValue() ); assertNotNull( link1 ); assertTrue( link1.parent().getId().equals( p.getId())); assertTrue( link1.child().getId().equals( d1.getId() )); ProjectDatasetLink link2 = (ProjectDatasetLink) iQuery.get( ProjectDatasetLink.class, l2.getId().longValue() ); assertNotNull( link2 ); assertTrue( link2.parent().getId().equals( p.getId())); assertTrue( link2.child().getId().equals( d2.getId() )); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/975967c2ebf5a196f315cce5d47f2ae779d574fc/PojosServiceTest.java/buggy/components/client/test/ome/adapters/pojos/itests/PojosServiceTest.java
Project p = new Project(); p.setName("ui"); Dataset d = new Dataset(); d.setName("ui"); Image i = new Image(); i.setName("ui"); p.linkDataset( d ); d.linkImage( i ); p = iPojos.createDataObject( p, null );
public void test_unloaded_ds_in_ui() throws Exception {// Project p = new Project(); p.setName("ui");// Dataset d = new Dataset(); d.setName("ui");// Image i = new Image(); i.setName("ui");// p.linkDataset( d );// d.linkImage( i );// // ProjectData pd = new ProjectData( (Project)// iPojos.createDataObject( p, null )// ); PojoOptions po = new PojoOptions().exp( new Long( 0L ) ); ProjectData pd_test = new ProjectData( (Project) iPojos.loadContainerHierarchy( Project.class, null, po.map()) .iterator().next() ); DatasetData dd_test = (DatasetData) pd_test.getDatasets().iterator().next(); pd_test.setDescription("new value:ui"); iPojos.updateDataObject( pd_test.asIObject(), null ); try { dd_test.getName(); fail(" this should blow up "); } catch (Exception e ){ // TODO which exception? // good. } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/975967c2ebf5a196f315cce5d47f2ae779d574fc/PojosServiceTest.java/buggy/components/client/test/ome/adapters/pojos/itests/PojosServiceTest.java
PojoOptions po = new PojoOptions().exp( new Long( 0L ) );
public void test_unloaded_ds_in_ui() throws Exception {// Project p = new Project(); p.setName("ui");// Dataset d = new Dataset(); d.setName("ui");// Image i = new Image(); i.setName("ui");// p.linkDataset( d );// d.linkImage( i );// // ProjectData pd = new ProjectData( (Project)// iPojos.createDataObject( p, null )// ); PojoOptions po = new PojoOptions().exp( new Long( 0L ) ); ProjectData pd_test = new ProjectData( (Project) iPojos.loadContainerHierarchy( Project.class, null, po.map()) .iterator().next() ); DatasetData dd_test = (DatasetData) pd_test.getDatasets().iterator().next(); pd_test.setDescription("new value:ui"); iPojos.updateDataObject( pd_test.asIObject(), null ); try { dd_test.getName(); fail(" this should blow up "); } catch (Exception e ){ // TODO which exception? // good. } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/975967c2ebf5a196f315cce5d47f2ae779d574fc/PojosServiceTest.java/buggy/components/client/test/ome/adapters/pojos/itests/PojosServiceTest.java
iPojos.loadContainerHierarchy( Project.class, null, po.map())
iPojos.loadContainerHierarchy( Project.class, Collections.singleton(p.getId()), null)
public void test_unloaded_ds_in_ui() throws Exception {// Project p = new Project(); p.setName("ui");// Dataset d = new Dataset(); d.setName("ui");// Image i = new Image(); i.setName("ui");// p.linkDataset( d );// d.linkImage( i );// // ProjectData pd = new ProjectData( (Project)// iPojos.createDataObject( p, null )// ); PojoOptions po = new PojoOptions().exp( new Long( 0L ) ); ProjectData pd_test = new ProjectData( (Project) iPojos.loadContainerHierarchy( Project.class, null, po.map()) .iterator().next() ); DatasetData dd_test = (DatasetData) pd_test.getDatasets().iterator().next(); pd_test.setDescription("new value:ui"); iPojos.updateDataObject( pd_test.asIObject(), null ); try { dd_test.getName(); fail(" this should blow up "); } catch (Exception e ){ // TODO which exception? // good. } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/975967c2ebf5a196f315cce5d47f2ae779d574fc/PojosServiceTest.java/buggy/components/client/test/ome/adapters/pojos/itests/PojosServiceTest.java
public InProcessScript(String[] argArray, InputStream in, PrintStream out, PrintStream err) {
public InProcessScript(String[] argArray, InputStream in, PrintStream out, PrintStream err, File dir) {
public InProcessScript(String[] argArray, InputStream in, PrintStream out, PrintStream err) { this.argArray = argArray; this.in = in; this.out = out; this.err = err; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c30da196a486853692150e8be1d9d034f60e00b3/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java
this.dir = dir;
public InProcessScript(String[] argArray, InputStream in, PrintStream out, PrintStream err) { this.argArray = argArray; this.in = in; this.out = out; this.err = err; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c30da196a486853692150e8be1d9d034f60e00b3/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java
result = new Main(in, out, err).run(argArray);
String oldDir = System.getProperty("user.dir"); try { System.setProperty("user.dir", dir.getAbsolutePath()); result = new Main(in, out, err).run(argArray); } finally { System.setProperty("user.dir", oldDir); }
public void run() { result = new Main(in, out, err).run(argArray); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c30da196a486853692150e8be1d9d034f60e00b3/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java
ipScript = new InProcessScript(argArray, System.in, redirect, redirect);
ipScript = new InProcessScript(argArray, System.in, redirect, redirect, pwd);
public static int runInShell(IRuby runtime, IRubyObject[] rawArgs, OutputStream output) { try { // startup scripts set jruby.shell to /bin/sh for Unix, cmd.exe for Windows String shell = System.getProperty("jruby.shell"); rawArgs[0] = runtime.newString(repairDirSeps(rawArgs[0].toString())); Process aProcess = null; InProcessScript ipScript = null; if (isRubyCommand(rawArgs[0].toString())) { List args = parseCommandLine(rawArgs); PrintStream redirect = new PrintStream(output); String command = (String)args.get(0); String[] argArray = new String[args.size()-1]; // snip off ruby or jruby command from list of arguments // leave alone if the command is the name of a script int startIndex = command.endsWith(".rb") ? 0 : 1; args.subList(startIndex,args.size()).toArray(argArray); // FIXME: Where should we get in and err from? ipScript = new InProcessScript(argArray, System.in, redirect, redirect); // execute ruby command in-process ipScript.start(); ipScript.join(); } else if (shell != null && rawArgs.length == 1) { // execute command with sh -c or cmd.exe /c // this does shell expansion of wildcards String shellSwitch = shell.endsWith("sh") ? "-c" : "/c"; String[] argArray = new String[3]; argArray[0] = shell; argArray[1] = shellSwitch; argArray[2] = rawArgs[0].toString(); aProcess = Runtime.getRuntime().exec(argArray); } else { // execute command directly, no wildcard expansion if (rawArgs.length > 1) { String[] argArray = new String[rawArgs.length]; for (int i=0;i<rawArgs.length;i++) { argArray[i] = rawArgs[i].toString(); } aProcess = Runtime.getRuntime().exec(argArray); } else { aProcess = Runtime.getRuntime().exec(rawArgs[0].toString()); } } if (aProcess != null) { InputStream processOutput = aProcess.getInputStream(); // Fairly innefficient impl, but readLine is unable to tell // whether the last line in a process ended with a newline or not. int b; boolean crSeen = false; while ((b = processOutput.read()) != -1) { if (b == '\r') { crSeen = true; } else { if (crSeen) { if (b != '\n') { output.write('\r'); } crSeen = false; } output.write(b); } } if (crSeen) { output.write('\r'); } aProcess.getErrorStream().close(); aProcess.getOutputStream().close(); processOutput.close(); return aProcess.waitFor(); } else if (ipScript != null) { return ipScript.getResult(); } else { return 0; } } catch (IOException e) { throw runtime.newIOErrorFromException(e); } catch (InterruptedException e) { throw runtime.newThreadError("unexpected interrupt"); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c30da196a486853692150e8be1d9d034f60e00b3/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java
aProcess = Runtime.getRuntime().exec(argArray);
aProcess = Runtime.getRuntime().exec(argArray, new String[]{}, pwd);
public static int runInShell(IRuby runtime, IRubyObject[] rawArgs, OutputStream output) { try { // startup scripts set jruby.shell to /bin/sh for Unix, cmd.exe for Windows String shell = System.getProperty("jruby.shell"); rawArgs[0] = runtime.newString(repairDirSeps(rawArgs[0].toString())); Process aProcess = null; InProcessScript ipScript = null; if (isRubyCommand(rawArgs[0].toString())) { List args = parseCommandLine(rawArgs); PrintStream redirect = new PrintStream(output); String command = (String)args.get(0); String[] argArray = new String[args.size()-1]; // snip off ruby or jruby command from list of arguments // leave alone if the command is the name of a script int startIndex = command.endsWith(".rb") ? 0 : 1; args.subList(startIndex,args.size()).toArray(argArray); // FIXME: Where should we get in and err from? ipScript = new InProcessScript(argArray, System.in, redirect, redirect); // execute ruby command in-process ipScript.start(); ipScript.join(); } else if (shell != null && rawArgs.length == 1) { // execute command with sh -c or cmd.exe /c // this does shell expansion of wildcards String shellSwitch = shell.endsWith("sh") ? "-c" : "/c"; String[] argArray = new String[3]; argArray[0] = shell; argArray[1] = shellSwitch; argArray[2] = rawArgs[0].toString(); aProcess = Runtime.getRuntime().exec(argArray); } else { // execute command directly, no wildcard expansion if (rawArgs.length > 1) { String[] argArray = new String[rawArgs.length]; for (int i=0;i<rawArgs.length;i++) { argArray[i] = rawArgs[i].toString(); } aProcess = Runtime.getRuntime().exec(argArray); } else { aProcess = Runtime.getRuntime().exec(rawArgs[0].toString()); } } if (aProcess != null) { InputStream processOutput = aProcess.getInputStream(); // Fairly innefficient impl, but readLine is unable to tell // whether the last line in a process ended with a newline or not. int b; boolean crSeen = false; while ((b = processOutput.read()) != -1) { if (b == '\r') { crSeen = true; } else { if (crSeen) { if (b != '\n') { output.write('\r'); } crSeen = false; } output.write(b); } } if (crSeen) { output.write('\r'); } aProcess.getErrorStream().close(); aProcess.getOutputStream().close(); processOutput.close(); return aProcess.waitFor(); } else if (ipScript != null) { return ipScript.getResult(); } else { return 0; } } catch (IOException e) { throw runtime.newIOErrorFromException(e); } catch (InterruptedException e) { throw runtime.newThreadError("unexpected interrupt"); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c30da196a486853692150e8be1d9d034f60e00b3/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java
aProcess = Runtime.getRuntime().exec(argArray);
aProcess = Runtime.getRuntime().exec(argArray, new String[]{}, pwd);
public static int runInShell(IRuby runtime, IRubyObject[] rawArgs, OutputStream output) { try { // startup scripts set jruby.shell to /bin/sh for Unix, cmd.exe for Windows String shell = System.getProperty("jruby.shell"); rawArgs[0] = runtime.newString(repairDirSeps(rawArgs[0].toString())); Process aProcess = null; InProcessScript ipScript = null; if (isRubyCommand(rawArgs[0].toString())) { List args = parseCommandLine(rawArgs); PrintStream redirect = new PrintStream(output); String command = (String)args.get(0); String[] argArray = new String[args.size()-1]; // snip off ruby or jruby command from list of arguments // leave alone if the command is the name of a script int startIndex = command.endsWith(".rb") ? 0 : 1; args.subList(startIndex,args.size()).toArray(argArray); // FIXME: Where should we get in and err from? ipScript = new InProcessScript(argArray, System.in, redirect, redirect); // execute ruby command in-process ipScript.start(); ipScript.join(); } else if (shell != null && rawArgs.length == 1) { // execute command with sh -c or cmd.exe /c // this does shell expansion of wildcards String shellSwitch = shell.endsWith("sh") ? "-c" : "/c"; String[] argArray = new String[3]; argArray[0] = shell; argArray[1] = shellSwitch; argArray[2] = rawArgs[0].toString(); aProcess = Runtime.getRuntime().exec(argArray); } else { // execute command directly, no wildcard expansion if (rawArgs.length > 1) { String[] argArray = new String[rawArgs.length]; for (int i=0;i<rawArgs.length;i++) { argArray[i] = rawArgs[i].toString(); } aProcess = Runtime.getRuntime().exec(argArray); } else { aProcess = Runtime.getRuntime().exec(rawArgs[0].toString()); } } if (aProcess != null) { InputStream processOutput = aProcess.getInputStream(); // Fairly innefficient impl, but readLine is unable to tell // whether the last line in a process ended with a newline or not. int b; boolean crSeen = false; while ((b = processOutput.read()) != -1) { if (b == '\r') { crSeen = true; } else { if (crSeen) { if (b != '\n') { output.write('\r'); } crSeen = false; } output.write(b); } } if (crSeen) { output.write('\r'); } aProcess.getErrorStream().close(); aProcess.getOutputStream().close(); processOutput.close(); return aProcess.waitFor(); } else if (ipScript != null) { return ipScript.getResult(); } else { return 0; } } catch (IOException e) { throw runtime.newIOErrorFromException(e); } catch (InterruptedException e) { throw runtime.newThreadError("unexpected interrupt"); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c30da196a486853692150e8be1d9d034f60e00b3/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java
aProcess = Runtime.getRuntime().exec(rawArgs[0].toString());
aProcess = Runtime.getRuntime().exec(rawArgs[0].toString(), new String[]{}, pwd);
public static int runInShell(IRuby runtime, IRubyObject[] rawArgs, OutputStream output) { try { // startup scripts set jruby.shell to /bin/sh for Unix, cmd.exe for Windows String shell = System.getProperty("jruby.shell"); rawArgs[0] = runtime.newString(repairDirSeps(rawArgs[0].toString())); Process aProcess = null; InProcessScript ipScript = null; if (isRubyCommand(rawArgs[0].toString())) { List args = parseCommandLine(rawArgs); PrintStream redirect = new PrintStream(output); String command = (String)args.get(0); String[] argArray = new String[args.size()-1]; // snip off ruby or jruby command from list of arguments // leave alone if the command is the name of a script int startIndex = command.endsWith(".rb") ? 0 : 1; args.subList(startIndex,args.size()).toArray(argArray); // FIXME: Where should we get in and err from? ipScript = new InProcessScript(argArray, System.in, redirect, redirect); // execute ruby command in-process ipScript.start(); ipScript.join(); } else if (shell != null && rawArgs.length == 1) { // execute command with sh -c or cmd.exe /c // this does shell expansion of wildcards String shellSwitch = shell.endsWith("sh") ? "-c" : "/c"; String[] argArray = new String[3]; argArray[0] = shell; argArray[1] = shellSwitch; argArray[2] = rawArgs[0].toString(); aProcess = Runtime.getRuntime().exec(argArray); } else { // execute command directly, no wildcard expansion if (rawArgs.length > 1) { String[] argArray = new String[rawArgs.length]; for (int i=0;i<rawArgs.length;i++) { argArray[i] = rawArgs[i].toString(); } aProcess = Runtime.getRuntime().exec(argArray); } else { aProcess = Runtime.getRuntime().exec(rawArgs[0].toString()); } } if (aProcess != null) { InputStream processOutput = aProcess.getInputStream(); // Fairly innefficient impl, but readLine is unable to tell // whether the last line in a process ended with a newline or not. int b; boolean crSeen = false; while ((b = processOutput.read()) != -1) { if (b == '\r') { crSeen = true; } else { if (crSeen) { if (b != '\n') { output.write('\r'); } crSeen = false; } output.write(b); } } if (crSeen) { output.write('\r'); } aProcess.getErrorStream().close(); aProcess.getOutputStream().close(); processOutput.close(); return aProcess.waitFor(); } else if (ipScript != null) { return ipScript.getResult(); } else { return 0; } } catch (IOException e) { throw runtime.newIOErrorFromException(e); } catch (InterruptedException e) { throw runtime.newThreadError("unexpected interrupt"); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c30da196a486853692150e8be1d9d034f60e00b3/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java
int n = Integer.parseInt(args[0]);
public static void main(String args[]) { //@START int n = Integer.parseInt(args[0]); int result = 0; for (int i = 0; i < n; i++) { result = test_lists(); } System.out.println(result); //@END }
53330 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53330/eb6c850277407b38bcaefb81155941da0f27b849/lists.java/buggy/tests/shootout/java-start/lists.java
lensImage = itMng.buildDisplayImage(lensImage);
public BufferedImage getPinImage() { if (lensImage == null) return null; return ImageFactory.getImage(lensImage); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/8846f7da5fbaf4d3fb83aa43b5616bcd13483654/ImageCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/canvas/ImageCanvas.java
lensImage = itMng.buildDisplayImage(lensImage);
public BufferedImage getPinOnImage() { if (lensImage == null || displayImage == null) return null; return ImageFactory.getImagePinOn(displayImage, lensImage, xLens-ViewerUIF.START, yLens-ViewerUIF.START); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/8846f7da5fbaf4d3fb83aa43b5616bcd13483654/ImageCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/canvas/ImageCanvas.java
lensImage = itMng.buildDisplayImage(lensImage);
public BufferedImage getPinOnSide(boolean painting, Color c) { if (lensImage == null || displayImage == null) return null; int widthNew = (int) (manager.getWidth()/manager.getMagFactorLens()); return ImageFactory.getImagePinOnSide(displayImage, lensImage, xTopCorner, yTopCorner, widthNew, widthNew, painting, c); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/8846f7da5fbaf4d3fb83aa43b5616bcd13483654/ImageCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/canvas/ImageCanvas.java
int w = (int) (lensWidth/f); xTopCorner = p.x-w; yTopCorner = p.y-w; BufferedImage img = ImageFactory.getImage(displayImage, xTopCorner, yTopCorner, w, w, painting, c); lensImage = itMng.buildDisplayImage(img, f);
int w = (int) (lensWidth/(2*f)); xTopCorner = p.x-ViewerUIF.START-w; yTopCorner = p.y-ViewerUIF.START-w; int x = (int) ((p.x-ViewerUIF.START)*f)-lensWidth/2; int y = (int) ((p.y-ViewerUIF.START)*f)-lensWidth/2; BufferedImage img = itMng.buildDisplayImage(displayImage, f); lensImage = ImageFactory.getImage(img, x, y, lensWidth, lensWidth, painting, c);
void paintLensImage(double f, Point p, int lensWidth, boolean painting, Color c) { xLens = p.x-lensWidth/2; yLens = p.y-lensWidth/2; int w = (int) (lensWidth/f); xTopCorner = p.x-w; yTopCorner = p.y-w; BufferedImage img = ImageFactory.getImage(displayImage, xTopCorner, yTopCorner, w, w, painting, c); lensImage = itMng.buildDisplayImage(img, f); repaint(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/8846f7da5fbaf4d3fb83aa43b5616bcd13483654/ImageCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/canvas/ImageCanvas.java
ImageCanvasMng(ImageCanvas view)
ImageCanvasMng(ImageCanvas view, ViewerCtrl control)
ImageCanvasMng(ImageCanvas view) { this.view = view; width = ViewerUIF.DEFAULT_WIDTH; magFactor = ViewerUIF.DEFAULT_MAG; drawingArea = new Rectangle(); onOff = true; pin = false; painting = false; attachListeners(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/637cfc480ca0f34d360e30b6cf903cef502fa8dc/ImageCanvasMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/canvas/ImageCanvasMng.java
click = false;
ImageCanvasMng(ImageCanvas view) { this.view = view; width = ViewerUIF.DEFAULT_WIDTH; magFactor = ViewerUIF.DEFAULT_MAG; drawingArea = new Rectangle(); onOff = true; pin = false; painting = false; attachListeners(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/637cfc480ca0f34d360e30b6cf903cef502fa8dc/ImageCanvasMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/canvas/ImageCanvasMng.java
void setDrawingArea(int x, int y, int w, int h) { //drawingArea.setBounds(x-width, y-width, w-2*width, h-2*width); drawingArea.setBounds(x+width/2, y+width/2, w-width, h-width); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/637cfc480ca0f34d360e30b6cf903cef502fa8dc/ImageCanvasMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/canvas/ImageCanvasMng.java
state = ImViewer.RENDERING_CONTROL_LOADED;
void setRenderingControl(RenderingControl rndControl) { this.rndControl = rndControl; renderer = RendererFactory.createRenderer(component, rndControl); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/ImViewerModel.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerModel.java
RosterDialog dialog = new RosterDialog(); String jid = (String)resultsTable.getValueAt(row, 0);
RosterDialog dialog = new RosterDialog(); String jid = (String)resultsTable.getValueAt(row, 0);
public void actionPerformed(ActionEvent e) { RosterDialog dialog = new RosterDialog(); String jid = (String)resultsTable.getValueAt(row, 0); TableColumn column = null; try { column = resultsTable.getColumn("Username"); } catch (Exception ex) { try { column = resultsTable.getColumn("nick"); } catch (Exception e1) { } } if (column != null) { int col = column.getModelIndex(); String nickname = (String)resultsTable.getValueAt(row, col); if (!ModelUtil.hasLength(nickname)) { nickname = StringUtils.parseName(jid); } dialog.setDefaultNickname(nickname); } dialog.setDefaultJID(jid); dialog.showRosterDialog(); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/89fd2815c162e5d302583d26afbc300dc5aec22f/UserSearchResults.java/clean/src/java/org/jivesoftware/sparkimpl/search/users/UserSearchResults.java
TableColumn column = null; try { column = resultsTable.getColumn("Username"); } catch (Exception ex) { try { column = resultsTable.getColumn("nick"); } catch (Exception e1) { } } if (column != null) { int col = column.getModelIndex(); String nickname = (String)resultsTable.getValueAt(row, col); if (!ModelUtil.hasLength(nickname)) { nickname = StringUtils.parseName(jid); } dialog.setDefaultNickname(nickname); }
TableColumn column = null; try { column = resultsTable.getColumn("Username"); } catch (Exception ex) { try { column = resultsTable.getColumn("nick"); } catch (Exception e1) { } } if (column != null) { int col = column.getModelIndex(); String nickname = (String)resultsTable.getValueAt(row, col); if (!ModelUtil.hasLength(nickname)) { nickname = StringUtils.parseName(jid); } dialog.setDefaultNickname(nickname); }
public void actionPerformed(ActionEvent e) { RosterDialog dialog = new RosterDialog(); String jid = (String)resultsTable.getValueAt(row, 0); TableColumn column = null; try { column = resultsTable.getColumn("Username"); } catch (Exception ex) { try { column = resultsTable.getColumn("nick"); } catch (Exception e1) { } } if (column != null) { int col = column.getModelIndex(); String nickname = (String)resultsTable.getValueAt(row, col); if (!ModelUtil.hasLength(nickname)) { nickname = StringUtils.parseName(jid); } dialog.setDefaultNickname(nickname); } dialog.setDefaultJID(jid); dialog.showRosterDialog(); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/89fd2815c162e5d302583d26afbc300dc5aec22f/UserSearchResults.java/clean/src/java/org/jivesoftware/sparkimpl/search/users/UserSearchResults.java
dialog.setDefaultJID(jid); dialog.showRosterDialog(); }
dialog.setDefaultJID(jid); dialog.showRosterDialog(); }
public void actionPerformed(ActionEvent e) { RosterDialog dialog = new RosterDialog(); String jid = (String)resultsTable.getValueAt(row, 0); TableColumn column = null; try { column = resultsTable.getColumn("Username"); } catch (Exception ex) { try { column = resultsTable.getColumn("nick"); } catch (Exception e1) { } } if (column != null) { int col = column.getModelIndex(); String nickname = (String)resultsTable.getValueAt(row, col); if (!ModelUtil.hasLength(nickname)) { nickname = StringUtils.parseName(jid); } dialog.setDefaultNickname(nickname); } dialog.setDefaultJID(jid); dialog.showRosterDialog(); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/89fd2815c162e5d302583d26afbc300dc5aec22f/UserSearchResults.java/clean/src/java/org/jivesoftware/sparkimpl/search/users/UserSearchResults.java
openChatRoom(row); }
openChatRoom(row); }
public void actionPerformed(ActionEvent e) { openChatRoom(row); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/89fd2815c162e5d302583d26afbc300dc5aec22f/UserSearchResults.java/clean/src/java/org/jivesoftware/sparkimpl/search/users/UserSearchResults.java
VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = (String)resultsTable.getValueAt(row, 0); vcardSupport.viewProfile(jid, resultsTable); }
VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = (String)resultsTable.getValueAt(row, 0); vcardSupport.viewProfile(jid, resultsTable); }
public void actionPerformed(ActionEvent e) { VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = (String)resultsTable.getValueAt(row, 0); vcardSupport.viewProfile(jid, resultsTable); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/89fd2815c162e5d302583d26afbc300dc5aec22f/UserSearchResults.java/clean/src/java/org/jivesoftware/sparkimpl/search/users/UserSearchResults.java
if (!e.isPopupTrigger()) { return; } final int row = resultsTable.rowAtPoint(e.getPoint()); final JPopupMenu menu = new JPopupMenu(); Action addContactAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { RosterDialog dialog = new RosterDialog(); String jid = (String)resultsTable.getValueAt(row, 0); TableColumn column = null; try { column = resultsTable.getColumn("Username"); } catch (Exception ex) { try { column = resultsTable.getColumn("nick"); } catch (Exception e1) { } } if (column != null) { int col = column.getModelIndex(); String nickname = (String)resultsTable.getValueAt(row, col); if (!ModelUtil.hasLength(nickname)) { nickname = StringUtils.parseName(jid); } dialog.setDefaultNickname(nickname); } dialog.setDefaultJID(jid); dialog.showRosterDialog(); } }; Action chatAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { openChatRoom(row); } }; Action profileAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = (String)resultsTable.getValueAt(row, 0); vcardSupport.viewProfile(jid, resultsTable); } }; final JMenuItem addAsContact = new JMenuItem(addContactAction); addContactAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); addContactAction.putValue(Action.NAME, "Add as Contact"); menu.add(addAsContact); final JMenuItem chatMenu = new JMenuItem(chatAction); chatAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); chatAction.putValue(Action.NAME, "Chat"); menu.add(chatMenu); final JMenuItem viewProfileMenu = new JMenuItem(profileAction); profileAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_PROFILE_IMAGE)); profileAction.putValue(Action.NAME, "View Profile"); menu.add(viewProfileMenu); menu.show(resultsTable, e.getX(), e.getY());
checkPopup(e);
public void showUsersFound(ReportedData data) { List columnList = new ArrayList(); Iterator columns = data.getColumns(); while (columns.hasNext()) { ReportedData.Column column = (ReportedData.Column)columns.next(); String label = column.getLabel(); columnList.add(label); } if (resultsTable == null) { resultsTable = new UsersInfoTable((String[])columnList.toArray(new String[columnList.size()])); final JScrollPane scrollPane = new JScrollPane(resultsTable); scrollPane.getViewport().setBackground(Color.white); add(scrollPane, BorderLayout.CENTER); resultsTable.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { int row = resultsTable.getSelectedRow(); openChatRoom(row); } } public void mouseReleased(MouseEvent e) { if (!e.isPopupTrigger()) { return; } // Get agent final int row = resultsTable.rowAtPoint(e.getPoint()); final JPopupMenu menu = new JPopupMenu(); Action addContactAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { RosterDialog dialog = new RosterDialog(); String jid = (String)resultsTable.getValueAt(row, 0); TableColumn column = null; try { column = resultsTable.getColumn("Username"); } catch (Exception ex) { try { column = resultsTable.getColumn("nick"); } catch (Exception e1) { } } if (column != null) { int col = column.getModelIndex(); String nickname = (String)resultsTable.getValueAt(row, col); if (!ModelUtil.hasLength(nickname)) { nickname = StringUtils.parseName(jid); } dialog.setDefaultNickname(nickname); } dialog.setDefaultJID(jid); dialog.showRosterDialog(); } }; Action chatAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { openChatRoom(row); } }; Action profileAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = (String)resultsTable.getValueAt(row, 0); vcardSupport.viewProfile(jid, resultsTable); } }; final JMenuItem addAsContact = new JMenuItem(addContactAction); addContactAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); addContactAction.putValue(Action.NAME, "Add as Contact"); menu.add(addAsContact); final JMenuItem chatMenu = new JMenuItem(chatAction); chatAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); chatAction.putValue(Action.NAME, "Chat"); menu.add(chatMenu); final JMenuItem viewProfileMenu = new JMenuItem(profileAction); profileAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_PROFILE_IMAGE)); profileAction.putValue(Action.NAME, "View Profile"); menu.add(viewProfileMenu); menu.show(resultsTable, e.getX(), e.getY()); } public void mousePressed(MouseEvent e) { } }); } else { resultsTable.clearTable(); } // Populate with answers Iterator rows = data.getRows(); List modelList; while (rows.hasNext()) { modelList = new ArrayList(); ReportedData.Row row = (ReportedData.Row)rows.next(); for (int i = 0; i < resultsTable.getColumnCount(); i++) { String tableValue = (String)resultsTable.getTableHeader().getColumnModel().getColumn(i).getHeaderValue(); Iterator columnIterator = data.getColumns(); while (columnIterator.hasNext()) { ReportedData.Column column = (ReportedData.Column)columnIterator.next(); if (column.getLabel().equals(tableValue)) { tableValue = column.getVariable(); break; } } String modelValue = getFirstValue(row, tableValue); modelList.add(modelValue); } resultsTable.getTableModel().addRow(modelList.toArray()); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/89fd2815c162e5d302583d26afbc300dc5aec22f/UserSearchResults.java/clean/src/java/org/jivesoftware/sparkimpl/search/users/UserSearchResults.java
checkPopup(e);
public void showUsersFound(ReportedData data) { List columnList = new ArrayList(); Iterator columns = data.getColumns(); while (columns.hasNext()) { ReportedData.Column column = (ReportedData.Column)columns.next(); String label = column.getLabel(); columnList.add(label); } if (resultsTable == null) { resultsTable = new UsersInfoTable((String[])columnList.toArray(new String[columnList.size()])); final JScrollPane scrollPane = new JScrollPane(resultsTable); scrollPane.getViewport().setBackground(Color.white); add(scrollPane, BorderLayout.CENTER); resultsTable.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { int row = resultsTable.getSelectedRow(); openChatRoom(row); } } public void mouseReleased(MouseEvent e) { if (!e.isPopupTrigger()) { return; } // Get agent final int row = resultsTable.rowAtPoint(e.getPoint()); final JPopupMenu menu = new JPopupMenu(); Action addContactAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { RosterDialog dialog = new RosterDialog(); String jid = (String)resultsTable.getValueAt(row, 0); TableColumn column = null; try { column = resultsTable.getColumn("Username"); } catch (Exception ex) { try { column = resultsTable.getColumn("nick"); } catch (Exception e1) { } } if (column != null) { int col = column.getModelIndex(); String nickname = (String)resultsTable.getValueAt(row, col); if (!ModelUtil.hasLength(nickname)) { nickname = StringUtils.parseName(jid); } dialog.setDefaultNickname(nickname); } dialog.setDefaultJID(jid); dialog.showRosterDialog(); } }; Action chatAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { openChatRoom(row); } }; Action profileAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = (String)resultsTable.getValueAt(row, 0); vcardSupport.viewProfile(jid, resultsTable); } }; final JMenuItem addAsContact = new JMenuItem(addContactAction); addContactAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); addContactAction.putValue(Action.NAME, "Add as Contact"); menu.add(addAsContact); final JMenuItem chatMenu = new JMenuItem(chatAction); chatAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); chatAction.putValue(Action.NAME, "Chat"); menu.add(chatMenu); final JMenuItem viewProfileMenu = new JMenuItem(profileAction); profileAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_PROFILE_IMAGE)); profileAction.putValue(Action.NAME, "View Profile"); menu.add(viewProfileMenu); menu.show(resultsTable, e.getX(), e.getY()); } public void mousePressed(MouseEvent e) { } }); } else { resultsTable.clearTable(); } // Populate with answers Iterator rows = data.getRows(); List modelList; while (rows.hasNext()) { modelList = new ArrayList(); ReportedData.Row row = (ReportedData.Row)rows.next(); for (int i = 0; i < resultsTable.getColumnCount(); i++) { String tableValue = (String)resultsTable.getTableHeader().getColumnModel().getColumn(i).getHeaderValue(); Iterator columnIterator = data.getColumns(); while (columnIterator.hasNext()) { ReportedData.Column column = (ReportedData.Column)columnIterator.next(); if (column.getLabel().equals(tableValue)) { tableValue = column.getVariable(); break; } } String modelValue = getFirstValue(row, tableValue); modelList.add(modelValue); } resultsTable.getTableModel().addRow(modelList.toArray()); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/89fd2815c162e5d302583d26afbc300dc5aec22f/UserSearchResults.java/clean/src/java/org/jivesoftware/sparkimpl/search/users/UserSearchResults.java
checkPopup(e);
public void mousePressed(MouseEvent e) { }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/89fd2815c162e5d302583d26afbc300dc5aec22f/UserSearchResults.java/clean/src/java/org/jivesoftware/sparkimpl/search/users/UserSearchResults.java
if (!e.isPopupTrigger()) { return; } final int row = resultsTable.rowAtPoint(e.getPoint()); final JPopupMenu menu = new JPopupMenu(); Action addContactAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { RosterDialog dialog = new RosterDialog(); String jid = (String)resultsTable.getValueAt(row, 0); TableColumn column = null; try { column = resultsTable.getColumn("Username"); } catch (Exception ex) { try { column = resultsTable.getColumn("nick"); } catch (Exception e1) { } } if (column != null) { int col = column.getModelIndex(); String nickname = (String)resultsTable.getValueAt(row, col); if (!ModelUtil.hasLength(nickname)) { nickname = StringUtils.parseName(jid); } dialog.setDefaultNickname(nickname); } dialog.setDefaultJID(jid); dialog.showRosterDialog(); } }; Action chatAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { openChatRoom(row); } }; Action profileAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = (String)resultsTable.getValueAt(row, 0); vcardSupport.viewProfile(jid, resultsTable); } }; final JMenuItem addAsContact = new JMenuItem(addContactAction); addContactAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); addContactAction.putValue(Action.NAME, "Add as Contact"); menu.add(addAsContact); final JMenuItem chatMenu = new JMenuItem(chatAction); chatAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); chatAction.putValue(Action.NAME, "Chat"); menu.add(chatMenu); final JMenuItem viewProfileMenu = new JMenuItem(profileAction); profileAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_PROFILE_IMAGE)); profileAction.putValue(Action.NAME, "View Profile"); menu.add(viewProfileMenu); menu.show(resultsTable, e.getX(), e.getY());
checkPopup(e);
public void mouseReleased(MouseEvent e) { if (!e.isPopupTrigger()) { return; } // Get agent final int row = resultsTable.rowAtPoint(e.getPoint()); final JPopupMenu menu = new JPopupMenu(); Action addContactAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { RosterDialog dialog = new RosterDialog(); String jid = (String)resultsTable.getValueAt(row, 0); TableColumn column = null; try { column = resultsTable.getColumn("Username"); } catch (Exception ex) { try { column = resultsTable.getColumn("nick"); } catch (Exception e1) { } } if (column != null) { int col = column.getModelIndex(); String nickname = (String)resultsTable.getValueAt(row, col); if (!ModelUtil.hasLength(nickname)) { nickname = StringUtils.parseName(jid); } dialog.setDefaultNickname(nickname); } dialog.setDefaultJID(jid); dialog.showRosterDialog(); } }; Action chatAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { openChatRoom(row); } }; Action profileAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = (String)resultsTable.getValueAt(row, 0); vcardSupport.viewProfile(jid, resultsTable); } }; final JMenuItem addAsContact = new JMenuItem(addContactAction); addContactAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); addContactAction.putValue(Action.NAME, "Add as Contact"); menu.add(addAsContact); final JMenuItem chatMenu = new JMenuItem(chatAction); chatAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); chatAction.putValue(Action.NAME, "Chat"); menu.add(chatMenu); final JMenuItem viewProfileMenu = new JMenuItem(profileAction); profileAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_PROFILE_IMAGE)); profileAction.putValue(Action.NAME, "View Profile"); menu.add(viewProfileMenu); menu.show(resultsTable, e.getX(), e.getY()); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/89fd2815c162e5d302583d26afbc300dc5aec22f/UserSearchResults.java/clean/src/java/org/jivesoftware/sparkimpl/search/users/UserSearchResults.java
daoUtils.clean(((Map) obj).keySet());
Object clean(Object obj) { //TODO push OMEModel down into all calls if (null != obj) { if (obj instanceof OMEModel) { daoUtils.clean((OMEModel) obj); } else if (obj instanceof Set) { daoUtils.clean((Set) obj); } else if (obj instanceof HashMap) { daoUtils.clean(((Map) obj).keySet()); daoUtils.clean(new HashSet(((Map) obj).values())); } else { String msg = "Instances of " + obj.getClass().getName() + " not supported."; throw new IllegalArgumentException(msg); } } return obj; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fe14dc19a3cb8aef0082070000d68b42a88ac770/HierarchyBrowsingImpl.java/buggy/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java
if ((start > end && step > 0) || (start < end && step < 0)) step = -step;
public void write(FastWriter out, Context context) throws PropertyException, IOException { int start=_start, end=_end, step = _step; Object tmp; // if necessary, do run-time evaluation of our // start, end, and step objects. if ( (tmp = _objStart) != null) { while (tmp instanceof Macro) tmp = ((Macro) tmp).evaluate(context); if (tmp != null) start = Integer.parseInt(tmp.toString()); else throw new PropertyException ("Starting value cannot be null"); } if ( (tmp = _objEnd) != null) { while (tmp instanceof Macro) tmp = ((Macro) tmp).evaluate(context); if (tmp != null) end = Integer.parseInt(tmp.toString()); else throw new PropertyException ("Ending value cannot be null"); } if ( (tmp = _objStep) != null) { while (tmp instanceof Macro) tmp = ((Macro) tmp).evaluate(context); if (tmp != null) step = Integer.parseInt(tmp.toString()); else throw new PropertyException ("Step value cannot be null"); } // negate the step, if necessary if ((start > end && step > 0) || (start < end && step < 0)) step = -step; // just do it for (; ; start+=step) { _iterator.setValue(context, new Integer(start)); _body.write(out, context); if (start==end) break; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/94b8d2c950fc23297dea0f82a70ae21fd23dfd56/CountDirective.java/clean/webmacro/src/org/webmacro/directive/CountDirective.java
for (; ; start+=step) {
for (; start<=end; start+=step) {
public void write(FastWriter out, Context context) throws PropertyException, IOException { int start=_start, end=_end, step = _step; Object tmp; // if necessary, do run-time evaluation of our // start, end, and step objects. if ( (tmp = _objStart) != null) { while (tmp instanceof Macro) tmp = ((Macro) tmp).evaluate(context); if (tmp != null) start = Integer.parseInt(tmp.toString()); else throw new PropertyException ("Starting value cannot be null"); } if ( (tmp = _objEnd) != null) { while (tmp instanceof Macro) tmp = ((Macro) tmp).evaluate(context); if (tmp != null) end = Integer.parseInt(tmp.toString()); else throw new PropertyException ("Ending value cannot be null"); } if ( (tmp = _objStep) != null) { while (tmp instanceof Macro) tmp = ((Macro) tmp).evaluate(context); if (tmp != null) step = Integer.parseInt(tmp.toString()); else throw new PropertyException ("Step value cannot be null"); } // negate the step, if necessary if ((start > end && step > 0) || (start < end && step < 0)) step = -step; // just do it for (; ; start+=step) { _iterator.setValue(context, new Integer(start)); _body.write(out, context); if (start==end) break; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/94b8d2c950fc23297dea0f82a70ae21fd23dfd56/CountDirective.java/clean/webmacro/src/org/webmacro/directive/CountDirective.java
if (start==end) break;
public void write(FastWriter out, Context context) throws PropertyException, IOException { int start=_start, end=_end, step = _step; Object tmp; // if necessary, do run-time evaluation of our // start, end, and step objects. if ( (tmp = _objStart) != null) { while (tmp instanceof Macro) tmp = ((Macro) tmp).evaluate(context); if (tmp != null) start = Integer.parseInt(tmp.toString()); else throw new PropertyException ("Starting value cannot be null"); } if ( (tmp = _objEnd) != null) { while (tmp instanceof Macro) tmp = ((Macro) tmp).evaluate(context); if (tmp != null) end = Integer.parseInt(tmp.toString()); else throw new PropertyException ("Ending value cannot be null"); } if ( (tmp = _objStep) != null) { while (tmp instanceof Macro) tmp = ((Macro) tmp).evaluate(context); if (tmp != null) step = Integer.parseInt(tmp.toString()); else throw new PropertyException ("Step value cannot be null"); } // negate the step, if necessary if ((start > end && step > 0) || (start < end && step < 0)) step = -step; // just do it for (; ; start+=step) { _iterator.setValue(context, new Integer(start)); _body.write(out, context); if (start==end) break; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/94b8d2c950fc23297dea0f82a70ae21fd23dfd56/CountDirective.java/clean/webmacro/src/org/webmacro/directive/CountDirective.java
menu.addSeparator();
menu.add(new JSeparator(SwingConstants.HORIZONTAL));
private JMenu createActionsMenu() { JMenu menu = new JMenu("Actions"); menu.setMnemonic(KeyEvent.VK_A); menu.add(new JMenuItem( controller.getAction(HiViewerControl.PROPERTIES))); menu.add(new JMenuItem(controller.getAction(HiViewerControl.ANNOTATE))); menu.add(new JMenuItem(controller.getAction(HiViewerControl.CLASSIFY))); menu.addSeparator(); menu.add(new JMenuItem(controller.getAction(HiViewerControl.VIEW))); menu.add(new JMenuItem(controller.getAction(HiViewerControl.ZOOM_IN))); menu.add(new JMenuItem(controller.getAction(HiViewerControl.ZOOM_OUT))); menu.add(new JMenuItem(controller.getAction(HiViewerControl.ZOOM_FIT))); return menu; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/95a81c4515a3d8dfe34a789aed7b4aa6557ccc17/HiViewerWin.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerWin.java
menu.addSeparator();
menu.add(new JSeparator(SwingConstants.HORIZONTAL));
private JMenu createFindMenu() { JMenu menu = new JMenu("Find"); menu.setMnemonic(KeyEvent.VK_F); menu.add(new JMenuItem( controller.getAction(HiViewerControl.FIND_ANNOTATED))); menu.add(new JMenuItem( controller.getAction(HiViewerControl.FIND_W_TITLE))); menu.add(new JMenuItem( controller.getAction(HiViewerControl.FIND_W_ANNOTATION))); menu.add(new JMenuItem( controller.getAction(HiViewerControl.FIND_W_ST))); menu.addSeparator(); menu.add(new JMenuItem(controller.getAction(HiViewerControl.CLEAR))); return menu; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/95a81c4515a3d8dfe34a789aed7b4aa6557ccc17/HiViewerWin.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerWin.java
menu.addSeparator();
menu.add(new JSeparator(SwingConstants.HORIZONTAL));;
private JMenu createHierarchyMenu() { JMenu menu = new JMenu("Hierarchy"); menu.setMnemonic(KeyEvent.VK_H); menu.add(new JMenuItem( controller.getAction(HiViewerControl.VIEW_PDI))); menu.add(new JMenuItem( controller.getAction(HiViewerControl.VIEW_CGCI))); menu.addSeparator(); menu.add(new JMenuItem(controller.getAction(HiViewerControl.EXIT))); return menu; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/95a81c4515a3d8dfe34a789aed7b4aa6557ccc17/HiViewerWin.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerWin.java
menu.addSeparator();
menu.add(new JSeparator(SwingConstants.HORIZONTAL));
private JMenu createLayoutMenu() { JMenu menu = new JMenu("Layout"); menu.setMnemonic(KeyEvent.VK_L); menu.add(new JMenuItem(controller.getAction(HiViewerControl.SQUARY))); menu.add(new JMenuItem(controller.getAction(HiViewerControl.TREE))); menu.addSeparator(); menu.add(new JMenuItem(controller.getAction(HiViewerControl.SAVE))); return menu; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/95a81c4515a3d8dfe34a789aed7b4aa6557ccc17/HiViewerWin.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerWin.java
e.printStackTrace();
log("Error handling request", e);
public final Template handle(WebContext wc) throws HandlerException { String pageName = null; WikiPage wikiPage = null; // who is trying to do something? WikiUser user = getUser (wc); // which action wants to respond to this request? PageAction action = _actionManager.getAction (wc, user); // use the action to determine which WikiPage // we should be dealing with if (action != null) pageName = action.getWikiPageName (_wiki, wc); if (pageName != null) wikiPage = _wiki.getPage (pageName); // stuff the webcontext with useful stuff stuffContext (wc, wikiPage, user, pageName); if (action == null) throw new HandlerException ("Unable to find a PageAction to handle" + " this request."); try { // attempt to perform the action against the page action.perform (_wiki, wc, user, wikiPage); } catch (PageAction.RedirectException re) { // action wants us to redirect somewhere else try { wc.getResponse().sendRedirect (re.getURL()); } catch (IOException ioe) { throw new HandlerException ("Cannot redirect to " + re.getURL(), ioe); } return null; } catch (Exception e) { // something bad happened while performing the action // TODO: Handle error and error template ourselves e.printStackTrace(); throw new HandlerException (e.toString()); } finally { if (user != null) _wiki.updateUser(user); } // the action performed successfully, so now return // the template it wants us to use try { // determine the template name and return String templateName = action.getTemplateName(_wiki, wikiPage); return getTemplate (templateName); } catch (ResourceException re) { throw new HandlerException ("Could not get template", re); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/63e182a593c47d9b882560d480b0bab109616dc8/WikiServlet.java/buggy/wiki/src/org/tcdi/opensource/wiki/servlet/WikiServlet.java
} if (packageBranchRate != null) { getJava().createArg().setValue("--packagebranch"); getJava().createArg().setValue(packageBranchRate); } if (packageLineRate != null) { getJava().createArg().setValue("--packageline"); getJava().createArg().setValue(packageLineRate);
public void execute() throws BuildException { if (dataFile != null) { getJava().createArg().setValue("--datafile"); getJava().createArg().setValue(dataFile); } if (branchRate != null) { getJava().createArg().setValue("--branch"); getJava().createArg().setValue(branchRate); } if (lineRate != null) { getJava().createArg().setValue("--line"); getJava().createArg().setValue(lineRate); } if (totalBranchRate != null) { getJava().createArg().setValue("--totalbranch"); getJava().createArg().setValue(totalBranchRate); } if (totalLineRate != null) { getJava().createArg().setValue("--totalline"); getJava().createArg().setValue(totalLineRate); } Iterator iter = regexes.iterator(); while (iter.hasNext()) { getJava().createArg().setValue("--regex"); getJava().createArg().setValue(iter.next().toString()); } int returnCode = getJava().executeJava(); // Check the return code and print a message if (returnCode == 0) { System.out.println("All checks passed."); } else { if (haltOnFailure) throw new BuildException( "Coverage check failed. See messages above."); else if (failureProperty != null) getProject().setProperty(failureProperty, "true"); else System.err .println("Coverage check failed. See messages above."); } }
50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/e6b9546f524ec82a34db61772929657e87625501/CheckTask.java/buggy/cobertura/src/net/sourceforge/cobertura/ant/CheckTask.java
classes = packageData.getChildren();
classes = packageData.getClasses();
private void generateClassList(PackageData packageData) throws IOException { String filename; Collection classes; if (packageData == null) { filename = "frame-classes.html"; classes = projectData.getClasses(); } else { filename = "frame-classes-" + packageData.getName() + ".html"; classes = packageData.getChildren(); } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report Classes</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out.println("</head>"); out.println("<body>"); out.println("<h5>"); out.println(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<h5>Classes</h5>"); out.println("<table width=\"100%\">"); Map sortedClassList = new TreeMap(); for (Iterator iter = classes.iterator(); iter.hasNext();) { ClassData classData = (ClassData)iter.next(); sortedClassList.put(classData.getBaseName(), classData); } for (Iterator iter = sortedClassList.values().iterator(); iter .hasNext();) { ClassData classData = (ClassData)iter.next(); out.println("<tr>"); String percentCovered; if (classData.getNumberOfValidLines() > 0) percentCovered = getPercentValue(classData .getLineCoverageRate()); else percentCovered = "N/A"; out .println("<td nowrap=\"nowrap\"><a target=\"summary\" href=\"" + classData.getName() + ".html\">" + classData.getBaseName() + "</a> <i>(" + percentCovered + ")</i></td>"); out.println("</tr>"); } out.println("</td>"); out.println("</tr>"); out.println("</table>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } }
50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/2d04adc2554406c41824d5b965907076ecdceb80/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java
classes = packageData.getChildren();
classes = packageData.getClasses();
private void generateOverview(PackageData packageData) throws IOException { Iterator iter; String filename; if (packageData == null) { filename = "frame-summary.html"; } else { filename = "frame-summary-" + packageData.getName() + ".html"; } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/sortabletable.css\" />"); out .println("<script type=\"text/javascript\" src=\"js/popup.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/sortabletable.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/customsorttypes.js\"></script>"); out.println("</head>"); out.println("<body>"); out.print("<h5>Coverage Report - "); out.print(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<p>"); out.println("<table class=\"report\" id=\"packageResults\">"); out.println("<thead>"); out.println("<tr>"); out.println(" <td class=\"heading\">Package</td>"); out.println(" <td class=\"heading\"># Classes</td>"); out.println(generateCommonTableColumns()); out.println("</tr>"); out.println("</thead>"); out.println("<tbody>"); Collection packages; if (packageData == null) { // Output a summary line for all packages out.println(generateTableRowForTotal()); // Get packages packages = projectData.getChildren(); } else { // Get subpackages packages = projectData.getSubPackages(packageData.getName()); } // Output a line for each package or subpackage iter = packages.iterator(); while (iter.hasNext()) { PackageData subPackageData = (PackageData)iter.next(); out.println(generateTableRowForPackage(subPackageData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var packageTable = new SortableTable(document.getElementById(\"packageResults\"),"); out .println(" [\"String\", \"Number\", \"Percentage\", \"Percentage\", \"LocalizedNumber\"]);"); out.println("packageTable.sort(0);"); out.println("</script>"); out.println("</p>"); // Get the list of classes in this package Collection classes; if (packageData == null) { classes = new TreeSet(); if (projectData.getNumberOfClasses() > 0) { iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); if (classData.getPackageName() == null) { classes.add(classData); } } } } else { classes = packageData.getChildren(); } // Output a line for each class if (classes.size() > 0) { out.println("<p>"); out.println("<table class=\"report\" id=\"classResults\">"); out.println(generateTableHeaderForClasses()); out.println("<tbody>"); iter = classes.iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); out.println(generateTableRowForClass(classData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var classTable = new SortableTable(document.getElementById(\"classResults\"),"); out .println(" [\"String\", \"Percentage\", \"Percentage\", \"LocalizedNumber\"]);"); out.println("classTable.sort(0);"); out.println("</script>"); out.println("</p>"); } out.println("<div class=\"footer\">"); out .println("Report generated by <a href=\"http://cobertura.sourceforge.net/\" target=\"_top\">Cobertura</a>."); out.println("</div>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } }
50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/2d04adc2554406c41824d5b965907076ecdceb80/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java
if (view.getLens() != null) { view.resetLens(); view.repaint(); }
if (view.getLens() != null) drawLens(anchor);
public void setMagFactorLens(double f) { magFactorLens = f; if (view.getLens() != null) { view.resetLens(); view.repaint(); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/8846f7da5fbaf4d3fb83aa43b5616bcd13483654/ImageCanvasMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/canvas/ImageCanvasMng.java
int i = 0; for (; i < valueLen && iter.hasNext(); i++) {
for (int i = 0; i < valueLen && iter.hasNext(); i++) {
public void visitMultipleAsgnNode(MultipleAsgnNode iVisited) { // Make sure value is an array. if (value == null) { value = RubyArray.newArray(ruby, 0); } else if (!(value instanceof RubyArray)) { RubyObject newValue = value.convertToType("Array", "to_ary", false); if (newValue.isNil()) { newValue = RubyArray.newArray(ruby, value); } value = newValue; } // Assign the values. int valueLen = ((RubyArray)value).getLength(); int varLen = ListNodeUtil.getLength(iVisited.getHeadNode()); Iterator iter = iVisited.getHeadNode() != null ? iVisited.getHeadNode().iterator() : Collections.EMPTY_LIST.iterator(); int i = 0; for (; i < valueLen && iter.hasNext(); i++) { new AssignmentVisitor(ruby, self).assign((INode)iter.next(), ((RubyArray)value).entry(i), check); } if (check && varLen > valueLen) { throw new ArgumentError(ruby, "Wrong # of arguments (" + valueLen + " for " + varLen + ")"); } if (iVisited.getArgsNode() != null) { if (iVisited.getArgsNode() instanceof StarNode) { // no check for '*' } else if (varLen < valueLen) { List newList = ((RubyArray)value).getList().subList(varLen, valueLen); new AssignmentVisitor(ruby, self).assign(iVisited.getArgsNode(), RubyArray.newArray(ruby, newList), check); } else { new AssignmentVisitor(ruby, self).assign(iVisited.getArgsNode(), RubyArray.newArray(ruby, 0), check); } } else if (check && valueLen < varLen) { throw new ArgumentError(ruby, "Wrong # of arguments (" + valueLen + " for " + varLen + ")"); } while (iter.hasNext()) { i++; new AssignmentVisitor(ruby, self).assign((INode)iter.next(), ruby.getNil(), check); } result = value; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/06e8c0888351efa411cfdddbdf48771ce7f584c0/AssignmentVisitor.java/buggy/org/jruby/evaluator/AssignmentVisitor.java
i++;
public void visitMultipleAsgnNode(MultipleAsgnNode iVisited) { // Make sure value is an array. if (value == null) { value = RubyArray.newArray(ruby, 0); } else if (!(value instanceof RubyArray)) { RubyObject newValue = value.convertToType("Array", "to_ary", false); if (newValue.isNil()) { newValue = RubyArray.newArray(ruby, value); } value = newValue; } // Assign the values. int valueLen = ((RubyArray)value).getLength(); int varLen = ListNodeUtil.getLength(iVisited.getHeadNode()); Iterator iter = iVisited.getHeadNode() != null ? iVisited.getHeadNode().iterator() : Collections.EMPTY_LIST.iterator(); int i = 0; for (; i < valueLen && iter.hasNext(); i++) { new AssignmentVisitor(ruby, self).assign((INode)iter.next(), ((RubyArray)value).entry(i), check); } if (check && varLen > valueLen) { throw new ArgumentError(ruby, "Wrong # of arguments (" + valueLen + " for " + varLen + ")"); } if (iVisited.getArgsNode() != null) { if (iVisited.getArgsNode() instanceof StarNode) { // no check for '*' } else if (varLen < valueLen) { List newList = ((RubyArray)value).getList().subList(varLen, valueLen); new AssignmentVisitor(ruby, self).assign(iVisited.getArgsNode(), RubyArray.newArray(ruby, newList), check); } else { new AssignmentVisitor(ruby, self).assign(iVisited.getArgsNode(), RubyArray.newArray(ruby, 0), check); } } else if (check && valueLen < varLen) { throw new ArgumentError(ruby, "Wrong # of arguments (" + valueLen + " for " + varLen + ")"); } while (iter.hasNext()) { i++; new AssignmentVisitor(ruby, self).assign((INode)iter.next(), ruby.getNil(), check); } result = value; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/06e8c0888351efa411cfdddbdf48771ce7f584c0/AssignmentVisitor.java/buggy/org/jruby/evaluator/AssignmentVisitor.java
defineMethod("initialize", Arity.optional()); defineMethod("send", Arity.optional(), "write_send"); defineMethod("recv", Arity.optional(), "recv");
protected void initializeClass() { }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/955df6c6347fe40e2cb6502680208323eef890e2/BasicSocketMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/BasicSocketMetaClass.java
super("BasicSocket", RubyBasicSocket.class, runtime.getClass("IO"));
super("BasicSocket", RubyBasicSocket.class, runtime.getClass("IO"));
public BasicSocketMetaClass(IRuby runtime) { super("BasicSocket", RubyBasicSocket.class, runtime.getClass("IO")); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/955df6c6347fe40e2cb6502680208323eef890e2/BasicSocketMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/BasicSocketMetaClass.java
protected IRubyObject allocateObject() { return new RubyBasicSocket(getRuntime(), this);
public IRubyObject allocateObject() { return new RubyBasicSocket(getRuntime(), this);
protected IRubyObject allocateObject() { return new RubyBasicSocket(getRuntime(), this); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/955df6c6347fe40e2cb6502680208323eef890e2/BasicSocketMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/BasicSocketMetaClass.java
public RubyClass newSubClass(String name, RubyModule parent) { BasicSocketMetaClass basicSocketMetaClass = new BasicSocketMetaClass(getRuntime()); basicSocketMetaClass.initializeClass(); return basicSocketMetaClass;
public RubyClass newSubClass(String name, SinglyLinkedList parentCRef) { return new BasicSocketMetaClass(name, this, parentCRef);
public RubyClass newSubClass(String name, RubyModule parent) { BasicSocketMetaClass basicSocketMetaClass = new BasicSocketMetaClass(getRuntime()); basicSocketMetaClass.initializeClass(); return basicSocketMetaClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/955df6c6347fe40e2cb6502680208323eef890e2/BasicSocketMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/BasicSocketMetaClass.java
aProcess = Runtime.getRuntime().exec(new String[] { System.getProperty("jruby.shell"), "-c", aString.toString()});
{ if (!lShellProp.endsWith("sh")) lSwitch = "/c"; System.out.println("command: " + lShellProp + " " + lSwitch + " " + lCommand); aProcess = Runtime.getRuntime().exec(new String[] { lShellProp, lSwitch, lCommand}); }
public static RubyObject backquote(Ruby ruby, RubyObject recv, RubyString aString) { // XXX use other methods try { String lShellProp = System.getProperty("jruby.shell"); Process aProcess; if (lShellProp != null) aProcess = Runtime.getRuntime().exec(new String[] { System.getProperty("jruby.shell"), "-c", aString.toString()}); else aProcess = Runtime.getRuntime().exec(aString.toString()); final StringBuffer sb = new StringBuffer(); final BufferedReader reader = new BufferedReader(new InputStreamReader(aProcess.getInputStream())); String line; while ((line = reader.readLine()) != null) { sb.append(line).append('\n'); } aProcess.waitFor(); return RubyString.newString(ruby, sb.toString()); } catch (Exception excptn) { excptn.printStackTrace(); return RubyString.newString(ruby, ""); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c2cc02999f957e5b4789133df1ab058f33a4a6cc/RubyGlobal.java/clean/org/jruby/RubyGlobal.java
aProcess = Runtime.getRuntime().exec(aString.toString());
{ System.out.println("command: " + lCommand); aProcess = Runtime.getRuntime().exec(lCommand); }
public static RubyObject backquote(Ruby ruby, RubyObject recv, RubyString aString) { // XXX use other methods try { String lShellProp = System.getProperty("jruby.shell"); Process aProcess; if (lShellProp != null) aProcess = Runtime.getRuntime().exec(new String[] { System.getProperty("jruby.shell"), "-c", aString.toString()}); else aProcess = Runtime.getRuntime().exec(aString.toString()); final StringBuffer sb = new StringBuffer(); final BufferedReader reader = new BufferedReader(new InputStreamReader(aProcess.getInputStream())); String line; while ((line = reader.readLine()) != null) { sb.append(line).append('\n'); } aProcess.waitFor(); return RubyString.newString(ruby, sb.toString()); } catch (Exception excptn) { excptn.printStackTrace(); return RubyString.newString(ruby, ""); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c2cc02999f957e5b4789133df1ab058f33a4a6cc/RubyGlobal.java/clean/org/jruby/RubyGlobal.java
ruby.getInterpreter().setDynamicVars(assignInternal( ruby.getInterpreter().getDynamicVars(), id, value, false));
ruby.setDynamicVars(assignInternal(ruby.getDynamicVars(), id, value, false));
public static void assign(Ruby ruby, RubyId id, RubyObject value) { ruby.getInterpreter().setDynamicVars(assignInternal( ruby.getInterpreter().getDynamicVars(), id, value, false)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a2024bddc1b8e83f4e8075d2080935c221a833fe/RubyVarmap.java/clean/org/jruby/interpreter/RubyVarmap.java
ruby.getInterpreter().setDynamicVars(assignInternal( ruby.getInterpreter().getDynamicVars(), id, value, true));
ruby.setDynamicVars(assignInternal(ruby.getDynamicVars(), id, value, true));
public static void assignCurrent(Ruby ruby, RubyId id, RubyObject value) { ruby.getInterpreter().setDynamicVars(assignInternal( ruby.getInterpreter().getDynamicVars(), id, value, true)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a2024bddc1b8e83f4e8075d2080935c221a833fe/RubyVarmap.java/clean/org/jruby/interpreter/RubyVarmap.java
public boolean isCurrent(RubyId rubyId) { if (id == null || id.intValue() == 0) { return false; } else if (rubyId.equals(id)) { return true; } else if (next != null) { return next.isCurrent(rubyId);
public static boolean isCurrent(Ruby ruby, RubyId rubyId) { RubyVarmap vars = ruby.getDynamicVars(); while (vars != null) { if (vars.id == null || vars.id.intValue() == 0) { break; } if (vars.id == rubyId) { return true; } vars = vars.next;
public boolean isCurrent(RubyId rubyId) { if (id == null || id.intValue() == 0) { return false; } else if (rubyId.equals(id)) { return true; } else if (next != null) { return next.isCurrent(rubyId); } return false; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a2024bddc1b8e83f4e8075d2080935c221a833fe/RubyVarmap.java/clean/org/jruby/interpreter/RubyVarmap.java
public boolean isDefined(RubyId rubyId) { if (rubyId.equals(id)) { return true; } else if (next != null) { return next.isDefined(rubyId);
public static boolean isDefined(Ruby ruby, RubyId rubyId) { RubyVarmap vars = ruby.getDynamicVars(); while (vars != null) { if (vars.id == rubyId) { return true; } vars = vars.next;
public boolean isDefined(RubyId rubyId) { if (rubyId.equals(id)) { return true; } else if (next != null) { return next.isDefined(rubyId); } return false; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a2024bddc1b8e83f4e8075d2080935c221a833fe/RubyVarmap.java/clean/org/jruby/interpreter/RubyVarmap.java
public boolean isDefined(RubyId rubyId) { if (rubyId.equals(id)) { return true; } else if (next != null) { return next.isDefined(rubyId); } return false; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a2024bddc1b8e83f4e8075d2080935c221a833fe/RubyVarmap.java/clean/org/jruby/interpreter/RubyVarmap.java
ruby.getInterpreter().setDynamicVars((RubyVarmap)((RubyStack)oldMap.get(ruby)).pop());
ruby.setDynamicVars((RubyVarmap)((RubyStack)oldMap.get(ruby)).pop());
public static void pop(Ruby ruby) { ruby.getInterpreter().setDynamicVars((RubyVarmap)((RubyStack)oldMap.get(ruby)).pop()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a2024bddc1b8e83f4e8075d2080935c221a833fe/RubyVarmap.java/clean/org/jruby/interpreter/RubyVarmap.java
((RubyStack)oldMap.get(ruby)).push(ruby.getInterpreter().getDynamicVars()); ruby.getInterpreter().setDynamicVars(null);
((RubyStack)oldMap.get(ruby)).push(ruby.getDynamicVars()); ruby.setDynamicVars(null);
public static void push(Ruby ruby) { // HACK +++ if (oldMap.get(ruby) == null) { oldMap.put(ruby, new RubyStack()); // throw new RuntimeException("JRuby - BUG: Need Queue for oldMap in RubyVarmap"); } // HACK --- ((RubyStack)oldMap.get(ruby)).push(ruby.getInterpreter().getDynamicVars()); ruby.getInterpreter().setDynamicVars(null); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a2024bddc1b8e83f4e8075d2080935c221a833fe/RubyVarmap.java/clean/org/jruby/interpreter/RubyVarmap.java
if (query.startsWith("/")) { query = query.substring(1); }
public Template load(String query, CacheElement ce) throws ResourceException { URL url = loader.getResource(path.concat(query)); if (url != null && log.loggingDebug()) { log.debug("ClassPathTemplateProvider: Found Template " + url.toString()); } return (url != null) ? helper.load(url, ce) : null; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8fa9b52e736aaea7b8b1845ed47dba457c9a7c94/ClassPathTemplateLoader.java/buggy/webmacro/src/org/webmacro/resource/ClassPathTemplateLoader.java
if (config.startsWith("/")) { config = config.substring(1); }
public void setConfig(String config) { // as we'll later use this as a prefix, it should end with a slash if (config.length() > 0 && !config.endsWith("/")) { if (log.loggingInfo()) log.info("ClassPathTemplateLoader: appending \"/\" to path " + config); config = config.concat("/"); } // It isn't clear from the javadocs, whether ClassLoader.getResource() // needs a starting slash, so won't add one at the moment. this.path = config; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8fa9b52e736aaea7b8b1845ed47dba457c9a7c94/ClassPathTemplateLoader.java/buggy/webmacro/src/org/webmacro/resource/ClassPathTemplateLoader.java
if (z != null && z > getSizeZ()) throw new DimensionsOutOfBoundsException("Z '" + z + "' greater than height '" + getSizeZ() + "'."); if (c != null && c > getSizeC()) throw new DimensionsOutOfBoundsException("C '" + c + "' greater than height '" + getSizeC() + "'."); if (t != null && t > getSizeT()) throw new DimensionsOutOfBoundsException("T '" + t + "' greater than height '" + getSizeT() + "'.");
private void checkBounds(Integer y, Integer z, Integer c, Integer t) throws DimensionsOutOfBoundsException { if (y != null && y > getSizeY()) throw new DimensionsOutOfBoundsException("Y '" + y + "' greater than height '" + getSizeY() + "'."); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/49b1cc3bf41e9fd22f35e59aeb72233de4fe3863/PixelBuffer.java/buggy/components/omeio-nio/src/ome/io/nio/PixelBuffer.java
if (log != null) log = new StringBuffer();
private void addTool(String key, String className, String suffix) { Class c; try { c = _broker.classForName(className); } catch (ClassNotFoundException e) { _log.warning("Context: Could not locate class for context tool " + className); return; } if (key == null || key.equals("")) { key = className; int start = 0; int end = key.length(); int lastDot = key.lastIndexOf('.'); if (lastDot != -1) { start = lastDot + 1; } if (key.endsWith(suffix)) { end -= suffix.length(); } key = key.substring(start, end); } Object instance = null; StringBuffer log = null; try { Constructor ctor = c.getConstructor(_ctorArgs1); Object[] args = new Object[2]; args[0] = key; args[1] = new SubSettings(_broker.getSettings(), key); instance = ctor.newInstance(args); } catch (Exception e) { log = new StringBuffer(); log.append("Error loading component key="); log.append(key); log.append(" class="); log.append(c.toString()); log.append("\n"); log.append("Trying 2-argument constructor: "); log.append(e.toString()); log.append("\n"); } if (instance == null) { try { Constructor ctor = c.getConstructor(_ctorArgs2); Object[] args = new Object[1]; args[0] = key; instance = ctor.newInstance(args); } catch (Exception e) { log.append("Trying 1-argument constructor: "); log.append(e.toString()); log.append("\n"); } } if (instance == null) { try { instance = c.newInstance(); } catch (Exception e) { log.append("Trying 0-argument constructor: "); log.append(e.toString()); log.append("\n"); _log.warning(log.toString()); return; } } _tools.put(key, instance); _log.info("Registered ContextTool " + key); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8f5880751893a7e5dd9da25d036747a39c9b25b5/Context.java/buggy/webmacro/src/org/webmacro/Context.java
static private String makeName(Object[] names) {
static protected String makeName(Object[] names) {
static private String makeName(Object[] names) { StringBuffer buf = new StringBuffer(); buf.append("$("); for (int i = 0; i < names.length; i++) { if (i != 0) buf.append("."); buf.append((names[i] != null) ? names[i] : "NULL"); } buf.append(")"); return buf.toString(); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8f5880751893a7e5dd9da25d036747a39c9b25b5/Context.java/buggy/webmacro/src/org/webmacro/Context.java
if (currentLoader != null) { currentLoader.cancel(); currentLoader = null; } state = Annotator.READY; }
if (currentLoader != null) { currentLoader.cancel(); currentLoader = null; } state = Annotator.READY; }
void cancel() { if (currentLoader != null) { currentLoader.cancel(); currentLoader = null; } state = Annotator.READY; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorModel.java/clean/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorModel.java
{ if (list == null || list.size() == 0) return null; Comparator c = new Comparator() { public int compare(Object o1, Object o2) { Timestamp t1 = ((AnnotationData) o1).getLastModified(), t2 = ((AnnotationData) o2).getLastModified(); long n1 = t1.getTime(); long n2 = t2.getTime(); int v = 0; if (n1 < n2) v = -1; else if (n1 > n2) v = 1; return v; } }; Collections.sort(list, c); return (AnnotationData) list.get(list.size()-1); }
{ if (list == null || list.size() == 0) return null; Comparator c = new Comparator() { public int compare(Object o1, Object o2) { Timestamp t1 = ((AnnotationData) o1).getLastModified(), t2 = ((AnnotationData) o2).getLastModified(); long n1 = t1.getTime(); long n2 = t2.getTime(); int v = 0; if (n1 < n2) v = -1; else if (n1 > n2) v = 1; return v; } }; Collections.sort(list, c); return (AnnotationData) list.get(list.size()-1); }
private AnnotationData getLastAnnotation(List list) { if (list == null || list.size() == 0) return null; Comparator c = new Comparator() { public int compare(Object o1, Object o2) { Timestamp t1 = ((AnnotationData) o1).getLastModified(), t2 = ((AnnotationData) o2).getLastModified(); long n1 = t1.getTime(); long n2 = t2.getTime(); int v = 0; if (n1 < n2) v = -1; else if (n1 > n2) v = 1; return v; } }; Collections.sort(list, c); return (AnnotationData) list.get(list.size()-1); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorModel.java/clean/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorModel.java
{ Timestamp t1 = ((AnnotationData) o1).getLastModified(), t2 = ((AnnotationData) o2).getLastModified(); long n1 = t1.getTime(); long n2 = t2.getTime(); int v = 0; if (n1 < n2) v = -1; else if (n1 > n2) v = 1; return v; }
{ Timestamp t1 = ((AnnotationData) o1).getLastModified(), t2 = ((AnnotationData) o2).getLastModified(); long n1 = t1.getTime(); long n2 = t2.getTime(); int v = 0; if (n1 < n2) v = -1; else if (n1 > n2) v = 1; return v; }
public int compare(Object o1, Object o2) { Timestamp t1 = ((AnnotationData) o1).getLastModified(), t2 = ((AnnotationData) o2).getLastModified(); long n1 = t1.getTime(); long n2 = t2.getTime(); int v = 0; if (n1 < n2) v = -1; else if (n1 > n2) v = 1; return v; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorModel.java/clean/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorModel.java
{ if (Pattern.compile("/").matcher(originalName).find()) { String[] l = originalName.split("/", 0); int n = l.length; if (n == 1) return l[0]; return UIUtilities.DOTS+l[n-2]+"/"+l[n-1]; } else if (Pattern.compile("\\\\").matcher(originalName).find()) { String[] l = originalName.split("\\\\", 0); int n = l.length; if (n == 1) return l[0]; return UIUtilities.DOTS+l[n-2]+"\\"+l[n-1]; } return originalName; }
{ if (Pattern.compile("/").matcher(originalName).find()) { String[] l = originalName.split("/", 0); int n = l.length; if (n == 1) return l[0]; return UIUtilities.DOTS+l[n-2]+"/"+l[n-1]; } else if (Pattern.compile("\\\\").matcher(originalName).find()) { String[] l = originalName.split("\\\\", 0); int n = l.length; if (n == 1) return l[0]; return UIUtilities.DOTS+l[n-2]+"\\"+l[n-1]; } return originalName; }
private String getPartialName(String originalName) { if (Pattern.compile("/").matcher(originalName).find()) { String[] l = originalName.split("/", 0); int n = l.length; if (n == 1) return l[0]; return UIUtilities.DOTS+l[n-2]+"/"+l[n-1]; } else if (Pattern.compile("\\\\").matcher(originalName).find()) { String[] l = originalName.split("\\\\", 0); int n = l.length; if (n == 1) return l[0]; return UIUtilities.DOTS+l[n-2]+"\\"+l[n-1]; } return originalName; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorModel.java/clean/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorModel.java
{ if ((data instanceof ImageData)) { type = ImageData.class; return true; } else if (data instanceof DatasetData) { type = DatasetData.class; return true; } return false; }
{ if ((data instanceof ImageData)) { type = ImageData.class; return true; } else if (data instanceof DatasetData) { type = DatasetData.class; return true; } return false; }
private boolean isAnnotatable(DataObject data) { if ((data instanceof ImageData)) { type = ImageData.class; return true; } else if (data instanceof DatasetData) { type = DatasetData.class; return true; } return false; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorModel.java/clean/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorModel.java