bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
public ExperimenterGroup[] containedGroups(Long experimenterId) { Experimenter e = iQuery.execute( new UserQ( new Parameters( ).addId(experimenterId))); if (e == null) { throw new ApiUsageException("No such user: "+experimenterId); } int count = e.sizeOfGroupExperimenterMap(); if ( count < 1 ) { return new ExperimenterGroup[]{}; } return (ExperimenterGroup[]) e.linkedExperimenterGroupList() .toArray(new ExperimenterGroup[count]); }
|
public ExperimenterGroup[] containedGroups(Long experimenterId) { Experimenter e = iQuery.execute( new UserQ( new Parameters( ).addId(experimenterId))); if (e == null) { throw new ApiUsageException("No such user: "+experimenterId); } int count = e.sizeOfGroupExperimenterMap(); if ( count < 1 ) { return new ExperimenterGroup[]{}; } return (ExperimenterGroup[]) e.linkedExperimenterGroupList() .toArray(new ExperimenterGroup[count]); }
| 3,237,581
|
protected ExperimenterGroup copyGroup(ExperimenterGroup g) { if ( g.getName() == null ) { throw new ValidationException("Group name may not be null."); } ExperimenterGroup copy = new ExperimenterGroup(); copy.setDescription( g.getDescription() ); copy.setName( g.getName() ); copy.setDetails( getSecuritySystem().transientDetails(g)); // TODO see shallow copy comment on copy user return copy; }
|
protected ExperimenterGroup copyGroup(ExperimenterGroup g) { if ( g.getName() == null ) { throw new ValidationException("Group name may not be null."); } ExperimenterGroup copy = new ExperimenterGroup(); copy.setDescription( g.getDescription() ); copy.setName( g.getName() ); copy.setDetails( getSecuritySystem().transientDetails(g)); // TODO see shallow copy comment on copy user return copy; }
| 3,237,582
|
protected Experimenter copyUser(Experimenter e) { if ( e.getOmeName() == null ) { throw new ValidationException("OmeName may not be null."); } Experimenter copy = new Experimenter(); copy.setOmeName( e.getOmeName() ); copy.setFirstName( e.getOmeName() ); copy.setLastName( e.getLastName() ); copy.setEmail( e.getEmail() ); if (e.getDetails()!=null && e.getDetails().getPermissions()!=null) { copy.getDetails().setPermissions(e.getDetails().getPermissions()); } // TODO make ShallowCopy-like which ignores collections and details. // if possible, values should be validated. i.e. iTypes should say what // is non-null return copy; }
|
protected Experimenter copyUser(Experimenter e) { if ( e.getOmeName() == null ) { throw new ValidationException("OmeName may not be null."); } Experimenter copy = new Experimenter(); copy.setOmeName( e.getOmeName() ); copy.setFirstName( e.getOmeName() ); copy.setLastName( e.getLastName() ); copy.setEmail( e.getEmail() ); if (e.getDetails()!=null && e.getDetails().getPermissions()!=null) { copy.getDetails().setPermissions(e.getDetails().getPermissions()); } // TODO make ShallowCopy-like which ignores collections and details. // if possible, values should be validated. i.e. iTypes should say what // is non-null return copy; }
| 3,237,583
|
public long createExperimenter( Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups) {// TODO check that no other group is default Experimenter e = copyUser( experimenter ); if ( defaultGroup == null || defaultGroup.getId() == null ) { throw new ApiUsageException("Default group may not be null."); } SecureAction action = new SecureAction(){ public <T extends IObject> T updateObject(T obj) { return iUpdate.saveAndReturnObject( obj ); } }; e = getSecuritySystem().doAction(e, action); final GroupExperimenterMap defaultGroupMap = new GroupExperimenterMap(); defaultGroupMap.link( groupProxy(defaultGroup.getId()), userProxy(e.getId())); defaultGroupMap.setDefaultGroupLink(Boolean.TRUE); defaultGroupMap.setDetails( getSecuritySystem().transientDetails( defaultGroupMap )); getSecuritySystem().doAction(defaultGroupMap,action); if ( null != otherGroups ) { for (ExperimenterGroup group : otherGroups) { if ( group == null ) continue; if ( group.getId() == null) { throw new ApiUsageException( "Groups must be previously saved during " + "Experimenter creation."); } GroupExperimenterMap groupMap = new GroupExperimenterMap(); groupMap.link( groupProxy(group.getId()), userProxy(e.getId())); groupMap.setDefaultGroupLink(Boolean.FALSE); groupMap.setDetails( getSecuritySystem().transientDetails( groupMap )); getSecuritySystem().doAction(groupMap, action); } } changeUserPassword(e.getOmeName()," "); return e.getId(); }
|
public long createExperimenter( Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups) {// TODO check that no other group is default Experimenter e = copyUser( experimenter ); if ( defaultGroup == null || defaultGroup.getId() == null ) { throw new ApiUsageException("Default group may not be null."); } SecureAction action = new SecureAction(){ public <T extends IObject> T updateObject(T obj) { return iUpdate.saveAndReturnObject( obj ); } }; e = getSecuritySystem().doAction(e, action); final GroupExperimenterMap defaultGroupMap = new GroupExperimenterMap(); defaultGroupMap.link( groupProxy(defaultGroup.getId()), userProxy(e.getId())); defaultGroupMap.setDefaultGroupLink(Boolean.TRUE); defaultGroupMap.setDetails( getSecuritySystem().transientDetails( defaultGroupMap )); getSecuritySystem().doAction(defaultGroupMap,action); if ( null != otherGroups ) { for (ExperimenterGroup group : otherGroups) { if ( group == null ) continue; if ( group.getId() == null) { throw new ApiUsageException( "Groups must be previously saved during " + "Experimenter creation."); } GroupExperimenterMap groupMap = new GroupExperimenterMap(); groupMap.link( groupProxy(group.getId()), userProxy(e.getId())); groupMap.setDefaultGroupLink(Boolean.FALSE); groupMap.setDetails( getSecuritySystem().transientDetails( groupMap )); getSecuritySystem().doAction(groupMap, action); } } changeUserPassword(e.getOmeName()," "); return e.getId(); }
| 3,237,584
|
public long createExperimenter( Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups) {// TODO check that no other group is default Experimenter e = copyUser( experimenter ); if ( defaultGroup == null || defaultGroup.getId() == null ) { throw new ApiUsageException("Default group may not be null."); } SecureAction action = new SecureAction(){ public <T extends IObject> T updateObject(T obj) { return iUpdate.saveAndReturnObject( obj ); } }; e = getSecuritySystem().doAction(e, action); final GroupExperimenterMap defaultGroupMap = new GroupExperimenterMap(); defaultGroupMap.link( groupProxy(defaultGroup.getId()), userProxy(e.getId())); defaultGroupMap.setDefaultGroupLink(Boolean.TRUE); defaultGroupMap.setDetails( getSecuritySystem().transientDetails( defaultGroupMap )); getSecuritySystem().doAction(defaultGroupMap,action); if ( null != otherGroups ) { for (ExperimenterGroup group : otherGroups) { if ( group == null ) continue; if ( group.getId() == null) { throw new ApiUsageException( "Groups must be previously saved during " + "Experimenter creation."); } GroupExperimenterMap groupMap = new GroupExperimenterMap(); groupMap.link( groupProxy(group.getId()), userProxy(e.getId())); groupMap.setDefaultGroupLink(Boolean.FALSE); groupMap.setDetails( getSecuritySystem().transientDetails( groupMap )); getSecuritySystem().doAction(groupMap, action); } } changeUserPassword(e.getOmeName()," "); return e.getId(); }
|
public long createExperimenter( Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups) {// TODO check that no other group is default Experimenter e = copyUser( experimenter ); if ( defaultGroup == null || defaultGroup.getId() == null ) { throw new ApiUsageException("Default group may not be null."); } SecureAction action = new SecureAction(){ public <T extends IObject> T updateObject(T obj) { return iUpdate.saveAndReturnObject( obj ); } }; e = getSecuritySystem().doAction(e, action); final GroupExperimenterMap defaultGroupMap = new GroupExperimenterMap(); defaultGroupMap.link( groupProxy(defaultGroup.getId()), userProxy(e.getId())); defaultGroupMap.setDefaultGroupLink(Boolean.TRUE); defaultGroupMap.setDetails( getSecuritySystem().transientDetails( defaultGroupMap )); getSecuritySystem().doAction(defaultGroupMap,action); if ( null != otherGroups ) { for (ExperimenterGroup group : otherGroups) { if ( group == null ) continue; if ( group.getId() == null) { throw new ApiUsageException( "Groups must be previously saved during " + "Experimenter creation."); } GroupExperimenterMap groupMap = new GroupExperimenterMap(); groupMap.link( groupProxy(group.getId()), userProxy(e.getId())); groupMap.setDefaultGroupLink(Boolean.FALSE); groupMap.setDetails( getSecuritySystem().transientDetails( groupMap )); getSecuritySystem().doAction(groupMap, action); } } changeUserPassword(e.getOmeName()," "); return e.getId(); }
| 3,237,585
|
public long createExperimenter( Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups) {// TODO check that no other group is default Experimenter e = copyUser( experimenter ); if ( defaultGroup == null || defaultGroup.getId() == null ) { throw new ApiUsageException("Default group may not be null."); } SecureAction action = new SecureAction(){ public <T extends IObject> T updateObject(T obj) { return iUpdate.saveAndReturnObject( obj ); } }; e = getSecuritySystem().doAction(e, action); final GroupExperimenterMap defaultGroupMap = new GroupExperimenterMap(); defaultGroupMap.link( groupProxy(defaultGroup.getId()), userProxy(e.getId())); defaultGroupMap.setDefaultGroupLink(Boolean.TRUE); defaultGroupMap.setDetails( getSecuritySystem().transientDetails( defaultGroupMap )); getSecuritySystem().doAction(defaultGroupMap,action); if ( null != otherGroups ) { for (ExperimenterGroup group : otherGroups) { if ( group == null ) continue; if ( group.getId() == null) { throw new ApiUsageException( "Groups must be previously saved during " + "Experimenter creation."); } GroupExperimenterMap groupMap = new GroupExperimenterMap(); groupMap.link( groupProxy(group.getId()), userProxy(e.getId())); groupMap.setDefaultGroupLink(Boolean.FALSE); groupMap.setDetails( getSecuritySystem().transientDetails( groupMap )); getSecuritySystem().doAction(groupMap, action); } } changeUserPassword(e.getOmeName()," "); return e.getId(); }
|
public long createExperimenter( Experimenter experimenter, ExperimenterGroup defaultGroup, ExperimenterGroup[] otherGroups) {// TODO check that no other group is default Experimenter e = copyUser( experimenter ); if ( defaultGroup == null || defaultGroup.getId() == null ) { throw new ApiUsageException("Default group may not be null."); } SecureAction action = new SecureAction(){ public <T extends IObject> T updateObject(T obj) { return iUpdate.saveAndReturnObject( obj ); } }; e = getSecuritySystem().doAction(e, action); final GroupExperimenterMap defaultGroupMap = new GroupExperimenterMap(); defaultGroupMap.link( groupProxy(defaultGroup.getId()), userProxy(e.getId())); defaultGroupMap.setDefaultGroupLink(Boolean.TRUE); defaultGroupMap.setDetails( getSecuritySystem().transientDetails( defaultGroupMap )); getSecuritySystem().doAction(defaultGroupMap,action); if ( null != otherGroups ) { for (ExperimenterGroup group : otherGroups) { if ( group == null ) continue; if ( group.getId() == null) { throw new ApiUsageException( "Groups must be previously saved during " + "Experimenter creation."); } GroupExperimenterMap groupMap = new GroupExperimenterMap(); groupMap.link( groupProxy(group.getId()), userProxy(e.getId())); groupMap.setDefaultGroupLink(Boolean.FALSE); groupMap.setDetails( getSecuritySystem().transientDetails( groupMap )); getSecuritySystem().doAction(groupMap, action); } } changeUserPassword(e.getOmeName()," "); return e.getId(); }
| 3,237,586
|
public <T extends IObject> T updateObject(T obj) { return iUpdate.saveAndReturnObject( obj ); }
|
public <T extends IObject> T updateObject(T obj) { return iUpdate.saveAndReturnObject( obj ); }
| 3,237,587
|
public long createGroup(ExperimenterGroup group) { group = copyGroup( group ); ExperimenterGroup g = getSecuritySystem().doAction(group, new SecureAction(){ public <T extends IObject> T updateObject(T obj) { return iUpdate.saveAndReturnObject( obj ); } }); return g.getId(); }
|
public long createGroup(ExperimenterGroup group) { group = copyGroup( group ); ExperimenterGroup g = getSecuritySystem().doAction(group, new SecureAction(){ public <T extends IObject> T updateObject(T obj) { return iUpdate.saveAndReturnObject( obj ); } }); return g.getId(); }
| 3,237,588
|
public <T extends IObject> T updateObject(T obj) { return iUpdate.saveAndReturnObject( obj ); }
|
public <T extends IObject> T updateObject(T obj) { return iUpdate.saveAndReturnObject( obj ); }
| 3,237,589
|
public long createSystemUser(Experimenter newSystemUser) { return createExperimenter( newSystemUser, groupProxy("system"), new ExperimenterGroup[]{ groupProxy("user") } ); }
|
public long createSystemUser(Experimenter newSystemUser) { return createExperimenter( newSystemUser, groupProxy("system"), new ExperimenterGroup[]{ groupProxy("user") } ); }
| 3,237,590
|
public long createUser(Experimenter newUser) { return createExperimenter( newUser, groupProxy("user"),null); }
|
public long createUser(Experimenter newUser) { return createExperimenter( newUser, groupProxy("user"),null); }
| 3,237,591
|
public void deleteExperimenter( Experimenter user ) { Experimenter e = userProxy(user.getId()); int count = jdbc.update("delete from password where experimenter_id = ?", e.getId()); if ( count == 0 ) { getLogger().info("No password found for user " +e.getOmeName() +". Cannot delete."); } iUpdate.deleteObject(e); }
|
public void deleteExperimenter( Experimenter user ) { Experimenter e = userProxy(user.getId()); int count = jdbc.update("delete from password where experimenter_id = ?", e.getId()); if ( count == 0 ) { getLogger().info("No password found for user " +e.getOmeName() +". Cannot delete."); } iUpdate.deleteObject(e); }
| 3,237,592
|
public ExperimenterGroup getDefaultGroup( @NotNull Long experimenterId ) { ExperimenterGroup g = iQuery.findByQuery( "select g from ExperimenterGroup g " + "join fetch g.groupExperimenterMap m " + "join fetch m.child e " + "where e.id = :id " + "and m.defaultGroupLink = true", new Parameters().addId(experimenterId)); if (g==null) { throw new ValidationException( "The user "+experimenterId+" has no default group set."); } return g; }
|
public ExperimenterGroup getDefaultGroup( @NotNull Long experimenterId ) { ExperimenterGroup g = iQuery.findByQuery( "select g from ExperimenterGroup g " + "join fetch g.groupExperimenterMap m " + "join fetch m.child e " + "where e.id = :id " + "and m.defaultGroupLink = true", new Parameters().addId(experimenterId)); if (g==null) { throw new ValidationException( "The user "+experimenterId+" has no default group set."); } return g; }
| 3,237,593
|
public EventContext getEventContext() { return new SimpleEventContext( getSecuritySystem().getEventContext() ); }
|
public EventContext getEventContext() { return new SimpleEventContext( getSecuritySystem().getEventContext() ); }
| 3,237,594
|
public Experimenter getExperimenter(final Long id) { Experimenter e = iQuery.execute( new UserQ( new Parameters( ).addId(id))); if (e == null) { throw new ApiUsageException("No such experimenter: " + id); } return e; }
|
public Experimenter getExperimenter(final Long id) { Experimenter e = iQuery.execute( new UserQ( new Parameters( ).addId(id))); if (e == null) { throw new ApiUsageException("No such experimenter: " + id); } return e; }
| 3,237,595
|
public Experimenter getExperimenter(final Long id) { Experimenter e = iQuery.execute( new UserQ( new Parameters( ).addId(id))); if (e == null) { throw new ApiUsageException("No such experimenter: " + id); } return e; }
|
public Experimenter getExperimenter(final Long id) { Experimenter e = iQuery.execute( new UserQ( new Parameters( ).addId(id))); if (e == null) { throw new ApiUsageException("No such experimenter: " + id); } return e; }
| 3,237,596
|
public ExperimenterGroup getGroup(Long id) { ExperimenterGroup g = iQuery.execute( new GroupQ( new Parameters( ).addId(id))); if (g == null) { throw new ApiUsageException("No such group: " + id); } return g; }
|
public ExperimenterGroup getGroup(Long id) { ExperimenterGroup g = iQuery.execute( new GroupQ( new Parameters( ).addId(id))); if (g == null) { throw new ApiUsageException("No such group: " + id); } return g; }
| 3,237,597
|
public ExperimenterGroup getGroup(Long id) { ExperimenterGroup g = iQuery.execute( new GroupQ( new Parameters( ).addId(id))); if (g == null) { throw new ApiUsageException("No such group: " + id); } return g; }
|
public ExperimenterGroup getGroup(Long id) { ExperimenterGroup g = iQuery.execute( new GroupQ( new Parameters( ).addId(id))); if (g == null) { throw new ApiUsageException("No such group: " + id); } return g; }
| 3,237,598
|
public List<Long> getLeaderOfGroupIds( 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 g.id from ExperimenterGroup g where g.details.owner.id = :id"); q.setParameter("id", e.getId()); return q.list(); } }); return groupIds; }
|
public List<Long> getLeaderOfGroupIds( 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 g.id from ExperimenterGroup g where g.details.owner.id = :id"); q.setParameter("id", e.getId()); return q.list(); } }); return groupIds; }
| 3,237,599
|
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(); }
| 3,237,600
|
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; }
| 3,237,601
|
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(); }
| 3,237,602
|
public Roles getSecurityRoles() { return getSecuritySystem().getSecurityRoles(); }
|
public Roles getSecurityRoles() { return getSecuritySystem().getSecurityRoles(); }
| 3,237,603
|
protected Class<? extends ServiceInterface> getServiceInterface() { return IAdmin.class; }
|
protected Class<? extends ServiceInterface> getServiceInterface() { return IAdmin.class; }
| 3,237,604
|
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; }
|
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; }
| 3,237,605
|
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; }
|
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; }
| 3,237,606
|
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(); }
| 3,237,607
|
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; }
|
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; }
| 3,237,608
|
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; }
|
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; }
| 3,237,609
|
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; }
|
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; }
| 3,237,610
|
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; }
|
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; }
| 3,237,611
|
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; }
|
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; }
| 3,237,612
|
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; }
|
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; }
| 3,237,613
|
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); }
|
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); }
| 3,237,614
|
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); }
|
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); }
| 3,237,615
|
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(); }
|
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(); }
| 3,237,616
|
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(); }
|
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(); }
| 3,237,617
|
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(); }
|
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(); }
| 3,237,618
|
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(); }
|
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(); }
| 3,237,619
|
public <T extends IObject> T updateObject(T obj) { iUpdate.deleteObject( obj ); return null; }
|
public <T extends IObject> T updateObject(T obj) { iUpdate.deleteObject( obj ); return null; }
| 3,237,620
|
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(); }
|
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(); }
| 3,237,621
|
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(); }
|
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(); }
| 3,237,622
|
public final void setExtendedMetadata( ExtendedMetadata extMetadata ) { throwIfAlreadySet(this.em, extMetadata); em = extMetadata; }
|
public final void setExtendedMetadata( ExtendedMetadata extMetadata ) { throwIfAlreadySet(this.em, extMetadata); em = extMetadata; }
| 3,237,623
|
public final void setJdbcTemplate( SimpleJdbcTemplate jdbcTemplate ) { throwIfAlreadySet(this.jdbc, jdbcTemplate); jdbc = jdbcTemplate; }
|
public final void setJdbcTemplate( SimpleJdbcTemplate jdbcTemplate ) { throwIfAlreadySet(this.jdbc, jdbcTemplate); jdbc = jdbcTemplate; }
| 3,237,624
|
public final void setSessionFactory( SessionFactory sessionFactory ) { throwIfAlreadySet(this.sf, sessionFactory); sf = sessionFactory; }
|
public final void setSessionFactory( SessionFactory sessionFactory ) { throwIfAlreadySet(this.sf, sessionFactory); sf = sessionFactory; }
| 3,237,625
|
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; } }
|
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; } }
| 3,237,626
|
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(); } }
|
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(); } }
| 3,237,627
|
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(); } }
|
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(); } }
| 3,237,628
|
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(); } }
|
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(); } }
| 3,237,629
|
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(); } }
|
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(); } }
| 3,237,630
|
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(); } }
|
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(); } }
| 3,237,631
|
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; }
| 3,237,632
|
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)); }
|
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)); }
| 3,237,633
|
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()); }
|
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()); }
| 3,237,634
|
public void newAnnotation(String annotation) { DatasetAnnotation da = annotator.createDatasetAnnotation(annotation); annotationList.add(da); }
|
public void newAnnotation(String annotation) { DatasetAnnotation da = annotator.createDatasetAnnotation(annotation,datasetID); annotationList.add(da); }
| 3,237,635
|
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(); //} } }
|
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(); //} } }
| 3,237,636
|
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(); //} } }
|
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(); //} } }
| 3,237,637
|
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); }
|
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, superClasses, interfaces); }
| 3,237,638
|
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); }
|
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); }
| 3,237,639
|
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(); }
|
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, 1.0f); gradientStartRGB = gradientStartHSV.toColorA(); gradientEndHSV = new HSV(col.getHue(), bottomGradientSaturation, bottomGradientValue, 0.6f); gradientEndRGB = gradientEndHSV.toColorA(); }
| 3,237,640
|
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(); }
|
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, 1.0f); gradientEndRGB = gradientEndHSV.toColorA(); }
| 3,237,641
|
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(); }
|
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(); }
| 3,237,642
|
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(); }
|
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()); } 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(); }
| 3,237,643
|
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(); }
|
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 ((buffer.hasRemaining() && !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(); }
| 3,237,644
|
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(); }
|
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(); }
| 3,237,645
|
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(); }
|
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(); }
| 3,237,647
|
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"); }
|
public void testBeginEnd () throws Exception { String tmpl = "#if (true) #begin pass #end #else #begin fail #end"; assertStringTemplateEquals (tmpl, "pass\n"); tmpl = "#if (true)\n #begin pass\n #end\n #else\n #begin fail\n #end"; assertStringTemplateEquals (tmpl, "pass\n"); }
| 3,237,648
|
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; } }
|
public static IRubyObject rbCatch(IRubyObject recv, IRubyObject tag) { try { context.pushCatch(tag.asSymbol()); return context.yield(tag); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.ThrowJump) { if (je.getPrimaryData().equals(tag.asSymbol())) { return (IRubyObject)je.getSecondaryData(); } } throw je; } }
| 3,237,649
|
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; }
|
public static IRubyObject rbThrow(IRubyObject recv, IRubyObject[] args) { IRuby runtime = recv.getRuntime(); 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; }
| 3,237,651
|
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; }
|
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; }
| 3,237,652
|
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(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; }
| 3,237,653
|
public org.openmicroscopy.omero.model.Experimenter getExperimenter() { return this.experimenter; }
|
public Experimenter getExperimenter() { return this.experimenter; }
| 3,237,654
|
public org.openmicroscopy.omero.model.Group getGroup() { return this.group; }
|
public Group getGroup() { return this.group; }
| 3,237,655
|
public void setExperimenter(org.openmicroscopy.omero.model.Experimenter experimenter) { this.experimenter = experimenter; }
|
public void setExperimenter(Experimenter experimenter) { this.experimenter = experimenter; }
| 3,237,656
|
public void setGroup(org.openmicroscopy.omero.model.Group group) { this.group = group; }
|
public void setGroup(Group group) { this.group = group; }
| 3,237,657
|
public void setLocked(boolean locked) { this.locked = locked; }
|
public void setLocked(Boolean locked) { this.locked = locked; }
| 3,237,658
|
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; }
|
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)) { int size = 0; if(args != null) size = args.size(); throw new RubyArgumentException(ruby, "wrong # of arguments(" + 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; }
| 3,237,659
|
private void attachListeners() { model.addChangeListener(this); view.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); }
|
private void attachListeners() { model.addChangeListener(this); view.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); }
| 3,237,660
|
private void createActions() { 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)); }
| 3,237,661
|
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; }
|
private FileChannel getFileChannel(Boolean readOnly) throws FileNotFoundException { if (readOnly == true) { if (roChannel == null) { FileInputStream stream = new FileInputStream(path); roChannel = stream.getChannel(); return roChannel; } else return roChannel; } if (woChannel != null) return woChannel; FileInputStream stream = new FileInputStream(path); woChannel = stream.getChannel(); return woChannel; }
| 3,237,662
|
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; }
|
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; FileOutputStream stream = new FileOutputStream(path); woChannel = stream.getChannel(); return woChannel; }
| 3,237,663
|
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); }
|
public MappedByteBuffer getPlane(Integer z, Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException { Long offset = getPlaneOffset(z, c, t); Integer size = getPlaneSize(); byte[] nullPlane = PixelsService.nullPlane; for (int i = 0; i < PixelsService.NULL_PLANE_SIZE; i++) if (region.get(i) != nullPlane[i]) return region; return null; }
| 3,237,664
|
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); }
|
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, offset, size); }
| 3,237,665
|
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 }
|
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 }
| 3,237,666
|
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 }
|
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 }
| 3,237,667
|
boolean NIL_P(VALUE value) { return value == Qnil; }
|
boolean NIL_P(VALUE value) { return value == Qnil; }
| 3,237,668
|
boolean RTEST(VALUE value) { return value != Qnil; }
|
boolean RTEST(VALUE value) { return value != Qnil; }
| 3,237,669
|
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; }
|
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*/ ruby.getNil()); 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; }
| 3,237,670
|
private void dyna_pop(RVarmap vars) { lvtbl.dlev--; ruby_dyna_vars = vars; }
|
private void dyna_pop(RVarmap vars) { lvtbl.dlev--; ruby_dyna_vars = vars; }
| 3,237,671
|
private void dyna_pop(RVarmap vars) { lvtbl.dlev--; ruby_dyna_vars = vars; }
|
private void dyna_pop(RVarmap vars) { lvtbl.dlev--; ruby.getInterpreter().setDynamicVars(vars); }
| 3,237,672
|
private RVarmap dyna_push() { RVarmap vars = ruby_dyna_vars; rb_dvar_push(null, null); lvtbl.dlev++; return vars; }
|
private RVarmap dyna_push() { RVarmap vars = ruby_dyna_vars; rb_dvar_push(null, null); lvtbl.dlev++; return vars; }
| 3,237,673
|
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); }
|
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); }
| 3,237,674
|
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 RVarmap new_dvar(ID id, VALUE value, RVarmap prev) { RVarmap map = new RVarmap(); map.id = id; map.val = value; map.next = prev; return map; }
| 3,237,675
|
VALUE rb_backref_get() { if (ruby.rubyScope.getLocalVars() != null) { return ruby.rubyScope.getLocalVars(1); } return Qnil; }
|
VALUE rb_backref_get() { if (ruby.rubyScope.getLocalVars() != null) { return ruby.rubyScope.getLocalVars(1); } return ruby.getNil(); }
| 3,237,676
|
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; }
|
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; }
| 3,237,677
|
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; }
|
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; }
| 3,237,678
|
void rb_dvar_push(ID id, VALUE value) { ruby_dyna_vars = new_dvar(id, value, ruby_dyna_vars); }
|
void rb_dvar_push(ID id, VALUE value) { ruby.getInterpreter().getDynamicVars().push((RubyId)id, (RubyObject)value); }
| 3,237,679
|
VALUE rb_lastline_get() { if (ruby.rubyScope.getLocalVars() != null) { return ruby.rubyScope.getLocalVars(0); } return Qnil; }
|
VALUE rb_lastline_get() { if (ruby.rubyScope.getLocalVars() != null) { return ruby.rubyScope.getLocalVars(0); } return ruby.getNil(); }
| 3,237,680
|
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; }
|
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.getInterpreter().getDynamicVars() != null) lvtbl.dlev = 1; else lvtbl.dlev = 0; }
| 3,237,681
|
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()); } }
|
public void testDuplicateImages() { 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()); } }
| 3,237,682
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.