rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
else return pc.zeroConstant;
return pc.zeroConstant;
public PNodeI div(PNodeI c) throws ParseException { if(this.isZero()) { if(c.isZero()) return pc.nanConstant; else return pc.zeroConstant; } if(c.isZero()) return pc.infConstant; if(c.isOne()) return this; if(c instanceof Constant) return new Constant(pc,pc.div(value,((Constant) c).value)); return ...
else return false;
return false;
public boolean equals(PNodeI node) { if(node instanceof Constant) return value.equals(((Constant)node).value); else return false; }
else return pc.zeroConstant;
return pc.zeroConstant;
public PNodeI pow(PNodeI c) throws ParseException { if(this.isZero()){ if(c.isZero()) return pc.nanConstant; else return pc.zeroConstant; } if(this.isOne()) return pc.oneConstant; if(c.isZero()) return pc.oneConstant; if(c instanceof Constant) return new Constant(pc,pc.raise(value,((Constant) c).value));...
simplifyTest("2*x+x","3*x"); simplifyTest("2*x+3*x","5*x"); simplifyTest("5*x-3*x","2*x"); simplifyTest("3*x-5*x","-2*x"); simplifyTest("3*x-x","2*x");
public void testSimp() throws ParseException { simplifyTest("2+3","5"); simplifyTest("2*3","6"); simplifyTest("2^3","8"); simplifyTest("3/2","1.5"); simplifyTest("2*3+4","10"); simplifyTest("2*(3+4)","14"); simplifyTest("0+x","x"); simplifyTest("x+0","x"); simplifyTest("0-x","0-x"); simplifyTest("x-0","x"); ...
if (method == "Volume")
if (method.equalsIgnoreCase("Volume"))
private void calcAlcohol(String method) { double oPlato = sGToPlato(estOg); double fPlato = sGToPlato(estFg); double q = 0.22 + 0.001 * oPlato; double re = (q * oPlato + fPlato) / (1.0 + q); // calculate by weight: alcohol = (oPlato - re) / (2.0665 - 0.010665 * oPlato); if (method == "Volume") // convert to by ...
mf = new MessageFormat("OG: {0,number,0.000},\tFG:{1,number,0.000}, \tALC:{2,number,0.0}\n"); Object[] objs = {new Double(estOg), new Double(estFg), new Double(alcohol) };
mf = new MessageFormat("OG: {0,number,0.000},\tFG:{1,number,0.000}, \tAlc:{2,number,0.0}, \tIBU:{3,number,0.0}\n"); Object[] objs = {new Double(estOg), new Double(estFg), new Double(alcohol), new Double(ibu) };
public String toText(){ MessageFormat mf; StringBuffer sb = new StringBuffer(); sb.append("StrangeBrew J1.0 recipe text output\n\n"); sb.append("Details:\n"); sb.append("Name: " + name + "\n"); sb.append("Brewer: " + brewer + "\n"); sb.append("Size: " + SBStringUtils.df1.format(postBoilVol.getValue()) + " " + p...
sb.append("<!-- This is a SBJava export. StrangeBrew 1.8 will not import it. -->\n");
public String toXML() { StringBuffer sb = new StringBuffer(); sb.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"); sb.append("<STRANGEBREWRECIPE version = \"J1.0\">\n"); sb.append(" <DETAILS>\n"); sb.append(" <NAME>" + SBStringUtils.subEntities(name) + "</NAME>\n"); sb.append(" <BREWER>" + SBStri...
UnitRangeImpl range, double value) { return (int)Math.round(linearInterp(range.getMinValue(), 0, range.getMaxValue(), totalPixels, value));
MicroSecondDate begin, MicroSecondDate end, MicroSecondDate value) { return (int)Math.round(linearInterp(begin.getMicroSecondTime(), 0, end.getMicroSecondTime(), totalPixels, value.getMicroSecondTime()));
public static final int getPixel(int totalPixels, UnitRangeImpl range, double value) { return (int)Math.round(linearInterp(range.getMinValue(), 0, range.getMaxValue(), totalPixels, ...
public int compare(Object obj1, Object obj2)
public int compare( SearchResultElement sr1, SearchResultElement sr2 )
public int compare(Object obj1, Object obj2) { if( obj1 == obj2 || obj1.equals( obj2 ) ) { return 0; } SearchResultElement sr1 = (SearchResultElement)obj1; SearchResultElement sr2 = (SearchResultElement)obj2; long diff; switch ( sortFiel...
if( obj1 == obj2 || obj1.equals( obj2 ) )
if( sr1 == sr2 || sr1.equals( sr2 ) )
public int compare(Object obj1, Object obj2) { if( obj1 == obj2 || obj1.equals( obj2 ) ) { return 0; } SearchResultElement sr1 = (SearchResultElement)obj1; SearchResultElement sr2 = (SearchResultElement)obj2; long diff; switch ( sortFiel...
SearchResultElement sr1 = (SearchResultElement)obj1; SearchResultElement sr2 = (SearchResultElement)obj2;
public int compare(Object obj1, Object obj2) { if( obj1 == obj2 || obj1.equals( obj2 ) ) { return 0; } SearchResultElement sr1 = (SearchResultElement)obj1; SearchResultElement sr2 = (SearchResultElement)obj2; long diff; switch ( sortFiel...
assertSame(childUserRole, roles.toArray()[0]); assertSame(parentUserRole, roles.toArray()[1]);
assertTrue(roles.contains(childUserRole)); assertTrue(roles.contains(parentUserRole));
public void testDefaultAuthorityResolution() { UserRole childUserRole = new UserRole(), parentUserRole = new UserRole(); childUserRole.setServiceExtension("1"); parentUserRole.setServiceExtension("2"); User user = userDetailsAdapter.getUser(); user.setParent(new UserGroup()); ...
assertSame(childUserRole, roles.toArray()[0]); assertSame(parentUserRole, roles.toArray()[1]);
assertTrue(roles.contains(childUserRole)); assertTrue(roles.contains(parentUserRole));
public void testDuplicateDefaultAuthorityResolution() { UserRole childUserRole = new UserRole(), parentUserRole = new UserRole(); childUserRole.setServiceExtension("1"); parentUserRole.setServiceExtension("2"); User user = userDetailsAdapter.getUser(); user.setParent(new UserGroup...
shareMgr = ShareManager.getInstance(); queryHistory = QueryManager.getInstance().getQueryHistoryMonitor();
public ConnectionEngine( Host connectedHost ) { this.connectedHost = connectedHost; connection = connectedHost.getConnection(); shareMgr = ShareManager.getInstance(); queryHistory = QueryManager.getInstance().getQueryHistoryMonitor(); messageMgr = MsgManager.getInstance(); ...
msgDispatcher = messageMgr.getMessageDispatcher();
public ConnectionEngine( Host connectedHost ) { this.connectedHost = connectedHost; connection = connectedHost.getConnection(); shareMgr = ShareManager.getInstance(); queryHistory = QueryManager.getInstance().getQueryHistoryMonitor(); messageMgr = MsgManager.getInstance(); ...
handlePing( (PingMsg)message );
msgDispatcher.handlePing((PingMsg)message, connectedHost );
public void processIncomingData() throws IOException { headerBuffer = new byte[ MsgHeader.DATA_LENGTH ]; try { while ( true ) { MsgHeader header = readHeader(); byte[] body = MessageProcessor.readMessageBody( connection, ...
handlePong( (PongMsg)message );
msgDispatcher.handlePong( (PongMsg)message, connectedHost );
public void processIncomingData() throws IOException { headerBuffer = new byte[ MsgHeader.DATA_LENGTH ]; try { while ( true ) { MsgHeader header = readHeader(); byte[] body = MessageProcessor.readMessageBody( connection, ...
handlePushRequest( (PushRequestMsg) message );
msgDispatcher.handlePushRequest( (PushRequestMsg) message, connectedHost );
public void processIncomingData() throws IOException { headerBuffer = new byte[ MsgHeader.DATA_LENGTH ]; try { while ( true ) { MsgHeader header = readHeader(); byte[] body = MessageProcessor.readMessageBody( connection, ...
handleQuery( (QueryMsg) message );
msgDispatcher.handleQuery( (QueryMsg) message, connectedHost );
public void processIncomingData() throws IOException { headerBuffer = new byte[ MsgHeader.DATA_LENGTH ]; try { while ( true ) { MsgHeader header = readHeader(); byte[] body = MessageProcessor.readMessageBody( connection, ...
handleQueryResponse( (QueryResponseMsg) message );
msgDispatcher.handleQueryResponse( (QueryResponseMsg) message, connectedHost );
public void processIncomingData() throws IOException { headerBuffer = new byte[ MsgHeader.DATA_LENGTH ]; try { while ( true ) { MsgHeader header = readHeader(); byte[] body = MessageProcessor.readMessageBody( connection, ...
handleRouteTableUpdate( (RouteTableUpdateMsg) message );
msgDispatcher.handleRouteTableUpdate( (RouteTableUpdateMsg) message, connectedHost );
public void processIncomingData() throws IOException { headerBuffer = new byte[ MsgHeader.DATA_LENGTH ]; try { while ( true ) { MsgHeader header = readHeader(); byte[] body = MessageProcessor.readMessageBody( connection, ...
handleVendorMessage( (VendorMsg) message );
msgDispatcher.handleVendorMessage( (VendorMsg) message, connectedHost );
public void processIncomingData() throws IOException { headerBuffer = new byte[ MsgHeader.DATA_LENGTH ]; try { while ( true ) { MsgHeader header = readHeader(); byte[] body = MessageProcessor.readMessageBody( connection, ...
req.setCharacterEncoding("UTF-8");
public synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { try { if(!Hudson.adminCheck(req,rsp)) return; int scmidx = Integer.parseInt(req.getParameter("scm")); scm = SCMManager.getSupportedSCMs()[s...
allRemoteFiles = new ArrayList(); allSearchResultSHA1Set = new HashSet();
allRemoteFiles = new ArrayList<RemoteFile>(); allSearchResultSHA1Set = new HashSet<String>();
private SearchResultsDataModel( Search search ) { this.search = search; allRemoteFiles = new ArrayList(); allSearchResultSHA1Set = new HashSet(); allSearchResultCount = 0; displayedSearchResults = new ArrayList(); displayedSearchResultSHA1Map = new HashMap(); sear...
displayedSearchResults = new ArrayList(); displayedSearchResultSHA1Map = new HashMap();
displayedSearchResults = new ArrayList<SearchResultElement>(); displayedSearchResultSHA1Map = new HashMap<String, SearchResultElement>();
private SearchResultsDataModel( Search search ) { this.search = search; allRemoteFiles = new ArrayList(); allSearchResultSHA1Set = new HashSet(); allSearchResultCount = 0; displayedSearchResults = new ArrayList(); displayedSearchResultSHA1Map = new HashMap(); sear...
searchFilterRuleSet = new HashSet();
searchFilterRuleSet = new HashSet<Rule>();
private SearchResultsDataModel( Search search ) { this.search = search; allRemoteFiles = new ArrayList(); allSearchResultSHA1Set = new HashSet(); allSearchResultCount = 0; displayedSearchResults = new ArrayList(); displayedSearchResultSHA1Map = new HashMap(); sear...
resultElement = (SearchResultElement)displayedSearchResultSHA1Map.get( sha1 );
resultElement = displayedSearchResultSHA1Map.get( sha1 );
private void addSearchResultForDisplay(RemoteFile remoteFile) { SearchResultElement resultElement = null; String sha1 = remoteFile.getSHA1(); if ( sha1 != null ) { resultElement = (SearchResultElement)displayedSearchResultSHA1Map.get( sha1 ); } if ( resultElem...
return (SearchResultElement)displayedSearchResults.get( index );
return displayedSearchResults.get( index );
public SearchResultElement getSearchElementAt( int index ) { if ( index < 0 || index >= displayedSearchResults.size() ) { return null; } return (SearchResultElement)displayedSearchResults.get( index ); }
Iterator iterator = searchFilterRuleSet.iterator(); while( iterator.hasNext() )
for ( Rule rule : searchFilterRuleSet )
private void processFilterRules( RemoteFile[] remoteFiles ) { if ( searchFilterRuleSet == null ) { return; } if ( quickFilterRule != null ) { quickFilterRule.process(search, remoteFiles); } Iterator iterator = searchFilterRuleSet.iterator(); ...
Rule rule = (Rule) iterator.next();
private void processFilterRules( RemoteFile[] remoteFiles ) { if ( searchFilterRuleSet == null ) { return; } if ( quickFilterRule != null ) { quickFilterRule.process(search, remoteFiles); } Iterator iterator = searchFilterRuleSet.iterator(); ...
List remoteFilesList = new ArrayList( allRemoteFiles );
List<RemoteFile> remoteFilesList = new ArrayList<RemoteFile>( allRemoteFiles );
private void updateSecurityFilteredQueryList( IPAccessRule rule ) { // the code is basically the same as updateFilteredQueryList // except that is using a list for better performance. synchronized( allRemoteFiles ) { synchronized( displayedSearchResults ) { //...
ListIterator iterator = remoteFilesList.listIterator();
ListIterator<RemoteFile> iterator = remoteFilesList.listIterator();
private void updateSecurityFilteredQueryList( IPAccessRule rule ) { // the code is basically the same as updateFilteredQueryList // except that is using a list for better performance. synchronized( allRemoteFiles ) { synchronized( displayedSearchResults ) { //...
RemoteFile remoteFile = (RemoteFile) iterator.next();
RemoteFile remoteFile = iterator.next();
private void updateSecurityFilteredQueryList( IPAccessRule rule ) { // the code is basically the same as updateFilteredQueryList // except that is using a list for better performance. synchronized( allRemoteFiles ) { synchronized( displayedSearchResults ) { //...
if (param1 instanceof Number) { if (param2 instanceof Number) {
if (param1 instanceof Complex) { if (param2 instanceof Complex) return power((Complex)param1, (Complex)param2); else if (param2 instanceof Number) return power((Complex)param1, (Number)param2); } else if (param1 instanceof Number) { if (param2 instanceof Complex) return power((Number)param1, (Complex)param2); else if (...
public Object power(Object param1, Object param2) throws ParseException { if (param1 instanceof Number) { if (param2 instanceof Number) { return power((Number)param1, (Number)param2); } else if (param2 instanceof Complex) { return power((Number)param1, (Complex)param2); } } else if (param1 instanceof Co...
} else if (param2 instanceof Complex) { return power((Number)param1, (Complex)param2); } } else if (param1 instanceof Complex) { if (param2 instanceof Number) { return power((Complex)param1, (Number)param2); } else if (param2 instanceof Complex) { return power((Complex)param1, (Complex)param2); }
public Object power(Object param1, Object param2) throws ParseException { if (param1 instanceof Number) { if (param2 instanceof Number) { return power((Number)param1, (Number)param2); } else if (param2 instanceof Complex) { return power((Number)param1, (Complex)param2); } } else if (param1 instanceof Co...
setAsText(id, ExternalDocument.class);
if (logger.isDebugEnabled()) { logger.debug("Loaded ExternalDocument property editor"); } try { Object value = getHibernateTemplate().load(ExternalDocument.class, Long.parseLong(id)); super.setValue(value); if (logger.isDebugEnabled()) { logger.debug("Loaded property: "+value); } } catch (Exception e) { super.setValue(...
public void setAsText(String id) throws IllegalArgumentException { setAsText(id, ExternalDocument.class); }
PropertyEditor documentPropertyEditor = new DocumentPropertyEditor(getHibernateTemplate()); if (logger.isDebugEnabled()) { logger.debug("Registering custom editor "+documentPropertyEditor); } registry.registerCustomEditor(Document.class, documentPropertyEditor);
public void registerCustomEditors(PropertyEditorRegistry registry) { PropertyEditor externalDocumentPropertyEditor = new ExternalDocumentPropertyEditor(getHibernateTemplate()); if (logger.isDebugEnabled()) { logger.debug("Registering custom editor "+externalDocumentPropertyEditor); }...
public int getDownloadFileCount( int status )
public int getDownloadFileCount()
public int getDownloadFileCount( int status ) { int count = 0; synchronized( downloadList ) { for ( SWDownloadFile file : downloadList ) { if ( file.getStatus() == status ) { count ++; } } ...
int count = 0; synchronized( downloadList ) { for ( SWDownloadFile file : downloadList ) { if ( file.getStatus() == status ) { count ++; } } } return count;
return downloadList.size();
public int getDownloadFileCount( int status ) { int count = 0; synchronized( downloadList ) { for ( SWDownloadFile file : downloadList ) { if ( file.getStatus() == status ) { count ++; } } ...
timeRefType = new String(threeBytes);
timeRefType = new String(PSNDataFile.chopToLength(threeBytes));
private void readHeader() throws IOException{ /**Variable Header Length**/ //varHeadLength = dis.readInt(); varHeadLength = SacTimeSeries.swapBytes(dis.readInt()); //System.out.println("varHeadLength = " + Integer.toHexString(varHeadLength) + " or " + varHeadLength); dateTime = n...
sensorName = new String(sixBytes);
sensorName = new String(PSNDataFile.chopToLength(sixBytes));
private void readHeader() throws IOException{ /**Variable Header Length**/ //varHeadLength = dis.readInt(); varHeadLength = SacTimeSeries.swapBytes(dis.readInt()); //System.out.println("varHeadLength = " + Integer.toHexString(varHeadLength) + " or " + varHeadLength); dateTime = n...
channelId = new String(fourBytes);
channelId = new String(PSNDataFile.chopToLength(fourBytes));
private void readHeader() throws IOException{ /**Variable Header Length**/ //varHeadLength = dis.readInt(); varHeadLength = SacTimeSeries.swapBytes(dis.readInt()); //System.out.println("varHeadLength = " + Integer.toHexString(varHeadLength) + " or " + varHeadLength); dateTime = n...
sensorNetwork = new String(sixBytes);
sensorNetwork = new String(PSNDataFile.chopToLength(sixBytes));
private void readHeader() throws IOException{ /**Variable Header Length**/ //varHeadLength = dis.readInt(); varHeadLength = SacTimeSeries.swapBytes(dis.readInt()); //System.out.println("varHeadLength = " + Integer.toHexString(varHeadLength) + " or " + varHeadLength); dateTime = n...
MutiableMonomial toMutiableMonomial() throws ParseException
MutiableMonomial toMutiableMonomial()
MutiableMonomial toMutiableMonomial() throws ParseException { PNodeI newTerms[] = new PNodeI[vars.length]; PNodeI newPows[] = new PNodeI[vars.length]; for(int i=0;i<vars.length;++i){ newTerms[i] = vars[i]; newPows[i] = powers[i]; } return new MutiableMonomial(pc,coeff,newTerms,newPows); }
PNodeI valueOf(Constant coeff,PNodeI terms[],PNodeI pows[]) throws ParseException
PNodeI valueOf(Constant coefficient,PNodeI terms[],PNodeI pows[])
PNodeI valueOf(Constant coeff,PNodeI terms[],PNodeI pows[]) throws ParseException { if(coeff.isZero()) return pc.zeroConstant; if(terms.length ==0) return coeff; return new Monomial(pc,coeff,terms,pows); }
if(coeff.isZero()) return pc.zeroConstant; if(terms.length ==0) return coeff; return new Monomial(pc,coeff,terms,pows);
if(coefficient.isZero()) return pc.zeroConstant; if(terms.length ==0) return coefficient; return new Monomial(pc,coefficient,terms,pows);
PNodeI valueOf(Constant coeff,PNodeI terms[],PNodeI pows[]) throws ParseException { if(coeff.isZero()) return pc.zeroConstant; if(terms.length ==0) return coeff; return new Monomial(pc,coeff,terms,pows); }
System.out.println(query);
private StationId[] extractAll(PreparedStatement query) throws SQLException { System.out.println(query); ResultSet rs = query.executeQuery(); List aList = new ArrayList(); try { while(rs.next()) aList.add(extractId(rs, netTable, time)); } catch(NotFound e...
for( Executor e : executors ) e.interrupt();
synchronized(this) { for( Executor e : executors ) if(e.getCurrentBuild()==null) e.interrupt();
public synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException { useSecurity = req.getParameter("use_security")!=null; numExecutors = Integer.parseInt(req.getParameter("numExecutors")); for( Executor e : executors ) e.interrupt(); while(e...
while(executors.size()<numExecutors) executors.add(new Executor(this));
while(executors.size()<numExecutors) executors.add(new Executor(this)); }
public synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException { useSecurity = req.getParameter("use_security")!=null; numExecutors = Integer.parseInt(req.getParameter("numExecutors")); for( Executor e : executors ) e.interrupt(); while(e...
for( int i=0; i<subdirs.length; i++ ) {
for (final File subdir : subdirs) {
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...
Job p = Job.load(this,subdirs[i]); jobs.put(p.getName(),p); } catch( IOException e ) {
Job p = Job.load(this,subdir); jobs.put(p.getName(), p); } catch (IOException e) {
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...
if (param instanceof Number)
if (param instanceof Complex) { return ((Complex)param).cosh(); } else if (param instanceof Number)
public Object cosh(Object param) throws ParseException { if (param instanceof Number) { double value = ((Number)param).doubleValue(); return new Double((Math.exp(value) + Math.exp(-value))/2); } else if (param instanceof Complex) { return ((Complex)param).cosh(); } throw new ParseException("Invalid param...
else if (param instanceof Complex) { return ((Complex)param).cosh(); }
public Object cosh(Object param) throws ParseException { if (param instanceof Number) { double value = ((Number)param).doubleValue(); return new Double((Math.exp(value) + Math.exp(-value))/2); } else if (param instanceof Complex) { return ((Complex)param).cosh(); } throw new ParseException("Invalid param...
if ( !ggepBlock.isExtensionAvailable( GGEPBlock.ULTRAPEER_ID ) )
if ( ggepBlock == null || !ggepBlock.isExtensionAvailable( GGEPBlock.ULTRAPEER_ID ) )
public boolean hasFreeLeafSlots() { if ( !ggepBlock.isExtensionAvailable( GGEPBlock.ULTRAPEER_ID ) ) { return false; } byte[] data = ggepBlock.getExtensionData( GGEPBlock.ULTRAPEER_ID ); if ( data != null ) { if( data.length >= 3 ) { ...
if ( !ggepBlock.isExtensionAvailable( GGEPBlock.ULTRAPEER_ID ) )
if ( ggepBlock == null || !ggepBlock.isExtensionAvailable( GGEPBlock.ULTRAPEER_ID ) )
public boolean hasFreeUPSlots() { if ( !ggepBlock.isExtensionAvailable( GGEPBlock.ULTRAPEER_ID ) ) { return false; } byte[] data = ggepBlock.getExtensionData( GGEPBlock.ULTRAPEER_ID ); if ( data != null ) { if( data.length >= 3 ) { ...
rsp.sendRedirect(req.getContextPath()+"/images/48x48/"+getBuildStatusUrl());
rsp.sendRedirect(req.getContextPath()+"/nocacheImages/48x48/"+getBuildStatusUrl());
public void doBuildStatus( StaplerRequest req, StaplerResponse rsp ) throws IOException { rsp.sendRedirect(req.getContextPath()+"/images/48x48/"+getBuildStatusUrl()); }
req.setCharacterEncoding("UTF-8");
public synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException { if(!Hudson.adminCheck(req,rsp)) return; useSecurity = req.getParameter("use_security")!=null; numExecutors = Integer.parseInt(req.getParameter("numExecutors")); quietPeriod ...
req.setCharacterEncoding("UTF-8");
public synchronized Job doCreateJob( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { if(!Hudson.adminCheck(req,rsp)) return null; String name = req.getParameter("name").trim(); String className = req.getParameter("type"); String mode = req.getP...
req.setCharacterEncoding("UTF-8");
public synchronized void doCreateView( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { if(!Hudson.adminCheck(req,rsp)) return; String name = req.getParameter("name"); try { checkGoodName(name); } catch (ParseException e) { ...
for( BuildStepDescriptor d : BuildStep.PUBLISHERS ) result &= d.configure(req);
public synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException { useSecurity = req.getParameter("use_security")!=null; numExecutors = Integer.parseInt(req.getParameter("numExecutors")); synchronized(this) { for( Executor e : executors ) ...
public Node deepCopy(Node node,XJep xjep) throws ParseException
public Node deepCopy(Node node,XJep xj) throws ParseException
public Node deepCopy(Node node,XJep xjep) throws ParseException { this.xjep = xjep; Node res = (Node) node.jjtAccept(this,null); return res; }
this.xjep = xjep;
this.xjep = xj;
public Node deepCopy(Node node,XJep xjep) throws ParseException { this.xjep = xjep; Node res = (Node) node.jjtAccept(this,null); return res; }
|| qName.equalsIgnoreCase("NOTES")) {
|| (qName.equalsIgnoreCase("NOTES") && !currentList.equalsIgnoreCase("DETAILS")) ) {
public void endElement(String namespaceURI, String sName, // simple name String qName // qualified name ) throws SAXException { if (importType == "STRANGEBREW") { if (qName.equalsIgnoreCase("ITEM") && currentList.equalsIgnoreCase("FERMENTABLES")) { r.addMalt(m); m = null; } else if (qName.equalsIgnore...
} else if (eName.equalsIgnoreCase("NOTES")) {
} else if (eName.equalsIgnoreCase("NOTES") && !currentList.equals("DETAILS")) {
void sbStartElement(String eName) { if (eName.equalsIgnoreCase("DETAILS")) { currentList = "DETAILS"; } else if (eName.equalsIgnoreCase("FERMENTABLES")) { currentList = "FERMENTABLES"; } else if (eName.equalsIgnoreCase("HOPS")) { currentList = "HOPS"; } else if (eName.equalsIgnoreCase("MASH") && currentList....
public Object locateService(String name) {
public Object locateService(Object bindObject, String name) {
public Object locateService(String name) { Reference ref = config.getReference(name); return ref.getService(); }
return ref.getService();
return ref.getService(bindObject);
public Object locateService(String name) { Reference ref = config.getReference(name); return ref.getService(); }
public Object[] locateServices(String name) {
public Object[] locateServices(Object bindObject, String name) {
public Object[] locateServices(String name) { Reference ref = config.getReference(name); return ref.getServiceReferences(); }
return ref.getServiceReferences();
ServiceReference[] refs = ref.getServiceReferences(); Object[] ret = new Object[refs.length]; for (int i = 0; i < refs.length; i++) { ret[i] = ref.getService(bindObject, refs[i]); } return ret;
public Object[] locateServices(String name) { Reference ref = config.getReference(name); return ref.getServiceReferences(); }
disable();
public void dispose() { unregisterService(); deactivate(); }
config.bindReferences(instance, this.usingBundle);
config.bindReferences(instance, getDuplexObject());
public synchronized void activate() { // this method is described on page 297 r4 // Synchronized because the service is registered before activation, // enabling another thread to get the service and thereby trigger a // second activate() call. if (!config.isEnabled() || !config.i...
config.unbindReferences(instance);
config.unbindReferences(instance, getDuplexObject());
public synchronized void activate() { // this method is described on page 297 r4 // Synchronized because the service is registered before activation, // enabling another thread to get the service and thereby trigger a // second activate() call. if (!config.isEnabled() || !config.i...
config.unbindReferences(instance);
config.unbindReferences(instance, getDuplexObject());
public synchronized void deactivate() { // this method is described on page 432 r4 if (!isActivated()) return; try { Class klass = instance.getClass(); Method method = klass.getDeclaredMethod("deactivate", new Class[] { ComponentContext.class ...
ArrayList<DuplexReference> duplexRef = this.config .getDuplexReferences(); if (duplexRef != null && duplexRef.size() != 0) effectiveProperties.put(Constants.DUPLEX_REFERENCE, duplexRef);
public void registerService() { if (Activator.log.doDebug()) { Activator.log.debug("registerService() got BundleContext: " + bundleContext); } if (!config.getShouldRegisterService()) return; String[] interfaces = config.getServices(); if (i...
public void bindReferences(Object instance, Bundle bundle) {
public void bindReferences(Object instance, Object duplexObject) {
public void bindReferences(Object instance, Bundle bundle) { for (int i = 0; i < references.size(); i++) { ((Reference) references.get(i)).bind(instance); } for (DuplexReference ref : this.duplexReferences) { ref.bind(instance, bundle); } }
ref.bind(instance, bundle);
ref.bind(instance, duplexObject);
public void bindReferences(Object instance, Bundle bundle) { for (int i = 0; i < references.size(); i++) { ((Reference) references.get(i)).bind(instance); } for (DuplexReference ref : this.duplexReferences) { ref.bind(instance, bundle); } }
public void unbindReferences(Object instance) {
public void unbindReferences(Object instance, Object duplexObject) { for (int i = this.duplexReferences.size() - 1; i >= 0; i--) { this.duplexReferences.get(i).unbind(instance, duplexObject); }
public void unbindReferences(Object instance) { for (int i = references.size() - 1; i >= 0; i--) { ((Reference) references.get(i)).unbind(instance); } for (DuplexReference ref : this.duplexReferences) { ref.unbind(instance); } }
for (DuplexReference ref : this.duplexReferences) { ref.unbind(instance); }
public void unbindReferences(Object instance) { for (int i = references.size() - 1; i >= 0; i--) { ((Reference) references.get(i)).unbind(instance); } for (DuplexReference ref : this.duplexReferences) { ref.unbind(instance); } }
int idx1 = key1.lastIndexOf( LIST_POSTFIX ) + LIST_POSTFIX.length(); String val1Str = key1.substring( idx1 );
int idx1 = key1.lastIndexOf( LIST_DESER_POSTFIX ) + LIST_DESER_POSTFIX.length(); int idx1E = key1.indexOf( ']', idx1 ); String val1Str = key1.substring( idx1, idx1E );
public int compare( String key1, String key2 ) { if ( key1 == key2 || key1.equals( key2 ) ) { return 0; } int idx1 = key1.lastIndexOf( LIST_POSTFIX ) + LIST_POSTFIX.length(); String val1Str = key1.substring( idx1 ); int val1...
int idx2 = key2.lastIndexOf( LIST_POSTFIX ) + LIST_POSTFIX.length(); String val2Str = key1.substring( idx1 );
int idx2 = key2.lastIndexOf( LIST_DESER_POSTFIX ) + LIST_DESER_POSTFIX.length(); int idx2E = key2.indexOf( ']', idx2 ); String val2Str = key1.substring( idx2, idx2E );
public int compare( String key1, String key2 ) { if ( key1 == key2 || key1.equals( key2 ) ) { return 0; } int idx1 = key1.lastIndexOf( LIST_POSTFIX ) + LIST_POSTFIX.length(); String val1Str = key1.substring( idx1 ); int val1...
val2 = Integer.parseInt( val1Str );
val2 = Integer.parseInt( val2Str );
public int compare( String key1, String key2 ) { if ( key1 == key2 || key1.equals( key2 ) ) { return 0; } int idx1 = key1.lastIndexOf( LIST_POSTFIX ) + LIST_POSTFIX.length(); String val1Str = key1.substring( idx1 ); int val1...
return key2.hashCode() - key1.hashCode();
return key1.hashCode() - key2.hashCode();
public int compare( String key1, String key2 ) { if ( key1 == key2 || key1.equals( key2 ) ) { return 0; } int idx1 = key1.lastIndexOf( LIST_POSTFIX ) + LIST_POSTFIX.length(); String val1Str = key1.substring( idx1 ); int val1...
return val2 - val1;
return val1 - val2;
public int compare( String key1, String key2 ) { if ( key1 == key2 || key1.equals( key2 ) ) { return 0; } int idx1 = key1.lastIndexOf( LIST_POSTFIX ) + LIST_POSTFIX.length(); String val1Str = key1.substring( idx1 ); int val1...
List<String> names = preferences.getPrefixedPropertyNames( name + LIST_POSTFIX );
List<String> names = preferences.getPrefixedPropertyNames( name + LIST_DESER_POSTFIX );
private static List<String> deserializeList( String name, Preferences preferences ) { List<String> list = new ArrayList<String>(); List<String> names = preferences.getPrefixedPropertyNames( name + LIST_POSTFIX ); Collections.sort( names, new ListPostfixKeyComparator() ); for ( String ...
String prefix = new String ( name + SET_POSTFIX );
String prefix = new String ( name + SET_DESER_POSTFIX );
private static Set<String> deserializeSet( String name, Preferences preferences ) { Set<String> set = new HashSet<String>(); String prefix = new String ( name + SET_POSTFIX ); List<String> names = preferences.getPrefixedPropertyNames( prefix ); for ( String key : names ) ...
String setName = name + SET_POSTFIX;
public static void serializeSetting( Setting setting, Properties properties ) { String name = setting.getName(); Object value = setting.get(); if ( value instanceof String ) { properties.setProperty( name, (String)value ); } else if ( value instanceof Number )...
properties.setProperty( setName, elem );
properties.setProperty( name + String.format( SET_SER_POSTFIX, new Integer( pos++ ) ), elem );
public static void serializeSetting( Setting setting, Properties properties ) { String name = setting.getName(); Object value = setting.get(); if ( value instanceof String ) { properties.setProperty( name, (String)value ); } else if ( value instanceof Number )...
String listName = name + LIST_POSTFIX;
public static void serializeSetting( Setting setting, Properties properties ) { String name = setting.getName(); Object value = setting.get(); if ( value instanceof String ) { properties.setProperty( name, (String)value ); } else if ( value instanceof Number )...
properties.setProperty( listName + String.valueOf( i ),
properties.setProperty( name + String.format( LIST_SER_POSTFIX, new Integer( i ) ),
public static void serializeSetting( Setting setting, Properties properties ) { String name = setting.getName(); Object value = setting.get(); if ( value instanceof String ) { properties.setProperty( name, (String)value ); } else if ( value instanceof Number )...
public Rational(BigInteger num) { numerator = num; denominator = BigInteger.ONE; }
private Rational() { }
public Rational(BigInteger num) { numerator = num; denominator = BigInteger.ONE; }
else return numerator.toString() +"/" + denominator.toString();
return numerator.toString() +"/" + denominator.toString();
public String toString() { if(denominator.equals(BigInteger.ONE)) return numerator.toString(); else return numerator.toString() +"/" + denominator.toString(); }
else return new Rational(
return new Rational(
public static Number valueOf(String s) { int pos = s.indexOf('/'); if(pos==-1) return new Rational(new BigInteger(s)); else return new Rational( new BigInteger(s.substring(pos-1)), new BigInteger(s.substring(pos+1,-1))); }
FileInputStream log = new FileInputStream(changelogFile); try { Util.copyStream(log,listener.getLogger()); } finally { log.close(); }
private boolean calcChangeLog(Build build, File changelogFile, Launcher launcher, BuildListener listener) throws IOException { if(build.getPreviousBuild()==null) { // nothing to compare against return createEmptyChangeLog(changelogFile, listener, "log"); } PrintStream logg...
private String checkFileType(File f){ String suff = f.getPath().substring(f.getPath().length()-3, f.getPath().length()); Debug.print(suff); if (suff.equalsIgnoreCase(".rec"))
private String checkFileType(File f) { if (f.getPath().endsWith(".rec"))
private String checkFileType(File f){ String suff = f.getPath().substring(f.getPath().length()-3, f.getPath().length()); Debug.print(suff); if (suff.equalsIgnoreCase(".rec")) return "promash"; // let's open it up and have a peek // we'll only read 10 lines try { FileReader in = new FileReader(f); Buf...
try { FileReader in = new FileReader(f); BufferedReader inb = new BufferedReader(in); String c; int i = 0; while ((c = inb.readLine()) != null && i<10){ if (c.indexOf("BeerXML Format") > -1) return "beerxml"; if (c.indexOf("STRANGEBREWRECIPE") > -1) return "sb"; if (c.indexOf("generator=\"qbrew\"") > -1) return "qbrew"...
if (f.getPath().endsWith(".qbrew") || (f.getPath().endsWith(".xml"))) { try { FileReader in = new FileReader(f); BufferedReader inb = new BufferedReader(in); String c; int i = 0; while ((c = inb.readLine()) != null && i < 10) { if (c.indexOf("BeerXML Format") > -1) return "beerxml"; if (c.indexOf("STRANGEBREWRECIPE") >...
private String checkFileType(File f){ String suff = f.getPath().substring(f.getPath().length()-3, f.getPath().length()); Debug.print(suff); if (suff.equalsIgnoreCase(".rec")) return "promash"; // let's open it up and have a peek // we'll only read 10 lines try { FileReader in = new FileReader(f); Buf...
} catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }
}
private String checkFileType(File f){ String suff = f.getPath().substring(f.getPath().length()-3, f.getPath().length()); Debug.print(suff); if (suff.equalsIgnoreCase(".rec")) return "promash"; // let's open it up and have a peek // we'll only read 10 lines try { FileReader in = new FileReader(f); Buf...
public Recipe openFile(File f){ String type = checkFileType(f); Debug.print("File type: " + type); if (type.equalsIgnoreCase("")){ Debug.print("Unrecognized file"); JOptionPane.showMessageDialog( null, "The file you've tried to open isn't a recognized format. \n" + "You can open: \n" + "StrangeBrew 1.x and Java files...
public Recipe openFile(File f) { fileType = checkFileType(f); Debug.print("File type: " + fileType); if (fileType.equals("promash")) { PromashImport imp = new PromashImport();
public Recipe openFile(File f){ String type = checkFileType(f); Debug.print("File type: " + type); if (type.equalsIgnoreCase("")){ Debug.print("Unrecognized file"); JOptionPane.showMessageDialog( null, "The file you've tried to open isn't a recognized format. \n" + "You can open: \n" + "Str...
} if (type.equals("sb") || type.equals("qbrew")){
} else if (fileType.equals("sb") || fileType.equals("qbrew")) {
public Recipe openFile(File f){ String type = checkFileType(f); Debug.print("File type: " + type); if (type.equalsIgnoreCase("")){ Debug.print("Unrecognized file"); JOptionPane.showMessageDialog( null, "The file you've tried to open isn't a recognized format. \n" + "You can open: \n" + "Str...
} if (type.equals("beerxml")){
} else if (fileType.equals("beerxml")) {
public Recipe openFile(File f){ String type = checkFileType(f); Debug.print("File type: " + type); if (type.equalsIgnoreCase("")){ Debug.print("Unrecognized file"); JOptionPane.showMessageDialog( null, "The file you've tried to open isn't a recognized format. \n" + "You can open: \n" + "Str...
if(names!=null && cmds!=null && rfs!=null && lfs!=null) { int len = Math.min( Math.min(names.length,cmds.length), Math.min(rfs.length, lfs.length) );
if(names!=null && descriptions!=null && cmds!=null && rfs!=null && lfs!=null) { int len = Util.min(names.length,descriptions.length,cmds.length,rfs.length, lfs.length);
public synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException { if(!Hudson.adminCheck(req,rsp)) return; useSecurity = req.getParameter("use_security")!=null; numExecutors = Integer.parseInt(req.getParameter("numExecutors")); quietPeriod ...
slaves.add(new Slave(names[i],cmds[i],rfs[i],new File(lfs[i])));
slaves.add(new Slave(names[i],descriptions[i],cmds[i],rfs[i],new File(lfs[i])));
public synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException { if(!Hudson.adminCheck(req,rsp)) return; useSecurity = req.getParameter("use_security")!=null; numExecutors = Integer.parseInt(req.getParameter("numExecutors")); quietPeriod ...