rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
case 1 : | case 3 : | public void setValueAt(Object value, int row, int col) { // Fermentable m = (Fermentable) data.get(row); try { switch (col) { case 0 : data.setMaltName(row, value.toString()); break; case 1 : data.setMaltAmount(row, Double.parseDouble(value.toString())); break; case 2 : // m.setUn... |
case 2 : | case 4 : | public void setValueAt(Object value, int row, int col) { // Fermentable m = (Fermentable) data.get(row); try { switch (col) { case 0 : data.setMaltName(row, value.toString()); break; case 1 : data.setMaltAmount(row, Double.parseDouble(value.toString())); break; case 2 : // m.setUn... |
case 3 : | case 5 : | public void setValueAt(Object value, int row, int col) { // Fermentable m = (Fermentable) data.get(row); try { switch (col) { case 0 : data.setMaltName(row, value.toString()); break; case 1 : data.setMaltAmount(row, Double.parseDouble(value.toString())); break; case 2 : // m.setUn... |
case 4 : | case 6 : | public void setValueAt(Object value, int row, int col) { // Fermentable m = (Fermentable) data.get(row); try { switch (col) { case 0 : data.setMaltName(row, value.toString()); break; case 1 : data.setMaltAmount(row, Double.parseDouble(value.toString())); break; case 2 : // m.setUn... |
case 5 : | case 7 : | public void setValueAt(Object value, int row, int col) { // Fermentable m = (Fermentable) data.get(row); try { switch (col) { case 0 : data.setMaltName(row, value.toString()); break; case 1 : data.setMaltAmount(row, Double.parseDouble(value.toString())); break; case 2 : // m.setUn... |
case 6 : | case 8 : | public void setValueAt(Object value, int row, int col) { // Fermentable m = (Fermentable) data.get(row); try { switch (col) { case 0 : data.setMaltName(row, value.toString()); break; case 1 : data.setMaltAmount(row, Double.parseDouble(value.toString())); break; case 2 : // m.setUn... |
public void addStep(String t, double st, double et, String tu, String m, int min, | public void addStep(String type, double st, double et, String tu, String m, int min, | public void addStep(String t, double st, double et, String tu, String m, int min, int rmin) { MashStep step = new MashStep(t, st, et, tu, m, min, rmin); steps.add(step); calcMashSchedule(); } |
MashStep step = new MashStep(t, st, et, tu, m, min, rmin); | MashStep step = new MashStep(type, st, et, tu, m, min, rmin); | public void addStep(String t, double st, double et, String tu, String m, int min, int rmin) { MashStep step = new MashStep(t, st, et, tu, m, min, rmin); steps.add(step); calcMashSchedule(); } |
private static void deleteFile(File child) throws IOException { if (!child.delete()) { if(!child.exists()) | private static void deleteFile(File f) throws IOException { if (!f.delete()) { if(!f.exists()) | private static void deleteFile(File child) throws IOException { if (!child.delete()) { if(!child.exists()) // we are trying to delete a file that no longer exists, so this is not an error return; throw new IOException("Unable to delete " + child.getPath());... |
throw new IOException("Unable to delete " + child.getPath()); | try { Chmod chmod = new Chmod(); chmod.setProject(new org.apache.tools.ant.Project()); chmod.setFile(f); chmod.setPerm("u+w"); chmod.execute(); } catch (BuildException e) { LOGGER.log(Level.INFO,"Failed to chmod "+f,e); } throw new IOException("Unable to delete " + f.getPath()); | private static void deleteFile(File child) throws IOException { if (!child.delete()) { if(!child.exists()) // we are trying to delete a file that no longer exists, so this is not an error return; throw new IOException("Unable to delete " + child.getPath());... |
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("Operators:"); Operator.printOperators();// System.out.println("dJEPdx - Enter q to quit, rules to... |
j.getVarTab().print(j.pv); | j.getVarTab().print(j.getPrintVisitor()); | 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("Operators:"); Operator.printOperators();// System.out.println("dJEPdx - Enter q to quit, rules to... |
j.dv.addStandardDiffRules(); | j.addStandardDiffRules(); | void initialise() { j = new MatrixJep(); j.addStandardConstants(); j.addStandardFunctions(); j.addComplex(); j.setAllowUndeclared(true); j.setImplicitMul(true); j.setAllowAssignment(true); j.dv.addStandardDiffRules(); // dv.addDiffRule(new MProductDiffRule(dv,MatrixOperatorSet.M_HAT)); } |
j.pv.println(node); | j.println(node); | void processEquation(Node node) { if(node==null) return; try { System.out.print("fun:\t\t"); j.pv.println(node); MatrixNodeI matEqn = j.dec.preprocess(node,j); j.println(matEqn); Object res = j.evaluate(matEqn); System.out.println("Res: "+res); System.out.println("Variables"); j.getVarTab().print(j... |
j.getVarTab().print(j.pv); | j.getVarTab().print(j.getPrintVisitor()); | void processEquation(Node node) { if(node==null) return; try { System.out.print("fun:\t\t"); j.pv.println(node); MatrixNodeI matEqn = j.dec.preprocess(node,j); j.println(matEqn); Object res = j.evaluate(matEqn); System.out.println("Res: "+res); System.out.println("Variables"); j.getVarTab().print(j... |
public DifferentationVisitor getDifferentationVisitor() { return dv; } | public DifferentiationVisitor getDifferentationVisitor() { return dv; } | public DifferentationVisitor getDifferentationVisitor() { return dv; } |
checkAndRecord(that, r, that.getBuilds()); | public SortedMap<Integer,RangeSet> getRelationship(Project that) { TreeMap<Integer,RangeSet> r = new TreeMap<Integer,RangeSet>(REVERSE_INTEGER_COMPARATOR); checkAndRecord(that, r, this.getBuilds()); checkAndRecord(that, r, that.getBuilds()); return r; } | |
else if (o == rbPercent){ evapAmountLbl.setText("%"); } else if (o == rbConstant){ evapAmountLbl.setText(Quantity.getVolAbrv(volUnitsComboModel.getSelectedItem().toString()) + "/hr"); } | public void actionPerformed(ActionEvent e) { Object o = e.getSource(); if (o == okButton) { saveOptions(); opts.saveProperties(); ((StrangeSwing)sb).displayRecipe(); setVisible(false); dispose(); } else if (o == cancelButton){ setVisible(false); dispose(); } else if (o == colMethod1rb || o == co... | |
rbPercent.addActionListener(this); rbConstant.addActionListener(this); | private JPanel getPnlEvaporation() { if (pnlEvaporation == null) { pnlEvaporation = new JPanel(); BoxLayout pnlEvaporationLayout = new BoxLayout(pnlEvaporation, javax.swing.BoxLayout.Y_AXIS); pnlEvaporation.setLayout(pnlEvaporationLayout); pnlEvaporation.setBorder(BorderFactory.createTitledBorder("Evapora... | |
txtBottleSize.setPreferredSize(new java.awt.Dimension(61, 20)); | private JTextField getTxtBottleSize() { if (txtBottleSize == null) { txtBottleSize = new JTextField(); txtBottleSize.setText("351"); } return txtBottleSize; } | |
jPanel2.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets( 0, 0, 0, 0), 0, 0)); | jPanel2.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); | private void layoutUi() { JPanel buttons = new JPanel(); okButton = new JButton("OK"); okButton.addActionListener(this); cancelButton = new JButton("Cancel"); cancelButton.addActionListener(this); buttons.setLayout(new FlowLayout(FlowLayout.RIGHT)); buttons.add(cancelButton); buttons.add(okButton); getContent... |
jPanel2.add(txtOtherCost, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets( 0, 0, 0, 0), 0, 0)); | jPanel2.add(txtOtherCost, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); | private void layoutUi() { JPanel buttons = new JPanel(); okButton = new JButton("OK"); okButton.addActionListener(this); cancelButton = new JButton("Cancel"); cancelButton.addActionListener(this); buttons.setLayout(new FlowLayout(FlowLayout.RIGHT)); buttons.add(cancelButton); buttons.add(okButton); getContent... |
jPanel2.add(jLabel2, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets( 0, 0, 0, 0), 0, 0)); | jPanel2.add(jLabel2, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); | private void layoutUi() { JPanel buttons = new JPanel(); okButton = new JButton("OK"); okButton.addActionListener(this); cancelButton = new JButton("Cancel"); cancelButton.addActionListener(this); buttons.setLayout(new FlowLayout(FlowLayout.RIGHT)); buttons.add(cancelButton); buttons.add(okButton); getContent... |
jPanel2.add(cmbBottleSize, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel2.add(getTxtBottleSize(), new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); | jPanel2.add(cmbBottleSize, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); cmbBottleSize.setPreferredSize(new java.awt.Dimension(89, 20)); jPanel2.add(getTxtBottleSize(), new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, ... | private void layoutUi() { JPanel buttons = new JPanel(); okButton = new JButton("OK"); okButton.addActionListener(this); cancelButton = new JButton("Cancel"); cancelButton.addActionListener(this); buttons.setLayout(new FlowLayout(FlowLayout.RIGHT)); buttons.add(cancelButton); buttons.add(okButton); getContent... |
opts.setProperty("optEvaporation", evapAmountTxt.getText()); | private void saveOptions() { // cost tab: opts.setProperty("optMiscCost", txtOtherCost.getText()); opts.setProperty("optBottleSize", txtBottleSize.getText()); opts.setProperty("optBottleU", (String) cmbBottleSize.getSelectedItem()); // Brewer tab: opts.setProperty("optBrewer", txtBrewerName.getText()); opts.set... | |
rbConstant .setSelected((opts.getProperty("optEvapCalcMethod").equalsIgnoreCase("Constant"))); | rbConstant.setSelected((opts.getProperty("optEvapCalcMethod").equalsIgnoreCase("Constant"))); evapAmountTxt.setText(opts.getProperty("optEvaporation")); if (opts.getProperty("optEvapCalcMethod").equalsIgnoreCase("Percent")) evapAmountLbl.setText("%"); else evapAmountLbl.setText(opts.getProperty("optSizeU") + "/hr"); | private void setOptions() { // cost tab: txtOtherCost.setText(opts.getProperty("optMiscCost")); txtBottleSize.setText(opts.getProperty("optBottleSize")); cmbBottleSizeModel.addOrInsert(opts.getProperty("optBottleU")); // brewer tab: txtBrewerName.setText(opts.getProperty("optBrewer")); txtPhone.setText(opts.get... |
public static String toNameList(Iterable<? extends Project> projects) { | public static String toNameList(Collection<? extends Project> projects) { | public static String toNameList(Iterable<? extends Project> projects) { StringBuilder buf = new StringBuilder(); for (Project project : projects) { if(buf.length()>0) buf.append(", "); buf.append(project.getName()); } return buf.toString(); } |
rsp.sendRedirect("."); | String referer = req.getHeader("Referer"); if(referer==null) referer="."; rsp.sendRedirect(referer); | public void doBuild( StaplerRequest req, StaplerResponse rsp ) throws IOException { getParent().getQueue().add(this); rsp.sendRedirect("."); } |
String cmd = DESCRIPTOR.getShell()+" -xe "+script.getRemote(); | String[] cmd = new String[] { DESCRIPTOR.getShell(),"-xe",script.getRemote()}; | public boolean perform(Build build, Launcher launcher, BuildListener listener) { Project proj = build.getProject(); FilePath ws = proj.getWorkspace(); FilePath script=null; try { try { script = ws.createTempFile("hudson","sh"); Writer w = new File... |
listener.getLogger().println("$ "+cmd); int r = 0; | int r; | public boolean perform(Build build, Launcher launcher, BuildListener listener) { Project proj = build.getProject(); FilePath ws = proj.getWorkspace(); FilePath script=null; try { try { script = ws.createTempFile("hudson","sh"); Writer w = new File... |
r = -1; | public boolean perform(Build build, Launcher launcher, BuildListener listener) { Project proj = build.getProject(); FilePath ws = proj.getWorkspace(); FilePath script=null; try { try { script = ws.createTempFile("hudson","sh"); Writer w = new File... | |
MacroFunction complex = new MacroFunction("complex",2,"x+i*y",globalDJep); globalDJep.addFunction("complex",complex); | MacroFunction complex = new MacroFunction("macrocomplex",2,"x+i*y",globalDJep); globalDJep.addFunction("macrocomplex",complex); | boolean addStandardDiffRules() { try { addDiffRule(new MacroDiffRules(globalDJep,"sin","cos(x)")); addDiffRule(new MacroDiffRules(globalDJep,"cos","-sin(x)")); addDiffRule(new MacroDiffRules(globalDJep,"tan","1/((cos(x))^2)")); MacroFunction sec = new MacroFunction("sec",1,"1/cos(x)",globalDJep); global... |
return super.getFailCount() + (getStatus()==Status.PASS ? 0 : 1); | if(considerTestAsTestObject) return super.getFailCount() + (getStatus()==Status.PASS ? 0 : 1); else { if (super.getTotalCount() != 0) return super.getFailCount(); else return (getStatus() == Status.PASS ? 0 : 1); } | public int getFailCount() { return super.getFailCount() + (getStatus()==Status.PASS ? 0 : 1); } |
return super.getTotalCount()+1; | if(considerTestAsTestObject) return super.getTotalCount()+1; else { if(super.getTotalCount() != 0) return super.getTotalCount(); else return 1; } | public int getTotalCount() { return super.getTotalCount()+1; } |
setUnits("gr"); | public Misc() { setName("");; setCost(0); setDescription(""); } | |
Map<String,String> previousRevisions = new HashMap<String,String>(); { File file = getRevisionFile(build.getPreviousBuild()); if(!file.exists()) return createEmptyChangeLog(changelogFile,listener, "log"); BufferedReader br = new BufferedReader(new FileReader(file)); String line; while((line=br.readLine())!=null) { in... | Map<String,String> previousRevisions = parseRevisionFile(build.getPreviousBuild()); | public 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 logge... |
private File getRevisionFile(Build build) { | private static File getRevisionFile(Build build) { | private File getRevisionFile(Build build) { return new File(build.getRootDir(),"revision.txt"); } |
if (param1 instanceof Number) { if (param2 instanceof Number) { | if (param1 instanceof Complex) { if (param2 instanceof Complex) return add((Complex)param1, (Complex)param2); else if (param2 instanceof Number) return add((Complex)param1, (Number)param2); } else if (param1 instanceof Number) { if (param2 instanceof Complex) return add((Complex)param2, (Number)param1); else if (param2... | public Object add(Object param1, Object param2) throws ParseException { if (param1 instanceof Number) { if (param2 instanceof Number) { return add((Number)param1, (Number)param2); } else if (param2 instanceof Complex) { return add((Complex)param2, (Number)param1); } } else if (param1 instanceof Complex) ... |
} else if (param2 instanceof Complex) { return add((Complex)param2, (Number)param1); } } else if (param1 instanceof Complex) { if (param2 instanceof Number) { return add((Complex)param1, (Number)param2); } else if (param2 instanceof Complex) { return add((Complex)param1, (Complex)param2); } } else if ((param1 instanceo... | } else if ((param1 instanceof String) && (param2 instanceof String)) { | public Object add(Object param1, Object param2) throws ParseException { if (param1 instanceof Number) { if (param2 instanceof Number) { return add((Number)param1, (Number)param2); } else if (param2 instanceof Complex) { return add((Complex)param2, (Number)param1); } } else if (param1 instanceof Complex) ... |
if (!u.equals(getCurrentEntity())) { | if (!u.getEntity().equals(getCurrentEntity())) { | public List<Entity> getEntities() { List<Entity> entityList = new ArrayList<Entity>(); if (logger.isDebugEnabled()) { logger.debug("Current entity is: "+getCurrentEntity()); } for (User u: getUsers()) { if (!u.equals(getCurrentEntity())) { entityList.add... |
Node n = j.parse("zap * wow"); | j.parse("zap * wow"); | public void testUndeclared() throws Exception { j.setAllowUndeclared(false); try { Node n = j.parse("zap * wow"); fail("Should have found undeclared error"); } catch(ParseException e) { System.out.println("Error caught: "+e.getMessage()); } try { j.setVarValue("foo",... |
JButton closeBtn = new JButton( GUIRegistry.getInstance().getIconFactory().getIcon("Close") ); | JButton closeBtn = new JButton( tab.getTabAction( SearchTab.FILTER_PANEL_TOGGLE_ACTION) ); closeBtn.setText(null); closeBtn.setIcon( GUIRegistry.getInstance().getIconFactory().getIcon( "Close") ); | public SearchFilterPanel( SearchTab tab ) { super(); searchTab = tab; setBorder( BorderFactory.createLineBorder( PhexColors.getBoxPanelBorderColor() ) ); setBackground( UIManager.getDefaults().getColor("window") ); CellConstraints cc = new C... |
numZeros = SacTimeSeries.swapBytes((short)dis.readUnsignedShort()); numPoles = SacTimeSeries.swapBytes((short)dis.readUnsignedShort()); | numZeros = SacTimeSeries.swapBytes(dis.readShort()); numPoles = SacTimeSeries.swapBytes(dis.readShort()); | public PSNPolesAndZeros(DataInputStream data) throws IOException{ dis = data; numZeros = SacTimeSeries.swapBytes((short)dis.readUnsignedShort()); numPoles = SacTimeSeries.swapBytes((short)dis.readUnsignedShort()); zeros = new double[numZeros][2]; for (int i = 0; i < numZeros; i++)... |
if ( shareFile.getURN() == null ) { return new Integer(0); } | public Object getValueAt(int row, int col) { if ( displayDirectory == null ) { return ""; } if ( row >= displayDirectryFiles.length ) { fireTableRowsDeleted( row, row ); return ""; } ShareFile shareFile = sharedFilesService.getShar... | |
logger.debug("Loaded property: "+value); | logger.debug("Loaded property: " + getValue()+" set from id="+id); | protected void setAsText(String id, Class clazz) { if (logger.isDebugEnabled()) { logger.debug("Loaded "+clazz.getName()+" property editor"); } try { Serializable key = resolveId(id); Object value = getHibernateTemplate().load(clazz, key); super.setVa... |
jButton2 = new JButton(); mainToolBar.add(jButton2); jButton2.setIcon(new ImageIcon(getClass().getClassLoader().getResource( | findButton = new JButton(); mainToolBar.add(findButton); findButton.setIcon(new ImageIcon(getClass().getClassLoader().getResource( | 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... |
jButton2.addActionListener(new ActionListener() { | findButton.addActionListener(new ActionListener() { | 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... |
JButton printButton = new JButton(); mainToolBar.add(printButton); printButton.setIcon(new ImageIcon(getClass().getClassLoader().getResource( "ca/strangebrew/icons/print.gif"))); printButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { PrintDialog pd = new PrintDialog(owner); ... | 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... | |
if (myRecipe != null) { Fermentable f = new Fermentable(myRecipe.getMaltUnits()); myRecipe.addMalt(f); maltTable.updateUI(); displayRecipe(); } | String u = (String) maltTotalUnitsComboModel.getSelectedItem(); if (myRecipe != null) { myRecipe.setMaltUnits(u); displayRecipe(); | public void actionPerformed(ActionEvent evt) { if (myRecipe != null) { Fermentable f = new Fermentable(myRecipe.getMaltUnits()); myRecipe.addMalt(f); maltTable.updateUI(); displayRecipe(); } } |
} | public void actionPerformed(ActionEvent evt) { if (myRecipe != null) { Fermentable f = new Fermentable(myRecipe.getMaltUnits()); myRecipe.addMalt(f); maltTable.updateUI(); displayRecipe(); } } | |
int i = maltTable.getSelectedRow(); myRecipe.delMalt(i); | Fermentable f = new Fermentable(myRecipe.getMaltUnits()); myRecipe.addMalt(f); | public void actionPerformed(ActionEvent evt) { if (myRecipe != null) { int i = maltTable.getSelectedRow(); myRecipe.delMalt(i); maltTable.updateUI(); displayRecipe(); } } |
String u = (String) hopsTotalUnitsComboModel.getSelectedItem(); if (myRecipe != null) { myRecipe.setHopsUnits(u); displayRecipe(); | if (myRecipe != null) { int i = maltTable.getSelectedRow(); myRecipe.delMalt(i); maltTable.updateUI(); displayRecipe(); } | public void actionPerformed(ActionEvent evt) { String u = (String) hopsTotalUnitsComboModel.getSelectedItem(); if (myRecipe != null) { myRecipe.setHopsUnits(u); displayRecipe(); } } |
} | public void actionPerformed(ActionEvent evt) { String u = (String) hopsTotalUnitsComboModel.getSelectedItem(); if (myRecipe != null) { myRecipe.setHopsUnits(u); displayRecipe(); } } | |
int i = hopsTable.getSelectedRow(); myRecipe.delHop(i); | Hop h = new Hop(myRecipe.getHopUnits()); myRecipe.addHop(h); | public void actionPerformed(ActionEvent evt) { if (myRecipe != null) { int i = hopsTable.getSelectedRow(); myRecipe.delHop(i); hopsTable.updateUI(); displayRecipe(); } } |
myRecipe = new Recipe(); myRecipe.setVersion(version); currentFile = null; attachRecipeData(); displayRecipe(); } | if (myRecipe != null) { int i = hopsTable.getSelectedRow(); myRecipe.delHop(i); hopsTable.updateUI(); displayRecipe(); } } | public void actionPerformed(ActionEvent evt) { // This is just a test right now to see that // stuff is changed. myRecipe = new Recipe(); myRecipe.setVersion(version); currentFile = null; attachRecipeData(); displayRecipe(); } |
String[] ext = {"xml", "qbrew", "rec"}; String desc = "StrangBrew and importable formats"; sbFileFilter openFileFilter = new sbFileFilter(ext, desc); fileChooser.setFileFilter(openFileFilter); int returnVal = fileChooser.showOpenDialog(jMenuBar1); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fileCho... | myRecipe = new Recipe(); myRecipe.setVersion(version); currentFile = null; attachRecipeData(); displayRecipe(); | public void actionPerformed(ActionEvent evt) { // Show open dialog; this method does // not return until the dialog is closed String[] ext = {"xml", "qbrew", "rec"}; String desc = "StrangBrew and importable formats"; sbFileFilter openFileFilter = new sbFileFilter(ext, desc); ... |
FindDialog fd = new FindDialog(owner); fd.setModal(true); fd.setVisible(true); | String[] ext = {"xml", "qbrew", "rec"}; String desc = "StrangBrew and importable formats"; sbFileFilter openFileFilter = new sbFileFilter(ext, desc); fileChooser.setFileFilter(openFileFilter); int returnVal = fileChooser.showOpenDialog(jMenuBar1); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fileCho... | public void actionPerformed(ActionEvent evt) { // open the find dialog FindDialog fd = new FindDialog(owner); fd.setModal(true); fd.setVisible(true); } |
saveFile(evt); } | FindDialog fd = new FindDialog(owner); fd.setModal(true); fd.setVisible(true); } | public void actionPerformed(ActionEvent evt) { saveFile(evt); } |
saveAs(); } | saveFile(evt); } | public void actionPerformed(ActionEvent evt) { saveAs(); } |
String[] ext = {"html", "htm"}; sbFileFilter saveFileFilter = new sbFileFilter(ext, "HTML"); fileChooser.setFileFilter(saveFileFilter); fileChooser.setSelectedFile(new File(myRecipe.getName() + ".html")); int returnVal = fileChooser.showSaveDialog(jMenuBar1); if (returnVal == JFileChooser.APPROVE_OPTION) { File file =... | saveAs(); } | public void actionPerformed(ActionEvent evt) { // Show save dialog; this method does // not return until the dialog is closed String[] ext = {"html", "htm"}; sbFileFilter saveFileFilter = new sbFileFilter(ext, "HTML"); fileChooser.setFileFilter(saveFileFilter); f... |
String[] ext = {"txt"}; sbFileFilter saveFileFilter = new sbFileFilter(ext, "Text"); | String[] ext = {"html", "htm"}; sbFileFilter saveFileFilter = new sbFileFilter(ext, "HTML"); | public void actionPerformed(ActionEvent evt) { // Show save dialog; this method does // not return until the dialog is closed String[] ext = {"txt"}; sbFileFilter saveFileFilter = new sbFileFilter(ext, "Text"); fileChooser.setFileFilter(saveFileFilter); fileChoose... |
+ ".txt")); | + ".html")); | public void actionPerformed(ActionEvent evt) { // Show save dialog; this method does // not return until the dialog is closed String[] ext = {"txt"}; sbFileFilter saveFileFilter = new sbFileFilter(ext, "Text"); fileChooser.setFileFilter(saveFileFilter); fileChoose... |
FileWriter out = new FileWriter(file); out.write(myRecipe.toText()); out.close(); | saveAsHTML(file, "recipeToHtml.xslt", null); | public void actionPerformed(ActionEvent evt) { // Show save dialog; this method does // not return until the dialog is closed String[] ext = {"txt"}; sbFileFilter saveFileFilter = new sbFileFilter(ext, "Text"); fileChooser.setFileFilter(saveFileFilter); fileChoose... |
Debug.print("Export text command cancelled by user.\n"); | Debug.print("Save command cancelled by user.\n"); | public void actionPerformed(ActionEvent evt) { // Show save dialog; this method does // not return until the dialog is closed String[] ext = {"txt"}; sbFileFilter saveFileFilter = new sbFileFilter(ext, "Text"); fileChooser.setFileFilter(saveFileFilter); fileChoose... |
Clipboard clipboard = getToolkit ().getSystemClipboard (); StringSelection s = new StringSelection(myRecipe.toText()); clipboard.setContents(s, s); } | String[] ext = {"txt"}; sbFileFilter saveFileFilter = new sbFileFilter(ext, "Text"); fileChooser.setFileFilter(saveFileFilter); fileChooser.setSelectedFile(new File(myRecipe.getName() + ".txt")); int returnVal = fileChooser.showSaveDialog(jMenuBar1); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fileChoos... | public void actionPerformed(ActionEvent evt) { // Copy current recipe to clipboard Clipboard clipboard = getToolkit ().getSystemClipboard (); StringSelection s = new StringSelection(myRecipe.toText()); clipboard.setContents(s, s); } |
PrintDialog pd = new PrintDialog(owner); pd.setModal(true); pd.setVisible(true); | Clipboard clipboard = getToolkit ().getSystemClipboard (); StringSelection s = new StringSelection(myRecipe.toText()); clipboard.setContents(s, s); | public void actionPerformed(ActionEvent evt) { PrintDialog pd = new PrintDialog(owner); pd.setModal(true); pd.setVisible(true); } |
processWindowEvent(new WindowEvent(owner,WindowEvent.WINDOW_CLOSING)); System.exit(0); | PrintDialog pd = new PrintDialog(owner); pd.setModal(true); pd.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); | processWindowEvent(new WindowEvent(owner,WindowEvent.WINDOW_CLOSING)); System.exit(0); | 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); | PreferencesDialog d = new PreferencesDialog(owner, preferences); d.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); | ScaleRecipeDialog scaleRecipe = new ScaleRecipeDialog(owner); scaleRecipe.setModal(true); scaleRecipe.setVisible(true); | public void actionPerformed(ActionEvent evt) { MaltPercentDialog maltPercent = new MaltPercentDialog(owner); maltPercent.setModal(true); maltPercent.setVisible(true); } |
RefractometerDialog refract = new RefractometerDialog(owner); refract.setModal(true); refract.setVisible(true); | MaltPercentDialog maltPercent = new MaltPercentDialog(owner); maltPercent.setModal(true); maltPercent.setVisible(true); | public void actionPerformed(ActionEvent evt) { RefractometerDialog refract = new RefractometerDialog(owner); refract.setModal(true); refract.setVisible(true); } |
PotentialExtractCalcDialog extCalc = new PotentialExtractCalcDialog(owner); extCalc.setModal(true); extCalc.setVisible(true); | RefractometerDialog refract = new RefractometerDialog(owner); refract.setModal(true); refract.setVisible(true); | public void actionPerformed(ActionEvent evt) { PotentialExtractCalcDialog extCalc = new PotentialExtractCalcDialog(owner); extCalc.setModal(true); extCalc.setVisible(true); } |
String urlString = SBStringUtils.getAppPath("help") + "index.html"; Debug.print(urlString); AbstractLogger logger = new SystemLogger(); BrowserLauncher launcher; try { launcher = new BrowserLauncher(logger); BrowserLauncherRunner runner = new BrowserLauncherRunner( launcher, urlString, null); Thread launcherThread = ne... | PotentialExtractCalcDialog extCalc = new PotentialExtractCalcDialog(owner); extCalc.setModal(true); extCalc.setVisible(true); | public void actionPerformed(ActionEvent evt) { String urlString = SBStringUtils.getAppPath("help") + "index.html"; Debug.print(urlString); AbstractLogger logger = new SystemLogger(); BrowserLauncher launcher; try { launcher = new BrowserLauncher(logger); ... |
aboutDlg = new AboutDialog(owner, version); aboutDlg.setVisible(true); | String urlString = SBStringUtils.getAppPath("help") + "index.html"; Debug.print(urlString); AbstractLogger logger = new SystemLogger(); BrowserLauncher launcher; try { launcher = new BrowserLauncher(logger); BrowserLauncherRunner runner = new BrowserLauncherRunner( launcher, urlString, null); Thread launcherThread = ne... | public void actionPerformed(ActionEvent evt) { aboutDlg = new AboutDialog(owner, version); aboutDlg.setVisible(true); } |
String slash = System.getProperty("file.separator"); currentDir = new java.io.File("."); try { currentDir = new File(currentDir.getCanonicalPath() + slash + "recipes"); } catch (IOException e) { e.printStackTrace(); } | currentDir = new File(SBStringUtils.getAppPath("recipes")); | public FindDialog(JFrame frame) { super(frame); recipes = new ArrayList(); files = new ArrayList(); inst = (StrangeSwing) frame; String slash = System.getProperty("file.separator"); currentDir = new java.io.File("."); try { currentDir = new File(currentDir.getCanonicalPath() + slash + "recipes"); } catch (IO... |
if (param instanceof Number) | if (param instanceof Complex) { return ((Complex)param).cos(); } else if (param instanceof Number) | public Object cos(Object param) throws ParseException { if (param instanceof Number) { return new Double(Math.cos(((Number)param).doubleValue())); } else if (param instanceof Complex) { return ((Complex)param).cos(); } throw new ParseException("Invalid parameter type"); } |
} else if (param instanceof Complex) { return ((Complex)param).cos(); | public Object cos(Object param) throws ParseException { if (param instanceof Number) { return new Double(Math.cos(((Number)param).doubleValue())); } else if (param instanceof Complex) { return ((Complex)param).cos(); } throw new ParseException("Invalid parameter type"); } | |
public String visualizeSearchStatus( Search search ) | public static String visualizeSearchStatus( Search search ) | public String visualizeSearchStatus( Search search ) { return null; } |
return null; | if ( search instanceof BrowseHostResults ) { BrowseHostResults br = (BrowseHostResults) search; switch ( br.getBrowseHostStatus() ) { case BrowseHostResults.INITIALIZING: return Localizer.getString("BrowseHost_Initializing"); case BrowseHostResults.CONNECTING: return Localizer.getString("BrowseHost_Connecting"); case B... | public String visualizeSearchStatus( Search search ) { return null; } |
if (param instanceof Number) | if (param instanceof Complex) { return ((Complex)param).asin(); } else if (param instanceof Number) | public Object asin(Object param) throws ParseException { if (param instanceof Number) { return new Double(Math.asin(((Number)param).doubleValue())); } else if (param instanceof Complex) { return ((Complex)param).asin(); } throw new ParseException("Invalid parameter type"); } |
} else if (param instanceof Complex) { return ((Complex)param).asin(); | public Object asin(Object param) throws ParseException { if (param instanceof Number) { return new Double(Math.asin(((Number)param).doubleValue())); } else if (param instanceof Complex) { return ((Complex)param).asin(); } throw new ParseException("Invalid parameter type"); } | |
public UserLog createAndPersistUserLog(User user, Date date) { UserLog userLog = new UserLog(); userLog.setUser(user); userLog.setLastLogin(date); merge(userLog); return userLog; | public UserLog createAndPersistUserLog(User user) { return createAndPersistUserLog(user, new Date()); | public UserLog createAndPersistUserLog(User user, Date date) { UserLog userLog = new UserLog(); userLog.setUser(user); userLog.setLastLogin(date); merge(userLog); return userLog; } |
Date lastLogin = (Date) findUnique(LASTUSERLOGDATE_QUERY, principal); | Date lastLogin = findLastIdentityLogDate(principal); | public UserLog findLastUserLog(String principal) { try { // two different queries to grant compatibility with all databases Date lastLogin = (Date) findUnique(LASTUSERLOGDATE_QUERY, principal); List<UserLog> userLogList = (ArrayList<UserLog>) find(LASTUSERLOG_QUERY, principal, last... |
if (param instanceof Number) { return new Double(Math.exp(((Number)param).doubleValue())); } else if (param instanceof Complex) | if (param instanceof Complex) | public Object exp(Object param) throws ParseException { if (param instanceof Number) { return new Double(Math.exp(((Number)param).doubleValue())); } else if (param instanceof Complex) { Complex z = (Complex) param; double x = z.re(); double y = z.im(); double mod = Math.exp(x); return new Co... |
else if (param instanceof Number) { return new Double(Math.exp(((Number)param).doubleValue())); } | public Object exp(Object param) throws ParseException { if (param instanceof Number) { return new Double(Math.exp(((Number)param).doubleValue())); } else if (param instanceof Complex) { Complex z = (Complex) param; double x = z.re(); double y = z.im(); double mod = Math.exp(x); return new Co... | |
rsp.sendRedirect(req.getContextPath()); | rsp.sendRedirect(req.getContextPath()+"/"); | public synchronized void doLoginEntry( StaplerRequest req, StaplerResponse rsp ) throws IOException { rsp.sendRedirect(req.getContextPath()); } |
rsp.sendRedirect(req.getContextPath()); | rsp.sendRedirect(req.getContextPath()+"/"); | public synchronized void doLogout( StaplerRequest req, StaplerResponse rsp ) throws IOException { HttpSession session = req.getSession(false); if(session!=null) session.invalidate(); rsp.sendRedirect(req.getContextPath()); } |
rsp.sendRedirect(req.getContextPath()); | rsp.sendRedirect(req.getContextPath()+"/"); | public synchronized void doReload( StaplerRequest req, StaplerResponse rsp ) throws IOException { if(!Hudson.adminCheck(req,rsp)) return; load(); rsp.sendRedirect(req.getContextPath()); } |
int index = ((Double) param2.getEle(0)).intValue()-1; | int index = ((Number) param2.getEle(0)).intValue()-1; | public MatrixValueI calcValue(MatrixValueI res, MatrixValueI param1,MatrixValueI param2) throws ParseException {// 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)).intV... |
Double d1 = (Double) vec.getEle(0); Double d2 = (Double) vec.getEle(1); | Number d1 = (Number) vec.getEle(0); Number d2 = (Number) vec.getEle(1); | public MatrixValueI calcValue(MatrixValueI res, MatrixValueI param1,MatrixValueI param2) throws ParseException {// 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)).intV... |
if(param2 instanceof Double) | if(param2 instanceof Number) | public void run(Stack stack) throws ParseException { checkStack(stack); // check the stack Object param1,param2; // get the parameter from the stack param2 = stack.pop(); param1 = stack.pop(); if(param1 instanceof MVector) { if(param2 instanceof Double) { Object val = ((MVector)... |
Object val = ((MVector) param1).getEle(((Double) param2).intValue()-1); | Object val = ((MVector) param1).getEle(((Number) param2).intValue()-1); | public void run(Stack stack) throws ParseException { checkStack(stack); // check the stack Object param1,param2; // get the parameter from the stack param2 = stack.pop(); param1 = stack.pop(); if(param1 instanceof MVector) { if(param2 instanceof Double) { Object val = ((MVector)... |
Double d1 = (Double) vec.getEle(0); Double d2 = (Double) vec.getEle(1); | Number d1 = (Number) vec.getEle(0); Number d2 = (Number) vec.getEle(1); | public void run(Stack stack) throws ParseException { checkStack(stack); // check the stack Object param1,param2; // get the parameter from the stack param2 = stack.pop(); param1 = stack.pop(); if(param1 instanceof MVector) { if(param2 instanceof Double) { Object val = ((MVector)... |
String path = getPath(); File inputFile = new File(path + getSep() + type + ".ini"); | String path = SBStringUtils.getAppPath("ini"); File inputFile = new File(path + type + ".ini"); | private void loadProperties() { try { String path = getPath(); File inputFile = new File(path + getSep() + type + ".ini"); if (inputFile.exists()){ props.load(new FileInputStream(inputFile)); Debug.print(type + ".ini file read: " + inputFile.getAbsolutePath() +". Contents:"); } } catch... |
String path = getPath(); Debug.print("Storing props: " + path); FileOutputStream out = new FileOutputStream(path + "\\" + type +".ini"); | String path = SBStringUtils.getAppPath("ini"); Debug.print("Storing props: " + path); FileOutputStream out = new FileOutputStream(path + type +".ini"); | public void saveProperties() { try{ String path = getPath(); Debug.print("Storing props: " + path); FileOutputStream out = new FileOutputStream(path + "\\" + type +".ini"); props.store(out, "/* properties updated */"); } catch (Exception e) { System.out.println(e); } } |
super( Localizer.getString( "AdvancedSearchFilter" ), IconFactory.EMPTY_IMAGE_16, Localizer.getString( "TTTAdvancedSearchFilter" ) ); | super( Localizer.getString( "SearchTab_EditFilterRules" ), null, Localizer.getString( "SearchTab_TTTEditFilterRules" ) ); | public AdvancedFilterAction() { super( Localizer.getString( "AdvancedSearchFilter" ), IconFactory.EMPTY_IMAGE_16, Localizer.getString( "TTTAdvancedSearchFilter" ) ); refreshActionState(); } |
POperator op = (POperator) node; if(!this.op.equals(op)) return false; if(args.length != op.args.length) | POperator nodeOp = (POperator) node; if(!this.op.equals(nodeOp)) return false; if(args.length != nodeOp.args.length) | public boolean equals(PNodeI node) { if(!(node instanceof POperator)) return false; POperator op = (POperator) node; if(!this.op.equals(op)) return false; if(args.length != op.args.length) return false; for(int i=0;i<args.length;++i) if(!args[i].equals(op.args[i])) return false; return true; } |
if(!args[i].equals(op.args[i])) return false; | if(!args[i].equals(nodeOp.args[i])) return false; | public boolean equals(PNodeI node) { if(!(node instanceof POperator)) return false; POperator op = (POperator) node; if(!this.op.equals(op)) return false; if(args.length != op.args.length) return false; for(int i=0;i<args.length;++i) if(!args[i].equals(op.args[i])) return false; return true; } |
} catch (FileNotFoundException e) { | } catch (Exception e) { | private String checkFileType(File f) { if (f.getPath().endsWith(".rec")) return "promash"; // let's open it up and have a peek // we'll only read 10 lines if (f.getPath().endsWith(".qbrew") || (f.getPath().endsWith(".xml"))) { try { FileReader in = new FileReader(f); BufferedReader inb = new BufferedRead... |
} catch (IOException e) { e.printStackTrace(); } | } | private String checkFileType(File f) { if (f.getPath().endsWith(".rec")) return "promash"; // let's open it up and have a peek // we'll only read 10 lines if (f.getPath().endsWith(".qbrew") || (f.getPath().endsWith(".xml"))) { try { FileReader in = new FileReader(f); BufferedReader inb = new BufferedRead... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.