rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
for(int i=numberOfParameters-1;i>0;) vars[i].setValue(stack.pop()); | for(int i=numberOfParameters;i>0;--i) vars[i-1].setValue(stack.pop()); | public void run(Stack stack) throws ParseException { if(numberOfParameters == 0) {} else if(numberOfParameters == 1) vars[0].setValue(stack.pop()); else if(numberOfParameters == 2) { vars[1].setValue(stack.pop()); vars[0].setValue(stack.pop()); } else { for(int i=numberOfParameters-1;i>0;) vars[i].s... |
return new PrintWriter(out); | return new PrintWriter(new OutputStreamWriter(out),true); | public PrintWriter error(String msg) { out.println(msg); return new PrintWriter(out); } |
if ((param1 instanceof Number) && (param2 instanceof Number)) { double x = ((Number)param1).doubleValue(); double y = ((Number)param2).doubleValue(); return (x==y); } | public boolean eq(Object param1, Object param2) throws ParseException { if ((param1 instanceof Complex) && (param2 instanceof Complex)) { return ((Complex)param1).equals((Complex)param2, tolerance); } if ((param1 instanceof Complex) && (param2 instanceof Double)) { return ((Complex)param1).equals(new Complex(... | |
if ((param1 instanceof Number) && (param2 instanceof Number)) { double x = ((Number)param1).doubleValue(); double y = ((Number)param2).doubleValue(); return (x!=y); } | public boolean ne(Object param1, Object param2) throws ParseException { if ((param1 instanceof Complex) && (param2 instanceof Complex)) { return !((Complex)param1).equals((Complex)param2, tolerance); } if ((param1 instanceof Complex) && (param2 instanceof Double)) { return !((Complex)param1).equals(new Comple... | |
for(int j=-1;j<=maxPrec;++j) | for(int jj=-1;jj<=maxPrec;++jj) | public void printOps() { println("Known operators"); Operator ops[] = j.getOperatorSet().getOperators(); int maxPrec = -1; for(int i=0;i<ops.length;++i) if(((XOperator) ops[i]).getPrecedence()>maxPrec) maxPrec=((XOperator) ops[i]).getPrecedence(); for(int j=-1;j<=maxPrec;++j) for(int i=0;i<ops.length;++i) ... |
if(((XOperator) ops[i]).getPrecedence()==j) | if(((XOperator) ops[i]).getPrecedence()==jj) | public void printOps() { println("Known operators"); Operator ops[] = j.getOperatorSet().getOperators(); int maxPrec = -1; for(int i=0;i<ops.length;++i) if(((XOperator) ops[i]).getPrecedence()>maxPrec) maxPrec=((XOperator) ops[i]).getPrecedence(); for(int j=-1;j<=maxPrec;++j) for(int i=0;i<ops.length;++i) ... |
timeRegistrar = new TimeConfigRegistrar(); ampRegistrar = new AmpConfigRegistrar(); | timeRegistrar = new TimeConfigRegistrar(new BoundedTimeConfig(timeRegistrar)); ampRegistrar = new AmpConfigRegistrar(new RMeanAmpConfig(ampRegistrar)); | public BasicSeismogramDisplay(LocalSeismogram seis, String name, VerticalSeismogramDisplay parent){ timeRegistrar = new TimeConfigRegistrar(); ampRegistrar = new AmpConfigRegistrar(); initializeDisplay(seis, name, parent); } |
parent.removeAll(me); | parent.removeAll(); | public void removeAll(MouseEvent me){ logger.debug("remove all called"); parent.removeAll(me); } |
public void remove(){ display.remove(); } | public void remove(){ if(display != null) display.remove(); } | public void remove(){ display.remove(); } |
if (param instanceof Number) { | if (param instanceof Complex) return new Double(((Complex)param).re()); else if (param instanceof Number) | public Number re(Object param) throws ParseException { if (param instanceof Number) { return ((Number)param); } else if (param instanceof Complex) { return new Double(((Complex)param).re()); } throw new ParseException("Invalid parameter type"); } |
} else if (param instanceof Complex) { return new Double(((Complex)param).re()); } | public Number re(Object param) throws ParseException { if (param instanceof Number) { return ((Number)param); } else if (param instanceof Complex) { return new Double(((Complex)param).re()); } throw new ParseException("Invalid parameter type"); } | |
validatePrincipal(user.getCredential(), errors); | public void validate(Object obj, Errors errors) { if (obj==null) { errors.reject("user.error.nullpointer", "Null user received"); } else { User user = (User) obj; validatePrincipal(user.getCredential(), errors); } } | |
j.dv.printDiffRules(); | j.getDifferentationVisitor().printDiffRules(); | private String getCommand() throws IOException { String s; if (br == null) return null; if ( (s = br.readLine()) == null) return null; if( s.equals("rules")) { j.dv.printDiffRules(); System.out.println("dJEPdx - Enter q to quit, rules to print the differentation rules,\ndiff(x^2,x) to differentiate,\nev... |
j.dv.addStandardDiffRules(); | j.addStandardDiffRules(); | public void initialise() { j = new DJep(); j.addStandardConstants(); j.addStandardFunctions(); j.addComplex(); j.setAllowUndeclared(true); j.setAllowAssignment(true); j.setImplicitMul(true); j.dv.addStandardDiffRules(); //j.setTraverse(true); } |
Node processed = j.commandv.process(node,j); | Node processed = j.preprocess(node); | public void processEquation(Node node) { try { System.out.print("fun:\t\t"); j.println(node); Node processed = j.commandv.process(node,j); System.out.print("Processed:\t"); j.println(processed); Node simp = j.simplify(processed); System.out.print("Simplified:\t"); j.println(simp); System.o... |
j.pv.setFullBrackets(true); | j.getPrintVisitor().setFullBrackets(true); | public void processEquation(Node node) { try { System.out.print("fun:\t\t"); j.println(node); Node processed = j.commandv.process(node,j); System.out.print("Processed:\t"); j.println(processed); Node simp = j.simplify(processed); System.out.print("Simplified:\t"); j.println(simp); System.o... |
j.pv.setFullBrackets(false); | j.getPrintVisitor().setFullBrackets(false); | public void processEquation(Node node) { try { System.out.print("fun:\t\t"); j.println(node); Node processed = j.commandv.process(node,j); System.out.print("Processed:\t"); j.println(processed); Node simp = j.simplify(processed); System.out.print("Simplified:\t"); j.println(simp); System.o... |
((DSymbolTable) j.getSymbolTable()).print(j.pv); | ((DSymbolTable) j.getSymbolTable()).print(j.getPrintVisitor()); | public void processEquation(Node node) { try { System.out.print("fun:\t\t"); j.println(node); Node processed = j.commandv.process(node,j); System.out.print("Processed:\t"); j.println(processed); Node simp = j.simplify(processed); System.out.print("Simplified:\t"); j.println(simp); System.o... |
updateTries ++; if ( updateTries > WINDOWS_PER_SECONDS * 2 ) { break; } | private void updateWindow( boolean blockTillAvailable ) { boolean wasInterrupted = false; long elapsedWindowMillis; long now; while ( true ) { now = System.currentTimeMillis(); elapsedWindowMillis = now - lastWindowTime; if (elapsedWindowMillis ... | |
if (param1 instanceof Number) | if (param1 instanceof Complex) | public Object div(Object param1, Object param2) throws ParseException { if (param1 instanceof Number) { if (param2 instanceof Number) return div((Number)param1, (Number)param2); else if (param2 instanceof Complex) return div((Number)param1, (Complex)param2); else if (param2 instanceof Vector) return ... |
if (param2 instanceof Number) | if (param2 instanceof Complex) return div((Complex)param1, (Complex)param2); else if (param2 instanceof Number) return div((Complex)param1, (Number)param2); else if (param2 instanceof Vector) return div((Complex)param1, (Vector)param2); } else if (param1 instanceof Number) { if (param2 instanceof Complex) return div((N... | public Object div(Object param1, Object param2) throws ParseException { if (param1 instanceof Number) { if (param2 instanceof Number) return div((Number)param1, (Number)param2); else if (param2 instanceof Complex) return div((Number)param1, (Complex)param2); else if (param2 instanceof Vector) return ... |
else if (param2 instanceof Complex) return div((Number)param1, (Complex)param2); | public Object div(Object param1, Object param2) throws ParseException { if (param1 instanceof Number) { if (param2 instanceof Number) return div((Number)param1, (Number)param2); else if (param2 instanceof Complex) return div((Number)param1, (Complex)param2); else if (param2 instanceof Vector) return ... | |
else if (param1 instanceof Complex) { if (param2 instanceof Number) return div((Complex)param1, (Number)param2); else if (param2 instanceof Complex) return div((Complex)param1, (Complex)param2); else if (param2 instanceof Vector) return div((Complex)param1, (Vector)param2); } | public Object div(Object param1, Object param2) throws ParseException { if (param1 instanceof Number) { if (param2 instanceof Number) return div((Number)param1, (Number)param2); else if (param2 instanceof Complex) return div((Number)param1, (Complex)param2); else if (param2 instanceof Vector) return ... | |
if (param2 instanceof Number) | if (param2 instanceof Complex) return div((Vector)param1, (Complex)param2); else if (param2 instanceof Number) | public Object div(Object param1, Object param2) throws ParseException { if (param1 instanceof Number) { if (param2 instanceof Number) return div((Number)param1, (Number)param2); else if (param2 instanceof Complex) return div((Number)param1, (Complex)param2); else if (param2 instanceof Vector) return ... |
else if (param2 instanceof Complex) return div((Vector)param1, (Complex)param2); | public Object div(Object param1, Object param2) throws ParseException { if (param1 instanceof Number) { if (param2 instanceof Number) return div((Number)param1, (Number)param2); else if (param2 instanceof Complex) return div((Number)param1, (Complex)param2); else if (param2 instanceof Vector) return ... | |
m.setCost(Double.parseDouble(value.toString())); | m.setCost(value.toString()); | public void setValueAt(Object value, int row, int col) { Fermentable m = (Fermentable) data.get(row); try { switch (col) { case 0 : m.setName(value.toString()); /* if (NewSwingApp.DEBUG){ System.out.println("value is:" + value); }*/ case 1 : m.setAmount(Double.parseDouble(value.toString(... |
for (int i = 1; i<=10; i++) { | for (int i = 1; i<=3; i++) { | private List<Entity> createEntities() { List<Entity> entities = new ArrayList<Entity>(); for (int i = 1; i<=10; i++) { Entity e = entityCreator.entityFactory(home, "ENTITY"+i); entities.add(e); } return entities; } |
for (int i = 1; i<=3; i++) { Identity c = userCreator.identityFactory("CRED"+i, "ALIAS"+i); | for (int i = 1; i<numberOfIdentities; i++) { Identity c = userCreator.identityFactory("IDENTITY"+i, "ALIAS"+i); userDao.persistIdentity(c); | private List<User> populateUsersAndLogs(List<Entity> entities) { List<Identity> identities = new ArrayList<Identity>(); for (int i = 1; i<=3; i++) { Identity c = userCreator.identityFactory("CRED"+i, "ALIAS"+i); identities.add(c); } List<User> users = new ArrayList<... |
Random r = new Random(); int repeat1 = r.nextInt(2); for (int i=0; i<=repeat1;i++) { User u = userCreator.userFactory(e, identities.get(i)); | for (Identity i: identities) { User u = userCreator.userFactory(e, i); i.getUsers().add(u); | private List<User> populateUsersAndLogs(List<Entity> entities) { List<Identity> identities = new ArrayList<Identity>(); for (int i = 1; i<=3; i++) { Identity c = userCreator.identityFactory("CRED"+i, "ALIAS"+i); identities.add(c); } List<User> users = new ArrayList<... |
int repeat2 = r.nextInt(8); for (int j=0; j<=repeat2;j++) { | for (int j=0; j<=3;j++) { | private List<User> populateUsersAndLogs(List<Entity> entities) { List<Identity> identities = new ArrayList<Identity>(); for (int i = 1; i<=3; i++) { Identity c = userCreator.identityFactory("CRED"+i, "ALIAS"+i); identities.add(c); } List<User> users = new ArrayList<... |
if (logger.isDebugEnabled()) { logger.debug("Repeat ("+i+", "+j+") UserLog to: "+u+" - "+date); } | logger.info("Repeat ("+i+", "+j+") UserLog to: "+u+" - "+date); | private List<User> populateUsersAndLogs(List<Entity> entities) { List<Identity> identities = new ArrayList<Identity>(); for (int i = 1; i<=3; i++) { Identity c = userCreator.identityFactory("CRED"+i, "ALIAS"+i); identities.add(c); } List<User> users = new ArrayList<... |
digester.addSetProperties("info/entry","revision","revision"); | digester.addSetProperties("info/entry/commit","revision","revision"); | 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(); ... |
List<Home> homeList = hibernateTemplate.find("from Home"); | List<Home> homeList = (ArrayList<Home>) hibernateTemplate.find("from Home"); | public void testPersistDefaultEntitySuccess() { simpleCoreMgr.persistDefaultEntity(defaultEntity); hibernateTemplate.flush(); List<Home> homeList = hibernateTemplate.find("from Home"); assertEquals(1, homeList.size()); Home h = homeList.get(0); assertEquals ... |
List<Entity> entityList = hibernateTemplate.find("from Entity"); | List<Entity> entityList = (ArrayList<Entity>) hibernateTemplate.find("from Entity"); | public void testPersistDefaultEntitySuccess() { simpleCoreMgr.persistDefaultEntity(defaultEntity); hibernateTemplate.flush(); List<Home> homeList = hibernateTemplate.find("from Home"); assertEquals(1, homeList.size()); Home h = homeList.get(0); assertEquals ... |
int columnCount = tcm.getColumnCount(); | int colCount = tcm.getColumnCount(); | private void addColumnWidthListeners() { TableColumnModel mtcm = maltTable.getColumnModel(); TableColumnModel htcm = hopsTable.getColumnModel(); //: listener that watches the width of a column PropertyChangeListener mpcl = new PropertyChangeListener() { private int columnCount = maltTable.getColumnCount(); pri... |
for (int i = 0; i < columnCount; i++) { | for (int i = 0; i < colCount; i++) { | private void addColumnWidthListeners() { TableColumnModel mtcm = maltTable.getColumnModel(); TableColumnModel htcm = hopsTable.getColumnModel(); //: listener that watches the width of a column PropertyChangeListener mpcl = new PropertyChangeListener() { private int columnCount = maltTable.getColumnCount(); pri... |
int columnCount = tcm.getColumnCount(); | int colCount = tcm.getColumnCount(); | public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals("preferredWidth")) { TableColumnModel tcm = hopsTable.getColumnModel(); TableColumnModel tcmt = tblHopsTotals.getColumnModel(); int columnCount = tcm.getColumnCount(); // for each column, get its width for (... |
for (int i = 0; i < columnCount; i++) { | for (int i = 0; i < colCount; i++) { | public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals("preferredWidth")) { TableColumnModel tcm = hopsTable.getColumnModel(); TableColumnModel tcmt = tblHopsTotals.getColumnModel(); int columnCount = tcm.getColumnCount(); // for each column, get its width for (... |
stylePanel.setStyleData(); | public void displayRecipe() { if (myRecipe == null) return; txtName.setText(myRecipe.getName()); brewerNameText.setText(myRecipe.getBrewer()); txtPreBoil.setValue(new Double(myRecipe.getPreBoilVol(myRecipe.getVolUnits()))); lblSizeUnits.setText(myRecipe.getVolUnits()); postBoilText.setValue(new Double(myRecipe... | |
sb.append(SBStringUtils.xmlElement("VOLUME", getMashTotalVol(), 4)); | sb.append(SBStringUtils.xmlElement("MASH_VOLUME", getMashTotalVol(), 4)); sb.append(SBStringUtils.xmlElement("MASH_RATIO", "" + mashRatio, 4)); sb.append(SBStringUtils.xmlElement("MASH_TIME", "" + totalTime, 4)); sb.append(SBStringUtils.xmlElement("MASH_TMP_U", "" + mashTempU, 4)); if (tempUnits.equals("C")) sb.append(... | public String toXml() { StringBuffer sb = new StringBuffer(); sb.append(" <MASH>\n"); sb.append(SBStringUtils.xmlElement("VOLUME", getMashTotalVol(), 4)); for (int i = 0; i < steps.size(); i++) { MashStep st = (MashStep) steps.get(i); sb.append(" <ITEM>\n"); sb.append(" <TYPE>" + st.type + "</TYPE... |
"deploy/partner.xml"}; | "deploy/core.xml"}; | protected String[] getConfigLocations() { return new String[] { "deploy/dataSource.xml", "deploy/sessionFactory.xml", "deploy/support.xml", "deploy/transaction.xml", "deploy/partner.xml"}; } |
return super.mul(param1,param2); | else return super.mul(param1,param2); | public Object dot(Object param1, Object param2) throws ParseException { if(param1 instanceof MVector && param2 instanceof MVector) return dot((MVector) param1,(MVector) param2); return super.mul(param1,param2); } |
errorList.clear(); | errorList.removeAllElements(); | public void parseExpression(String expression_in) { Reader reader = new StringReader(expression_in); try { // try parsing errorList.clear(); topNode = parser.parseStream(reader, this); } catch (Throwable e) { // an exception was thrown, so there is no parse tree topNode = null; // check the type of... |
errorList.add(((ParseException)e).getErrorInfo()); | errorList.addElement(((ParseException)e).getErrorInfo()); | public void parseExpression(String expression_in) { Reader reader = new StringReader(expression_in); try { // try parsing errorList.clear(); topNode = parser.parseStream(reader, this); } catch (Throwable e) { // an exception was thrown, so there is no parse tree topNode = null; // check the type of... |
errorList.add("Syntax error"); | errorList.addElement("Syntax error"); | public void parseExpression(String expression_in) { Reader reader = new StringReader(expression_in); try { // try parsing errorList.clear(); topNode = parser.parseStream(reader, this); } catch (Throwable e) { // an exception was thrown, so there is no parse tree topNode = null; // check the type of... |
public int getValue() { | public char getValue() { | public int getValue() { return value; } |
UserGroup userGroup = userList.get((int) Math.random()*e*d); | IdentityFilter identityFilter = new IdentityFilter(); | public void testFindIdentities() { // write list int e = 2; int d = 3; List<UserGroup> userList = AuthorizationTestSupport.createAndPersistUserGroupList(hibernateTemplate, e, d); assertEquals(e*d, userList.size()); UserGroup parent = AuthorizationTestSupport.createUserGroup... |
List<Identity> identityList = authenticationDao.findIdentityByCriteria(identityFilter); assertEquals(e*d, identityList.size()); int index = (int) (Math.random()*e*d); System.out.println("INDEX "+index); Identity identity = identityList.get(index); UserGroup loaded = identity .getUsers() .iterator() .next() .getParents(... | public void testFindIdentities() { // write list int e = 2; int d = 3; List<UserGroup> userList = AuthorizationTestSupport.createAndPersistUserGroupList(hibernateTemplate, e, d); assertEquals(e*d, userList.size()); UserGroup parent = AuthorizationTestSupport.createUserGroup... | |
else { Operator op = jep.getOperatorSet().getCross(); BinaryOperatorI bin = (BinaryOperatorI) op.getPFMC(); Dimensions dim = bin.calcDim(lhsDim,rhsDim); return (ASTMFunNode) nf.buildOperatorNode(op,children,dim); } | Operator op = jep.getOperatorSet().getCross(); BinaryOperatorI bin = (BinaryOperatorI) op.getPFMC(); Dimensions dim = bin.calcDim(lhsDim,rhsDim); return (ASTMFunNode) nf.buildOperatorNode(op,children,dim); | public MatrixNodeI preprocess( ASTFunNode node, MatrixPreprocessor visitor, MatrixJep jep, MatrixNodeFactory nf) throws ParseException { MatrixNodeI children[] = visitor.visitChildrenAsArray(node,null); if(node.jjtGetNumChildren()!=2) throw new ParseException("Operator "+node.getOperator().getName()+" must have... |
if (param instanceof Number) { | if (param instanceof Complex) return new Double(((Complex)param).im()); else if (param instanceof Number) | public Number im(Object param) throws ParseException { if (param instanceof Number) { return new Double(0); } else if (param instanceof Complex) { return new Double(((Complex)param).im()); } throw new ParseException("Invalid parameter type"); } |
} else if (param instanceof Complex) { return new Double(((Complex)param).im()); } | public Number im(Object param) throws ParseException { if (param instanceof Number) { return new Double(0); } else if (param instanceof Complex) { return new Double(((Complex)param).im()); } throw new ParseException("Invalid parameter type"); } | |
public boolean accept(File dir, String name) { return name.endsWith(".hudson-plugin"); } }); | public boolean accept(File dir, String name) { return name.endsWith(".hpi") || name.endsWith(".hpl"); } }); | public PluginManager(ServletContext context) { this.context = context; rootDir = new File(Hudson.getInstance().getRootDir(),"plugins"); if(!rootDir.exists()) rootDir.mkdirs(); File[] archives = rootDir.listFiles(new FilenameFilter() { public boolean accept(F... |
return name.endsWith(".hudson-plugin"); } | return name.endsWith(".hpi") || name.endsWith(".hpl"); } | public boolean accept(File dir, String name) { return name.endsWith(".hudson-plugin"); } |
}else{ setUnitRange(event.getAmp()); } | }else setUnitRange(event.getAmp()); | public void updateAmp(AmpEvent event){ if(event instanceof LazyAmpEvent){ ((LazyAmpEvent)event).addCalculateListener(this); }else{ setUnitRange(event.getAmp()); } } |
bandwidthController.getAvailableByteCount( true ); | bandwidthController.getAvailableByteCount( 1, true, true ); | public void write(int b) throws IOException { // this call will always return at least 1 directly or after blocking. bandwidthController.getAvailableByteCount( true ); outStream.write(b); bandwidthController.markBytesUsed( 1 ); } |
bandwidthController.markBytesUsed( 1 ); | public void write(int b) throws IOException { // this call will always return at least 1 directly or after blocking. bandwidthController.getAvailableByteCount( true ); outStream.write(b); bandwidthController.markBytesUsed( 1 ); } | |
getParent().jobs.remove(name); | getParent().deleteJob(this); | public synchronized void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException { Util.deleteRecursive(root); getParent().jobs.remove(name); rsp.sendRedirect(req.getContextPath()); } |
scalRecipeMenuItem.setText("Scale Recipe..."); | scalRecipeMenuItem.setText("Resize / Convert Recipe..."); | private void initGUI() { try { // restore the saved size and location: this.setSize(preferences.getIProperty("winWidth"), preferences.getIProperty("winHeight")); this.setLocation(preferences.getIProperty("winX"), preferences.getIProperty("winY")); imgURL = getClass().getClassLoader().getResource("ca... |
QueryResponseRecord rec; | public void processResponse( QueryResponseMsg msg ) { long speed = msg.getRemoteHostSpeed(); GUID rcID = msg.getRemoteClientID(); DestAddress address = msg.getDestAddress(); QueryHitHost qhHost = new QueryHitHost( rcID, address, speed ); qhHost.setQHDFlags( msg.getPushNeededFla... | |
int recordCount = msg.getRecordCount(); ArrayList newHitList = new ArrayList( recordCount ); for (int i = 0; i < recordCount; i++) | QueryResponseRecord[] records = msg.getMsgRecords(); ArrayList<RemoteFile> newHitList = new ArrayList<RemoteFile>( records.length ); for (int i = 0; i < records.length; i++) | public void processResponse( QueryResponseMsg msg ) { long speed = msg.getRemoteHostSpeed(); GUID rcID = msg.getRemoteClientID(); DestAddress address = msg.getDestAddress(); QueryHitHost qhHost = new QueryHitHost( rcID, address, speed ); qhHost.setQHDFlags( msg.getPushNeededFla... |
rec = msg.getMsgRecord(i); | public void processResponse( QueryResponseMsg msg ) { long speed = msg.getRemoteHostSpeed(); GUID rcID = msg.getRemoteClientID(); DestAddress address = msg.getDestAddress(); QueryHitHost qhHost = new QueryHitHost( rcID, address, speed ); qhHost.setQHDFlags( msg.getPushNeededFla... | |
long fileSize = rec.getFileSize(); String filename = rec.getFilename(); URN urn = rec.getURN(); int fileIndex = rec.getFileIndex(); String metaData = rec.getMetaData(); String pathInfo = rec.getPathInfo(); | long fileSize = records[i].getFileSize(); String filename = records[i].getFilename(); URN urn = records[i].getURN(); int fileIndex = records[i].getFileIndex(); String metaData = records[i].getMetaData(); String pathInfo = records[i].getPathInfo(); | public void processResponse( QueryResponseMsg msg ) { long speed = msg.getRemoteHostSpeed(); GUID rcID = msg.getRemoteClientID(); DestAddress address = msg.getDestAddress(); QueryHitHost qhHost = new QueryHitHost( rcID, address, speed ); qhHost.setQHDFlags( msg.getPushNeededFla... |
candidates[i].manualConnectionRetry(); | if ( candidates[i] != null ) { candidates[i].manualConnectionRetry(); } | public void actionPerformed( ActionEvent e ) { SWDownloadCandidate[] candidates = getSelectedDownloadCandidates(); for ( int i = 0; i < candidates.length; i++ ) { candidates[i].manualConnectionRetry(); } } |
MatrixValueI lhs,MatrixValueI rhs) throws ParseException | MatrixValueI param1,MatrixValueI param2) throws ParseException | public MatrixValueI calcValue(MatrixValueI res, MatrixValueI lhs,MatrixValueI rhs) throws ParseException { Number num = (Number) rhs.getEle(0); res.setEle(0,lhs.getEle(num.intValue()+1)); return res; } |
Number num = (Number) rhs.getEle(0); res.setEle(0,lhs.getEle(num.intValue()+1)); | if(param1 instanceof MVector) { if(param2 instanceof Scaler) { int index = ((Double) param2.getEle(0)).intValue()-1; Object val = ((MVector) param1).getEle(index); res.setEle(0,val); } else throw new ParseException("Bad second argument to ele, expecting a double "+param2.toString()); } else if(param1 instanceof Matrix)... | public MatrixValueI calcValue(MatrixValueI res, MatrixValueI lhs,MatrixValueI rhs) throws ParseException { Number num = (Number) rhs.getEle(0); res.setEle(0,lhs.getEle(num.intValue()+1)); return res; } |
return data.getMaltSteep(row); | return new Boolean(data.getMaltSteep(row)); | public Object getValueAt(int row, int col) { // Fermentable m = (Fermentable) data.get(row); try { switch (col) { case 0: // steep return data.getMaltSteep(row); case 1: // mash return data.getMaltMashed(row); case 2 : // indicate this is a sugar: String s = ""; if (!data.getMaltMashed... |
return data.getMaltMashed(row); case 2 : String s = ""; if (!data.getMaltMashed(row) && data.getMaltSteep(row)) s = "*"; return s + data.getMaltName(row); | return new Boolean (data.getMaltMashed(row)); case 2 : return data.getMaltName(row); | public Object getValueAt(int row, int col) { // Fermentable m = (Fermentable) data.get(row); try { switch (col) { case 0: // steep return data.getMaltSteep(row); case 1: // mash return data.getMaltMashed(row); case 2 : // indicate this is a sugar: String s = ""; if (!data.getMaltMashed... |
Complex temp = new Complex(((Number)param).doubleValue(),0.0); return temp.asinh(); | double val = ((Number)param).doubleValue(); double res = Math.log(val+Math.sqrt(val*val+1)); return new Double(res); | public Object asinh(Object param) throws ParseException { if (param instanceof Complex) { return ((Complex)param).asinh(); } else if (param instanceof Number) { Complex temp = new Complex(((Number)param).doubleValue(),0.0); return temp.asinh(); } throw new ParseException("Invalid parameter type"); } |
else { super.mouseReleased(e); } | public void mouseReleased(MouseEvent e) { if (SwingUtilities.isLeftMouseButton(e) ) { AbstractButton b = (AbstractButton) e.getSource(); if ( b.isSelected() ) { int w = closeIcon.getIco... | |
if (myFile != "/") { | if (myFile != null) { | public void execute() { if (myContents.getQuitItem().isSelected()) { myContents.quit(); } if (myContents.getOpenItem().isSelected()) { String myFile = myContents.getOpenFilename(); if (myFile != "/") { ImportXml imp = new ImportXml(myFile); Recipe recipe = imp.handler.getRecip... |
req.setCharacterEncoding("UTF-8"); | protected final void serveFile(StaplerRequest req, StaplerResponse rsp, File root, String icon, boolean serveDirIndex) throws IOException, ServletException { if(req.getQueryString()!=null) { String path = req.getParameter("path"); if(path!=null) { rsp.sendRedirect(URLEnco... | |
cases.add(new CaseResult(e)); | cases.add(new CaseResult(this,e)); | SuiteResult(File xmlReport) throws DocumentException { Document result = new SAXReader().read(xmlReport); Element root = result.getRootElement(); name = root.attributeValue("name"); stdout = root.elementText("system-out"); stderr = root.elementText("system-err"); for (Eleme... |
String v = req.getParameter("mailer_smtpServer"); | String v = req.getParameter("mailer_smtp_server"); | public boolean configure(HttpServletRequest req) { String v = req.getParameter("mailer_smtpServer"); if(v!=null && v.length()==0) v=null; getProperties().put("mail.smtp.host",v); getProperties().put("mail.admin.address",req.getParameter("mailer_admin_address")); ... |
valueToStringTest("i*j","-1.0k"); | valueToStringTest("i*j","-k"); | public void testQuartonians() throws Exception { j = new GroupJep(new Quartonians()); j.addStandardConstants(); System.out.println(j.getGroup().toString()); valueToStringTest("i*j","-1.0k"); } |
this.add(jPanel1, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); | this.add(jPanel1, new GridBagConstraints(3, 1, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.setPreferredSize(new java.awt.Dimension(158, 230)); | private void initGUI() { try { GridBagLayout thisLayout = new GridBagLayout(); thisLayout.columnWeights = new double[]{0.3, 0.3}; thisLayout.columnWidths = new int[]{7, 7}; thisLayout.rowWeights = new double[]{0.1, 0.8, 0.1}; thisLayout.rowHeights = new int[]{7, 7, 7}; this.setLayout(thisLayout); { t... |
String aString = new String(stringArray); | String aString = new String(PSNDataFile.chopToLength(stringArray)); | public PSNVariableHeader(DataInputStream data, int length) throws IOException{ dis = data; for (int i = 0; i < length; i++) { //Sanity Check: this should be equal to 0x55 byte check = dis.readByte(); //System.out.println("Check: " + check); if (check != 0x55... |
for( int i=builders.size()-1; i>=0; i-- ) { BuildStep b = builders.get(i); | for (BuildStep b : builders) { | public synchronized Map<BuildStepDescriptor,BuildStep> getBuilders() { Map<BuildStepDescriptor,BuildStep> m = new LinkedHashMap<BuildStepDescriptor,BuildStep>(); for( int i=builders.size()-1; i>=0; i-- ) { BuildStep b = builders.get(i); m.put(b.getDescriptor(),b); } ... |
for( int i=publishers.size()-1; i>=0; i-- ) { BuildStep b = publishers.get(i); | for (BuildStep b : publishers) { | public synchronized Map<BuildStepDescriptor,BuildStep> getPublishers() { Map<BuildStepDescriptor,BuildStep> m = new LinkedHashMap<BuildStepDescriptor,BuildStep>(); for( int i=publishers.size()-1; i>=0; i-- ) { BuildStep b = publishers.get(i); m.put(b.getDescriptor(),b); } ... |
else if (type.equals("ini")) path = appRoot + slash; | public static String getAppPath(String type){ String appRoot = ""; String path = ""; String slash = System.getProperty("file.separator"); try { appRoot = new File(".").getCanonicalPath(); } catch (Exception e){ e.printStackTrace(); } if (type.equals("data")) path = appRoot + slash + "src" + slash + "ca" ... | |
public Slave(String name, String command, String remoteFS, File localFS) { | public Slave(String name, String description, String command, String remoteFS, File localFS) { | public Slave(String name, String command, String remoteFS, File localFS) { this.name = name; this.command = command; this.remoteFS = remoteFS; this.localFS = localFS; } |
this.description = description; | public Slave(String name, String command, String remoteFS, File localFS) { this.name = name; this.command = command; this.remoteFS = remoteFS; this.localFS = localFS; } | |
r.addAll(Arrays.asList(env)); | for (String s : env) { int index =s.indexOf('='); r.add(s.substring(0,index)); r.add(s.substring(index+1)); } | public Launcher createLauncher(BuildListener listener) { return new Launcher(listener) { @Override public Proc launch(String[] cmd, String[] env, OutputStream out, FilePath workDir) throws IOException { return super.launch(prepend(cmd,env,workDir), env, null, out); ... |
r.addAll(Arrays.asList(env)); | for (String s : env) { int index =s.indexOf('='); r.add(s.substring(0,index)); r.add(s.substring(index+1)); } | private String[] prepend(String[] cmd, String[] env, FilePath workDir) { List<String> r = new ArrayList<String>(); r.addAll(Arrays.asList(getCommandTokens())); r.add("~/bin/slave"); r.add(workDir.getRemote()); r.addAll(Arrays.asList(... |
searchStatusLbl = new JLabel(); searchBoxBuilder.add( searchStatusLbl, cc.xy( 4, 2 ) ); | public SearchInfoBox( SearchControlPanel cp ) { super( Localizer.getString( "SearchTab_Information" ) ); controlPanel = cp; CellConstraints cc = new CellConstraints(); FormLayout boxLayout = new FormLayout( "6dlu, d, 2dlu, fill:p:grow, 6dlu", // columns "... | |
progressBar.setValue( displayedDataModel.getSearch().getProgress() ); | progressBar.setValue( search.getProgress() ); | private void updateDisplay() { if ( displayedDataModel != null ) { int total = displayedDataModel.getAllSearchResultCount(); int filtered = displayedDataModel.getFilteredElementCount(); progressBar.setValue( displayedDataModel.getSearch().getProgress() ); ... |
searchStatusLbl.setText(""); | private void updateDisplay() { if ( displayedDataModel != null ) { int total = displayedDataModel.getAllSearchResultCount(); int filtered = displayedDataModel.getFilteredElementCount(); progressBar.setValue( displayedDataModel.getSearch().getProgress() ); ... | |
v.jobNames.remove(oldName); v.jobNames.add(newName); | if(v.jobNames.remove(oldName)) v.jobNames.add(newName); | /*package*/ void onRenamed(Job job, String oldName, String newName) throws IOException { jobs.remove(oldName); jobs.put(newName,job); if(views!=null) { for (View v : views) { synchronized(v) { v.jobNames.remove(oldName); v.jobNames... |
debug = false; | public EvaluatorVisitor() { debug = false; errorList = null; symTab = null; stack = new Stack(); } | |
public Object getValue(Node topNode, Vector errorList_in, | public synchronized Object getValue(Node topNode, Vector errorList_in, | public Object getValue(Node topNode, Vector errorList_in, SymbolTable symTab_in) throws Exception { // check if arguments are ok if (topNode == null) { throw new IllegalArgumentException( "topNode parameter is null"); } if (symTab_in == null) { throw new IllegalArgumentException( "sym... |
f.setMashed(s.trim().equalsIgnoreCase("true")); | f.setMashed(s.trim().equalsIgnoreCase("true")); } else if (currentList.equalsIgnoreCase("mash")){ if (currentElement.equalsIgnoreCase("type")) myRecipe.mash.setStepMethod(myRecipe.mash.getStepSize()-1, s.trim()); if (currentElement.equalsIgnoreCase("STEP_TIME")) myRecipe.mash.setStepMin(myRecipe.mash.getStepSize()-1, n... | public void characters(char buf[], int offset, int len) throws SAXException { String s = new String(buf, offset, len); // we're inside a style: if (!s.trim().equals("")) { if (currentElement.equalsIgnoreCase("notes")) descrBuf += s; if (currentList.equalsIgnoreCase("hops")){ if (currentElement.equalsI... |
if (currentList.equalsIgnoreCase("miscs")) m.setDescription(descrBuf); if (currentList.equalsIgnoreCase("yeast")) myRecipe.getYeastObj().setDescription(descrBuf); | public void endElement(String namespaceURI, String sName, // simple name String qName // qualified name ) throws SAXException { if (qName.equalsIgnoreCase("recipe")){ newRecipe = false; numRecipes ++; recipes.add(myRecipe); } if (qName.equalsIgnoreCase("hops") || qName.equalsIgnoreCase("fermentables")... | |
} | } if (eName.equalsIgnoreCase("MISC")){ m = new Misc(); } if (qName.equalsIgnoreCase("MASH_STEP")){ myRecipe.mash.addStep(); } | 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... |
return "save.png"; | return "save.gif"; | public String getIconFileName() { return "save.png"; } |
expect(hibernateTemplate.load(ExternalDocument.class, 5)).andReturn(loaded); | expect(hibernateTemplate.load(ExternalDocument.class, new Long(5))).andReturn(loaded); | public void testExternalDocument() { ExternalDocument loaded = new ExternalDocument(); loaded.setDocCode("TEST"); expect(hibernateTemplate.load(ExternalDocument.class, 5)).andReturn(loaded); replay(hibernateTemplate); ExternalDocumentForm externalDocumentFo... |
stations.clear(); | public void initFrame(){ // setSize(new java.awt.Dimension (mywidth, myheight)); //setPreferredSize(new java.awt.Dimension (mywidth, myheight)); setLayout(new GridBagLayout()); gbc = new GridBagConstraints(); gbc.fill = gbc.BOTH; gbc.weightx = 1.0; gbc.weighty = 0.0; gbc.gridx = 0; gbc.gridy = 0; JLabel netLabel... | |
logger.debug("There are "+stations.getSize()+" items in the station list model"); | public void initFrame(){ // setSize(new java.awt.Dimension (mywidth, myheight)); //setPreferredSize(new java.awt.Dimension (mywidth, myheight)); setLayout(new GridBagLayout()); gbc = new GridBagConstraints(); gbc.fill = gbc.BOTH; gbc.weightx = 1.0; gbc.weighty = 0.0; gbc.gridx = 0; gbc.gridy = 0; JLabel netLabel... | |
stations.clear(); | public void valueChanged(ListSelectionEvent e) { if(e.getValueIsAdjusting()){ return; } final NetworkAccess[] nets = getSelectedNetworks(); stations.clear(); Thread stationLoader = new Thread() { public void run() { try { for (int i=0; i<nets.length; i++) { Station[] new... | |
logger.debug("There are "+stations.getSize()+" items in the station list model"); | public void valueChanged(ListSelectionEvent e) { if(e.getValueIsAdjusting()){ return; } final NetworkAccess[] nets = getSelectedNetworks(); stations.clear(); Thread stationLoader = new Thread() { public void run() { try { for (int i=0; i<nets.length; i++) { Station[] new... | |
logger.debug("There are "+stations.getSize()+" items in the station list model"); | public void run() { try { for (int i=0; i<nets.length; i++) { Station[] newStations = nets[i].retrieve_stations(); logger.debug("got "+newStations.length+" stations"); for (int j=0; j<newStations.length; j++) { stations.addElement(newStations[j]); } logger.debug("finished ad... | |
myParent = parent; | public MenuController(MenuView aView, MainController parent) { super(aView); myContents = aView; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.