rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
List list = block.getScriptList(); int size = list.size(); if ( size > 0 ) { Script script = (Script) list.get(0); if ( script instanceof TextScript ) { TextScript textScript = (TextScript) script; textScript.trimStartWhitespace(); } if ( size > 1 ) { script = (Script) list.get(size - 1); if ( script instanceof TextScr... | block.trimWhitespace(); | protected void trimBody() { synchronized(body) { // #### should refactor this code into // #### trimWhitespace() methods on the Script objects if ( body instanceof CompositeTextScriptBlock ) { CompositeTextScriptBlock block = (CompositeTextScriptBlock) body; ... |
List list = block.getScriptList(); for ( int i = list.size() - 1; i >= 0; i-- ) { Script script = (Script) list.get(i); if ( script instanceof TextScript ) { TextScript textScript = (TextScript) script; String text = textScript.getText(); text = text.trim(); if ( text.length() == 0 ) { list.remove(i); } else { textScri... | block.trimWhitespace(); | protected void trimBody() { synchronized(body) { // #### should refactor this code into // #### trimWhitespace() methods on the Script objects if ( body instanceof CompositeTextScriptBlock ) { CompositeTextScriptBlock block = (CompositeTextScriptBlock) body; ... |
if (dc.equalsIgnoreCase(s)){ | if (!dc.equalsIgnoreCase(s)){ | public void parseHapMap(Vector rawLines) throws PedFileException { int colNum = -1; int numLines = rawLines.size(); Individual ind; this.order = new Vector(); //sort first Vector lines = new Vector(); Hashtable sortHelp = new Hashtable(numLines-1,1.0f); long[]... |
if (compoundDepth == 0) throw new IllegalStateException("Not in a compound edit"); compoundDepth--; if (compoundDepth == 0) { log.add(currentCompoundLog); currentCompoundLog = null; } | public void compoundEditEnd(UndoCompoundEvent e) { if (compoundDepth == 0) throw new IllegalStateException("Not in a compound edit"); compoundDepth--; if (compoundDepth == 0) { log.add(currentCompoundLog); currentCompoundLog = null; } ... | |
compoundDepth++; if (compoundDepth == 1) { currentCompoundLog = new ArrayList(); } | public void compoundEditStart(UndoCompoundEvent e) { compoundDepth++; if (compoundDepth == 1) { currentCompoundLog = new ArrayList(); } } | |
log.add(e); | addToLog(LogItemType.INSERT, e); | public void dbChildrenInserted(SQLObjectEvent e) { log.add(e); } |
log.add(e); | addToLog(LogItemType.REMOVE, e); | public void dbChildrenRemoved(SQLObjectEvent e) { log.add(e); } |
log.add(e); | addToLog(LogItemType.CHANGE, e); | public void dbObjectChanged(SQLObjectEvent e) { log.add(e); } |
log.add(e); | throw new UnsupportedOperationException("Structure changes are not undoable"); | public void dbStructureChanged(SQLObjectEvent e) { log.add(e); } |
public List<Map<String,Object>> makeTableSnapshot(SQLTable t) { return null; | public TableSnapshot makeTableSnapshot(SQLTable t) throws Exception { return new TableSnapshot(t); | public List<Map<String,Object>> makeTableSnapshot(SQLTable t) { return null; //TODO: finish method } |
public void testChangeFifthColumnKey() throws ArchitectException{ | public void testChangeFifthColumnKey() throws Exception { EventLogger l = new EventLogger(); | public void testChangeFifthColumnKey() throws ArchitectException{ SQLColumn col5 = table.getColumnByName("five"); assertNotNull(col5); col5.setPrimaryKeySeq(0); assertEquals(4, table.getPkSize()); assertEquals(0, table.getColumnIndex(table.getColumnByName("one"))); ... |
col5.setPrimaryKeySeq(0); | TableSnapshot original = l.makeTableSnapshot(table); ArchitectUtils.listenToHierarchy(l, table); col5.setPrimaryKeySeq(0); ArchitectUtils.unlistenToHierarchy(l, table); System.out.println("Event log:\n"+l); TableSnapshot afterChange = l.makeTableSnapshot(table); | public void testChangeFifthColumnKey() throws ArchitectException{ SQLColumn col5 = table.getColumnByName("five"); assertNotNull(col5); col5.setPrimaryKeySeq(0); assertEquals(4, table.getPkSize()); assertEquals(0, table.getColumnIndex(table.getColumnByName("one"))); ... |
assertEquals(5, table.getColumnIndex(table.getColumnByName("six"))); | assertEquals(5, table.getColumnIndex(table.getColumnByName("six"))); System.out.println("Original: "+original); System.out.println("After: "+afterChange); l.rollBack(afterChange); assertEquals(original.toString(), afterChange.toString()); | public void testChangeFifthColumnKey() throws ArchitectException{ SQLColumn col5 = table.getColumnByName("five"); assertNotNull(col5); col5.setPrimaryKeySeq(0); assertEquals(4, table.getPkSize()); assertEquals(0, table.getColumnIndex(table.getColumnByName("one"))); ... |
int size = list.getLength(); for (int i = 0; i < size; i++) { String attributeName = list.getLocalName(i); String attributeValue = list.getValue(i); Expression expression = taglib.createExpression( getExpressionFactory(), localName, attributeName, attributeValue); if (expression == null) { expression = createConstantEx... | if ( script != null ) { int size = list.getLength(); for (int i = 0; i < size; i++) { String attributeName = list.getLocalName(i); String attributeValue = list.getValue(i); Expression expression = taglib.createExpression( getExpressionFactory(), localName, attributeName, attributeValue); if (expression == null) { expr... | protected TagScript createTag( String namespaceURI, String localName, Attributes list) throws SAXException { try { // use the URI to load a taglib TagLibrary taglib = context.getTagLibrary(namespaceURI); if (taglib == null) { if (nam... |
script.addAttribute(attributeName, expression); | protected TagScript createTag( String namespaceURI, String localName, Attributes list) throws SAXException { try { // use the URI to load a taglib TagLibrary taglib = context.getTagLibrary(namespaceURI); if (taglib == null) { if (nam... | |
boolean[] killMe = new boolean[indList.size()]; Arrays.fill(killMe, false); | public Vector check() throws PedFileException{ //before we perform the check we want to prune out individuals with too much missing data //or trios which contain individuals with too much missing data Vector indList = getOrder(); Individual currentInd; Family currentFamily; ... | |
if(currentInd.getIsTyped()){ if(currentFamily.getNumMembers() == 1){ double numMissing = 0; int numMarkers = currentInd.getNumMarkers(); for (int i = 0; i < numMarkers; i++){ byte[] thisMarker = currentInd.getMarker(i); if (thisMarker[0] == 0 || thisMarker[1] == 0){ numMissing++; } } if (numMissing/numMarkers > Option... | double numMissing = 0; int numMarkers = currentInd.getNumMarkers(); for (int i = 0; i < numMarkers; i++){ byte[] thisMarker = currentInd.getMarker(i); if (thisMarker[0] == 0 || thisMarker[1] == 0){ numMissing++; } } if (numMissing/numMarkers > Options.getMissingThreshold()){ order.removeElement(currentInd); axedPeopl... | public Vector check() throws PedFileException{ //before we perform the check we want to prune out individuals with too much missing data //or trios which contain individuals with too much missing data Vector indList = getOrder(); Individual currentInd; Family currentFamily; ... |
if (momMissing/numMarkers > Options.getMissingThreshold() || dadMissing/numMarkers > Options.getMissingThreshold()){ killMe[x] = true; | }else{ String spouseID = ""; Enumeration peopleinFam = currentFamily.getMemberList(); while (peopleinFam.hasMoreElements()){ Individual nextMember = currentFamily.getMember((String)peopleinFam.nextElement()); if (nextMember.getDadID().equals(currentInd.getIndividualID())) spouseID = nextMember.getMomID(); if (nextMemb... | public Vector check() throws PedFileException{ //before we perform the check we want to prune out individuals with too much missing data //or trios which contain individuals with too much missing data Vector indList = getOrder(); Individual currentInd; Family currentFamily; ... |
} } for (int x = 0; x < killMe.length; x++){ if (killMe[x]){ currentInd = (Individual)indList.elementAt(x); currentFamily = getFamily(currentInd.getFamilyID()); order.removeElement(currentInd); axedPeople.add(currentInd.getIndividualID()); | public Vector check() throws PedFileException{ //before we perform the check we want to prune out individuals with too much missing data //or trios which contain individuals with too much missing data Vector indList = getOrder(); Individual currentInd; Family currentFamily; ... | |
Enumeration peopleinFam = currentFamily.getMemberList(); while (peopleinFam.hasMoreElements()){ String p = (String)peopleinFam.nextElement(); Individual thisPerson = currentFamily.getMember(p); if (thisPerson.getMomID().equals(currentInd.getIndividualID()) || thisPerson.getDadID().equals(currentInd.getIndividualID())... | public Vector check() throws PedFileException{ //before we perform the check we want to prune out individuals with too much missing data //or trios which contain individuals with too much missing data Vector indList = getOrder(); Individual currentInd; Family currentFamily; ... | |
} } } indList = getOrder(); for (int x = 0; x < indList.size(); x++){ currentInd = (Individual)indList.elementAt(x); currentFamily = getFamily(currentInd.getFamilyID()); Enumeration peopleinFam = currentFamily.getMemberList(); while (peopleinFam.hasMoreElements()){ Individual nextMember = currentFamily.getMember((Stri... | public Vector check() throws PedFileException{ //before we perform the check we want to prune out individuals with too much missing data //or trios which contain individuals with too much missing data Vector indList = getOrder(); Individual currentInd; Family currentFamily; ... | |
ind.setIsTyped(true); | public void parseHapMap(Vector rawLines) throws PedFileException { int colNum = -1; int numLines = rawLines.size(); Individual ind; this.order = new Vector(); //sort first Vector lines = new Vector(); Hashtable sortHelp = new Hashtable(numLines-1,1.0f); long[]... | |
boolean isTyped = false; | public void parseLinkage(Vector pedigrees) throws PedFileException { int colNum = -1; boolean withOptionalColumn = false; int numLines = pedigrees.size(); Individual ind; this.order = new Vector(); for(int k=0; k<numLines; k++){ StringTokenizer tokenizer = new St... | |
if ( !( (allele1==0) && (allele2 == 0) ) ) isTyped = true; | public void parseLinkage(Vector pedigrees) throws PedFileException { int colNum = -1; boolean withOptionalColumn = false; int numLines = pedigrees.size(); Individual ind; this.order = new Vector(); for(int k=0; k<numLines; k++){ StringTokenizer tokenizer = new St... | |
ind.setIsTyped(isTyped); | public void parseLinkage(Vector pedigrees) throws PedFileException { int colNum = -1; boolean withOptionalColumn = false; int numLines = pedigrees.size(); Individual ind; this.order = new Vector(); for(int k=0; k<numLines; k++){ StringTokenizer tokenizer = new St... | |
public Tag createTag() throws Exception { | public Tag createTag(String name, Attributes attributes) throws Exception { | public TagScript createTagScript(String name, Attributes attributes) throws Exception { TagScript answer = super.createTagScript(name, attributes); if ( answer == null ) { final Factory factory = getFactory( name ); if ( factory != null ) { return new TagScript( ... |
return ((TagFactory) factory).createTag(); | return ((TagFactory) factory).createTag(name, attributes); | public TagScript createTagScript(String name, Attributes attributes) throws Exception { TagScript answer = super.createTagScript(name, attributes); if ( answer == null ) { final Factory factory = getFactory( name ); if ( factory != null ) { return new TagScript( ... |
public Tag createTag() throws Exception { | public Tag createTag(String name, Attributes attributes) throws Exception { | public Tag createTag() throws Exception { if ( factory instanceof TagFactory ) { return ((TagFactory) factory).createTag(); } else { return new ComponentTag(factory); } ... |
return ((TagFactory) factory).createTag(); | return ((TagFactory) factory).createTag(name, attributes); | public Tag createTag() throws Exception { if ( factory instanceof TagFactory ) { return ((TagFactory) factory).createTag(); } else { return new ComponentTag(factory); } ... |
String text = getBodyText(); Object[] args = { text }; | Object[] args = { body }; | public void doTag(XMLOutput output) throws Exception { Project project = getAntProject(); String tagName = getTagName(); Object parentObject = findBeanAncestor(); // lets assume that Task instances are not nested inside other Task instances // for example <manifest> inside a <jar>... |
} | log.error("Caught exception while closing statement: " + e, e); } | public void doTag(XMLOutput output) throws Exception { if (!maxRowsSpecified) { Object obj = context.getVariable("org.apache.commons.jelly.sql.maxRows"); if (obj != null) { if (obj instanceof Integer) { maxRows = ((Integer) obj).intValue(); ... |
} | log.error("Caught exception while closing result set: " + e, e); } | public void doTag(XMLOutput output) throws Exception { if (!maxRowsSpecified) { Object obj = context.getVariable("org.apache.commons.jelly.sql.maxRows"); if (obj != null) { if (obj instanceof Integer) { maxRows = ((Integer) obj).intValue(); ... |
} | log.error("Caught exception while closing connection: " + e, e); } | public void doTag(XMLOutput output) throws Exception { if (!maxRowsSpecified) { Object obj = context.getVariable("org.apache.commons.jelly.sql.maxRows"); if (obj != null) { if (obj instanceof Integer) { maxRows = ((Integer) obj).intValue(); ... |
throw new JellyTagException( "this tag must be nested within a <tr> tag" ); | throw new JellyTagException( "this tag must be nested within a <borderLayout> tag" ); | public void addChild(Component component, Object constraints) throws JellyTagException { BorderLayoutTag tag = (BorderLayoutTag) findAncestorWithClass( BorderLayoutTag.class ); if (tag == null) { throw new JellyTagException( "this tag must be nested within a <tr> tag" ); } tag... |
for (int j = i+1; j < dPrime.getLength(i); j++){ | for (int j = i+1; j < i + dPrime.getLength(i); j++){ | static Vector doSpine(DPrimeTable dPrime){ // find blocks by searching for stretches between two markers A,B where // D prime is > a threshold for all informative combinations of A, (A+1...B) int baddies; int verticalExtent=0; int horizontalExtent=0; Vector blocks = new Ve... |
setPropertyValue( target, property, value ); | setPropertyValue( target, property, answer ); | public void doTag(XMLOutput output) throws Exception { Object answer = null; if ( value != null ) { answer = value.evaluate(context); } else { answer = getBodyText(); } if ( var != null ) { context.setVariable(var, answer); } ... |
if ( target instanceof Map ) { Map map = (Map) target; map.put( property, value ); | try { if ( target instanceof Map ) { Map map = (Map) target; map.put( property, value ); } else { BeanUtils.setProperty( target, property, value ); } | protected void setPropertyValue( Object target, String property, Object value ) throws Exception { if ( target instanceof Map ) { Map map = (Map) target; map.put( property, value ); } else { BeanUtils.setProperty( target, property, value ); } } |
else { BeanUtils.setProperty( target, property, value ); | catch (Exception e) { log.error( "Failed to set the property: " + property + " on bean: " + target + " to value: " + value + " due to exception: " + e, e ); | protected void setPropertyValue( Object target, String property, Object value ) throws Exception { if ( target instanceof Map ) { Map map = (Map) target; map.put( property, value ); } else { BeanUtils.setProperty( target, property, value ); } } |
public void addColumn(SQLColumn c, SQLTable t) throws ArchitectDiffException { | public void addColumn(SQLColumn c) { | public void addColumn(SQLColumn c, SQLTable t) throws ArchitectDiffException { Map colNameMap = new HashMap(); print("\n ALTER TABLE "); print( toQualifiedName(t) ); print(" ADD COLUMN "); print(columnDefinition(c,colNameMap)); endStatement(DDLStatement.StatementType.CREATE, c); } |
print( toQualifiedName(t) ); | print(toQualifiedName(c.getParentTable())); | public void addColumn(SQLColumn c, SQLTable t) throws ArchitectDiffException { Map colNameMap = new HashMap(); print("\n ALTER TABLE "); print( toQualifiedName(t) ); print(" ADD COLUMN "); print(columnDefinition(c,colNameMap)); endStatement(DDLStatement.StatementType.CREATE, c); } |
public void addPrimaryKey(SQLTable t, String primaryKeyName) throws ArchitectException { | public void addPrimaryKey(SQLTable t) throws ArchitectException { | public void addPrimaryKey(SQLTable t, String primaryKeyName) throws ArchitectException { Map colNameMap = new HashMap(); StringBuffer sqlStatement = new StringBuffer(); boolean first = true; sqlStatement.append("ALTER TABLE "+ toQualifiedName(t.getCatalogName(),t.getSchemaName(),t.getName()) + " ADD PRIMARY K... |
sqlStatement.append("ALTER TABLE "+ toQualifiedName(t.getCatalogName(),t.getSchemaName(),t.getName()) | sqlStatement.append("ALTER TABLE "+ toQualifiedName(t.getName()) | public void addPrimaryKey(SQLTable t, String primaryKeyName) throws ArchitectException { Map colNameMap = new HashMap(); StringBuffer sqlStatement = new StringBuffer(); boolean first = true; sqlStatement.append("ALTER TABLE "+ toQualifiedName(t.getCatalogName(),t.getSchemaName(),t.getName()) + " ADD PRIMARY K... |
public void addRelationship(SQLRelationship r) throws ArchitectDiffException { | public void addRelationship(SQLRelationship r) { | public void addRelationship(SQLRelationship r) throws ArchitectDiffException { print("\n ALTER TABLE "); print( toQualifiedName(r.getFkTable()) ); print(" ADD CONSTRAINT "); print(r.getName()); print(" FOREIGN KEY ( "); Map<String, SQLColumn> colNameMap = new HashMap<String, SQLColumn> (); boolean firstCol... |
protected String columnDefinition(SQLColumn c, Map colNameMap) throws ArchitectDiffException { | protected String columnDefinition(SQLColumn c, Map colNameMap) { | protected String columnDefinition(SQLColumn c, Map colNameMap) throws ArchitectDiffException { StringBuffer def = new StringBuffer(); // Column name def.append(createPhysicalName(colNameMap, c)); def.append(" "); def.append(columnType(c)); def.append(" "); // Column nul... |
public void dropColumn(SQLColumn c, SQLTable t) throws ArchitectDiffException { | public void dropColumn(SQLColumn c) { | public void dropColumn(SQLColumn c, SQLTable t) throws ArchitectDiffException { Map colNameMap = new HashMap(); print("\n ALTER TABLE "); print( toQualifiedName(t) ); print(" DROP COLUMN "); print(createPhysicalName(colNameMap,c)); endStatement(DDLStatement.StatementType.DROP, c); } |
print( toQualifiedName(t) ); | print(toQualifiedName(c.getParentTable())); | public void dropColumn(SQLColumn c, SQLTable t) throws ArchitectDiffException { Map colNameMap = new HashMap(); print("\n ALTER TABLE "); print( toQualifiedName(t) ); print(" DROP COLUMN "); print(createPhysicalName(colNameMap,c)); endStatement(DDLStatement.StatementType.DROP, c); } |
public void dropPrimaryKey(SQLTable t, String primaryKeyName) { | public void dropPrimaryKey(SQLTable t) { | public void dropPrimaryKey(SQLTable t, String primaryKeyName) { print("ALTER TABLE " + toQualifiedName(t.getCatalogName(),t.getSchemaName(),t.getName()) + " DROP PRIMARY KEY " + primaryKeyName); endStatement(DDLStatement.StatementType.DROP,t); } |
print("ALTER TABLE " + toQualifiedName(t.getCatalogName(),t.getSchemaName(),t.getName()) + " DROP PRIMARY KEY " + primaryKeyName); endStatement(DDLStatement.StatementType.DROP,t); | print("ALTER TABLE " + toQualifiedName(t.getName()) + " DROP PRIMARY KEY " + t.getPrimaryKeyName()); endStatement(DDLStatement.StatementType.DROP, t); | public void dropPrimaryKey(SQLTable t, String primaryKeyName) { print("ALTER TABLE " + toQualifiedName(t.getCatalogName(),t.getSchemaName(),t.getName()) + " DROP PRIMARY KEY " + primaryKeyName); endStatement(DDLStatement.StatementType.DROP,t); } |
print(makeDropTableSQL(t.getCatalogName(), t.getSchemaName(), t.getName())); | print(makeDropTableSQL(t.getName())); | public void dropTable(SQLTable t) { print(makeDropTableSQL(t.getCatalogName(), t.getSchemaName(), t.getName())); endStatement(DDLStatement.StatementType.DROP, t); } |
public List generateDDLStatements(SQLDatabase source) throws SQLException, ArchitectException { | public List<DDLStatement> generateDDLStatements(SQLDatabase source) throws SQLException, ArchitectException { | public List generateDDLStatements(SQLDatabase source) throws SQLException, ArchitectException { warnings = new ArrayList(); ddlStatements = new ArrayList(); ddl = new StringBuffer(500); topLevelNames = new HashMap(); // for tracking dup table/relationship names try { if (allowConnection) { con = source.getC... |
ddlStatements = new ArrayList(); | ddlStatements = new ArrayList<DDLStatement>(); | public List generateDDLStatements(SQLDatabase source) throws SQLException, ArchitectException { warnings = new ArrayList(); ddlStatements = new ArrayList(); ddl = new StringBuffer(500); topLevelNames = new HashMap(); // for tracking dup table/relationship names try { if (allowConnection) { con = source.getC... |
public String makeDropForeignKeySQL(String fkCatalog, String fkSchema, String fkTable, String fkName) { | public String makeDropForeignKeySQL(String fkTable, String fkName) { | public String makeDropForeignKeySQL(String fkCatalog, String fkSchema, String fkTable, String fkName) { return "ALTER TABLE " +toQualifiedName(fkCatalog, fkSchema, fkTable) +" DROP FOREIGN KEY " +fkName; } |
+toQualifiedName(fkCatalog, fkSchema, fkTable) | +toQualifiedName(fkTable) | public String makeDropForeignKeySQL(String fkCatalog, String fkSchema, String fkTable, String fkName) { return "ALTER TABLE " +toQualifiedName(fkCatalog, fkSchema, fkTable) +" DROP FOREIGN KEY " +fkName; } |
public String makeDropTableSQL(String catalog, String schema, String table) { return "DROP TABLE "+toQualifiedName(catalog, schema, table); | public String makeDropTableSQL(String table) { return "DROP TABLE "+toQualifiedName(table); | public String makeDropTableSQL(String catalog, String schema, String table) { return "DROP TABLE "+toQualifiedName(catalog, schema, table); } |
public void modifyColumn(SQLColumn c) throws ArchitectDiffException { | public void modifyColumn(SQLColumn c) { | public void modifyColumn(SQLColumn c) throws ArchitectDiffException { Map colNameMap = new HashMap(); SQLTable t = c.getParentTable(); print("\n ALTER TABLE "); print( toQualifiedName(t) ); print(" ALTER COLUMN "); print(columnDefinition(c,colNameMap)); endStatement(DDLStatement.StatementType.MODIFY, c); } |
String catalog = getTargetCatalog(); if ( catalog == null ) catalog = t.getCatalogName(); String schema = getTargetSchema(); if ( schema == null ) schema = t.getSchemaName(); return DDLUtils.toQualifiedName(catalog,schema,t.getPhysicalName()); | return toQualifiedName(t.getPhysicalName()); | public String toQualifiedName(SQLTable t) { String catalog = getTargetCatalog(); if ( catalog == null ) catalog = t.getCatalogName(); String schema = getTargetSchema(); if ( schema == null ) schema = t.getSchemaName(); return DDLUtils.toQualifiedName(catalog,schema,t.getPhysicalName()); } |
append(pkCols, cmap.getPkColumn().getPhysicalName()); append(fkCols, cmap.getFkColumn().getPhysicalName()); | pkCols.append(cmap.getPkColumn().getPhysicalName()); fkCols.append(cmap.getFkColumn().getPhysicalName()); | protected void writeExportedRelationships(SQLTable t) throws ArchitectException { Iterator it = t.getExportedKeys().iterator(); while (it.hasNext()) { SQLRelationship rel = (SQLRelationship) it.next(); // geneate a physical name for this relationship createPhysicalName(topLevelNames,rel); // println(""); ... |
Implementation odmg = ODMG.getODMGImplementation(); Database db = ODMG.getODMGDatabase(); | public void delete() { Implementation odmg = ODMG.getODMGImplementation(); Database db = ODMG.getODMGDatabase(); ODMGXAWrapper txw = new ODMGXAWrapper(); db.deletePersistent( this ); if ( imageFile != null && !imageFile.delete() ) { log.error( "File " + imageFile.getAbsolutePath() + " could not be delet... | |
if ( imageFile != null && !imageFile.delete() ) { log.error( "File " + imageFile.getAbsolutePath() + " could not be deleted" ); | if ( !(volume instanceof ExternalVolume) ) { if ( imageFile != null && !imageFile.delete() ) { log.error( "File " + imageFile.getAbsolutePath() + " could not be deleted" ); } | public void delete() { Implementation odmg = ODMG.getODMGImplementation(); Database db = ODMG.getODMGDatabase(); ODMGXAWrapper txw = new ODMGXAWrapper(); db.deletePersistent( this ); if ( imageFile != null && !imageFile.delete() ) { log.error( "File " + imageFile.getAbsolutePath() + " could not be delet... |
return checkTime; | return checkTime != null ? (java.util.Date) checkTime.clone() : null; | public java.util.Date getCheckTime() { ODMGXAWrapper txw = new ODMGXAWrapper(); txw.lock( this, Transaction.READ ); txw.commit(); return checkTime; } |
return (byte[]) hash.clone(); | return (hash != null) ? (byte[]) hash.clone() : null; | public byte[] getHash() { if ( hash == null && imageFile != null ) { calcHash(); } return (byte[]) hash.clone(); } |
reader.setInput( iis, true ); width = reader.getWidth( 0 ); height = reader.getHeight( 0 ); iis.close(); | if ( iis != null ) { reader.setInput( iis, true ); width = reader.getWidth( 0 ); height = reader.getHeight( 0 ); iis.close(); } | protected void readImageFile() throws IOException { // Find the JPEG image reader // TODO: THis shoud decode also other readers from fname Iterator readers = ImageIO.getImageReadersByFormatName("jpg"); ImageReader reader = (ImageReader)readers.next(); ImageInputStream iis = ImageIO.createImageInputStream( imageFile... |
if(context.isRefreshRequest()){ return output.toString(); } | public String draw(DashboardContext context) { StringBuffer output = new StringBuffer(); output.append(component.draw(context)); // append script final String dashboardId = context.getDashboardConfig().getDashboardId(); String appId = context.getWebContext().getApplicationConfig()... | |
modified(); | public void addPhoto( PhotoInfo photo ) { if ( photos == null ) { photos = new Vector(); } ODMGXAWrapper txw = new ODMGXAWrapper(); txw.lock( this, Transaction.WRITE ); photo.addedToFolder( this ); photos.add( photo ); txw.commit(); } | |
modified(); | public void removePhoto( PhotoInfo photo ) { if ( photos == null ) { return; } ODMGXAWrapper txw = new ODMGXAWrapper(); txw.lock( this, Transaction.WRITE ); photo.removedFromFolder( this ); photos.remove( photo ); txw.commit(); } | |
return (String) this.context.getVariable(name); | Object value = this.context.getVariable(name); if (value == null) { return null; } else { return value.toString(); } | public String getProperty(String name) { if (name == null) { return null; } return (String) this.context.getVariable(name); } |
log.warn( "Checking bounds" ); | log.debug( "Checking bounds" ); | protected Rectangle getPhotoBounds( int photoNum ) { if ( photoNum < photoCollection.getPhotoCount() ) { PhotoInfo photoCandidate = photoCollection.getPhoto( photoNum ); log.warn( "Checking bounds" ); // Check whether the click was inside the thumbnail or not int w... |
Thumbnail thumb = photoCandidate.getThumbnail(); | Thumbnail thumb = null; if ( photoCandidate.hasThumbnail() ) { thumb = photoCandidate.getThumbnail(); } | protected Rectangle getPhotoBounds( int photoNum ) { if ( photoNum < photoCollection.getPhotoCount() ) { PhotoInfo photoCandidate = photoCollection.getPhoto( photoNum ); log.warn( "Checking bounds" ); // Check whether the click was inside the thumbnail or not int w... |
log.debug( "Thumbnail request submitted" ); | private void paintThumbnail( Graphics2D g2, PhotoInfo photo, int startx, int starty, boolean isSelected ) { // Current position in which attributes can be drawn int ypos = starty + rowHeight/2; if ( photo != null ) { Thumbnail thumbnail = null; if ( photo.hasThumbnail() ) { thumbnail =... | |
log.debug( "request submitted" ); | public void thumbnailCreated( PhotoInfo photo ) { repaintPhoto( photo ); Container parent = getParent(); Rectangle viewRect = null; if ( parent instanceof JViewport ) { viewRect = ((JViewport)parent).getViewRect(); } PhotoInfo nextPhoto = null; // Walk through all phoso until we find a photo that is visible //... | |
invokeBody(output); | ChooseTag tag = (ChooseTag) findAncestorWithClass( ChooseTag.class ); if ( tag == null ) { throw new JellyException( "This tag must be enclosed inside a <choose> tag" ); } if ( ! tag.isBlockEvaluated() ) { tag.setBlockEvaluated(true); invokeBody(output); } | public void doTag(XMLOutput output) throws Exception { invokeBody(output); } |
int numMarkers = Chromosome.getSize(); | int numMarkers = Chromosome.getFilteredSize(); | public static Vector calcCCTDT(Vector chromosomes){ Vector results = new Vector(); int numMarkers = Chromosome.getSize(); for (int i = 0; i < numMarkers; i++){ TDTResult thisResult = new TDTResult(Chromosome.getMarker(i)); for (int j = 0; j < chromosomes.size()-1; j++){ ... |
thisResult.tallyCCInd(theChrom.getGenotype(i), nextChrom.getGenotype(i), 0); | thisResult.tallyCCInd(theChrom.getFilteredGenotype(i), nextChrom.getFilteredGenotype(i), 0); | public static Vector calcCCTDT(Vector chromosomes){ Vector results = new Vector(); int numMarkers = Chromosome.getSize(); for (int i = 0; i < numMarkers; i++){ TDTResult thisResult = new TDTResult(Chromosome.getMarker(i)); for (int j = 0; j < chromosomes.size()-1; j++){ ... |
thisResult.tallyCCInd(theChrom.getGenotype(i), nextChrom.getGenotype(i), 1); | thisResult.tallyCCInd(theChrom.getFilteredGenotype(i), nextChrom.getFilteredGenotype(i), 1); | public static Vector calcCCTDT(Vector chromosomes){ Vector results = new Vector(); int numMarkers = Chromosome.getSize(); for (int i = 0; i < numMarkers; i++){ TDTResult thisResult = new TDTResult(Chromosome.getMarker(i)); for (int j = 0; j < chromosomes.size()-1; j++){ ... |
int numMarkers = Chromosome.getSize(); | int numMarkers = Chromosome.getFilteredSize(); | public static Vector calcTrioTDT(Vector chromosomes) { Vector results = new Vector(); int numMarkers = Chromosome.getSize(); for(int k=0;k<numMarkers;k++){ results.add(new TDTResult(Chromosome.getMarker(k))); } for(int i=0;i<chromosomes.size()-3;i++){ Chromos... |
byte allele1T = chrom1T.getGenotype(j); byte allele1U = chrom1U.getGenotype(j); byte allele2T = chrom2T.getGenotype(j); byte allele2U = chrom2U.getGenotype(j); | byte allele1T = chrom1T.getFilteredGenotype(j); byte allele1U = chrom1U.getFilteredGenotype(j); byte allele2T = chrom2T.getFilteredGenotype(j); byte allele2U = chrom2U.getFilteredGenotype(j); | public static Vector calcTrioTDT(Vector chromosomes) { Vector results = new Vector(); int numMarkers = Chromosome.getSize(); for(int k=0;k<numMarkers;k++){ results.add(new TDTResult(Chromosome.getMarker(k))); } for(int i=0;i<chromosomes.size()-3;i++){ Chromos... |
log.info("Adding resource and not found handlers to context:" + currContext.getContextPath()); | public void doTag(XMLOutput xmlOutput) throws Exception { // allow nested tags first, e.g body invokeBody(xmlOutput); // if no listeners create a default port listener if (_server.getListeners().length == 0) { SocketListener listener=new SocketListener(); listener.s... | |
MailProcessingRecord mailProcessingRecord = new MailProcessingRecord(); mailProcessingRecord.setReceivingQueue("smtpOutbound"); mailProcessingRecord.setTimeFetchStart(System.currentTimeMillis()); mailProcessingRecord.setByteReceivedTotal(message.getSize()); try { if (!MailMatchingUtils.isMatchCandidate(message)) retur... | try { new SMTPMailAnalyzeStrategy("smtpOutbound", m_results, message).handle(); } catch (Exception e) { throw new MessagingException("error handling message", e); } | public void sendMail(MailAddress sender, Collection recipients, MimeMessage message) throws MessagingException { //log.info("start processing incoming mail having id = " + msg.getMessageID()); MailProcessingRecord mailProcessingRecord = new MailProcessingRecord(); mailProcessingRecord.setReceiv... |
Object parentObject = null; TaskSource ancestor = (TaskSource) findAncestorWithClass( TaskSource.class ); if ( ancestor != null ) { parentObject = ancestor.getTaskObject(); } | Object parentObject = findBeanAncestor(); | public void doTag(XMLOutput output) throws Exception { Project project = getAntProject(); String tagName = getTagName(); Object parentObject = null; // must be a datatype. TaskSource ancestor = (TaskSource) findAncestorWithClass( TaskSource.class ); if ( ancestor !=... |
if ( parentObject == null ) { parentObject = findBeanAncestor(); } | public void doTag(XMLOutput output) throws Exception { Project project = getAntProject(); String tagName = getTagName(); Object parentObject = null; // must be a datatype. TaskSource ancestor = (TaskSource) findAncestorWithClass( TaskSource.class ); if ( ancestor !=... | |
log.warn( "Caught exception setting nested: " + tagName, e ); } try { BeanUtils.setProperty( parentObject, tagName, nested ); } catch (Exception e) { log.debug("Caught exception trying to set property: " + tagName + " on: " + parentObject); | public void doTag(XMLOutput output) throws Exception { Project project = getAntProject(); String tagName = getTagName(); Object parentObject = null; // must be a datatype. TaskSource ancestor = (TaskSource) findAncestorWithClass( TaskSource.class ); if ( ancestor !=... | |
if (tag != null) { | while (tag != null) { | protected Object findBeanAncestor() throws Exception { Tag tag = getParent(); if (tag != null) { if (tag instanceof BeanSource) { BeanSource beanSource = (BeanSource) tag; return beanSource.getBean(); } } return tag; } |
return tag; | return getParent(); | protected Object findBeanAncestor() throws Exception { Tag tag = getParent(); if (tag != null) { if (tag instanceof BeanSource) { BeanSource beanSource = (BeanSource) tag; return beanSource.getBean(); } } return tag; } |
JMenuItem newWindowItem = new JMenuItem( "New window", KeyEvent.VK_N ); newWindowItem.addActionListener( new ActionListener() { public void actionPerformed( ActionEvent e ) { BrowserWindow br = new BrowserWindow(); br.setVisible( true ); } }); fileMenu.add( newWindowItem ); | protected void createUI() { tabPane = new JTabbedPane(); queryPane = new QueryPane(); treePane = new PhotoFolderTree(); tabPane.addTab( "Query", queryPane ); tabPane.addTab( "Folders", treePane ); // viewPane = new TableCollectionView(); viewPane = new PhotoCollectionThumbView(); viewPane.setCollection( queryPane.g... | |
importFile(); | BrowserWindow br = new BrowserWindow(); br.setVisible( true ); | public void actionPerformed( ActionEvent e ) { importFile(); } |
System.exit( 0 ); | importFile(); | public void actionPerformed( ActionEvent e ) { System.exit( 0 ); } |
log.warn("Could not load class: " + uri + " so disabling the taglib", e); | throw createSAXException("Could not load class: " + uri + " so taglib instantiation failed", e); | protected TagScript createTag( String namespaceURI, String localName, Attributes list) throws SAXException { try { // use the URI to load a taglib TagLibrary taglib = context.getTagLibrary(namespaceURI); if (taglib == null) { if (nam... |
log.warn("Constructor for class is not accessible: " + uri + " so disabling the taglib", e); | throw createSAXException("Constructor for class is not accessible: " + uri + " so taglib instantiation failed",e); | protected TagScript createTag( String namespaceURI, String localName, Attributes list) throws SAXException { try { // use the URI to load a taglib TagLibrary taglib = context.getTagLibrary(namespaceURI); if (taglib == null) { if (nam... |
log.warn("Class could not be instantiated: " + uri + " so disabling the taglib", e); | throw createSAXException("Class could not be instantiated: " + uri + " so taglib instantiation failed",e); | protected TagScript createTag( String namespaceURI, String localName, Attributes list) throws SAXException { try { // use the URI to load a taglib TagLibrary taglib = context.getTagLibrary(namespaceURI); if (taglib == null) { if (nam... |
log.warn("Class is not a TagLibrary: " + uri + " so disabling the taglib", e); | throw createSAXException("Class is not a TagLibrary: " + uri + " so taglib instantiation failed",e); | protected TagScript createTag( String namespaceURI, String localName, Attributes list) throws SAXException { try { // use the URI to load a taglib TagLibrary taglib = context.getTagLibrary(namespaceURI); if (taglib == null) { if (nam... |
public AntTag(Project project, String tagName) { this.project = project; | public AntTag(String tagName) { | public AntTag(Project project, String tagName) { this.project = project; this.tagName = tagName; } |
dataType = (DataType) ctor.newInstance(new Object[] {project}); | dataType = (DataType) ctor.newInstance(new Object[] { getAntProject() }); | public Object createDataType(String name) throws Exception { Object dataType = null; Class type = (Class) getAntProject().getDataTypeDefinitions().get(name); if ( type != null ) { try { Constructor ctor = null; boolean noArg = false; // Da... |
((DataType)dataType).setProject( project ); | ((DataType)dataType).setProject( getAntProject() ); | public Object createDataType(String name) throws Exception { Object dataType = null; Class type = (Class) getAntProject().getDataTypeDefinitions().get(name); if ( type != null ) { try { Constructor ctor = null; boolean noArg = false; // Da... |
return this.project; | return AntTagLibrary.getProject(context); | public Project getAntProject() { return this.project; } |
if (caller.hapDisplay != null){ caller.hapDisplay.setVisible(false); } | public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command==RAW_DATA){ load(PED); }else if (command == PHASED_DATA){ load(HAPS); }else if (command == HAPMAP_DATA){ load(HMP); }else if (command == BROWSE_GENO){ ... | |
getBody().run(context, output); | invokeBody(output); | public void doTag(XMLOutput output) throws Exception { getBody().run(context, output); } |
log.debug( "registering volume " + volumeName + ", basedir " + volumeBaseDir ); | private void registerVolume() { if ( volumes == null ) { volumes = new HashMap(); } volumes.put( volumeName, this ); } | |
log.debug( "New basedir for " + volumeName + ": " + baseDir ); | public void setBaseDir( File baseDir ) { volumeBaseDir = baseDir; if ( !volumeBaseDir.exists() ) { volumeBaseDir.mkdir(); } } | |
logger.debug("getTransferData returns '"+data.getName()+"'"+data.getClass().getName()+"@"+data.hashCode()); | public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (flavor != this.flavor) { throw new IllegalArgumentException("Unsupported flavor "+flavor); } return data; } | |
request.setAttribute(RequestAttributes.USERS, users); | Map orderedUsers = new TreeMap(users); request.setAttribute(RequestAttributes.USERS, orderedUsers); | public ActionForward execute(WebContext context, ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.