rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
return AdapterUtils.go((CategoryGroup) result, new HashMap());
return AdapterUtils.go((CategoryGroup) result, newCache());
static public DataObject adaptLoadedCGCIHierarchy(Class rootNodeType, Object result) { if (rootNodeType.equals(CategoryGroup.class)){ return AdapterUtils.go((CategoryGroup) result, new HashMap()); } else if (rootNodeType.equals(Category.class)){ return AdapterUtils.go((Category) result, new HashMap()); } else { throw new IllegalArgumentException("Method only takes CategoryGroup and Category as argument."); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5e29e25bb21b2a51d4b44f9fd80b5b876b782887/AdapterUtils.java/clean/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/AdapterUtils.java
return AdapterUtils.go((Category) result, new HashMap());
return AdapterUtils.go((Category) result, newCache());
static public DataObject adaptLoadedCGCIHierarchy(Class rootNodeType, Object result) { if (rootNodeType.equals(CategoryGroup.class)){ return AdapterUtils.go((CategoryGroup) result, new HashMap()); } else if (rootNodeType.equals(Category.class)){ return AdapterUtils.go((Category) result, new HashMap()); } else { throw new IllegalArgumentException("Method only takes CategoryGroup and Category as argument."); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5e29e25bb21b2a51d4b44f9fd80b5b876b782887/AdapterUtils.java/clean/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/AdapterUtils.java
return AdapterUtils.go((Project) result, new HashMap());
return AdapterUtils.go((Project) result, newCache());
static public DataObject adaptLoadedPDIHierarchy(Class rootNodeType, Object result) { if (rootNodeType.equals(Project.class)){ return AdapterUtils.go((Project) result, new HashMap()); } else if (rootNodeType.equals(Dataset.class)){ return AdapterUtils.go((Dataset) result, new HashMap()); } else { throw new IllegalArgumentException("Method only takes Project and Dataset as argument."); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5e29e25bb21b2a51d4b44f9fd80b5b876b782887/AdapterUtils.java/clean/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/AdapterUtils.java
return AdapterUtils.go((Dataset) result, new HashMap());
return AdapterUtils.go((Dataset) result, newCache());
static public DataObject adaptLoadedPDIHierarchy(Class rootNodeType, Object result) { if (rootNodeType.equals(Project.class)){ return AdapterUtils.go((Project) result, new HashMap()); } else if (rootNodeType.equals(Dataset.class)){ return AdapterUtils.go((Dataset) result, new HashMap()); } else { throw new IllegalArgumentException("Method only takes Project and Dataset as argument."); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5e29e25bb21b2a51d4b44f9fd80b5b876b782887/AdapterUtils.java/clean/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/AdapterUtils.java
if (null == p.getProjectId()) {
if (null == p.getProjectId()) {
static public ProjectData go(Project p, Map cache) { if (check(cache,p)) { return (ProjectData) from(cache, p); } ProjectData pd = new ProjectData(); to(cache, p, pd); if (null == p.getProjectId()) { if (log.isDebugEnabled())log.debug(nullId+p); } else { pd.setID(p.getProjectId().intValue()); } pd.setName(p.getName()); pd.setDescription(p.getDescription()); if (null==p.getExperimenter()){ if (log.isDebugEnabled())log.debug(nullExp + p); } else { pd.setOwnerFirstName(p.getExperimenter().getFirstname()); } //TODO if (null==p.getDatasets()){ if (log.isDebugEnabled())log.debug(nullDs + p); } else { Set set = new HashSet(); for (Iterator i = p.getDatasets().iterator(); i.hasNext();) { Dataset d = (Dataset) i.next(); set.add(go(d,cache)); } pd.setDatasets(new ArrayList(set)); } return pd; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5e29e25bb21b2a51d4b44f9fd80b5b876b782887/AdapterUtils.java/clean/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/AdapterUtils.java
m.put(init_time,new Date());
static Map newCache() { Map m = new HashMap(); m.put(null,null); // This keeps things from getting hairy return m; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5e29e25bb21b2a51d4b44f9fd80b5b876b782887/AdapterUtils.java/clean/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/AdapterUtils.java
module.defineModuleFunction("select", callbackFactory.getOptSingletonMethod("select"));
public static RubyModule createKernelModule(IRuby runtime) { RubyModule module = runtime.defineModule("Kernel"); CallbackFactory callbackFactory = runtime.callbackFactory(RubyKernel.class); CallbackFactory objectCallbackFactory = runtime.callbackFactory(RubyObject.class); module.defineModuleFunction("Array", callbackFactory.getSingletonMethod("new_array", IRubyObject.class)); module.defineModuleFunction("Float", callbackFactory.getSingletonMethod("new_float", IRubyObject.class)); module.defineModuleFunction("Integer", callbackFactory.getSingletonMethod("new_integer", IRubyObject.class)); module.defineModuleFunction("String", callbackFactory.getSingletonMethod("new_string", IRubyObject.class)); module.defineModuleFunction("`", callbackFactory.getSingletonMethod("backquote", IRubyObject.class)); // TODO: Implement Kernel#abort module.defineModuleFunction("at_exit", callbackFactory.getSingletonMethod("at_exit")); module.defineModuleFunction("autoload", callbackFactory.getSingletonMethod("autoload", IRubyObject.class, IRubyObject.class)); // TODO: Implement Kernel#autoload? module.defineModuleFunction("binding", callbackFactory.getSingletonMethod("binding")); module.defineModuleFunction("block_given?", callbackFactory.getSingletonMethod("block_given")); // TODO: Implement Kernel#callcc module.defineModuleFunction("caller", callbackFactory.getOptSingletonMethod("caller")); module.defineModuleFunction("catch", callbackFactory.getSingletonMethod("rbCatch", IRubyObject.class)); module.defineModuleFunction("chomp", callbackFactory.getOptSingletonMethod("chomp")); module.defineModuleFunction("chomp!", callbackFactory.getOptSingletonMethod("chomp_bang")); module.defineModuleFunction("chop", callbackFactory.getSingletonMethod("chop")); module.defineModuleFunction("chop!", callbackFactory.getSingletonMethod("chop_bang")); module.defineModuleFunction("eval", callbackFactory.getOptSingletonMethod("eval")); // TODO: Implement Kernel#exec module.defineModuleFunction("exit", callbackFactory.getOptSingletonMethod("exit")); module.defineModuleFunction("exit!", callbackFactory.getOptSingletonMethod("exit_bang")); module.defineModuleFunction("fail", callbackFactory.getOptSingletonMethod("raise")); // TODO: Implement Kernel#fork module.defineModuleFunction("format", callbackFactory.getOptSingletonMethod("sprintf")); module.defineModuleFunction("gets", callbackFactory.getOptSingletonMethod("gets")); module.defineModuleFunction("global_variables", callbackFactory.getSingletonMethod("global_variables")); module.defineModuleFunction("gsub", callbackFactory.getOptSingletonMethod("gsub")); module.defineModuleFunction("gsub!", callbackFactory.getOptSingletonMethod("gsub_bang")); // TODO: Add deprecation to Kernel#iterator? (maybe formal deprecation mech.) module.defineAlias("iterator?", "block_given?"); module.defineModuleFunction("lambda", callbackFactory.getSingletonMethod("proc")); module.defineModuleFunction("load", callbackFactory.getOptSingletonMethod("load")); module.defineModuleFunction("local_variables", callbackFactory.getSingletonMethod("local_variables")); module.defineModuleFunction("loop", callbackFactory.getSingletonMethod("loop")); // Note: method_missing is documented as being in Object, but ruby appears to stick it in Kernel. module.defineModuleFunction("method_missing", callbackFactory.getOptSingletonMethod("method_missing")); module.defineModuleFunction("open", callbackFactory.getOptSingletonMethod("open")); module.defineModuleFunction("p", callbackFactory.getOptSingletonMethod("p")); module.defineModuleFunction("print", callbackFactory.getOptSingletonMethod("print")); module.defineModuleFunction("printf", callbackFactory.getOptSingletonMethod("printf")); module.defineModuleFunction("proc", callbackFactory.getSingletonMethod("proc")); // TODO: implement Kernel#putc module.defineModuleFunction("puts", callbackFactory.getOptSingletonMethod("puts")); module.defineAlias("raise", "fail"); module.defineModuleFunction("rand", callbackFactory.getOptSingletonMethod("rand")); module.defineModuleFunction("readline", callbackFactory.getOptSingletonMethod("readline")); module.defineModuleFunction("readlines", callbackFactory.getOptSingletonMethod("readlines")); module.defineModuleFunction("require", callbackFactory.getSingletonMethod("require", IRubyObject.class)); module.defineModuleFunction("scan", callbackFactory.getSingletonMethod("scan", IRubyObject.class)); // TODO: Implement Kernel#select module.defineModuleFunction("set_trace_func", callbackFactory.getSingletonMethod("set_trace_func", IRubyObject.class)); module.defineModuleFunction("sleep", callbackFactory.getSingletonMethod("sleep", IRubyObject.class)); module.defineModuleFunction("split", callbackFactory.getOptSingletonMethod("split")); module.defineAlias("sprintf", "format"); module.defineModuleFunction("srand", callbackFactory.getOptSingletonMethod("srand")); module.defineModuleFunction("sub", callbackFactory.getOptSingletonMethod("sub")); module.defineModuleFunction("sub!", callbackFactory.getOptSingletonMethod("sub_bang")); // Skipping: Kernel#syscall (too system dependent) module.defineModuleFunction("system", callbackFactory.getOptSingletonMethod("system")); // TODO: Implement Kernel#test (partial impl) module.defineModuleFunction("throw", callbackFactory.getOptSingletonMethod("rbThrow")); // TODO: Implement Kernel#trace_var module.defineModuleFunction("trap", callbackFactory.getOptSingletonMethod("trap")); // TODO: Implement Kernel#untrace_var module.defineModuleFunction("warn", callbackFactory.getSingletonMethod("warn", IRubyObject.class)); // Defined p411 Pickaxe 2nd ed. module.defineModuleFunction("singleton_method_added", callbackFactory.getSingletonMethod("singleton_method_added", IRubyObject.class)); // Object methods module.definePublicModuleFunction("==", objectCallbackFactory.getMethod("equal", IRubyObject.class)); module.defineAlias("===", "=="); module.defineAlias("eql?", "=="); module.definePublicModuleFunction("to_s", objectCallbackFactory.getMethod("to_s")); module.definePublicModuleFunction("nil?", objectCallbackFactory.getMethod("nil_p")); module.definePublicModuleFunction("to_a", objectCallbackFactory.getMethod("to_a")); module.definePublicModuleFunction("hash", objectCallbackFactory.getMethod("hash")); module.definePublicModuleFunction("id", objectCallbackFactory.getMethod("id")); module.defineAlias("__id__", "id"); module.defineAlias("object_id", "id"); module.definePublicModuleFunction("is_a?", objectCallbackFactory.getMethod("kind_of", IRubyObject.class)); module.defineAlias("kind_of?", "is_a?"); module.definePublicModuleFunction("dup", objectCallbackFactory.getMethod("dup")); module.definePublicModuleFunction("equal?", objectCallbackFactory.getMethod("same", IRubyObject.class)); module.definePublicModuleFunction("type", objectCallbackFactory.getMethod("type_deprecated")); module.definePublicModuleFunction("class", objectCallbackFactory.getMethod("type")); module.definePublicModuleFunction("inspect", objectCallbackFactory.getMethod("inspect")); module.definePublicModuleFunction("=~", objectCallbackFactory.getMethod("match", IRubyObject.class)); module.definePublicModuleFunction("clone", objectCallbackFactory.getMethod("rbClone")); module.definePublicModuleFunction("display", objectCallbackFactory.getOptMethod("display")); module.definePublicModuleFunction("extend", objectCallbackFactory.getOptMethod("extend")); module.definePublicModuleFunction("freeze", objectCallbackFactory.getMethod("freeze")); module.definePublicModuleFunction("frozen?", objectCallbackFactory.getMethod("frozen")); module.defineModuleFunction("initialize_copy", objectCallbackFactory.getMethod("initialize_copy", IRubyObject.class)); module.definePublicModuleFunction("instance_eval", objectCallbackFactory.getOptMethod("instance_eval")); module.definePublicModuleFunction("instance_of?", objectCallbackFactory.getMethod("instance_of", IRubyObject.class)); module.definePublicModuleFunction("instance_variables", objectCallbackFactory.getMethod("instance_variables")); module.definePublicModuleFunction("instance_variable_get", objectCallbackFactory.getMethod("instance_variable_get", IRubyObject.class)); module.definePublicModuleFunction("instance_variable_set", objectCallbackFactory.getMethod("instance_variable_set", IRubyObject.class, IRubyObject.class)); module.definePublicModuleFunction("method", objectCallbackFactory.getMethod("method", IRubyObject.class)); module.definePublicModuleFunction("methods", objectCallbackFactory.getOptMethod("methods")); module.definePublicModuleFunction("private_methods", objectCallbackFactory.getMethod("private_methods")); module.definePublicModuleFunction("protected_methods", objectCallbackFactory.getMethod("protected_methods")); module.definePublicModuleFunction("public_methods", objectCallbackFactory.getOptMethod("public_methods")); module.definePublicModuleFunction("remove_instance_variable", objectCallbackFactory.getMethod("remove_instance_variable", IRubyObject.class)); module.definePublicModuleFunction("respond_to?", objectCallbackFactory.getOptMethod("respond_to")); module.definePublicModuleFunction("send", objectCallbackFactory.getOptMethod("send")); module.defineAlias("__send__", "send"); module.definePublicModuleFunction("singleton_methods", objectCallbackFactory.getMethod("singleton_methods")); module.definePublicModuleFunction("taint", objectCallbackFactory.getMethod("taint")); module.definePublicModuleFunction("tainted?", objectCallbackFactory.getMethod("tainted")); module.definePublicModuleFunction("untaint", objectCallbackFactory.getMethod("untaint")); return module; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/54e6b8da799629e0b7db879c45149399878f5f84/RubyKernel.java/clean/src/org/jruby/RubyKernel.java
public NoteTreeNode(NoteTreeNode parent, DisplayedNote data) {
protected NoteTreeNode(NoteTreeNode parent, DisplayedNote data) {
public NoteTreeNode(NoteTreeNode parent, DisplayedNote data) { treeItem = new TreeItem(parent.treeItem, SWT.NONE, data.getNote().getIndex()); init(data); }
57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/d0681c368f8b555700e4ef73b079e6a225f180f2/NoteTreeNode.java/buggy/trunk/src/de/berlios/koalanotes/display/NoteTreeNode.java
if (isSelected() == selected) { return; }
public void setSelected(boolean selected) { List<TreeItem> selectionTemp = Arrays.asList(treeItem.getParent().getSelection()); List<TreeItem> selection = new LinkedList<TreeItem>(selectionTemp); if (selected) { selection.add(treeItem); } else { selection.remove(treeItem); } TreeItem[] newSelection = selection.toArray(new TreeItem[selection.size()]); treeItem.getParent().setSelection(newSelection); }
57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/d0681c368f8b555700e4ef73b079e6a225f180f2/NoteTreeNode.java/buggy/trunk/src/de/berlios/koalanotes/display/NoteTreeNode.java
super(runtime, null, superClass, runtime.getObject(), "Module", RubyModule.class);
super(runtime, null, superClass, runtime.getObject().getCRef(), "Module", RubyModule.class);
public ModuleMetaClass(IRuby runtime, RubyClass superClass) { super(runtime, null, superClass, runtime.getObject(), "Module", RubyModule.class); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a1b8fc1d456e3d5c6e01579b88773383068aa85c/ModuleMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/ModuleMetaClass.java
public RubyClass newSubClass(String name, RubyModule parent) { return new ModuleMetaClass(name, this, parent);
public RubyClass newSubClass(String name, SinglyLinkedList parentCRef) { return new ModuleMetaClass(name, this, parentCRef);
public RubyClass newSubClass(String name, RubyModule parent) { return new ModuleMetaClass(name, this, parent); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a1b8fc1d456e3d5c6e01579b88773383068aa85c/ModuleMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/ModuleMetaClass.java
if (!currentP.identical(previousP))
Permissions tmpDetails = new Permissions(previousP); if (currentP.isSet(Flag.LOCKED)) { tmpDetails.set(Flag.LOCKED); } else { tmpDetails.unSet(Flag.LOCKED); } if (!currentP.identical(tmpDetails))
protected boolean managedPermissions(boolean locked, boolean privileged, IObject obj, Details previousDetails, Details currentDetails, Details newDetails) { // setup boolean altered = false; Permissions previousP = previousDetails == null ? null : previousDetails.getPermissions(); Permissions currentP = currentDetails == null ? null : currentDetails .getPermissions(); // ignore newDetails permissions. // If the stored perms are null, then we can't validate anything // TODO : is this alright. Should only happen for system types. // Then can silently ignore ?? if (previousP == null) { if (currentP == null) { newDetails.setPermissions(null); altered |= false; // don't need to update } else { newDetails.setPermissions(currentP); altered = true; } } // WORKAROUND for ticket:307 by checking for SOFT below // see https://trac.openmicroscopy.org.uk/omero/ticket/307 // see // http://opensource.atlassian.com/projects/hibernate/browse/HHH-2027 // Users did not enter permission (normal case) so is null OR // in the workaround permissions is SOFT, then // need to copy whole sale those from database. else if (currentP == null || currentP.isSet(Flag.SOFT)) { newDetails.setPermissions(previousP); altered = true; } // if the user has set the permissions (currentDetails), then we should // try to allow that. if it's identical to the current, then there // is no reason to hit the DB. else { // if we need to filter any permissions, do it here! newDetails.setPermissions(currentP); if (!currentP.identical(previousP)) { if ( ! isOwnerOrSupervisor(obj)) // TODO and privileged? if not, remove from below?? throw new SecurityViolation(String.format( "You are not authorized to change " + "the permissions for %s from %s to %s", obj, previousP, currentP)); altered = true; } } // now we've calculated the desired permissions, throw // a security violation if this instance was locked AND // the read permissions have been lowered or if the lock // was removed. if (locked) { if (previousP == null) // if null it can't have been locked. throw new InternalException("Null permissions cannot be locked"); Permissions calculatedP = newDetails.getPermissions(); if (calculatedP != null) { // can't override if ( ! calculatedP.isSet( Flag.LOCKED )) { calculatedP.set(Flag.LOCKED); altered = true; } if ((previousP.isGranted(USER, READ) && !calculatedP.isGranted(USER, READ)) || (previousP.isGranted(GROUP, READ) && !calculatedP .isGranted(GROUP, READ)) || (previousP.isGranted(WORLD, READ) && !calculatedP .isGranted(WORLD, READ))) throw new SecurityViolation( "Cannot remove READ from locked entity:" + obj); } } // privileged plays no role since everyone can alter their permissions // (within bounds) return altered; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/36bb3b3ff2057894b05b208ab4ef1b9ce950164a/BasicSecuritySystem.java/buggy/components/server/src/ome/security/basic/BasicSecuritySystem.java
&& !source.getOwner().getId().equals( newDetails.getOwner().getId())) {
&& !newDetails.getOwner().getId().equals( source.getOwner().getId())) {
public Details newTransientDetails(IObject obj) { checkReady("transientDetails"); if (obj == null) throw new ApiUsageException("Argument cannot be null."); if (hasPrivilegedToken(obj)) return obj.getDetails(); // EARLY EXIT Details source = obj.getDetails(); Details newDetails = cd.createDetails(); if (source != null) { // PERMISSIONS // users _are_ allowed to alter the permissions of new objects. // this entity may be locked in the same operation, in which case // the READ permissions which are set will not be removable. copyNonNullPermissions(newDetails, source.getPermissions()); applyUmaskIfNecessary(newDetails); // OWNER // users *aren't* allowed to set the owner of an item. if (source.getOwner() != null && !source.getOwner().getId().equals( newDetails.getOwner().getId())) { // but this is root if (currentUserIsAdmin()) { newDetails.setOwner(source.getOwner()); } else { throw new SecurityViolation(String.format( "You are not authorized to set the ExperimenterID" + " for %s to %d", obj, source.getOwner() .getId())); } } // GROUP // users are only allowed to set to another of their groups if (source.getGroup() != null && source.getGroup().getId() != null) { // users can change to their own group if (memberOfGroups().contains(source.getGroup().getId())) { newDetails.setGroup(source.getGroup()); } // and admin can change it too else if (currentUserIsAdmin()) { newDetails.setGroup(source.getGroup()); } // oops. boom! else { throw new SecurityViolation(String.format( "You are not authorized to set the ExperimenterGroupID" + " for %s to %d", obj, source.getGroup() .getId())); } } // EXTERNALINFO // useres _are_ allowed to set the external info on a new object. // subsequent operations, however, will not be able to edit this // value. newDetails.setExternalInfo( source.getExternalInfo() ); // CREATION/UPDATEVENT : currently ignore what users do } return newDetails; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/36bb3b3ff2057894b05b208ab4ef1b9ce950164a/BasicSecuritySystem.java/buggy/components/server/src/ome/security/basic/BasicSecuritySystem.java
"You are not authorized to set the ExperimenterID" + " for %s to %d", obj, source.getOwner() .getId()));
"You are not authorized to set the Experimenter" + " for %s to %s", obj, source.getOwner()));
public Details newTransientDetails(IObject obj) { checkReady("transientDetails"); if (obj == null) throw new ApiUsageException("Argument cannot be null."); if (hasPrivilegedToken(obj)) return obj.getDetails(); // EARLY EXIT Details source = obj.getDetails(); Details newDetails = cd.createDetails(); if (source != null) { // PERMISSIONS // users _are_ allowed to alter the permissions of new objects. // this entity may be locked in the same operation, in which case // the READ permissions which are set will not be removable. copyNonNullPermissions(newDetails, source.getPermissions()); applyUmaskIfNecessary(newDetails); // OWNER // users *aren't* allowed to set the owner of an item. if (source.getOwner() != null && !source.getOwner().getId().equals( newDetails.getOwner().getId())) { // but this is root if (currentUserIsAdmin()) { newDetails.setOwner(source.getOwner()); } else { throw new SecurityViolation(String.format( "You are not authorized to set the ExperimenterID" + " for %s to %d", obj, source.getOwner() .getId())); } } // GROUP // users are only allowed to set to another of their groups if (source.getGroup() != null && source.getGroup().getId() != null) { // users can change to their own group if (memberOfGroups().contains(source.getGroup().getId())) { newDetails.setGroup(source.getGroup()); } // and admin can change it too else if (currentUserIsAdmin()) { newDetails.setGroup(source.getGroup()); } // oops. boom! else { throw new SecurityViolation(String.format( "You are not authorized to set the ExperimenterGroupID" + " for %s to %d", obj, source.getGroup() .getId())); } } // EXTERNALINFO // useres _are_ allowed to set the external info on a new object. // subsequent operations, however, will not be able to edit this // value. newDetails.setExternalInfo( source.getExternalInfo() ); // CREATION/UPDATEVENT : currently ignore what users do } return newDetails; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/36bb3b3ff2057894b05b208ab4ef1b9ce950164a/BasicSecuritySystem.java/buggy/components/server/src/ome/security/basic/BasicSecuritySystem.java
"You are not authorized to set the ExperimenterGroupID" + " for %s to %d", obj, source.getGroup() .getId()));
"You are not authorized to set the ExperimenterGroup" + " for %s to %s", obj, source.getGroup()));
public Details newTransientDetails(IObject obj) { checkReady("transientDetails"); if (obj == null) throw new ApiUsageException("Argument cannot be null."); if (hasPrivilegedToken(obj)) return obj.getDetails(); // EARLY EXIT Details source = obj.getDetails(); Details newDetails = cd.createDetails(); if (source != null) { // PERMISSIONS // users _are_ allowed to alter the permissions of new objects. // this entity may be locked in the same operation, in which case // the READ permissions which are set will not be removable. copyNonNullPermissions(newDetails, source.getPermissions()); applyUmaskIfNecessary(newDetails); // OWNER // users *aren't* allowed to set the owner of an item. if (source.getOwner() != null && !source.getOwner().getId().equals( newDetails.getOwner().getId())) { // but this is root if (currentUserIsAdmin()) { newDetails.setOwner(source.getOwner()); } else { throw new SecurityViolation(String.format( "You are not authorized to set the ExperimenterID" + " for %s to %d", obj, source.getOwner() .getId())); } } // GROUP // users are only allowed to set to another of their groups if (source.getGroup() != null && source.getGroup().getId() != null) { // users can change to their own group if (memberOfGroups().contains(source.getGroup().getId())) { newDetails.setGroup(source.getGroup()); } // and admin can change it too else if (currentUserIsAdmin()) { newDetails.setGroup(source.getGroup()); } // oops. boom! else { throw new SecurityViolation(String.format( "You are not authorized to set the ExperimenterGroupID" + " for %s to %d", obj, source.getGroup() .getId())); } } // EXTERNALINFO // useres _are_ allowed to set the external info on a new object. // subsequent operations, however, will not be able to edit this // value. newDetails.setExternalInfo( source.getExternalInfo() ); // CREATION/UPDATEVENT : currently ignore what users do } return newDetails; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/36bb3b3ff2057894b05b208ab4ef1b9ce950164a/BasicSecuritySystem.java/buggy/components/server/src/ome/security/basic/BasicSecuritySystem.java
private JToolBar buildViewBar() { JToolBar bar = new JToolBar(); bar.setFloatable(false); bar.setRollover(true); bar.setBorder(null); JToggleButton b = new JToggleButton( controller.getAction(HiViewerControl.TREE_VIEW)); bar.add(b); b = new JToggleButton( controller.getAction(HiViewerControl.CLIPBOARD_VIEW)); b.setSelected(true); bar.add(b); bar.add(new JSeparator(SwingConstants.HORIZONTAL)); return bar; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ea7509babe2344eb702969105eb77096cc5b6bcf/HiViewerToolBar.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerToolBar.java
Class targetType = (Class) c2c().get(current.getClass());
Class targetType = findClass(current.getClass());
public Object findTarget(Object current){ // IMMUTABLES if (null == current | current instanceof Integer | current instanceof String) // TODO can use findTarget then for these as well. { return current; } else // Special cases TODO put into doFindTarget if (current instanceof Date){ return new Timestamp(((Date)current).getTime()); // FIXME should cache these in model2pojo } Object target = model2target.get(current); if (null == target) { Class targetType = (Class) c2c().get(current.getClass()); if (null != targetType){ try { target = targetType.newInstance(); } catch (Exception e) { throw new RuntimeException("Internal error: could not instantiate object of type "+targetType+" while trying to map "+current,e); } model2target.put(current,target); } } return target; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/afec4b5da2a19f70c897c6d87552b4e998da56cb/ModelMapper.java/clean/components/common/src/ome/util/ModelMapper.java
(Category)controller.getCategories(group).get(i);
(Category)controller.getCategories(group).get(selectedCategory);
private void buildGUI() { Container container = getContentPane(); container.setLayout(new BorderLayout(2,2)); JPanel listPanel = new JPanel(); listPanel.setLayout(new GridLayout(1,2)); JPanel leftPanel = new JPanel(); leftPanel.setLayout(new BorderLayout(2,2)); JPanel leftLabelPanel = new JPanel(); leftLabelPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); leftLabelPanel.add(new JLabel("Groups:")); leftPanel.add(leftLabelPanel,BorderLayout.NORTH); groupList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); groupList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { newCategoryButton.setEnabled(true); categoryList.setEnabled(true); if(groupList.getSelectedIndex() != -1) { selectedGroup = groupList.getSelectedIndex(); } CategoryGroup group = (CategoryGroup)controller.getCategoryGroups().get(selectedGroup); buildCategoryList(group); repaint(); } }); groupList.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent arg0) { if(arg0.getOppositeComponent() != editButton) { editButton.setEnabled(false); } } public void focusGained(FocusEvent arg0) { editButton.setEnabled(true); editButton.setAction(editGroupAction); } }); JScrollPane scrollPane = new JScrollPane(groupList); scrollPane.setPreferredSize(new Dimension(150,225)); leftPanel.add(scrollPane,BorderLayout.CENTER); listPanel.add(leftPanel); JPanel rightPanel = new JPanel(); rightPanel.setLayout(new BorderLayout(2,2)); JPanel rightLabelPanel = new JPanel(); rightLabelPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); rightLabelPanel.add(new JLabel("Phenotypes:")); rightPanel.add(rightLabelPanel,BorderLayout.NORTH); categoryList.setEnabled(false); categoryList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); categoryList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { int i = categoryList.getSelectedIndex(); CategoryGroup group = (CategoryGroup)controller.getCategoryGroups().get(selectedGroup); Category cat = (Category)controller.getCategories(group).get(i); repaint(); } }); categoryList.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent arg0) { if(arg0.getOppositeComponent() != editButton) { editButton.setEnabled(false); } } public void focusGained(FocusEvent arg0) { editButton.setEnabled(true); editButton.setAction(editCategoryAction); } }); JScrollPane rightScrollPane = new JScrollPane(categoryList); rightScrollPane.setPreferredSize(new Dimension(150,225)); rightPanel.add(rightScrollPane,BorderLayout.CENTER); listPanel.add(rightPanel); JPanel detailsPanel = new JPanel(); detailsPanel.setBorder(BorderFactory.createLineBorder(Color.gray)); detailsPanel.setLayout(new BorderLayout(2,2)); detailsPanel.add(listPanel,BorderLayout.CENTER); JPanel buttonPanel = new JPanel(); newGroupButton = new JButton("New Group"); newGroupButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { CategoryEditUI.showCreateGroupDialog(refCopy,controller); } }); buttonPanel.add(newGroupButton); editButton = new JButton("Edit"); buttonPanel.add(editButton); newCategoryButton = new JButton("New Phenotype"); newCategoryButton.setEnabled(false); newCategoryButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { CategoryGroup group = (CategoryGroup)controller.getCategoryGroups().get(selectedGroup); CategoryEditUI.showCreateCategoryDialog(refCopy,controller,group); } }); buttonPanel.add(newCategoryButton); detailsPanel.add(buttonPanel,BorderLayout.SOUTH); container.add(detailsPanel,BorderLayout.CENTER); JPanel savePanel = new JPanel(); savePanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); JButton saveButton = new JButton("Save"); saveButton.setAction(saveAction); savePanel.add(saveButton); savePanel.add(Box.createHorizontalStrut(10)); JButton cancelButton = new JButton("Cancel"); cancelButton.setAction(cancelAction); savePanel.add(cancelButton); container.add(savePanel,BorderLayout.SOUTH); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a47b86cb03a09b865a88769c10a7d57151002bd0/CategoryUI.java/clean/SRC/org/openmicroscopy/shoola/agents/classifier/CategoryUI.java
(Category)controller.getCategories(group).get(i);
(Category)controller.getCategories(group).get(selectedCategory);
public void valueChanged(ListSelectionEvent e) { int i = categoryList.getSelectedIndex(); CategoryGroup group = (CategoryGroup)controller.getCategoryGroups().get(selectedGroup); Category cat = (Category)controller.getCategories(group).get(i); repaint(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a47b86cb03a09b865a88769c10a7d57151002bd0/CategoryUI.java/clean/SRC/org/openmicroscopy/shoola/agents/classifier/CategoryUI.java
return _allCategories;
if(_allCategories==null){ return new LinkedHashMap(); } else{ return _allCategories; }
public Map getCategories() { if (_allCategories == null) { Collection cats = CategoryUtil.getCategories(); if(cats!=null && !cats.isEmpty()){ _allCategories = new LinkedHashMap(); _allCategories.put(ArticleUtil.getBundle().getLocalizedText("All categories"), "-1"); Iterator cat = cats.iterator(); while (cat.hasNext()) { String category = (String) cat.next(); _allCategories.put(ArticleUtil.getBundle().getLocalizedText(category),category); } } } return _allCategories; }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/77f6af59c63a9bb06fc5f97887a10f33495a1eb0/SearchArticleBean.java/clean/src/java/com/idega/block/article/bean/SearchArticleBean.java
if(!getSearchCategory().equals("-1")){
if(!("-1").equals(getSearchCategory())){
public SearchRequest getSearchRequest(String scope, Locale locale) throws SearchException { SearchRequest s = new SearchRequest(); s.addSelection(IWSlideConstants.PROPERTY_CREATION_DATE); s.addSelection(IWSlideConstants.PROPERTY_CATEGORY); s.addScope(new SearchScope(scope)); SearchExpression whereExpression = null; //String localeString = ""; //((locale!=null)?locale.getLanguage():""); //TODO create search input for language SearchExpression namePatternExpression = s.compare(CompareOperator.LIKE, IWSlideConstants.PROPERTY_DISPLAY_NAME,"%.article"); //todo search by the content type //SearchExpression contentTypeExpression = s.compare(CompareOperator.LIKE, ArticleItemBean.PROPERTY_CONTENT_TYPE, ArticleItemBean.ARTICLE_FILENAME_SCOPE); whereExpression = namePatternExpression; //whereExpression = contentTypeExpression; SearchExpression creationDateFromExpression = null; if(getSearchPublishedFrom() != null){ Date from = getSearchPublishedFrom(); IWTimestamp stamp = new IWTimestamp(from); //the date's time is at 24:00 so anything from that day will not be found. So be back up a day to 24:00 stamp.addDays(-1); from = stamp.getDate(); creationDateFromExpression = s.compare(CompareOperator.GTE, IWSlideConstants.PROPERTY_CREATION_DATE,from); whereExpression = s.and(whereExpression,creationDateFromExpression); } SearchExpression creationDateToExpression = null; if(getSearchPublishedTo() != null){ creationDateToExpression = s.compare(CompareOperator.LTE, IWSlideConstants.PROPERTY_CREATION_DATE,getSearchPublishedTo()); whereExpression = s.and(whereExpression,creationDateToExpression); } // List categoryExpressions = new ArrayList(); if(!getSearchCategory().equals("-1")){ SearchExpression categoryExpression = s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CATEGORY,","+getSearchCategory()+","); whereExpression = s.and(whereExpression,categoryExpression); } String author = getSearchAuthor(); if(author!=null && !"".equals(author)){ SearchExpression authorExpression = s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CREATOR_DISPLAY_NAME,"%"+author+"%"); whereExpression = s.and(whereExpression,authorExpression); } // }// whereExpression = s.and(whereExpression,categoryExpression);// for (Iterator iter = categoryList.iterator(); iter.hasNext();) {// String categoryName = (String) iter.next();// categoryExpressions.add(s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CATEGORY,"%"+categoryName+"%"));// }// Iterator expr = categoryExpressions.iterator();// if(expr.hasNext()){// SearchExpression categoryExpression = (SearchExpression)expr.next();// while(expr.hasNext()){// categoryExpression = s.or(categoryExpression,(SearchExpression)expr.next());// }// whereExpression = s.and(whereExpression,categoryExpression);// }// } SearchExpression containsExpression = null; if(getSearchText() != null && !"".equals(getSearchText())){ containsExpression = s.contains(getSearchText()); if(whereExpression!=null){ whereExpression = s.and(whereExpression,containsExpression); }else{ whereExpression = containsExpression; } } s.setWhereExpression(whereExpression); System.out.println("------------------------"); System.out.println(s.asString()); System.out.println("------------------------"); return s; }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/77f6af59c63a9bb06fc5f97887a10f33495a1eb0/SearchArticleBean.java/clean/src/java/com/idega/block/article/bean/SearchArticleBean.java
int n = Integer.parseInt(args[0]);
public static void main(String args[]) throws IOException { //@START int n = Integer.parseInt(args[0]); int i, c; String s = ""; Integer ii; // the original program used: // Hashtable ht = new Hashtable(); // John Olsson points out that Hashtable is for synchronized access // and we should use instead: HashMap ht = new HashMap(); c = 0; for (i = 1; i <= n; i++) ht.put(Integer.toString(i, 16), new Integer(i)); for (i = 1; i <= n; i++) // The original code converted to decimal string this way: // if (ht.containsKey(i+"")) if (ht.containsKey(Integer.toString(i, 10))) c++; System.out.println(c); //@END }
53330 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53330/eb6c850277407b38bcaefb81155941da0f27b849/hash.java/buggy/tests/shootout/java-start/hash.java
FlowLayout(FlowLayout.LEFT, 0, 0)) {
FlowLayout(FlowLayout.LEFT, 0, 0)) {
private void createUI() { setLayout(new BorderLayout()); tabs = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)) { public Dimension getPreferredSize() { if (getParent() == null) return getPreferredSize(); // calculate the preferred size based on the flow of components FlowLayout flow = (FlowLayout)getLayout(); int w = getParent().getWidth(); int h = flow.getVgap(); int x = flow.getHgap(); int rowH = 0; Dimension d; Component[] comps = getComponents(); for (int i = 0; i < comps.length; i++) { if (comps[i].isVisible()) { d = comps[i].getPreferredSize(); if (x + d.width > w && x > flow.getHgap()) { x = flow.getHgap(); h += rowH; rowH = 0; h += flow.getVgap(); } rowH = Math.max(d.height, rowH); x += d.width + flow.getHgap(); } } h += rowH; return new Dimension(w, h); } }; final JPanel topPanel = new JPanel(); topPanel.setLayout(new GridBagLayout()); topPanel.add(new JLabel(), new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); topPanel.setOpaque(false); // Add Tabs panel to top of panel. if (tabPlacement == JTabbedPane.TOP) { topPanel.add(tabs, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 0, 0), 0, 0)); add(topPanel, BorderLayout.NORTH); } else { topPanel.add(tabs, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 2, 0), 0, 0)); add(topPanel, BorderLayout.SOUTH); } // Create mainPanel mainPanel = new JPanel(new CardLayout()); add(mainPanel, BorderLayout.CENTER); // mainPanel.setBorder(BorderFactory.createLineBorder(Color.lightGray)); // Initialize close button closeInactiveButtonIcon = SparkRes.getImageIcon(SparkRes.CLOSE_WHITE_X_IMAGE); closeActiveButtonIcon = SparkRes.getImageIcon(SparkRes.CLOSE_DARK_X_IMAGE); setOpaque(false); tabs.setOpaque(false); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/93be14b35e2ec723a91a9660ce4217f9947cf7b5/SparkTabbedPane.java/buggy/src/java/org/jivesoftware/spark/component/tabbedPane/SparkTabbedPane.java
if (e.getSource() instanceof SparkTab) { SparkTab tab = (SparkTab)e.getSource(); setSelectedTab(tab); }
public void mouseClicked(MouseEvent e) { }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/93be14b35e2ec723a91a9660ce4217f9947cf7b5/SparkTabbedPane.java/buggy/src/java/org/jivesoftware/spark/component/tabbedPane/SparkTabbedPane.java
if(e.isPopupTrigger()){ return; } if (e.getSource() instanceof SparkTab) { SparkTab tab = (SparkTab)e.getSource(); setSelectedTab(tab); }
public void mousePressed(MouseEvent e) { if(e.isPopupTrigger()){ return; } if (e.getSource() instanceof SparkTab) { SparkTab tab = (SparkTab)e.getSource(); setSelectedTab(tab); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/93be14b35e2ec723a91a9660ce4217f9947cf7b5/SparkTabbedPane.java/buggy/src/java/org/jivesoftware/spark/component/tabbedPane/SparkTabbedPane.java
textLabel.setFont(defaultFont);
public void setSelected(boolean selected) { super.setSelected(selected); this.selected = selected; if (boldWhenActive && selected) { textLabel.setFont(textLabel.getFont().deriveFont(Font.BOLD)); } else { textLabel.setFont(defaultFont); } invalidate(); repaint(); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/00fab4f4f794528a2db5b65568d6efec6e2e119d/SparkTab.java/buggy/src/java/org/jivesoftware/spark/component/tabbedPane/SparkTab.java
put(varName,toolType);
put(varName,tool);
WC(final Broker broker) { _broker = broker; try { String tools = (String) _broker.getValue("config","TemplateTools"); Enumeration tenum = new StringTokenizer(tools); while (tenum.hasMoreElements()) { String toolName = (String) tenum.nextElement(); try { Class toolType = Class.forName(toolName); String varName = getToolName(toolName); Object tool = toolType.newInstance(); put(varName,toolType); } catch (ClassNotFoundException ce) { _log.exception(ce); _log.error("Tool class " + toolName + " not found: " + ce); } catch (IllegalAccessException ia) { _log.exception(ia); _log.error("Tool class and methods must be public for " + toolName + ": " + ia); } catch (InstantiationException ie) { _log.exception(ie); _log.error("Tool class " + toolName + " must have a public zero " + "argument or default constructor: " + ie); } } } catch (NotFoundException e) { _log.exception(e); _log.error("Could not locate TemplateTools in config: " + e); } catch (InvalidTypeException e) { _log.exception(e); _log.error("Could not access config: " + e); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2b733b59c2820d3bfe96a20a52e269bad07b066e/WC.java/buggy/webmacro/src/org/webmacro/servlet/WC.java
" is a " + name.getClass());
" is a " + c + ": " + v);
final public ContextTool getTool(String name) throws InvalidContextException { try { return (ContextTool) getMacro(name); } catch (ClassCastException ce) { throw new InvalidContextException("Not a tool, " + name + " is a " + name.getClass()); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2b733b59c2820d3bfe96a20a52e269bad07b066e/WC.java/buggy/webmacro/src/org/webmacro/servlet/WC.java
WebContext wc = (WebContext) clone(null);
WebContext wc = (WebContext) clone();
final public WebContext clone( final HttpServletRequest req, final HttpServletResponse resp) { try { // want: new local vars, both existing tools tables, no bean, // plus store req and resp somewhere, plus existing broker WebContext wc = (WebContext) clone(null); wc._request = req; wc._response = resp; return wc; } catch (Exception e) { _log.error("Clone not supported on WebContext!"); return null; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/278b4a35f5c73b37a3381dc75821bfaa4d3aa3d0/WebContext.java/buggy/webmacro/src/org/webmacro/servlet/WebContext.java
this.myName, name, desc, ignoreRegex);
this.myName, name, desc, ignoreRegexs);
public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) { MethodVisitor mv = cv.visitMethod(access, name, desc, signature, exceptions); if (!instrument) return mv; return mv == null ? null : new MethodInstrumenter(classData, mv, this.myName, name, desc, ignoreRegex); }
50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/8d76b07e3d230fcd0d3b233e7ffc80df6ca3ec82/ClassInstrumenter.java/clean/cobertura/src/net/sourceforge/cobertura/instrument/ClassInstrumenter.java
final String owner, final String myName, final String myDescriptor, final Pattern ignoreRegexp)
final String owner, final String myName, final String myDescriptor, final Collection ignoreRegexs)
public MethodInstrumenter(ClassData classData, final MethodVisitor mv, final String owner, final String myName, final String myDescriptor, final Pattern ignoreRegexp) { super(mv); this.classData = classData; this.ownerClass = owner; this.myName = myName; this.myDescriptor = myDescriptor; this.ignoreRegex = ignoreRegexp; }
50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/8d76b07e3d230fcd0d3b233e7ffc80df6ca3ec82/MethodInstrumenter.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/MethodInstrumenter.java
this.ignoreRegex = ignoreRegexp;
this.ignoreRegexs = ignoreRegexs;
public MethodInstrumenter(ClassData classData, final MethodVisitor mv, final String owner, final String myName, final String myDescriptor, final Pattern ignoreRegexp) { super(mv); this.classData = classData; this.ownerClass = owner; this.myName = myName; this.myDescriptor = myDescriptor; this.ignoreRegex = ignoreRegexp; }
50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/8d76b07e3d230fcd0d3b233e7ffc80df6ca3ec82/MethodInstrumenter.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/MethodInstrumenter.java
} else { model.setState(ANNOTATIONS_READY); fireStateChange();
public void manageAnnotationEditing(boolean b) { if (model.getState() != ClipBoard.EDIT_ANNOTATIONS) throw new IllegalStateException("This method can only be invoked " + "in the EDIT_ANNOTATIONS state."); if (b) { view.manageAnnotation(); retrieveAnnotations(model.getAnnotatedObjectID(), model.getAnnotatedObjectIndex()); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3feec30057da68977528d8509d07bff5c080fb40/ClipBoardComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/ClipBoardComponent.java
initListener();
void initialize(ClipBoardControl controller, ClipBoardModel model) { if (controller == null) throw new NullPointerException("No control."); if (model == null) throw new NullPointerException("No model."); this.model = model; this.controller = controller; initComponents(); buildUI(); //Initializes the listener otherwise an event is fired when //components are added to the tabbed pane. initListener(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c7517f5d0ece413452f58f3f0a071be2ccbee2e/ClipBoardUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/ClipBoardUI.java
public void composingNotification(final String from, String packetID) { SwingUtilities.invokeLater(new Runnable() { public void run() { String bareAddress = StringUtils.parseBareAddress(from); if (bareAddress.equals(getRoomname())) { String nickname = StringUtils.parseResource(from); String isTypingText = Res.getString("message.is.typing.a.message", nickname); } } }); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/GroupChatRoom.java/buggy/src/java/org/jivesoftware/spark/ui/rooms/GroupChatRoom.java
public void run() { String bareAddress = StringUtils.parseBareAddress(from); if (bareAddress.equals(getRoomname())) { String nickname = StringUtils.parseResource(from); String isTypingText = Res.getString("message.is.typing.a.message", nickname); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/GroupChatRoom.java/buggy/src/java/org/jivesoftware/spark/ui/rooms/GroupChatRoom.java
public void setSendAndReceiveTypingNotifications(boolean sendAndReceiveTypingNotifications) { sendNotifications = sendAndReceiveTypingNotifications; if (sendAndReceiveTypingNotifications) { SparkManager.getMessageEventManager().addMessageEventNotificationListener(messageManager); } else { SparkManager.getMessageEventManager().removeMessageEventNotificationListener(messageManager); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/GroupChatRoom.java/buggy/src/java/org/jivesoftware/spark/ui/rooms/GroupChatRoom.java
private void setupListeners() { chat.addParticipantStatusListener(new DefaultParticipantStatusListener() { public void kicked(String participant) { String nickname = StringUtils.parseResource(participant); insertText(Res.getString("message.user.kicked.from.room", nickname)); } public void voiceGranted(String participant) { String nickname = StringUtils.parseResource(participant); insertText(Res.getString("message.user.given.voice", nickname)); } public void voiceRevoked(String participant) { String nickname = StringUtils.parseResource(participant); insertText(Res.getString("message.user.voice.revoked", nickname)); } public void banned(String participant) { String nickname = StringUtils.parseResource(participant); insertText(Res.getString("message.user.banned", nickname)); } public void membershipGranted(String participant) { String nickname = StringUtils.parseResource(participant); insertText(Res.getString("message.user.granted.membership", nickname)); } public void membershipRevoked(String participant) { String nickname = StringUtils.parseResource(participant); insertText(Res.getString("message.user.revoked.membership", nickname)); } public void moderatorGranted(String participant) { String nickname = StringUtils.parseResource(participant); insertText(Res.getString("message.user.granted.moderator", nickname)); } public void moderatorRevoked(String participant) { String nickname = StringUtils.parseResource(participant); insertText(Res.getString("message.user.revoked.moderator", nickname)); } public void ownershipGranted(String participant) { String nickname = StringUtils.parseResource(participant); insertText(Res.getString("message.user.granted.owner", nickname)); } public void ownershipRevoked(String participant) { String nickname = StringUtils.parseResource(participant); insertText(Res.getString("message.user.revoked.owner", nickname)); } public void adminGranted(String participant) { String nickname = StringUtils.parseResource(participant); insertText(Res.getString("message.user.granted.admin", nickname)); } public void adminRevoked(String participant) { String nickname = StringUtils.parseResource(participant); insertText(Res.getString("message.user.revoked.admin", nickname)); } public void nicknameChanged(String participant, String nickname) { insertText(Res.getString("message.user.nickname.changed", StringUtils.parseResource(participant), nickname)); } }); chat.addUserStatusListener(new DefaultUserStatusListener() { public void kicked(String s, String reason) { insertText(Res.getString("message.your.kicked", s)); getChatInputEditor().setEnabled(false); getSplitPane().setRightComponent(null); leaveChatRoom(); } public void voiceGranted() { insertText(Res.getString("message.your.voice.granted")); getChatInputEditor().setEnabled(true); } public void voiceRevoked() { insertText(Res.getString("message.your.voice.revoked")); getChatInputEditor().setEnabled(false); } public void banned(String s, String reason) { insertText(Res.getString("message.your.banned")); } public void membershipGranted() { insertText(Res.getString("message.your.membership.granted")); } public void membershipRevoked() { insertText(Res.getString("message.your.membership.revoked")); } public void moderatorGranted() { insertText(Res.getString("message.your.moderator.granted")); } public void moderatorRevoked() { insertText(Res.getString("message.your.moderator.revoked")); } public void ownershipGranted() { insertText(Res.getString("message.your.ownership.granted")); } public void ownershipRevoked() { insertText(Res.getString("message.your.ownership.revoked")); } public void adminGranted() { insertText(Res.getString("message.your.admin.granted")); } public void adminRevoked() { insertText(Res.getString("message.your.revoked.granted")); } }); chat.addSubjectUpdatedListener(new SubjectListener()); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/GroupChatRoom.java/buggy/src/java/org/jivesoftware/spark/ui/rooms/GroupChatRoom.java
public void addLog(String action, Class klass, Long id) {
public void addLog(String action, Class klass, Long id) {
public void addLog(String action, Class klass, Long id) { Assert.notNull(action); Assert.notNull(klass); Assert.notNull(id); if (Event.class.isAssignableFrom(klass) || EventLog.class.isAssignableFrom(klass) || EventDiff.class.isAssignableFrom(klass)) { log.debug("Not logging creation of logging type:" + klass); } else { checkReady("addLog"); log.info("Adding log:" + action + "," + klass + "," + id); EventLog l = new EventLog(); l.setAction(action); l.setType(klass.getName()); // TODO could be id to Type entity l.setIdList(id.toString()); l.setDetails(CurrentDetails.createDetails()); l.getGraphHolder().setToken(null, token); CurrentDetails.getCreationEvent().addEventLog(l); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e6b7ac4062ce844e31078de77a00a7ab77e5e5d5/BasicSecuritySystem.java/buggy/components/server/src/ome/security/BasicSecuritySystem.java
EventLog l = new EventLog(); l.setAction(action); l.setType(klass.getName()); l.setIdList(id.toString()); l.setDetails(CurrentDetails.createDetails()); l.getGraphHolder().setToken(null, token); CurrentDetails.getCreationEvent().addEventLog(l);
CurrentDetails.addLog( action, klass, id );
public void addLog(String action, Class klass, Long id) { Assert.notNull(action); Assert.notNull(klass); Assert.notNull(id); if (Event.class.isAssignableFrom(klass) || EventLog.class.isAssignableFrom(klass) || EventDiff.class.isAssignableFrom(klass)) { log.debug("Not logging creation of logging type:" + klass); } else { checkReady("addLog"); log.info("Adding log:" + action + "," + klass + "," + id); EventLog l = new EventLog(); l.setAction(action); l.setType(klass.getName()); // TODO could be id to Type entity l.setIdList(id.toString()); l.setDetails(CurrentDetails.createDetails()); l.getGraphHolder().setToken(null, token); CurrentDetails.getCreationEvent().addEventLog(l); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e6b7ac4062ce844e31078de77a00a7ab77e5e5d5/BasicSecuritySystem.java/buggy/components/server/src/ome/security/BasicSecuritySystem.java
Assert.notNull(d); if (isSystemType(klass))
if ( d == null || isSystemType(klass) )
public boolean allowLoad(Class<? extends IObject> klass, Details d) { Assert.notNull(klass); Assert.notNull(d); if (isSystemType(klass)) return true; return SecurityFilter.passesFilter(this, d); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e6b7ac4062ce844e31078de77a00a7ab77e5e5d5/BasicSecuritySystem.java/buggy/components/server/src/ome/security/BasicSecuritySystem.java
if ( currentDetails.getCreationEvent() == null ) { newDetails.setCreationEvent( previousDetails.getCreationEvent() ); return true; }
protected boolean managedEvent(boolean locked, boolean privileged, IObject obj, Details previousDetails, Details currentDetails, Details newDetails) { if (!idEqual(previousDetails.getCreationEvent(), currentDetails .getCreationEvent())) { // no one change them. throw new SecurityViolation(String.format( "You are not authorized to change " + "the creation event for %s from %s to %s", obj, previousDetails.getCreationEvent(), currentDetails .getCreationEvent())); } // they are equal meaning no change was intended but in case other // changes took place, we have to make sure newDetails has the correct // value else { newDetails.setCreationEvent(previousDetails.getCreationEvent()); } return false; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e6b7ac4062ce844e31078de77a00a7ab77e5e5d5/BasicSecuritySystem.java/buggy/components/server/src/ome/security/BasicSecuritySystem.java
if (locked) { throw new SecurityViolation("Cannot change group for entity:" + obj); } else if (currentDetails.getGroup() == null) {
if ( currentDetails.getGroup() == null ) {
protected boolean managedGroup(boolean locked, boolean privileged, IObject obj, Details previousDetails, Details currentDetails, Details newDetails) { // previous and current have different ids. either change it and return // true if permitted, or throw an exception. if (!idEqual(previousDetails.getGroup(), currentDetails.getGroup())) { if (locked) { throw new SecurityViolation("Cannot change group for entity:" + obj); } // even root can't set them to null. else if (currentDetails.getGroup() == null) { newDetails.setGroup(previousDetails.getGroup()); return true; } // if user is a member of the group or the current user is an admin // or if the entity has been marked as privileged, then use the // current group. else if (memberOfGroups().contains( currentDetails.getGroup().getId()) || currentUserIsAdmin() || privileged) { newDetails.setGroup(currentDetails.getGroup()); return true; } // everyone else can't change them at all. else { throw new SecurityViolation(String.format( "You are not authorized to change " + "the group for %s from %s to %s", obj, previousDetails.getGroup(), currentDetails.getGroup())); } } // previous and current are the same, but we need to set // that value on newDetails. else { // This doesn't need to return true, because it'll only // be used if something else was changed. newDetails.setGroup(previousDetails.getGroup()); } return false; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e6b7ac4062ce844e31078de77a00a7ab77e5e5d5/BasicSecuritySystem.java/buggy/components/server/src/ome/security/BasicSecuritySystem.java
} if (locked) { throw new SecurityViolation("Object locked! " + "Cannot change group for entity:" + obj);
protected boolean managedGroup(boolean locked, boolean privileged, IObject obj, Details previousDetails, Details currentDetails, Details newDetails) { // previous and current have different ids. either change it and return // true if permitted, or throw an exception. if (!idEqual(previousDetails.getGroup(), currentDetails.getGroup())) { if (locked) { throw new SecurityViolation("Cannot change group for entity:" + obj); } // even root can't set them to null. else if (currentDetails.getGroup() == null) { newDetails.setGroup(previousDetails.getGroup()); return true; } // if user is a member of the group or the current user is an admin // or if the entity has been marked as privileged, then use the // current group. else if (memberOfGroups().contains( currentDetails.getGroup().getId()) || currentUserIsAdmin() || privileged) { newDetails.setGroup(currentDetails.getGroup()); return true; } // everyone else can't change them at all. else { throw new SecurityViolation(String.format( "You are not authorized to change " + "the group for %s from %s to %s", obj, previousDetails.getGroup(), currentDetails.getGroup())); } } // previous and current are the same, but we need to set // that value on newDetails. else { // This doesn't need to return true, because it'll only // be used if something else was changed. newDetails.setGroup(previousDetails.getGroup()); } return false; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e6b7ac4062ce844e31078de77a00a7ab77e5e5d5/BasicSecuritySystem.java/buggy/components/server/src/ome/security/BasicSecuritySystem.java
throw new SecurityViolation("Cannot change owner for:" + obj);
throw new SecurityViolation("Object locked! " + "Cannot change owner for:" + obj);
protected boolean managedOwner(boolean locked, boolean privileged, IObject obj, Details previousDetails, Details currentDetails, Details newDetails) { if (!idEqual(previousDetails.getOwner(), currentDetails.getOwner())) { if (locked) { throw new SecurityViolation("Cannot change owner for:" + obj); } // if the current user is an admin or if the entity has been // marked privileged, then use the current owner. else if (currentUserIsAdmin() || privileged) { // even root can't set them to null. if (currentDetails.getOwner() == null) { newDetails.setOwner(previousDetails.getOwner()); return true; } } // everyone else can't change them at all. else { throw new SecurityViolation(String.format( "You are not authorized to change " + "the owner for %s from %s to %s", obj, previousDetails.getOwner(), currentDetails.getOwner())); } } else { // values are the same. ensure they are the same for // newDetails as well newDetails.setOwner(previousDetails.getOwner()); } return false; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e6b7ac4062ce844e31078de77a00a7ab77e5e5d5/BasicSecuritySystem.java/buggy/components/server/src/ome/security/BasicSecuritySystem.java
if (currentDetails.getOwner() == null) { newDetails.setOwner(previousDetails.getOwner()); return true; }
protected boolean managedOwner(boolean locked, boolean privileged, IObject obj, Details previousDetails, Details currentDetails, Details newDetails) { if (!idEqual(previousDetails.getOwner(), currentDetails.getOwner())) { if (locked) { throw new SecurityViolation("Cannot change owner for:" + obj); } // if the current user is an admin or if the entity has been // marked privileged, then use the current owner. else if (currentUserIsAdmin() || privileged) { // even root can't set them to null. if (currentDetails.getOwner() == null) { newDetails.setOwner(previousDetails.getOwner()); return true; } } // everyone else can't change them at all. else { throw new SecurityViolation(String.format( "You are not authorized to change " + "the owner for %s from %s to %s", obj, previousDetails.getOwner(), currentDetails.getOwner())); } } else { // values are the same. ensure they are the same for // newDetails as well newDetails.setOwner(previousDetails.getOwner()); } return false; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e6b7ac4062ce844e31078de77a00a7ab77e5e5d5/BasicSecuritySystem.java/buggy/components/server/src/ome/security/BasicSecuritySystem.java
protected boolean managedOwner(boolean locked, boolean privileged, IObject obj, Details previousDetails, Details currentDetails, Details newDetails) { if (!idEqual(previousDetails.getOwner(), currentDetails.getOwner())) { if (locked) { throw new SecurityViolation("Cannot change owner for:" + obj); } // if the current user is an admin or if the entity has been // marked privileged, then use the current owner. else if (currentUserIsAdmin() || privileged) { // even root can't set them to null. if (currentDetails.getOwner() == null) { newDetails.setOwner(previousDetails.getOwner()); return true; } } // everyone else can't change them at all. else { throw new SecurityViolation(String.format( "You are not authorized to change " + "the owner for %s from %s to %s", obj, previousDetails.getOwner(), currentDetails.getOwner())); } } else { // values are the same. ensure they are the same for // newDetails as well newDetails.setOwner(previousDetails.getOwner()); } return false; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e6b7ac4062ce844e31078de77a00a7ab77e5e5d5/BasicSecuritySystem.java/buggy/components/server/src/ome/security/BasicSecuritySystem.java
if (iObject == null)
if (iObject == null || isSystemType( iObject.getClass() ))
public void markLockedIfNecessary(IObject iObject) { if (iObject == null) return; Set<IObject> s = new HashSet<IObject>(); IObject[] candidates = em.getLockCandidates(iObject); for (IObject object : candidates) { s.add(object); // TODO NEED TO CHECK FOR OWNERSHIP etc. etc. } CurrentDetails.appendLockCandidates(s); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e6b7ac4062ce844e31078de77a00a7ab77e5e5d5/BasicSecuritySystem.java/buggy/components/server/src/ome/security/BasicSecuritySystem.java
if (recv.getRuntime().getLoadService().load(file.toString())) { return recv.getRuntime().getTrue(); } return recv.getRuntime().getFalse();
recv.getRuntime().getLoadService().load(file.toString()); return recv.getRuntime().getTrue();
public static IRubyObject load(IRubyObject recv, IRubyObject[] args) { RubyString file = (RubyString)args[0]; if (recv.getRuntime().getLoadService().load(file.toString())) { return recv.getRuntime().getTrue(); } return recv.getRuntime().getFalse(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ee934b89304925fd623a76285f84cfb31cb3695f/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java
Experimenter foundUser = iQuery.get(Experimenter.class,user.getId());
Experimenter foundUser = internalGetExperimenter(user.getId());
public void addGroups(Experimenter user, ExperimenterGroup[] groups) { if (user == null) return; // Handled by annotations if (groups == null) return; Experimenter foundUser = iQuery.get(Experimenter.class,user.getId()); for (ExperimenterGroup group : groups) { ExperimenterGroup foundGroup = iQuery.get(ExperimenterGroup.class, group.getId()); foundUser.linkExperimenterGroup(foundGroup); } iUpdate.flush(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51bca7b98918ffeec3bfbe06121fa0c606f5da26/AdminImpl.java/buggy/components/server/src/ome/logic/AdminImpl.java
iQuery.get(ExperimenterGroup.class, group.getId());
internalGetGroup(group.getId());
public void addGroups(Experimenter user, ExperimenterGroup[] groups) { if (user == null) return; // Handled by annotations if (groups == null) return; Experimenter foundUser = iQuery.get(Experimenter.class,user.getId()); for (ExperimenterGroup group : groups) { ExperimenterGroup foundGroup = iQuery.get(ExperimenterGroup.class, group.getId()); foundUser.linkExperimenterGroup(foundGroup); } iUpdate.flush(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51bca7b98918ffeec3bfbe06121fa0c606f5da26/AdminImpl.java/buggy/components/server/src/ome/logic/AdminImpl.java
final LocalUpdate update = iUpdate; final IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); ExperimenterGroup group = internalLookupGroup(groupName); copy.getDetails().setGroup(group); securitySystem.doAction(copy, new SecureAction(){ public IObject updateObject(IObject obj) { update.flush(); return null; } });
public void changeGroup(IObject iObject, String groupName) { // TODO Auto-generated method stub }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51bca7b98918ffeec3bfbe06121fa0c606f5da26/AdminImpl.java/buggy/components/server/src/ome/logic/AdminImpl.java
IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Experimenter owner = internalLookupExperimenter(omeName); copy.getDetails().setOwner(owner); iUpdate.saveObject(copy);
public void changeOwner(IObject iObject, String omeName) { // TODO Auto-generated method stub }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51bca7b98918ffeec3bfbe06121fa0c606f5da26/AdminImpl.java/buggy/components/server/src/ome/logic/AdminImpl.java
IObject copy = iQuery.get(iObject.getClass(), iObject.getId()); Permissions p = new Permissions().applyMask(perms); copy.getDetails().setPermissions(p); iUpdate.saveObject(copy);
public void changePermissions(IObject iObject, Permissions perms) { // TODO Auto-generated method stub }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51bca7b98918ffeec3bfbe06121fa0c606f5da26/AdminImpl.java/buggy/components/server/src/ome/logic/AdminImpl.java
public Experimenter createExperimenter(Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups)
public Experimenter createExperimenter( Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups)
public Experimenter createExperimenter(Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups) {// TODO check that no other group is default Experimenter e = copyUser( experimenter ); if ( defaultGroup == null || defaultGroup.getId() == null ) { throw new ApiUsageException("Default group may not be null."); } GroupExperimenterMap defaultGroupMap = new GroupExperimenterMap(); defaultGroupMap.link( getGroup(defaultGroup.getId()), e); defaultGroupMap.setDefaultGroupLink(Boolean.TRUE); e.addGroupExperimenterMap(defaultGroupMap, false); if ( null != otherGroups ) { for (ExperimenterGroup group : otherGroups) { if ( group == null ) continue; if ( group.getId() == null) { throw new ApiUsageException( "Groups must be previously saved during " + "Experimenter creation."); } GroupExperimenterMap groupMap = new GroupExperimenterMap(); groupMap.link( getGroup(group.getId()), e); e.addGroupExperimenterMap(groupMap, false); } } e = iUpdate.saveAndReturnObject( e ); changeUserPassword(e.getOmeName()," "); return lookupExperimenter(e.getOmeName()); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51bca7b98918ffeec3bfbe06121fa0c606f5da26/AdminImpl.java/buggy/components/server/src/ome/logic/AdminImpl.java
defaultGroupMap.link( getGroup(defaultGroup.getId()), e);
defaultGroupMap.link( internalGetGroup(defaultGroup.getId()), e);
public Experimenter createExperimenter(Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups) {// TODO check that no other group is default Experimenter e = copyUser( experimenter ); if ( defaultGroup == null || defaultGroup.getId() == null ) { throw new ApiUsageException("Default group may not be null."); } GroupExperimenterMap defaultGroupMap = new GroupExperimenterMap(); defaultGroupMap.link( getGroup(defaultGroup.getId()), e); defaultGroupMap.setDefaultGroupLink(Boolean.TRUE); e.addGroupExperimenterMap(defaultGroupMap, false); if ( null != otherGroups ) { for (ExperimenterGroup group : otherGroups) { if ( group == null ) continue; if ( group.getId() == null) { throw new ApiUsageException( "Groups must be previously saved during " + "Experimenter creation."); } GroupExperimenterMap groupMap = new GroupExperimenterMap(); groupMap.link( getGroup(group.getId()), e); e.addGroupExperimenterMap(groupMap, false); } } e = iUpdate.saveAndReturnObject( e ); changeUserPassword(e.getOmeName()," "); return lookupExperimenter(e.getOmeName()); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51bca7b98918ffeec3bfbe06121fa0c606f5da26/AdminImpl.java/buggy/components/server/src/ome/logic/AdminImpl.java
groupMap.link( getGroup(group.getId()), e);
groupMap.link( internalGetGroup(group.getId()), e);
public Experimenter createExperimenter(Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups) {// TODO check that no other group is default Experimenter e = copyUser( experimenter ); if ( defaultGroup == null || defaultGroup.getId() == null ) { throw new ApiUsageException("Default group may not be null."); } GroupExperimenterMap defaultGroupMap = new GroupExperimenterMap(); defaultGroupMap.link( getGroup(defaultGroup.getId()), e); defaultGroupMap.setDefaultGroupLink(Boolean.TRUE); e.addGroupExperimenterMap(defaultGroupMap, false); if ( null != otherGroups ) { for (ExperimenterGroup group : otherGroups) { if ( group == null ) continue; if ( group.getId() == null) { throw new ApiUsageException( "Groups must be previously saved during " + "Experimenter creation."); } GroupExperimenterMap groupMap = new GroupExperimenterMap(); groupMap.link( getGroup(group.getId()), e); e.addGroupExperimenterMap(groupMap, false); } } e = iUpdate.saveAndReturnObject( e ); changeUserPassword(e.getOmeName()," "); return lookupExperimenter(e.getOmeName()); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51bca7b98918ffeec3bfbe06121fa0c606f5da26/AdminImpl.java/buggy/components/server/src/ome/logic/AdminImpl.java
return g;
return lookupGroup(g.getName());
public ExperimenterGroup createGroup(ExperimenterGroup group) { group = copyGroup( group ); ExperimenterGroup g = iUpdate.saveAndReturnObject( group ); return g; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51bca7b98918ffeec3bfbe06121fa0c606f5da26/AdminImpl.java/buggy/components/server/src/ome/logic/AdminImpl.java
lookupGroup("system"),
internalLookupGroup("system"),
public Experimenter createSystemUser(Experimenter newSystemUser) { Experimenter e = createExperimenter( newSystemUser, lookupGroup("system"), new ExperimenterGroup[]{ lookupGroup("user") } ); return e; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51bca7b98918ffeec3bfbe06121fa0c606f5da26/AdminImpl.java/buggy/components/server/src/ome/logic/AdminImpl.java
Experimenter e = createExperimenter(newUser, lookupGroup("user"),null);
Experimenter e = createExperimenter( newUser, internalLookupGroup("user"),null);
public Experimenter createUser(Experimenter newUser) { Experimenter e = createExperimenter(newUser, lookupGroup("user"),null); return e; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51bca7b98918ffeec3bfbe06121fa0c606f5da26/AdminImpl.java/buggy/components/server/src/ome/logic/AdminImpl.java
Experimenter e = getExperimenter(user.getId());
Experimenter e = internalGetExperimenter(user.getId());
public void deleteExperimenter( Experimenter user ) { Experimenter e = getExperimenter(user.getId()); int count = jdbc.update("delete from password where experimenter_id = ?", e.getId()); if ( count == 0 ) { log.info("No password found for user " +e.getOmeName() +". Cannot delete."); } iUpdate.deleteObject(e); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51bca7b98918ffeec3bfbe06121fa0c606f5da26/AdminImpl.java/buggy/components/server/src/ome/logic/AdminImpl.java
public MetaClass newSingletonClass() { MetaClass newClass = new MetaClass(getRuntime(), this);
public MetaClass newSingletonClass(RubyModule parentModule) { MetaClass newClass = new MetaClass(getRuntime(), this, parentModule);
public MetaClass newSingletonClass() { MetaClass newClass = new MetaClass(getRuntime(), this); newClass.infectBy(this); return newClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/32d84ae899fd3c367ef3800d0984b69f53209031/RubyClass.java/clean/src/org/jruby/RubyClass.java
newClass.makeMetaClass(getMetaClass());
newClass.makeMetaClass(getMetaClass(), newClass);
public RubyClass newSubClass(String name, RubyModule parentModule) { Ruby runtime = getRuntime(); RubyClass newClass = new RubyClass(runtime, runtime.getClasses().getClassClass(), this, parentModule, name); newClass.makeMetaClass(getMetaClass()); newClass.inheritedBy(this); runtime.getClasses().putClass(name, newClass, parentModule); return newClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/32d84ae899fd3c367ef3800d0984b69f53209031/RubyClass.java/clean/src/org/jruby/RubyClass.java
Browser browser = model.getBrowser(); ImageDisplay d = browser.getSelectedDisplay();
public void propertyChange(PropertyChangeEvent pce) { Browser browser = model.getBrowser(); ImageDisplay d = browser.getSelectedDisplay(); String propName = pce.getPropertyName(); if (Browser.POPUP_POINT_PROPERTY.equals(propName)) { Point p = browser.getPopupPoint(); if (d != null && p != null) view.showPopup(d, p); } else if (Browser.THUMB_SELECTED_PROPERTY.equals(propName)) { ThumbWinManager.display((ImageNode) d, model); } else if (TreeView.TREE_POPUP_POINT_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null Point p = treeView.getPopupPoint(); if (p != null) view.showPopup(((JComponent) pce.getNewValue()), p); } else if (TreeView.CLOSE_PROPERTY.equals(propName)) { model.showTreeView(false); } else if (TreeView.SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null browser.setSelectedDisplay((ImageDisplay) pce.getNewValue()); } else if (Browser.SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; treeView.accept(new SelectedNodeVisitor(treeView, d)); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/aaed3948a4c0b3282991cf3a892a7670ca368625/HiViewerControl.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerControl.java
browser.setSelectedDisplay((ImageDisplay) pce.getNewValue());
model.getBrowser().setSelectedDisplay( (ImageDisplay) pce.getNewValue());
public void propertyChange(PropertyChangeEvent pce) { Browser browser = model.getBrowser(); ImageDisplay d = browser.getSelectedDisplay(); String propName = pce.getPropertyName(); if (Browser.POPUP_POINT_PROPERTY.equals(propName)) { Point p = browser.getPopupPoint(); if (d != null && p != null) view.showPopup(d, p); } else if (Browser.THUMB_SELECTED_PROPERTY.equals(propName)) { ThumbWinManager.display((ImageNode) d, model); } else if (TreeView.TREE_POPUP_POINT_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null Point p = treeView.getPopupPoint(); if (p != null) view.showPopup(((JComponent) pce.getNewValue()), p); } else if (TreeView.CLOSE_PROPERTY.equals(propName)) { model.showTreeView(false); } else if (TreeView.SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null browser.setSelectedDisplay((ImageDisplay) pce.getNewValue()); } else if (Browser.SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; treeView.accept(new SelectedNodeVisitor(treeView, d)); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/aaed3948a4c0b3282991cf3a892a7670ca368625/HiViewerControl.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerControl.java
ImageDisplay d = model.getBrowser().getSelectedDisplay();
public void propertyChange(PropertyChangeEvent pce) { Browser browser = model.getBrowser(); ImageDisplay d = browser.getSelectedDisplay(); String propName = pce.getPropertyName(); if (Browser.POPUP_POINT_PROPERTY.equals(propName)) { Point p = browser.getPopupPoint(); if (d != null && p != null) view.showPopup(d, p); } else if (Browser.THUMB_SELECTED_PROPERTY.equals(propName)) { ThumbWinManager.display((ImageNode) d, model); } else if (TreeView.TREE_POPUP_POINT_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null Point p = treeView.getPopupPoint(); if (p != null) view.showPopup(((JComponent) pce.getNewValue()), p); } else if (TreeView.CLOSE_PROPERTY.equals(propName)) { model.showTreeView(false); } else if (TreeView.SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; //tree shouldn't be null browser.setSelectedDisplay((ImageDisplay) pce.getNewValue()); } else if (Browser.SELECTED_DISPLAY_PROPERTY.equals(propName)) { TreeView treeView = model.getTreeView(); if (treeView == null) return; treeView.accept(new SelectedNodeVisitor(treeView, d)); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/aaed3948a4c0b3282991cf3a892a7670ca368625/HiViewerControl.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerControl.java
int availableRows = testHeadlines.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows;
int availableRows = 0; ArticleItemBean[] articleItemBean; try { articleItemBean = (ArticleItemBean[])loadAllArticlesInFolder(new File("/Test/article/")).toArray(new ArticleItemBean[0]); availableRows = articleItemBean.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = Math.min(start.intValue() + nrOfRows,availableRows); for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), articleItemBean[i].getAuthor(), articleItemBean[i].getStatus()); _dataModel.set(a, i); }
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = testHeadlines.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = start.intValue() + nrOfRows; if (maxRow > availableRows) { maxRow = availableRows; } for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), testHeadlines[i], testPublished[i], testAuthors[i], testStatus[i]); if (i == 5) { // set test style red a.setTestStyle("color:red"); } _dataModel.set(a, i); } _dataModel.setRowCount(availableRows); }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/2cd921b37179b60f73b08e496f3539f6703ee5c0/ArticleListBean.java/clean/src/java/com/idega/block/article/bean/ArticleListBean.java
int maxRow = start.intValue() + nrOfRows; if (maxRow > availableRows) { maxRow = availableRows;
catch (XmlException e) { e.printStackTrace();
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = testHeadlines.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = start.intValue() + nrOfRows; if (maxRow > availableRows) { maxRow = availableRows; } for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), testHeadlines[i], testPublished[i], testAuthors[i], testStatus[i]); if (i == 5) { // set test style red a.setTestStyle("color:red"); } _dataModel.set(a, i); } _dataModel.setRowCount(availableRows); }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/2cd921b37179b60f73b08e496f3539f6703ee5c0/ArticleListBean.java/clean/src/java/com/idega/block/article/bean/ArticleListBean.java
for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), testHeadlines[i], testPublished[i], testAuthors[i], testStatus[i]); if (i == 5) { a.setTestStyle("color:red"); } _dataModel.set(a, i);
catch (IOException e) { e.printStackTrace();
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = testHeadlines.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = start.intValue() + nrOfRows; if (maxRow > availableRows) { maxRow = availableRows; } for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), testHeadlines[i], testPublished[i], testAuthors[i], testStatus[i]); if (i == 5) { // set test style red a.setTestStyle("color:red"); } _dataModel.set(a, i); } _dataModel.setRowCount(availableRows); }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/2cd921b37179b60f73b08e496f3539f6703ee5c0/ArticleListBean.java/clean/src/java/com/idega/block/article/bean/ArticleListBean.java
throw new IllegalArgumentException(msg);
throw new ApiUsageException(msg);
public static void errorOnViolation(Class implClass, Method mthd, Object[] args) throws ValidationException { /* find concrete method */ Method implMethod; try { implMethod = implClass.getMethod(mthd.getName(), (Class[]) mthd .getParameterTypes()); } catch (SecurityException e) { throw new InternalException( "Not allowed to perform reflection for testing API.\n" + String.format("Class:%s Method:%s",implClass.getName(),mthd)); } catch (NoSuchMethodException e) { return; // TODO No method == no violation. } log.info("Checking: " + implMethod); /* get arrays of arguments with parameters */ if ( args == null ) args = new Object[]{}; Annotation[][] anns = implMethod.getParameterAnnotations(); for (int i = 0; i < args.length; i++) { Object arg = args[i]; Annotation[] annotations = anns[i]; boolean validated = false; for (Annotation annotation : annotations) { if (NotNull.class.equals(annotation.annotationType())) { if (null == arg) { String msg = "Argument " + i + " to " + implMethod + " may not be null."; log.warn(msg); throw new IllegalArgumentException(msg); } } else if (Validate.class.equals(annotation.annotationType())) { validated = true; Validate validator = (Validate) annotation; Class[] validClasses = validator.value(); ValidSet validSet = new ValidSet( validClasses ); String msg = "Argument " + i + " must be of a type in:" + validSet; if (null == arg) { // handled by NotNull } else if (arg instanceof Collection) { Collection coll = (Collection) arg; for (Object object : coll) { if ( ! validSet.isValid( object.getClass() )) throw new IllegalArgumentException(msg); } } else { if ( ! validSet.isValid( arg.getClass() )) { throw new IllegalArgumentException(msg); } } } } /* warn if someone's forgotten to annotate a method */ if (arg instanceof Collection && !validated) throw new ValidationException(implMethod + " is missing a required @" + Validate.class.getName() + " annotation. Refusing to proceed..."); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/d102caba308a2112d9a1fb39652435611207cd3e/ApiConstraintChecker.java/clean/components/server/src/ome/annotations/ApiConstraintChecker.java
throw new IllegalArgumentException(msg);
throw new ApiUsageException(msg);
public static void errorOnViolation(Class implClass, Method mthd, Object[] args) throws ValidationException { /* find concrete method */ Method implMethod; try { implMethod = implClass.getMethod(mthd.getName(), (Class[]) mthd .getParameterTypes()); } catch (SecurityException e) { throw new InternalException( "Not allowed to perform reflection for testing API.\n" + String.format("Class:%s Method:%s",implClass.getName(),mthd)); } catch (NoSuchMethodException e) { return; // TODO No method == no violation. } log.info("Checking: " + implMethod); /* get arrays of arguments with parameters */ if ( args == null ) args = new Object[]{}; Annotation[][] anns = implMethod.getParameterAnnotations(); for (int i = 0; i < args.length; i++) { Object arg = args[i]; Annotation[] annotations = anns[i]; boolean validated = false; for (Annotation annotation : annotations) { if (NotNull.class.equals(annotation.annotationType())) { if (null == arg) { String msg = "Argument " + i + " to " + implMethod + " may not be null."; log.warn(msg); throw new IllegalArgumentException(msg); } } else if (Validate.class.equals(annotation.annotationType())) { validated = true; Validate validator = (Validate) annotation; Class[] validClasses = validator.value(); ValidSet validSet = new ValidSet( validClasses ); String msg = "Argument " + i + " must be of a type in:" + validSet; if (null == arg) { // handled by NotNull } else if (arg instanceof Collection) { Collection coll = (Collection) arg; for (Object object : coll) { if ( ! validSet.isValid( object.getClass() )) throw new IllegalArgumentException(msg); } } else { if ( ! validSet.isValid( arg.getClass() )) { throw new IllegalArgumentException(msg); } } } } /* warn if someone's forgotten to annotate a method */ if (arg instanceof Collection && !validated) throw new ValidationException(implMethod + " is missing a required @" + Validate.class.getName() + " annotation. Refusing to proceed..."); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/d102caba308a2112d9a1fb39652435611207cd3e/ApiConstraintChecker.java/clean/components/server/src/ome/annotations/ApiConstraintChecker.java
throw new IllegalArgumentException(msg);
throw new ApiUsageException(msg);
public static void errorOnViolation(Class implClass, Method mthd, Object[] args) throws ValidationException { /* find concrete method */ Method implMethod; try { implMethod = implClass.getMethod(mthd.getName(), (Class[]) mthd .getParameterTypes()); } catch (SecurityException e) { throw new InternalException( "Not allowed to perform reflection for testing API.\n" + String.format("Class:%s Method:%s",implClass.getName(),mthd)); } catch (NoSuchMethodException e) { return; // TODO No method == no violation. } log.info("Checking: " + implMethod); /* get arrays of arguments with parameters */ if ( args == null ) args = new Object[]{}; Annotation[][] anns = implMethod.getParameterAnnotations(); for (int i = 0; i < args.length; i++) { Object arg = args[i]; Annotation[] annotations = anns[i]; boolean validated = false; for (Annotation annotation : annotations) { if (NotNull.class.equals(annotation.annotationType())) { if (null == arg) { String msg = "Argument " + i + " to " + implMethod + " may not be null."; log.warn(msg); throw new IllegalArgumentException(msg); } } else if (Validate.class.equals(annotation.annotationType())) { validated = true; Validate validator = (Validate) annotation; Class[] validClasses = validator.value(); ValidSet validSet = new ValidSet( validClasses ); String msg = "Argument " + i + " must be of a type in:" + validSet; if (null == arg) { // handled by NotNull } else if (arg instanceof Collection) { Collection coll = (Collection) arg; for (Object object : coll) { if ( ! validSet.isValid( object.getClass() )) throw new IllegalArgumentException(msg); } } else { if ( ! validSet.isValid( arg.getClass() )) { throw new IllegalArgumentException(msg); } } } } /* warn if someone's forgotten to annotate a method */ if (arg instanceof Collection && !validated) throw new ValidationException(implMethod + " is missing a required @" + Validate.class.getName() + " annotation. Refusing to proceed..."); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/d102caba308a2112d9a1fb39652435611207cd3e/ApiConstraintChecker.java/clean/components/server/src/ome/annotations/ApiConstraintChecker.java
defineMethod("fcntl", Arity.twoArguments());
protected void initializeClass() { includeModule(getRuntime().getModule("Enumerable")); // TODO: Implement tty? and isatty. We have no real capability to // determine this from java, but if we could set tty status, then // we could invoke jruby differently to allow stdin to return true // on this. This would allow things like cgi.rb to work properly. defineSingletonMethod("foreach", Arity.optional()); defineSingletonMethod("read", Arity.optional()); defineSingletonMethod("readlines", Arity.optional()); defineSingletonMethod("popen", Arity.optional()); defineSingletonMethod("select", Arity.optional()); defineMethod("<<", Arity.singleArgument(), "addString"); defineMethod("binmode", Arity.noArguments()); defineMethod("clone", Arity.noArguments(), "clone_IO"); defineMethod("close", Arity.noArguments()); defineMethod("closed?", Arity.noArguments(), "closed"); defineMethod("each", Arity.optional(), "each_line"); defineMethod("each_byte", Arity.noArguments()); defineMethod("each_line", Arity.optional()); defineMethod("eof", Arity.noArguments()); defineAlias("eof?", "eof"); defineMethod("fileno", Arity.noArguments()); defineMethod("flush", Arity.noArguments()); defineMethod("fsync", Arity.noArguments()); defineMethod("getc", Arity.noArguments()); defineMethod("gets", Arity.optional()); defineMethod("initialize", Arity.optional()); defineMethod("lineno", Arity.noArguments()); defineMethod("lineno=", Arity.singleArgument(), "lineno_set"); defineMethod("pid", Arity.noArguments()); defineMethod("pos", Arity.noArguments()); defineMethod("pos=", Arity.singleArgument(), "pos_set"); defineMethod("print", Arity.optional()); defineMethod("printf", Arity.optional()); defineMethod("putc", Arity.singleArgument()); defineMethod("puts", Arity.optional()); defineMethod("read", Arity.optional()); defineMethod("readchar", Arity.noArguments()); defineMethod("readline", Arity.optional()); defineMethod("readlines", Arity.optional()); defineMethod("reopen", Arity.optional()); defineMethod("rewind", Arity.noArguments()); defineMethod("seek", Arity.optional()); defineMethod("sync", Arity.noArguments()); defineMethod("sync=", Arity.singleArgument(), "sync_set"); defineMethod("sysread", Arity.singleArgument()); defineMethod("syswrite", Arity.singleArgument()); defineAlias("tell", "pos"); defineAlias("to_i", "fileno"); defineMethod("to_io", Arity.noArguments()); defineMethod("ungetc", Arity.singleArgument()); defineMethod("write", Arity.singleArgument()); defineMethod("tty?", Arity.noArguments(), "tty"); defineAlias("isatty", "tty?"); // Constants for seek setConstant("SEEK_SET", getRuntime().newFixnum(IOHandler.SEEK_SET)); setConstant("SEEK_CUR", getRuntime().newFixnum(IOHandler.SEEK_CUR)); setConstant("SEEK_END", getRuntime().newFixnum(IOHandler.SEEK_END)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/54594cf2641226a173f9dc7981b2fbb511d7061e/IOMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/IOMetaClass.java
searchArticlesNode.setVisibleInMenus(false);
public void addArticleViews(IWBundle bundle){ ContentViewManager cViewManager = ContentViewManager.getInstance(bundle.getApplication()); ViewNode contentNode = cViewManager.getContentNode(); DefaultViewNode articleNode = new DefaultViewNode("article",contentNode); articleNode.setJspUri(bundle.getJSPURI("createarticle.jsp")); articleNode.setKeyboardShortcut(new KeyboardShortcut("a")); articleNode.setName("#{localizedStrings['com.idega.block.article']['article']}"); DefaultViewNode createNewArticleNode = new DefaultViewNode("create",articleNode); String jspUri = bundle.getJSPURI("createarticle.jsp"); createNewArticleNode.setJspUri(jspUri); createNewArticleNode.setName("#{localizedStrings['com.idega.block.article']['create_article']}"); DefaultViewNode editNewArticleNode = new DefaultViewNode("edit",articleNode);// editNewArticleNode.setJspUri(bundle.getJSPURI("createarticle.jsp")); editNewArticleNode.setJspUri(bundle.getJSPURI("editarticle.jsp")); editNewArticleNode.setVisibleInMenus(false); editNewArticleNode.setName("#{localizedStrings['com.idega.block.article']['edit']}"); DefaultViewNode listArticlesNode = new DefaultViewNode("list",articleNode); listArticlesNode.setJspUri(bundle.getJSPURI("listarticles.jsp")); listArticlesNode.setName("#{localizedStrings['com.idega.block.article']['list_articles']}"); DefaultViewNode previewArticlesNode = new DefaultViewNode("preview",articleNode); previewArticlesNode.setJspUri(bundle.getJSPURI("previewarticle.jsp")); previewArticlesNode.setVisibleInMenus(false); previewArticlesNode.setName("#{localizedStrings['com.idega.block.article']['preview']}"); DefaultViewNode searchArticlesNode = new DefaultViewNode("search",articleNode); searchArticlesNode.setJspUri(bundle.getJSPURI("searcharticle.jsp")); searchArticlesNode.setName("#{localizedStrings['com.idega.block.article']['search_articles']}"); searchArticlesNode.setVisibleInMenus(false); }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/44c7553551d463f44b7cb7cf5d0a43b62412701b/IWBundleStarter.java/buggy/src/java/com/idega/block/article/IWBundleStarter.java
assertEquals("nil", RubyNil.inspect(rubyNil).getValue());
assertEquals("nil", RubyNil.inspect(rubyNil).toString());
public void testInspect() { assertEquals("nil", RubyNil.inspect(rubyNil).getValue()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/TestRubyNil.java/buggy/test/org/jruby/test/TestRubyNil.java
assertEquals("", RubyNil.to_s(rubyNil).getValue());
assertEquals("", RubyNil.to_s(rubyNil).toString());
public void testToS() { assertEquals("", RubyNil.to_s(rubyNil).getValue()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/TestRubyNil.java/buggy/test/org/jruby/test/TestRubyNil.java
return RubyFixnum.zero(recv.getRuntime()); }
return RubyFixnum.zero(recv.getRuntime()); }
public static RubyFixnum to_i(IRubyObject recv) { return RubyFixnum.zero(recv.getRuntime()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/39c53cd7958c3b95ef4124a65a62d1e1cac24c84/RubyNil.java/buggy/src/org/jruby/RubyNil.java
getCurrentContext().pushClass(getClasses().getObjectClass());
private void init() { getIterStack().push(Iter.ITER_NOT); getFrameStack().push(); topFrame = getCurrentFrame(); getScope().push(); topScope = currentScope(); setCurrentVisibility(Visibility.PRIVATE); classes = new RubyClasses(this); classes.initCoreClasses(); RubyGlobal.createGlobals(this); exceptions = new RubyExceptions(this); exceptions.initDefaultExceptionClasses(); topSelf = TopSelfFactory.createTopSelf(this); getCurrentFrame().setSelf(topSelf); topNamespace = new Namespace(getClasses().getObjectClass()); namespace = topNamespace; getCurrentFrame().setNamespace(namespace); classes.initBuiltinClasses(); getScope().pop(); getScope().push(topScope); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f75018181746a5807539db933ad4144d55240425/Ruby.java/clean/src/org/jruby/Ruby.java
return "SemanticType"+(semanticTypeId==null ? ":Hash"+this.hashCode() : ":"+semanticTypeId);
return "SemanticType"+(semanticTypeId==null ? ":Hash_"+this.hashCode() : ":Id_"+semanticTypeId);
public String toString(){ return "SemanticType"+(semanticTypeId==null ? ":Hash"+this.hashCode() : ":"+semanticTypeId); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51a3c546dfc7a7a98b29771a459df19094fc5b51/SemanticType.java/clean/components/common/src/ome/model/SemanticType.java
if (movieIndex == Player.MOVIE_Z) max = maxZ;
MoviePaneMng(MoviePane view, PlayerUIMng playerUIMng, Registry registry, int maxT, int maxZ, MovieSettings settings) { this.view = view; this. playerUIMng = playerUIMng; this.registry = registry; this.maxT = maxT; this.maxZ = maxZ; max = maxT; curStartT = settings.getStartT(); curEndT = settings.getEndT(); curStartZ = settings.getStartZ(); curEndZ = settings.getEndZ(); movieIndex = settings.getMovieIndex(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/69d9ca849e67dccda3286f8ae868fd51e5634768/MoviePaneMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/movie/pane/MoviePaneMng.java
startTField.setActionCommand(""+START_T); startTField.addActionListener(this); startTField.addFocusListener(this); endTField.setActionCommand(""+END_T); endTField.addActionListener(this); endTField.addFocusListener(this); startZField.setActionCommand(""+START_Z); startZField.addActionListener(this); startZField.addFocusListener(this); endZField.setActionCommand(""+END_Z); endZField.addActionListener(this); endZField.addFocusListener(this);
attachFieldListeners(startTField, START_T); attachFieldListeners(endTField, END_T); attachFieldListeners(startZField, START_Z); attachFieldListeners(endZField, END_Z);
void attachListeners() { //TexField startTField = view.getMovieStartT(); endTField = view.getMovieEndT(); startZField = view.getMovieStartZ(); endZField = view.getMovieEndZ(); startTField.setActionCommand(""+START_T); startTField.addActionListener(this); startTField.addFocusListener(this); endTField.setActionCommand(""+END_T); endTField.addActionListener(this); endTField.addFocusListener(this); startZField.setActionCommand(""+START_Z); startZField.addActionListener(this); startZField.addFocusListener(this); endZField.setActionCommand(""+END_Z); endZField.addActionListener(this); endZField.addFocusListener(this); //RadioButton JRadioButton movieZ = view.getMovieZ(), movieT = view.getMovieT(); movieZ.addActionListener(this); movieZ.setActionCommand(""+Player.MOVIE_Z); movieT.addActionListener(this); movieT.setActionCommand(""+Player.MOVIE_T); view.getSliderT().addChangeListener(this); view.getSliderZ().addChangeListener(this); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/69d9ca849e67dccda3286f8ae868fd51e5634768/MoviePaneMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/movie/pane/MoviePaneMng.java
int width, height; width = img.getWidth(); height = img.getHeight();
public void paintComponent(Graphics g) { super.paintComponent(g); BufferedImage img = model.getDisplayedImage(); if (img == null) return; Graphics2D g2D = (Graphics2D) g; ImagePaintingFactory.setGraphicRenderingSettings(g2D); g2D.drawImage(img, null, 0, 0); if (model.isUnitBar()) { String value = model.getUnitBarValue(); if (value != null) { int size = (int) (model.getUnitBarSize()); int width, height; width = img.getWidth(); height = img.getHeight(); Rectangle imgRect = new Rectangle(0, 0, width, height); Rectangle viewRect = view.getViewport().getBounds(); JViewport port = view.getViewport(); int x = (int) port.getViewPosition().getX(); int y = (int) port.getViewPosition().getY(); if (imgRect.contains(viewRect)) { width = x+port.getWidth(); height = y+port.getHeight(); } else { width = img.getWidth(); height = img.getHeight(); if (x+viewRect.width < imgRect.width) width = x+viewRect.width; if (y+viewRect.height < imgRect.height) height = y+viewRect.height; } ImagePaintingFactory.paintScaleBar(g2D, width-size-10, height-10, size, value); } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fd07cb02b8ddef458b76281e758695eaa977dbf0/BrowserCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/browser/BrowserCanvas.java
Rectangle imgRect = new Rectangle(0, 0, width, height);
Rectangle imgRect = new Rectangle(0, 0, img.getWidth(), img.getHeight());
public void paintComponent(Graphics g) { super.paintComponent(g); BufferedImage img = model.getDisplayedImage(); if (img == null) return; Graphics2D g2D = (Graphics2D) g; ImagePaintingFactory.setGraphicRenderingSettings(g2D); g2D.drawImage(img, null, 0, 0); if (model.isUnitBar()) { String value = model.getUnitBarValue(); if (value != null) { int size = (int) (model.getUnitBarSize()); int width, height; width = img.getWidth(); height = img.getHeight(); Rectangle imgRect = new Rectangle(0, 0, width, height); Rectangle viewRect = view.getViewport().getBounds(); JViewport port = view.getViewport(); int x = (int) port.getViewPosition().getX(); int y = (int) port.getViewPosition().getY(); if (imgRect.contains(viewRect)) { width = x+port.getWidth(); height = y+port.getHeight(); } else { width = img.getWidth(); height = img.getHeight(); if (x+viewRect.width < imgRect.width) width = x+viewRect.width; if (y+viewRect.height < imgRect.height) height = y+viewRect.height; } ImagePaintingFactory.paintScaleBar(g2D, width-size-10, height-10, size, value); } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fd07cb02b8ddef458b76281e758695eaa977dbf0/BrowserCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/browser/BrowserCanvas.java
} else { width = img.getWidth(); height = img.getHeight(); if (x+viewRect.width < imgRect.width) width = x+viewRect.width; if (y+viewRect.height < imgRect.height) height = y+viewRect.height;
public void paintComponent(Graphics g) { super.paintComponent(g); BufferedImage img = model.getDisplayedImage(); if (img == null) return; Graphics2D g2D = (Graphics2D) g; ImagePaintingFactory.setGraphicRenderingSettings(g2D); g2D.drawImage(img, null, 0, 0); if (model.isUnitBar()) { String value = model.getUnitBarValue(); if (value != null) { int size = (int) (model.getUnitBarSize()); int width, height; width = img.getWidth(); height = img.getHeight(); Rectangle imgRect = new Rectangle(0, 0, width, height); Rectangle viewRect = view.getViewport().getBounds(); JViewport port = view.getViewport(); int x = (int) port.getViewPosition().getX(); int y = (int) port.getViewPosition().getY(); if (imgRect.contains(viewRect)) { width = x+port.getWidth(); height = y+port.getHeight(); } else { width = img.getWidth(); height = img.getHeight(); if (x+viewRect.width < imgRect.width) width = x+viewRect.width; if (y+viewRect.height < imgRect.height) height = y+viewRect.height; } ImagePaintingFactory.paintScaleBar(g2D, width-size-10, height-10, size, value); } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fd07cb02b8ddef458b76281e758695eaa977dbf0/BrowserCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/browser/BrowserCanvas.java
public void paintComponent(Graphics g) { super.paintComponent(g); BufferedImage img = model.getDisplayedImage(); if (img == null) return; Graphics2D g2D = (Graphics2D) g; ImagePaintingFactory.setGraphicRenderingSettings(g2D); g2D.drawImage(img, null, 0, 0); if (model.isUnitBar()) { String value = model.getUnitBarValue(); if (value != null) { int size = (int) (model.getUnitBarSize()); int width, height; width = img.getWidth(); height = img.getHeight(); Rectangle imgRect = new Rectangle(0, 0, width, height); Rectangle viewRect = view.getViewport().getBounds(); JViewport port = view.getViewport(); int x = (int) port.getViewPosition().getX(); int y = (int) port.getViewPosition().getY(); if (imgRect.contains(viewRect)) { width = x+port.getWidth(); height = y+port.getHeight(); } else { width = img.getWidth(); height = img.getHeight(); if (x+viewRect.width < imgRect.width) width = x+viewRect.width; if (y+viewRect.height < imgRect.height) height = y+viewRect.height; } ImagePaintingFactory.paintScaleBar(g2D, width-size-10, height-10, size, value); } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fd07cb02b8ddef458b76281e758695eaa977dbf0/BrowserCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/browser/BrowserCanvas.java
classes.addAll(sourceFileData.getChildren());
classes.addAll(sourceFileData.getClasses());
public SortedSet getClasses() { SortedSet classes = new TreeSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { SourceFileData sourceFileData = (SourceFileData)iter.next(); classes.addAll(sourceFileData.getChildren()); } return classes; }
50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/7f42310aa94d3450acefa63804376619941a31c5/PackageData.java/buggy/cobertura/src/net/sourceforge/cobertura/coveragedata/PackageData.java
threadContext.callSuper(args);
result = threadContext.callSuper(args);
public void visitSuperNode(SuperNode iVisited) { if (threadContext.getCurrentFrame().getLastClass() == null) { throw new NameError(runtime, "Superclass method '" + threadContext.getCurrentFrame().getLastFunc() + "' disabled."); } Block tmpBlock = ArgsUtil.beginCallArgs(threadContext); IRubyObject[] args = null; try { args = ArgsUtil.setupArgs(threadContext, this, iVisited.getArgsNode()); } finally { ArgsUtil.endCallArgs(threadContext, tmpBlock); } threadContext.callSuper(args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/87cd159e65e50f4157091c667b2f04e958262442/EvaluateVisitor.java/clean/src/org/jruby/evaluator/EvaluateVisitor.java
threadContext.callSuper(args);
result = threadContext.callSuper(args);
public void visitZSuperNode(ZSuperNode iVisited) { if (threadContext.getCurrentFrame().getLastClass() == null) { throw new NameError(runtime, "superclass method '" + runtime.getCurrentFrame().getLastFunc() + "' disabled"); } IRubyObject[] args = threadContext.getCurrentFrame().getArgs(); threadContext.callSuper(args); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/87cd159e65e50f4157091c667b2f04e958262442/EvaluateVisitor.java/clean/src/org/jruby/evaluator/EvaluateVisitor.java
if (je.getJumpType() == JumpException.JumpType.NextJump) { handleNext(je); } else if (je.getJumpType() == JumpException.JumpType.RedoJump) { handleRedo(je); } else if (je.getJumpType() == JumpException.JumpType.BreakJump) {
if (je.getJumpType() == JumpException.JumpType.BreakJump) {
public IRubyObject begin(Node node) { clearResult(); if (node != null) { try { // for each call to internalEval, push down new stacks (to isolate eval runs that still want to be logically separate pushCurrentInstructionStack(); addNodeInstruction(node); // TODO: once we're ready to have an external entity run this loop (i.e. thread scheduler) move this out masterLoop: while (hasNext()) { // invoke the next instruction try { executeNext(); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.NextJump) { handleNext(je); } else if (je.getJumpType() == JumpException.JumpType.RedoJump) { handleRedo(je); } else if (je.getJumpType() == JumpException.JumpType.BreakJump) { handleBreak(je); } else if (je.getJumpType() == JumpException.JumpType.RaiseJump) { handleRaise(je); } else if (je.getJumpType() == JumpException.JumpType.RetryJump) { handleRetry(je); } else if (je.getJumpType() == JumpException.JumpType.ReturnJump) { handleReturn(je); } else if (je.getJumpType() == JumpException.JumpType.ThrowJump) { handleThrow(je); } } } } catch (StackOverflowError soe) { // TODO: perhaps a better place to catch this (although it will go away) throw runtime.newSystemStackError("stack level too deep"); } finally { popCurrentInstructionStack(); } } return getResult(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ed5fe768829dd43ebf13861d9031b19571d6e898/EvaluationState.java/buggy/src/org/jruby/evaluator/EvaluationState.java
} } if (currentException != null && !handlingException) { if (currentException.getJumpType() == JumpException.JumpType.RedoJump) { handleRedo(currentException); } else if (currentException.getJumpType() == JumpException.JumpType.NextJump) { handleNext(currentException);
public IRubyObject begin(Node node) { clearResult(); if (node != null) { try { // for each call to internalEval, push down new stacks (to isolate eval runs that still want to be logically separate pushCurrentInstructionStack(); addNodeInstruction(node); // TODO: once we're ready to have an external entity run this loop (i.e. thread scheduler) move this out masterLoop: while (hasNext()) { // invoke the next instruction try { executeNext(); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.NextJump) { handleNext(je); } else if (je.getJumpType() == JumpException.JumpType.RedoJump) { handleRedo(je); } else if (je.getJumpType() == JumpException.JumpType.BreakJump) { handleBreak(je); } else if (je.getJumpType() == JumpException.JumpType.RaiseJump) { handleRaise(je); } else if (je.getJumpType() == JumpException.JumpType.RetryJump) { handleRetry(je); } else if (je.getJumpType() == JumpException.JumpType.ReturnJump) { handleReturn(je); } else if (je.getJumpType() == JumpException.JumpType.ThrowJump) { handleThrow(je); } } } } catch (StackOverflowError soe) { // TODO: perhaps a better place to catch this (although it will go away) throw runtime.newSystemStackError("stack level too deep"); } finally { popCurrentInstructionStack(); } } return getResult(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ed5fe768829dd43ebf13861d9031b19571d6e898/EvaluationState.java/buggy/src/org/jruby/evaluator/EvaluationState.java
addInstruction(iVisited, exceptionRethrower);
handlingException = true; addInstruction(iVisited, exceptionContinuer);
private void handleNext(JumpException je) { NextNode iVisited = (NextNode)je.getSecondaryData(); while (!(getCurrentInstructionStack().isEmpty() || peekCurrentInstructionBundle().redoable)) { InstructionBundle ib = peekCurrentInstructionBundle(); if (ib.ensured) { // exec ensured node, return to "nexting" afterwards popCurrentInstruction(); addInstruction(iVisited, exceptionRethrower); addInstructionBundle(ib); return; } popCurrentInstruction(); } if (getCurrentInstructionStack().isEmpty()) { // rethrow next to previous level throw je; } else { // pop the redoable and continue popCurrentInstruction(); setCurrentException(null); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ed5fe768829dd43ebf13861d9031b19571d6e898/EvaluationState.java/buggy/src/org/jruby/evaluator/EvaluationState.java
handlingException = false;
private void handleNext(JumpException je) { NextNode iVisited = (NextNode)je.getSecondaryData(); while (!(getCurrentInstructionStack().isEmpty() || peekCurrentInstructionBundle().redoable)) { InstructionBundle ib = peekCurrentInstructionBundle(); if (ib.ensured) { // exec ensured node, return to "nexting" afterwards popCurrentInstruction(); addInstruction(iVisited, exceptionRethrower); addInstructionBundle(ib); return; } popCurrentInstruction(); } if (getCurrentInstructionStack().isEmpty()) { // rethrow next to previous level throw je; } else { // pop the redoable and continue popCurrentInstruction(); setCurrentException(null); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ed5fe768829dd43ebf13861d9031b19571d6e898/EvaluationState.java/buggy/src/org/jruby/evaluator/EvaluationState.java
handlingException = false;
private void handleRedo(JumpException je) { RedoNode iVisited = (RedoNode)je.getSecondaryData(); while (!(getCurrentInstructionStack().isEmpty() || peekCurrentInstructionBundle().redoable)) { InstructionBundle ib = peekCurrentInstructionBundle(); if (ib.ensured) { // exec ensured node, return to "redoing" afterwards popCurrentInstruction(); addInstruction(iVisited, exceptionRethrower); addInstructionBundle(ib); return; } popCurrentInstruction(); } if (getCurrentInstructionStack().isEmpty()) { // rethrow next to previous level throw je; } else { // pop the redoable leave the redo body Node nodeToRedo = (Node)peekCurrentInstructionContext(); popCurrentInstruction(); addRedoMarker(nodeToRedo); addNodeInstruction(nodeToRedo); setCurrentException(null); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ed5fe768829dd43ebf13861d9031b19571d6e898/EvaluationState.java/buggy/src/org/jruby/evaluator/EvaluationState.java
_colorName = null;
final public WikiPage parse(WikiPageBuilder builder) throws ParseException { Token t; label_1: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case QUOTED_BLOCK: case BOLD: case UNDERLINE: case ITALIC: case LT: case GT: case COLOR: case HEADER: case COLOR_HEADER_TERMINATE: case RULE: case EMAIL: case URL: case WIKI_TERM: case SHORT_WIKI_TERM: case WORD: case NEW_PARAGRAPH: case LINE_BREAK: case INDENT: case WHITESPACE: case ASTERISK: case UNDERSCORE: case CARET: case DOUBLE_LBRACKET: case DELIMITERS: ; break; default: jj_la1[0] = jj_gen; break label_1; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LT: t = jj_consume_token(LT); builder.lt(); break; case GT: t = jj_consume_token(GT); builder.gt(); break; case BOLD: t = jj_consume_token(BOLD); builder.bold(); break; case UNDERLINE: t = jj_consume_token(UNDERLINE); builder.underline(); break; case ITALIC: t = jj_consume_token(ITALIC); builder.italic(); break; case COLOR: t = jj_consume_token(COLOR); if (_headerName != null || _colorName != null) { builder.endColorOrHeader(); String word = t.image.substring(1); if (builder.isWikiTermReference (word)) builder.wikiTerm (word); else builder.word (word); _colorName = null; _headerName = null; } else { _colorName = t.image.substring(1); builder.color (_colorName); } break; case HEADER: t = jj_consume_token(HEADER); _headerName = t.image.substring(2); builder.header (_headerName); break; case COLOR_HEADER_TERMINATE: t = jj_consume_token(COLOR_HEADER_TERMINATE); if (_headerName == null && _colorName == null) builder.word ("^"); else { builder.endColorOrHeader (); _headerName = null; } break; case RULE: t = jj_consume_token(RULE); builder.ruler(); break; case EMAIL: t = jj_consume_token(EMAIL); builder.email(t.image); break; case WIKI_TERM: t = jj_consume_token(WIKI_TERM); if (builder.isWikiTermReference (t.image)) builder.wikiTerm (t.image); else builder.word (t.image); break; case SHORT_WIKI_TERM: t = jj_consume_token(SHORT_WIKI_TERM); if (builder.isWikiTermReference (t.image)) builder.wikiTerm (t.image.substring(0, t.image.length()-1)); else builder.word (t.image); break; case WORD: t = jj_consume_token(WORD); builder.word (t.image); break; case NEW_PARAGRAPH: t = jj_consume_token(NEW_PARAGRAPH); builder.paragraph (); break; case LINE_BREAK: t = jj_consume_token(LINE_BREAK); builder.newline(); break; case INDENT: t = jj_consume_token(INDENT); builder.indent(2); break; case WHITESPACE: t = jj_consume_token(WHITESPACE); builder.space(); break; case ASTERISK: t = jj_consume_token(ASTERISK); builder.word ("*"); break; case UNDERSCORE: t = jj_consume_token(UNDERSCORE); builder.word ("_"); break; case CARET: t = jj_consume_token(CARET); builder.word ("^"); break; case DOUBLE_LBRACKET: t = jj_consume_token(DOUBLE_LBRACKET); builder.word ("[["); break; case DELIMITERS: t = jj_consume_token(DELIMITERS); builder.word (t.image); break; case URL: t = jj_consume_token(URL); builder.url (t.image); break; case QUOTED_BLOCK: t = jj_consume_token(QUOTED_BLOCK); builder.quotedBlock (t.image.substring(2, t.image.length()-2)); break; default: jj_la1[1] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } {if (true) return builder.getPage ();} throw new Error("Missing return statement in function"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/3b3eb520f27d3c9af235ee5b06769be73322daec/WikiParser.java/clean/wiki/src/org/tcdi/opensource/wiki/parser/WikiParser.java
for (Iterator it = nsr.parse().iterator(); it.hasNext();)
nsr.parse(); for (Iterator it = nsr.process().iterator(); it.hasNext();)
public void DISABLEDtestReal() throws Exception { File currentDir = new File(System.getProperty("user.dir"));// TODO Util File mappings = new File(currentDir.getParent() + File.separator + "common" + File.separator + "resources" + File.separator + "Mappings.ome.xml"); // FIXME circular deps. log.error(mappings); SaxReader nsr = new SaxReader(mappings); for (Iterator it = nsr.parse().iterator(); it.hasNext();) { SemanticType st = (SemanticType) it.next(); VelocityHelper vh = new VelocityHelper(); vh.put("type", st); // FileWriter fw = new // FileWriter("/tmp/"+st.getId().replaceAll("[.]","_")+".hbm.xml"); StringWriter sw = new StringWriter(); vh.invoke("ome/dsl/mapping.vm", sw); sw.flush(); sw.close(); // fw.flush(); // fw.close(); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d9e84b0d2f71da76eba45bc713472ad607c544a/ExampleUsageTest.java/buggy/components/dsl/test/ome/dsl/utests/ExampleUsageTest.java
sr = new SaxReader("type.xml");
File f = new File(ExampleUsageTest.class.getResource("type.xml").getFile()); sr = new SaxReader(f);
protected void setUp() throws Exception { sr = new SaxReader("type.xml"); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d9e84b0d2f71da76eba45bc713472ad607c544a/ExampleUsageTest.java/buggy/components/dsl/test/ome/dsl/utests/ExampleUsageTest.java
Set set = sr.parse();
sr.parse(); Set set = sr.process();
public void testONE() { Set set = sr.parse(); log.info("Results of parse:" + set); for (Iterator it = set.iterator(); it.hasNext();) { SemanticType st = (SemanticType) it.next(); VelocityHelper vh = new VelocityHelper(); vh.put("type", st); Map h = new HashMap(); h.put("test", "this was a dynamic key test"); vh.put("test", h); String s = vh.invoke("ome/dsl/mapping.vm"); log.info("Results of invoke:" + s); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d9e84b0d2f71da76eba45bc713472ad607c544a/ExampleUsageTest.java/buggy/components/dsl/test/ome/dsl/utests/ExampleUsageTest.java
Set set = sr.parse();
sr.parse(); Set set = sr.process();
public void testWithWriting() throws Exception { Set set = sr.parse(); for (Iterator it = set.iterator(); it.hasNext();) { SemanticType st = (SemanticType) it.next(); VelocityHelper vh = new VelocityHelper(); vh.put("type", st); // FileWriter fw = new // FileWriter("/tmp/"+st.getId().replaceAll("[.]","_")+".hbm.xml"); StringWriter sw = new StringWriter(); vh.invoke("ome/dsl/mapping.vm", sw); sw.flush(); sw.close(); // fw.flush(); // fw.close(); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d9e84b0d2f71da76eba45bc713472ad607c544a/ExampleUsageTest.java/buggy/components/dsl/test/ome/dsl/utests/ExampleUsageTest.java
Element body = (Element)webResponse.getDOM().getDocumentElement().getElementsByTagName("body").item(0); NodeList elems = body.getElementsByTagName("textarea"); response = elems.item(0).getChildNodes().item(0).getNodeValue();
NodeList list = webResponse.getDOM().getDocumentElement().getElementsByTagName("div"); int length = list.getLength(); for (int i = 0; i < length; i++) { Element element = (Element)list.item(i); if ("result_box".equals(element.getAttribute("id"))) { Node translation = element.getFirstChild(); if (translation != null) { response = translation.getNodeValue(); } } }
private static String useGoogleTranslator(String text, TranslationType type) { String response = null; String urlString = "http://translate.google.com/translate_t?text=" + text + "&langpair=" + type.getID(); // disable scripting to avoid requiring js.jar HttpUnitOptions.setScriptingEnabled(false); // create the conversation object which will maintain state for us WebConversation wc = new WebConversation(); // Obtain the google translation page WebRequest webRequest = new GetMethodWebRequest(urlString); // required to prevent a 403 forbidden error from google webRequest.setHeaderField("User-agent", "Mozilla/4.0"); try { WebResponse webResponse = wc.getResponse(webRequest); Element body = (Element)webResponse.getDOM().getDocumentElement().getElementsByTagName("body").item(0); NodeList elems = body.getElementsByTagName("textarea"); response = elems.item(0).getChildNodes().item(0).getNodeValue(); } catch (MalformedURLException e) { Log.error("Could not for url: " + e); } catch (IOException e) { Log.error("Could not get response: " + e); } catch (SAXException e) { Log.error("Could not parse response content: " + e); } return response; }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/93b8449904967783211de8a56a69f1cec482d118/TranslatorUtil.java/clean/src/plugins/translator/src/java/org/jivesoftware/spark/translator/TranslatorUtil.java
int startReal, int endReal, int yStart, int yEnd, PixelsStatsEntry[] histogramData) { this.histogramData = histogramData; this.manager = manager; initSizeBin(); setWindowLimits(mini, maxi); setInputWindow(startReal, endReal); controlOutputStart = yStart; heightStart = tS-yStart; heightEnd = yEnd-topBorder; setKnobOutputStart(lS+10, yStart); setKnobOutputEnd(leftBorder-10, yEnd); setSize(widthWin, HEIGHT); repaint(); }
int startReal, int endReal, int yStart, int yEnd, PixelsStatsEntry[] histogramData) { this.histogramData = histogramData; this.manager = manager; initSizeBin(); setWindowLimits(mini, maxi); setInputWindow(startReal, endReal); controlOutputStart = yStart; heightStart = tS-yStart; heightEnd = yEnd-topBorder; setKnobOutputStart(lS+10, yStart); setKnobOutputEnd(leftBorder-10, yEnd); setSize(widthWin, HEIGHT); repaint(); }
HistogramPanel(HistogramDialogManager manager, int mini, int maxi, int startReal, int endReal, int yStart, int yEnd, PixelsStatsEntry[] histogramData) { this.histogramData = histogramData; this.manager = manager; initSizeBin(); setWindowLimits(mini, maxi); setInputWindow(startReal, endReal); //control output window controlOutputStart = yStart; heightStart = tS-yStart; heightEnd = yEnd-topBorder; //output knob setKnobOutputStart(lS+10, yStart); setKnobOutputEnd(leftBorder-10, yEnd); setSize(widthWin, HEIGHT); repaint(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1722ebf9ac60fc8e45cdc8d0049e85db5b86715c/HistogramPanel.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/pane/HistogramPanel.java