bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public SWDownloadFile( DDownloadFile dFile ) { this(); URN fileUrn = null; if ( dFile.getFileURN() != null ) { fileUrn = new URN( dFile.getFileURN() ); } String destDir = dFile.getDestinationDirectory(); if ( !StringUtils.isEmpty( destDir ) ) { destinationDirectory = new File( destDir ); } initialize( dFile.getLocalFileName(), fileUrn, dFile.getFileSize(), dFile.getSearchTerm(), false ); String incompleteFileName = dFile.getIncompleteFileName(); if ( !StringUtils.isEmpty( incompleteFileName ) ) { try { incompleteManagedFile = FileManager.getInstance().getReadWriteManagedFile( new File( incompleteFileName ) ); } catch ( ManagedFileException exp ) { NLogger.error( NLoggerNames.Download, exp, exp ); incompleteManagedFile = null; } } setCreatedDate( new Date( dFile.getCreationTime() ) ); setDownloadedDate( new Date( dFile.getModificationTime() ) ); status = dFile.getStatus(); memoryFile.createDownloadScopes( dFile ); createDownloadCandidates( dFile ); forceCollectionOfTransferData(); verifyStatus(); if ( isFileCompletedOrMoved() ) { // set transferred data... this is lazy collected from // segments when the download is not completed transferredDataSize = fileSize; // in case some interrupted move occured... or some old downloads // are still sitting there if ( isFileCompleted() ) { if ( memoryFile.getFinishedLength() == 0 ) { setStatus(STATUS_FILE_COMPLETED_MOVED); } } } }
|
private SWDownloadFile() { this(); URN fileUrn = null; if ( dFile.getFileURN() != null ) { fileUrn = new URN( dFile.getFileURN() ); } String destDir = dFile.getDestinationDirectory(); if ( !StringUtils.isEmpty( destDir ) ) { destinationDirectory = new File( destDir ); } initialize( dFile.getLocalFileName(), fileUrn, dFile.getFileSize(), dFile.getSearchTerm(), false ); String incompleteFileName = dFile.getIncompleteFileName(); if ( !StringUtils.isEmpty( incompleteFileName ) ) { try { incompleteManagedFile = FileManager.getInstance().getReadWriteManagedFile( new File( incompleteFileName ) ); } catch ( ManagedFileException exp ) { NLogger.error( NLoggerNames.Download, exp, exp ); incompleteManagedFile = null; } } setCreatedDate( new Date( dFile.getCreationTime() ) ); setDownloadedDate( new Date( dFile.getModificationTime() ) ); status = dFile.getStatus(); memoryFile.createDownloadScopes( dFile ); createDownloadCandidates( dFile ); forceCollectionOfTransferData(); verifyStatus(); if ( isFileCompletedOrMoved() ) { // set transferred data... this is lazy collected from // segments when the download is not completed transferredDataSize = fileSize; // in case some interrupted move occured... or some old downloads // are still sitting there if ( isFileCompleted() ) { if ( memoryFile.getFinishedLength() == 0 ) { setStatus(STATUS_FILE_COMPLETED_MOVED); } } } }
| 1,115,467
|
public SWDownloadFile( DDownloadFile dFile ) { this(); URN fileUrn = null; if ( dFile.getFileURN() != null ) { fileUrn = new URN( dFile.getFileURN() ); } String destDir = dFile.getDestinationDirectory(); if ( !StringUtils.isEmpty( destDir ) ) { destinationDirectory = new File( destDir ); } initialize( dFile.getLocalFileName(), fileUrn, dFile.getFileSize(), dFile.getSearchTerm(), false ); String incompleteFileName = dFile.getIncompleteFileName(); if ( !StringUtils.isEmpty( incompleteFileName ) ) { try { incompleteManagedFile = FileManager.getInstance().getReadWriteManagedFile( new File( incompleteFileName ) ); } catch ( ManagedFileException exp ) { NLogger.error( NLoggerNames.Download, exp, exp ); incompleteManagedFile = null; } } setCreatedDate( new Date( dFile.getCreationTime() ) ); setDownloadedDate( new Date( dFile.getModificationTime() ) ); status = dFile.getStatus(); memoryFile.createDownloadScopes( dFile ); createDownloadCandidates( dFile ); forceCollectionOfTransferData(); verifyStatus(); if ( isFileCompletedOrMoved() ) { // set transferred data... this is lazy collected from // segments when the download is not completed transferredDataSize = fileSize; // in case some interrupted move occured... or some old downloads // are still sitting there if ( isFileCompleted() ) { if ( memoryFile.getFinishedLength() == 0 ) { setStatus(STATUS_FILE_COMPLETED_MOVED); } } } }
|
public SWDownloadFile( DDownloadFile dFile ) { this(); URN fileUrn = null; if ( dFile.getFileURN() != null ) { fileUrn = new URN( dFile.getFileURN() ); } String destDir = dFile.getDestinationDirectory(); if ( !StringUtils.isEmpty( destDir ) ) { destinationDirectory = new File( destDir ); } initialize( dFile.getLocalFileName(), fileUrn, dFile.getFileSize(), dFile.getSearchTerm(), false ); String incompleteFileName = dFile.getIncompleteFileName(); if ( !StringUtils.isEmpty( incompleteFileName ) ) { try { incompleteManagedFile = FileManager.getInstance().getReadWriteManagedFile( new File( incompleteFileName ) ); } catch ( ManagedFileException exp ) { NLogger.error( NLoggerNames.Download, exp, exp ); incompleteManagedFile = null; } } setCreatedDate( new Date( dFile.getCreationTime() ) ); setDownloadedDate( new Date( dFile.getModificationTime() ) ); status = dFile.getStatus(); memoryFile.createDownloadScopes( dFile ); createDownloadCandidates( dFile ); forceCollectionOfTransferData(); verifyStatus(); if ( isFileCompletedOrMoved() ) { // set transferred data... this is lazy collected from // segments when the download is not completed transferredDataSize = fileSize; // in case some interrupted move occured... or some old downloads // are still sitting there if ( isFileCompleted() ) { if ( memoryFile.getFinishedLength() == 0 ) { setStatus(STATUS_FILE_COMPLETED_MOVED); } } } }
| 1,115,468
|
public SWDownloadFile( DDownloadFile dFile ) { this(); URN fileUrn = null; if ( dFile.getFileURN() != null ) { fileUrn = new URN( dFile.getFileURN() ); } String destDir = dFile.getDestinationDirectory(); if ( !StringUtils.isEmpty( destDir ) ) { destinationDirectory = new File( destDir ); } initialize( dFile.getLocalFileName(), fileUrn, dFile.getFileSize(), dFile.getSearchTerm(), false ); String incompleteFileName = dFile.getIncompleteFileName(); if ( !StringUtils.isEmpty( incompleteFileName ) ) { try { incompleteManagedFile = FileManager.getInstance().getReadWriteManagedFile( new File( incompleteFileName ) ); } catch ( ManagedFileException exp ) { NLogger.error( NLoggerNames.Download, exp, exp ); incompleteManagedFile = null; } } setCreatedDate( new Date( dFile.getCreationTime() ) ); setDownloadedDate( new Date( dFile.getModificationTime() ) ); status = dFile.getStatus(); memoryFile.createDownloadScopes( dFile ); createDownloadCandidates( dFile ); forceCollectionOfTransferData(); verifyStatus(); if ( isFileCompletedOrMoved() ) { // set transferred data... this is lazy collected from // segments when the download is not completed transferredDataSize = fileSize; // in case some interrupted move occured... or some old downloads // are still sitting there if ( isFileCompleted() ) { if ( memoryFile.getFinishedLength() == 0 ) { setStatus(STATUS_FILE_COMPLETED_MOVED); } } } }
|
public SWDownloadFile( DDownloadFile dFile ) { this(); URN fileUrn = null; if ( dFile.getFileURN() != null ) { fileUrn = new URN( dFile.getFileURN() ); } String destDir = dFile.getDestinationDirectory(); if ( !StringUtils.isEmpty( destDir ) ) { destinationDirectory = new File( destDir ); } initialize( dFile.getLocalFileName(), fileUrn, dFile.getFileSize(), dFile.getSearchTerm(), false ); String incompleteFileName = dFile.getIncompleteFileName(); if ( !StringUtils.isEmpty( incompleteFileName ) ) { try { incompleteManagedFile = FileManager.getInstance().getReadWriteManagedFile( new File( incompleteFileName ) ); } catch ( ManagedFileException exp ) { NLogger.error( NLoggerNames.Download, exp, exp ); incompleteManagedFile = null; } } setCreatedDate( new Date( dFile.getCreationTime() ) ); setDownloadedDate( new Date( dFile.getModificationTime() ) ); status = dFile.getStatus(); memoryFile.createDownloadScopes( dFile ); createDownloadCandidates( dFile ); forceCollectionOfTransferData(); verifyStatus(); if ( isFileCompletedOrMoved() ) { // set transferred data... this is lazy collected from // segments when the download is not completed transferredDataSize = fileSize; // in case some interrupted move occured... or some old downloads // are still sitting there if ( isFileCompleted() ) { if ( memoryFile.getFinishedLength() == 0 ) { setStatus(STATUS_FILE_COMPLETED_MOVED); } } } }
| 1,115,469
|
public static DPhex loadDPhexFromFile( ManagedFile managedFile ) throws IOException, ManagedFileException { if ( !managedFile.getFile().exists() ) { return null; } NLogger.debug( XMLBuilder.class, "Loading DPhex from: " + managedFile ); InputStream inStream = null; try { managedFile.acquireFileLock(); inStream = new ManagedFileInputStream( managedFile, 0 ); return readDPhexFromStream(inStream); } finally { IOUtil.closeQuietly( inStream ); IOUtil.closeQuietly( managedFile ); managedFile.releaseFileLock(); } }
|
public static DPhex loadDPhexFromFile( ManagedFile managedFile ) throws IOException, ManagedFileException { if ( !managedFile.exists() ) { return null; } NLogger.debug( XMLBuilder.class, "Loading DPhex from: " + managedFile ); InputStream inStream = null; try { managedFile.acquireFileLock(); inStream = new ManagedFileInputStream( managedFile, 0 ); return readDPhexFromStream(inStream); } finally { IOUtil.closeQuietly( inStream ); IOUtil.closeQuietly( managedFile ); managedFile.releaseFileLock(); } }
| 1,115,470
|
public void fireDisplayUserMessage( String userMessageId, String[] args ) { // if initialized if ( userMessageListener != null ) { userMessageListener.displayUserMessage( userMessageId, args ); } }
|
public void fireDisplayUserMessage( String userMessageId ) { // if initialized if ( userMessageListener != null ) { userMessageListener.displayUserMessage( userMessageId, args ); } }
| 1,115,471
|
public void fireDisplayUserMessage( String userMessageId, String[] args ) { // if initialized if ( userMessageListener != null ) { userMessageListener.displayUserMessage( userMessageId, args ); } }
|
public void fireDisplayUserMessage( String userMessageId, String[] args ) { // if initialized if ( userMessageListener != null ) { userMessageListener.displayUserMessage( userMessageId, null ); } }
| 1,115,472
|
public void stopDownload() { setStatus( STATUS_FILE_STOPPED ); stopAllWorkers( true ); }
|
public void stopDownload( SWDownloadCandidate candidate ) { setStatus( STATUS_FILE_STOPPED ); stopAllWorkers( true ); }
| 1,115,473
|
public void stopDownload() { setStatus( STATUS_FILE_STOPPED ); stopAllWorkers( true ); }
|
public void stopDownload() { setStatus( STATUS_FILE_STOPPED ); stopAllWorkers( true ); }
| 1,115,474
|
private R update(TreeMap<Integer, R> m, Integer key, R value) { R r = m.put(key, value); SortedMap<Integer,R> head = m.headMap(key); if(!head.isEmpty()) { R prev = m.get(head.lastKey()); r.nextBuild = prev.nextBuild; r.previousBuild = prev; if(r.nextBuild!=null) r.nextBuild.previousBuild = r; prev.nextBuild=r; } else { if(!m.isEmpty()) { R first = m.get(m.firstKey()); r.nextBuild = first; r.previousBuild = null; first.previousBuild = r; } } return r; }
|
private R update(TreeMap<Integer, R> m, Integer key, R value) { R r = m.put(key, value); SortedMap<Integer,R> head = m.headMap(key); if(!head.isEmpty()) { R prev = m.get(head.lastKey()); r.nextBuild = prev.nextBuild; r.previousBuild = prev; if(r.nextBuild!=null) r.nextBuild.previousBuild = r; prev.nextBuild=r; } else { if(!m.isEmpty()) { R first = m.get(m.firstKey()); r.nextBuild = first; r.previousBuild = null; first.previousBuild = r; } } return r; }
| 1,115,475
|
private R update(TreeMap<Integer, R> m, Integer key, R value) { R r = m.put(key, value); SortedMap<Integer,R> head = m.headMap(key); if(!head.isEmpty()) { R prev = m.get(head.lastKey()); r.nextBuild = prev.nextBuild; r.previousBuild = prev; if(r.nextBuild!=null) r.nextBuild.previousBuild = r; prev.nextBuild=r; } else { if(!m.isEmpty()) { R first = m.get(m.firstKey()); r.nextBuild = first; r.previousBuild = null; first.previousBuild = r; } } return r; }
|
private R update(TreeMap<Integer, R> m, Integer key, R value) { R r = m.put(key, value); SortedMap<Integer,R> head = m.headMap(key); if(!head.isEmpty()) { R prev = m.get(head.lastKey()); r.nextBuild = prev.nextBuild; r.previousBuild = prev; if(r.nextBuild!=null) r.nextBuild.previousBuild = r; prev.nextBuild=r; } else { if(!m.isEmpty()) { R first = m.get(m.firstKey()); r.nextBuild = first; r.previousBuild = null; first.previousBuild = r; } } return r; }
| 1,115,476
|
public synchronized void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException { if(!Hudson.adminCheck(req,rsp)) return; owner.deleteView(this); rsp.sendRedirect(req.getContextPath()); }
|
public synchronized void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException { if(!Hudson.adminCheck(req,rsp)) return; owner.deleteView(this); rsp.sendRedirect(req.getContextPath()+"/"); }
| 1,115,478
|
private void printCommandLine(String[] cmd) { StringBuffer buf = new StringBuffer(); buf.append('$'); for (String c : cmd) { buf.append(' ').append(c); } listener.getLogger().println(buf.toString()); }
|
private void printCommandLine(String[] cmd, FilePath workDir) { StringBuffer buf = new StringBuffer(); buf.append('$'); for (String c : cmd) { buf.append(' ').append(c); } listener.getLogger().println(buf.toString()); }
| 1,115,480
|
public Proc(String[] cmd,String[] env,OutputStream out, File workDir) throws IOException { this( Runtime.getRuntime().exec(cmd,env,workDir), null, out ); }
|
public Proc(String[] cmd,String[] env,OutputStream out, File workDir) throws IOException { this( Runtime.getRuntime().exec(cmd,env,workDir), null, out ); }
| 1,115,482
|
public void setAmountAndUnits(String a){ int i = a.indexOf(" "); String d = a.substring(0,i); String u = a.substring(i); postBoilVol.setQuantity( null, u.trim(), Double.parseDouble(d.trim())); }
|
public void setAmountAndUnits(String a){ int i = a.indexOf(" "); String d = a.substring(0,i); String u = a.substring(i); preBoilVol.setQuantity( null, u.trim(), Double.parseDouble(d.trim())); postBoilVol.setQuantity( null, u.trim(), Double.parseDouble(d.trim())); }
| 1,115,483
|
public void setCost(String c){ if (c.substring(0,1).equals("$")) { c = c.substring(1, c.length()); // trim leading "$" } costPerU = Double.parseDouble(c); }
|
public void setCost(String c){ if (c.substring(0,1).equals("$")) { c = c.substring(1, c.length()); // trim leading "$" } costPerU = Double.parseDouble(c); }
| 1,115,485
|
public Node getNode() { return node; }
|
public Node getNode() { if(nodeName==null) return Hudson.getInstance(); return Hudson.getInstance().getSlave(nodeName); }
| 1,115,487
|
public static void main(String args[]) { /* initilisation */ DJep j = new DJep(); j.addStandardConstants(); j.addStandardFunctions(); j.addComplex(); j.setAllowUndeclared(true); j.setAllowAssignment(true); j.setImplicitMul(true); j.dv.addStandardDiffRules(); try { // parse the string Node node = j.parse("sin(x^2)"); // differentiate wrt x Node diff = j.differentiate(node,"x"); // print j.println(diff); // simplify Node simp = j.simplify(diff); // print j.println(simp); // This time the differentation is specified by // the diff(eqn,var) function Node node2 = j.parse("diff(cos(x^3),x)"); // To actually make diff do its work the // equation needs to be preprocessed Node processed = j.preprocess(node2); j.println(processed); // finally simplify Node simp2 = j.simplify(processed); j.println(simp2); // Now combine assignment and differentation Node node3 = j.parse("y=x^5"); j.preprocess(node3); Node node4 = j.parse("diff(y^2+x,x)"); Node simp3 = j.simplify(j.preprocess(node4)); j.dpv.setPrintVariableEquations(true); j.println(simp3); j.dpv.setPrintPartialEquations(false); j.dpv.setPrintVariableEquations(false); j.println(simp3); Node node5 = j.parse("y"); j.println(node5); j.dpv.setPrintVariableEquations(true); j.println(node5); j.getSymbolTable().setVarValue("x",new Double(5)); System.out.println(j.evaluate(simp3)); j.evaluate(node3); System.out.println(j.getSymbolTable().getVar("y").getValue()); j.getSymbolTable().setVarValue("x",new Double(0)); System.out.println(j.evaluate(simp)); Node node10 = j.parse("x=3"); Node node11 = j.preprocess(node10); System.out.println(j.evaluate(node11)); Node node12 = j.parse("y=x^2"); Node node13 = j.preprocess(node12); System.out.println(j.evaluate(node13)); Node node14 = j.parse("z=diff(y,x)"); Node node15 = j.simplify(j.preprocess(node14)); System.out.println(j.evaluate(node15)); // If a variable is changed then any expresion tree // it depends on needs to be re-evaluated to bring // values of other variables upto date j.setVarValue("x",new Double(4)); System.out.println(j.evaluate(node13)); System.out.println(j.evaluate(node15)); System.out.println("z: "+j.getVarValue("z").toString()); // the findVarValue method will automatically // re-calculate the value of variables specified by // equations if needed. However a lazy j.setVarValue("x",new Double(5)); System.out.println("j.setVarValue(\"x\",new Double(5));"); System.out.println("j.findVarValue(y): "+j.findVarValue("y").toString()); System.out.println("j.findVarValue(z): "+j.findVarValue("z").toString()); // if j.getSymbolTable().clearValues(); // is called before values of equations are set // then the values of intermediate equations // are automatically calculated, so you can jump // straight to the chase: no need to calculate // y explititly to find the value of z. j.getSymbolTable().clearValues(); j.setVarValue("x",new Double(6)); System.out.println("j.setVarValue(\"x\",new Double(6));"); System.out.println("j.findVarValue(z): "+j.findVarValue("z").toString()); j.getSymbolTable().clearValues(); j.setVarValue("x",new Double(7)); System.out.println(j.evaluate(node15)); System.out.println("z: "+j.getVarValue("z").toString()); } catch(ParseException e) { System.out.println("Error with parsing"); } catch(Exception e) { System.out.println("Error with evaluation"); } }
|
public static void main(String args[]) { /* initilisation */ DJep j = new DJep(); j.addStandardConstants(); j.addStandardFunctions(); j.addComplex(); j.setAllowUndeclared(true); j.setAllowAssignment(true); j.setImplicitMul(true); j.addStandardDiffRules(); try { // parse the string Node node = j.parse("sin(x^2)"); // differentiate wrt x Node diff = j.differentiate(node,"x"); // print j.println(diff); // simplify Node simp = j.simplify(diff); // print j.println(simp); // This time the differentation is specified by // the diff(eqn,var) function Node node2 = j.parse("diff(cos(x^3),x)"); // To actually make diff do its work the // equation needs to be preprocessed Node processed = j.preprocess(node2); j.println(processed); // finally simplify Node simp2 = j.simplify(processed); j.println(simp2); // Now combine assignment and differentation Node node3 = j.parse("y=x^5"); j.preprocess(node3); Node node4 = j.parse("diff(y^2+x,x)"); Node simp3 = j.simplify(j.preprocess(node4)); j.dpv.setPrintVariableEquations(true); j.println(simp3); j.dpv.setPrintPartialEquations(false); j.dpv.setPrintVariableEquations(false); j.println(simp3); Node node5 = j.parse("y"); j.println(node5); j.dpv.setPrintVariableEquations(true); j.println(node5); j.getSymbolTable().setVarValue("x",new Double(5)); System.out.println(j.evaluate(simp3)); j.evaluate(node3); System.out.println(j.getSymbolTable().getVar("y").getValue()); j.getSymbolTable().setVarValue("x",new Double(0)); System.out.println(j.evaluate(simp)); Node node10 = j.parse("x=3"); Node node11 = j.preprocess(node10); System.out.println(j.evaluate(node11)); Node node12 = j.parse("y=x^2"); Node node13 = j.preprocess(node12); System.out.println(j.evaluate(node13)); Node node14 = j.parse("z=diff(y,x)"); Node node15 = j.simplify(j.preprocess(node14)); System.out.println(j.evaluate(node15)); // If a variable is changed then any expresion tree // it depends on needs to be re-evaluated to bring // values of other variables upto date j.setVarValue("x",new Double(4)); System.out.println(j.evaluate(node13)); System.out.println(j.evaluate(node15)); System.out.println("z: "+j.getVarValue("z").toString()); // the findVarValue method will automatically // re-calculate the value of variables specified by // equations if needed. However a lazy j.setVarValue("x",new Double(5)); System.out.println("j.setVarValue(\"x\",new Double(5));"); System.out.println("j.findVarValue(y): "+j.findVarValue("y").toString()); System.out.println("j.findVarValue(z): "+j.findVarValue("z").toString()); // if j.getSymbolTable().clearValues(); // is called before values of equations are set // then the values of intermediate equations // are automatically calculated, so you can jump // straight to the chase: no need to calculate // y explititly to find the value of z. j.getSymbolTable().clearValues(); j.setVarValue("x",new Double(6)); System.out.println("j.setVarValue(\"x\",new Double(6));"); System.out.println("j.findVarValue(z): "+j.findVarValue("z").toString()); j.getSymbolTable().clearValues(); j.setVarValue("x",new Double(7)); System.out.println(j.evaluate(node15)); System.out.println("z: "+j.getVarValue("z").toString()); } catch(ParseException e) { System.out.println("Error with parsing"); } catch(Exception e) { System.out.println("Error with evaluation"); } }
| 1,115,488
|
public static void main(String args[]) { /* initilisation */ DJep j = new DJep(); j.addStandardConstants(); j.addStandardFunctions(); j.addComplex(); j.setAllowUndeclared(true); j.setAllowAssignment(true); j.setImplicitMul(true); j.dv.addStandardDiffRules(); try { // parse the string Node node = j.parse("sin(x^2)"); // differentiate wrt x Node diff = j.differentiate(node,"x"); // print j.println(diff); // simplify Node simp = j.simplify(diff); // print j.println(simp); // This time the differentation is specified by // the diff(eqn,var) function Node node2 = j.parse("diff(cos(x^3),x)"); // To actually make diff do its work the // equation needs to be preprocessed Node processed = j.preprocess(node2); j.println(processed); // finally simplify Node simp2 = j.simplify(processed); j.println(simp2); // Now combine assignment and differentation Node node3 = j.parse("y=x^5"); j.preprocess(node3); Node node4 = j.parse("diff(y^2+x,x)"); Node simp3 = j.simplify(j.preprocess(node4)); j.dpv.setPrintVariableEquations(true); j.println(simp3); j.dpv.setPrintPartialEquations(false); j.dpv.setPrintVariableEquations(false); j.println(simp3); Node node5 = j.parse("y"); j.println(node5); j.dpv.setPrintVariableEquations(true); j.println(node5); j.getSymbolTable().setVarValue("x",new Double(5)); System.out.println(j.evaluate(simp3)); j.evaluate(node3); System.out.println(j.getSymbolTable().getVar("y").getValue()); j.getSymbolTable().setVarValue("x",new Double(0)); System.out.println(j.evaluate(simp)); Node node10 = j.parse("x=3"); Node node11 = j.preprocess(node10); System.out.println(j.evaluate(node11)); Node node12 = j.parse("y=x^2"); Node node13 = j.preprocess(node12); System.out.println(j.evaluate(node13)); Node node14 = j.parse("z=diff(y,x)"); Node node15 = j.simplify(j.preprocess(node14)); System.out.println(j.evaluate(node15)); // If a variable is changed then any expresion tree // it depends on needs to be re-evaluated to bring // values of other variables upto date j.setVarValue("x",new Double(4)); System.out.println(j.evaluate(node13)); System.out.println(j.evaluate(node15)); System.out.println("z: "+j.getVarValue("z").toString()); // the findVarValue method will automatically // re-calculate the value of variables specified by // equations if needed. However a lazy j.setVarValue("x",new Double(5)); System.out.println("j.setVarValue(\"x\",new Double(5));"); System.out.println("j.findVarValue(y): "+j.findVarValue("y").toString()); System.out.println("j.findVarValue(z): "+j.findVarValue("z").toString()); // if j.getSymbolTable().clearValues(); // is called before values of equations are set // then the values of intermediate equations // are automatically calculated, so you can jump // straight to the chase: no need to calculate // y explititly to find the value of z. j.getSymbolTable().clearValues(); j.setVarValue("x",new Double(6)); System.out.println("j.setVarValue(\"x\",new Double(6));"); System.out.println("j.findVarValue(z): "+j.findVarValue("z").toString()); j.getSymbolTable().clearValues(); j.setVarValue("x",new Double(7)); System.out.println(j.evaluate(node15)); System.out.println("z: "+j.getVarValue("z").toString()); } catch(ParseException e) { System.out.println("Error with parsing"); } catch(Exception e) { System.out.println("Error with evaluation"); } }
|
public static void main(String args[]) { /* initilisation */ DJep j = new DJep(); j.addStandardConstants(); j.addStandardFunctions(); j.addComplex(); j.setAllowUndeclared(true); j.setAllowAssignment(true); j.setImplicitMul(true); j.dv.addStandardDiffRules(); try { // parse the string Node node = j.parse("sin(x^2)"); // differentiate wrt x Node diff = j.differentiate(node,"x"); // print j.println(diff); // simplify Node simp = j.simplify(diff); // print j.println(simp); // This time the differentation is specified by // the diff(eqn,var) function Node node2 = j.parse("diff(cos(x^3),x)"); // To actually make diff do its work the // equation needs to be preprocessed Node processed = j.preprocess(node2); j.println(processed); // finally simplify Node simp2 = j.simplify(processed); j.println(simp2); // Now combine assignment and differentation Node node3 = j.parse("y=x^5"); j.preprocess(node3); Node node4 = j.parse("diff(y^2+x,x)"); Node simp3 = j.simplify(j.preprocess(node4)); j.getDPrintVisitor().setPrintVariableEquations(true); j.println(simp3); j.dpv.setPrintPartialEquations(false); j.dpv.setPrintVariableEquations(false); j.println(simp3); Node node5 = j.parse("y"); j.println(node5); j.getDPrintVisitor().setPrintVariableEquations(true); j.println(node5); j.getSymbolTable().setVarValue("x",new Double(5)); System.out.println(j.evaluate(simp3)); j.evaluate(node3); System.out.println(j.getSymbolTable().getVar("y").getValue()); j.getSymbolTable().setVarValue("x",new Double(0)); System.out.println(j.evaluate(simp)); Node node10 = j.parse("x=3"); Node node11 = j.preprocess(node10); System.out.println(j.evaluate(node11)); Node node12 = j.parse("y=x^2"); Node node13 = j.preprocess(node12); System.out.println(j.evaluate(node13)); Node node14 = j.parse("z=diff(y,x)"); Node node15 = j.simplify(j.preprocess(node14)); System.out.println(j.evaluate(node15)); // If a variable is changed then any expresion tree // it depends on needs to be re-evaluated to bring // values of other variables upto date j.setVarValue("x",new Double(4)); System.out.println(j.evaluate(node13)); System.out.println(j.evaluate(node15)); System.out.println("z: "+j.getVarValue("z").toString()); // the findVarValue method will automatically // re-calculate the value of variables specified by // equations if needed. However a lazy j.setVarValue("x",new Double(5)); System.out.println("j.setVarValue(\"x\",new Double(5));"); System.out.println("j.findVarValue(y): "+j.findVarValue("y").toString()); System.out.println("j.findVarValue(z): "+j.findVarValue("z").toString()); // if j.getSymbolTable().clearValues(); // is called before values of equations are set // then the values of intermediate equations // are automatically calculated, so you can jump // straight to the chase: no need to calculate // y explititly to find the value of z. j.getSymbolTable().clearValues(); j.setVarValue("x",new Double(6)); System.out.println("j.setVarValue(\"x\",new Double(6));"); System.out.println("j.findVarValue(z): "+j.findVarValue("z").toString()); j.getSymbolTable().clearValues(); j.setVarValue("x",new Double(7)); System.out.println(j.evaluate(node15)); System.out.println("z: "+j.getVarValue("z").toString()); } catch(ParseException e) { System.out.println("Error with parsing"); } catch(Exception e) { System.out.println("Error with evaluation"); } }
| 1,115,489
|
public static void main(String args[]) { /* initilisation */ DJep j = new DJep(); j.addStandardConstants(); j.addStandardFunctions(); j.addComplex(); j.setAllowUndeclared(true); j.setAllowAssignment(true); j.setImplicitMul(true); j.dv.addStandardDiffRules(); try { // parse the string Node node = j.parse("sin(x^2)"); // differentiate wrt x Node diff = j.differentiate(node,"x"); // print j.println(diff); // simplify Node simp = j.simplify(diff); // print j.println(simp); // This time the differentation is specified by // the diff(eqn,var) function Node node2 = j.parse("diff(cos(x^3),x)"); // To actually make diff do its work the // equation needs to be preprocessed Node processed = j.preprocess(node2); j.println(processed); // finally simplify Node simp2 = j.simplify(processed); j.println(simp2); // Now combine assignment and differentation Node node3 = j.parse("y=x^5"); j.preprocess(node3); Node node4 = j.parse("diff(y^2+x,x)"); Node simp3 = j.simplify(j.preprocess(node4)); j.dpv.setPrintVariableEquations(true); j.println(simp3); j.dpv.setPrintPartialEquations(false); j.dpv.setPrintVariableEquations(false); j.println(simp3); Node node5 = j.parse("y"); j.println(node5); j.dpv.setPrintVariableEquations(true); j.println(node5); j.getSymbolTable().setVarValue("x",new Double(5)); System.out.println(j.evaluate(simp3)); j.evaluate(node3); System.out.println(j.getSymbolTable().getVar("y").getValue()); j.getSymbolTable().setVarValue("x",new Double(0)); System.out.println(j.evaluate(simp)); Node node10 = j.parse("x=3"); Node node11 = j.preprocess(node10); System.out.println(j.evaluate(node11)); Node node12 = j.parse("y=x^2"); Node node13 = j.preprocess(node12); System.out.println(j.evaluate(node13)); Node node14 = j.parse("z=diff(y,x)"); Node node15 = j.simplify(j.preprocess(node14)); System.out.println(j.evaluate(node15)); // If a variable is changed then any expresion tree // it depends on needs to be re-evaluated to bring // values of other variables upto date j.setVarValue("x",new Double(4)); System.out.println(j.evaluate(node13)); System.out.println(j.evaluate(node15)); System.out.println("z: "+j.getVarValue("z").toString()); // the findVarValue method will automatically // re-calculate the value of variables specified by // equations if needed. However a lazy j.setVarValue("x",new Double(5)); System.out.println("j.setVarValue(\"x\",new Double(5));"); System.out.println("j.findVarValue(y): "+j.findVarValue("y").toString()); System.out.println("j.findVarValue(z): "+j.findVarValue("z").toString()); // if j.getSymbolTable().clearValues(); // is called before values of equations are set // then the values of intermediate equations // are automatically calculated, so you can jump // straight to the chase: no need to calculate // y explititly to find the value of z. j.getSymbolTable().clearValues(); j.setVarValue("x",new Double(6)); System.out.println("j.setVarValue(\"x\",new Double(6));"); System.out.println("j.findVarValue(z): "+j.findVarValue("z").toString()); j.getSymbolTable().clearValues(); j.setVarValue("x",new Double(7)); System.out.println(j.evaluate(node15)); System.out.println("z: "+j.getVarValue("z").toString()); } catch(ParseException e) { System.out.println("Error with parsing"); } catch(Exception e) { System.out.println("Error with evaluation"); } }
|
public static void main(String args[]) { /* initilisation */ DJep j = new DJep(); j.addStandardConstants(); j.addStandardFunctions(); j.addComplex(); j.setAllowUndeclared(true); j.setAllowAssignment(true); j.setImplicitMul(true); j.dv.addStandardDiffRules(); try { // parse the string Node node = j.parse("sin(x^2)"); // differentiate wrt x Node diff = j.differentiate(node,"x"); // print j.println(diff); // simplify Node simp = j.simplify(diff); // print j.println(simp); // This time the differentation is specified by // the diff(eqn,var) function Node node2 = j.parse("diff(cos(x^3),x)"); // To actually make diff do its work the // equation needs to be preprocessed Node processed = j.preprocess(node2); j.println(processed); // finally simplify Node simp2 = j.simplify(processed); j.println(simp2); // Now combine assignment and differentation Node node3 = j.parse("y=x^5"); j.preprocess(node3); Node node4 = j.parse("diff(y^2+x,x)"); Node simp3 = j.simplify(j.preprocess(node4)); j.dpv.setPrintVariableEquations(true); j.println(simp3); j.dpv.setPrintPartialEquations(false); j.dpv.setPrintVariableEquations(false); j.println(simp3); Node node5 = j.parse("y"); j.println(node5); j.dpv.setPrintVariableEquations(true); j.println(node5); j.getSymbolTable().setVarValue("x",new Double(5)); System.out.println(j.evaluate(simp3)); j.evaluate(node3); System.out.println(j.getSymbolTable().getVar("y").getValue()); j.getSymbolTable().setVarValue("x",new Double(0)); System.out.println(j.evaluate(simp)); Node node10 = j.parse("x=3"); Node node11 = j.preprocess(node10); System.out.println(j.evaluate(node11)); Node node12 = j.parse("y=x^2"); Node node13 = j.preprocess(node12); System.out.println(j.evaluate(node13)); Node node14 = j.parse("z=diff(y,x)"); Node node15 = j.simplify(j.preprocess(node14)); System.out.println(j.evaluate(node15)); // If a variable is changed then any expresion tree // it depends on needs to be re-evaluated to bring // values of other variables upto date j.setVarValue("x",new Double(4)); System.out.println(j.evaluate(node13)); System.out.println(j.evaluate(node15)); System.out.println("z: "+j.getVarValue("z").toString()); // the findVarValue method will automatically // re-calculate the value of variables specified by // equations if needed. However a lazy j.setVarValue("x",new Double(5)); System.out.println("j.setVarValue(\"x\",new Double(5));"); System.out.println("j.findVarValue(y): "+j.findVarValue("y").toString()); System.out.println("j.findVarValue(z): "+j.findVarValue("z").toString()); // if j.getSymbolTable().clearValues(); // is called before values of equations are set // then the values of intermediate equations // are automatically calculated, so you can jump // straight to the chase: no need to calculate // y explititly to find the value of z. j.getSymbolTable().clearValues(); j.setVarValue("x",new Double(6)); System.out.println("j.setVarValue(\"x\",new Double(6));"); System.out.println("j.findVarValue(z): "+j.findVarValue("z").toString()); j.getSymbolTable().clearValues(); j.setVarValue("x",new Double(7)); System.out.println(j.evaluate(node15)); System.out.println("z: "+j.getVarValue("z").toString()); } catch(ParseException e) { System.out.println("Error with parsing"); } catch(Exception e) { System.out.println("Error with evaluation"); } }
| 1,115,490
|
public void ignorableWhitespace(char buf[], int offset, int len) throws SAXException { nl(); // emit("IGNORABLE"); }
|
public void ignorableWhitespace(char buf[], int offset, int len) throws SAXException { // emit("IGNORABLE"); }
| 1,115,491
|
public void processingInstruction(String target, String data) throws SAXException { nl(); emit("PROCESS: "); emit("<?" + target + " " + data + "?>"); }
|
public void processingInstruction(String target, String data) throws SAXException { emit("PROCESS: "); emit("<?" + target + " " + data + "?>"); }
| 1,115,492
|
public XMLDataSet(DocumentBuilder docBuilder, URL base, Element config) { this(docBuilder, base); this.config = config; }
|
public XMLDataSet(DocumentBuilder docBuilder, URL base, Element config) { this(docBuilder, base); this.config = config; }
| 1,115,494
|
public void addSeismogram(LocalSeismogramImpl seis, AuditInfo[] audit) { seismogramNameCache = null; // Note this does not set the xlink, as the seis has not been saved anywhere yet. Document doc = config.getOwnerDocument(); Element localSeismogram = doc.createElement("localSeismogram");//doc.createElement("SacSeismogram"); String name =seis.getProperty(seisNameKey); if (name == null || name.length() == 0) { name = seis.channel_id.network_id.network_code+"."+ seis.channel_id.station_code+"."+ seis.channel_id.channel_code; //edu.iris.Fissures.network.ChannelIdUtil.toStringNoDates(seis.channel_id); } name = getUniqueName(name); seis.setName(name); Element seismogramAttr = doc.createElement("seismogramAttr"); XMLSeismogramAttr.insert(seismogramAttr, (LocalSeismogram)seis); //localSeismogram.appendChild(seismogramAttr); Element propertyElement = doc.createElement("property"); propertyElement.appendChild(XMLUtil.createTextElement(doc, "name", "Name")); propertyElement.appendChild(XMLUtil.createTextElement(doc, "value", name)); ///seismogramAttr.appendChild(propertyElement); localSeismogram.appendChild(seismogramAttr); Property[] props = seis.getProperties(); //System.out.println("the length of the Properties of the seismogram are "+props.length); Element propE, propNameE, propValueE; for (int i=0; i<props.length; i++) { if (props[i].name != seisNameKey) { propE = doc.createElement("property"); propNameE = doc.createElement("name"); propNameE.setNodeValue(props[i].name); propValueE = doc.createElement("value"); propValueE.setNodeValue(props[i].value); propE.appendChild(propNameE); propE.appendChild(propValueE); localSeismogram.appendChild(propE); } } config.appendChild(localSeismogram); seismogramCache.put(name, seis); logger.debug("added seis now "+getSeismogramNames().length+" seisnogram names."); seismogramNameCache = null; //xpath = new XPathAPI(); //xpath = new CachedXPathAPI(xpath); logger.debug("2 added seis now "+getSeismogramNames().length+" seisnogram names."); }
|
public void addSeismogram(LocalSeismogramImpl seis, AuditInfo[] audit) { seismogramNameCache = null; // Note this does not set the xlink, as the seis has not been saved anywhere yet. Document doc = config.getOwnerDocument(); Element localSeismogram = doc.createElement("localSeismogram");//doc.createElement("SacSeismogram"); String name =seis.getProperty(seisNameKey); if (name == null || name.length() == 0) { name = seis.channel_id.network_id.network_code+"."+ seis.channel_id.station_code+"."+ seis.channel_id.channel_code; //edu.iris.Fissures.network.ChannelIdUtil.toStringNoDates(seis.channel_id); } name = getUniqueName(getSeismogramNames(), name); seis.setName(name); Element seismogramAttr = doc.createElement("seismogramAttr"); XMLSeismogramAttr.insert(seismogramAttr, (LocalSeismogram)seis); //localSeismogram.appendChild(seismogramAttr); Element propertyElement = doc.createElement("property"); propertyElement.appendChild(XMLUtil.createTextElement(doc, "name", "Name")); propertyElement.appendChild(XMLUtil.createTextElement(doc, "value", name)); ///seismogramAttr.appendChild(propertyElement); localSeismogram.appendChild(seismogramAttr); Property[] props = seis.getProperties(); //System.out.println("the length of the Properties of the seismogram are "+props.length); Element propE, propNameE, propValueE; for (int i=0; i<props.length; i++) { if (props[i].name != seisNameKey) { propE = doc.createElement("property"); propNameE = doc.createElement("name"); propNameE.setNodeValue(props[i].name); propValueE = doc.createElement("value"); propValueE.setNodeValue(props[i].value); propE.appendChild(propNameE); propE.appendChild(propValueE); localSeismogram.appendChild(propE); } } config.appendChild(localSeismogram); seismogramCache.put(name, seis); logger.debug("added seis now "+getSeismogramNames().length+" seisnogram names."); seismogramNameCache = null; //xpath = new XPathAPI(); //xpath = new CachedXPathAPI(xpath); logger.debug("2 added seis now "+getSeismogramNames().length+" seisnogram names."); }
| 1,115,495
|
public void addSeismogram(LocalSeismogramImpl seis, AuditInfo[] audit) { seismogramNameCache = null; // Note this does not set the xlink, as the seis has not been saved anywhere yet. Document doc = config.getOwnerDocument(); Element localSeismogram = doc.createElement("localSeismogram");//doc.createElement("SacSeismogram"); String name =seis.getProperty(seisNameKey); if (name == null || name.length() == 0) { name = seis.channel_id.network_id.network_code+"."+ seis.channel_id.station_code+"."+ seis.channel_id.channel_code; //edu.iris.Fissures.network.ChannelIdUtil.toStringNoDates(seis.channel_id); } name = getUniqueName(name); seis.setName(name); Element seismogramAttr = doc.createElement("seismogramAttr"); XMLSeismogramAttr.insert(seismogramAttr, (LocalSeismogram)seis); //localSeismogram.appendChild(seismogramAttr); Element propertyElement = doc.createElement("property"); propertyElement.appendChild(XMLUtil.createTextElement(doc, "name", "Name")); propertyElement.appendChild(XMLUtil.createTextElement(doc, "value", name)); ///seismogramAttr.appendChild(propertyElement); localSeismogram.appendChild(seismogramAttr); Property[] props = seis.getProperties(); //System.out.println("the length of the Properties of the seismogram are "+props.length); Element propE, propNameE, propValueE; for (int i=0; i<props.length; i++) { if (props[i].name != seisNameKey) { propE = doc.createElement("property"); propNameE = doc.createElement("name"); propNameE.setNodeValue(props[i].name); propValueE = doc.createElement("value"); propValueE.setNodeValue(props[i].value); propE.appendChild(propNameE); propE.appendChild(propValueE); localSeismogram.appendChild(propE); } } config.appendChild(localSeismogram); seismogramCache.put(name, seis); logger.debug("added seis now "+getSeismogramNames().length+" seisnogram names."); seismogramNameCache = null; //xpath = new XPathAPI(); //xpath = new CachedXPathAPI(xpath); logger.debug("2 added seis now "+getSeismogramNames().length+" seisnogram names."); }
|
public void addSeismogram(LocalSeismogramImpl seis, AuditInfo[] audit) { seismogramNameCache = null; // Note this does not set the xlink, as the seis has not been saved anywhere yet. Document doc = config.getOwnerDocument(); Element localSeismogram = doc.createElement("localSeismogram");//doc.createElement("SacSeismogram"); String name =seis.getProperty(seisNameKey); if (name == null || name.length() == 0) { name = seis.channel_id.network_id.network_code+"."+ seis.channel_id.station_code+"."+ seis.channel_id.channel_code; //edu.iris.Fissures.network.ChannelIdUtil.toStringNoDates(seis.channel_id); } name = getUniqueName(name); seis.setName(name); Element seismogramAttr = doc.createElement("seismogramAttr"); XMLSeismogramAttr.insert(seismogramAttr, (LocalSeismogram)seis); //localSeismogram.appendChild(seismogramAttr); Element propertyElement = doc.createElement("property"); propertyElement.appendChild(XMLUtil.createTextElement(doc, "name", "Name")); propertyElement.appendChild(XMLUtil.createTextElement(doc, "value", name)); ///seismogramAttr.appendChild(propertyElement); localSeismogram.appendChild(seismogramAttr); Property[] props = seis.getProperties(); //System.out.println("the length of the Properties of the seismogram are "+props.length); Element propE, propNameE, propValueE; for (int i=0; i<props.length; i++) { if (props[i] != null && props[i].name != seisNameKey) { propE = doc.createElement("property"); propNameE = doc.createElement("name"); propNameE.setNodeValue(props[i].name); propValueE = doc.createElement("value"); propValueE.setNodeValue(props[i].value); propE.appendChild(propNameE); propE.appendChild(propValueE); localSeismogram.appendChild(propE); } } config.appendChild(localSeismogram); seismogramCache.put(name, seis); logger.debug("added seis now "+getSeismogramNames().length+" seisnogram names."); seismogramNameCache = null; //xpath = new XPathAPI(); //xpath = new CachedXPathAPI(xpath); logger.debug("2 added seis now "+getSeismogramNames().length+" seisnogram names."); }
| 1,115,496
|
public void addSeismogramRef(LocalSeismogramImpl seis, URL seisURL, String name, Property[] props, ParameterRef[] parm_ids, AuditInfo[] audit) { seismogramNameCache = null; String baseStr = base.toString(); String seisStr = seisURL.toString(); if (seisStr.startsWith(baseStr)) { // use relative URL seisStr = seisStr.substring(baseStr.length()); } // end of if (seisStr.startsWith(baseStr)) Document doc = config.getOwnerDocument(); Element localSeismogram = doc.createElement("localSeismogram"); if(name == null || name.length() == 0) { name =seis.getProperty(seisNameKey); } if (name == null || name.length() == 0) { name = edu.iris.Fissures.network.ChannelIdUtil.toStringNoDates(seis.channel_id); } name = getUniqueName(name); seis.setName(name); Element seismogramAttr = doc.createElement("seismogramAttr"); XMLSeismogramAttr.insert(seismogramAttr, (LocalSeismogram)seis); //localSeismogram.appendChild(seismogramAttr); Element propertyElement = doc.createElement("property"); propertyElement.appendChild(XMLUtil.createTextElement(doc, "name", "Name")); propertyElement.appendChild(XMLUtil.createTextElement(doc, "value", name)); //seismogramAttr.appendChild(propertyElement); localSeismogram.appendChild(seismogramAttr); Element data = doc.createElement("data"); data.setAttributeNS(xlinkNS, "xlink:type", "simple"); data.setAttributeNS(xlinkNS, "xlink:href", seisStr); data.setAttribute("seisType", "sac"); //Element nameE = doc.createElement("name"); // Text text = doc.createTextNode(name); //nameE.appendChild(text); //localSeismogram.appendChild(nameE); localSeismogram.appendChild(data); /* Element propE, propNameE, propValueE; for (int i=0; i<props.length; i++) { if (props[i].name != seisNameKey) { propE = doc.createElement("property"); propNameE = doc.createElement("name"); text = doc.createTextNode(props[i].name); propNameE.appendChild(text); propValueE = doc.createElement("value"); text = doc.createTextNode(props[i].value); propValueE.appendChild(text); propE.appendChild(propNameE); propE.appendChild(propValueE); sac.appendChild(propE); } }*/ config.appendChild(localSeismogram); }
|
public void addSeismogramRef(LocalSeismogramImpl seis, URL seisURL, String name, Property[] props, ParameterRef[] parm_ids, AuditInfo[] audit) { seismogramNameCache = null; String baseStr = base.toString(); String seisStr = seisURL.toString(); if (seisStr.startsWith(baseStr)) { // use relative URL seisStr = seisStr.substring(baseStr.length()); } // end of if (seisStr.startsWith(baseStr)) Document doc = config.getOwnerDocument(); Element localSeismogram = doc.createElement("localSeismogram"); if(name == null || name.length() == 0) { name =seis.getProperty(seisNameKey); } if (name == null || name.length() == 0) { name = edu.iris.Fissures.network.ChannelIdUtil.toStringNoDates(seis.channel_id); } name = getUniqueName(getSeismogramNames(), name); seis.setName(name); Element seismogramAttr = doc.createElement("seismogramAttr"); XMLSeismogramAttr.insert(seismogramAttr, (LocalSeismogram)seis); //localSeismogram.appendChild(seismogramAttr); Element propertyElement = doc.createElement("property"); propertyElement.appendChild(XMLUtil.createTextElement(doc, "name", "Name")); propertyElement.appendChild(XMLUtil.createTextElement(doc, "value", name)); //seismogramAttr.appendChild(propertyElement); localSeismogram.appendChild(seismogramAttr); Element data = doc.createElement("data"); data.setAttributeNS(xlinkNS, "xlink:type", "simple"); data.setAttributeNS(xlinkNS, "xlink:href", seisStr); data.setAttribute("seisType", "sac"); //Element nameE = doc.createElement("name"); // Text text = doc.createTextNode(name); //nameE.appendChild(text); //localSeismogram.appendChild(nameE); localSeismogram.appendChild(data); /* Element propE, propNameE, propValueE; for (int i=0; i<props.length; i++) { if (props[i].name != seisNameKey) { propE = doc.createElement("property"); propNameE = doc.createElement("name"); text = doc.createTextNode(props[i].name); propNameE.appendChild(text); propValueE = doc.createElement("value"); text = doc.createTextNode(props[i].value); propValueE.appendChild(text); propE.appendChild(propNameE); propE.appendChild(propValueE); sac.appendChild(propE); } }*/ config.appendChild(localSeismogram); }
| 1,115,497
|
public DataSet createChildDataSet(String id, String name, String owner, AuditInfo[] audit) { dataSetIdCache = null; XMLDataSet dataset = new XMLDataSet(docBuilder, base, id, name, owner); addDataSet(dataset, audit); return dataset; }
|
public DataSet createChildDataSet(String id, String name, String owner, AuditInfo[] audit) { dataSetIdCache = null; XMLDataSet dataset = new XMLDataSet(docBuilder, base, id, name, owner); return dataset; }
| 1,115,498
|
public DataSet getDataSet(String name) { String[] ids = getDataSetIds(); for (int i=0; i<ids.length; i++) { DataSet ds = getDataSetById(ids[i]); if (name == ds.getName()) { return ds; } } // end of for (int i=0; i<ids.length; i++) return null; }
|
public DataSet getDataSet(String name) { String[] ids = getDataSetIds(); for (int i=0; i<ids.length; i++) { DataSet ds = getDataSetById(ids[i]); logger.debug("++++++++ name is "+name +" the datasetID name is "+ds.getName()); if (name.equals(ds.getName())) { return ds; } } // end of for (int i=0; i<ids.length; i++) return null; }
| 1,115,499
|
public String getUniqueName(String name) { String[] nameList = getSeismogramNames(); int counter = 0; for(int i = 0; i < nameList.length; i++) { if(nameList[i].equals(name)) counter++; } if(counter == 0) return name; return name+"_"+counter; }
|
public String getUniqueName(String name) { String[] nameList = getSeismogramNames(); int counter = 0; for(int i = 0; i < nameList.length; i++) { if(nameList[i].equals(name)) counter++; } if(counter == 0) return name; return name+"_"+counter; }
| 1,115,501
|
public String getUniqueName(String name) { String[] nameList = getSeismogramNames(); int counter = 0; for(int i = 0; i < nameList.length; i++) { if(nameList[i].equals(name)) counter++; } if(counter == 0) return name; return name+"_"+counter; }
|
public String getUniqueName(String name) { String[] nameList = getSeismogramNames(); int counter = 0; for(int i = 0; i < nameList.length; i++) { if(nameList[i].indexOf(name) != -1) counter++; } if(counter == 0) return name; return name+"_"+counter; }
| 1,115,502
|
public String getUniqueName(String name) { String[] nameList = getSeismogramNames(); int counter = 0; for(int i = 0; i < nameList.length; i++) { if(nameList[i].equals(name)) counter++; } if(counter == 0) return name; return name+"_"+counter; }
|
public String getUniqueName(String name) { String[] nameList = getSeismogramNames(); int counter = 0; for(int i = 0; i < nameList.length; i++) { if(nameList[i].equals(name)) counter++; } if(counter == 0) return name; return name+"_"+(counter+1); }
| 1,115,503
|
public synchronized RunT getLastStableBuild() { RunT r = getLastBuild(); while(r!=null && r.getResult()!=null && r.getResult().isWorseThan(Result.SUCCESS)) r=r.getPreviousBuild(); return r; }
|
public synchronized RunT getLastStableBuild() { RunT r = getLastBuild(); while(r!=null && (r.getResult()==null || r.getResult().isWorseThan(Result.SUCCESS))) r=r.getPreviousBuild(); return r; }
| 1,115,506
|
public synchronized RunT getLastSuccessfulBuild() { RunT r = getLastBuild(); while(r!=null && r.getResult()!=null && r.getResult().isWorseThan(Result.UNSTABLE)) r=r.getPreviousBuild(); return r; }
|
public synchronized RunT getLastSuccessfulBuild() { RunT r = getLastBuild(); while(r!=null && (r.getResult()==null || r.getResult().isWorseThan(Result.UNSTABLE))) r=r.getPreviousBuild(); return r; }
| 1,115,507
|
public static Message parseMessage( MsgHeader header, Connection connection ) throws IOException, InvalidMessageException { byte[] body = readMessageBody( connection, header.getDataLength() ); Message message = createMessageFromBody( header, body ); return message; }
|
public static Message parseMessage( Connection connection ) throws IOException, InvalidMessageException { byte[] body = readMessageBody( connection, header.getDataLength() ); Message message = createMessageFromBody( header, body ); return message; }
| 1,115,509
|
public static Message parseMessage( MsgHeader header, Connection connection ) throws IOException, InvalidMessageException { byte[] body = readMessageBody( connection, header.getDataLength() ); Message message = createMessageFromBody( header, body ); return message; }
|
public static Message parseMessage( MsgHeader header, Connection connection ) throws IOException, InvalidMessageException { byte[] body = readMessageBody( connection, header.getDataLength() ); Message message = createMessageFromBody( header, body ); return message; }
| 1,115,510
|
public void doBuildStatus( StaplerRequest req, StaplerResponse rsp ) throws IOException { rsp.sendRedirect(req.getContextPath()+'/'+getBuildStatusUrl()); }
|
public void doBuildStatus( StaplerRequest req, StaplerResponse rsp ) throws IOException { rsp.sendRedirect(req.getContextPath()+"/nocacheImages/48x48/"+getBuildStatusUrl()); }
| 1,115,512
|
public Node substitute(Node orig,String name,Node replacement,XJep xjep) throws ParseException { this.names = new String[]{name}; this.replacements = new Node[]{replacement}; this.xjep=xjep; Node res = (Node) orig.jjtAccept(this,null); return res; }
|
public Node substitute(Node orig,String name,Node replacement,XJep xj) throws ParseException { this.names = new String[]{name}; this.replacements = new Node[]{replacement}; this.xjep=xjep; Node res = (Node) orig.jjtAccept(this,null); return res; }
| 1,115,513
|
public Node substitute(Node orig,String name,Node replacement,XJep xjep) throws ParseException { this.names = new String[]{name}; this.replacements = new Node[]{replacement}; this.xjep=xjep; Node res = (Node) orig.jjtAccept(this,null); return res; }
|
public Node substitute(Node orig,String name,Node replacement,XJep xjep) throws ParseException { this.names = new String[]{name}; this.replacements = new Node[]{replacement}; this.xjep=xj; Node res = (Node) orig.jjtAccept(this,null); return res; }
| 1,115,514
|
public static void main(String[] args) { XJep j = new XJep(); j.addStandardConstants(); j.addStandardFunctions(); j.addComplex(); j.setAllowUndeclared(true); j.setImplicitMul(true); j.setAllowAssignment(true); try { // parse expression Node node = j.parse("a*b+c*(d+sin(x))"); // print it j.println(node); // convert to string String str = j.toString(node); System.out.println("String is '"+str+"'"); j.pv.setFullBrackets(true); j.println(node); j.pv.setFullBrackets(false); Node node2=j.parse("1*x^1+0"); j.println(node2); Node simp=j.simplify(node2); j.println(simp); } catch(ParseException e) { System.out.println("Parse error"); } }
|
public static void main(String[] args) { XJep j = new XJep(); j.addStandardConstants(); j.addStandardFunctions(); j.addComplex(); j.setAllowUndeclared(true); j.setImplicitMul(true); j.setAllowAssignment(true); try { // parse expression Node node = j.parse("a*b+c*(d+sin(x))"); // print it j.println(node); // convert to string String str = j.toString(node); System.out.println("String is '"+str+"'"); j.getPrintVisitor().setFullBrackets(true); j.println(node); j.pv.setFullBrackets(false); Node node2=j.parse("1*x^1+0"); j.println(node2); Node simp=j.simplify(node2); j.println(simp); } catch(ParseException e) { System.out.println("Parse error"); } }
| 1,115,515
|
public static void main(String[] args) { XJep j = new XJep(); j.addStandardConstants(); j.addStandardFunctions(); j.addComplex(); j.setAllowUndeclared(true); j.setImplicitMul(true); j.setAllowAssignment(true); try { // parse expression Node node = j.parse("a*b+c*(d+sin(x))"); // print it j.println(node); // convert to string String str = j.toString(node); System.out.println("String is '"+str+"'"); j.pv.setFullBrackets(true); j.println(node); j.pv.setFullBrackets(false); Node node2=j.parse("1*x^1+0"); j.println(node2); Node simp=j.simplify(node2); j.println(simp); } catch(ParseException e) { System.out.println("Parse error"); } }
|
public static void main(String[] args) { XJep j = new XJep(); j.addStandardConstants(); j.addStandardFunctions(); j.addComplex(); j.setAllowUndeclared(true); j.setImplicitMul(true); j.setAllowAssignment(true); try { // parse expression Node node = j.parse("a*b+c*(d+sin(x))"); // print it j.println(node); // convert to string String str = j.toString(node); System.out.println("String is '"+str+"'"); j.pv.setFullBrackets(true); j.println(node); j.getPrintVisitor().setFullBrackets(false); Node node2=j.parse("1*x^1+0"); j.println(node2); Node simp=j.simplify(node2); j.println(simp); } catch(ParseException e) { System.out.println("Parse error"); } }
| 1,115,516
|
public synchronized void signal() { if(signaled) throw new IllegalStateException(); // already signaled this.signaled = true; notify(); }
|
public synchronized void signal() { if(signaled) throw new IllegalStateException(); // already signaled this.signaled = true; notify(); }
| 1,115,517
|
public void setStatus( HostStatus status, String msg, long statusTime) { if ( this.status == status && lastStatusMsg != null && lastStatusMsg.equals(msg) ) { return; } this.status = status; lastStatusMsg = msg; this.statusTime = statusTime; hostsContainer.fireNetworkHostChanged(this); }
|
public void setStatus( HostStatus status) { if ( this.status == status && lastStatusMsg != null && lastStatusMsg.equals(msg) ) { return; } this.status = status; lastStatusMsg = msg; this.statusTime = statusTime; hostsContainer.fireNetworkHostChanged(this); }
| 1,115,518
|
public void setStatus( HostStatus status, String msg, long statusTime) { if ( this.status == status && lastStatusMsg != null && lastStatusMsg.equals(msg) ) { return; } this.status = status; lastStatusMsg = msg; this.statusTime = statusTime; hostsContainer.fireNetworkHostChanged(this); }
|
public void setStatus( HostStatus status, String msg, long statusTime) { if ( this.status == status && lastStatusMsg != null && lastStatusMsg.equals(msg) ) { return; } this.status = status; lastStatusMsg = msg; this.statusTime = statusTime; hostsContainer.fireNetworkHostChanged(this); }
| 1,115,519
|
public Object getValueAt(int row, int col) { try { switch (col) { case 0 : return data.getStepType(row); case 1 : return data.getStepMethod(row); case 2 : return data.df1.format( new Double(data.getStepStartTemp(row)) ); case 3 : return data.df1.format( new Double(data.getStepEndTemp(row)) ); case 4 : return new Double(data.getStepRampMin(row)); case 5 : return new Double(data.getStepMin(row)); } } catch (Exception e) { }; return ""; }
|
public Object getValueAt(int row, int col) { try { switch (col) { case 0 : return data.getStepType(row); case 1 : return data.getStepMethod(row); case 2 : return data.df1.format( new Double(data.getStepStartTemp(row)) ); case 3 : return data.df1.format( new Double(data.getStepEndTemp(row)) ); case 4 : return new Double(data.getStepRampMin(row)); case 5 : return new Double(data.getStepMin(row)); } } catch (Exception e) { }; return ""; }
| 1,115,520
|
public Object getValueAt(int row, int col) { try { switch (col) { case 0 : return data.getStepType(row); case 1 : return data.getStepMethod(row); case 2 : return data.df1.format( new Double(data.getStepStartTemp(row)) ); case 3 : return data.df1.format( new Double(data.getStepEndTemp(row)) ); case 4 : return new Double(data.getStepRampMin(row)); case 5 : return new Double(data.getStepMin(row)); } } catch (Exception e) { }; return ""; }
|
public Object getValueAt(int row, int col) { try { switch (col) { case 0 : return data.getStepType(row); case 1 : return data.getStepMethod(row); case 2 : return data.df1.format( new Double(data.getStepStartTemp(row)) ); case 3 : return new Double(data.getStepEndTemp(row)) ; case 4 : return new Double(data.getStepRampMin(row)); case 5 : return new Double(data.getStepMin(row)); } } catch (Exception e) { }; return ""; }
| 1,115,521
|
public Object getValueAt(int row, int col) { try { switch (col) { case 0 : return data.getStepType(row); case 1 : return data.getStepMethod(row); case 2 : return data.df1.format( new Double(data.getStepStartTemp(row)) ); case 3 : return data.df1.format( new Double(data.getStepEndTemp(row)) ); case 4 : return new Double(data.getStepRampMin(row)); case 5 : return new Double(data.getStepMin(row)); } } catch (Exception e) { }; return ""; }
|
public Object getValueAt(int row, int col) { try { switch (col) { case 0 : return data.getStepType(row); case 1 : return data.getStepMethod(row); case 2 : return data.df1.format( new Double(data.getStepStartTemp(row)) ); case 3 : return data.df1.format( new Double(data.getStepEndTemp(row)) ); case 4 : return new Integer(data.getStepRampMin(row)); case 5 : return new Double(data.getStepMin(row)); } } catch (Exception e) { }; return ""; }
| 1,115,522
|
public Object getValueAt(int row, int col) { try { switch (col) { case 0 : return data.getStepType(row); case 1 : return data.getStepMethod(row); case 2 : return data.df1.format( new Double(data.getStepStartTemp(row)) ); case 3 : return data.df1.format( new Double(data.getStepEndTemp(row)) ); case 4 : return new Double(data.getStepRampMin(row)); case 5 : return new Double(data.getStepMin(row)); } } catch (Exception e) { }; return ""; }
|
public Object getValueAt(int row, int col) { try { switch (col) { case 0 : return data.getStepType(row); case 1 : return data.getStepMethod(row); case 2 : return data.df1.format( new Double(data.getStepStartTemp(row)) ); case 3 : return data.df1.format( new Double(data.getStepEndTemp(row)) ); case 4 : return new Double(data.getStepRampMin(row)); case 5 : return new Integer(data.getStepMin(row)); } } catch (Exception e) { }; return ""; }
| 1,115,523
|
public void setValueAt(Object value, int row, int col) { try { switch (col) { case 0 : data.setStepType(row, value.toString()); break; case 1 : data.setStepMethod(row, value.toString()); break; case 2 : data.setStepStartTemp(row, Integer.parseInt(value.toString())); break; case 3 : data.setStepEndTemp(row, Integer.parseInt(value.toString())); break; case 4 : data.setStepRampMin(row, Integer.parseInt(value.toString())); break; case 5 : data.setStepMin(row, Integer.parseInt(value.toString())); break; } } catch (Exception e) { }; data.calcMashSchedule(); fireTableCellUpdated(row, col); fireTableDataChanged(); mashManager.displayMash(); }
|
public void setValueAt(Object value, int row, int col) { try { switch (col) { case 0 : data.setStepType(row, value.toString()); break; case 1 : data.setStepMethod(row, value.toString()); break; case 2 : data.setStepStartTemp(row, Double.parseDouble(value.toString())); break; case 3 : data.setStepEndTemp(row, Integer.parseInt(value.toString())); break; case 4 : data.setStepRampMin(row, Integer.parseInt(value.toString())); break; case 5 : data.setStepMin(row, Integer.parseInt(value.toString())); break; } } catch (Exception e) { }; data.calcMashSchedule(); fireTableCellUpdated(row, col); fireTableDataChanged(); mashManager.displayMash(); }
| 1,115,525
|
public void setValueAt(Object value, int row, int col) { try { switch (col) { case 0 : data.setStepType(row, value.toString()); break; case 1 : data.setStepMethod(row, value.toString()); break; case 2 : data.setStepStartTemp(row, Integer.parseInt(value.toString())); break; case 3 : data.setStepEndTemp(row, Integer.parseInt(value.toString())); break; case 4 : data.setStepRampMin(row, Integer.parseInt(value.toString())); break; case 5 : data.setStepMin(row, Integer.parseInt(value.toString())); break; } } catch (Exception e) { }; data.calcMashSchedule(); fireTableCellUpdated(row, col); fireTableDataChanged(); mashManager.displayMash(); }
|
public void setValueAt(Object value, int row, int col) { try { switch (col) { case 0 : data.setStepType(row, value.toString()); break; case 1 : data.setStepMethod(row, value.toString()); break; case 2 : data.setStepStartTemp(row, Integer.parseInt(value.toString())); break; case 3 : data.setStepEndTemp(row, Double.parseDouble(value.toString())); break; case 4 : data.setStepRampMin(row, Integer.parseInt(value.toString())); break; case 5 : data.setStepMin(row, Integer.parseInt(value.toString())); break; } } catch (Exception e) { }; data.calcMashSchedule(); fireTableCellUpdated(row, col); fireTableDataChanged(); mashManager.displayMash(); }
| 1,115,526
|
private Map<String,String> inherit(String[] env) { Map<String,String> m = new HashMap<String,String>(EnvVars.masterEnvVars); for( int i=0; i<env.length; i+=2 ) { if(env[i+1]==null) m.remove(env[i]); else m.put(env[i],env[i+1]); } return m; }
|
private Map<String,String> inherit(String[] env) { Map<String,String> m = new HashMap<String,String>(EnvVars.masterEnvVars); for( int i=0; i<env.length; i+=2 ) { if(env[i+1]==null) m.remove(env[i]); else m.put(env[i],env[i+1]); } return m; }
| 1,115,527
|
private Map<String,String> inherit(String[] env) { Map<String,String> m = new HashMap<String,String>(EnvVars.masterEnvVars); for( int i=0; i<env.length; i+=2 ) { if(env[i+1]==null) m.remove(env[i]); else m.put(env[i],env[i+1]); } return m; }
|
private Map<String,String> inherit(String[] env) { Map<String,String> m = new HashMap<String,String>(EnvVars.masterEnvVars); for( int i=0; i<env.length; i+=2 ) { if(env[i+1]==null) m.remove(env[i]); else m.put(key,value); } return m; }
| 1,115,528
|
public void testBad() throws ParseException { if(SHOW_BAD) { simplifyTest("1&&(1||x)","1"); simplifyTest("diff(sgn(x),x)","0"); // sgn not implemented simplifyTest("diff(re(x+i y),x)","1"); // not smart enought to work out re(i) = 1 simplifyTest("diff(re(x+i y),y)","0"); simplifyTest("diff(im(x+i y),x)","0"); simplifyTest("diff(im(x+i y),y)","1"); simplifyTest("(x/2)*3","x*1.5"); } }
|
public void testBad() throws Exception { if(SHOW_BAD) { simplifyTest("1&&(1||x)","1"); simplifyTest("diff(sgn(x),x)","0"); // sgn not implemented simplifyTest("diff(re(x+i y),x)","1"); // not smart enought to work out re(i) = 1 simplifyTest("diff(re(x+i y),y)","0"); simplifyTest("diff(im(x+i y),x)","0"); simplifyTest("diff(im(x+i y),y)","1"); simplifyTest("(x/2)*3","x*1.5"); } }
| 1,115,529
|
public Complex getComplexValue() { Object value = getValueAsObject(); if (value == null) { return null; } else if (value instanceof Number) { return new Complex(((Number)value).doubleValue(), 0); } else if (value instanceof Complex) { return (Complex)value; } else { return null; } }
|
public Complex getComplexValue() { Object value = getValueAsObject(); if (value == null) { return null; } else if (value instanceof Number) { return new Complex(((Number)value).doubleValue(), 0); } else if (value instanceof Complex) { return (Complex)value; } else { return null; } }
| 1,115,531
|
private void processFile(final String line) { if (line.startsWith("Working file:")) { m_file = line.substring(14, line.length()); m_status = GET_REVISION; } }
|
private void processFile(final String line) { if (line.startsWith("Working file:")) { m_file = line.substring(14, line.length()); m_status = GET_SYMBOLIC_NAMES; } }
| 1,115,532
|
private void saveEntry() { final String entryKey = m_date + m_author + m_comment; CVSEntry entry; if (!m_entries.containsKey(entryKey)) { entry = new CVSEntry(parseDate(m_date), m_author, m_comment); m_entries.put(entryKey, entry); } else { entry = (CVSEntry) m_entries.get(entryKey); } entry.addFile(m_file, m_revision, m_previousRevision, m_dead); }
|
private void saveEntry() { final String entryKey = m_date + m_author + m_comment; CVSEntry entry; if (!m_entries.containsKey(entryKey)) { entry = new CVSEntry(parseDate(m_date), m_author, m_comment); m_entries.put(entryKey, entry); } else { entry = m_entries.get(entryKey); } entry.addFile(m_file, m_revision, m_previousRevision, m_dead); }
| 1,115,534
|
private void saveEntry() { final String entryKey = m_date + m_author + m_comment; CVSEntry entry; if (!m_entries.containsKey(entryKey)) { entry = new CVSEntry(parseDate(m_date), m_author, m_comment); m_entries.put(entryKey, entry); } else { entry = (CVSEntry) m_entries.get(entryKey); } entry.addFile(m_file, m_revision, m_previousRevision, m_dead); }
|
private void saveEntry() { final String entryKey = m_date + m_author + m_comment; CVSEntry entry; if (!m_entries.containsKey(entryKey)) { entry = new CVSEntry(parseDate(m_date), m_author, m_comment); m_entries.put(entryKey, entry); } else { entry = (CVSEntry) m_entries.get(entryKey); } entry.addFile(m_file, m_revision, m_previousRevision, findBranch(m_revision), m_dead); }
| 1,115,535
|
public static XJBPhex loadXJBPhexFromFile( ManagedFile managedFile ) throws JAXBException { if ( !managedFile.getFile().exists() ) { return null; } //NLogger.debug(NLoggerNames.GLOBAL, "Loading XJBPhex from: " + managedFile ); XJBPhex phex; InputStream inStream = null; try { inStream = new ManagedFileInputStream( managedFile, 0 ); // create a JAXBContext JAXBContext jc = JAXBContext.newInstance( "phex.xml" ); // create an Unmarshaller Unmarshaller unmarshaller = jc.createUnmarshaller(); unmarshaller.setEventHandler( new TolerantValidationEventHandler() ); phex = (XJBPhex)unmarshaller.unmarshal( inStream ); return phex; } finally { IOUtil.closeQuietly( inStream ); IOUtil.closeQuietly( managedFile ); } }
|
public static XJBPhex loadXJBPhexFromFile( ManagedFile managedFile ) throws JAXBException { if ( !managedFile.exists() ) { return null; } //NLogger.debug(NLoggerNames.GLOBAL, "Loading XJBPhex from: " + managedFile ); XJBPhex phex; InputStream inStream = null; try { inStream = new ManagedFileInputStream( managedFile, 0 ); // create a JAXBContext JAXBContext jc = JAXBContext.newInstance( "phex.xml" ); // create an Unmarshaller Unmarshaller unmarshaller = jc.createUnmarshaller(); unmarshaller.setEventHandler( new TolerantValidationEventHandler() ); phex = (XJBPhex)unmarshaller.unmarshal( inStream ); return phex; } finally { IOUtil.closeQuietly( inStream ); IOUtil.closeQuietly( managedFile ); } }
| 1,115,538
|
public void cleanUp() { shuttingDown = true; for( Executor e : executors ) e.interrupt(); }
|
public void cleanUp() { shuttingDown = true; for( Executor e : executors ) e.interrupt(); }
| 1,115,539
|
private void load() throws IOException { if(getConfigFile().exists()) { Reader r = new InputStreamReader(new FileInputStream(getConfigFile()),"UTF-8"); createConfiguredStream().unmarshal(new XppReader(r),this); r.close(); } File projectsDir = new File(root,"jobs"); projectsDir.mkdirs(); File[] subdirs = projectsDir.listFiles(new FileFilter() { public boolean accept(File child) { return child.isDirectory(); } }); jobs.clear(); for (final File subdir : subdirs) { try { Job p = Job.load(this,subdir); jobs.put(p.getName(), p); } catch (IOException e) { e.printStackTrace(); // TODO: logging } } }
|
private void load() throws IOException { if(getConfigFile().exists()) { Reader r = new InputStreamReader(new FileInputStream(getConfigFile()),"UTF-8"); createConfiguredStream().unmarshal(new XppReader(r),this); r.close(); } File projectsDir = new File(root,"jobs"); projectsDir.mkdirs(); File[] subdirs = projectsDir.listFiles(new FileFilter() { public boolean accept(File child) { return child.isDirectory(); } }); jobs.clear(); for (final File subdir : subdirs) { try { Job p = Job.load(this,subdir); jobs.put(p.getName(), p); } catch (IOException e) { e.printStackTrace(); // TODO: logging } } }
| 1,115,540
|
private void load() throws IOException { if(getConfigFile().exists()) { Reader r = new InputStreamReader(new FileInputStream(getConfigFile()),"UTF-8"); createConfiguredStream().unmarshal(new XppReader(r),this); r.close(); } File projectsDir = new File(root,"jobs"); projectsDir.mkdirs(); File[] subdirs = projectsDir.listFiles(new FileFilter() { public boolean accept(File child) { return child.isDirectory(); } }); jobs.clear(); for (final File subdir : subdirs) { try { Job p = Job.load(this,subdir); jobs.put(p.getName(), p); } catch (IOException e) { e.printStackTrace(); // TODO: logging } } }
|
private void load() throws IOException { if(getConfigFile().exists()) { Reader r = new InputStreamReader(new FileInputStream(getConfigFile()),"UTF-8"); createConfiguredStream().unmarshal(new XppReader(r),this); r.close(); } File projectsDir = new File(root,"jobs"); projectsDir.mkdirs(); File[] subdirs = projectsDir.listFiles(new FileFilter() { public boolean accept(File child) { return child.isDirectory(); } }); jobs.clear(); for (File subdir : subdirs) { try { Job p = Job.load(this,subdir); jobs.put(p.getName(), p); } catch (IOException e) { e.printStackTrace(); // TODO: logging } } }
| 1,115,541
|
public synchronized void save() throws IOException { Writer w = new OutputStreamWriter(new FileOutputStream(getConfigFile()),"UTF-8"); w.write("<?xml version='1.0' encoding='UTF-8'?>\n"); createConfiguredStream().toXML(this,w); w.close(); }
|
public synchronized void save() throws IOException { Writer w = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(getConfigFile()),"UTF-8")); w.write("<?xml version='1.0' encoding='UTF-8'?>\n"); createConfiguredStream().toXML(this,w); w.close(); }
| 1,115,543
|
static Job load(Hudson root, File dir) throws IOException { Reader r = new InputStreamReader(new FileInputStream(new File(dir,"config.xml")),"UTF-8"); Job job = (Job)createConfiguredStream().unmarshal(new XppReader(r)); r.close(); job.onLoad(root,dir.getName()); return job; }
|
static Job load(Hudson root, File dir) throws IOException { Reader r = new InputStreamReader(new FileInputStream(new File(dir,"config.xml")),"UTF-8"); Job job = (Job)createConfiguredStream().unmarshal(new XppReader(r)); r.close(); job.onLoad(root,dir.getName()); return job; }
| 1,115,544
|
public void toXML( Object o, File f ) throws IOException { Writer w = new OutputStreamWriter(new FileOutputStream(f),"UTF-8"); w.write("<?xml version='1.0' encoding='UTF-8'?>\n"); toXML(o,w); w.close(); }
|
public void toXML( Object o, File f ) throws IOException { Writer w = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f),"UTF-8")); w.write("<?xml version='1.0' encoding='UTF-8'?>\n"); toXML(o,w); w.close(); }
| 1,115,545
|
public void run() { run(new Runner() { public Result run(BuildListener listener) throws IOException { if(!project.checkout(Build.this,listener)) return Result.FAILURE; if(!project.getScm().calcChangeLog(Build.this,new File(getRootDir(),"changelog.xml"),listener)) return Result.FAILURE; if(!preBuild(listener,project.getBuilders())) return Result.FAILURE; if(!preBuild(listener,project.getPublishers())) return Result.FAILURE; if(!build(listener,project.getBuilders())) return Result.FAILURE; if(!isWindows()) { try { // ignore a failure. new Proc(new String[]{"rm","../latest"},new String[0],listener.getLogger(),getProject().getBuildDir()).join(); int r = new Proc(new String[]{ "ln","-s","builds/"+getId()/*ugly*/,"../lastSuccessful"}, new String[0],listener.getLogger(),getProject().getBuildDir()).join(); if(r!=0) listener.getLogger().println("ln failed: "+r); } catch (IOException e) { PrintStream log = listener.getLogger(); log.println("ln failed"); e.printStackTrace( log ); } } return Result.SUCCESS; } public void post(BuildListener listener) { build(listener,project.getPublishers()); } }); }
|
public void run() { run(new Runner() { public Result run(BuildListener listener) throws IOException { if(!project.checkout(Build.this,listener)) return Result.FAILURE; if(!project.getScm().calcChangeLog(Build.this,new File(getRootDir(),"changelog.xml"),listener)) return Result.FAILURE; if(!preBuild(listener,project.getBuilders())) return Result.FAILURE; if(!preBuild(listener,project.getPublishers())) return Result.FAILURE; if(!build(listener,project.getBuilders())) return Result.FAILURE; if(!isWindows()) { try { // ignore a failure. new Proc(new String[]{"rm","../lastSuccessful"},new String[0],listener.getLogger(),getProject().getBuildDir()).join(); int r = new Proc(new String[]{ "ln","-s","builds/"+getId()/*ugly*/,"../lastSuccessful"}, new String[0],listener.getLogger(),getProject().getBuildDir()).join(); if(r!=0) listener.getLogger().println("ln failed: "+r); } catch (IOException e) { PrintStream log = listener.getLogger(); log.println("ln failed"); e.printStackTrace( log ); } } return Result.SUCCESS; } public void post(BuildListener listener) { build(listener,project.getPublishers()); } }); }
| 1,115,546
|
public Result run(BuildListener listener) throws IOException { if(!project.checkout(Build.this,listener)) return Result.FAILURE; if(!project.getScm().calcChangeLog(Build.this,new File(getRootDir(),"changelog.xml"),listener)) return Result.FAILURE; if(!preBuild(listener,project.getBuilders())) return Result.FAILURE; if(!preBuild(listener,project.getPublishers())) return Result.FAILURE; if(!build(listener,project.getBuilders())) return Result.FAILURE; if(!isWindows()) { try { // ignore a failure. new Proc(new String[]{"rm","../latest"},new String[0],listener.getLogger(),getProject().getBuildDir()).join(); int r = new Proc(new String[]{ "ln","-s","builds/"+getId()/*ugly*/,"../lastSuccessful"}, new String[0],listener.getLogger(),getProject().getBuildDir()).join(); if(r!=0) listener.getLogger().println("ln failed: "+r); } catch (IOException e) { PrintStream log = listener.getLogger(); log.println("ln failed"); e.printStackTrace( log ); } } return Result.SUCCESS; }
|
public Result run(BuildListener listener) throws IOException { if(!project.checkout(Build.this,listener)) return Result.FAILURE; if(!project.getScm().calcChangeLog(Build.this,new File(getRootDir(),"changelog.xml"),listener)) return Result.FAILURE; if(!preBuild(listener,project.getBuilders())) return Result.FAILURE; if(!preBuild(listener,project.getPublishers())) return Result.FAILURE; if(!build(listener,project.getBuilders())) return Result.FAILURE; if(!isWindows()) { try { // ignore a failure. new Proc(new String[]{"rm","../lastSuccessful"},new String[0],listener.getLogger(),getProject().getBuildDir()).join(); int r = new Proc(new String[]{ "ln","-s","builds/"+getId()/*ugly*/,"../lastSuccessful"}, new String[0],listener.getLogger(),getProject().getBuildDir()).join(); if(r!=0) listener.getLogger().println("ln failed: "+r); } catch (IOException e) { PrintStream log = listener.getLogger(); log.println("ln failed"); e.printStackTrace( log ); } } return Result.SUCCESS; }
| 1,115,547
|
SQETestAction(Build owner, DirectoryScanner results, BuildListener listener) { super(owner); listener.getLogger().println("Collecting JWSDP SQE reports"); int counter=0; File dataDir = getDataDir(); dataDir.mkdirs(); long buildTime = owner.getTimestamp().getTimeInMillis(); // archive report files for (String file : results.getIncludedFiles()) { File src = new File(results.getBasedir(), file); if(src.lastModified()<buildTime) { listener.getLogger().println("Skipping "+src+" because it's not up to date"); continue; // not up to date. } Copy cp = new Copy(); cp.setProject(new Project()); cp.setFile(src); cp.setTofile(new File(dataDir,"report"+(counter++)+".xml")); cp.execute(); } Report r = load(listener); totalCount = r.getTotalCount(); failCount = r.getFailCount(); result = new WeakReference<Report>(r); }
|
SQETestAction(Build owner, DirectoryScanner results, BuildListener listener, boolean considerTestAsTestObject) { super(owner); listener.getLogger().println("Collecting JWSDP SQE reports"); int counter=0; File dataDir = getDataDir(); dataDir.mkdirs(); long buildTime = owner.getTimestamp().getTimeInMillis(); // archive report files for (String file : results.getIncludedFiles()) { File src = new File(results.getBasedir(), file); if(src.lastModified()<buildTime) { listener.getLogger().println("Skipping "+src+" because it's not up to date"); continue; // not up to date. } Copy cp = new Copy(); cp.setProject(new Project()); cp.setFile(src); cp.setTofile(new File(dataDir,"report"+(counter++)+".xml")); cp.execute(); } Report r = load(listener); totalCount = r.getTotalCount(); failCount = r.getFailCount(); result = new WeakReference<Report>(r); }
| 1,115,548
|
public ChangeLogSet getChangeSet() { if(scm==null) scm = new CVSChangeLogParser(); if(changeSet==null) // cached value changeSet = calcChangeSet(); return changeSet; }
|
public ChangeLogSet<?> getChangeSet() { if(scm==null) scm = new CVSChangeLogParser(); if(changeSet==null) // cached value changeSet = calcChangeSet(); return changeSet; }
| 1,115,550
|
public void doBuildStatus( StaplerRequest req, StaplerResponse rsp ) throws IOException { rsp.sendRedirect(req.getContextPath()+"/nocacheImages/48x48/"+getBuildStatusUrl()); }
|
public void doBuildStatus( StaplerRequest req, StaplerResponse rsp ) throws IOException { rsp.sendRedirect2(req.getContextPath()+"/nocacheImages/48x48/"+getBuildStatusUrl()); }
| 1,115,551
|
public synchronized void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException { if(!Hudson.adminCheck(req,rsp)) return; Util.deleteRecursive(root); getParent().deleteJob(this); rsp.sendRedirect(req.getContextPath()+"/"); }
|
public synchronized void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException { if(!Hudson.adminCheck(req,rsp)) return; Util.deleteRecursive(root); getParent().deleteJob(this); rsp.sendRedirect2(req.getContextPath()+"/"); }
| 1,115,552
|
public String getUrl() { return "job/"+WHITESPACE_REPLACER.matcher(name).replaceAll("%20")+'/'; }
|
public String getUrl() { return "job/"+name+'/'; }
| 1,115,553
|
public void addSeismogram(LocalSeismogramImpl seis, AuditInfo[] audit) { seismogramNameCache = null; // Note this does not set the xlink, as the seis has not been saved anywhere yet. Document doc = config.getOwnerDocument(); Element localSeismogram = doc.createElement("localSeismogram");//doc.createElement("SacSeismogram"); String name =seis.getProperty(seisNameKey); if (name == null || name.length() == 0) { name = edu.iris.Fissures.network.ChannelIdUtil.toStringNoDates(seis.channel_id); } name = getUniqueName(name); seis.setName(name); Element seismogramAttr = doc.createElement("seismogramAttr"); XMLSeismogramAttr.insert(seismogramAttr, (LocalSeismogram)seis); //localSeismogram.appendChild(seismogramAttr); Element propertyElement = doc.createElement("property"); propertyElement.appendChild(XMLUtil.createTextElement(doc, "name", "Name")); propertyElement.appendChild(XMLUtil.createTextElement(doc, "value", name)); ///seismogramAttr.appendChild(propertyElement); localSeismogram.appendChild(seismogramAttr); Property[] props = seis.getProperties(); //System.out.println("the length of the Properties of the seismogram are "+props.length); Element propE, propNameE, propValueE; for (int i=0; i<props.length; i++) { if (props[i].name != seisNameKey) { propE = doc.createElement("property"); propNameE = doc.createElement("name"); propNameE.setNodeValue(props[i].name); propValueE = doc.createElement("value"); propValueE.setNodeValue(props[i].value); propE.appendChild(propNameE); propE.appendChild(propValueE); localSeismogram.appendChild(propE); } } config.appendChild(localSeismogram); seismogramCache.put(name, seis); logger.debug("added seis now "+getSeismogramNames().length+" seisnogram names."); //xpath = new CachedXPathAPI(xpath); logger.debug("2 added seis now "+getSeismogramNames().length+" seisnogram names."); }
|
public void addSeismogram(LocalSeismogramImpl seis, AuditInfo[] audit) { seismogramNameCache = null; // Note this does not set the xlink, as the seis has not been saved anywhere yet. Document doc = config.getOwnerDocument(); Element localSeismogram = doc.createElement("localSeismogram");//doc.createElement("SacSeismogram"); String name =seis.getProperty(seisNameKey); if (name == null || name.length() == 0) { name = seis.channel_id.network_id.network_code+"."+ seis.channel_id.station_code+"."+ seis.channel_id.channel_code; } name = getUniqueName(name); seis.setName(name); Element seismogramAttr = doc.createElement("seismogramAttr"); XMLSeismogramAttr.insert(seismogramAttr, (LocalSeismogram)seis); //localSeismogram.appendChild(seismogramAttr); Element propertyElement = doc.createElement("property"); propertyElement.appendChild(XMLUtil.createTextElement(doc, "name", "Name")); propertyElement.appendChild(XMLUtil.createTextElement(doc, "value", name)); ///seismogramAttr.appendChild(propertyElement); localSeismogram.appendChild(seismogramAttr); Property[] props = seis.getProperties(); //System.out.println("the length of the Properties of the seismogram are "+props.length); Element propE, propNameE, propValueE; for (int i=0; i<props.length; i++) { if (props[i].name != seisNameKey) { propE = doc.createElement("property"); propNameE = doc.createElement("name"); propNameE.setNodeValue(props[i].name); propValueE = doc.createElement("value"); propValueE.setNodeValue(props[i].value); propE.appendChild(propNameE); propE.appendChild(propValueE); localSeismogram.appendChild(propE); } } config.appendChild(localSeismogram); seismogramCache.put(name, seis); logger.debug("added seis now "+getSeismogramNames().length+" seisnogram names."); //xpath = new CachedXPathAPI(xpath); logger.debug("2 added seis now "+getSeismogramNames().length+" seisnogram names."); }
| 1,115,554
|
public void actionPerformed( ActionEvent e ) { if ( lastDownloadFile == null ) { return; } final File file = lastDownloadFile.getIncompleteFile(); if ( file == null ) { return; } File dir = file.getParentFile(); try { SystemShellExecute.exploreFolder( dir ); } catch (IOException exp) {// ignore and do nothing.. } }
|
public void actionPerformed( ActionEvent e ) { if ( lastDownloadFile == null ) { return; } File file = null; try { file = lastDownloadFile.getIncompleteDownloadFile().getFile(); } catch ( ManagedFileException exp ) { NLogger.error( DownloadOverviewPanel.class, exp ); } catch ( FileHandlingException exp ) { NLogger.error( DownloadOverviewPanel.class, exp ); } if ( file == null ) { return; } File dir = file.getParentFile(); try { SystemShellExecute.exploreFolder( dir ); } catch (IOException exp) {// ignore and do nothing.. } }
| 1,115,556
|
private void updateInterface() { if ( lastDownloadFile == null ) { progressBar.setDownloadFile( null ); progressLabel.setText(""); downloadedLabel.setText(""); downloadedLabel.setToolTipText(""); remainingLabel.setText(""); remainingLabel.setToolTipText(""); totalSizeLabel.setText(""); totalSizeLabel.setToolTipText(""); createdLabel.setText(""); lastDownloadedLabel.setText(""); downloadRateLabel.setText(""); downloadRateLabel.setToolTipText(""); maxRateLabel.setText(""); etaLabel.setText(""); downloadingCandidatesLabel.setText( "" ); queuedCandidatesLabel.setText( "" ); connectingCandidatesLabel.setText( "" ); goodCandidatesLabel.setText( "" ); badCandidatesLabel.setText( "" ); totalCandidatesLabel.setText( "" ); fileNameTxt.setText(""); incompleteFileTxt.setText(""); return; } progressBar.setDownloadFile( lastDownloadFile ); progressLabel.setText( lastDownloadFile.getProgress().toString() + " %" ); downloadedLabel.setText( NumberFormatUtils.formatSignificantByteSize( lastDownloadFile.getTransferredDataSize() ) ); downloadedLabel.setToolTipText( NumberFormatUtils.formatFullByteSize( lastDownloadFile.getTransferredDataSize() ) ); long remaining = lastDownloadFile.getTotalDataSize() - lastDownloadFile.getTransferredDataSize(); remainingLabel.setText( NumberFormatUtils.formatSignificantByteSize( remaining ) ); remainingLabel.setToolTipText( NumberFormatUtils.formatFullByteSize( remaining ) ); totalSizeLabel.setText( NumberFormatUtils.formatSignificantByteSize( lastDownloadFile.getTotalDataSize() ) ); totalSizeLabel.setToolTipText( NumberFormatUtils.formatFullByteSize( lastDownloadFile.getTotalDataSize() ) ); createdLabel.setText( dateFormat.format( lastDownloadFile.getCreatedDate() ) ); lastDownloadedLabel.setText( dateFormat.format( lastDownloadFile.getDownloadedDate() ) ); downloadRateLabel.setText( NumberFormatUtils.formatSignificantByteSize( lastDownloadFile.getTransferSpeed() ) + Localizer.getString( "PerSec" ) ); downloadRateLabel.setToolTipText( NumberFormatUtils.formatFullByteSize( lastDownloadFile.getTransferSpeed() ) + Localizer.getString( "PerSec" ) ); long maxRate = lastDownloadFile.getDownloadThrottlingRate(); String maxRateStr; if ( maxRate >= Integer.MAX_VALUE ) { maxRateStr = Localizer.getDecimalFormatSymbols().getInfinity(); } else { maxRateStr = NumberFormatUtils.formatSignificantByteSize( maxRate) + Localizer.getString( "PerSec" ); } maxRateLabel.setText( maxRateStr ); // TODO1 //etaLabel.setText() downloadingCandidatesLabel.setText( String.valueOf( lastDownloadFile.getDownloadingCandidatesCount() ) ); queuedCandidatesLabel.setText( String.valueOf( lastDownloadFile.getQueuedCandidatesCount() ) ); connectingCandidatesLabel.setText( String.valueOf( lastDownloadFile.getConnectingCandidatesCount() ) ); goodCandidatesLabel.setText( String.valueOf( lastDownloadFile.getGoodCandidateCount() ) ); badCandidatesLabel.setText( String.valueOf( lastDownloadFile.getBadCandidateCount() ) ); totalCandidatesLabel.setText( String.valueOf( lastDownloadFile.getCandidatesCount() ) ); String destFile = lastDownloadFile.getDestinationFileName(); if ( !fileNameTxt.getText().equals( destFile ) ) { fileNameTxt.setText( destFile ); fileNameTxt.setCaretPosition(0); } String path = lastDownloadFile.getIncompleteFile().getAbsolutePath(); if ( !incompleteFileTxt.getText().equals( path ) ) { incompleteFileTxt.setText( path ); incompleteFileTxt.setCaretPosition(0); } long curFinBugScopeLength = lastDownloadFile.getMemoryFile().getFinishedBufferedLength(); if ( lastFinBufScopeLength != curFinBugScopeLength ) { lastFinBufScopeLength = curFinBugScopeLength; progressIconLabel.setIcon( twinkleProgressIcon ); resetProgressTwinkleTimer.restart(); } }
|
private void updateInterface() { if ( lastDownloadFile == null ) { progressBar.setDownloadFile( null ); progressLabel.setText(""); downloadedLabel.setText(""); downloadedLabel.setToolTipText(""); remainingLabel.setText(""); remainingLabel.setToolTipText(""); totalSizeLabel.setText(""); totalSizeLabel.setToolTipText(""); createdLabel.setText(""); lastDownloadedLabel.setText(""); downloadRateLabel.setText(""); downloadRateLabel.setToolTipText(""); maxRateLabel.setText(""); etaLabel.setText(""); downloadingCandidatesLabel.setText( "" ); queuedCandidatesLabel.setText( "" ); connectingCandidatesLabel.setText( "" ); goodCandidatesLabel.setText( "" ); badCandidatesLabel.setText( "" ); totalCandidatesLabel.setText( "" ); fileNameTxt.setText(""); incompleteFileTxt.setText(""); return; } progressBar.setDownloadFile( lastDownloadFile ); progressLabel.setText( lastDownloadFile.getProgress().toString() + " %" ); downloadedLabel.setText( NumberFormatUtils.formatSignificantByteSize( lastDownloadFile.getTransferredDataSize() ) ); downloadedLabel.setToolTipText( NumberFormatUtils.formatFullByteSize( lastDownloadFile.getTransferredDataSize() ) ); long remaining = lastDownloadFile.getTotalDataSize() - lastDownloadFile.getTransferredDataSize(); remainingLabel.setText( NumberFormatUtils.formatSignificantByteSize( remaining ) ); remainingLabel.setToolTipText( NumberFormatUtils.formatFullByteSize( remaining ) ); totalSizeLabel.setText( NumberFormatUtils.formatSignificantByteSize( lastDownloadFile.getTotalDataSize() ) ); totalSizeLabel.setToolTipText( NumberFormatUtils.formatFullByteSize( lastDownloadFile.getTotalDataSize() ) ); createdLabel.setText( dateFormat.format( lastDownloadFile.getCreatedDate() ) ); lastDownloadedLabel.setText( dateFormat.format( lastDownloadFile.getDownloadedDate() ) ); downloadRateLabel.setText( NumberFormatUtils.formatSignificantByteSize( lastDownloadFile.getTransferSpeed() ) + Localizer.getString( "PerSec" ) ); downloadRateLabel.setToolTipText( NumberFormatUtils.formatFullByteSize( lastDownloadFile.getTransferSpeed() ) + Localizer.getString( "PerSec" ) ); long maxRate = lastDownloadFile.getDownloadThrottlingRate(); String maxRateStr; if ( maxRate >= Integer.MAX_VALUE ) { maxRateStr = Localizer.getDecimalFormatSymbols().getInfinity(); } else { maxRateStr = NumberFormatUtils.formatSignificantByteSize( maxRate) + Localizer.getString( "PerSec" ); } maxRateLabel.setText( maxRateStr ); // TODO1 //etaLabel.setText() downloadingCandidatesLabel.setText( String.valueOf( lastDownloadFile.getDownloadingCandidatesCount() ) ); queuedCandidatesLabel.setText( String.valueOf( lastDownloadFile.getQueuedCandidatesCount() ) ); connectingCandidatesLabel.setText( String.valueOf( lastDownloadFile.getConnectingCandidatesCount() ) ); goodCandidatesLabel.setText( String.valueOf( lastDownloadFile.getGoodCandidateCount() ) ); badCandidatesLabel.setText( String.valueOf( lastDownloadFile.getBadCandidateCount() ) ); totalCandidatesLabel.setText( String.valueOf( lastDownloadFile.getCandidatesCount() ) ); String destFile = lastDownloadFile.getDestinationFileName(); if ( !fileNameTxt.getText().equals( destFile ) ) { fileNameTxt.setText( destFile ); fileNameTxt.setCaretPosition(0); } String path = lastDownloadFile.getIncompleteFile().getAbsolutePath(); if ( !incompleteFileTxt.getText().equals( path ) ) { incompleteFileTxt.setText( path ); incompleteFileTxt.setCaretPosition(0); } long curFinBugScopeLength = lastDownloadFile.getMemoryFile().getFinishedBufferedLength(); if ( lastFinBufScopeLength != curFinBugScopeLength ) { lastFinBufScopeLength = curFinBugScopeLength; progressIconLabel.setIcon( twinkleProgressIcon ); resetProgressTwinkleTimer.restart(); } }
| 1,115,557
|
private void updateInterface() { if ( lastDownloadFile == null ) { progressBar.setDownloadFile( null ); progressLabel.setText(""); downloadedLabel.setText(""); downloadedLabel.setToolTipText(""); remainingLabel.setText(""); remainingLabel.setToolTipText(""); totalSizeLabel.setText(""); totalSizeLabel.setToolTipText(""); createdLabel.setText(""); lastDownloadedLabel.setText(""); downloadRateLabel.setText(""); downloadRateLabel.setToolTipText(""); maxRateLabel.setText(""); etaLabel.setText(""); downloadingCandidatesLabel.setText( "" ); queuedCandidatesLabel.setText( "" ); connectingCandidatesLabel.setText( "" ); goodCandidatesLabel.setText( "" ); badCandidatesLabel.setText( "" ); totalCandidatesLabel.setText( "" ); fileNameTxt.setText(""); incompleteFileTxt.setText(""); return; } progressBar.setDownloadFile( lastDownloadFile ); progressLabel.setText( lastDownloadFile.getProgress().toString() + " %" ); downloadedLabel.setText( NumberFormatUtils.formatSignificantByteSize( lastDownloadFile.getTransferredDataSize() ) ); downloadedLabel.setToolTipText( NumberFormatUtils.formatFullByteSize( lastDownloadFile.getTransferredDataSize() ) ); long remaining = lastDownloadFile.getTotalDataSize() - lastDownloadFile.getTransferredDataSize(); remainingLabel.setText( NumberFormatUtils.formatSignificantByteSize( remaining ) ); remainingLabel.setToolTipText( NumberFormatUtils.formatFullByteSize( remaining ) ); totalSizeLabel.setText( NumberFormatUtils.formatSignificantByteSize( lastDownloadFile.getTotalDataSize() ) ); totalSizeLabel.setToolTipText( NumberFormatUtils.formatFullByteSize( lastDownloadFile.getTotalDataSize() ) ); createdLabel.setText( dateFormat.format( lastDownloadFile.getCreatedDate() ) ); lastDownloadedLabel.setText( dateFormat.format( lastDownloadFile.getDownloadedDate() ) ); downloadRateLabel.setText( NumberFormatUtils.formatSignificantByteSize( lastDownloadFile.getTransferSpeed() ) + Localizer.getString( "PerSec" ) ); downloadRateLabel.setToolTipText( NumberFormatUtils.formatFullByteSize( lastDownloadFile.getTransferSpeed() ) + Localizer.getString( "PerSec" ) ); long maxRate = lastDownloadFile.getDownloadThrottlingRate(); String maxRateStr; if ( maxRate >= Integer.MAX_VALUE ) { maxRateStr = Localizer.getDecimalFormatSymbols().getInfinity(); } else { maxRateStr = NumberFormatUtils.formatSignificantByteSize( maxRate) + Localizer.getString( "PerSec" ); } maxRateLabel.setText( maxRateStr ); // TODO1 //etaLabel.setText() downloadingCandidatesLabel.setText( String.valueOf( lastDownloadFile.getDownloadingCandidatesCount() ) ); queuedCandidatesLabel.setText( String.valueOf( lastDownloadFile.getQueuedCandidatesCount() ) ); connectingCandidatesLabel.setText( String.valueOf( lastDownloadFile.getConnectingCandidatesCount() ) ); goodCandidatesLabel.setText( String.valueOf( lastDownloadFile.getGoodCandidateCount() ) ); badCandidatesLabel.setText( String.valueOf( lastDownloadFile.getBadCandidateCount() ) ); totalCandidatesLabel.setText( String.valueOf( lastDownloadFile.getCandidatesCount() ) ); String destFile = lastDownloadFile.getDestinationFileName(); if ( !fileNameTxt.getText().equals( destFile ) ) { fileNameTxt.setText( destFile ); fileNameTxt.setCaretPosition(0); } String path = lastDownloadFile.getIncompleteFile().getAbsolutePath(); if ( !incompleteFileTxt.getText().equals( path ) ) { incompleteFileTxt.setText( path ); incompleteFileTxt.setCaretPosition(0); } long curFinBugScopeLength = lastDownloadFile.getMemoryFile().getFinishedBufferedLength(); if ( lastFinBufScopeLength != curFinBugScopeLength ) { lastFinBufScopeLength = curFinBugScopeLength; progressIconLabel.setIcon( twinkleProgressIcon ); resetProgressTwinkleTimer.restart(); } }
|
private void updateInterface() { if ( lastDownloadFile == null ) { progressBar.setDownloadFile( null ); progressLabel.setText(""); downloadedLabel.setText(""); downloadedLabel.setToolTipText(""); remainingLabel.setText(""); remainingLabel.setToolTipText(""); totalSizeLabel.setText(""); totalSizeLabel.setToolTipText(""); createdLabel.setText(""); lastDownloadedLabel.setText(""); downloadRateLabel.setText(""); downloadRateLabel.setToolTipText(""); maxRateLabel.setText(""); etaLabel.setText(""); downloadingCandidatesLabel.setText( "" ); queuedCandidatesLabel.setText( "" ); connectingCandidatesLabel.setText( "" ); goodCandidatesLabel.setText( "" ); badCandidatesLabel.setText( "" ); totalCandidatesLabel.setText( "" ); fileNameTxt.setText(""); incompleteFileTxt.setText(""); return; } progressBar.setDownloadFile( lastDownloadFile ); progressLabel.setText( lastDownloadFile.getProgress().toString() + " %" ); downloadedLabel.setText( NumberFormatUtils.formatSignificantByteSize( lastDownloadFile.getTransferredDataSize() ) ); downloadedLabel.setToolTipText( NumberFormatUtils.formatFullByteSize( lastDownloadFile.getTransferredDataSize() ) ); long remaining = lastDownloadFile.getTotalDataSize() - lastDownloadFile.getTransferredDataSize(); remainingLabel.setText( NumberFormatUtils.formatSignificantByteSize( remaining ) ); remainingLabel.setToolTipText( NumberFormatUtils.formatFullByteSize( remaining ) ); totalSizeLabel.setText( NumberFormatUtils.formatSignificantByteSize( lastDownloadFile.getTotalDataSize() ) ); totalSizeLabel.setToolTipText( NumberFormatUtils.formatFullByteSize( lastDownloadFile.getTotalDataSize() ) ); createdLabel.setText( dateFormat.format( lastDownloadFile.getCreatedDate() ) ); lastDownloadedLabel.setText( dateFormat.format( lastDownloadFile.getDownloadedDate() ) ); downloadRateLabel.setText( NumberFormatUtils.formatSignificantByteSize( lastDownloadFile.getTransferSpeed() ) + Localizer.getString( "PerSec" ) ); downloadRateLabel.setToolTipText( NumberFormatUtils.formatFullByteSize( lastDownloadFile.getTransferSpeed() ) + Localizer.getString( "PerSec" ) ); long maxRate = lastDownloadFile.getDownloadThrottlingRate(); String maxRateStr; if ( maxRate >= Integer.MAX_VALUE ) { maxRateStr = Localizer.getDecimalFormatSymbols().getInfinity(); } else { maxRateStr = NumberFormatUtils.formatSignificantByteSize( maxRate) + Localizer.getString( "PerSec" ); } maxRateLabel.setText( maxRateStr ); // TODO1 //etaLabel.setText() downloadingCandidatesLabel.setText( String.valueOf( lastDownloadFile.getDownloadingCandidatesCount() ) ); queuedCandidatesLabel.setText( String.valueOf( lastDownloadFile.getQueuedCandidatesCount() ) ); connectingCandidatesLabel.setText( String.valueOf( lastDownloadFile.getConnectingCandidatesCount() ) ); goodCandidatesLabel.setText( String.valueOf( lastDownloadFile.getGoodCandidateCount() ) ); badCandidatesLabel.setText( String.valueOf( lastDownloadFile.getBadCandidateCount() ) ); totalCandidatesLabel.setText( String.valueOf( lastDownloadFile.getCandidatesCount() ) ); String destFile = lastDownloadFile.getDestinationFileName(); if ( !fileNameTxt.getText().equals( destFile ) ) { fileNameTxt.setText( destFile ); fileNameTxt.setCaretPosition(0); } String path = lastDownloadFile.getIncompleteFile().getAbsolutePath(); if ( !incompleteFileTxt.getText().equals( path ) ) { incompleteFileTxt.setText( path ); incompleteFileTxt.setCaretPosition(0); } long curFinBugScopeLength = lastDownloadFile.getMemoryFile().getFinishedBufferedLength(); if ( lastFinBufScopeLength != curFinBugScopeLength ) { lastFinBufScopeLength = curFinBugScopeLength; progressIconLabel.setIcon( twinkleProgressIcon ); resetProgressTwinkleTimer.restart(); } }
| 1,115,558
|
public ASTFunNode buildUnfinishedOperatorNode(Operator op) throws ParseException { ASTFunNode res = new ASTFunNode(ParserTreeConstants.JJTFUNNODE); res.setOperator(op); return res; }
|
public ASTFunNode buildUnfinishedOperatorNode(Operator op) { ASTFunNode res = new ASTFunNode(ParserTreeConstants.JJTFUNNODE); res.setOperator(op); return res; }
| 1,115,559
|
public void clearValues() { for(Enumeration e = this.elements(); e.hasMoreElements(); ) { Variable var = (Variable) e.nextElement(); if(!var.isConstant()) var.setValidValue(false); } }
|
public void clearValues() { for(Enumeration e = this.elements(); e.hasMoreElements(); ) { Variable var = (Variable) e.nextElement(); var.setValidValue(false); } }
| 1,115,560
|
public VectorJep() { super(); opSet = new VOperatorSet(); this.ev = new VectorEvaluator(); this.parser.setInitialTokenManagerState(Parser.NO_DOT_IN_IDENTIFIERS); }
|
public VectorJep() { super(); opSet = new VOperatorSet(); this.ev = new VectorEvaluator(); this.parser.setInitialTokenManagerState(ParserConstants.NO_DOT_IN_IDENTIFIERS); }
| 1,115,561
|
public Object evaluate(Node node) throws Exception { Object res = ev.getValue(node,new Vector(),this.getSymbolTable()); if(res instanceof Scaler) return ((Scaler) res).getEle(0); else return res; }
|
public Object evaluate(Node node) throws Exception { Object res = ev.getValue(node,new Vector(),this.getSymbolTable()); if(res instanceof Scaler) return ((Scaler) res).getEle(0); else return res; }
| 1,115,562
|
@Test public void utf() throws SQLException { PreparedStatement prep = conn.prepareStatement( "select ?,?,?,?,?,?,?,?;"); prep.setString(1, utf01); prep.setString(2, utf02); prep.setString(3, utf03); prep.setString(4, utf04); prep.setString(5, utf05); prep.setString(6, utf06); prep.setString(7, utf07); prep.setString(8, utf08); ResultSet rs = prep.executeQuery(); assertTrue(rs.next()); assertEquals(rs.getString(1), utf01); assertEquals(rs.getString(2), utf02); assertEquals(rs.getString(3), utf03); assertEquals(rs.getString(4), utf04); assertEquals(rs.getString(5), utf05); assertEquals(rs.getString(6), utf06); assertEquals(rs.getString(7), utf07); assertEquals(rs.getString(8), utf08); rs.close(); }
|
@Test public void utf() throws SQLException { PreparedStatement prep = conn.prepareStatement( "select ?,?,?,?,?,?,?,?;"); prep.setString(1, utf01); prep.setString(2, utf02); prep.setString(3, utf03); prep.setString(4, utf04); prep.setString(5, utf05); prep.setString(6, utf06); prep.setString(7, utf07); prep.setString(8, utf08); rs = prep.executeQuery(); assertTrue(rs.next()); assertEquals(rs.getString(1), utf01); assertEquals(rs.getString(2), utf02); assertEquals(rs.getString(3), utf03); assertEquals(rs.getString(4), utf04); assertEquals(rs.getString(5), utf05); assertEquals(rs.getString(6), utf06); assertEquals(rs.getString(7), utf07); assertEquals(rs.getString(8), utf08); rs.close(); }
| 1,115,563
|
public void setName(String name) { Element nameElement = evalElement(config, "name"); nameElement.setNodeValue(name); }
|
public void setName(String name) { Element nameElement = evalElement(config, "name"); Text text = config.getOwnerDocument().createTextNode(name); nameElement.appendChild(text); config.appendChild(nameElement); }
| 1,115,564
|
public EORelationship addBlankRelationship(String _name, EORelationshipPath _flattenRelationship) throws DuplicateNameException { String newRelationshipNameBase = _name; String newRelationshipName = newRelationshipNameBase; int newRelationshipNum = 0; while (getRelationshipNamed(newRelationshipName) != null) { newRelationshipNum++; newRelationshipName = newRelationshipNameBase + newRelationshipNum; } EORelationship relationship; if (_flattenRelationship != null) { relationship = new EORelationship(newRelationshipName, _flattenRelationship.toKeyPath()); } else { relationship = new EORelationship(newRelationshipName); } relationship.setClassProperty(Boolean.TRUE); addRelationship(relationship); return relationship; }
|
public EORelationship addBlankRelationship(String _name, EORelationshipPath _flattenRelationship) throws DuplicateNameException { String newRelationshipNameBase = _name; String newRelationshipName = newRelationshipNameBase; int newRelationshipNum = 0; while (getRelationshipNamed(newRelationshipName) != null) { newRelationshipNum++; newRelationshipName = newRelationshipNameBase + newRelationshipNum; } EORelationship relationship; if (_flattenRelationship != null) { relationship = new EORelationship(newRelationshipName, _flattenRelationship.toKeyPath()); } else { relationship = new EORelationship(newRelationshipName); } relationship.setClassProperty(Boolean.TRUE); addRelationship(relationship); return relationship; }
| 1,115,566
|
private R update(TreeMap<Integer, R> m, Integer key, R value) { R first = m.isEmpty() ? null : m.get(m.firstKey()); R r = m.put(key, value); SortedMap<Integer,R> head = m.headMap(key); if(!head.isEmpty()) { R prev = m.get(head.lastKey()); value.nextBuild = prev.nextBuild; value.previousBuild = prev; if(value.nextBuild!=null) value.nextBuild.previousBuild = value; prev.nextBuild=value; } else { value.nextBuild = first; value.previousBuild = null; if(first!=null) first.previousBuild = value; } return r; }
|
private R update(TreeMap<Integer, R> m, Integer key, R value) { R first = m.isEmpty() ? null : m.get(m.firstKey()); R r = m.put(key, value); SortedMap<Integer,R> head = m.headMap(key); if(!head.isEmpty()) { R prev = m.get(head.lastKey()); value.nextBuild = prev.nextBuild; value.previousBuild = prev; if(value.nextBuild!=null) value.nextBuild.previousBuild = value; prev.nextBuild=value; } else { value.nextBuild = first; value.previousBuild = null; if(first!=null) first.previousBuild = value; } return r; }
| 1,115,567
|
private R update(TreeMap<Integer, R> m, Integer key, R value) { R first = m.isEmpty() ? null : m.get(m.firstKey()); R r = m.put(key, value); SortedMap<Integer,R> head = m.headMap(key); if(!head.isEmpty()) { R prev = m.get(head.lastKey()); value.nextBuild = prev.nextBuild; value.previousBuild = prev; if(value.nextBuild!=null) value.nextBuild.previousBuild = value; prev.nextBuild=value; } else { value.nextBuild = first; value.previousBuild = null; if(first!=null) first.previousBuild = value; } return r; }
|
private R update(TreeMap<Integer, R> m, Integer key, R value) { R first = m.isEmpty() ? null : m.get(m.firstKey()); R r = m.put(key, value); SortedMap<Integer,R> head = m.headMap(key); if(!head.isEmpty()) { R prev = m.get(head.lastKey()); value.nextBuild = prev.nextBuild; value.previousBuild = prev; if(value.nextBuild!=null) value.nextBuild.previousBuild = value; prev.nextBuild=value; } else { value.nextBuild = first; value.previousBuild = null; if(first!=null) first.previousBuild = value; } return r; }
| 1,115,568
|
private R update(TreeMap<Integer, R> m, Integer key, R value) { R first = m.isEmpty() ? null : m.get(m.firstKey()); R r = m.put(key, value); SortedMap<Integer,R> head = m.headMap(key); if(!head.isEmpty()) { R prev = m.get(head.lastKey()); value.nextBuild = prev.nextBuild; value.previousBuild = prev; if(value.nextBuild!=null) value.nextBuild.previousBuild = value; prev.nextBuild=value; } else { value.nextBuild = first; value.previousBuild = null; if(first!=null) first.previousBuild = value; } return r; }
|
private R update(TreeMap<Integer, R> m, Integer key, R value) { R first = m.isEmpty() ? null : m.get(m.firstKey()); R r = m.put(key, value); SortedMap<Integer,R> head = m.headMap(key); if(!head.isEmpty()) { R prev = m.get(head.lastKey()); value.nextBuild = prev.nextBuild; value.previousBuild = prev; if(value.nextBuild!=null) value.nextBuild.previousBuild = value; prev.nextBuild=value; } else { value.nextBuild = first; value.previousBuild = null; if(first!=null) first.nextBuild = value; } return r; }
| 1,115,569
|
public Object umin(Object param) throws ParseException { if (param instanceof Number) { return new Double(-((Number)param).doubleValue()); } else if (param instanceof Complex) { return ((Complex)param).neg(); } throw new ParseException("Invalid parameter type"); }
|
public Object umin(Object param) throws ParseException { if (param instanceof Complex) return ((Complex)param).neg(); if (param instanceof Number) return new Double(-((Number)param).doubleValue()); } else if (param instanceof Complex) { return ((Complex)param).neg(); } throw new ParseException("Invalid parameter type"); }
| 1,115,570
|
public Object umin(Object param) throws ParseException { if (param instanceof Number) { return new Double(-((Number)param).doubleValue()); } else if (param instanceof Complex) { return ((Complex)param).neg(); } throw new ParseException("Invalid parameter type"); }
|
public Object umin(Object param) throws ParseException { if (param instanceof Number) { return new Double(-((Number)param).doubleValue()); } else if (param instanceof Complex) { return ((Complex)param).neg(); } throw new ParseException("Invalid parameter type"); }
| 1,115,571
|
void drawPlottableNew(Graphics g) { int mean = getMean(); // get new graphics to avoid messing up original Graphics2D g2 = (Graphics2D)g.create(); g2.setClip(LABEL_X_SHIFT, 0, rowWidth, Integer.MAX_VALUE); AffineTransform originalTransform = AffineTransform.getTranslateInstance(LABEL_X_SHIFT, titleHeight); for (int row = 0; row < rows && currentImageGraphics == g; row++) { //use title and label transform to draw red center lines g2.setTransform(originalTransform); g2.setPaint(Color.red); int yLoc = rowOffset*row; g2.drawLine(0, yLoc, rowWidth, yLoc); //Create new transform to draw plottable scaled correctly g2.setTransform(new AffineTransform()); //shift the shape left to get to the correct point for this row //and down to get to the correct draw height g2.translate(-1* rowWidth * row, yLoc + titleHeight); //flip the y axis to make going lower positive g2.scale(1,-1); //scale for the amplitude slider g2.scale(1, ampScale); g2.scale(1, ampScalePercent); //center the mean g2.translate(0, -1*mean); if (row % 2 == 0) { g2.setPaint(Color.black); } else { g2.setPaint(Color.blue); } if (plottableShape != null) { g2.draw(plottableShape); } // end of if (plottableShape != null) } repaint(); }
|
void drawPlottableNew(Graphics g) { int mean = getMean(); // get new graphics to avoid messing up original Graphics2D g2 = (Graphics2D)g.create(); g2.setClip(LABEL_X_SHIFT, 0, rowWidth, Integer.MAX_VALUE); AffineTransform originalTransform = AffineTransform.getTranslateInstance(LABEL_X_SHIFT, titleHeight); for (int row = 0; row < rows && currentImageGraphics == g; row++) { //use title and label transform to draw red center lines g2.setTransform(originalTransform); g2.setPaint(Color.red); int yLoc = rowOffset*row; g2.drawLine(0, yLoc, rowWidth, yLoc); //Create new transform to draw plottable scaled correctly g2.setTransform(new AffineTransform()); //shift the shape left to get to the correct point for this row //and down to get to the correct draw height g2.translate(-1* rowWidth * row + LABEL_X_SHIFT, yLoc + titleHeight); //flip the y axis to make going lower positive g2.scale(1,-1); //scale for the amplitude slider g2.scale(1, ampScale); g2.scale(1, ampScalePercent); //center the mean g2.translate(0, -1*mean); if (row % 2 == 0) { g2.setPaint(Color.black); } else { g2.setPaint(Color.blue); } if (plottableShape != null) { g2.draw(plottableShape); } // end of if (plottableShape != null) } repaint(); }
| 1,115,572
|
public PVariable(PolynomialCreator pc,XVariable var) throws ParseException { super(pc); this.variable = var; }
|
public PVariable(PolynomialCreator pc,XVariable var) { super(pc); this.variable = var; }
| 1,115,573
|
public boolean isConstantVar(XVariable var) { if(!var.hasEquation()) return true; Node eqn = var.getEquation(); if(eqn instanceof ASTConstant) return true; if(eqn instanceof ASTVarNode) { return isConstantVar((XVariable)((ASTVarNode) eqn).getVar()); } return false; }
|
public boolean isConstantVar(XVariable var) { if(!var.hasEquation()) return true; Node eqn = var.getEquation(); if(eqn instanceof ASTConstant) return true; if(eqn instanceof ASTVarNode) { return isConstantVar((XVariable)((ASTVarNode) eqn).getVar()); } return false; }
| 1,115,574
|
public Object visit(ASTFunNode node, Object data) throws ParseException { Node children[]=acceptChildrenAsArray(node,data); return xjep.getNodeFactory().buildFunctionNode(node,children); }
|
public Object visit(ASTConstant node, Object data) throws ParseException { Node children[]=acceptChildrenAsArray(node,data); return xjep.getNodeFactory().buildFunctionNode(node,children); }
| 1,115,575
|
public Object visit(ASTFunNode node, Object data) throws ParseException { Node children[]=acceptChildrenAsArray(node,data); return xjep.getNodeFactory().buildFunctionNode(node,children); }
|
public Object visit(ASTFunNode node, Object data) throws ParseException { Node children[]=acceptChildrenAsArray(node,data); return xjep.getNodeFactory().buildFunctionNode(node,children); }
| 1,115,576
|
public PartialDerivative findDerivative(String derivname,DJep jep) throws ParseException { String newnames[] = new String[1]; newnames[0]=derivname; return findDerivativeSorted(newnames,jep); }
|
public PartialDerivative findDerivative(String derivnames[],DJep jep) throws ParseException { String newnames[] = new String[1]; newnames[0]=derivname; return findDerivativeSorted(newnames,jep); }
| 1,115,577
|
public PartialDerivative findDerivative(String derivname,DJep jep) throws ParseException { String newnames[] = new String[1]; newnames[0]=derivname; return findDerivativeSorted(newnames,jep); }
|
public PartialDerivative findDerivative(String derivname,DJep jep) throws ParseException { String newnames[] = new String[1]; newnames[0]=derivname; return findDerivativeSorted(newnames,jep); }
| 1,115,578
|
protected Serializable resolveId(String id) { return Integer.parseInt(id); }
|
protected Serializable resolveId(String id) { int value = Integer.parseInt(id); return value; }
| 1,115,579
|
protected void setAsText(String id, Class clazz) { if (logger.isDebugEnabled()) { logger.debug("Loaded "+clazz.getName()+" property editor"); } try { Object value = getHibernateTemplate().load(clazz, resolveId(id)); super.setValue(value); if (logger.isDebugEnabled()) { logger.debug("Loaded property: "+value); } } catch (Exception e) { super.setValue(null); } }
|
protected void setAsText(String id, Class clazz) { if (logger.isDebugEnabled()) { logger.debug("Loaded "+clazz.getName()+" property editor"); } try { Serializable key = resolveId(id); Object value = getHibernateTemplate().load(clazz, key); super.setValue(value); if (logger.isDebugEnabled()) { logger.debug("Loaded property: "+value); } } catch (Exception e) { super.setValue(null); } }
| 1,115,580
|
public void testGetSeismograms(){ LocalSeismogramImpl[] contained = container.getSeismograms(); while(contained.length < 3){ try { Thread.sleep(5); } catch (InterruptedException e) {} contained = container.getSeismograms(); } ArrayAssert.assertEquivalenceArrays(seismograms, contained); }
|
public void testGetSeismograms(){ LocalSeismogramImpl[] contained = container.getSeismograms(); while(contained.length < 3){ try { Thread.sleep(5); } catch (InterruptedException e) {} contained = container.getSeismograms(); } ArrayAssert.assertEquivalenceArrays(seismograms, contained); }
| 1,115,582
|
public void testPushAlreadyAddedData(){ LocalSeismogramImpl[] alreadyContained = container.getSeismograms(); while(alreadyContained.length < 3){ try { Thread.sleep(5); } catch (InterruptedException e) {} alreadyContained = container.getSeismograms(); } container.pushData(new SeisDataChangeEvent(DisplayUtilsTest.createThreeSeisArray(), null, container)); LocalSeismogramImpl[] nowContains = container.getSeismograms(); ArrayAssert.assertEquivalenceArrays(alreadyContained, nowContains); }
|
public void testPushAlreadyAddedData(){ LocalSeismogramImpl[] alreadyContained = container.getSeismograms(); while(alreadyContained.length < 3){ try { Thread.sleep(5); } catch (InterruptedException e) {} alreadyContained = container.getSeismograms(); } container.pushData(new SeisDataChangeEvent(DisplayUtilsTest.createThreeSeisArray(), null, container)); LocalSeismogramImpl[] nowContains = container.getSeismograms(); ArrayAssert.assertEquivalenceArrays(alreadyContained, nowContains); }
| 1,115,583
|
public void testPushNewData(){ LocalSeismogramImpl[] alreadyContained = container.getSeismograms(); LocalSeismogramImpl[] otherSeis = DisplayUtilsTest.createOtherSeisArray(); container.pushData(new SeisDataChangeEvent(otherSeis, null, container)); LocalSeismogramImpl[] nowContains = container.getSeismograms(); //assertEquals("must be exactly 6 seismograms", 6, nowContains.length); for (int i = 0; i < nowContains.length; i++){ System.out.println("nowContains "+i+" "+nowContains[i].get_id()); boolean found = false; for (int j = 0; j < alreadyContained.length; j++) { if(nowContains[i] == alreadyContained[j]){ found = true; break; } } for (int j = 0; j < otherSeis.length; j++) { if(nowContains[i] == otherSeis[j]){ found = true; break; } } assertTrue("Found an extra seismogram", found); } }
|
public void testPushNewData(){ LocalSeismogramImpl[] alreadyContained = container.getSeismograms(); LocalSeismogramImpl[] otherSeis = DisplayUtilsTest.createOtherSeisArray(); container.pushData(new SeisDataChangeEvent(otherSeis, null, container)); LocalSeismogramImpl[] nowContains = container.getSeismograms(); //assertEquals("must be exactly 6 seismograms", 6, nowContains.length); for (int i = 0; i < nowContains.length; i++){ boolean found = false; for (int j = 0; j < alreadyContained.length; j++) { if(nowContains[i] == alreadyContained[j]){ found = true; break; } } for (int j = 0; j < otherSeis.length; j++) { if(nowContains[i] == otherSeis[j]){ found = true; break; } } assertTrue("Found an extra seismogram", found); } }
| 1,115,585
|
public synchronized LocalSeismogramImpl[] getSeismograms(){ if(softSeis.size() == 0){ return EMPTY_ARRAY; } List existant = new ArrayList(); Iterator it = softSeis.iterator(); boolean calledRetrieved = false; while(it.hasNext()){ SoftReference current = (SoftReference)it.next(); if(current.get() != null){ existant.add(current.get()); }else{ it.remove(); if(!calledRetrieved){ seismogram.retrieveData(this); calledRetrieved = true; } } } return (LocalSeismogramImpl[])existant.toArray(new LocalSeismogramImpl[existant.size()]); }
|
public synchronized LocalSeismogramImpl[] getSeismograms(){ if(softSeis.size() == 0){ return EMPTY_ARRAY; } List existant = new ArrayList(); Iterator it = softSeis.iterator(); boolean callRetrieve = false; while(it.hasNext()){ SoftReference current = (SoftReference)it.next(); if(current.get() != null){ existant.add(current.get()); }else{ it.remove(); if(!calledRetrieved){ seismogram.retrieveData(this); calledRetrieved = true; } } } return (LocalSeismogramImpl[])existant.toArray(new LocalSeismogramImpl[existant.size()]); }
| 1,115,586
|
public synchronized LocalSeismogramImpl[] getSeismograms(){ if(softSeis.size() == 0){ return EMPTY_ARRAY; } List existant = new ArrayList(); Iterator it = softSeis.iterator(); boolean calledRetrieved = false; while(it.hasNext()){ SoftReference current = (SoftReference)it.next(); if(current.get() != null){ existant.add(current.get()); }else{ it.remove(); if(!calledRetrieved){ seismogram.retrieveData(this); calledRetrieved = true; } } } return (LocalSeismogramImpl[])existant.toArray(new LocalSeismogramImpl[existant.size()]); }
|
public synchronized LocalSeismogramImpl[] getSeismograms(){ if(softSeis.size() == 0){ return EMPTY_ARRAY; } List existant = new ArrayList(); Iterator it = softSeis.iterator(); boolean calledRetrieved = false; while(it.hasNext()){ SoftReference current = (SoftReference)it.next(); if(current.get() != null){ existant.add(current.get()); }else{ it.remove(); if(!calledRetrieved){ seismogram.retrieveData(this); calledRetrieved = true; } } } return (LocalSeismogramImpl[])existant.toArray(new LocalSeismogramImpl[existant.size()]); }
| 1,115,587
|
public synchronized LocalSeismogramImpl[] getSeismograms(){ if(softSeis.size() == 0){ return EMPTY_ARRAY; } List existant = new ArrayList(); Iterator it = softSeis.iterator(); boolean calledRetrieved = false; while(it.hasNext()){ SoftReference current = (SoftReference)it.next(); if(current.get() != null){ existant.add(current.get()); }else{ it.remove(); if(!calledRetrieved){ seismogram.retrieveData(this); calledRetrieved = true; } } } return (LocalSeismogramImpl[])existant.toArray(new LocalSeismogramImpl[existant.size()]); }
|
public synchronized LocalSeismogramImpl[] getSeismograms(){ if(softSeis.size() == 0){ return EMPTY_ARRAY; } List existant = new ArrayList(); Iterator it = softSeis.iterator(); boolean calledRetrieved = false; while(it.hasNext()){ SoftReference current = (SoftReference)it.next(); if(current.get() != null){ existant.add(current.get()); }else{ it.remove(); if(!calledRetrieved){ seismogram.retrieveData(this); calledRetrieved = true; } } } return (LocalSeismogramImpl[])existant.toArray(new LocalSeismogramImpl[existant.size()]); }
| 1,115,588
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.