rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
int choice = 1; if (currentFile != null) { File file = currentFile; try { FileWriter out = new FileWriter(file); out.write(myRecipe.toXML()); out.close(); Debug.print("Saved: " + file.getAbsoluteFile()); currentFile = file; } catch (Exception e) { showError(e); }
saveFile(evt);
public void actionPerformed(ActionEvent evt) { int choice = 1; if (currentFile != null) { File file = currentFile; //This is where a real application would save the file. try { FileWriter out = new FileWriter(file); out.write(myRecipe.toXML()); out...
else { choice = JOptionPane.showConfirmDialog(null, "File not saved. Do you wish to save it?", "File note saved", JOptionPane.YES_NO_OPTION); } if (choice == 0) { saveAs(); } }
public void actionPerformed(ActionEvent evt) { int choice = 1; if (currentFile != null) { File file = currentFile; //This is where a real application would save the file. try { FileWriter out = new FileWriter(file); out.write(myRecipe.toXML()); out...
File tmp = new File("tmp.html"); try { saveAsHTML(tmp, "ca/strangebrew/data/recipeToSimpleHtml.xslt"); HTMLViewer view = new HTMLViewer(owner, tmp.toURL()); view.setModal(true); view.setVisible(true); } catch (Exception e) { e.printStackTrace(); } tmp.delete();
processWindowEvent(new WindowEvent(owner,WindowEvent.WINDOW_CLOSING)); System.exit(0);
public void actionPerformed(ActionEvent evt) { // Copy current recipe to clipboard// save file as xml, then transform it to html File tmp = new File("tmp.html"); try { saveAsHTML(tmp, "ca/strangebrew/data/recipeToSimpleHtml.xslt"); HTMLViewer view = new HTMLVi...
processWindowEvent(new WindowEvent(owner,WindowEvent.WINDOW_CLOSING)); System.exit(0);
PreferencesDialog d = new PreferencesDialog(owner, preferences); d.setVisible(true);
public void actionPerformed(ActionEvent evt) { // exit program processWindowEvent(new WindowEvent(owner,WindowEvent.WINDOW_CLOSING)); System.exit(0); }
PreferencesDialog d = new PreferencesDialog(owner, preferences); d.setVisible(true);
ScaleRecipeDialog scaleRecipe = new ScaleRecipeDialog(owner); scaleRecipe.setModal(true); scaleRecipe.setVisible(true);
public void actionPerformed(ActionEvent evt) { PreferencesDialog d = new PreferencesDialog(owner, preferences); d.setVisible(true); }
ScaleRecipeDialog scaleRecipe = new ScaleRecipeDialog(owner); scaleRecipe.setModal(true); scaleRecipe.setVisible(true);
MaltPercentDialog maltPercent = new MaltPercentDialog(owner); maltPercent.setModal(true); maltPercent.setVisible(true);
public void actionPerformed(ActionEvent evt) { ScaleRecipeDialog scaleRecipe = new ScaleRecipeDialog(owner); scaleRecipe.setModal(true); scaleRecipe.setVisible(true); }
MaltPercentDialog maltPercent = new MaltPercentDialog(owner); maltPercent.setModal(true); maltPercent.setVisible(true);
aboutDlg = new AboutDialog(owner, version); aboutDlg.setVisible(true);
public void actionPerformed(ActionEvent evt) { MaltPercentDialog maltPercent = new MaltPercentDialog(owner); maltPercent.setModal(true); maltPercent.setVisible(true); }
bandwidthController.getAvailableByteCount( true );
bandwidthController.getAvailableByteCount( 1, true, true );
public int read() throws IOException { bandwidthController.getAvailableByteCount( true ); int val = inStream.read(); bandwidthController.markBytesUsed( 1 ); return val; }
bandwidthController.markBytesUsed( 1 );
public int read() throws IOException { bandwidthController.getAvailableByteCount( true ); int val = inStream.read(); bandwidthController.markBytesUsed( 1 ); return val; }
public synchronized void markBytesUsed( int byteCount )
public synchronized void markBytesUsed( int byteCount ) throws IOException
public synchronized void markBytesUsed( int byteCount ) { updateWindow( false ); bytesRemaining -= byteCount; if ( bytesRemaining < 0 ) { updateWindow( true ); } short logLevel = NLogger.LOG_LEVEL_DEBUG; if ( bytesRemaining < 0 ) { ...
bytesRemaining = Math.max( bytesRemaining, -15 * WINDOWS_PER_SECONDS * bytesPerWindow );
public synchronized void markBytesUsed( int byteCount ) { updateWindow( false ); bytesRemaining -= byteCount; if ( bytesRemaining < 0 ) { updateWindow( true ); } short logLevel = NLogger.LOG_LEVEL_DEBUG; if ( bytesRemaining < 0 ) { ...
numberOfParameters = 0;
numberOfParameters = 0; curNumberOfParameters = 0;
public PostfixMathCommand() { numberOfParameters = 0; }
Iterator e = seismos.keySet().iterator(); while(e.hasNext()) seismos.put(e.next(), b);
public synchronized void set(MicroSecondDate b, TimeInterval t){ displayInterval = t; beginTime = b; updateTimeSyncListeners(); }
public void removeAll(MouseEvent me){
public void removeAll(){ logger.debug("removing all displays");
public void removeAll(MouseEvent me){ this.stopImageCreation(); seismograms.removeAll(); remove(seismograms); basicDisplays = new LinkedList(); sorter = new SeismogramSorter(); globalTimeRegistrar = new TimeConfigRegistrar(); globalAmpRegistrar = new AmpConfigRegistrar(); repaint(); }
this.time.setText(" Time: "); this.amp.setText(" Amplitude: ");
public void removeAll(MouseEvent me){ this.stopImageCreation(); seismograms.removeAll(); remove(seismograms); basicDisplays = new LinkedList(); sorter = new SeismogramSorter(); globalTimeRegistrar = new TimeConfigRegistrar(); globalAmpRegistrar = new AmpConfigRegistrar(); repaint(); }
logger.debug("removing a display with " + basicDisplays.size() + " left");
public void removeDisplay(BasicSeismogramDisplay display){ if(basicDisplays.size() == 1){ this.removeAll(); return; } seismograms.remove(display); basicDisplays.remove(display); ((SeismogramDisplay)basicDisplays.getFirst()).addTopTimeBorder(); ((SeismogramDisplay)basicDisplays.getLast()).addBottomTimeBorder...
private ChangeLogSet calcChangeSet() {
private ChangeLogSet<? extends Entry> calcChangeSet() {
private ChangeLogSet calcChangeSet() { File changelogFile = new File(getRootDir(), "changelog.xml"); if(!changelogFile.exists()) return ChangeLogSet.EMPTY; try { return scm.parse(this,changelogFile); } catch (IOException e) { e.printStackTrace(); }...
public ChangeLogSet<?> getChangeSet() {
public ChangeLogSet<? extends Entry> getChangeSet() {
public ChangeLogSet<?> getChangeSet() { if(scm==null) scm = new CVSChangeLogParser(); if(changeSet==null) // cached value changeSet = calcChangeSet(); return changeSet; }
public synchronized Map<String,String> getRevisionMap() throws IOException {
public synchronized Map<String,Integer> getRevisionMap() throws IOException {
public synchronized Map<String,String> getRevisionMap() throws IOException { if(revisionMap==null) revisionMap = SubversionSCM.parseRevisionFile(build); return revisionMap; }
Options opts = new Options();
opts = new Options(); mash = new Mash(this);
public Recipe() { Options opts = new Options(); name = "My Recipe"; created = new GregorianCalendar(); efficiency = opts.getDProperty("optEfficiency"); //preBoilVol.setUnits(opts.getProperty("optSizeU")); // preBoilVol.setAmount(opts.getDProperty("optPreBoilVol")); // postBoilVol.setUnits(opts.getProperty("optS...
private double calcColour(double lov) {
private double calcColour(double lov, String method) {
private double calcColour(double lov) { double colour = 0; if (colourMethod.equals("EBC")) { // From Greg Noonan's article at // http://brewingtechniques.com/bmg/noonan.html colour = 1.4922 * Math.pow(lov, 0.6859); // SRM // EBC is apr. SRM * 2.65 - 1.2 colour = (colour * 2.65) - 1.2; } else { // calcul...
if (colourMethod.equals("EBC")) {
if (method.equals("EBC")) {
private double calcColour(double lov) { double colour = 0; if (colourMethod.equals("EBC")) { // From Greg Noonan's article at // http://brewingtechniques.com/bmg/noonan.html colour = 1.4922 * Math.pow(lov, 0.6859); // SRM // EBC is apr. SRM * 2.65 - 1.2 colour = (colour * 2.65) - 1.2; } else { // calcul...
srm = calcColour(mcu);
srm = calcColour(mcu, "SRM"); ebc = calcColour(mcu, "EBC");
public void calcMaltTotals() { if (!allowRecalcs) return; double maltPoints = 0; double mcu = 0; totalMaltLbs = 0; totalMaltCost = 0; totalMashLbs = 0; // first figure out the total we're dealing with for (int i = 0; i < fermentables.size(); i++) { Fermentable m = ((Fermentable) fermentables.get(i)); tot...
SearchButton btn = new SearchButton( search );
SearchButton btn = new SearchButton( search, searchTab );
public void searchAdded( Search search, int position ) { SearchButton btn = new SearchButton( search ); btn.addActionListener( buttonHandler ); synchronized ( accessLock ) { searchButtonMap.put(search, btn); searchButtonGroup.add(btn); addButto...
j.getPrintVisitor().setMode(DPrintVisitor.FULL_BRACKET,true);
j.getPrintVisitor().setMode(PrintVisitor.FULL_BRACKET,true);
public void processEquation(Node node) throws Exception { DJep j = (DJep) this.j; if(verbose) { print("Parsed:\t\t"); println(j.toString(node)); } Node processed = j.preprocess(node); if(verbose) { print("Processed:\t"); println(j.toString(processed)); } Node simp = j.simplify(processed); if(ver...
j.getPrintVisitor().setMode(DPrintVisitor.FULL_BRACKET,false);
j.getPrintVisitor().setMode(PrintVisitor.FULL_BRACKET,false);
public void processEquation(Node node) throws Exception { DJep j = (DJep) this.j; if(verbose) { print("Parsed:\t\t"); println(j.toString(node)); } Node processed = j.preprocess(node); if(verbose) { print("Processed:\t"); println(j.toString(processed)); } Node simp = j.simplify(processed); if(ver...
cacheStatusBuilder.addLabel( Localizer.getString( "NetworkTab_GWebCacheContains" ), cc.xy( 2, 5 ) ); gWebCacheStatLabel = new JLabel( ); cacheStatusBuilder.add( gWebCacheStatLabel, cc.xy( 4, 5 ) ); cacheStatusBuilder.addLabel( Localizer.getString( "NetworkTab_Caches" ), cc.xy( 6, 5 ) ); final JButton queryWebCache = ...
public void initComponent( DGuiSettings guiSettings ) { CellConstraints cc = new CellConstraints(); FormLayout layout = new FormLayout( "2dlu, fill:d:grow, 2dlu", // columns "2dlu, fill:d:grow, 4dlu, d, 2dlu"); //rows PanelBuilder contentBuilder = new PanelBuilder( layo...
gWebCacheStatLabel.setText( String.valueOf( gWebCacheCont.getGWebCacheCount() ) );
public void refresh() { catcherStatLabel.setText( String.valueOf( hostMgr.getCaughtHostsContainer().getCaughtHostsCount() ) ); gWebCacheStatLabel.setText( String.valueOf( gWebCacheCont.getGWebCacheCount() ) ); networkModel.fireTableDataChanged(); }
throw new IOException("revision check failed");
throw new IOException("svn info failed");
public static SvnInfo parse(String subject, Map env, FilePath workspace, TaskListener listener) throws IOException { String cmd = DESCRIPTOR.getSvnExe()+" info --xml "+subject; listener.getLogger().println("$ "+cmd); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ...
File module = workspace.child(url).getLocal();
File module = workspace.child(moduleName).getLocal();
private boolean isUpdatable(FilePath workspace,BuildListener listener) { StringTokenizer tokens = new StringTokenizer(modules); while(tokens.hasMoreTokens()) { String url = tokens.nextToken(); String moduleName = getLastPathComponent(url); File module = workspace.child...
return false;
private boolean isUpdatable(FilePath workspace,BuildListener listener) { StringTokenizer tokens = new StringTokenizer(modules); while(tokens.hasMoreTokens()) { String url = tokens.nextToken(); String moduleName = getLastPathComponent(url); File module = workspace.child...
new Node[]{djep.deepCopy(children[1])})),
new Node[]{djep.deepCopy(children[0])})),
public Node differentiate(ASTFunNode node,String var,Node [] children,Node [] dchildren,DJep djep) throws ParseException { OperatorSet op = djep.getOperatorSet(); NodeFactory nf = djep.getNodeFactory(); TreeUtils tu = djep.getTreeUtils(); FunctionTable funTab = djep.getFunctionTable(); int nchild = node.jjtGetNumCh...
for (Fingerprint e : f.getFingerprints().values()) if(e.getOriginal().is(this))
for (Fingerprint e : f.getFingerprints().values()) { BuildPtr o = e.getOriginal(); if(o!=null && o.is(this))
public RangeSet getDownstreamRelationship(Project that) { RangeSet rs = new RangeSet(); FingerprintAction f = getAction(FingerprintAction.class); if(f==null) return rs; // look for fingerprints that point to this build as the source, and merge them all for (Fingerprint e : f.g...
}
public RangeSet getDownstreamRelationship(Project that) { RangeSet rs = new RangeSet(); FingerprintAction f = getAction(FingerprintAction.class); if(f==null) return rs; // look for fingerprints that point to this build as the source, and merge them all for (Fingerprint e : f.g...
if(o.is(that))
if(o!=null && o.is(that))
public int getUpstreamRelationship(Project that) { FingerprintAction f = getAction(FingerprintAction.class); if(f==null) return -1; // look for fingerprints that point to the given project as the source, and merge them all for (Fingerprint e : f.getFingerprints().values()) { ...
props.putAll(getProperties());
for (Map.Entry o : ((Map<?,?>)getProperties()).entrySet()) { if(o.getValue()!=null) props.put(o.getKey(),o.getValue()); }
public Session createSession() { Properties props = new Properties(System.getProperties()); props.putAll(getProperties()); return Session.getInstance(props); }
this.opSet=(MatrixOperatorSet) mdjep.getOperatorSet();
public MatrixNodeI preprocess(Node node,MatrixJep mdjep) throws ParseException { this.mjep=mdjep; this.nf=(MatrixNodeFactory) mdjep.getNodeFactory(); this.vt=(DSymbolTable) mdjep.getSymbolTable(); this.opSet=(MatrixOperatorSet) mdjep.getOperatorSet(); return (MatrixNodeI) node.jjtAccept(this,null); }
children[i] = (MatrixNodeI) no;
children[i] = no;
public MatrixNodeI[] visitChildrenAsArray(Node node,Object data) throws ParseException { int nchild = node.jjtGetNumChildren(); MatrixNodeI children[] = new MatrixNodeI[nchild]; for(int i=0;i<nchild;++i) {// System.out.println("vcaa "+i+" "+node.jjtGetChild(i)); MatrixNodeI no = (MatrixNodeI) node.jjtGetChi...
dims[i]=((MatrixNodeI) children[i]).getDim();
dims[i]=children[i].getDim();
public Object visitOp(ASTFunNode node, Object data) throws ParseException { PostfixMathCommandI pfmc=node.getPFMC(); MatrixNodeI children[] = visitChildrenAsArray(node,data); if(pfmc instanceof BinaryOperatorI) { if(node.jjtGetNumChildren()!=2) throw new ParseException("Operator "+node.getOperator().getName()+" ...
Search search = ((SearchButton)e.getSource()).getSearch();
Search search = searchButton.getSearch();
public void actionPerformed(ActionEvent e) { try { searchTab.refreshTabActions(); Search search = ((SearchButton)e.getSource()).getSearch(); if ( search == null ) { return; } ...
if ( updateDisplayTimer == null ) { updateDisplayTimer = new Timer( 2000, new UpdateButtonsTimerAction()); } updateDisplayTimer.start();
public void addNotify() { super.addNotify(); searchContainer.addSearchListChangeListener( this ); }
if( updateDisplayTimer != null ) { updateDisplayTimer.stop(); updateDisplayTimer = null; }
public void removeNotify() { super.removeNotify(); searchContainer.removeSearchListChangeListener( this ); }
searchButtonMap.put(search, btn); searchButtonGroup.add(btn); addButton( btn );
synchronized ( accessLock ) { searchButtonMap.put(search, btn); searchButtonGroup.add(btn); addButton( btn ); }
public void searchAdded( Search search, int position ) { SearchButton btn = new SearchButton( search ); btn.addActionListener( buttonHandler ); searchButtonMap.put(search, btn); searchButtonGroup.add(btn); addButton( btn ); if ( displayedDataModel != null && search == di...
searchButtonGroup.remove( btn ); removeButton( btn );
synchronized ( accessLock ) { searchButtonGroup.remove( btn ); removeButton( btn ); }
public void searchRemoved( Search search, int position ) { SearchButton btn = (SearchButton) searchButtonMap.remove(search); searchButtonGroup.remove( btn ); removeButton( btn ); }
if (param instanceof Number) {
if (param instanceof Complex) { return new Double(((Complex)param).arg()); } else if (param instanceof Number) {
public Number arg(Object param) throws ParseException { if (param instanceof Number) { return (ONE); } else if (param instanceof Complex) { return new Double(((Complex)param).arg()); } throw new ParseException("Invalid parameter type"); }
} else if (param instanceof Complex) { return new Double(((Complex)param).arg()); }
}
public Number arg(Object param) throws ParseException { if (param instanceof Number) { return (ONE); } else if (param instanceof Complex) { return new Double(((Complex)param).arg()); } throw new ParseException("Invalid parameter type"); }
if(!this.author.equals(that.author))
if(this.author==null || that.author==null || !this.author.equals(that.author))
public boolean canBeMergedWith(CVSChangeLog that) { if(!this.date.equals(that.date)) return false; if(!this.time.equals(that.time)) // TODO: perhaps check this loosely? return false; if(!this.author.equals(that.author)) return fals...
digester.addBeanPropertySetter("*/entry/author");
digester.addBeanPropertySetter("*/entry/author","user");
public static CVSChangeLogSet parse( java.io.File f ) throws IOException, SAXException { Digester digester = new Digester(); ArrayList<CVSChangeLog> r = new ArrayList<CVSChangeLog>(); digester.push(r); digester.addObjectCreate("*/entry",CVSChangeLog.class); digester.addBeanPropert...
if(msgLevel==org.apache.tools.ant.Project.MSG_ERR) listener.error(msg);
if(msgLevel==org.apache.tools.ant.Project.MSG_ERR) { errorOutput.write(msg); errorOutput.write('\n'); }
private boolean calcChangeLog(Build build, List<String> changedFiles, File changelogFile, final BuildListener listener) { if(build.getPreviousBuild()==null || (changedFiles!=null && changedFiles.isEmpty())) { // nothing to compare against, or no changes // (note that changedFiles==null ...
task.setDir(build.getProject().getWorkspace().getLocal());
File baseDir = build.getProject().getWorkspace().getLocal(); task.setDir(baseDir);
private boolean calcChangeLog(Build build, List<String> changedFiles, File changelogFile, final BuildListener listener) { if(build.getPreviousBuild()==null || (changedFiles!=null && changedFiles.isEmpty())) { // nothing to compare against, or no changes // (note that changedFiles==null ...
if(changedFiles!=null) task.setFile(changedFiles); else {
if(changedFiles!=null) { for (String filePath : changedFiles) { if(new File(baseDir,filePath).getParentFile().exists()) task.addFile(filePath); } } else {
private boolean calcChangeLog(Build build, List<String> changedFiles, File changelogFile, final BuildListener listener) { if(build.getPreviousBuild()==null || (changedFiles!=null && changedFiles.isEmpty())) { // nothing to compare against, or no changes // (note that changedFiles==null ...
listener.getLogger().print(errorOutput);
private boolean calcChangeLog(Build build, List<String> changedFiles, File changelogFile, final BuildListener listener) { if(build.getPreviousBuild()==null || (changedFiles!=null && changedFiles.isEmpty())) { // nothing to compare against, or no changes // (note that changedFiles==null ...
if(msgLevel==org.apache.tools.ant.Project.MSG_ERR) listener.error(msg);
if(msgLevel==org.apache.tools.ant.Project.MSG_ERR) { errorOutput.write(msg); errorOutput.write('\n'); }
public void log(String msg, int msgLevel) { // send error to listener. This seems like the route in which the changelog task // sends output if(msgLevel==org.apache.tools.ant.Project.MSG_ERR) listener.error(msg); }
public int compare( Object obj1, Object obj2 )
public int compare( SWDownloadCandidate candidate1, SWDownloadCandidate candidate2 )
public int compare( Object obj1, Object obj2 ) { if ( obj1 == obj2 || obj1.equals(obj2) ) { return 0; } SWDownloadCandidate candidate1 = (SWDownloadCandidate)obj1; SWDownloadCandidate candidate2 = (SWDownloadCandidate)obj2; ...
if ( obj1 == obj2 || obj1.equals(obj2) )
if ( candidate1 == candidate2 || candidate1.equals(candidate2) )
public int compare( Object obj1, Object obj2 ) { if ( obj1 == obj2 || obj1.equals(obj2) ) { return 0; } SWDownloadCandidate candidate1 = (SWDownloadCandidate)obj1; SWDownloadCandidate candidate2 = (SWDownloadCandidate)obj2; ...
SWDownloadCandidate candidate1 = (SWDownloadCandidate)obj1; SWDownloadCandidate candidate2 = (SWDownloadCandidate)obj2;
public int compare( Object obj1, Object obj2 ) { if ( obj1 == obj2 || obj1.equals(obj2) ) { return 0; } SWDownloadCandidate candidate1 = (SWDownloadCandidate)obj1; SWDownloadCandidate candidate2 = (SWDownloadCandidate)obj2; ...
Iterator iterator = queuedCandidatesSet.iterator(); while ( iterator.hasNext() )
for ( SWDownloadCandidate altCandidate : queuedCandidatesSet )
public boolean addAndValidateQueuedCandidate( SWDownloadCandidate candidate ) { int maxWorkers = Math.min( ServiceManager.sCfg.maxTotalDownloadWorker, ServiceManager.sCfg.maxWorkerPerDownload ); int maxQueuedWorkers = (int)Math.max( Math.floor( maxWorkers - (maxWorke...
SWDownloadCandidate altCandidate = (SWDownloadCandidate) iterator.next();
public boolean addAndValidateQueuedCandidate( SWDownloadCandidate candidate ) { int maxWorkers = Math.min( ServiceManager.sCfg.maxTotalDownloadWorker, ServiceManager.sCfg.maxWorkerPerDownload ); int maxQueuedWorkers = (int)Math.max( Math.floor( maxWorkers - (maxWorke...
candidate = (SWDownloadCandidate)badCandidatesList.get(currentIndex);
candidate = badCandidatesList.get(currentIndex);
private SWDownloadCandidate allocateBadCandidate( SWDownloadWorker worker ) { SWDownloadCandidate candidate = null; synchronized( candidatesLock ) { int numCandidates = badCandidatesList.size(); // return quickly if there are no candidates if ( nu...
return memoryFile.allocateMissingScopeForCandidate( this, candidateScopeList,
return memoryFile.allocateMissingScopeForCandidate( candidateScopeList,
private DownloadScope allocateSegmentForRangeSet( DownloadScopeList candidateScopeList, long preferredSize) { assert fileSize != UNKNOWN_FILE_SIZE : "Cant allocate segment for range set with unknown end."; NLogger.debug( NLoggerNames.Download_Segment_Allocate, "alloca...
xjbFile.setIncompleteFileName( incompleteFile.getAbsolutePath() );
if ( incompleteFile != null ) { xjbFile.setIncompleteFileName( incompleteFile.getAbsolutePath() ); }
public XJBSWDownloadFile createXJBSWDownloadFile() throws JAXBException { ObjectFactory objFactory = new ObjectFactory(); XJBSWDownloadFile xjbFile = objFactory.createXJBSWDownloadFile(); xjbFile.setLocalFileName( destinationFile.getName() ); xjbFile.setIncompleteFileName( inco...
return (SWDownloadCandidate) allCandidatesList.get( index );
return allCandidatesList.get( index );
public SWDownloadCandidate getCandidate( int index ) { if ( index < 0 || index >= allCandidatesList.size() ) { return null; } return (SWDownloadCandidate) allCandidatesList.get( index ); }
return memoryFile.getRatedScopeList( this );
return memoryFile.getRatedScopeList( );
public RatedDownloadScopeList getRatedScopeList() { return memoryFile.getRatedScopeList( this ); }
return (SWDownloadCandidate)transferCandidatesList.get( index );
return transferCandidatesList.get( index );
public SWDownloadCandidate getTransferCandidate( int index ) { if ( index < 0 || index >= transferCandidatesList.size() ) { return null; } return (SWDownloadCandidate)transferCandidatesList.get( index ); }
Iterator iterator = goodCandidatesList.iterator(); while( iterator.hasNext() )
for ( SWDownloadCandidate candidate : goodCandidatesList )
public void rateDownloadScopeList( RatedDownloadScopeList ratedScopeList) { long oldestConnectTime = System.currentTimeMillis() - BAD_CANDIDATE_STATUS_TIMEOUT; synchronized( candidatesLock ) { Iterator iterator = goodCandidatesList.iterator(); while( iterator.hasNext() ...
SWDownloadCandidate candidate = (SWDownloadCandidate)iterator.next();
public void rateDownloadScopeList( RatedDownloadScopeList ratedScopeList) { long oldestConnectTime = System.currentTimeMillis() - BAD_CANDIDATE_STATUS_TIMEOUT; synchronized( candidatesLock ) { Iterator iterator = goodCandidatesList.iterator(); while( iterator.hasNext() ...
Iterator iterator = transferCandidatesList.iterator(); while ( iterator.hasNext() )
for ( SWDownloadCandidate candidate : transferCandidatesList )
private void updateCandidateWorkerCounts() { // to save performance search in transfer list for // downloading candidates. synchronized( candidatesLock ) { long now = System.currentTimeMillis(); if ( lastCandidateWorkerCountUpdate + CANDIDATE_WOR...
SWDownloadCandidate candidate = (SWDownloadCandidate) iterator.next(); CandidateStatus status = candidate.getStatus(); switch ( status )
CandidateStatus candStatus = candidate.getStatus(); switch ( candStatus )
private void updateCandidateWorkerCounts() { // to save performance search in transfer list for // downloading candidates. synchronized( candidatesLock ) { long now = System.currentTimeMillis(); if ( lastCandidateWorkerCountUpdate + CANDIDATE_WOR...
memoryFile.writeBuffersToDisk();
memoryFile.requestBufferWriting();
public void verifyStatus() { forceCollectionOfTransferData(); synchronized( candidatesLock ) { if ( !isFileCompletedOrMoved() && memoryFile.getFinishedBufferedLength() == getTotalDataSize() ) { // trigger data write down to disk.....
public DownloadScope allocateMissingScopeForCandidate( SWDownloadFile downloadFile, DownloadScopeList candidateScopeList, long preferredSize )
public DownloadScope allocateMissingScopeForCandidate( DownloadScopeList candidateScopeList, long preferredSize )
public DownloadScope allocateMissingScopeForCandidate( SWDownloadFile downloadFile, DownloadScopeList candidateScopeList, long preferredSize ) { synchronized( missingScopeList ) { DownloadScopeList wantedScopeList = (DownloadScopeList)missingScopeList.clone(); wantedSco...
public List getFinishedScopeListCopy()
public List<DownloadScope> getFinishedScopeListCopy()
public List getFinishedScopeListCopy() { return finishedScopeList.getScopeListCopy(); }
public RatedDownloadScopeList getRatedScopeList( SWDownloadFile downloadFile )
public RatedDownloadScopeList getRatedScopeList()
public RatedDownloadScopeList getRatedScopeList( SWDownloadFile downloadFile ) { long now = System.currentTimeMillis(); if ( ratedScopeListBuildTime + SWDownloadConstants.RATED_SCOPE_LIST_TIMEOUT > now ) { return ratedScopeList; } if ( ratedScopeList == null ) ...
isBufferWritingRequested = false;
public MemoryFile( SWDownloadFile downloadFile ) { this.downloadFile = downloadFile; missingScopeList = new DownloadScopeList(); blockedScopeList = new DownloadScopeList(); bufferedDataScopeList = new ArrayList<DataDownloadScope>(); //bufferedScopeList = new DownloadScopeList()...
bytesPerWindow = (int) ((double) throttlingRate / (double) WINDOWS_PER_SECONDS);
bytesPerWindow = Math.max( (int) ((double) throttlingRate / (double) WINDOWS_PER_SECONDS), 1 ) ;
public synchronized void setThrottlingRate(long bytesPerSecond) { throttlingRate = bytesPerSecond; bytesPerWindow = (int) ((double) throttlingRate / (double) WINDOWS_PER_SECONDS); if ( NLogger.isDebugEnabled( NLoggerNames.BANDWIDTH ) ) NLogger.debug(NLoggerNames.BANDWIDTH, ...
bytesRemaining = Math.min( bytesRemaining, bytesPerWindow );
bytesRemaining = bytesRemaining < bytesPerWindow ? Math.min( bytesRemaining, bytesPerWindow ) : bytesRemaining;
public synchronized void setThrottlingRate(long bytesPerSecond) { throttlingRate = bytesPerSecond; bytesPerWindow = (int) ((double) throttlingRate / (double) WINDOWS_PER_SECONDS); if ( NLogger.isDebugEnabled( NLoggerNames.BANDWIDTH ) ) NLogger.debug(NLoggerNames.BANDWIDTH, ...
public Host(DestAddress address, Connection connection)
public Host()
public Host(DestAddress address, Connection connection) { this(); hostAddress = address; this.connection = connection; }
this(); hostAddress = address; this.connection = connection;
hostsContainer = HostManager.getInstance().getNetworkHostsContainer(); connection = null; status = HostStatus.NOT_CONNECTED; type = TYPE_OUTGOING; mHasWorker = false; isConnectionStable = false; connectionType = CONNECTION_NORMAL; isQueryRoutingSupported = false; isUPQueryRoutingSupported = false; isDynamicQuerySuppor...
public Host(DestAddress address, Connection connection) { this(); hostAddress = address; this.connection = connection; }
public Object sqrt(Object param) throws ParseException {
public Object sqrt(Object param) throws ParseException { if (param instanceof Complex) return ((Complex)param).sqrt();
public Object sqrt(Object param) throws ParseException { if (param instanceof Number) { double value = ((Number)param).doubleValue(); // a value less than 0 will produce a complex result if (value < 0) { return (new Complex(value).sqrt()); } else { return new Double(Math.sqrt(value)); } } else i...
if (value < 0) {
if (value < 0.0) {
public Object sqrt(Object param) throws ParseException { if (param instanceof Number) { double value = ((Number)param).doubleValue(); // a value less than 0 will produce a complex result if (value < 0) { return (new Complex(value).sqrt()); } else { return new Double(Math.sqrt(value)); } } else i...
} else if (param instanceof Complex) { return ((Complex)param).sqrt();
public Object sqrt(Object param) throws ParseException { if (param instanceof Number) { double value = ((Number)param).doubleValue(); // a value less than 0 will produce a complex result if (value < 0) { return (new Complex(value).sqrt()); } else { return new Double(Math.sqrt(value)); } } else i...
req.setCharacterEncoding("UTF-8");
public static void doTrackback( Object it, StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { String title = req.getParameter("title"); String url = req.getParameter("url"); String excerpt = req.getParameter("excerpt"); String blog_name = req.getParameter("b...
public void println(Node node) { println(node,System.out); }
public void println(Node node,PrintStream out) { print(node,out); out.println(""); }
public void println(Node node) { println(node,System.out); }
if(subdirs==null) throw new IOException("Unable to create "+projectsDir+"\nPermission issue?");
private void load() throws IOException { XmlFile cfg = getConfigFile(); if(cfg.exists()) cfg.unmarshal(this); File projectsDir = new File(root,"jobs"); projectsDir.mkdirs(); File[] subdirs = projectsDir.listFiles(new FileFilter() { public boolean accept(File ...
public Recipe getRecipe() {return r;}
public Recipe getRecipe() { r.setAllowRecalcs(true); return r;}
public Recipe getRecipe() {return r;}
r.setAllowRecalcs(false);
public void startElement(String namespaceURI, String lName, // local unit String qName, // qualified unit Attributes attrs) throws SAXException { String eName = lName; // element unit if ("".equals(eName)) eName = qName; // namespaceAware = false currentElement = eName; currentAttributes = attrs; if (eNam...
public ServiceFactoryComponent(Config config, Dictionary overriddenProps) { super(config, overriddenProps); services = new Hashtable(); }
public ServiceFactoryComponent(Config config, Dictionary overriddenProps) { super(config, overriddenProps); }
public ServiceFactoryComponent(Config config, Dictionary overriddenProps) { super(config, overriddenProps); services = new Hashtable(); }
Object service = services.get(bundle);
Component component = services.get(bundle);
public synchronized Object getService(Bundle bundle, ServiceRegistration reg) { Object service = services.get(bundle); if (service == null) { Config copy = config.copy(); copy.setServiceFactory(false); copy.setShouldRegisterService(false); Component component = copy.createComponent(); c...
if (service == null) { Config copy = config.copy(); copy.setServiceFactory(false); copy.setShouldRegisterService(false); Component component = copy.createComponent(); component.enable(); service = component.getService(bundle, reg); services.put(bundle, service);
if (component == null) { Config copy = config.copy(); copy.setServiceFactory(false); copy.setShouldRegisterService(false); component = copy.createComponent(); component.enable(); services.put(bundle, component); } return component.getService(bundle, reg);
public synchronized Object getService(Bundle bundle, ServiceRegistration reg) { Object service = services.get(bundle); if (service == null) { Config copy = config.copy(); copy.setServiceFactory(false); copy.setShouldRegisterService(false); Component component = copy.createComponent(); c...
return service; }
public synchronized Object getService(Bundle bundle, ServiceRegistration reg) { Object service = services.get(bundle); if (service == null) { Config copy = config.copy(); copy.setServiceFactory(false); copy.setShouldRegisterService(false); Component component = copy.createComponent(); c...
public void ungetService(Bundle bundle, ServiceRegistration reg, Object instance) { super.ungetService(bundle, reg, instance); services.remove(bundle); }
public void ungetService(Bundle bundle, ServiceRegistration reg, Object instance) { super.ungetService(bundle, reg, instance); Component component = services.remove(bundle); if (component != null) { component.ungetService(bundle, reg, instance); component.disable(); } }
public void ungetService(Bundle bundle, ServiceRegistration reg, Object instance) { super.ungetService(bundle, reg, instance); services.remove(bundle); }
String encodedUrl = null; try { encodedUrl = URLEncoder.encode(build.getUrl(), "UTF-8"); } catch (UnsupportedEncodingException e) { throw new Error(e); } buf.append("See ").append(baseUrl).append(encodedUrl).append("\n\n");
buf.append("See ").append(baseUrl).append(build.getUrl()).append("\n\n");
private void appendBuildUrl(Build build, StringBuffer buf) { String baseUrl = DESCRIPTOR.getUrl(); if(baseUrl!=null) { String encodedUrl = null; try { encodedUrl = URLEncoder.encode(build.getUrl(), "UTF-8"); } catch (UnsupportedEncodingException e) { ...
Object val = Scaler.getInstance(lhs.getEle(0));
Object val = lhs.getEle(0);
public MatrixValueI calcValue(MatrixValueI res, MatrixValueI lhs) throws ParseException { if(!(res instanceof Scaler)) throw new ParseException("vsum: result must be a scaler"); Object val = Scaler.getInstance(lhs.getEle(0)); for(int i=1;i<lhs.getNumEles();++i) val = add.add(val,lhs.getEle(i)); res.setEle(...
public Comparator getColumnComparator( int column )
public Comparator<?> getColumnComparator( int column )
public Comparator getColumnComparator( int column ) { switch( column ) { case HOST_MODEL_INDEX: return new DestAddressComparator(); case PROGRESS_MODEL_INDEX: return ComparableComparator.getInstance(); // for all other columns use defau...
return "";
return null;
public Object getComparableValueAt( int row, int column ) { SWDownloadCandidate candidate = downloadFile.getCandidate( row ); if ( candidate == null ) { return ""; } switch( column ) { case PROGRESS_MODEL_INDEX: { D...
if (param instanceof Number)
if (param instanceof Complex) { return new Double(((Complex)param).abs()); } else if (param instanceof Number)
public Object abs(Object param) throws ParseException { if (param instanceof Number) { return new Double(Math.abs(((Number)param).doubleValue())); } else if (param instanceof Complex) { return new Double(((Complex)param).abs()); } throw new ParseException("Invalid parameter type"); }
} else if (param instanceof Complex) { return new Double(((Complex)param).abs());
public Object abs(Object param) throws ParseException { if (param instanceof Number) { return new Double(Math.abs(((Number)param).doubleValue())); } else if (param instanceof Complex) { return new Double(((Complex)param).abs()); } throw new ParseException("Invalid parameter type"); }
int available = controller.getAvailableByteCount( true ); int toUse = Math.min( available, 1000 );
int toUse = controller.getAvailableByteCount( 1000, true, false );
public void testRandThroughput() throws Exception { BandwidthController controller = BandwidthController.acquireBandwidthController( "Test2", 1000 ); long start = System.currentTimeMillis(); long totalData = 10000; while( totalData > 0 ) { int available = ...
int available = controller.getAvailableByteCount( true ); int toUse = Math.min( available, 1000 );
int toUse = controller.getAvailableByteCount( 1000, true, false );
public void testThroughput2() throws Exception { BandwidthController controller = BandwidthController.acquireBandwidthController( "Test2", 1000 ); long start = System.currentTimeMillis(); long totalData = 10000; while( totalData > 0 ) { int available = con...
public synchronized void doArtifact( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
public void doArtifact( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
public synchronized void doArtifact( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { serveFile(req, rsp, getArtifactsDir(), "package.gif", true); }
myRecipeNavigationGroup.dispose();
public void dispose() { myFolder.dispose(); myDisplay.dispose(); }