rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
public Object doInHibernate(Session session) throws HibernateException, SQLException { org.hibernate.Query q = session.createQuery( "select g.id from ExperimenterGroup g where g.details.owner.id = :id"); q.setParameter("id", e.getId()); return q.list(); }
public Object doInHibernate(Session session) throws HibernateException, SQLException { org.hibernate.Query q = session .createQuery("select g.id from ExperimenterGroup g where g.details.owner.id = :id"); q.setParameter("id", e.getId()); return q.list(); }
public Object doInHibernate(Session session) throws HibernateException, SQLException { org.hibernate.Query q = session.createQuery( "select g.id from ExperimenterGroup g where g.details.owner.id = :id"); q.setParameter("id", e.getId()); return q.list(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
public List<Long> getMemberOfGroupIds( final Experimenter e ) { Assert.notNull(e); Assert.notNull(e.getId()); List<Long> groupIds = iQuery.execute(new HibernateCallback(){ public Object doInHibernate(Session session) throws HibernateException, SQLException { org.hibernate.Query q = session.createQuery( "select m.parent.id from GroupExperimenterMap m " + "where m.child.id = :id"); q.setParameter("id", e.getId()); return q.list(); } }); return groupIds; }
public List<Long> getMemberOfGroupIds(final Experimenter e) { Assert.notNull(e); Assert.notNull(e.getId()); List<Long> groupIds = iQuery.execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException, SQLException { org.hibernate.Query q = session .createQuery("select m.parent.id from GroupExperimenterMap m " + "where m.child.id = :id"); q.setParameter("id", e.getId()); return q.list(); } }); return groupIds; }
public List<Long> getMemberOfGroupIds( final Experimenter e ) { Assert.notNull(e); Assert.notNull(e.getId()); List<Long> groupIds = iQuery.execute(new HibernateCallback(){ public Object doInHibernate(Session session) throws HibernateException, SQLException { org.hibernate.Query q = session.createQuery( "select m.parent.id from GroupExperimenterMap m " + "where m.child.id = :id"); q.setParameter("id", e.getId()); return q.list(); } }); return groupIds; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
public Object doInHibernate(Session session) throws HibernateException, SQLException { org.hibernate.Query q = session.createQuery( "select m.parent.id from GroupExperimenterMap m " + "where m.child.id = :id"); q.setParameter("id", e.getId()); return q.list(); }
public Object doInHibernate(Session session) throws HibernateException, SQLException { org.hibernate.Query q = session .createQuery("select m.parent.id from GroupExperimenterMap m " + "where m.child.id = :id"); q.setParameter("id", e.getId()); return q.list(); }
public Object doInHibernate(Session session) throws HibernateException, SQLException { org.hibernate.Query q = session.createQuery( "select m.parent.id from GroupExperimenterMap m " + "where m.child.id = :id"); q.setParameter("id", e.getId()); return q.list(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
public Roles getSecurityRoles() { return getSecuritySystem().getSecurityRoles(); }
public Roles getSecurityRoles() { return getSecuritySystem().getSecurityRoles(); }
public Roles getSecurityRoles() { return getSecuritySystem().getSecurityRoles(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
protected Class<? extends ServiceInterface> getServiceInterface() { return IAdmin.class; }
protected Class<? extends ServiceInterface> getServiceInterface() { return IAdmin.class; }
protected Class<? extends ServiceInterface> getServiceInterface() { return IAdmin.class; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
public ExperimenterGroup groupProxy(Long id) { if ( id == null ) throw new ApiUsageException("Id argument cannot be null.");
public ExperimenterGroup groupProxy(Long id) { if (id == null) throw new ApiUsageException("Id argument cannot be null.");
public ExperimenterGroup groupProxy(Long id) { if ( id == null ) throw new ApiUsageException("Id argument cannot be null."); ExperimenterGroup g = iQuery.get(ExperimenterGroup.class,id); return g; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
ExperimenterGroup g = iQuery.get(ExperimenterGroup.class,id); return g; }
ExperimenterGroup g = iQuery.get(ExperimenterGroup.class, id); return g; }
public ExperimenterGroup groupProxy(Long id) { if ( id == null ) throw new ApiUsageException("Id argument cannot be null."); ExperimenterGroup g = iQuery.get(ExperimenterGroup.class,id); return g; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
protected void internalChangeUserPasswordById(Long id, String password) { int results = jdbc.update( "update password set hash = ? " + "where experimenter_id = ? ", preparePassword(password),id ); if ( results < 1 ) { results = jdbc.update("insert into password values (?,?) ", id,preparePassword(password)); } synchronizeLoginCache(); }
protected void internalChangeUserPasswordById(Long id, String password) { int results = jdbc.update("update password set hash = ? " + "where experimenter_id = ? ", preparePassword(password), id); if (results < 1) { results = jdbc.update("insert into password values (?,?) ", id, preparePassword(password)); } synchronizeLoginCache(); }
protected void internalChangeUserPasswordById(Long id, String password) { int results = jdbc.update( "update password set hash = ? " + "where experimenter_id = ? ", preparePassword(password),id ); if ( results < 1 ) { results = jdbc.update("insert into password values (?,?) ", id,preparePassword(password)); } synchronizeLoginCache(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
public Experimenter lookupExperimenter(final String omeName) { Experimenter e = iQuery.execute( new UserQ( new Parameters( ) .addString("name",omeName))); if (e == null) { throw new ApiUsageException("No such experimenter: " + omeName); }
public Experimenter lookupExperimenter(final String omeName) { Experimenter e = iQuery.execute(new UserQ(new Parameters().addString( "name", omeName)));
public Experimenter lookupExperimenter(final String omeName) { Experimenter e = iQuery.execute( new UserQ( new Parameters( ) .addString("name",omeName))); if (e == null) { throw new ApiUsageException("No such experimenter: " + omeName); } return e; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
return e; }
if (e == null) { throw new ApiUsageException("No such experimenter: " + omeName); } return e; }
public Experimenter lookupExperimenter(final String omeName) { Experimenter e = iQuery.execute( new UserQ( new Parameters( ) .addString("name",omeName))); if (e == null) { throw new ApiUsageException("No such experimenter: " + omeName); } return e; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
public ExperimenterGroup lookupGroup(final String groupName) { ExperimenterGroup g = iQuery.execute( new GroupQ( new Parameters( ).addString("name",groupName))); if (g == null) { throw new ApiUsageException("No such group: " + groupName); }
public ExperimenterGroup lookupGroup(final String groupName) { ExperimenterGroup g = iQuery.execute(new GroupQ(new Parameters() .addString("name", groupName)));
public ExperimenterGroup lookupGroup(final String groupName) { ExperimenterGroup g = iQuery.execute( new GroupQ( new Parameters( ).addString("name",groupName))); if (g == null) { throw new ApiUsageException("No such group: " + groupName); } return g; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
return g; }
if (g == null) { throw new ApiUsageException("No such group: " + groupName); } return g; }
public ExperimenterGroup lookupGroup(final String groupName) { ExperimenterGroup g = iQuery.execute( new GroupQ( new Parameters( ).addString("name",groupName))); if (g == null) { throw new ApiUsageException("No such group: " + groupName); } return g; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
protected String passwordDigest( String clearText ) { if ( clearText == null ) { throw new ApiUsageException("Value for digesting may not be null"); } String hashedText = Util .createPasswordHash("MD5", "base64", "ISO-8859-1", null, clearText, null); if ( hashedText == null ) {
protected String passwordDigest(String clearText) { if (clearText == null) { throw new ApiUsageException("Value for digesting may not be null"); } String hashedText = Util.createPasswordHash("MD5", "base64", "ISO-8859-1", null, clearText, null); if (hashedText == null) {
protected String passwordDigest( String clearText ) { if ( clearText == null ) { throw new ApiUsageException("Value for digesting may not be null"); } // These constants are also defined in app/resources/jboss-login.xml // and this method is called from {@link JBossLoginModule} String hashedText = Util .createPasswordHash("MD5", "base64", "ISO-8859-1", null, clearText, null); if ( hashedText == null ) { throw new InternalException("Failed to obtain digest."); } return hashedText; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
}
}
protected String passwordDigest( String clearText ) { if ( clearText == null ) { throw new ApiUsageException("Value for digesting may not be null"); } // These constants are also defined in app/resources/jboss-login.xml // and this method is called from {@link JBossLoginModule} String hashedText = Util .createPasswordHash("MD5", "base64", "ISO-8859-1", null, clearText, null); if ( hashedText == null ) { throw new InternalException("Failed to obtain digest."); } return hashedText; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
return newPassword == null ? null
return newPassword == null ? null
protected String preparePassword(String newPassword) { // This allows setting passwords to "null" - locked account. return newPassword == null ? null // This allows empty passwords to be considered "open-access" : newPassword.trim().length() == 0 ? newPassword // Regular MD5 digest. : passwordDigest(newPassword); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
protected String preparePassword(String newPassword) { // This allows setting passwords to "null" - locked account. return newPassword == null ? null // This allows empty passwords to be considered "open-access" : newPassword.trim().length() == 0 ? newPassword // Regular MD5 digest. : passwordDigest(newPassword); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
public void removeGroups(Experimenter user, ExperimenterGroup... groups) { if (user == null) return; if (groups == null) return; Experimenter foundUser = getExperimenter(user.getId()); List<Long> toRemove = new ArrayList<Long>(); for (ExperimenterGroup g : groups) { if (g.getId()!=null) toRemove.add(g.getId());
public void removeGroups(Experimenter user, ExperimenterGroup... groups) { if (user == null) return; if (groups == null) return; Experimenter foundUser = getExperimenter(user.getId()); List<Long> toRemove = new ArrayList<Long>(); for (ExperimenterGroup g : groups) { if (g.getId() != null) toRemove.add(g.getId());
public void removeGroups(Experimenter user, ExperimenterGroup... groups) { if (user == null) return; if (groups == null) return; Experimenter foundUser = getExperimenter(user.getId()); List<Long> toRemove = new ArrayList<Long>(); for (ExperimenterGroup g : groups) { if (g.getId()!=null) toRemove.add(g.getId()); } for (GroupExperimenterMap map : (List<GroupExperimenterMap>) foundUser.collectGroupExperimenterMap(null)) { if (toRemove.contains(map.parent().getId())) { map.child().removeGroupExperimenterMap(map, false); map.parent().removeGroupExperimenterMap(map, false); getSecuritySystem().doAction(map,new SecureAction(){ public <T extends IObject> T updateObject(T obj) { iUpdate.deleteObject( obj ); return null; } }); } } iUpdate.flush(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
for (GroupExperimenterMap map : (List<GroupExperimenterMap>) foundUser.collectGroupExperimenterMap(null)) { if (toRemove.contains(map.parent().getId())) {
for (GroupExperimenterMap map : (List<GroupExperimenterMap>) foundUser .collectGroupExperimenterMap(null)) { if (toRemove.contains(map.parent().getId())) {
public void removeGroups(Experimenter user, ExperimenterGroup... groups) { if (user == null) return; if (groups == null) return; Experimenter foundUser = getExperimenter(user.getId()); List<Long> toRemove = new ArrayList<Long>(); for (ExperimenterGroup g : groups) { if (g.getId()!=null) toRemove.add(g.getId()); } for (GroupExperimenterMap map : (List<GroupExperimenterMap>) foundUser.collectGroupExperimenterMap(null)) { if (toRemove.contains(map.parent().getId())) { map.child().removeGroupExperimenterMap(map, false); map.parent().removeGroupExperimenterMap(map, false); getSecuritySystem().doAction(map,new SecureAction(){ public <T extends IObject> T updateObject(T obj) { iUpdate.deleteObject( obj ); return null; } }); } } iUpdate.flush(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
getSecuritySystem().doAction(map,new SecureAction(){ public <T extends IObject> T updateObject(T obj) { iUpdate.deleteObject( obj ); return null; } });
getSecuritySystem().doAction(map, new SecureAction() { public <T extends IObject> T updateObject(T obj) { iUpdate.deleteObject(obj); return null; } });
public void removeGroups(Experimenter user, ExperimenterGroup... groups) { if (user == null) return; if (groups == null) return; Experimenter foundUser = getExperimenter(user.getId()); List<Long> toRemove = new ArrayList<Long>(); for (ExperimenterGroup g : groups) { if (g.getId()!=null) toRemove.add(g.getId()); } for (GroupExperimenterMap map : (List<GroupExperimenterMap>) foundUser.collectGroupExperimenterMap(null)) { if (toRemove.contains(map.parent().getId())) { map.child().removeGroupExperimenterMap(map, false); map.parent().removeGroupExperimenterMap(map, false); getSecuritySystem().doAction(map,new SecureAction(){ public <T extends IObject> T updateObject(T obj) { iUpdate.deleteObject( obj ); return null; } }); } } iUpdate.flush(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
} iUpdate.flush(); }
} iUpdate.flush(); }
public void removeGroups(Experimenter user, ExperimenterGroup... groups) { if (user == null) return; if (groups == null) return; Experimenter foundUser = getExperimenter(user.getId()); List<Long> toRemove = new ArrayList<Long>(); for (ExperimenterGroup g : groups) { if (g.getId()!=null) toRemove.add(g.getId()); } for (GroupExperimenterMap map : (List<GroupExperimenterMap>) foundUser.collectGroupExperimenterMap(null)) { if (toRemove.contains(map.parent().getId())) { map.child().removeGroupExperimenterMap(map, false); map.parent().removeGroupExperimenterMap(map, false); getSecuritySystem().doAction(map,new SecureAction(){ public <T extends IObject> T updateObject(T obj) { iUpdate.deleteObject( obj ); return null; } }); } } iUpdate.flush(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
iUpdate.deleteObject( obj ); return null; }
iUpdate.deleteObject(obj); return null; }
public <T extends IObject> T updateObject(T obj) { iUpdate.deleteObject( obj ); return null; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
public void setDefaultGroup(Experimenter user, ExperimenterGroup group) { if (user == null) return; if (group == null) return; if (group.getId() == null) { throw new ApiUsageException("Group argument to setDefaultGroup " + "must be managed (i.e. have an id)"); } boolean newDefaultSet = false; Experimenter foundUser = getExperimenter(user.getId()); for (GroupExperimenterMap map : (List<GroupExperimenterMap>) foundUser.collectGroupExperimenterMap(null)) { if (map.parent().getId().equals(group.getId())) { map.setDefaultGroupLink(Boolean.TRUE); newDefaultSet = true; } else { map.setDefaultGroupLink(Boolean.FALSE); }
public void setDefaultGroup(Experimenter user, ExperimenterGroup group) { if (user == null) return; if (group == null) return; if (group.getId() == null) { throw new ApiUsageException("Group argument to setDefaultGroup " + "must be managed (i.e. have an id)");
public void setDefaultGroup(Experimenter user, ExperimenterGroup group) { if (user == null) return; if (group == null) return; if (group.getId() == null) { throw new ApiUsageException("Group argument to setDefaultGroup " + "must be managed (i.e. have an id)"); } boolean newDefaultSet = false; Experimenter foundUser = getExperimenter(user.getId()); for (GroupExperimenterMap map : (List<GroupExperimenterMap>) foundUser.collectGroupExperimenterMap(null)) { if (map.parent().getId().equals(group.getId())) { map.setDefaultGroupLink(Boolean.TRUE); newDefaultSet = true; } else { map.setDefaultGroupLink(Boolean.FALSE); } } if ( ! newDefaultSet) { throw new ApiUsageException("Group "+group.getId()+" was not " + "found for user "+user.getId()); } iUpdate.flush(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
if ( ! newDefaultSet) { throw new ApiUsageException("Group "+group.getId()+" was not " + "found for user "+user.getId()); } iUpdate.flush(); }
boolean newDefaultSet = false; Experimenter foundUser = getExperimenter(user.getId()); for (GroupExperimenterMap map : (List<GroupExperimenterMap>) foundUser .collectGroupExperimenterMap(null)) { if (map.parent().getId().equals(group.getId())) { map.setDefaultGroupLink(Boolean.TRUE); newDefaultSet = true; } else { map.setDefaultGroupLink(Boolean.FALSE); } } if (!newDefaultSet) { throw new ApiUsageException("Group " + group.getId() + " was not " + "found for user " + user.getId()); } iUpdate.flush(); }
public void setDefaultGroup(Experimenter user, ExperimenterGroup group) { if (user == null) return; if (group == null) return; if (group.getId() == null) { throw new ApiUsageException("Group argument to setDefaultGroup " + "must be managed (i.e. have an id)"); } boolean newDefaultSet = false; Experimenter foundUser = getExperimenter(user.getId()); for (GroupExperimenterMap map : (List<GroupExperimenterMap>) foundUser.collectGroupExperimenterMap(null)) { if (map.parent().getId().equals(group.getId())) { map.setDefaultGroupLink(Boolean.TRUE); newDefaultSet = true; } else { map.setDefaultGroupLink(Boolean.FALSE); } } if ( ! newDefaultSet) { throw new ApiUsageException("Group "+group.getId()+" was not " + "found for user "+user.getId()); } iUpdate.flush(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
public final void setExtendedMetadata( ExtendedMetadata extMetadata ) { throwIfAlreadySet(this.em, extMetadata); em = extMetadata; }
public final void setExtendedMetadata(ExtendedMetadata extMetadata) { throwIfAlreadySet(this.em, extMetadata); em = extMetadata; }
public final void setExtendedMetadata( ExtendedMetadata extMetadata ) { throwIfAlreadySet(this.em, extMetadata); em = extMetadata; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
public final void setJdbcTemplate( SimpleJdbcTemplate jdbcTemplate ) { throwIfAlreadySet(this.jdbc, jdbcTemplate); jdbc = jdbcTemplate; }
public final void setJdbcTemplate(SimpleJdbcTemplate jdbcTemplate) { throwIfAlreadySet(this.jdbc, jdbcTemplate); jdbc = jdbcTemplate; }
public final void setJdbcTemplate( SimpleJdbcTemplate jdbcTemplate ) { throwIfAlreadySet(this.jdbc, jdbcTemplate); jdbc = jdbcTemplate; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
public final void setSessionFactory( SessionFactory sessionFactory ) { throwIfAlreadySet(this.sf, sessionFactory); sf = sessionFactory; }
public final void setSessionFactory(SessionFactory sessionFactory) { throwIfAlreadySet(this.sf, sessionFactory); sf = sessionFactory; }
public final void setSessionFactory( SessionFactory sessionFactory ) { throwIfAlreadySet(this.sf, sessionFactory); sf = sessionFactory; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
public void synchronizeLoginCache() { String string = "omero:service=LoginConfig"; MBeanServer mbeanServer = JmxUtils.locateMBeanServer(); getLogger().debug("Acquired MBeanServer."); ObjectName name; try { name = new ObjectName(string); mbeanServer.invoke( name, "flushAuthenticationCaches", new Object[]{}, new String[]{}); getLogger().debug("Flushed authentication caches."); } catch (InstanceNotFoundException infe) { getLogger().warn(string+" not found. Won't synchronize login cache."); } catch (Exception e) { InternalException ie = new InternalException(e.getMessage()); ie.setStackTrace(e.getStackTrace()); throw ie; } }
public void synchronizeLoginCache() { String string = "omero:service=LoginConfig"; MBeanServer mbeanServer = JmxUtils.locateMBeanServer(); getLogger().debug("Acquired MBeanServer."); ObjectName name; try { name = new ObjectName(string); mbeanServer.invoke(name, "flushAuthenticationCaches", new Object[] {}, new String[] {}); getLogger().debug("Flushed authentication caches."); } catch (InstanceNotFoundException infe) { getLogger().warn( string + " not found. Won't synchronize login cache."); } catch (Exception e) { InternalException ie = new InternalException(e.getMessage()); ie.setStackTrace(e.getStackTrace()); throw ie; } }
public void synchronizeLoginCache() { String string = "omero:service=LoginConfig"; // using Spring utilities to get MBeanServer MBeanServer mbeanServer = JmxUtils.locateMBeanServer(); getLogger().debug("Acquired MBeanServer."); ObjectName name; try { // defined in app/resources/jboss-service.xml name = new ObjectName(string); mbeanServer.invoke( name, "flushAuthenticationCaches", new Object[]{}, new String[]{}); getLogger().debug("Flushed authentication caches."); } catch (InstanceNotFoundException infe) { getLogger().warn(string+" not found. Won't synchronize login cache."); } catch (Exception e) { InternalException ie = new InternalException(e.getMessage()); ie.setStackTrace(e.getStackTrace()); throw ie; } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
public boolean[] unlock(final IObject...iObjects ) { if ( iObjects == null | iObjects.length < 1 ) return new boolean[]{}; Session s = SessionFactoryUtils.getNewSession( sf, EmptyInterceptor.INSTANCE ); Transaction tx = s.beginTransaction(); try { boolean[] isUnlocked = new boolean[iObjects.length]; for (int i = 0; i < iObjects.length; i++) {
public boolean[] unlock(final IObject... iObjects) { if (iObjects == null | iObjects.length < 1) return new boolean[] {}; Session s = SessionFactoryUtils.getNewSession(sf, EmptyInterceptor.INSTANCE); Transaction tx = s.beginTransaction(); try { boolean[] isUnlocked = new boolean[iObjects.length]; for (int i = 0; i < iObjects.length; i++) {
public boolean[] unlock(final IObject...iObjects ) { // do nothing if possible if ( iObjects == null | iObjects.length < 1 ) return new boolean[]{}; // create a new session. It's important that we pass in the empty // interceptor here, otherwise even root wouldn't be allowed to unlock // the instance. Session s = SessionFactoryUtils.getNewSession( sf, EmptyInterceptor.INSTANCE ); Transaction tx = s.beginTransaction(); try { boolean[] isUnlocked = new boolean[iObjects.length]; for (int i = 0; i < iObjects.length; i++) { IObject orig = iObjects[i]; // do nothing if possible again. if ( orig == null || orig.getId() == null ) { isUnlocked[i] = true; continue; } // get the original to operate on final IObject object = (IObject) s.load( orig.getClass(), orig.getId() ); // if it's not locked, we don't need to look further. if ( ! object.getDetails().getPermissions().isSet(Flag.LOCKED) ) { isUnlocked[i] = true; continue; } // since it's a managed entity it's class.getName() might contain // some byte-code generation string final Class<? extends IObject> klass = Utils.trueClass( object.getClass() ); final long id = object.getId().longValue(); // the values that could possibly link to this instance. String[][] checks = em.getLockChecks( klass ); // reporting long total = 0L; Map<String,Long> counts = new HashMap<String,Long>(); // run the individual queries for (String[] check : checks) { final String hql = String.format( "select count(*) from %s where %s%s = :id ", check[0],check[1],".id"); org.hibernate.Query q = s.createQuery(hql); q.setLong("id",id); Long count = (Long) q.iterate().next(); if ( count != null && count.longValue() > 0 ) { total += count.longValue(); counts.put( hql, count ); } } // reporting if ( getLogger().isDebugEnabled() ) { getLogger().debug( counts ); } // if there are no links, the we can unlock // the actual unlocking happens on flush below. if ( total == 0 ) { object.getDetails().getPermissions().unSet( Flag.LOCKED ); isUnlocked[i] = true; } else { isUnlocked[i] = false; } } return isUnlocked; } finally { s.flush(); tx.commit(); s.close(); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
if ( orig == null || orig.getId() == null ) { isUnlocked[i] = true; continue; } final IObject object = (IObject) s.load( orig.getClass(), orig.getId() ); if ( ! object.getDetails().getPermissions().isSet(Flag.LOCKED) ) { isUnlocked[i] = true; continue; } final Class<? extends IObject> klass = Utils.trueClass( object.getClass() ); final long id = object.getId().longValue(); String[][] checks = em.getLockChecks( klass ); long total = 0L; Map<String,Long> counts = new HashMap<String,Long>(); for (String[] check : checks) { final String hql = String.format( "select count(*) from %s where %s%s = :id ", check[0],check[1],".id"); org.hibernate.Query q = s.createQuery(hql); q.setLong("id",id); Long count = (Long) q.iterate().next(); if ( count != null && count.longValue() > 0 ) { total += count.longValue(); counts.put( hql, count ); }
if (orig == null || orig.getId() == null) { isUnlocked[i] = true; continue;
public boolean[] unlock(final IObject...iObjects ) { // do nothing if possible if ( iObjects == null | iObjects.length < 1 ) return new boolean[]{}; // create a new session. It's important that we pass in the empty // interceptor here, otherwise even root wouldn't be allowed to unlock // the instance. Session s = SessionFactoryUtils.getNewSession( sf, EmptyInterceptor.INSTANCE ); Transaction tx = s.beginTransaction(); try { boolean[] isUnlocked = new boolean[iObjects.length]; for (int i = 0; i < iObjects.length; i++) { IObject orig = iObjects[i]; // do nothing if possible again. if ( orig == null || orig.getId() == null ) { isUnlocked[i] = true; continue; } // get the original to operate on final IObject object = (IObject) s.load( orig.getClass(), orig.getId() ); // if it's not locked, we don't need to look further. if ( ! object.getDetails().getPermissions().isSet(Flag.LOCKED) ) { isUnlocked[i] = true; continue; } // since it's a managed entity it's class.getName() might contain // some byte-code generation string final Class<? extends IObject> klass = Utils.trueClass( object.getClass() ); final long id = object.getId().longValue(); // the values that could possibly link to this instance. String[][] checks = em.getLockChecks( klass ); // reporting long total = 0L; Map<String,Long> counts = new HashMap<String,Long>(); // run the individual queries for (String[] check : checks) { final String hql = String.format( "select count(*) from %s where %s%s = :id ", check[0],check[1],".id"); org.hibernate.Query q = s.createQuery(hql); q.setLong("id",id); Long count = (Long) q.iterate().next(); if ( count != null && count.longValue() > 0 ) { total += count.longValue(); counts.put( hql, count ); } } // reporting if ( getLogger().isDebugEnabled() ) { getLogger().debug( counts ); } // if there are no links, the we can unlock // the actual unlocking happens on flush below. if ( total == 0 ) { object.getDetails().getPermissions().unSet( Flag.LOCKED ); isUnlocked[i] = true; } else { isUnlocked[i] = false; } } return isUnlocked; } finally { s.flush(); tx.commit(); s.close(); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
if ( getLogger().isDebugEnabled() ) { getLogger().debug( counts ); } if ( total == 0 ) { object.getDetails().getPermissions().unSet( Flag.LOCKED ); isUnlocked[i] = true; } else { isUnlocked[i] = false; }
final IObject object = (IObject) s.load(orig.getClass(), orig .getId()); if (!object.getDetails().getPermissions().isSet(Flag.LOCKED)) { isUnlocked[i] = true; continue; } final Class<? extends IObject> klass = Utils.trueClass(object .getClass()); final long id = object.getId().longValue(); String[][] checks = em.getLockChecks(klass); long total = 0L; Map<String, Long> counts = new HashMap<String, Long>(); for (String[] check : checks) { final String hql = String.format( "select count(*) from %s where %s%s = :id ", check[0], check[1], ".id"); org.hibernate.Query q = s.createQuery(hql); q.setLong("id", id); Long count = (Long) q.iterate().next(); if (count != null && count.longValue() > 0) { total += count.longValue(); counts.put(hql, count); } } if (getLogger().isDebugEnabled()) { getLogger().debug(counts); } if (total == 0) { object.getDetails().getPermissions().unSet(Flag.LOCKED); isUnlocked[i] = true; } else { isUnlocked[i] = false; }
public boolean[] unlock(final IObject...iObjects ) { // do nothing if possible if ( iObjects == null | iObjects.length < 1 ) return new boolean[]{}; // create a new session. It's important that we pass in the empty // interceptor here, otherwise even root wouldn't be allowed to unlock // the instance. Session s = SessionFactoryUtils.getNewSession( sf, EmptyInterceptor.INSTANCE ); Transaction tx = s.beginTransaction(); try { boolean[] isUnlocked = new boolean[iObjects.length]; for (int i = 0; i < iObjects.length; i++) { IObject orig = iObjects[i]; // do nothing if possible again. if ( orig == null || orig.getId() == null ) { isUnlocked[i] = true; continue; } // get the original to operate on final IObject object = (IObject) s.load( orig.getClass(), orig.getId() ); // if it's not locked, we don't need to look further. if ( ! object.getDetails().getPermissions().isSet(Flag.LOCKED) ) { isUnlocked[i] = true; continue; } // since it's a managed entity it's class.getName() might contain // some byte-code generation string final Class<? extends IObject> klass = Utils.trueClass( object.getClass() ); final long id = object.getId().longValue(); // the values that could possibly link to this instance. String[][] checks = em.getLockChecks( klass ); // reporting long total = 0L; Map<String,Long> counts = new HashMap<String,Long>(); // run the individual queries for (String[] check : checks) { final String hql = String.format( "select count(*) from %s where %s%s = :id ", check[0],check[1],".id"); org.hibernate.Query q = s.createQuery(hql); q.setLong("id",id); Long count = (Long) q.iterate().next(); if ( count != null && count.longValue() > 0 ) { total += count.longValue(); counts.put( hql, count ); } } // reporting if ( getLogger().isDebugEnabled() ) { getLogger().debug( counts ); } // if there are no links, the we can unlock // the actual unlocking happens on flush below. if ( total == 0 ) { object.getDetails().getPermissions().unSet( Flag.LOCKED ); isUnlocked[i] = true; } else { isUnlocked[i] = false; } } return isUnlocked; } finally { s.flush(); tx.commit(); s.close(); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
return isUnlocked; } finally {
return isUnlocked; } finally {
public boolean[] unlock(final IObject...iObjects ) { // do nothing if possible if ( iObjects == null | iObjects.length < 1 ) return new boolean[]{}; // create a new session. It's important that we pass in the empty // interceptor here, otherwise even root wouldn't be allowed to unlock // the instance. Session s = SessionFactoryUtils.getNewSession( sf, EmptyInterceptor.INSTANCE ); Transaction tx = s.beginTransaction(); try { boolean[] isUnlocked = new boolean[iObjects.length]; for (int i = 0; i < iObjects.length; i++) { IObject orig = iObjects[i]; // do nothing if possible again. if ( orig == null || orig.getId() == null ) { isUnlocked[i] = true; continue; } // get the original to operate on final IObject object = (IObject) s.load( orig.getClass(), orig.getId() ); // if it's not locked, we don't need to look further. if ( ! object.getDetails().getPermissions().isSet(Flag.LOCKED) ) { isUnlocked[i] = true; continue; } // since it's a managed entity it's class.getName() might contain // some byte-code generation string final Class<? extends IObject> klass = Utils.trueClass( object.getClass() ); final long id = object.getId().longValue(); // the values that could possibly link to this instance. String[][] checks = em.getLockChecks( klass ); // reporting long total = 0L; Map<String,Long> counts = new HashMap<String,Long>(); // run the individual queries for (String[] check : checks) { final String hql = String.format( "select count(*) from %s where %s%s = :id ", check[0],check[1],".id"); org.hibernate.Query q = s.createQuery(hql); q.setLong("id",id); Long count = (Long) q.iterate().next(); if ( count != null && count.longValue() > 0 ) { total += count.longValue(); counts.put( hql, count ); } } // reporting if ( getLogger().isDebugEnabled() ) { getLogger().debug( counts ); } // if there are no links, the we can unlock // the actual unlocking happens on flush below. if ( total == 0 ) { object.getDetails().getPermissions().unSet( Flag.LOCKED ); isUnlocked[i] = true; } else { isUnlocked[i] = false; } } return isUnlocked; } finally { s.flush(); tx.commit(); s.close(); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
} }
} }
public boolean[] unlock(final IObject...iObjects ) { // do nothing if possible if ( iObjects == null | iObjects.length < 1 ) return new boolean[]{}; // create a new session. It's important that we pass in the empty // interceptor here, otherwise even root wouldn't be allowed to unlock // the instance. Session s = SessionFactoryUtils.getNewSession( sf, EmptyInterceptor.INSTANCE ); Transaction tx = s.beginTransaction(); try { boolean[] isUnlocked = new boolean[iObjects.length]; for (int i = 0; i < iObjects.length; i++) { IObject orig = iObjects[i]; // do nothing if possible again. if ( orig == null || orig.getId() == null ) { isUnlocked[i] = true; continue; } // get the original to operate on final IObject object = (IObject) s.load( orig.getClass(), orig.getId() ); // if it's not locked, we don't need to look further. if ( ! object.getDetails().getPermissions().isSet(Flag.LOCKED) ) { isUnlocked[i] = true; continue; } // since it's a managed entity it's class.getName() might contain // some byte-code generation string final Class<? extends IObject> klass = Utils.trueClass( object.getClass() ); final long id = object.getId().longValue(); // the values that could possibly link to this instance. String[][] checks = em.getLockChecks( klass ); // reporting long total = 0L; Map<String,Long> counts = new HashMap<String,Long>(); // run the individual queries for (String[] check : checks) { final String hql = String.format( "select count(*) from %s where %s%s = :id ", check[0],check[1],".id"); org.hibernate.Query q = s.createQuery(hql); q.setLong("id",id); Long count = (Long) q.iterate().next(); if ( count != null && count.longValue() > 0 ) { total += count.longValue(); counts.put( hql, count ); } } // reporting if ( getLogger().isDebugEnabled() ) { getLogger().debug( counts ); } // if there are no links, the we can unlock // the actual unlocking happens on flush below. if ( total == 0 ) { object.getDetails().getPermissions().unSet( Flag.LOCKED ); isUnlocked[i] = true; } else { isUnlocked[i] = false; } } return isUnlocked; } finally { s.flush(); tx.commit(); s.close(); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
public Experimenter userProxy(final Long id) { if ( id == null ) throw new ApiUsageException("Id argument cannot be null."); Experimenter e = iQuery.get(Experimenter.class, id); return e; }
public Experimenter userProxy(final Long id) { if (id == null) throw new ApiUsageException("Id argument cannot be null."); Experimenter e = iQuery.get(Experimenter.class, id); return e; }
public Experimenter userProxy(final Long id) { if ( id == null ) throw new ApiUsageException("Id argument cannot be null."); Experimenter e = iQuery.get(Experimenter.class, id); return e; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7e7c45d25ea1bbef3485ae116b3eb108d9f6f5ef/AdminImpl.java/clean/components/server/src/ome/logic/AdminImpl.java
final VCardPanel vcardPanel = new VCardPanel(getParticipantJID()); getToolBar().add(vcardPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
SwingWorker worker = new SwingWorker() { public Object construct() { return SparkManager.getVCardManager().getVCard(participantJID); } public void finished() { final VCard vcard = (VCard)get(); if (vcard == null) { return; } final VCardPanel vcardPanel = new VCardPanel(vcard, participantJID); getToolBar().add(vcardPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); scrollOnTimer(); } }; worker.start();
public ChatRoomImpl(final String participantJID, String participantNickname, String title) { this.participantJID = participantJID; this.participantNickname = participantNickname; AndFilter presenceFilter = new AndFilter(new PacketTypeFilter(Presence.class), new FromContainsFilter(this.participantJID)); // Register PacketListeners AndFilter messageFilter = new AndFilter(new PacketTypeFilter(Message.class), new FromContainsFilter(participantJID)); SparkManager.getConnection().addPacketListener(this, messageFilter); SparkManager.getConnection().addPacketListener(this, presenceFilter); // The roomname will be the participantJID this.roomname = participantJID; // Use the agents username as the Tab Title this.tabTitle = title; // The name of the room will be the node of the user jid + conversation. final SimpleDateFormat formatter = new SimpleDateFormat("h:mm a"); this.roomTitle = participantNickname + " - Started " + formatter.format(new Date()); // Add RoomInfo this.getSplitPane().setRightComponent(null); getSplitPane().setDividerSize(0); messageManager = new ChatRoomMessageManager(); SparkManager.getMessageEventManager().addMessageEventNotificationListener(messageManager); roster = SparkManager.getConnection().getRoster(); presence = roster.getPresence(participantJID); StatusItem statusItem = SparkManager.getWorkspace().getStatusBar().getItemFromPresence(presence); RosterEntry entry = roster.getEntry(participantJID); if (statusItem == null) { tabIcon = SparkRes.getImageIcon(SparkRes.CLEAR_BALL_ICON); } else { String status = presence.getStatus(); if (status != null && status.indexOf("phone") != -1) { tabIcon = SparkRes.getImageIcon(SparkRes.ON_PHONE_IMAGE); } else { tabIcon = statusItem.getIcon(); } } Icon icon = SparkManager.getChatManager().getPresenceIconForContactHandler(presence); if (icon != null) { tabIcon = icon; } PacketFilter filter = new AndFilter(new PacketTypeFilter(Presence.class), new FromContainsFilter(participantJID)); SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { presence = (Presence)packet; } }, filter); // Create toolbar buttons. ChatRoomButton infoButton = new ChatRoomButton("", SparkRes.getImageIcon(SparkRes.PROFILE_IMAGE_24x24)); infoButton.setToolTipText("View information about this user"); // Create basic toolbar. getToolBar().addChatRoomButton(infoButton); // If the user is not in the roster, then allow user to add them. if (entry == null && !StringUtils.parseResource(participantJID).equals(participantNickname)) { ChatRoomButton addToRosterButton = new ChatRoomButton("", SparkRes.getImageIcon(SparkRes.ADD_IMAGE_24x24)); addToRosterButton.setToolTipText("Add this user to your roster."); getToolBar().addChatRoomButton(addToRosterButton); addToRosterButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(participantJID); rosterDialog.setDefaultNickname(getParticipantNickname()); rosterDialog.showRosterDialog(SparkManager.getChatManager().getChatContainer().getChatFrame()); } }); } // Show VCard. infoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { VCardManager vcard = SparkManager.getVCardManager(); vcard.viewProfile(participantJID, SparkManager.getChatManager().getChatContainer()); } }); // If this is a private chat from a group chat room, do not show toolbar. if (StringUtils.parseResource(participantJID).equals(participantNickname)) { getToolBar().setVisible(false); } typingTimer = new Timer(2000, new ActionListener() { public void actionPerformed(ActionEvent e) { long now = System.currentTimeMillis(); if (now - lastTypedCharTime > 2000) { if (!sendNotification) { // send cancel SparkManager.getMessageEventManager().sendCancelledNotification(getParticipantJID(), threadID); sendNotification = true; } } } }); typingTimer.start(); // Add message event request listener messageEventRequestListener = new ChatMessageEventRequestListener(); SparkManager.getMessageEventManager().addMessageEventRequestListener(messageEventRequestListener); // Add VCard Panel final VCardPanel vcardPanel = new VCardPanel(getParticipantJID()); getToolBar().add(vcardPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/da1687b63c06d7dd9fe93840d507e6d48e13de11/ChatRoomImpl.java/clean/src/java/org/jivesoftware/spark/ui/rooms/ChatRoomImpl.java
return "tag:yaml.org,2002:null".equals(node.getTag()) || ("tag:yaml.org,2002:seq".equals(node.getTag()) && ((java.util.List)node.getValue()).isEmpty()) || ("tag:yaml.org,2002:map".equals(node.getTag()) && ((java.util.Map)node.getValue()).isEmpty());
return true;
protected boolean ignoreAnchor(Node node) { return "tag:yaml.org,2002:null".equals(node.getTag()) || ("tag:yaml.org,2002:seq".equals(node.getTag()) && ((java.util.List)node.getValue()).isEmpty()) || ("tag:yaml.org,2002:map".equals(node.getTag()) && ((java.util.Map)node.getValue()).isEmpty()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/20188965a791bc0b14113c10e67bdbfd4e6827c5/JRubySerializer.java/buggy/src/org/jruby/yaml/JRubySerializer.java
DatasetAnnotation da = annotator.createDatasetAnnotation(annotation);
DatasetAnnotation da = annotator.createDatasetAnnotation(annotation,datasetID);
public void newAnnotation(String annotation) { DatasetAnnotation da = annotator.createDatasetAnnotation(annotation); annotationList.add(da); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b8aa9d8c9035f1fe142d99b7f63b4b808d4a9fed/DatasetAnnotationCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/annotator/DatasetAnnotationCtrl.java
for (int i = 0; i < listeners.length; i++) view.tree.removeTreeExpansionListener(listeners[i]);
private void onClick(MouseEvent e) { int selRow = view.tree.getRowForLocation(e.getX(), e.getY()); if (selRow != -1) { view.tree.setSelectionRow(selRow); DataObject target = view.getCurrentOMEObject(); // remove tree expansion listener //otherwise a tree expansion event is fired when we //double-click for (int i = 0; i < listeners.length; i++) view.tree.removeTreeExpansionListener(listeners[i]); if (target != null) { if (e.isPopupTrigger()) { DataManagerUIF presentation = agentCtrl.getAbstraction().getPresentation(); TreePopupMenu popup = presentation.getPopupMenu(); popup.setTarget(target); popup.show(view.tree, e.getX(), e.getY()); } else { if (e.getClickCount() == 2) { agentCtrl.showProperties(target); for (int i = 0; i < listeners.length; i++) view.tree.addTreeExpansionListener(listeners[i]); } } }// else { //Test click on the root node. //if (e.isPopupTrigger()) rebuildTree(); //} } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6ec05530173229b43c3f21f0021b71fd776dd63c/ExplorerPaneManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/ExplorerPaneManager.java
for (int i = 0; i < listeners.length; i++) view.tree.addTreeExpansionListener(listeners[i]);
private void onClick(MouseEvent e) { int selRow = view.tree.getRowForLocation(e.getX(), e.getY()); if (selRow != -1) { view.tree.setSelectionRow(selRow); DataObject target = view.getCurrentOMEObject(); // remove tree expansion listener //otherwise a tree expansion event is fired when we //double-click for (int i = 0; i < listeners.length; i++) view.tree.removeTreeExpansionListener(listeners[i]); if (target != null) { if (e.isPopupTrigger()) { DataManagerUIF presentation = agentCtrl.getAbstraction().getPresentation(); TreePopupMenu popup = presentation.getPopupMenu(); popup.setTarget(target); popup.show(view.tree, e.getX(), e.getY()); } else { if (e.getClickCount() == 2) { agentCtrl.showProperties(target); for (int i = 0; i < listeners.length; i++) view.tree.addTreeExpansionListener(listeners[i]); } } }// else { //Test click on the root node. //if (e.isPopupTrigger()) rebuildTree(); //} } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6ec05530173229b43c3f21f0021b71fd776dd63c/ExplorerPaneManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/ExplorerPaneManager.java
flatCollections);
flatCollections, superClasses, interfaces);
private ElementMapping loadElement(JavaClass javaClass) { DocletTag xbeanTag = javaClass.getTagByName(XBEAN_ANNOTATION); if (xbeanTag == null) { return null; } String element = getElementName(javaClass, xbeanTag); String description = getProperty(xbeanTag, "description"); if (description == null) { description = javaClass.getComment(); } String namespace = getProperty(xbeanTag, "namespace", defaultNamespace); boolean root = getBooleanProperty(xbeanTag, "rootElement"); String contentProperty = getProperty(xbeanTag, "contentProperty"); Map mapsByPropertyName = new HashMap(); List flatProperties = new ArrayList(); Map flatCollections = new HashMap(); Set attributes = new HashSet(); Map attributesByPropertyName = new HashMap(); for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { BeanProperty[] beanProperties = jClass.getBeanProperties(); for (int i = 0; i < beanProperties.length; i++) { BeanProperty beanProperty = beanProperties[i]; // we only care about properties with a setter if (beanProperty.getMutator() != null) { AttributeMapping attributeMapping = loadAttribute(beanProperty, ""); if (attributeMapping != null) { attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } JavaMethod acc = beanProperty.getAccessor(); if (acc != null) { DocletTag mapTag = acc.getTagByName(MAP_ANNOTATION); if (mapTag != null) { MapMapping mm = new MapMapping(mapTag.getNamedParameter("entryName"), mapTag.getNamedParameter("keyName")); mapsByPropertyName.put(beanProperty.getName(), mm); } DocletTag flatColTag = acc.getTagByName(FLAT_COLLECTION_ANNOTATION); if (flatColTag != null) { String childName = flatColTag.getNamedParameter("childElement"); if (childName == null) throw new InvalidModelException("Flat collections must specify the childElement attribute."); flatCollections.put(beanProperty.getName(), childName); } DocletTag flatPropTag = acc.getTagByName(FLAT_PROPERTY_ANNOTATION); if (flatPropTag != null) { flatProperties.add(beanProperty.getName()); } } } } } String initMethod = null; String destroyMethod = null; String factoryMethod = null; for (JavaClass jClass = javaClass; jClass != null; jClass = jClass.getSuperJavaClass()) { JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; if (method.isPublic() && !method.isConstructor()) { if (initMethod == null && method.getTagByName(INIT_METHOD_ANNOTATION) != null) { initMethod = method.getName(); } if (destroyMethod == null && method.getTagByName(DESTROY_METHOD_ANNOTATION) != null) { destroyMethod = method.getName(); } if (factoryMethod == null && method.getTagByName(FACTORY_METHOD_ANNOTATION) != null) { factoryMethod = method.getName(); } } } } List constructorArgs = new ArrayList(); JavaMethod[] methods = javaClass.getMethods(); for (int i = 0; i < methods.length; i++) { JavaMethod method = methods[i]; JavaParameter[] parameters = method.getParameters(); if (isValidConstructor(factoryMethod, method, parameters)) { List args = new ArrayList(parameters.length); for (int j = 0; j < parameters.length; j++) { JavaParameter parameter = parameters[j]; AttributeMapping attributeMapping = (AttributeMapping) attributesByPropertyName.get(parameter.getName()); if (attributeMapping == null) { attributeMapping = loadParameter(parameter); attributes.add(attributeMapping); attributesByPropertyName.put(attributeMapping.getPropertyName(), attributeMapping); } args.add(new ParameterMapping(attributeMapping.getPropertyName(), toMappingType(parameter.getType(), null))); } constructorArgs.add(Collections.unmodifiableList(args)); } } return new ElementMapping(namespace, element, javaClass.getFullyQualifiedName(), description, root, initMethod, destroyMethod, factoryMethod, contentProperty, attributes, constructorArgs, flatProperties, mapsByPropertyName, flatCollections); }
52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/82f8c1592f773a8e10d7a95ab3c2405dc29d8a3e/QdoxMappingLoader.java/clean/xbean-spring-common/src/main/java/org/apache/xbean/spring/generator/QdoxMappingLoader.java
Color gradientStart = new Color(0.5f, 0.5f, 0.5f, 0.8f); Color gradientEnd = new Color(0.3f, 0.3f, 0.3f, 0.9f);
Color gradientStart = new Color(0.5f, 0.5f, 0.5f, 1.0f); Color gradientEnd = new Color(0.3f, 0.3f, 0.3f, 1.0f);
private void drawGreyMask(Graphics2D g) { GradientPaint gp; // Set a gradient mask of V=.5 to V = 0.3; this has an alpha // value to show the colours of the button underlying the mask. Color gradientStart = new Color(0.5f, 0.5f, 0.5f, 0.8f); Color gradientEnd = new Color(0.3f, 0.3f, 0.3f, 0.9f); // Draw the gradient mask. gp = new GradientPaint((int) buttonRect.getX(), (int) buttonRect.getY(), gradientStart, (int) buttonRect.getWidth(), (int) buttonRect.getHeight(), gradientEnd, false); g.setPaint(gp); g.fill(buttonRect); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3878a115ce22ca0c57db2b2488dd61685384ba45/ColouredButtonUI.java/buggy/SRC/org/openmicroscopy/shoola/util/ui/ColouredButtonUI.java
topGradientValue, 0.6f);
topGradientValue, 1.0f);
private void setGradientColours() { HSV col = new HSV(colour); // top gradient value from HSV model. float topGradientValue = col.getValue(); // bottom gradient value from HSV model. float bottomGradientValue = col.getValue(); // top and bottom gradient saturation from HSV model. float topGradientSaturation, bottomGradientSaturation; // if colour greyscale(achromatic) don't touch saturation if (col.getSaturation() == 0) { topGradientSaturation = bottomGradientSaturation = col.getSaturation(); // A check to see what gives greatest increase, +0.3 or *1.3 // and set topGradientValue to that. topGradientValue = col.getValue()+0.3f; if (col.getValue()*1.3f > topGradientValue) topGradientValue = col.getValue()*1.3f; if (topGradientValue>1) topGradientValue = 1; // Set bottomGradientValue to 75% of colour value. bottomGradientValue = col.getValue()*0.75f; } else { // We're in a colour space. // Increase topGradientValue to 1.5 * value of colour face. topGradientValue = col.getValue()*1.5f; if (topGradientValue>1) topGradientValue = 1; topGradientSaturation = col.getSaturation()*0.6f; bottomGradientSaturation = col.getSaturation(); } gradientStartHSV = new HSV(col.getHue(), topGradientSaturation, topGradientValue, 0.6f); gradientStartRGB = gradientStartHSV.toColorA(); gradientEndHSV = new HSV(col.getHue(), bottomGradientSaturation, bottomGradientValue, 0.6f); gradientEndRGB = gradientEndHSV.toColorA(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3878a115ce22ca0c57db2b2488dd61685384ba45/ColouredButtonUI.java/buggy/SRC/org/openmicroscopy/shoola/util/ui/ColouredButtonUI.java
bottomGradientSaturation, bottomGradientValue, 0.6f);
bottomGradientSaturation, bottomGradientValue, 1.0f);
private void setGradientColours() { HSV col = new HSV(colour); // top gradient value from HSV model. float topGradientValue = col.getValue(); // bottom gradient value from HSV model. float bottomGradientValue = col.getValue(); // top and bottom gradient saturation from HSV model. float topGradientSaturation, bottomGradientSaturation; // if colour greyscale(achromatic) don't touch saturation if (col.getSaturation() == 0) { topGradientSaturation = bottomGradientSaturation = col.getSaturation(); // A check to see what gives greatest increase, +0.3 or *1.3 // and set topGradientValue to that. topGradientValue = col.getValue()+0.3f; if (col.getValue()*1.3f > topGradientValue) topGradientValue = col.getValue()*1.3f; if (topGradientValue>1) topGradientValue = 1; // Set bottomGradientValue to 75% of colour value. bottomGradientValue = col.getValue()*0.75f; } else { // We're in a colour space. // Increase topGradientValue to 1.5 * value of colour face. topGradientValue = col.getValue()*1.5f; if (topGradientValue>1) topGradientValue = 1; topGradientSaturation = col.getSaturation()*0.6f; bottomGradientSaturation = col.getSaturation(); } gradientStartHSV = new HSV(col.getHue(), topGradientSaturation, topGradientValue, 0.6f); gradientStartRGB = gradientStartHSV.toColorA(); gradientEndHSV = new HSV(col.getHue(), bottomGradientSaturation, bottomGradientValue, 0.6f); gradientEndRGB = gradientEndHSV.toColorA(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3878a115ce22ca0c57db2b2488dd61685384ba45/ColouredButtonUI.java/buggy/SRC/org/openmicroscopy/shoola/util/ui/ColouredButtonUI.java
byte[] trigger; IRubyObject dollar_backslash = getRuntime().getGlobalVariables().get("$\\"); if (dollar_backslash instanceof RubyString) { trigger = ((RubyString) dollar_backslash).toByteArray(); } else { trigger = RubyString.stringToBytes("\n"); } loop:
public int write(String string) throws IOException, BadDescriptorException { checkWritable(); ByteBuffer buffer = ByteBuffer.wrap(RubyString.stringToBytes(string)); byte[] trigger; IRubyObject dollar_backslash = getRuntime().getGlobalVariables().get("$\\"); if (dollar_backslash instanceof RubyString) { trigger = ((RubyString) dollar_backslash).toByteArray(); } else { trigger = RubyString.stringToBytes("\n"); } loop: while (buffer.hasRemaining()) { /* append data */ while (buffer.hasRemaining() && outBuffer.hasRemaining()) { outBuffer.put(buffer.get()); } int idx; outBuffer.flip(); if (!outBuffer.hasRemaining() || isSync()) { flushOutBuffer(); } else if ((idx = buffer_rindex(outBuffer, trigger)) >= 0) { int oldLimit = outBuffer.limit(); outBuffer.limit(idx + trigger.length); flushOutBuffer(); outBuffer.position(idx + trigger.length); outBuffer.limit(oldLimit); int i; for (i = 0; outBuffer.hasRemaining(); i++) { outBuffer.put(i, outBuffer.get()); } outBuffer.position(i); outBuffer.limit(outBuffer.capacity()); } else { // unflip outBuffer.position(outBuffer.limit()); outBuffer.limit(outBuffer.capacity()); } } return buffer.capacity(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4a6b21deaf3a8472be6c0e7f4663f1a582ba5b85/IOHandlerNio.java/buggy/src/org/jruby/util/IOHandlerNio.java
int idx;
public int write(String string) throws IOException, BadDescriptorException { checkWritable(); ByteBuffer buffer = ByteBuffer.wrap(RubyString.stringToBytes(string)); byte[] trigger; IRubyObject dollar_backslash = getRuntime().getGlobalVariables().get("$\\"); if (dollar_backslash instanceof RubyString) { trigger = ((RubyString) dollar_backslash).toByteArray(); } else { trigger = RubyString.stringToBytes("\n"); } loop: while (buffer.hasRemaining()) { /* append data */ while (buffer.hasRemaining() && outBuffer.hasRemaining()) { outBuffer.put(buffer.get()); } int idx; outBuffer.flip(); if (!outBuffer.hasRemaining() || isSync()) { flushOutBuffer(); } else if ((idx = buffer_rindex(outBuffer, trigger)) >= 0) { int oldLimit = outBuffer.limit(); outBuffer.limit(idx + trigger.length); flushOutBuffer(); outBuffer.position(idx + trigger.length); outBuffer.limit(oldLimit); int i; for (i = 0; outBuffer.hasRemaining(); i++) { outBuffer.put(i, outBuffer.get()); } outBuffer.position(i); outBuffer.limit(outBuffer.capacity()); } else { // unflip outBuffer.position(outBuffer.limit()); outBuffer.limit(outBuffer.capacity()); } } return buffer.capacity(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4a6b21deaf3a8472be6c0e7f4663f1a582ba5b85/IOHandlerNio.java/buggy/src/org/jruby/util/IOHandlerNio.java
if (!outBuffer.hasRemaining() || isSync()) {
if ((buffer.hasRemaining() && !outBuffer.hasRemaining()) || isSync()) {
public int write(String string) throws IOException, BadDescriptorException { checkWritable(); ByteBuffer buffer = ByteBuffer.wrap(RubyString.stringToBytes(string)); byte[] trigger; IRubyObject dollar_backslash = getRuntime().getGlobalVariables().get("$\\"); if (dollar_backslash instanceof RubyString) { trigger = ((RubyString) dollar_backslash).toByteArray(); } else { trigger = RubyString.stringToBytes("\n"); } loop: while (buffer.hasRemaining()) { /* append data */ while (buffer.hasRemaining() && outBuffer.hasRemaining()) { outBuffer.put(buffer.get()); } int idx; outBuffer.flip(); if (!outBuffer.hasRemaining() || isSync()) { flushOutBuffer(); } else if ((idx = buffer_rindex(outBuffer, trigger)) >= 0) { int oldLimit = outBuffer.limit(); outBuffer.limit(idx + trigger.length); flushOutBuffer(); outBuffer.position(idx + trigger.length); outBuffer.limit(oldLimit); int i; for (i = 0; outBuffer.hasRemaining(); i++) { outBuffer.put(i, outBuffer.get()); } outBuffer.position(i); outBuffer.limit(outBuffer.capacity()); } else { // unflip outBuffer.position(outBuffer.limit()); outBuffer.limit(outBuffer.capacity()); } } return buffer.capacity(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4a6b21deaf3a8472be6c0e7f4663f1a582ba5b85/IOHandlerNio.java/buggy/src/org/jruby/util/IOHandlerNio.java
} else if ((idx = buffer_rindex(outBuffer, trigger)) >= 0) { int oldLimit = outBuffer.limit(); outBuffer.limit(idx + trigger.length); flushOutBuffer(); outBuffer.position(idx + trigger.length); outBuffer.limit(oldLimit); int i; for (i = 0; outBuffer.hasRemaining(); i++) { outBuffer.put(i, outBuffer.get()); } outBuffer.position(i); outBuffer.limit(outBuffer.capacity()); } else { outBuffer.position(outBuffer.limit()); outBuffer.limit(outBuffer.capacity());
public int write(String string) throws IOException, BadDescriptorException { checkWritable(); ByteBuffer buffer = ByteBuffer.wrap(RubyString.stringToBytes(string)); byte[] trigger; IRubyObject dollar_backslash = getRuntime().getGlobalVariables().get("$\\"); if (dollar_backslash instanceof RubyString) { trigger = ((RubyString) dollar_backslash).toByteArray(); } else { trigger = RubyString.stringToBytes("\n"); } loop: while (buffer.hasRemaining()) { /* append data */ while (buffer.hasRemaining() && outBuffer.hasRemaining()) { outBuffer.put(buffer.get()); } int idx; outBuffer.flip(); if (!outBuffer.hasRemaining() || isSync()) { flushOutBuffer(); } else if ((idx = buffer_rindex(outBuffer, trigger)) >= 0) { int oldLimit = outBuffer.limit(); outBuffer.limit(idx + trigger.length); flushOutBuffer(); outBuffer.position(idx + trigger.length); outBuffer.limit(oldLimit); int i; for (i = 0; outBuffer.hasRemaining(); i++) { outBuffer.put(i, outBuffer.get()); } outBuffer.position(i); outBuffer.limit(outBuffer.capacity()); } else { // unflip outBuffer.position(outBuffer.limit()); outBuffer.limit(outBuffer.capacity()); } } return buffer.capacity(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4a6b21deaf3a8472be6c0e7f4663f1a582ba5b85/IOHandlerNio.java/buggy/src/org/jruby/util/IOHandlerNio.java
} if(!isSync()) { flushOutBuffer();
public int write(String string) throws IOException, BadDescriptorException { checkWritable(); ByteBuffer buffer = ByteBuffer.wrap(RubyString.stringToBytes(string)); byte[] trigger; IRubyObject dollar_backslash = getRuntime().getGlobalVariables().get("$\\"); if (dollar_backslash instanceof RubyString) { trigger = ((RubyString) dollar_backslash).toByteArray(); } else { trigger = RubyString.stringToBytes("\n"); } loop: while (buffer.hasRemaining()) { /* append data */ while (buffer.hasRemaining() && outBuffer.hasRemaining()) { outBuffer.put(buffer.get()); } int idx; outBuffer.flip(); if (!outBuffer.hasRemaining() || isSync()) { flushOutBuffer(); } else if ((idx = buffer_rindex(outBuffer, trigger)) >= 0) { int oldLimit = outBuffer.limit(); outBuffer.limit(idx + trigger.length); flushOutBuffer(); outBuffer.position(idx + trigger.length); outBuffer.limit(oldLimit); int i; for (i = 0; outBuffer.hasRemaining(); i++) { outBuffer.put(i, outBuffer.get()); } outBuffer.position(i); outBuffer.limit(outBuffer.capacity()); } else { // unflip outBuffer.position(outBuffer.limit()); outBuffer.limit(outBuffer.capacity()); } } return buffer.capacity(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4a6b21deaf3a8472be6c0e7f4663f1a582ba5b85/IOHandlerNio.java/buggy/src/org/jruby/util/IOHandlerNio.java
ps.setString(1, getTableName()); ps.setString(2, getIDColumnName()); ps.setInt(3, id);
void delete() throws Exception { DBManager dbm = DBManager.getInstance(); PreparedStatement ps = dbm.getPreparedStatement(DELETE_STM); ps.setString(1, getTableName()); ps.setString(2, getIDColumnName()); ps.setInt(3, id); ps.execute(); ps.close(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/573df7087912a67672c1e083613af66bdbf3486e/DBRow.java/clean/TEST/omeds/DBRow.java
assertStringTemplateEquals (tmpl, "pass");
assertStringTemplateEquals (tmpl, "pass\n");
public void testBeginEnd () throws Exception { String tmpl = "#if (true) #begin pass #end #else #begin fail #end"; assertStringTemplateEquals (tmpl, "pass"); tmpl = "#if (true)\n #begin pass\n #end\n #else\n #begin fail\n #end"; assertStringTemplateEquals (tmpl, "pass"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/f5ebf1fa86f338484c8f14f11ac1fbcc329367a3/TestBlocks.java/clean/webmacro/test/unit/org/webmacro/template/TestBlocks.java
return recv.getRuntime().getCurrentContext().yield(tag);
context.pushCatch(tag.asSymbol()); return context.yield(tag);
public static IRubyObject rbCatch(IRubyObject recv, IRubyObject tag) { try { return recv.getRuntime().getCurrentContext().yield(tag); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.ThrowJump) { if (je.getPrimaryData().equals(tag.asSymbol())) { return (IRubyObject)je.getSecondaryData(); } } throw je; } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/43527512ed5edac73606a65971bfe9f8a7c23c7b/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java
} finally { context.popCatch();
public static IRubyObject rbCatch(IRubyObject recv, IRubyObject tag) { try { return recv.getRuntime().getCurrentContext().yield(tag); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.ThrowJump) { if (je.getPrimaryData().equals(tag.asSymbol())) { return (IRubyObject)je.getSecondaryData(); } } throw je; } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/43527512ed5edac73606a65971bfe9f8a7c23c7b/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java
JumpException je = new JumpException(JumpException.JumpType.ThrowJump);
public static IRubyObject rbThrow(IRubyObject recv, IRubyObject[] args) { IRuby runtime = recv.getRuntime(); JumpException je = new JumpException(JumpException.JumpType.ThrowJump); String tag = args[0].asSymbol(); IRubyObject value = args.length > 1 ? args[1] : recv.getRuntime().getNil(); RubyException nameException = new RubyException(runtime, runtime.getClass("NameError"), "uncaught throw '" + tag + '\''); je.setPrimaryData(tag); je.setSecondaryData(value); je.setTertiaryData(nameException); throw je; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/43527512ed5edac73606a65971bfe9f8a7c23c7b/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java
IRubyObject value = args.length > 1 ? args[1] : recv.getRuntime().getNil(); RubyException nameException = new RubyException(runtime, runtime.getClass("NameError"), "uncaught throw '" + tag + '\''); je.setPrimaryData(tag); je.setSecondaryData(value); je.setTertiaryData(nameException); throw je;
String[] catches = runtime.getCurrentContext().getActiveCatches(); String message = "uncaught throw '" + tag + '\''; for (int i = catches.length - 1 ; i >= 0 ; i--) { if (tag.equals(catches[i])) { JumpException je = new JumpException(JumpException.JumpType.ThrowJump); je.setPrimaryData(tag); je.setSecondaryData(args.length > 1 ? args[1] : runtime.getNil()); throw je; } } throw runtime.newNameError(message);
public static IRubyObject rbThrow(IRubyObject recv, IRubyObject[] args) { IRuby runtime = recv.getRuntime(); JumpException je = new JumpException(JumpException.JumpType.ThrowJump); String tag = args[0].asSymbol(); IRubyObject value = args.length > 1 ? args[1] : recv.getRuntime().getNil(); RubyException nameException = new RubyException(runtime, runtime.getClass("NameError"), "uncaught throw '" + tag + '\''); je.setPrimaryData(tag); je.setSecondaryData(value); je.setTertiaryData(nameException); throw je; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/43527512ed5edac73606a65971bfe9f8a7c23c7b/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java
public Dataset(Integer datasetId, boolean locked, String name, String description, org.openmicroscopy.omero.model.Group group, org.openmicroscopy.omero.model.Experimenter experimenter, Set moduleExecutions, Set datasetAnnotations, Set images, Set projects) { this.datasetId = datasetId; this.locked = locked; this.name = name; this.description = description; this.group = group; this.experimenter = experimenter; this.moduleExecutions = moduleExecutions; this.datasetAnnotations = datasetAnnotations; this.images = images; this.projects = projects;
public Dataset() {
public Dataset(Integer datasetId, boolean locked, String name, String description, org.openmicroscopy.omero.model.Group group, org.openmicroscopy.omero.model.Experimenter experimenter, Set moduleExecutions, Set datasetAnnotations, Set images, Set projects) { this.datasetId = datasetId; this.locked = locked; this.name = name; this.description = description; this.group = group; this.experimenter = experimenter; this.moduleExecutions = moduleExecutions; this.datasetAnnotations = datasetAnnotations; this.images = images; this.projects = projects; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Dataset.java/buggy/components/common/src/org/openmicroscopy/omero/model/Dataset.java
public org.openmicroscopy.omero.model.Experimenter getExperimenter() {
public Experimenter getExperimenter() {
public org.openmicroscopy.omero.model.Experimenter getExperimenter() { return this.experimenter; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Dataset.java/buggy/components/common/src/org/openmicroscopy/omero/model/Dataset.java
public org.openmicroscopy.omero.model.Group getGroup() {
public Group getGroup() {
public org.openmicroscopy.omero.model.Group getGroup() { return this.group; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Dataset.java/buggy/components/common/src/org/openmicroscopy/omero/model/Dataset.java
public void setExperimenter(org.openmicroscopy.omero.model.Experimenter experimenter) {
public void setExperimenter(Experimenter experimenter) {
public void setExperimenter(org.openmicroscopy.omero.model.Experimenter experimenter) { this.experimenter = experimenter; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Dataset.java/buggy/components/common/src/org/openmicroscopy/omero/model/Dataset.java
public void setGroup(org.openmicroscopy.omero.model.Group group) {
public void setGroup(Group group) {
public void setGroup(org.openmicroscopy.omero.model.Group group) { this.group = group; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Dataset.java/buggy/components/common/src/org/openmicroscopy/omero/model/Dataset.java
public void setLocked(boolean locked) {
public void setLocked(Boolean locked) {
public void setLocked(boolean locked) { this.locked = locked; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Dataset.java/buggy/components/common/src/org/openmicroscopy/omero/model/Dataset.java
throw new RubyArgumentException(ruby, "wrong # of arguments(" + args.size() + " for " + i + ")");
int size = 0; if(args != null) size = args.size(); throw new RubyArgumentException(ruby, "wrong # of arguments(" + size + " for " + i + ")");
public RubyObject call(Ruby ruby, RubyObject recv, RubyId id, RubyPointer args, boolean noSuper) { CRefNode savedCref = null; // +++ = null; // RubyPointer argsList = new RubyPointer(args); RubyPointer localVarsList = null; ruby.getRubyScope().push(); if (getRefValue() != null) { savedCref = ruby.getCRef(); // s.a. ruby.setCRef(getRefValue()); ruby.getRubyFrame().setCbase(getRefValue()); } if (getTable() != null) { localVarsList = new RubyPointer(ruby.getNil(), getTable().getId(0).intValue() + 1); localVarsList.set(0, this); localVarsList.inc(); ruby.getRubyScope().setLocalVars(localVarsList); ruby.getRubyScope().setLocalTbl(getTable()); } else { localVarsList = ruby.getRubyScope().getLocalVars(); ruby.getRubyScope().setLocalVars(null); ruby.getRubyScope().setLocalTbl(null); } Node callBody = getNextNode(); Node callNode = null; if (callBody.getType() == Constants.NODE_ARGS) { callNode = callBody; callBody = null; } else if (callBody.getType() == Constants.NODE_BLOCK) { callNode = callBody.getHeadNode(); callBody = callBody.getNextNode(); } RubyVarmap.push(ruby); // PUSH_TAG(PROT_FUNC); RubyObject result = ruby.getNil(); try { if (callNode != null) { //if (call_node.getType() != Constants.NODE_ARGS) { // rb_bug("no argument-node"); //} int i = callNode.getCount(); if (i > (args != null ? args.size() : 0)) { throw new RubyArgumentException(ruby, "wrong # of arguments(" + args.size() + " for " + i + ")"); } if (callNode.getRest() == -1) { int opt = i; Node optNode = callNode.getOptNode(); while (optNode != null) { opt++; optNode = optNode.getNextNode(); } if (opt < (args != null ? args.size() : 0)) { throw new RubyArgumentException(ruby, "wrong # of arguments(" + args.size() + " for " + opt + ")"); } ruby.getRubyFrame().setArgs(localVarsList != null ? localVarsList.getPointer(2) : null); } if (localVarsList != null) { if (i > 0) { localVarsList.inc(2); for (int j = 0; j < i; j++ ) { localVarsList.set(j, args.get(j)); } localVarsList.dec(2); } args.inc(i); if (callNode.getOptNode() != null) { Node optNode = callNode.getOptNode(); while (optNode != null && args.size() != 0) { ((AssignableNode)optNode.getHeadNode()).assign(ruby, recv, args.getRuby(0), true); args.inc(1); optNode = optNode.getNextNode(); } recv.eval(optNode); } if (callNode.getRest() >= 0) { RubyArray array = null; if (args.size() > 0) { array = RubyArray.m_newArray(ruby, args); } else { array = RubyArray.m_newArray(ruby, 0); } localVarsList.set(callNode.getRest(), array); } } } result = recv.eval(callBody); } catch (ReturnException rExcptn) { } RubyVarmap.pop(ruby); ruby.getRubyScope().pop(); if (savedCref != null) { ruby.setCRef(savedCref); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d378b4018285512fd061f4972e55ab6ff3577de0/ScopeNode.java/buggy/org/jruby/nodes/ScopeNode.java
{ model.addChangeListener(this); view.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); }
{ model.addChangeListener(this); view.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); }
private void attachListeners() { model.addChangeListener(this); view.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorControl.java/clean/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorControl.java
{ actionsMap.put(CANCEL, new CloseAction(model)); actionsMap.put(FINISH, new FinishAction(model)); }
{ actionsMap.put(CANCEL, new CloseAction(model)); actionsMap.put(FINISH, new FinishAction(model)); }
private void createActions() { actionsMap.put(CANCEL, new CloseAction(model)); actionsMap.put(FINISH, new FinishAction(model)); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorControl.java/clean/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorControl.java
FileOutputStream stream = new FileOutputStream(path);
FileInputStream stream = new FileInputStream(path);
private FileChannel getFileChannel(Boolean readOnly) throws FileNotFoundException { if (readOnly == true) { if (roChannel == null) { FileOutputStream stream = new FileOutputStream(path); roChannel = stream.getChannel(); return roChannel; } else return roChannel; } if (woChannel != null) return woChannel; FileInputStream stream = new FileInputStream(path); woChannel = stream.getChannel(); return woChannel; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/68fcf3cc1b9292144736bb3f929fd5962e8aa2b0/PixelBuffer.java/buggy/components/omeio-nio/src/ome/io/nio/PixelBuffer.java
FileInputStream stream = new FileInputStream(path);
FileOutputStream stream = new FileOutputStream(path);
private FileChannel getFileChannel(Boolean readOnly) throws FileNotFoundException { if (readOnly == true) { if (roChannel == null) { FileOutputStream stream = new FileOutputStream(path); roChannel = stream.getChannel(); return roChannel; } else return roChannel; } if (woChannel != null) return woChannel; FileInputStream stream = new FileInputStream(path); woChannel = stream.getChannel(); return woChannel; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/68fcf3cc1b9292144736bb3f929fd5962e8aa2b0/PixelBuffer.java/buggy/components/omeio-nio/src/ome/io/nio/PixelBuffer.java
return getRegion(size, offset);
byte[] nullPlane = PixelsService.nullPlane; for (int i = 0; i < PixelsService.NULL_PLANE_SIZE; i++) if (region.get(i) != nullPlane[i]) return region; return null;
public MappedByteBuffer getPlane(Integer z, Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException { Long offset = getPlaneOffset(z, c, t); Integer size = getPlaneSize(); return getRegion(size, offset); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/68fcf3cc1b9292144736bb3f929fd5962e8aa2b0/PixelBuffer.java/buggy/components/omeio-nio/src/ome/io/nio/PixelBuffer.java
return fileChannel.map(MapMode.READ_ONLY, size, offset);
return fileChannel.map(MapMode.READ_ONLY, offset, size);
public MappedByteBuffer getRegion(Integer size, Long offset) throws IOException { FileChannel fileChannel = getFileChannel(true); /* fileChannel should not be "null" as it will throw an exception if * there happens to be an error. */ return fileChannel.map(MapMode.READ_ONLY, size, offset); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/68fcf3cc1b9292144736bb3f929fd5962e8aa2b0/PixelBuffer.java/buggy/components/omeio-nio/src/ome/io/nio/PixelBuffer.java
MappedByteBuffer region = getRegion(size, offset); byte[] nullPlane = PixelsService.nullPlane;
public MappedByteBuffer getStack(Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException { Long offset = getStackOffset(c, t); Integer size = getStackSize(); MappedByteBuffer region = getRegion(size, offset); byte[] nullPlane = PixelsService.nullPlane; for (int i = 0; i < PixelsService.NULL_PLANE_SIZE; i++) if (region.get(i) != nullPlane[i]) return region; return null; // All of the nullPlane bytes match, non-filled plane }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/68fcf3cc1b9292144736bb3f929fd5962e8aa2b0/PixelBuffer.java/buggy/components/omeio-nio/src/ome/io/nio/PixelBuffer.java
for (int i = 0; i < PixelsService.NULL_PLANE_SIZE; i++) if (region.get(i) != nullPlane[i]) return region; return null;
return getRegion(size, offset);
public MappedByteBuffer getStack(Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException { Long offset = getStackOffset(c, t); Integer size = getStackSize(); MappedByteBuffer region = getRegion(size, offset); byte[] nullPlane = PixelsService.nullPlane; for (int i = 0; i < PixelsService.NULL_PLANE_SIZE; i++) if (region.get(i) != nullPlane[i]) return region; return null; // All of the nullPlane bytes match, non-filled plane }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/68fcf3cc1b9292144736bb3f929fd5962e8aa2b0/PixelBuffer.java/buggy/components/omeio-nio/src/ome/io/nio/PixelBuffer.java
boolean NIL_P(VALUE value) { return value == Qnil; }
boolean NIL_P(VALUE value) { return value == ruby.getNil(); }
boolean NIL_P(VALUE value) { return value == Qnil; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/parse.java/clean/org/jruby/parser/parse.java
boolean RTEST(VALUE value) { return value != Qnil; }
boolean RTEST(VALUE value) { return value != ruby.getNil(); }
boolean RTEST(VALUE value) { return value != Qnil; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/parse.java/clean/org/jruby/parser/parse.java
rb_dvar_push(id, Qnil);
rb_dvar_push(id, /*Qnil*/ ruby.getNil());
private NODE assignable(ID id, NODE val) { value_expr(val); if (id.intValue() == kSELF) { yyerror("Can't change the value of self"); } else if (id.intValue() == kNIL) { yyerror("Can't assign to nil"); } else if (id.intValue() == kTRUE) { yyerror("Can't assign to true"); } else if (id.intValue() == kFALSE) { yyerror("Can't assign to false"); } else if (id.intValue() == k__FILE__) { yyerror("Can't assign to __FILE__"); } else if (id.intValue() == k__LINE__) { yyerror("Can't assign to __LINE__"); } else if (id.is_local_id()) { if (rb_dvar_curr(id) != false) { return NEW_DASGN_CURR(id, val); } else if (rb_dvar_defined(id)) { return NEW_DASGN(id, val); } else if (local_id(id) || !dyna_in_block()) { return NEW_LASGN(id, val); } else{ rb_dvar_push(id, Qnil); return NEW_DASGN_CURR(id, val); } } else if (id.is_global_id()) { return NEW_GASGN(id, val); } else if (id.is_instance_id()) { return NEW_IASGN(id, val); } else if (id.is_const_id()) { if (in_def!=0 || in_single!=0) yyerror("dynamic constant assignment"); return NEW_CDECL(id, val); } else if (id.is_class_id()) { if (in_single!=0) return NEW_CVASGN(id, val); return NEW_CVDECL(id, val); } else { rb_bug("bad id for variable"); } return null; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/parse.java/clean/org/jruby/parser/parse.java
private void dyna_pop(RVarmap vars) {
private void dyna_pop(RubyVarmap vars) {
private void dyna_pop(RVarmap vars) { lvtbl.dlev--; ruby_dyna_vars = vars; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/parse.java/clean/org/jruby/parser/parse.java
ruby_dyna_vars = vars;
ruby.getInterpreter().setDynamicVars(vars);
private void dyna_pop(RVarmap vars) { lvtbl.dlev--; ruby_dyna_vars = vars; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/parse.java/clean/org/jruby/parser/parse.java
private RVarmap dyna_push() { RVarmap vars = ruby_dyna_vars;
private RubyVarmap dyna_push() { RubyVarmap vars = ruby.getInterpreter().getDynamicVars();
private RVarmap dyna_push() { RVarmap vars = ruby_dyna_vars; rb_dvar_push(null, null); lvtbl.dlev++; return vars; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/parse.java/clean/org/jruby/parser/parse.java
return Qnil;
return ruby.getNil();
private VALUE lex_gets_str(VALUE _s) { String s = ((RubyString)_s).getString(); if (lex_gets_ptr != 0) { if (s.length() == lex_gets_ptr) return Qnil; s = s.substring(lex_gets_ptr); } int end = 0; while (end < s.length()) { if (s.charAt(end++) == '\n') break; } lex_gets_ptr += end; return rb_str_new(s, end); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/parse.java/clean/org/jruby/parser/parse.java
private RVarmap new_dvar(ID id, VALUE value, RVarmap prev) { RVarmap map = new RVarmap(); map.id = id; map.val = value; map.next = prev; return map;
private RubyVarmap new_dvar(ID id, VALUE value, RubyVarmap prev) { return new RubyVarmap((RubyId)id, (RubyObject)value, prev);
private RVarmap new_dvar(ID id, VALUE value, RVarmap prev) { RVarmap map = new RVarmap(); map.id = id; map.val = value; map.next = prev; return map; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/parse.java/clean/org/jruby/parser/parse.java
return Qnil;
return ruby.getNil();
VALUE rb_backref_get() { if (ruby.rubyScope.getLocalVars() != null) { return ruby.rubyScope.getLocalVars(1); } return Qnil; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/parse.java/clean/org/jruby/parser/parse.java
RVarmap vars = ruby_dyna_vars; while (vars != null) { if (vars.id == null) break; if (vars.id.equals(id)) return true; vars = vars.next; } return false;
return ruby.getInterpreter().getDynamicVars().isCurrent((RubyId)id);
boolean rb_dvar_curr(ID id) { RVarmap vars = ruby_dyna_vars; while (vars != null) { if (vars.id == null) break; if (vars.id.equals(id)) return true; vars = vars.next; } return false; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/parse.java/clean/org/jruby/parser/parse.java
RVarmap vars = ruby_dyna_vars; while (vars != null) { if (vars.id == null) break; if (vars.id.equals(id)) return true; vars = vars.next; } return false;
return ruby.getInterpreter().getDynamicVars().isDefined((RubyId)id);
boolean rb_dvar_defined(ID id) { RVarmap vars = ruby_dyna_vars; while (vars != null) { if (vars.id == null) break; if (vars.id.equals(id)) return true; vars = vars.next; } return false; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/parse.java/clean/org/jruby/parser/parse.java
ruby_dyna_vars = new_dvar(id, value, ruby_dyna_vars);
ruby.getInterpreter().getDynamicVars().push((RubyId)id, (RubyObject)value);
void rb_dvar_push(ID id, VALUE value) { ruby_dyna_vars = new_dvar(id, value, ruby_dyna_vars); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/parse.java/clean/org/jruby/parser/parse.java
return Qnil;
return ruby.getNil();
VALUE rb_lastline_get() { if (ruby.rubyScope.getLocalVars() != null) { return ruby.rubyScope.getLocalVars(0); } return Qnil; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/parse.java/clean/org/jruby/parser/parse.java
if (ruby_dyna_vars != null)
if (ruby.getInterpreter().getDynamicVars() != null)
top_local_init() { local_push(); lvtbl.cnt = ruby.rubyScope.getLocalTbl() != null ? ruby.rubyScope.getLocalTbl(0).intValue() : 0; if (lvtbl.cnt > 0) { lvtbl.tbl = new ID[lvtbl.cnt+3]; System.arraycopy(lvtbl.tbl, 0, ruby.rubyScope.getLocalTbl(), 0, lvtbl.cnt+1); } else { lvtbl.tbl = null; } if (ruby_dyna_vars != null) lvtbl.dlev = 1; else lvtbl.dlev = 0; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e00ad1c7ae96f50ae0bd521483380788f891b7b/parse.java/clean/org/jruby/parser/parse.java
HierarchyBrowsing hb = (HierarchyBrowsing) applicationContext.getBean("hierarchyBrowsingService");
public void testDuplicateImages() { HierarchyBrowsing hb = (HierarchyBrowsing) applicationContext.getBean("hierarchyBrowsingService"); OMEData data = (OMEData) applicationContext.getBean("data"); Set result = hb.findPDIHierarchies(data.imgsPDI); Set test = Utils.getImagesinPID(result); assertTrue("Images in should eq. images out",data.imgsPDI.size()==test.size()); Set noDupesPlease = new HashSet(); for (Iterator i = test.iterator(); i.hasNext();) { Image img = (Image) i.next(); if (noDupesPlease.contains(img.getImageId())) fail("But also the IDs should be unique!"); noDupesPlease.add(img.getImageId()); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/LeftOuterJoinTest.java/clean/components/server/test/org/openmicroscopy/omero/server/itests/LeftOuterJoinTest.java
HierarchyBrowsing hb = (HierarchyBrowsing) applicationContext.getBean("hierarchyBrowsingService");
public void testImageThumbnailExplodsOnHessianSerialization() { HierarchyBrowsing hb = (HierarchyBrowsing) applicationContext.getBean("hierarchyBrowsingService"); Set imgIds = new HashSet(); imgIds.add(new Integer(1191)); imgIds.add(new Integer(4665)); imgIds.add(new Integer(1304)); imgIds.add(new Integer(4977)); imgIds.add(new Integer(3540)); imgIds.add(new Integer(2064)); Set result = hb.findPDIHierarchies(imgIds); Set test = Utils.getImagesinPID(result); assertTrue("Images in should eq. images out",imgIds.size()==test.size()); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/LeftOuterJoinTest.java/clean/components/server/test/org/openmicroscopy/omero/server/itests/LeftOuterJoinTest.java
text = removeAbsoluteReferences(text);
protected String prettify(String toPrettify) { String text = toPrettify; if(text!=null){ //Use JTidy to clean up the html Tidy tidy = new Tidy(); tidy.setXHTML(true); tidy.setXmlOut(true); tidy.setShowWarnings(false); tidy.setCharEncoding(Configuration.UTF8); ByteArrayInputStream bais; try { bais = new ByteArrayInputStream(text.getBytes("UTF-8")); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); text = baos.toString("UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } return text; }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/9b658e6c2776912956529ae2cfd007c902cc2a20/ArticleLocalizedItemBean.java/clean/src/java/com/idega/block/article/bean/ArticleLocalizedItemBean.java
if (!wiki.containsPage(pageName)) throw new PageActionException ("That page does not exist");
public void perform(WikiSystem wiki, WebContext wc, WikiUser user, WikiPage page) throws PageActionException { String pageName = wc.getForm ("jump"); pageName = WikiUtil.guessWikiTitle(pageName, wiki); if (!wiki.containsPage(pageName)) throw new PageActionException ("That page does not exist"); throw new RedirectException (pageName); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/a24ecb46046b93185ca4901af358792a86cb2c81/JumpToPageAction.java/clean/wiki/src/org/tcdi/opensource/wiki/servlet/JumpToPageAction.java
table.setValueAt(obj, i, ContextPane.BOOLEAN);
table.setValueAt(obj, i, ContextDialog.BOOLEAN);
private void selectAll(boolean b) { TableComponent table = view.table; Boolean obj = Boolean.FALSE; if (b) obj = Boolean.TRUE; for (int i = 0; i < table.getRowCount(); i++) table.setValueAt(obj, i, ContextPane.BOOLEAN); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3db37517e6873d11567ee5822e769ab058e1abed/SelectionPaneMng.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/results/stats/graphic/SelectionPaneMng.java
view.initListeners();
void initialize(ClipBoardUI view, ClipBoardModel model) { if (view == null) throw new NullPointerException("No view."); if (model == null) throw new NullPointerException("No model."); this.view = view; this.model = model; component.addChangeListener(this); model.getParentModel().addChangeListener(this); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/ClipBoardControl.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/ClipBoardControl.java
view.initListeners();
public void stateChanged(ChangeEvent ce) { Object source = ce.getSource(); if (source instanceof HiViewer) { HiViewer parentModel = model.getParentModel(); if (parentModel.getState() == HiViewer.READY) { parentModel.getBrowser().addPropertyChangeListener( Browser.SELECTED_DISPLAY_PROPERTY, this); parentModel.getBrowser().addPropertyChangeListener( Browser.MOUSE_OVER_PROPERTY, this); view.initListeners(); } } else if (source instanceof ClipBoard) { switch (model.getState()) { //We don't know how long the call is going to take so set to // indeterminate case ClipBoard.EDIT_ANNOTATIONS: model.getParentModel().setStatus(EDIT_MSG, -1); break; case ClipBoard.LOADING_CLASSIFICATIONS: case ClipBoard.LOADING_ANNOTATIONS: case ClipBoard.LOADING_CHANNELS_METADATA: model.getParentModel().setStatus(LOADING_MSG, -1); break; case ClipBoard.READY: case ClipBoard.ANNOTATIONS_READY: case ClipBoard.CLASSIFICATIONS_READY: case ClipBoard.DISCARDED_ANNOTATIONS: model.getParentModel().setStatus("", -1); break; } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/ClipBoardControl.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/ClipBoardControl.java
if (!init_p) { if (args.getLength() > 0) { next_p = 1; } else { next_p = -1; currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue("-");
if (args.getLength() == 0) { if (currentFile == runtime.getGlobalVar("$stdin")) { return true;
protected boolean nextArgsFile() { RubyArray args = (RubyArray)runtime.getGlobalVar("$*"); if (!init_p) { if (args.getLength() > 0) { next_p = 1; } else { next_p = -1; currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue("-"); } init_p = true; first_p = false; currentLineNumber = 0; } // retry : while (true) { if (next_p == 1) { next_p = 0; if (args.getLength() > 0) { String filename = ((RubyString) args.shift()).getValue(); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue(filename); if (filename.equals("-")) { currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); /*if (ruby_inplace_mode) { rb_warn("Can't do inplace edit for stdio"); rb_defout = rb_stdout; }*/ } else { File file = new File(filename); try { RubyInputStream inStream = new RubyInputStream(new BufferedInputStream(new FileInputStream(file))); // FILE *fr = rb_fopen(fn, "r"); /*if (ruby_inplace_mode) { struct stat st, st2; VALUE str; FILE *fw; if (TYPE(rb_defout) == T_FILE && rb_defout != rb_stdout) { rb_io_close(rb_defout); } fstat(fileno(fr), &st); if (*ruby_inplace_mode) { str = rb_str_new2(fn); #ifdef NO_LONG_FNAME ruby_add_suffix(str, ruby_inplace_mode); #else rb_str_cat2(str, ruby_inplace_mode); #endif #ifdef NO_SAFE_RENAME (void)fclose(fr); (void)unlink(RSTRING(str)->ptr); (void)rename(fn, RSTRING(str)->ptr); fr = rb_fopen(RSTRING(str)->ptr, "r"); #else if (rename(fn, RSTRING(str)->ptr) < 0) { rb_warn("Can't rename %s to %s: %s, skipping file", fn, RSTRING(str)->ptr, strerror(errno)); fclose(fr); goto retry; } #endif } else { #ifdef NO_SAFE_RENAME rb_fatal("Can't do inplace edit without backup"); #else if (unlink(fn) < 0) { rb_warn("Can't remove %s: %s, skipping file", fn, strerror(errno)); fclose(fr); goto retry; } #endif } fw = rb_fopen(fn, "w"); #ifndef NO_SAFE_RENAME fstat(fileno(fw), &st2); #ifdef HAVE_FCHMOD fchmod(fileno(fw), st.st_mode); #else chmod(fn, st.st_mode); #endif if (st.st_uid!=st2.st_uid || st.st_gid!=st2.st_gid) { fchown(fileno(fw), st.st_uid, st.st_gid); } #endif rb_defout = prep_stdio(fw, FMODE_WRITABLE, rb_cFile); prep_path(rb_defout, fn); }*/ currentFile = new RubyFile(runtime, runtime.getClasses().getFileClass()); currentFile.initIO(inStream, null, filename); // prep_stdio(fr, FMODE_READABLE, rb_cFile); // prep_path(current_file, fn); } catch (FileNotFoundException fnfExcptn) { throw new IOError(runtime, fnfExcptn.getMessage()); } } /*if (binmode) rb_io_binmode(current_file);*/ } else { init_p = false; return false; } } //break; //} return true; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/49c17b4ec0ae2e046650a9ace532caa461a65f20/RubyArgsFile.java/clean/src/org/jruby/RubyArgsFile.java
init_p = true; first_p = false;
currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue("-");
protected boolean nextArgsFile() { RubyArray args = (RubyArray)runtime.getGlobalVar("$*"); if (!init_p) { if (args.getLength() > 0) { next_p = 1; } else { next_p = -1; currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue("-"); } init_p = true; first_p = false; currentLineNumber = 0; } // retry : while (true) { if (next_p == 1) { next_p = 0; if (args.getLength() > 0) { String filename = ((RubyString) args.shift()).getValue(); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue(filename); if (filename.equals("-")) { currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); /*if (ruby_inplace_mode) { rb_warn("Can't do inplace edit for stdio"); rb_defout = rb_stdout; }*/ } else { File file = new File(filename); try { RubyInputStream inStream = new RubyInputStream(new BufferedInputStream(new FileInputStream(file))); // FILE *fr = rb_fopen(fn, "r"); /*if (ruby_inplace_mode) { struct stat st, st2; VALUE str; FILE *fw; if (TYPE(rb_defout) == T_FILE && rb_defout != rb_stdout) { rb_io_close(rb_defout); } fstat(fileno(fr), &st); if (*ruby_inplace_mode) { str = rb_str_new2(fn); #ifdef NO_LONG_FNAME ruby_add_suffix(str, ruby_inplace_mode); #else rb_str_cat2(str, ruby_inplace_mode); #endif #ifdef NO_SAFE_RENAME (void)fclose(fr); (void)unlink(RSTRING(str)->ptr); (void)rename(fn, RSTRING(str)->ptr); fr = rb_fopen(RSTRING(str)->ptr, "r"); #else if (rename(fn, RSTRING(str)->ptr) < 0) { rb_warn("Can't rename %s to %s: %s, skipping file", fn, RSTRING(str)->ptr, strerror(errno)); fclose(fr); goto retry; } #endif } else { #ifdef NO_SAFE_RENAME rb_fatal("Can't do inplace edit without backup"); #else if (unlink(fn) < 0) { rb_warn("Can't remove %s: %s, skipping file", fn, strerror(errno)); fclose(fr); goto retry; } #endif } fw = rb_fopen(fn, "w"); #ifndef NO_SAFE_RENAME fstat(fileno(fw), &st2); #ifdef HAVE_FCHMOD fchmod(fileno(fw), st.st_mode); #else chmod(fn, st.st_mode); #endif if (st.st_uid!=st2.st_uid || st.st_gid!=st2.st_gid) { fchown(fileno(fw), st.st_uid, st.st_gid); } #endif rb_defout = prep_stdio(fw, FMODE_WRITABLE, rb_cFile); prep_path(rb_defout, fn); }*/ currentFile = new RubyFile(runtime, runtime.getClasses().getFileClass()); currentFile.initIO(inStream, null, filename); // prep_stdio(fr, FMODE_READABLE, rb_cFile); // prep_path(current_file, fn); } catch (FileNotFoundException fnfExcptn) { throw new IOError(runtime, fnfExcptn.getMessage()); } } /*if (binmode) rb_io_binmode(current_file);*/ } else { init_p = false; return false; } } //break; //} return true; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/49c17b4ec0ae2e046650a9ace532caa461a65f20/RubyArgsFile.java/clean/src/org/jruby/RubyArgsFile.java
if (next_p == 1) { next_p = 0; if (args.getLength() > 0) { String filename = ((RubyString) args.shift()).getValue(); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue(filename);
String filename = ((RubyString) args.shift()).getValue(); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue(filename);
protected boolean nextArgsFile() { RubyArray args = (RubyArray)runtime.getGlobalVar("$*"); if (!init_p) { if (args.getLength() > 0) { next_p = 1; } else { next_p = -1; currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue("-"); } init_p = true; first_p = false; currentLineNumber = 0; } // retry : while (true) { if (next_p == 1) { next_p = 0; if (args.getLength() > 0) { String filename = ((RubyString) args.shift()).getValue(); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue(filename); if (filename.equals("-")) { currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); /*if (ruby_inplace_mode) { rb_warn("Can't do inplace edit for stdio"); rb_defout = rb_stdout; }*/ } else { File file = new File(filename); try { RubyInputStream inStream = new RubyInputStream(new BufferedInputStream(new FileInputStream(file))); // FILE *fr = rb_fopen(fn, "r"); /*if (ruby_inplace_mode) { struct stat st, st2; VALUE str; FILE *fw; if (TYPE(rb_defout) == T_FILE && rb_defout != rb_stdout) { rb_io_close(rb_defout); } fstat(fileno(fr), &st); if (*ruby_inplace_mode) { str = rb_str_new2(fn); #ifdef NO_LONG_FNAME ruby_add_suffix(str, ruby_inplace_mode); #else rb_str_cat2(str, ruby_inplace_mode); #endif #ifdef NO_SAFE_RENAME (void)fclose(fr); (void)unlink(RSTRING(str)->ptr); (void)rename(fn, RSTRING(str)->ptr); fr = rb_fopen(RSTRING(str)->ptr, "r"); #else if (rename(fn, RSTRING(str)->ptr) < 0) { rb_warn("Can't rename %s to %s: %s, skipping file", fn, RSTRING(str)->ptr, strerror(errno)); fclose(fr); goto retry; } #endif } else { #ifdef NO_SAFE_RENAME rb_fatal("Can't do inplace edit without backup"); #else if (unlink(fn) < 0) { rb_warn("Can't remove %s: %s, skipping file", fn, strerror(errno)); fclose(fr); goto retry; } #endif } fw = rb_fopen(fn, "w"); #ifndef NO_SAFE_RENAME fstat(fileno(fw), &st2); #ifdef HAVE_FCHMOD fchmod(fileno(fw), st.st_mode); #else chmod(fn, st.st_mode); #endif if (st.st_uid!=st2.st_uid || st.st_gid!=st2.st_gid) { fchown(fileno(fw), st.st_uid, st.st_gid); } #endif rb_defout = prep_stdio(fw, FMODE_WRITABLE, rb_cFile); prep_path(rb_defout, fn); }*/ currentFile = new RubyFile(runtime, runtime.getClasses().getFileClass()); currentFile.initIO(inStream, null, filename); // prep_stdio(fr, FMODE_READABLE, rb_cFile); // prep_path(current_file, fn); } catch (FileNotFoundException fnfExcptn) { throw new IOError(runtime, fnfExcptn.getMessage()); } } /*if (binmode) rb_io_binmode(current_file);*/ } else { init_p = false; return false; } } //break; //} return true; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/49c17b4ec0ae2e046650a9ace532caa461a65f20/RubyArgsFile.java/clean/src/org/jruby/RubyArgsFile.java
if (filename.equals("-")) { currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); /*if (ruby_inplace_mode) { rb_warn("Can't do inplace edit for stdio"); rb_defout = rb_stdout; }*/ } else { File file = new File(filename); try { RubyInputStream inStream = new RubyInputStream(new BufferedInputStream(new FileInputStream(file)));
if (filename.equals("-")) { currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); } else { File file = new File(filename); try { RubyInputStream inStream = new RubyInputStream(new BufferedInputStream(new FileInputStream(file)));
protected boolean nextArgsFile() { RubyArray args = (RubyArray)runtime.getGlobalVar("$*"); if (!init_p) { if (args.getLength() > 0) { next_p = 1; } else { next_p = -1; currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue("-"); } init_p = true; first_p = false; currentLineNumber = 0; } // retry : while (true) { if (next_p == 1) { next_p = 0; if (args.getLength() > 0) { String filename = ((RubyString) args.shift()).getValue(); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue(filename); if (filename.equals("-")) { currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); /*if (ruby_inplace_mode) { rb_warn("Can't do inplace edit for stdio"); rb_defout = rb_stdout; }*/ } else { File file = new File(filename); try { RubyInputStream inStream = new RubyInputStream(new BufferedInputStream(new FileInputStream(file))); // FILE *fr = rb_fopen(fn, "r"); /*if (ruby_inplace_mode) { struct stat st, st2; VALUE str; FILE *fw; if (TYPE(rb_defout) == T_FILE && rb_defout != rb_stdout) { rb_io_close(rb_defout); } fstat(fileno(fr), &st); if (*ruby_inplace_mode) { str = rb_str_new2(fn); #ifdef NO_LONG_FNAME ruby_add_suffix(str, ruby_inplace_mode); #else rb_str_cat2(str, ruby_inplace_mode); #endif #ifdef NO_SAFE_RENAME (void)fclose(fr); (void)unlink(RSTRING(str)->ptr); (void)rename(fn, RSTRING(str)->ptr); fr = rb_fopen(RSTRING(str)->ptr, "r"); #else if (rename(fn, RSTRING(str)->ptr) < 0) { rb_warn("Can't rename %s to %s: %s, skipping file", fn, RSTRING(str)->ptr, strerror(errno)); fclose(fr); goto retry; } #endif } else { #ifdef NO_SAFE_RENAME rb_fatal("Can't do inplace edit without backup"); #else if (unlink(fn) < 0) { rb_warn("Can't remove %s: %s, skipping file", fn, strerror(errno)); fclose(fr); goto retry; } #endif } fw = rb_fopen(fn, "w"); #ifndef NO_SAFE_RENAME fstat(fileno(fw), &st2); #ifdef HAVE_FCHMOD fchmod(fileno(fw), st.st_mode); #else chmod(fn, st.st_mode); #endif if (st.st_uid!=st2.st_uid || st.st_gid!=st2.st_gid) { fchown(fileno(fw), st.st_uid, st.st_gid); } #endif rb_defout = prep_stdio(fw, FMODE_WRITABLE, rb_cFile); prep_path(rb_defout, fn); }*/ currentFile = new RubyFile(runtime, runtime.getClasses().getFileClass()); currentFile.initIO(inStream, null, filename); // prep_stdio(fr, FMODE_READABLE, rb_cFile); // prep_path(current_file, fn); } catch (FileNotFoundException fnfExcptn) { throw new IOError(runtime, fnfExcptn.getMessage()); } } /*if (binmode) rb_io_binmode(current_file);*/ } else { init_p = false; return false; } } //break; //} return true; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/49c17b4ec0ae2e046650a9ace532caa461a65f20/RubyArgsFile.java/clean/src/org/jruby/RubyArgsFile.java
/*if (ruby_inplace_mode) { struct stat st, st2; VALUE str; FILE *fw; if (TYPE(rb_defout) == T_FILE && rb_defout != rb_stdout) { rb_io_close(rb_defout); } fstat(fileno(fr), &st); if (*ruby_inplace_mode) { str = rb_str_new2(fn); #ifdef NO_LONG_FNAME ruby_add_suffix(str, ruby_inplace_mode); #else rb_str_cat2(str, ruby_inplace_mode); #endif #ifdef NO_SAFE_RENAME (void)fclose(fr); (void)unlink(RSTRING(str)->ptr); (void)rename(fn, RSTRING(str)->ptr); fr = rb_fopen(RSTRING(str)->ptr, "r"); #else if (rename(fn, RSTRING(str)->ptr) < 0) { rb_warn("Can't rename %s to %s: %s, skipping file", fn, RSTRING(str)->ptr, strerror(errno)); fclose(fr); goto retry; } #endif } else { #ifdef NO_SAFE_RENAME rb_fatal("Can't do inplace edit without backup"); #else if (unlink(fn) < 0) { rb_warn("Can't remove %s: %s, skipping file", fn, strerror(errno)); fclose(fr); goto retry; } #endif } fw = rb_fopen(fn, "w"); #ifndef NO_SAFE_RENAME fstat(fileno(fw), &st2); #ifdef HAVE_FCHMOD fchmod(fileno(fw), st.st_mode); #else chmod(fn, st.st_mode); #endif if (st.st_uid!=st2.st_uid || st.st_gid!=st2.st_gid) { fchown(fileno(fw), st.st_uid, st.st_gid); } #endif rb_defout = prep_stdio(fw, FMODE_WRITABLE, rb_cFile); prep_path(rb_defout, fn); }*/
currentFile = new RubyFile(runtime, runtime.getClasses().getFileClass()); currentFile.initIO(inStream, null, filename);
protected boolean nextArgsFile() { RubyArray args = (RubyArray)runtime.getGlobalVar("$*"); if (!init_p) { if (args.getLength() > 0) { next_p = 1; } else { next_p = -1; currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue("-"); } init_p = true; first_p = false; currentLineNumber = 0; } // retry : while (true) { if (next_p == 1) { next_p = 0; if (args.getLength() > 0) { String filename = ((RubyString) args.shift()).getValue(); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue(filename); if (filename.equals("-")) { currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); /*if (ruby_inplace_mode) { rb_warn("Can't do inplace edit for stdio"); rb_defout = rb_stdout; }*/ } else { File file = new File(filename); try { RubyInputStream inStream = new RubyInputStream(new BufferedInputStream(new FileInputStream(file))); // FILE *fr = rb_fopen(fn, "r"); /*if (ruby_inplace_mode) { struct stat st, st2; VALUE str; FILE *fw; if (TYPE(rb_defout) == T_FILE && rb_defout != rb_stdout) { rb_io_close(rb_defout); } fstat(fileno(fr), &st); if (*ruby_inplace_mode) { str = rb_str_new2(fn); #ifdef NO_LONG_FNAME ruby_add_suffix(str, ruby_inplace_mode); #else rb_str_cat2(str, ruby_inplace_mode); #endif #ifdef NO_SAFE_RENAME (void)fclose(fr); (void)unlink(RSTRING(str)->ptr); (void)rename(fn, RSTRING(str)->ptr); fr = rb_fopen(RSTRING(str)->ptr, "r"); #else if (rename(fn, RSTRING(str)->ptr) < 0) { rb_warn("Can't rename %s to %s: %s, skipping file", fn, RSTRING(str)->ptr, strerror(errno)); fclose(fr); goto retry; } #endif } else { #ifdef NO_SAFE_RENAME rb_fatal("Can't do inplace edit without backup"); #else if (unlink(fn) < 0) { rb_warn("Can't remove %s: %s, skipping file", fn, strerror(errno)); fclose(fr); goto retry; } #endif } fw = rb_fopen(fn, "w"); #ifndef NO_SAFE_RENAME fstat(fileno(fw), &st2); #ifdef HAVE_FCHMOD fchmod(fileno(fw), st.st_mode); #else chmod(fn, st.st_mode); #endif if (st.st_uid!=st2.st_uid || st.st_gid!=st2.st_gid) { fchown(fileno(fw), st.st_uid, st.st_gid); } #endif rb_defout = prep_stdio(fw, FMODE_WRITABLE, rb_cFile); prep_path(rb_defout, fn); }*/ currentFile = new RubyFile(runtime, runtime.getClasses().getFileClass()); currentFile.initIO(inStream, null, filename); // prep_stdio(fr, FMODE_READABLE, rb_cFile); // prep_path(current_file, fn); } catch (FileNotFoundException fnfExcptn) { throw new IOError(runtime, fnfExcptn.getMessage()); } } /*if (binmode) rb_io_binmode(current_file);*/ } else { init_p = false; return false; } } //break; //} return true; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/49c17b4ec0ae2e046650a9ace532caa461a65f20/RubyArgsFile.java/clean/src/org/jruby/RubyArgsFile.java
currentFile = new RubyFile(runtime, runtime.getClasses().getFileClass()); currentFile.initIO(inStream, null, filename); } catch (FileNotFoundException fnfExcptn) { throw new IOError(runtime, fnfExcptn.getMessage()); } } /*if (binmode) rb_io_binmode(current_file);*/ } else { init_p = false; return false;
} catch (FileNotFoundException fnfExcptn) { throw new IOError(runtime, fnfExcptn.getMessage());
protected boolean nextArgsFile() { RubyArray args = (RubyArray)runtime.getGlobalVar("$*"); if (!init_p) { if (args.getLength() > 0) { next_p = 1; } else { next_p = -1; currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue("-"); } init_p = true; first_p = false; currentLineNumber = 0; } // retry : while (true) { if (next_p == 1) { next_p = 0; if (args.getLength() > 0) { String filename = ((RubyString) args.shift()).getValue(); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue(filename); if (filename.equals("-")) { currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); /*if (ruby_inplace_mode) { rb_warn("Can't do inplace edit for stdio"); rb_defout = rb_stdout; }*/ } else { File file = new File(filename); try { RubyInputStream inStream = new RubyInputStream(new BufferedInputStream(new FileInputStream(file))); // FILE *fr = rb_fopen(fn, "r"); /*if (ruby_inplace_mode) { struct stat st, st2; VALUE str; FILE *fw; if (TYPE(rb_defout) == T_FILE && rb_defout != rb_stdout) { rb_io_close(rb_defout); } fstat(fileno(fr), &st); if (*ruby_inplace_mode) { str = rb_str_new2(fn); #ifdef NO_LONG_FNAME ruby_add_suffix(str, ruby_inplace_mode); #else rb_str_cat2(str, ruby_inplace_mode); #endif #ifdef NO_SAFE_RENAME (void)fclose(fr); (void)unlink(RSTRING(str)->ptr); (void)rename(fn, RSTRING(str)->ptr); fr = rb_fopen(RSTRING(str)->ptr, "r"); #else if (rename(fn, RSTRING(str)->ptr) < 0) { rb_warn("Can't rename %s to %s: %s, skipping file", fn, RSTRING(str)->ptr, strerror(errno)); fclose(fr); goto retry; } #endif } else { #ifdef NO_SAFE_RENAME rb_fatal("Can't do inplace edit without backup"); #else if (unlink(fn) < 0) { rb_warn("Can't remove %s: %s, skipping file", fn, strerror(errno)); fclose(fr); goto retry; } #endif } fw = rb_fopen(fn, "w"); #ifndef NO_SAFE_RENAME fstat(fileno(fw), &st2); #ifdef HAVE_FCHMOD fchmod(fileno(fw), st.st_mode); #else chmod(fn, st.st_mode); #endif if (st.st_uid!=st2.st_uid || st.st_gid!=st2.st_gid) { fchown(fileno(fw), st.st_uid, st.st_gid); } #endif rb_defout = prep_stdio(fw, FMODE_WRITABLE, rb_cFile); prep_path(rb_defout, fn); }*/ currentFile = new RubyFile(runtime, runtime.getClasses().getFileClass()); currentFile.initIO(inStream, null, filename); // prep_stdio(fr, FMODE_READABLE, rb_cFile); // prep_path(current_file, fn); } catch (FileNotFoundException fnfExcptn) { throw new IOError(runtime, fnfExcptn.getMessage()); } } /*if (binmode) rb_io_binmode(current_file);*/ } else { init_p = false; return false; } } //break; //} return true; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/49c17b4ec0ae2e046650a9ace532caa461a65f20/RubyArgsFile.java/clean/src/org/jruby/RubyArgsFile.java
protected boolean nextArgsFile() { RubyArray args = (RubyArray)runtime.getGlobalVar("$*"); if (!init_p) { if (args.getLength() > 0) { next_p = 1; } else { next_p = -1; currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue("-"); } init_p = true; first_p = false; currentLineNumber = 0; } // retry : while (true) { if (next_p == 1) { next_p = 0; if (args.getLength() > 0) { String filename = ((RubyString) args.shift()).getValue(); ((RubyString) runtime.getGlobalVar("$FILENAME")).setValue(filename); if (filename.equals("-")) { currentFile = (RubyIO) runtime.getGlobalVar("$stdin"); /*if (ruby_inplace_mode) { rb_warn("Can't do inplace edit for stdio"); rb_defout = rb_stdout; }*/ } else { File file = new File(filename); try { RubyInputStream inStream = new RubyInputStream(new BufferedInputStream(new FileInputStream(file))); // FILE *fr = rb_fopen(fn, "r"); /*if (ruby_inplace_mode) { struct stat st, st2; VALUE str; FILE *fw; if (TYPE(rb_defout) == T_FILE && rb_defout != rb_stdout) { rb_io_close(rb_defout); } fstat(fileno(fr), &st); if (*ruby_inplace_mode) { str = rb_str_new2(fn); #ifdef NO_LONG_FNAME ruby_add_suffix(str, ruby_inplace_mode); #else rb_str_cat2(str, ruby_inplace_mode); #endif #ifdef NO_SAFE_RENAME (void)fclose(fr); (void)unlink(RSTRING(str)->ptr); (void)rename(fn, RSTRING(str)->ptr); fr = rb_fopen(RSTRING(str)->ptr, "r"); #else if (rename(fn, RSTRING(str)->ptr) < 0) { rb_warn("Can't rename %s to %s: %s, skipping file", fn, RSTRING(str)->ptr, strerror(errno)); fclose(fr); goto retry; } #endif } else { #ifdef NO_SAFE_RENAME rb_fatal("Can't do inplace edit without backup"); #else if (unlink(fn) < 0) { rb_warn("Can't remove %s: %s, skipping file", fn, strerror(errno)); fclose(fr); goto retry; } #endif } fw = rb_fopen(fn, "w"); #ifndef NO_SAFE_RENAME fstat(fileno(fw), &st2); #ifdef HAVE_FCHMOD fchmod(fileno(fw), st.st_mode); #else chmod(fn, st.st_mode); #endif if (st.st_uid!=st2.st_uid || st.st_gid!=st2.st_gid) { fchown(fileno(fw), st.st_uid, st.st_gid); } #endif rb_defout = prep_stdio(fw, FMODE_WRITABLE, rb_cFile); prep_path(rb_defout, fn); }*/ currentFile = new RubyFile(runtime, runtime.getClasses().getFileClass()); currentFile.initIO(inStream, null, filename); // prep_stdio(fr, FMODE_READABLE, rb_cFile); // prep_path(current_file, fn); } catch (FileNotFoundException fnfExcptn) { throw new IOError(runtime, fnfExcptn.getMessage()); } } /*if (binmode) rb_io_binmode(current_file);*/ } else { init_p = false; return false; } } //break; //} return true; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/49c17b4ec0ae2e046650a9ace532caa461a65f20/RubyArgsFile.java/clean/src/org/jruby/RubyArgsFile.java
URL url = SparkManager.getVCardManager().getAvatar(SparkManager.getSessionManager().getJID());
URL url = SparkManager.getVCardManager().getAvatar(participantJID);
public ChatRoomImpl(final String participantJID, String participantNickname, String title) { this.participantJID = participantJID; this.participantNickname = participantNickname; AndFilter presenceFilter = new AndFilter(new PacketTypeFilter(Presence.class), new FromContainsFilter(participantJID)); // Register PacketListeners AndFilter messageFilter = new AndFilter(new PacketTypeFilter(Message.class), new FromContainsFilter(participantJID)); SparkManager.getConnection().addPacketListener(this, messageFilter); SparkManager.getConnection().addPacketListener(this, presenceFilter); // The roomname will be the participantJID this.roomname = participantJID; // Use the agents username as the Tab Title this.tabTitle = title; // The name of the room will be the node of the user jid + conversation. final SimpleDateFormat formatter = new SimpleDateFormat("h:mm a"); this.roomTitle = participantNickname; // Add RoomInfo this.getSplitPane().setRightComponent(null); getSplitPane().setDividerSize(0); roster = SparkManager.getConnection().getRoster(); presence = roster.getPresence(participantJID); RosterEntry entry = roster.getEntry(participantJID); tabIcon = SparkManager.getUserManager().getTabIconForPresence(presence); PacketFilter filter = new AndFilter(new PacketTypeFilter(Presence.class), new FromContainsFilter(participantJID)); SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { presence = (Presence)packet; } }, filter); // Create toolbar buttons. ChatRoomButton infoButton = new ChatRoomButton("", SparkRes.getImageIcon(SparkRes.PROFILE_IMAGE_24x24)); infoButton.setToolTipText(Res.getString("message.view.information.about.this.user")); // Create basic toolbar. getToolBar().addChatRoomButton(infoButton); // If the user is not in the roster, then allow user to add them. if (entry == null && !StringUtils.parseResource(participantJID).equals(participantNickname)) { ChatRoomButton addToRosterButton = new ChatRoomButton("", SparkRes.getImageIcon(SparkRes.ADD_IMAGE_24x24)); addToRosterButton.setToolTipText(Res.getString("message.add.this.user.to.your.roster")); getToolBar().addChatRoomButton(addToRosterButton); addToRosterButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(participantJID); rosterDialog.setDefaultNickname(getParticipantNickname()); rosterDialog.showRosterDialog(SparkManager.getChatManager().getChatContainer().getChatFrame()); } }); } // Show VCard. infoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { VCardManager vcard = SparkManager.getVCardManager(); vcard.viewProfile(participantJID, SparkManager.getChatManager().getChatContainer()); } }); // If this is a private chat from a group chat room, do not show toolbar. if (StringUtils.parseResource(participantJID).equals(participantNickname)) { getToolBar().setVisible(false); } typingTimer = new Timer(2000, new ActionListener() { public void actionPerformed(ActionEvent e) { if (!sendTypingNotification) { return; } long now = System.currentTimeMillis(); if (now - lastTypedCharTime > 2000) { if (!sendNotification) { // send cancel SparkManager.getMessageEventManager().sendCancelledNotification(getParticipantJID(), threadID); sendNotification = true; } } } }); typingTimer.start(); lastActivity = System.currentTimeMillis(); String time = formatter.format(new Date()); transcriptWindow.setInnerHTML("chatName", participantNickname); transcriptWindow.setInnerHTML("timeOpened", "Conversation started on " + time); URL url = SparkManager.getVCardManager().getAvatar(SparkManager.getSessionManager().getJID()); if (url != null) { transcriptWindow.setInnerHTML("incomingIconPath", "<img src=\"" + url.toExternalForm() + "\">"); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d146fe0558b3a9a3c79746e51b1aa990ebe519a4/ChatRoomImpl.java/buggy/src/java/org/jivesoftware/spark/ui/rooms/ChatRoomImpl.java
JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); return this; }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/f678f06c6fbc4a84079c230a0a7461759cb20755/ConferenceRooms.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRooms.java
final ChatPreferences pref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE);
LocalPreferences pref = SettingsManager.getLocalPreferences();
private void createRoom() { ConferenceCreator mucRoomDialog = new ConferenceCreator(); final MultiUserChat groupChat = mucRoomDialog.createGroupChat(SparkManager.getMainWindow(), serviceName); final ChatPreferences pref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); if (null != groupChat) { // Join Room try { GroupChatRoom room = new GroupChatRoom(groupChat); chatManager.getChatContainer().addChatRoom(room); chatManager.getChatContainer().activateChatRoom(room); groupChat.create(pref.getNickname()); // Send Form Form form = groupChat.getConfigurationForm().createAnswerForm(); if (mucRoomDialog.isPasswordProtected()) { String password = mucRoomDialog.getPassword(); form.setAnswer("muc#roomconfig_passwordprotectedroom", true); form.setAnswer("muc#roomconfig_roomsecret", password); } form.setAnswer("muc#roomconfig_roomname", mucRoomDialog.getRoomName()); if (mucRoomDialog.isPermanent()) { form.setAnswer("muc#roomconfig_persistentroom", true); } List owners = new ArrayList(); owners.add(SparkManager.getSessionManager().getBareAddress()); form.setAnswer("muc#roomconfig_roomowners", owners); // new DataFormDialog(groupChat, form); groupChat.sendConfigurationForm(form); } catch (XMPPException e1) { Log.error("Error creating new room.", e1); } addRoomToTable(groupChat.getRoom(), StringUtils.parseName(groupChat.getRoom()), 1); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/f678f06c6fbc4a84079c230a0a7461759cb20755/ConferenceRooms.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRooms.java
EqualCondition(Condition l, Condition r) { _l = l; _r = r; }
EqualCondition(Macro l, Macro r) { _l = l; _r = r; }
EqualCondition(Condition l, Condition r) { _l = l; _r = r; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4e82bcbfa0293596ccebd7abff0c093e9937d6ba/EqualConditionBuilder.java/buggy/webmacro/src/org/webmacro/engine/EqualConditionBuilder.java