bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
public void saveCollection(Collection graph) { UpdateFilter filter = new UpdateFilter( getHibernateTemplate() ); beforeUpdate( graph, filter ); for (Object _object : graph) { IObject obj = (IObject) _object; obj = internalSave( obj, filter ); } afterUpdate( graph, filter ); }
public void saveCollection(Collection graph) { UpdateFilter filter = new UpdateFilter( securitySystem, localQuery ); beforeUpdate( graph, filter ); for (Object _object : graph) { IObject obj = (IObject) _object; obj = internalSave( obj, filter ); } afterUpdate( graph, filter ); }
3,231,084
public void saveObject(IObject graph) { UpdateFilter filter = new UpdateFilter( getHibernateTemplate() ); beforeUpdate( graph, filter ); graph = internalSave( graph, filter ); afterUpdate( graph, filter ); }
public void saveObject(IObject graph) { UpdateFilter filter = new UpdateFilter( securitySystem, localQuery ); beforeUpdate( graph, filter ); graph = internalSave( graph, filter ); afterUpdate( graph, filter ); }
3,231,085
private void showPresentation() { DataManagerUIF presentation = abstraction.getPresentation(); if (presentation != null && presentation.isClosed()) abstraction.showPresentation(); }
private void showPresentation() { DataManagerUIF presentation = abstraction.getPresentation(); if (presentation != null && presentation.isClosed()) abstraction.showPresentation(); }
3,231,086
void updateDataset(pojos.DatasetData dd, List isToRemove, List isToAdd, boolean nameChange) { try { DataManagementService dms = registry.getDataManagementService(); dms.updateDataset(transformPojosDatasetData(dd), isToRemove, isToAdd); //update the presentation and the dataset summary contained in the //datasetSummaries list accordingly. if (datasetSummaries.size() != 0) updateDSList(dd); else updateDatasetInPS(dd); if (nameChange) presentation.updateDatasetInTree(); UserNotifier un = registry.getUserNotifier(); IconManager im = IconManager.getInstance(registry); un.notifyInfo("Update dataset", "The dataset has been updated.", im.getIcon(IconManager.SEND_TO_DB)); } catch(DSAccessException dsae) { String s = "Can't update the dataset: "+dd.getId()+"."; registry.getLogger().error(this, s+" Error: "+dsae); registry.getUserNotifier().notifyError("Data Retrieval Failure", s, dsae); } catch(DSOutOfServiceException dsose) { ServiceActivationRequest request = new ServiceActivationRequest( ServiceActivationRequest.DATA_SERVICES); registry.getEventBus().post(request); } }
void updateDataset(pojos.DatasetData dd, List isToRemove, List isToAdd, boolean nameChange) { try { DataManagementService dms = registry.getDataManagementService(); dms.updateDataset(transformPojosDatasetData(dd), isToRemove, isToAdd); //update the presentation and the dataset summary contained in the //datasetSummaries list accordingly. if (datasetSummaries.size() != 0) updateDSList(dd); else updateDatasetInPS(dd); if (nameChange) presentation.updateDatasetInTree(); UserNotifier un = registry.getUserNotifier(); IconManager im = IconManager.getInstance(registry); un.notifyInfo("Update dataset", "The dataset has been updated.", im.getIcon(IconManager.SEND_TO_DB)); } catch(DSAccessException dsae) { String s = "Can't update the dataset: "+dd.getId()+"."; registry.getLogger().error(this, s+" Error: "+dsae); registry.getUserNotifier().notifyError("Data Retrieval Failure", s, dsae); } catch(DSOutOfServiceException dsose) { ServiceActivationRequest request = new ServiceActivationRequest( ServiceActivationRequest.DATA_SERVICES); registry.getEventBus().post(request); } }
3,231,087
protected void onDisplayChange(TreeImageDisplay selectedDisplay) { if (selectedDisplay == null) { setEnabled(false); return; } //if (model.getSelectedBrowser().getBrowserType() == //Browser.IMAGES_EXPLORER && if (selectedDisplay.getParentDisplay() == null) { //root setEnabled(true); return; } Object ho = selectedDisplay.getUserObject(); if (ho == null || !(ho instanceof DataObject)) setEnabled(false); else { if ((ho instanceof ImageData)) putValue(Action.NAME, VIEW); else putValue(Action.NAME, BROWSE); setEnabled(true); } }
protected void onDisplayChange(TreeImageDisplay selectedDisplay){if (selectedDisplay == null) {setEnabled(false);return;}//if (model.getSelectedBrowser().getBrowserType() == //Browser.IMAGES_EXPLORER && if (selectedDisplay.getParentDisplay() == null) { //rootsetEnabled(true);return;}Object ho = selectedDisplay.getUserObject();if (ho == null || !(ho instanceof DataObject)) setEnabled(false);else {if ((ho instanceof ImageData)) putValue(Action.NAME, VIEW); else putValue(Action.NAME, BROWSE);setEnabled(true);}}
3,231,091
protected void onDisplayChange(TreeImageDisplay selectedDisplay) { if (selectedDisplay == null) { setEnabled(false); return; } //if (model.getSelectedBrowser().getBrowserType() == //Browser.IMAGES_EXPLORER && if (selectedDisplay.getParentDisplay() == null) { //root setEnabled(true); return; } Object ho = selectedDisplay.getUserObject(); if (ho == null || !(ho instanceof DataObject)) setEnabled(false); else { if ((ho instanceof ImageData)) putValue(Action.NAME, VIEW); else putValue(Action.NAME, BROWSE); setEnabled(true); } }
protected void onDisplayChange(TreeImageDisplay selectedDisplay) { if (selectedDisplay == null) { setEnabled(false); return; } //if (model.getSelectedBrowser().getBrowserType() == //Browser.IMAGES_EXPLORER && if (selectedDisplay.getParentDisplay() == null) { //root putValue(Action.NAME, BROWSE); setEnabled(model.getSelectedBrowser().getBrowserType() == Browser.IMAGES_EXPLORER); return; } Object ho = selectedDisplay.getUserObject(); if (ho == null || !(ho instanceof DataObject)) setEnabled(false); else { if ((ho instanceof ImageData)) putValue(Action.NAME, VIEW); else putValue(Action.NAME, BROWSE); putValue(Action.NAME, BROWSE); setEnabled(model.getSelectedBrowser().getBrowserType() == Browser.IMAGES_EXPLORER); } }
3,231,092
protected void prettifyBody() { String body = getBody(); if(body!=null){// System.out.println("ArticleIn = "+articleIn); //Use JTidy to clean up the html Tidy tidy = new Tidy(); tidy.setXHTML(true); tidy.setXmlOut(true); ByteArrayInputStream bais = new ByteArrayInputStream(body.getBytes()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); String articleOut = baos.toString();// System.out.println("ArticleOut = "+articleOut); setBody(articleOut); } }
protected void prettifyBody() { String body = getBody(); if(body!=null){// System.out.println("ArticleIn = "+articleIn); //Use JTidy to clean up the html Tidy tidy = new Tidy(); tidy.setXHTML(true); tidy.setXmlOut(true); ByteArrayInputStream bais = new ByteArrayInputStream(body.getBytes()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); String articleOut = baos.toString();// System.out.println("ArticleOut = "+articleOut); setBody(articleOut); } }
3,231,093
protected void prettifyBody() { String body = getBody(); if(body!=null){// System.out.println("ArticleIn = "+articleIn); //Use JTidy to clean up the html Tidy tidy = new Tidy(); tidy.setXHTML(true); tidy.setXmlOut(true); ByteArrayInputStream bais = new ByteArrayInputStream(body.getBytes()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); String articleOut = baos.toString();// System.out.println("ArticleOut = "+articleOut); setBody(articleOut); } }
protected void prettifyBody() { String body = getBody(); if(body!=null){// System.out.println("ArticleIn = "+articleIn); //Use JTidy to clean up the html Tidy tidy = new Tidy(); tidy.setXHTML(true); tidy.setXmlOut(true); ByteArrayInputStream bais = new ByteArrayInputStream(body.getBytes()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); String articleOut = baos.toString();// System.out.println("ArticleOut = "+articleOut); setBody(articleOut); } }
3,231,094
public ZoomBarManager(ZoomBar view, ImageInspectorManager control, double magFactor) { zoomLevel = magFactor; percentFormat = NumberFormat.getPercentInstance(); this.view = view; this.control = control; }
public ZoomBarManager(ZoomBar view, ImageInspectorManager control, double magFactor) { zoomLevel = magFactor; percentFormat = NumberFormat.getPercentInstance(); this.view = view; this.control = control; }
3,231,095
public void actionPerformed(ActionEvent e) { int index = Integer.parseInt(e.getActionCommand()); try { switch (index) { case ZOOM_FIELD_CMD: zoomFieldActionHandler(); break; case ZOOM_IN_CMD: zoomIn(); break; case ZOOM_OUT_CMD: zoomOut(); break; case ZOOM_FIT_CMD: zoomFit(); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } }
public void actionPerformed(ActionEvent e) { int index = Integer.parseInt(e.getActionCommand()); try { switch (index) { case ZOOM_FIELD_CMD: zoomFieldActionHandler(); break; case ZOOM_IN_CMD: zoomIn(); break; case ZOOM_OUT_CMD: zoomOut(); break; case ZOOM_FIT_CMD: zoomFit(); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } }
3,231,096
void attachListeners() { //textfield zoomField = view.getZoomField(); zoomField.setActionCommand(""+ZOOM_FIELD_CMD); zoomField.addActionListener(this); zoomField.addFocusListener(this); //button JButton zoomIn = view.getZoomIn(), zoomOut = view.getZoomOut(), zoomFit = view.getZoomFit(); zoomIn.addActionListener(this); zoomIn.setActionCommand(""+ZOOM_IN_CMD); zoomOut.addActionListener(this); zoomOut.setActionCommand(""+ZOOM_OUT_CMD); zoomFit.addActionListener(this); zoomFit.setActionCommand(""+ZOOM_FIT_CMD); }
void attachListeners() { //textfield zoomField = view.getZoomField(); zoomField.setActionCommand(""+ZOOM_FIELD_CMD); zoomField.addActionListener(this); zoomField.addFocusListener(this); //button JButton zoomIn = view.getZoomIn(), zoomOut = view.getZoomOut(), zoomFit = view.getZoomFit(); zoomIn.addActionListener(this); zoomIn.setActionCommand(""+ZOOM_IN_CMD); zoomOut.addActionListener(this); zoomOut.setActionCommand(""+ZOOM_OUT_CMD); zoomFit.addActionListener(this); zoomFit.setActionCommand(""+ZOOM_FIT_CMD); }
3,231,097
public void focusLost(FocusEvent e) { String val = zoomField.getText(); String cVal = percentFormat.format(zoomLevel); if (val == null || !val.equals(cVal)) zoomField.setText(cVal); }
public void focusLost(FocusEvent e) { String val = zoomField.getText(); String cVal = percentFormat.format(zoomLevel); if (val == null || !val.equals(cVal)) zoomField.setText(cVal); }
3,231,098
public void setText(double level) { zoomField.setText(percentFormat.format(level)); }
public void setText(double level) { zoomField.setText(percentFormat.format(level)); }
3,231,099
private void synchZoom(double value) { zoomLevel = value; control.setZoomLevel(zoomLevel); }
private void synchZoom(double value) { zoomLevel = value; control.setZoomLevel(zoomLevel); }
3,231,100
private void zoomFieldActionHandler() { boolean valid = false; double val = 0; try { val = percentFormat.parse(zoomField.getText()).doubleValue(); if (ImageInspector.MIN_ZOOM_LEVEL <= val && val <= ImageInspector.MAX_ZOOM_LEVEL) { valid = true; } else if (val < ImageInspector.MIN_ZOOM_LEVEL) { val = ImageInspector.MIN_ZOOM_LEVEL; valid = true; } else if (val > ImageInspector.MAX_ZOOM_LEVEL) { val = ImageInspector.MAX_ZOOM_LEVEL; valid = true; } } catch(NumberFormatException nfe) {} catch(ParseException e) {} if (valid) synchZoom(val); else { zoomField.selectAll(); UserNotifier un = view.getRegistry().getUserNotifier(); un.notifyInfo("Invalid input value", "Please enter a value between 25% and 300%."); } }
private void zoomFieldActionHandler() { boolean valid = false; double val = 0; try { val = percentFormat.parse(zoomField.getText()).doubleValue(); if (ImageInspector.MIN_ZOOM_LEVEL <= val && val <= ImageInspector.MAX_ZOOM_LEVEL) { valid = true; } else if (val < ImageInspector.MIN_ZOOM_LEVEL) { val = ImageInspector.MIN_ZOOM_LEVEL; valid = true; } else if (val > ImageInspector.MAX_ZOOM_LEVEL) { val = ImageInspector.MAX_ZOOM_LEVEL; valid = true; } } catch(NumberFormatException nfe) {} catch(ParseException e) {} if (valid) synchZoom(val); else { zoomField.selectAll(); UserNotifier un = view.getRegistry().getUserNotifier(); un.notifyInfo("Invalid input value", "Please enter a value between 25% and 300%."); } }
3,231,101
private void zoomFit() { zoomLevel = ImageInspector.ZOOM_DEFAULT; control.setZoomLevel(zoomLevel); }
private void zoomFit() { zoomLevel = ImageInspector.ZOOM_DEFAULT; control.setZoomLevel(zoomLevel); }
3,231,102
private void zoomIn() { if (zoomLevel < ImageInspector.MAX_ZOOM_LEVEL) zoomLevel += ImageInspector.ZOOM_INCREMENT; control.setZoomLevel(zoomLevel); }
private void zoomIn() { if (zoomLevel < ImageInspector.MAX_ZOOM_LEVEL) zoomLevel += ImageInspector.ZOOM_INCREMENT; control.setZoomLevel(zoomLevel); }
3,231,103
private void zoomIn() { if (zoomLevel < ImageInspector.MAX_ZOOM_LEVEL) zoomLevel += ImageInspector.ZOOM_INCREMENT; control.setZoomLevel(zoomLevel); }
private void zoomIn() { if (zoomLevel < ImageInspector.MAX_ZOOM_LEVEL) zoomLevel += ImageInspector.ZOOM_INCREMENT; control.setZoomLevel(zoomLevel); }
3,231,104
private void zoomOut() { if (zoomLevel > ImageInspector.MIN_ZOOM_LEVEL) zoomLevel -= ImageInspector.ZOOM_INCREMENT; control.setZoomLevel(zoomLevel); }
private void zoomOut() { if (zoomLevel > ImageInspector.MIN_ZOOM_LEVEL) zoomLevel -= ImageInspector.ZOOM_INCREMENT; control.setZoomLevel(zoomLevel); }
3,231,105
void setSelectedNode() { DefaultMutableTreeNode node = (DefaultMutableTreeNode) getLastSelectedPathComponent(); if (selectedNode == node) return; ImageDisplay newObject = (ImageDisplay) node.getUserObject(); ImageDisplay oldObject = null; if (selectedNode != null) oldObject = (ImageDisplay) selectedNode.getUserObject(); firePropertyChange(ClipBoard.LOCALIZE_IMAGE_DISPLAY, oldObject, newObject); selectedNode = node; }
void setSelectedNode() { DefaultMutableTreeNode node = (DefaultMutableTreeNode) getLastSelectedPathComponent(); if (selectedNode == node) return; Object uo = node.getUserObject(); if (uo instanceof String) return; ImageDisplay newObject = (ImageDisplay) uo; ImageDisplay oldObject = null; if (selectedNode != null) oldObject = (ImageDisplay) selectedNode.getUserObject(); firePropertyChange(ClipBoard.LOCALIZE_IMAGE_DISPLAY, oldObject, newObject); selectedNode = node; }
3,231,106
void buildTree(Set nodes) { if (nodes.size() == 0) { getTreeModel(); DefaultMutableTreeNode childNode = new DefaultMutableTreeNode("Empty"); DefaultTreeModel tm= (DefaultTreeModel) view.getModel(); tm.insertNodeInto(childNode, root, root.getChildCount()); } else { List list = CollectionSorter.sortImageDisplay(nodes); Iterator i = list.iterator(); while (i.hasNext()) buildTreeNode((ImageDisplay) i.next()); } }
void buildTree(Set nodes) { if (nodes.size() == 0) { getTreeModel(); DefaultMutableTreeNode childNode = new DefaultMutableTreeNode("Empty"); DefaultTreeModel tm= (DefaultTreeModel) view.getModel(); tm.insertNodeInto(childNode, root, root.getChildCount()); } else { ViewerSorter sorter = new ViewerSorter(nodes); List list = sorter.sort(); Iterator i = list.iterator(); while (i.hasNext()) buildTreeNode((ImageDisplay) i.next()); } }
3,231,107
protected DataLoader createHierarchyLoader() { return new ImagesLoader(component, imagesID); }
protected DataLoader createHierarchyLoader(boolean refresh) { return new ImagesLoader(component, imagesID); }
3,231,108
protected DataLoader createHierarchyLoader() { return new ImagesLoader(component, imagesID); }
protected DataLoader createHierarchyLoader() { return new ImagesLoader(component, imagesID, refresh); }
3,231,109
public static void main(String args[]) { //@START int i, n = Integer.parseInt(args[0]); int x[] = new int[n]; int y[] = new int[n]; for (i = 0; i < n;) { x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; } for (i = n-1; i >= 0;) { y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; } System.out.println(y[n-1]); //@END }
public static void main(String args[]) { //@START int i, n = Integer.parseInt(args[0]); int x[] = new int[n]; int y[] = new int[n]; for (i = 0; i < n;) { x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; x[i] = i; ++i; } for (i = n-1; i >= 0;) { y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; y[i] = x[i]; --i; } System.out.println(y[n-1]); //@END }
3,231,111
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) return (Block) builder.getArg(IF_BLOCK, bc); elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount; if (cMacro) ++nConditions; conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; }
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) { return (Block) builder.getArg(IF_BLOCK, bc); elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount; if (cMacro) ++nConditions; conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; }
3,231,112
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) return (Block) builder.getArg(IF_BLOCK, bc); elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount; if (cMacro) ++nConditions; conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; }
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) return (Block) builder.getArg(IF_BLOCK, bc); elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount; if (cMacro) ++nConditions; conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; }
3,231,113
private IRubyObject substr(int beg, int len) { int length = getValue().length(); if (len < 0 || beg > length) { return getRuntime().getNil(); } if (beg < 0) { beg += length; if (beg < 0) { return getRuntime().getNil(); } } int end = Math.min(length, beg + len); return newString(getMutableValue().substring(beg, end)).infectBy(this); }
private IRubyObject substr(int beg, int len) { int length = getValue().length(); if (len < 0 || beg > length) { return getRuntime().getNil(); } if (beg < 0) { beg += length; if (beg < 0) { return getRuntime().getNil(); } } int end = Math.min(length, beg + len); return newString(getMutableValue().substring(beg, end)).infectBy(this); }
3,231,114
private void process() { if (limit == 1) { result.add(splitee); return; } int pos = 0; int beg = 0; int hits = 0; int len = splitee.length(); RubyString rubySplitee = runtime.newString(splitee); while ((beg = pattern.search(rubySplitee, pos)) > -1) { hits++; RubyMatchData matchData = (RubyMatchData) runtime.getBackref(); int end = matchData.matchEndPosition(); // Whitespace splits are supposed to ignore leading whitespace if (beg != 0 || !isWhitespace) { addResult(substring(splitee, pos, (beg == pos && end == beg) ? 1 : beg - pos)); // Add to list any /(.)/ matched. long extraPatterns = matchData.getSize(); for (int i = 1; i < extraPatterns; i++) { addResult(((RubyString) matchData.group(i)).getValue()); } } pos = (end == beg) ? beg + 1 : end; if (hits + 1 == limit) { break; } } if (hits == 0) { addResult(splitee); } else if (pos <= len) { addResult(substring(splitee, pos, len - pos)); } if (limit == 0) { while (((String) result.get(result.size() - 1)).length() == 0) { result.remove(result.size() - 1); } } }
private void process() { if (limit == 1) { result.add(splitee); return; } int pos = 0; int beg = 0; int hits = 0; int len = splitee.length(); RubyString rubySplitee = runtime.newString(splitee); while ((beg = pattern.search(rubySplitee, pos)) > -1) { hits++; RubyMatchData matchData = (RubyMatchData) runtime.getBackref(); int end = matchData.matchEndPosition(); // Whitespace splits are supposed to ignore leading whitespace if (beg != 0 || !isWhitespace) { addResult(substring(splitee, pos, (beg == pos && end == beg) ? 1 : beg - pos)); // Add to list any /(.)/ matched. long extraPatterns = matchData.getSize(); for (int i = 1; i < extraPatterns; i++) { addResult(((RubyString) matchData.group(i)).getValue()); } } pos = (end == beg) ? beg + 1 : end; if (hits + 1 == limit) { break; } } if (hits == 0) { addResult(splitee); } else if (pos <= len) { addResult(substring(splitee, pos, len - pos)); } if (limit == 0) { while (((String) result.get(result.size() - 1)).length() == 0) { result.remove(result.size() - 1); } } }
3,231,115
public void initialize() throws IllegalServiceStateException, UnsatisfiedConditionsException, Exception { // if we are not restartable, we need to start immediately, otherwise we are not going to register this service if (!serviceFactory.isRestartable()) { try { start(false, StartStrategies.UNREGISTER); } catch (UnregisterServiceException e) { Throwable cause = e.getCause(); if (cause instanceof Exception) { throw (Exception) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new AssertionError(cause); } } // a non restartable service uses a special stop conditions object that picks up stop conditions as they // are added. When the stop() method is called on a non-restartable service all of the stop conditions // registered with the service factory are initialized (if not already initialized), and the isSatisfied // method is called. This should cause the stop logic of a stop condition to fire. lock("initialize"); try { stopConditions = new NonRestartableStopConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock, serviceFactory); } finally { unlock(); } } // cool we are registered serviceMonitor.serviceRegistered(createServiceEvent()); // if we are not restartable, we need to notify everyone we just started if (!serviceFactory.isRestartable()) { serviceMonitor.serviceRunning(createServiceEvent()); } }
public void initialize() throws IllegalServiceStateException, UnsatisfiedConditionsException, Exception { // if we are not restartable, we need to start immediately, otherwise we are not going to register this service if (!serviceFactory.isRestartable()) { try { start(false, StartStrategies.UNREGISTER); } catch (UnregisterServiceException e) { Throwable cause = e.getCause(); if (cause instanceof Exception) { throw (Exception) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new AssertionError(cause); } } // a non restartable service uses a special stop conditions object that picks up stop conditions as they // are added. When the stop() method is called on a non-restartable service all of the stop conditions // registered with the service factory are initialized (if not already initialized), and the isSatisfied // method is called. This should cause the stop logic of a stop condition to fire. lock("initialize"); try { stopConditions = new NonRestartableStopConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock, serviceFactory); } finally { unlock(); } } // cool we are registered serviceMonitor.serviceRegistered(createServiceEvent()); // if we are not restartable, we need to notify everyone we just started if (!serviceFactory.isRestartable()) { serviceMonitor.serviceRunning(createServiceEvent()); } }
3,231,117
public void destroy() throws KernelErrorsError { // we gather all errors that occur during shutdown and throw them as on huge exception List errors = new ArrayList(); List managerFutures; synchronized (serviceManagers) { managerFutures = new ArrayList(); serviceManagers.clear(); } List managers = new ArrayList(managerFutures.size()); for (Iterator iterator = managerFutures.iterator(); iterator.hasNext();) { Future future = (Future) iterator.next(); try { managers.add(future.get()); } catch (InterruptedException e) { // ignore -- this should not happen errors.add(new AssertionError(e)); } catch (ExecutionException e) { // good -- one less manager to deal with } } // Be nice and try to stop asynchronously errors.addAll(stopAll(managers, StopStrategies.ASYNCHRONOUS)); // Be really nice and try to stop asynchronously again errors.addAll(stopAll(managers, StopStrategies.ASYNCHRONOUS)); // We have been nice enough now nuke them errors.addAll(stopAll(managers, StopStrategies.FORCE)); // All managers are gaurenteed to be destroyed now for (Iterator iterator = managers.iterator(); iterator.hasNext();) { ServiceManager serviceManager = (ServiceManager) iterator.next(); try { serviceManager.destroy(StopStrategies.FORCE); } catch (UnsatisfiedConditionsException e) { // this should not happen, because we force stopped errors.add(new AssertionError(e)); } catch (IllegalServiceStateException e) { // this should not happen, because we force stopped errors.add(new AssertionError(e)); } catch (RuntimeException e) { errors.add(new AssertionError(e)); } catch (Error e) { errors.add(new AssertionError(e)); } } if (!errors.isEmpty()) { throw new KernelErrorsError(errors); } }
public void destroy() throws KernelErrorsError { // we gather all errors that occur during shutdown and throw them as on huge exception List errors = new ArrayList(); List managerFutures; synchronized (serviceManagers) { managerFutures = new ArrayList(serviceManagers.values()); serviceManagers.clear(); } List managers = new ArrayList(managerFutures.size()); for (Iterator iterator = managerFutures.iterator(); iterator.hasNext();) { Future future = (Future) iterator.next(); try { managers.add(future.get()); } catch (InterruptedException e) { // ignore -- this should not happen errors.add(new AssertionError(e)); } catch (ExecutionException e) { // good -- one less manager to deal with } } // Be nice and try to stop asynchronously errors.addAll(stopAll(managers, StopStrategies.ASYNCHRONOUS)); // Be really nice and try to stop asynchronously again errors.addAll(stopAll(managers, StopStrategies.ASYNCHRONOUS)); // We have been nice enough now nuke them errors.addAll(stopAll(managers, StopStrategies.FORCE)); // All managers are gaurenteed to be destroyed now for (Iterator iterator = managers.iterator(); iterator.hasNext();) { ServiceManager serviceManager = (ServiceManager) iterator.next(); try { serviceManager.destroy(StopStrategies.FORCE); } catch (UnsatisfiedConditionsException e) { // this should not happen, because we force stopped errors.add(new AssertionError(e)); } catch (IllegalServiceStateException e) { // this should not happen, because we force stopped errors.add(new AssertionError(e)); } catch (RuntimeException e) { errors.add(new AssertionError(e)); } catch (Error e) { errors.add(new AssertionError(e)); } } if (!errors.isEmpty()) { throw new KernelErrorsError(errors); } }
3,231,119
public GetMethodBodyResult getMethodBody(RubyId id, int noex) { GetMethodBodyResult result = new GetMethodBodyResult(this, id, noex); MethodNode methodNode = searchMethod(id); if (methodNode == null || methodNode.getBodyNode() == null) { System.out.println( "Cant find method \"" + id.toName() + "\" in class " + toName()); RubyMethodCacheEntry.saveEmptyEntry(getRuby(), this, id); return result; } RubyMethodCacheEntry ent = new RubyMethodCacheEntry(this, methodNode.getNoex()); Node body = methodNode.getBodyNode(); if (body instanceof FBodyNode) { FBodyNode fbody = (FBodyNode) body; ent.setMid(id); ent.setOrigin((RubyModule) fbody.getOrigin()); ent.setMid0(fbody.getMId()); ent.setMethod(fbody.getBodyNode()); result.setRecvClass((RubyModule) fbody.getOrigin()); result.setId(fbody.getMId()); body = fbody.getBodyNode(); } else { ent.setMid(id); ent.setMid0(id); ent.setOrigin(methodNode.getMethodOrigin()); ent.setMethod(body); result.setRecvClass(methodNode.getMethodOrigin()); } RubyMethodCacheEntry.saveEntry(getRuby(), this, id, ent); result.setNoex(ent.getNoex()); result.setBody(body); return result; }
public GetMethodBodyResult getMethodBody(RubyId id, int noex) { GetMethodBodyResult result = new GetMethodBodyResult(this, id, noex); MethodNode methodNode = searchMethod(id); if (methodNode == null || methodNode.getBodyNode() == null) { System.out.println( "Cant find method \"" + id.toName() + "\" in class " + toName()); RubyMethodCacheEntry.saveEmptyEntry(getRuby(), this, id); return result; } RubyMethodCacheEntry ent = new RubyMethodCacheEntry(this, methodNode.getNoex()); Node body = methodNode.getBodyNode(); if (body instanceof FBodyNode) { FBodyNode fbody = (FBodyNode) body; ent.setMid(id); ent.setOrigin((RubyModule) fbody.getOrigin()); ent.setMid0(fbody.getMId()); ent.setMethod(fbody.getBodyNode()); result.setRecvClass((RubyModule) fbody.getOrigin()); result.setId(fbody.getMId()); body = fbody.getBodyNode(); } else { ent.setMid(id); ent.setMid0(id); ent.setOrigin(methodNode.getMethodOrigin()); ent.setMethod(body); result.setRecvClass(methodNode.getMethodOrigin()); } RubyMethodCacheEntry.saveEntry(getRuby(), this, id, ent); result.setNoex(ent.getNoex()); result.setBody(body); return result; }
3,231,121
public GetMethodBodyResult getMethodBody(RubyId id, int noex) { GetMethodBodyResult result = new GetMethodBodyResult(this, id, noex); MethodNode methodNode = searchMethod(id); if (methodNode == null || methodNode.getBodyNode() == null) { System.out.println( "Cant find method \"" + id.toName() + "\" in class " + toName()); RubyMethodCacheEntry.saveEmptyEntry(getRuby(), this, id); return result; } RubyMethodCacheEntry ent = new RubyMethodCacheEntry(this, methodNode.getNoex()); Node body = methodNode.getBodyNode(); if (body instanceof FBodyNode) { FBodyNode fbody = (FBodyNode) body; ent.setMid(id); ent.setOrigin((RubyModule) fbody.getOrigin()); ent.setMid0(fbody.getMId()); ent.setMethod(fbody.getBodyNode()); result.setRecvClass((RubyModule) fbody.getOrigin()); result.setId(fbody.getMId()); body = fbody.getBodyNode(); } else { ent.setMid(id); ent.setMid0(id); ent.setOrigin(methodNode.getMethodOrigin()); ent.setMethod(body); result.setRecvClass(methodNode.getMethodOrigin()); } RubyMethodCacheEntry.saveEntry(getRuby(), this, id, ent); result.setNoex(ent.getNoex()); result.setBody(body); return result; }
public GetMethodBodyResult getMethodBody(RubyId id, int noex) { GetMethodBodyResult result = new GetMethodBodyResult(this, id, noex); MethodNode methodNode = searchMethod(id); if (methodNode == null || methodNode.getBodyNode() == null) { System.out.println( "Cant find method \"" + id.toName() + "\" in class " + toName()); RubyMethodCacheEntry.saveEmptyEntry(getRuby(), this, id); return result; } RubyMethodCacheEntry ent = new RubyMethodCacheEntry(this, methodNode.getNoex()); Node body = methodNode.getBodyNode(); if (body instanceof FBodyNode) { FBodyNode fbody = (FBodyNode) body; ent.setMid(id); ent.setOrigin((RubyModule) fbody.getOrigin()); ent.setMid0(fbody.getMId()); ent.setMethod(fbody.getBodyNode()); result.setRecvClass((RubyModule) fbody.getOrigin()); result.setId(fbody.getMId()); body = fbody.getBodyNode(); } else { ent.setMid(id); ent.setMid0(id); ent.setOrigin(methodNode.getMethodOrigin()); ent.setMethod(body); result.setRecvClass(methodNode.getMethodOrigin()); } RubyMethodCacheEntry.saveEntry(getRuby(), this, id, ent); result.setNoex(ent.getNoex()); result.setBody(body); return result; }
3,231,122
public void selfConfigure() { this.ctx = OmeroContext.getInternalServerContext(); this.ctx.applyBeanPropertyValues(this,getName()); }
public void selfConfigure() { this.ctx = OmeroContext.getInternalServerContext(); this.ctx.applyBeanPropertyValues(this,getServiceInterface()); }
3,231,123
public void setQueryFactory(QueryFactory factory){ this.queryFactory = factory; }
public void setQueryFactory(QueryFactory factory) { this.queryFactory = factory; }
3,231,124
public RubyArray gethostbyname(IRubyObject hostname) { try { RubyString name = (RubyString) hostname; InetAddress inetAddress = InetAddress.getByName(name.getValue()); List parts = new ArrayList(); parts.add(new RubyString(getRuntime(), inetAddress.getCanonicalHostName())); parts.add(RubyArray.newArray(getRuntime())); parts.add(new RubyFixnum(getRuntime(),2)); parts.add(new RubyString(getRuntime(), RubyString.bytesToString(inetAddress.getAddress()))); return RubyArray.newArray(getRuntime(), parts); } catch (UnknownHostException e) { // DSC throw SystemError("gethostbyname"); return RubyArray.newArray(getRuntime()); } }
public RubyArray gethostbyname(IRubyObject hostname) { try { RubyString name = (RubyString) hostname; InetAddress inetAddress = InetAddress.getByName(name.getValue()); List parts = new ArrayList(); parts.add(new RubyString(getRuntime(), inetAddress.getCanonicalHostName())); parts.add(RubyArray.newArray(getRuntime())); parts.add(new RubyFixnum(getRuntime(),2)); parts.add(new RubyString(getRuntime(), RubyString.bytesToString(inetAddress.getAddress()))); return RubyArray.newArray(getRuntime(), parts); } catch (UnknownHostException e) { // DSC throw SystemError("gethostbyname"); return RubyArray.newArray(getRuntime()); } }
3,231,125
public RubyArray gethostbyname(IRubyObject hostname) { try { RubyString name = (RubyString) hostname; InetAddress inetAddress = InetAddress.getByName(name.getValue()); List parts = new ArrayList(); parts.add(new RubyString(getRuntime(), inetAddress.getCanonicalHostName())); parts.add(RubyArray.newArray(getRuntime())); parts.add(new RubyFixnum(getRuntime(),2)); parts.add(new RubyString(getRuntime(), RubyString.bytesToString(inetAddress.getAddress()))); return RubyArray.newArray(getRuntime(), parts); } catch (UnknownHostException e) { // DSC throw SystemError("gethostbyname"); return RubyArray.newArray(getRuntime()); } }
public RubyArray gethostbyname(IRubyObject hostname) { try { RubyString name = (RubyString) hostname; InetAddress inetAddress = InetAddress.getByName(name.getValue()); List parts = new ArrayList(); parts.add(new RubyString(getRuntime(), inetAddress.getCanonicalHostName())); parts.add(RubyArray.newArray(getRuntime())); parts.add(new RubyFixnum(getRuntime(),2)); parts.add(new RubyString(getRuntime(), RubyString.bytesToString(inetAddress.getAddress()))); return RubyArray.newArray(getRuntime(), parts); } catch (UnknownHostException e) { // DSC throw SystemError("gethostbyname"); return RubyArray.newArray(getRuntime()); } }
3,231,126
public RubyArray gethostbyname(IRubyObject hostname) { try { RubyString name = (RubyString) hostname; InetAddress inetAddress = InetAddress.getByName(name.getValue()); List parts = new ArrayList(); parts.add(new RubyString(getRuntime(), inetAddress.getCanonicalHostName())); parts.add(RubyArray.newArray(getRuntime())); parts.add(new RubyFixnum(getRuntime(),2)); parts.add(new RubyString(getRuntime(), RubyString.bytesToString(inetAddress.getAddress()))); return RubyArray.newArray(getRuntime(), parts); } catch (UnknownHostException e) { // DSC throw SystemError("gethostbyname"); return RubyArray.newArray(getRuntime()); } }
public RubyArray gethostbyname(IRubyObject hostname) { try { RubyString name = (RubyString) hostname; InetAddress inetAddress = InetAddress.getByName(name.getValue()); List parts = new ArrayList(); parts.add(new RubyString(getRuntime(), inetAddress.getCanonicalHostName())); parts.add(RubyArray.newArray(getRuntime())); parts.add(new RubyFixnum(getRuntime(),2)); parts.add(new RubyString(getRuntime(), RubyString.bytesToString(inetAddress.getAddress()))); return RubyArray.newArray(getRuntime(), parts); } catch (UnknownHostException e) { // DSC throw SystemError("gethostbyname"); return RubyArray.newArray(getRuntime()); } }
3,231,127
public RubyString gethostname() { try { String hostName = InetAddress.getLocalHost().getHostName(); return new RubyString(getRuntime(), hostName); } catch (UnknownHostException e) { // DSC throw SystemError("gethostname"); return new RubyString(getRuntime(), ""); } }
public RubyString gethostname() { try { String hostName = InetAddress.getLocalHost().getHostName(); return new RubyString(getRuntime(), hostName); } catch (UnknownHostException e) { // DSC throw SystemError("gethostname"); return new RubyString(getRuntime(), ""); } }
3,231,128
public RubyString gethostname() { try { String hostName = InetAddress.getLocalHost().getHostName(); return new RubyString(getRuntime(), hostName); } catch (UnknownHostException e) { // DSC throw SystemError("gethostname"); return new RubyString(getRuntime(), ""); } }
public RubyString gethostname() { try { String hostName = InetAddress.getLocalHost().getHostName(); return new RubyString(getRuntime(), hostName); } catch (UnknownHostException e) { // DSC throw SystemError("gethostname"); return new RubyString(getRuntime(), ""); } }
3,231,129
public void valueChanged(TreeSelectionEvent e) { // If this change is occurring because a if (lockTreeChange == true) return; ModuleTreeNode node = (ModuleTreeNode) tree.getLastSelectedPathComponent(); if (node == null) return; if (lastModule != null) { moduleCanvas.unhighlightModules(lastModule); } if (node.isLeaf()) { // it's a module lastModule = (ChainModuleData) node.getObject(); moduleCanvas.highlightModule(lastModule); } else if (node.getObject() instanceof ModuleCategoryData) { lastModule = null; ModuleCategoryData mc = (ModuleCategoryData) node.getObject(); moduleCanvas.highlightCategory(mc); } // clicked on uncategorized else if (node.getName() != null && node.getName().compareTo(ModuleTreeNode.UNCAT_NAME) ==0) moduleCanvas.highlightCategory(null); else moduleCanvas.unhighlightModules(); }
public void valueChanged(TreeSelectionEvent e) { // If this change is occurring because a if (lockTreeChange == true) return; ModuleTreeNode node = (ModuleTreeNode) tree.getLastSelectedPathComponent(); if (node == null) return; if (lastModule != null) { moduleCanvas.unhighlightModules(lastModule); } if (node.isLeaf()) { // it's a module lastModule = (ChainModuleData) node.getObject(); moduleCanvas.highlightModule(lastModule); } else if (node.getObject() instanceof ModuleCategoryData) { lastModule = null; ModuleCategoryData mc = (ModuleCategoryData) node.getObject(); moduleCanvas.highlightCategory(mc); } // clicked on uncategorized else if (node.getName() != null && node.getName().compareTo(ModuleTreeNode.UNCAT_NAME) ==0) moduleCanvas.highlightCategory(null); else moduleCanvas.unhighlightModules(); }
3,231,131
public RubyString m_inspect() { // if (TYPE(obj) == T_OBJECT // && ROBJECT(obj)->iv_tbl // && ROBJECT(obj)->iv_tbl->num_entries > 0) { // VALUE str; // char *c; // // c = rb_class2name(CLASS_OF(obj)); // if (rb_inspecting_p(obj)) { // str = rb_str_new(0, strlen(c)+10+16+1); /* 10:tags 16:addr 1:eos */ // sprintf(RSTRING(str)->ptr, "#<%s:0x%lx ...>", c, obj); // RSTRING(str)->len = strlen(RSTRING(str)->ptr); // return str; // } // str = rb_str_new(0, strlen(c)+6+16+1); /* 6:tags 16:addr 1:eos */ // sprintf(RSTRING(str)->ptr, "-<%s:0x%lx ", c, obj); // RSTRING(str)->len = strlen(RSTRING(str)->ptr); // return rb_protect_inspect(inspect_obj, obj, str); // } // return rb_funcall(obj, rb_intern("to_s"), 0, 0); // } //return (RubyString)invokeMethod(getRuby().intern("to_s"), null, null); return null; }
public RubyString m_inspect() { // if (TYPE(obj) == T_OBJECT // && ROBJECT(obj)->iv_tbl // && ROBJECT(obj)->iv_tbl->num_entries > 0) { // VALUE str; // char *c; // // c = rb_class2name(CLASS_OF(obj)); // if (rb_inspecting_p(obj)) { // str = rb_str_new(0, strlen(c)+10+16+1); /* 10:tags 16:addr 1:eos */ // sprintf(RSTRING(str)->ptr, "#<%s:0x%lx ...>", c, obj); // RSTRING(str)->len = strlen(RSTRING(str)->ptr); // return str; // } // str = rb_str_new(0, strlen(c)+6+16+1); /* 6:tags 16:addr 1:eos */ // sprintf(RSTRING(str)->ptr, "-<%s:0x%lx ", c, obj); // RSTRING(str)->len = strlen(RSTRING(str)->ptr); // return rb_protect_inspect(inspect_obj, obj, str); // } // return rb_funcall(obj, rb_intern("to_s"), 0, 0); // } //return (RubyString)invokeMethod(getRuby().intern("to_s"), null, null); return (RubyString)funcall(getRuby().intern("to_s")); }
3,231,132
public void initialize() { contactList = SparkManager.getWorkspace().getContactList(); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F6"), "viewNotes"); contactList.getActionMap().put("viewNotes", new AbstractAction("viewNotes") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. retrieveNotes(); } }); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F5"), "viewTasks"); contactList.getActionMap().put("viewTasks", new AbstractAction("viewTasks") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. showTaskList(); } }); }
public void initialize() { contactList = SparkManager.getWorkspace().getContactList(); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control F6"), "viewNotes"); contactList.getActionMap().put("viewNotes", new AbstractAction("viewNotes") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. retrieveNotes(); } }); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F5"), "viewTasks"); contactList.getActionMap().put("viewTasks", new AbstractAction("viewTasks") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. showTaskList(); } }); }
3,231,133
public void initialize() { contactList = SparkManager.getWorkspace().getContactList(); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F6"), "viewNotes"); contactList.getActionMap().put("viewNotes", new AbstractAction("viewNotes") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. retrieveNotes(); } }); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F5"), "viewTasks"); contactList.getActionMap().put("viewTasks", new AbstractAction("viewTasks") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. showTaskList(); } }); }
public void initialize() { contactList = SparkManager.getWorkspace().getContactList(); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F6"), "viewNotes"); contactList.getActionMap().put("viewNotes", new AbstractAction("viewNotes") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. retrieveNotes(); } }); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control F5"), "viewTasks"); contactList.getActionMap().put("viewTasks", new AbstractAction("viewTasks") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. showTaskList(); } }); }
3,231,134
void login(String userName, String password) throws DSOutOfServiceException { try { RemoteCaller proxy = proxiesFactory.getRemoteCaller(); proxy.login(userName, password); serverVersionCheck(); connected = true; } catch (RemoteConnectionException rce) { connected = false; throw new DSOutOfServiceException("Can't connect to OMEDS.", rce); } catch (RemoteAuthenticationException rae) { connected = false; throw new DSOutOfServiceException("Failed to log in.", rae); } }
void login(String userName, String password) throws DSOutOfServiceException { try { RemoteCaller proxy = proxiesFactory.getRemoteCaller(); proxy.login(userName, password); serverVersionCheck(); connected = true; } catch (RemoteServerErrorException iae) { connected = false; throw new DSOutOfServiceException("Failed to log in.", iae); } catch (RemoteConnectionException rce) { connected = false; throw new DSOutOfServiceException("Can't connect to OMEDS.", rce); } catch (RemoteServerErrorException iae) { connected = false; throw new DSOutOfServiceException("Failed to log in.", iae); } catch (RemoteAuthenticationException rae) { connected = false; throw new DSOutOfServiceException("Failed to log in.", rae); } }
3,231,136
public static Object[] fillICGHierarchy(List classifications, Map mapIS, int userID) { Object[] results = new Object[2]; Iterator i = classifications.iterator(); //OME-JAVA object. Classification classification; Category category; CategoryGroup group; //Shoola object. ClassificationData cData; CategoryData cModel; CategoryGroupData gModel; ImageSummary is; Map categoryMap = new HashMap(), groupMap = new HashMap(), classificationsMap; float f; Integer categoryID, groupID; Collection unclassifiedImages = mapIS.values(); List classifiedImages = new ArrayList(); List categoriesList; while (i.hasNext()) { classification = (Classification) i.next(); if (userID != classification.getModuleExecution().getExperimenter().getID()) break; f = CategoryMapper.CONFIDENCE; if (classification.getConfidence() != null) f = classification.getConfidence().floatValue(); is = (ImageSummary) mapIS.get( new Integer(classification.getImage().getID())); if (!classifiedImages.contains(is)) classifiedImages.add(is); cData = new ClassificationData(classification.getID(), f); category = classification.getCategory(); group = category.getCategoryGroup(); groupID = new Integer(group.getID()); gModel = (CategoryGroupData) groupMap.get(groupID); //Create CategoryGroupData if (gModel == null) { gModel = CategoryMapper.buildCategoryGroup(group); gModel.setCategories(new ArrayList()); groupMap.put(groupID, gModel); } categoryID = new Integer(category.getID()); cModel = (CategoryData) categoryMap.get(categoryID); //Create CategoryData if (cModel == null) { cModel = CategoryMapper.buildCategoryData(category, gModel); cModel.setClassifications(new HashMap()); categoryMap.put(categoryID, cModel); gModel.getCategories(); } categoriesList = gModel.getCategories(); if (!categoriesList.contains(cModel)) categoriesList.add(cModel); classificationsMap = cModel.getClassifications(); classificationsMap.put(is.copyObject(), cData); } unclassifiedImages.removeAll(classifiedImages); results[0] = unclassifiedImages; results[1] = groupMap.values(); return results; }
public static Object[] fillICGHierarchy(List classifications, Map mapIS, int userID) { Object[] results = new Object[2]; Iterator i = classifications.iterator(); //OME-JAVA object. Classification classification; Category category; CategoryGroup group; //Shoola object. ClassificationData cData; CategoryData cModel; CategoryGroupData gModel; ImageSummary is; Map categoryMap = new HashMap(), groupMap = new HashMap(), classificationsMap; float f; Integer categoryID, groupID; Collection unclassifiedImages = mapIS.values(); List classifiedImages = new ArrayList(); List categoriesList; while (i.hasNext()) { classification = (Classification) i.next(); if (userID != classification.getModuleExecution().getExperimenter().getID()) break; f = CategoryMapper.CONFIDENCE; if (classification.getConfidence() != null) f = classification.getConfidence().floatValue(); is = (ImageSummary) mapIS.get( new Integer(classification.getImage().getID())); if (!classifiedImages.contains(is)) classifiedImages.add(is); cData = new ClassificationData(classification.getID(), f); category = classification.getCategory(); group = category.getCategoryGroup(); groupID = new Integer(group.getID()); gModel = (CategoryGroupData) groupMap.get(groupID); //Create CategoryGroupData if (gModel == null) { gModel = CategoryMapper.buildCategoryGroup(group); gModel.setCategories(new ArrayList()); groupMap.put(groupID, gModel); } categoryID = new Integer(category.getID()); cModel = (CategoryData) categoryMap.get(categoryID); //Create CategoryData if (cModel == null) { cModel = CategoryMapper.buildCategoryData(category, gModel); cModel.setClassifications(new HashMap()); categoryMap.put(categoryID, cModel); gModel.getCategories(); } categoriesList = gModel.getCategories(); if (!categoriesList.contains(cModel)) categoriesList.add(cModel); classificationsMap = cModel.getClassifications(); classificationsMap.put(is.copyObject(), cData); } unclassifiedImages.removeAll(classifiedImages); results[0] = unclassifiedImages; results[1] = groupMap.values(); return results; }
3,231,137
public static Object[] fillICGHierarchy(List classifications, Map mapIS, int userID) { Object[] results = new Object[2]; Iterator i = classifications.iterator(); //OME-JAVA object. Classification classification; Category category; CategoryGroup group; //Shoola object. ClassificationData cData; CategoryData cModel; CategoryGroupData gModel; ImageSummary is; Map categoryMap = new HashMap(), groupMap = new HashMap(), classificationsMap; float f; Integer categoryID, groupID; Collection unclassifiedImages = mapIS.values(); List classifiedImages = new ArrayList(); List categoriesList; while (i.hasNext()) { classification = (Classification) i.next(); if (userID != classification.getModuleExecution().getExperimenter().getID()) break; f = CategoryMapper.CONFIDENCE; if (classification.getConfidence() != null) f = classification.getConfidence().floatValue(); is = (ImageSummary) mapIS.get( new Integer(classification.getImage().getID())); if (!classifiedImages.contains(is)) classifiedImages.add(is); cData = new ClassificationData(classification.getID(), f); category = classification.getCategory(); group = category.getCategoryGroup(); groupID = new Integer(group.getID()); gModel = (CategoryGroupData) groupMap.get(groupID); //Create CategoryGroupData if (gModel == null) { gModel = CategoryMapper.buildCategoryGroup(group); gModel.setCategories(new ArrayList()); groupMap.put(groupID, gModel); } categoryID = new Integer(category.getID()); cModel = (CategoryData) categoryMap.get(categoryID); //Create CategoryData if (cModel == null) { cModel = CategoryMapper.buildCategoryData(category, gModel); cModel.setClassifications(new HashMap()); categoryMap.put(categoryID, cModel); gModel.getCategories(); } categoriesList = gModel.getCategories(); if (!categoriesList.contains(cModel)) categoriesList.add(cModel); classificationsMap = cModel.getClassifications(); classificationsMap.put(is.copyObject(), cData); } unclassifiedImages.removeAll(classifiedImages); results[0] = unclassifiedImages; results[1] = groupMap.values(); return results; }
public static Object[] fillICGHierarchy(List classifications, Map mapIS, int userID) { Object[] results = new Object[2]; Iterator i = classifications.iterator(); //OME-JAVA object. Classification classification; Category category; CategoryGroup group; //Shoola object. ClassificationData cData; CategoryData cModel; CategoryGroupData gModel; ImageSummary is; Map categoryMap = new HashMap(), groupMap = new HashMap(), classificationsMap; float f; Integer categoryID, groupID; Collection unclassifiedImages = mapIS.values(); List classifiedImages = new ArrayList(); List categoriesList; while (i.hasNext()) { classification = (Classification) i.next(); if (userID != classification.getModuleExecution().getExperimenter().getID()) break; f = CategoryMapper.CONFIDENCE; if (classification.getConfidence() != null) f = classification.getConfidence().floatValue(); is = (ImageSummary) mapIS.get( new Integer(classification.getImage().getID())); if (!classifiedImages.contains(is)) classifiedImages.add(is); cData = new ClassificationData(classification.getID(), f); category = classification.getCategory(); group = category.getCategoryGroup(); groupID = new Integer(group.getID()); gModel = (CategoryGroupData) groupMap.get(groupID); //Create CategoryGroupData if (gModel == null) { gModel = CategoryMapper.buildCategoryGroup(group); gModel.setCategories(new ArrayList()); groupMap.put(groupID, gModel); } categoryID = new Integer(category.getID()); cModel = (CategoryData) categoryMap.get(categoryID); //Create CategoryData if (cModel == null) { cModel = CategoryMapper.buildCategoryData(category, gModel); cModel.setClassifications(new HashMap()); categoryMap.put(categoryID, cModel); gModel.getCategories(); } categoriesList = gModel.getCategories(); if (!categoriesList.contains(cModel)) categoriesList.add(cModel); classificationsMap = cModel.getClassifications(); classificationsMap.put(is.copyObject(), cData); } unclassifiedImages.removeAll(classifiedImages); results[0] = unclassifiedImages; results[1] = groupMap.values(); return results; }
3,231,138
public static Object[] fillICGHierarchy(List classifications, Map mapIS, int userID) { Object[] results = new Object[2]; Iterator i = classifications.iterator(); //OME-JAVA object. Classification classification; Category category; CategoryGroup group; //Shoola object. ClassificationData cData; CategoryData cModel; CategoryGroupData gModel; ImageSummary is; Map categoryMap = new HashMap(), groupMap = new HashMap(), classificationsMap; float f; Integer categoryID, groupID; Collection unclassifiedImages = mapIS.values(); List classifiedImages = new ArrayList(); List categoriesList; while (i.hasNext()) { classification = (Classification) i.next(); if (userID != classification.getModuleExecution().getExperimenter().getID()) break; f = CategoryMapper.CONFIDENCE; if (classification.getConfidence() != null) f = classification.getConfidence().floatValue(); is = (ImageSummary) mapIS.get( new Integer(classification.getImage().getID())); if (!classifiedImages.contains(is)) classifiedImages.add(is); cData = new ClassificationData(classification.getID(), f); category = classification.getCategory(); group = category.getCategoryGroup(); groupID = new Integer(group.getID()); gModel = (CategoryGroupData) groupMap.get(groupID); //Create CategoryGroupData if (gModel == null) { gModel = CategoryMapper.buildCategoryGroup(group); gModel.setCategories(new ArrayList()); groupMap.put(groupID, gModel); } categoryID = new Integer(category.getID()); cModel = (CategoryData) categoryMap.get(categoryID); //Create CategoryData if (cModel == null) { cModel = CategoryMapper.buildCategoryData(category, gModel); cModel.setClassifications(new HashMap()); categoryMap.put(categoryID, cModel); gModel.getCategories(); } categoriesList = gModel.getCategories(); if (!categoriesList.contains(cModel)) categoriesList.add(cModel); classificationsMap = cModel.getClassifications(); classificationsMap.put(is.copyObject(), cData); } unclassifiedImages.removeAll(classifiedImages); results[0] = unclassifiedImages; results[1] = groupMap.values(); return results; }
publicstaticObject[]fillICGHierarchy(Listclassifications,MapmapIS,intuserID){Object[]results=newObject[2];Iteratori=classifications.iterator();//OME-JAVAobject.Classificationclassification;Categorycategory;CategoryGroupgroup;//Shoolaobject.ClassificationDatacData;CategoryDatacModel;CategoryGroupDatagModel;ImageSummaryis;MapcategoryMap=newHashMap(),groupMap=newHashMap(),classificationsMap;floatf;IntegercategoryID,groupID;CollectionunclassifiedImages=mapIS.values();ListclassifiedImages=newArrayList();ListcategoriesList;while(i.hasNext()){classification=(Classification)i.next();if(userID!=classification.getModuleExecution().getExperimenter().getID())break;f=CategoryMapper.CONFIDENCE;if(classification.getConfidence()!=null)f=classification.getConfidence().floatValue();is=(ImageSummary)mapIS.get(newInteger(classification.getImage().getID()));if(!classifiedImages.contains(is))classifiedImages.add(is);cData=newClassificationData(classification.getID(),f);category=classification.getCategory();group=category.getCategoryGroup();groupID=newInteger(group.getID());gModel=(CategoryGroupData)groupMap.get(groupID);//CreateCategoryGroupDataif(gModel==null){gModel=CategoryMapper.buildCategoryGroup(group);gModel.setCategories(newArrayList());groupMap.put(groupID,gModel);}categoryID=newInteger(category.getID());cModel=(CategoryData)categoryMap.get(categoryID);//CreateCategoryDataif(cModel==null){cModel=CategoryMapper.buildCategoryData(category,gModel);cModel.setClassifications(newHashMap());categoryMap.put(categoryID,cModel);gModel.getCategories();}categoriesList=gModel.getCategories();if(!categoriesList.contains(cModel))categoriesList.add(cModel);classificationsMap=cModel.getClassifications();classificationsMap.put(is.copyObject(),cData);}unclassifiedImages.removeAll(classifiedImages);results[0]=unclassifiedImages;results[1]=groupMap.values();returnresults;}
3,231,139
public ScriptTest(Ruby ruby, String filename) { super(filename); this.ruby = ruby; this.filename = filename; this.script = new File(TEST_DIR + File.separator + filename); }
public ScriptTest(Ruby ruby, String filename) { super(filename); this.ruby = ruby; this.filename = filename; }
3,231,140
public void runTest() throws Throwable { StringBuffer scriptString = new StringBuffer((int) script.length()); BufferedReader br = new BufferedReader(new FileReader(script)); String line; while ((line = br.readLine()) != null) { scriptString.append(line).append('\n'); } br.close(); // At the end of the tests we need a value to tell us if they failed. scriptString.append("$curtestOK").append('\n'); RubyBoolean isOk = (RubyBoolean) ruby.evalScript(scriptString.toString()); if (isOk.isFalse()) { fail(filename + " failed"); } System.out.flush(); // Without a flush Ant will miss some of our output }
public void runTest() throws Throwable { StringBuffer scriptString = new StringBuffer((int) script.length()); BufferedReader br = new BufferedReader(new FileReader(script)); String line; while ((line = br.readLine()) != null) { scriptString.append(line).append('\n'); } br.close(); // At the end of the tests we need a value to tell us if they failed. scriptString.append("$curtestOK").append('\n'); RubyBoolean isOk = (RubyBoolean) ruby.evalScript(scriptString.toString()); if (isOk.isFalse()) { fail(filename + " failed"); } System.out.flush(); // Without a flush Ant will miss some of our output }
3,231,141
public void runTest() throws Throwable { StringBuffer scriptString = new StringBuffer((int) script.length()); BufferedReader br = new BufferedReader(new FileReader(script)); String line; while ((line = br.readLine()) != null) { scriptString.append(line).append('\n'); } br.close(); // At the end of the tests we need a value to tell us if they failed. scriptString.append("$curtestOK").append('\n'); RubyBoolean isOk = (RubyBoolean) ruby.evalScript(scriptString.toString()); if (isOk.isFalse()) { fail(filename + " failed"); } System.out.flush(); // Without a flush Ant will miss some of our output }
public void runTest() throws Throwable { StringBuffer scriptString = new StringBuffer((int) script.length()); BufferedReader br = new BufferedReader(new FileReader(script)); String line; while ((line = br.readLine()) != null) { scriptString.append(line).append('\n'); } br.close(); // At the end of the tests we need a value to tell us if they failed. scriptString.append("$curtestOK").append('\n'); RubyBoolean isOk = (RubyBoolean) ruby.evalScript(scriptString.toString()); if (isOk.isFalse()) { fail(filename + " failed"); } System.out.flush(); // Without a flush Ant will miss some of our output }
3,231,142
public void actionPerformed(ActionEvent actionEvent) { Collection contacts = contactList.getSelectedUsers(); startConference(contacts); }
public void actionPerformed(ActionEvent actionEvent) { Collection contacts = contactList.getActiveGroup().getContactItems(); startConference(contacts); }
3,231,143
TNavigator(NavigationPaletteManager topManager, int sizeT, int t) { manager = new TNavigatorManager(this, topManager, sizeT, t); im = IconManager.getInstance(topManager.getRegistry()); initComponents(sizeT, t); manager.attachListeners(); buildGUI(); }
TNavigator(NavigationPaletteManager topManager, int sizeT, int t) { manager = new TNavigatorManager(this, topManager, sizeT, t); im = IconManager.getInstance(topManager.getRegistry()); initComponents(sizeT, t); manager.attachListeners(); buildGUI(); }
3,231,146
XYZNavigator(NavigationPaletteManager topManager, int sizeX, int sizeY, int sizeZ, int z) { manager = new XYZNavigatorManager(this, topManager, sizeZ, z); im = IconManager.getInstance(topManager.getRegistry()); initSlider(sizeZ, z); initTextField(sizeZ, z); manager.attachListeners(); buildGUI(sizeX, sizeY, sizeZ); }
XYZNavigator(NavigationPaletteManager topManager, int sizeX, int sizeY, int sizeZ, int z) { manager = new XYZNavigatorManager(this, topManager, sizeZ, z); im = IconManager.getInstance(topManager.getRegistry()); initSlider(sizeZ, z); initTextField(sizeZ, z); manager.attachListeners(); buildGUI(sizeX, sizeY, sizeZ); }
3,231,147
public RubyFixnum hash() { return getRuntime().newFixnum(hashCode()); }
public RubyFixnum hash() { long baseHash = (isExclusive ? 1 : 0); long beginHash = ((RubyFixnum) begin.callMethod("hash")).getLongValue(); long endHash = ((RubyFixnum) end.callMethod("hash")).getLongValue(); long hash = baseHash; hash = hash ^ (beginHash << 1); hash = hash ^ (endHash << 9); hash = hash ^ (baseHash << 24); return getRuntime().newFixnum(hash); }
3,231,148
public static void fillDataset(Dataset dataset, DatasetData empty) { //Fill in the data coming from Project. empty.setID(dataset.getID()); empty.setName(dataset.getName()); empty.setDescription(dataset.getDescription()); //Fill in the data coming from Experimenter. Experimenter owner = dataset.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill in the data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //Create the image summary list. List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); Image img; while (i.hasNext()) { img = (Image) i.next(); images.add(new ImageSummary(img.getID(), img.getName(), fillListPixelsID(img), fillDefaultPixels(img.getDefaultPixels()))); } empty.setImages(images); }
public static void fillDataset(Dataset dataset, DatasetData empty) { //Fill in the data coming from Project. empty.setID(dataset.getID()); empty.setName(dataset.getName()); empty.setDescription(dataset.getDescription()); //Fill in the data coming from Experimenter. Experimenter owner = dataset.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill in the data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //Create the image summary list. List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); Image img; while (i.hasNext()) { img = (Image) i.next(); images.add(new ImageSummary(img.getID(), img.getName(), fillListPixelsID(img), fillDefaultPixels(img.getDefaultPixels()))); } empty.setImages(images); }
3,231,149
public static void fillDataset(Dataset dataset, DatasetData empty) { //Fill in the data coming from Project. empty.setID(dataset.getID()); empty.setName(dataset.getName()); empty.setDescription(dataset.getDescription()); //Fill in the data coming from Experimenter. Experimenter owner = dataset.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill in the data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //Create the image summary list. List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); Image img; while (i.hasNext()) { img = (Image) i.next(); images.add(new ImageSummary(img.getID(), img.getName(), fillListPixelsID(img), fillDefaultPixels(img.getDefaultPixels()))); } empty.setImages(images); }
public static void fillDataset(Dataset dataset, DatasetData empty) { //Fill in the data coming from Project. empty.setID(dataset.getID()); empty.setName(dataset.getName()); empty.setDescription(dataset.getDescription()); //Fill in the data coming from Experimenter. Experimenter owner = dataset.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill in the data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //Create the image summary list. List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); Image img; while (i.hasNext()) { img = (Image) i.next(); images.add(new ImageSummary(img.getID(), img.getName(), fillListPixelsID(img), fillDefaultPixels(img.getDefaultPixels()))); } empty.setImages(images); }
3,231,150
public static void fillDataset(Dataset dataset, DatasetData empty) { //Fill in the data coming from Project. empty.setID(dataset.getID()); empty.setName(dataset.getName()); empty.setDescription(dataset.getDescription()); //Fill in the data coming from Experimenter. Experimenter owner = dataset.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill in the data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //Create the image summary list. List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); Image img; while (i.hasNext()) { img = (Image) i.next(); images.add(new ImageSummary(img.getID(), img.getName(), fillListPixelsID(img), fillDefaultPixels(img.getDefaultPixels()))); } empty.setImages(images); }
public static void fillDataset(Dataset dataset, DatasetData empty) { //Fill in the data coming from Project. empty.setID(dataset.getID()); empty.setName(dataset.getName()); empty.setDescription(dataset.getDescription()); //Fill in the data coming from Experimenter. Experimenter owner = dataset.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill in the data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //Create the image summary list. List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); Image img; while (i.hasNext()) { img = (Image) i.next(); images.add(new ImageSummary(img.getID(), img.getName(), fillListPixelsID(img), fillDefaultPixels(img.getDefaultPixels()))); } empty.setImages(images); }
3,231,151
public static List fillListImages(Dataset dataset) { List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); Image image; while (i.hasNext()) { image = (Image) i.next(); images.add(new ImageSummary(image.getID(), image.getName(), fillListPixelsID(image), fillDefaultPixels(image.getDefaultPixels()))); } return images; }
public static List fillListImages(Dataset dataset) { List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); Image image; while (i.hasNext()) { image = (Image) i.next(); images.add(new ImageSummary(image.getID(), image.getName(), fillListPixelsID(image), fillDefaultPixels(image.getDefaultPixels()))); } return images; }
3,231,152
public static List fillListImages(Dataset dataset) { List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); Image image; while (i.hasNext()) { image = (Image) i.next(); images.add(new ImageSummary(image.getID(), image.getName(), fillListPixelsID(image), fillDefaultPixels(image.getDefaultPixels()))); } return images; }
public static List fillListImages(Dataset dataset) { List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); Image image; while (i.hasNext()) { image = (Image) i.next(); images.add(new ImageSummary(image.getID(), image.getName(), fillListPixelsID(image), fillDefaultPixels(image.getDefaultPixels()))); } return images; }
3,231,153
public static List fillUserDatasets(List datasets, DatasetSummary dProto) { List datasetsList = new ArrayList(); //The returned summary list. Iterator i = datasets.iterator(); DatasetSummary ds; Dataset d; //For each d in datasets... while (i.hasNext()) { d = (Dataset) i.next(); //Make a new DataObject and fill it up. ds = (DatasetSummary) dProto.makeNew(); ds.setID(d.getID()); ds.setName(d.getName()); //Add the datasets to the list of returned datasets. datasetsList.add(ds); } return datasetsList; }
public static List fillUserDatasets(List datasets, DatasetSummary dProto) { List datasetsList = new ArrayList(); //The returned summary list. Iterator i = datasets.iterator(); DatasetSummary ds; Dataset d; //For each d in datasets... while (i.hasNext()) { d = (Dataset) i.next(); //Make a new DataObject and fill it up. ds = (DatasetSummary) dProto.makeNew(); ds.setID(d.getID()); ds.setName(d.getName()); //Add the datasets to the list of returned datasets. datasetsList.add(ds); } return datasetsList; }
3,231,154
public static List fillUserDatasets(List datasets, DatasetSummary dProto) { List datasetsList = new ArrayList(); //The returned summary list. Iterator i = datasets.iterator(); DatasetSummary ds; Dataset d; //For each d in datasets... while (i.hasNext()) { d = (Dataset) i.next(); //Make a new DataObject and fill it up. ds = (DatasetSummary) dProto.makeNew(); ds.setID(d.getID()); ds.setName(d.getName()); //Add the datasets to the list of returned datasets. datasetsList.add(ds); } return datasetsList; }
publicstaticListfillUserDatasets(Listdatasets,DatasetSummarydProto) { ListdatasetsList=newArrayList();//Thereturnedsummarylist. Iteratori=datasets.iterator(); DatasetSummaryds; Datasetd; //Foreachdindatasets... while(i.hasNext()){ d=(Dataset)i.next(); //MakeanewDataObjectandfillitup. ds=(DatasetSummary)dProto.makeNew(); ds.setID(d.getID()); ds.setName(d.getName()); //Addthedatasetstothelistofreturneddatasets. datasetsList.add(ds); } returndatasetsList; }
3,231,155
public IRubyObject internalCall(ThreadContext context, IRubyObject receiver, RubyModule lastClass, String name, IRubyObject[] args, boolean noSuper) { assert args != null; IRuby runtime = context.getRuntime(); if (argsNode.getBlockArgNode() != null && context.isBlockGiven()) { // We pass depth zero since we know this only applies to newly created local scope context.getCurrentScope().setValue(argsNode.getBlockArgNode().getCount(), runtime.newProc(), 0); } try { prepareArguments(context, runtime, receiver, args); getArity().checkArity(runtime, args); traceCall(context, runtime, receiver, name); return EvaluationState.eval(context, body, receiver); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.ReturnJump) { if (je.getPrimaryData() == this) { return (IRubyObject)je.getSecondaryData(); } } throw je; } finally { traceReturn(context, runtime, receiver, name); } }
public IRubyObject internalCall(ThreadContext context, IRubyObject receiver, RubyModule lastClass, String name, IRubyObject[] args, boolean noSuper) { assert args != null; IRuby runtime = context.getRuntime(); if (argsNode.getBlockArgNode() != null && context.isBlockGiven()) { // We pass depth zero since we know this only applies to newly created local scope blockArg = runtime.newProc(); blockArg.getBlock().isLambda = context.getCurrentBlock().isLambda; context.getCurrentScope().setValue(argsNode.getBlockArgNode().getCount(), blockArg, 0); } try { prepareArguments(context, runtime, receiver, args); getArity().checkArity(runtime, args); traceCall(context, runtime, receiver, name); return EvaluationState.eval(context, body, receiver); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.ReturnJump) { if (je.getPrimaryData() == this) { return (IRubyObject)je.getSecondaryData(); } } throw je; } finally { traceReturn(context, runtime, receiver, name); } }
3,231,156
void onCurveChange() { String f = model.getFamily(); gammaSlider.setEnabled((f.equals(RendererModel.POLYNOMIAL) || f.equals(RendererModel.EXPONENTIAL))); graphicsPane.onCurveChange(); }
void onCurveChange() { String f = model.getFamily(); gammaSlider.setEnabled((f.equals(RendererModel.POLYNOMIAL) || f.equals(RendererModel.EXPONENTIAL))); graphicsPane.onCurveChange(); }
3,231,157
OrCondition(Condition l, Condition r) { _l = l; _r = r; System.out.println("Condition: " + l + " || + " + r); }
OrCondition(Condition l, Condition r) { _l = l; _r = r; System.out.println("Condition: " + l + " || + " + r); }
3,231,158
public static RubyTime s_new(Ruby ruby, RubyObject rubyClass) { RubyObject[] args = new RubyObject[1]; args[0] = new RubyFixnum(ruby, new Date().getTime()); return s_at(ruby, rubyClass, args); }
public static RubyTime s_new(Ruby ruby, RubyObject rubyClass) { RubyObject[] args = new RubyObject[1]; args[0] = RubyFixnum.newFixnum(ruby, new Date().getTime()); return s_at(ruby, rubyClass, args); }
3,231,159
public IRubyObject aref(IRubyObject[] args) { if (checkArgumentCount(args, 1, 2) == 2) { if (args[0] instanceof RubyRegexp) { IRubyObject match = RubyRegexp.regexpValue(args[0]).match(toString(), 0); return match.isNil() ? getRuntime().getNil() : ((RubyMatchData) match).group(args[1].convertToInteger().getLongValue()); } return substr(RubyNumeric.fix2int(args[0]), RubyNumeric.fix2int(args[1])); } if (args[0] instanceof RubyRegexp) { return RubyRegexp.regexpValue(args[0]).search(toString(), 0) >= 0 ? RubyRegexp.last_match(getRuntime().getCurrentContext().getBackref()) : getRuntime().getNil(); } else if (args[0] instanceof RubyString) { return toString().indexOf(stringValue(args[0]).toString()) != -1 ? args[0] : getRuntime().getNil(); } else if (args[0] instanceof RubyRange) { long[] begLen = ((RubyRange) args[0]).getBeginLength(getValue().length(), true, false); return begLen == null ? getRuntime().getNil() : substr((int) begLen[0], (int) begLen[1]); } int idx = (int) args[0].convertToInteger().getLongValue(); if (idx < 0) { idx += getValue().length(); } return idx < 0 || idx >= getValue().length() ? getRuntime().getNil() : getRuntime().newFixnum(getValue().charAt(idx)); }
public IRubyObject aref(IRubyObject[] args) { if (checkArgumentCount(args, 1, 2) == 2) { if (args[0] instanceof RubyRegexp) { IRubyObject match = RubyRegexp.regexpValue(args[0]).match(toString(), 0); return match.isNil() ? getRuntime().getNil() : ((RubyMatchData) match).group(args[1].convertToInteger().getLongValue()); } return substr(RubyNumeric.fix2int(args[0]), RubyNumeric.fix2int(args[1])); } if (args[0] instanceof RubyRegexp) { return RubyRegexp.regexpValue(args[0]).search(toString(), 0) >= 0 ? RubyRegexp.last_match(getRuntime().getCurrentContext().getBackref()) : getRuntime().getNil(); } else if (args[0] instanceof RubyString) { return toString().indexOf(stringValue(args[0]).toString()) != -1 ? args[0] : getRuntime().getNil(); } else if (args[0] instanceof RubyRange) { long[] begLen = ((RubyRange) args[0]).getBeginLength(getValue().length(), true, false); return begLen == null ? getRuntime().getNil() : substr((int) begLen[0], (int) begLen[1]); } int idx = (int) args[0].convertToInteger().getLongValue(); if (idx < 0) { idx += getValue().length(); } return idx < 0 || idx >= getValue().length() ? getRuntime().getNil() : getRuntime().newFixnum(getValue().charAt(idx)); }
3,231,160
public void visit(ImageNode node) { Rectangle r = node.getBounds(); Thumbnail th = node.getThumbnail(); double sf = th.getScalingFactor(); double factor = ZoomCmd.calculateFactor(sf); if (sf != factor) { th.scale(factor); double ratio = factor/sf; node.setLocation((int) (r.x*ratio), (int) (r.y*ratio)); } }
public void visit(ImageNode node) { Thumbnail th = node.getThumbnail(); double sf = th.getScalingFactor(); double factor = ZoomCmd.calculateFactor(sf); if (sf != factor) { th.scale(factor); double ratio = factor/sf; node.setLocation((int) (r.x*ratio), (int) (r.y*ratio)); } }
3,231,161
public void visit(ImageNode node) { Rectangle r = node.getBounds(); Thumbnail th = node.getThumbnail(); double sf = th.getScalingFactor(); double factor = ZoomCmd.calculateFactor(sf); if (sf != factor) { th.scale(factor); double ratio = factor/sf; node.setLocation((int) (r.x*ratio), (int) (r.y*ratio)); } }
public void visit(ImageNode node) { Rectangle r = node.getBounds(); Thumbnail th = node.getThumbnail(); double sf = th.getScalingFactor(); double factor = ZoomCmd.calculateFactor(sf); if (sf != factor) { th.scale(factor); double ratio = factor/sf; node.setLocation((int) (r.x*ratio), (int) (r.y*ratio)); } }
3,231,162
public List getDatasets() { if (datasets == null ||projects.size() == 0) { try { DataManagementService dms = registry.getDataManagementService(); datasets = dms.retrieveUserDatasets(new BrowserDatasetSummary()); Collections.sort(datasets); registry.getLogger().info(this,"loaded datasets..."); } catch(DSAccessException dsae) { String s = "Can't retrieve user's datasets."; registry.getLogger().error(this, s+" Error: "+dsae); registry.getUserNotifier().notifyError("Data Retrieval Failure", s, dsae); } catch(DSOutOfServiceException dsose) { ServiceActivationRequest request = new ServiceActivationRequest( ServiceActivationRequest.DATA_SERVICES); registry.getEventBus().post(request); } } return datasets; }
public List getDatasets() { if (datasets == null ||projects.size() == 0) { try { DataManagementService dms = registry.getDataManagementService(); datasets = dms.retrieveUserDatasets(new BrowserDatasetSummary()); Collections.sort(datasets); registry.getLogger().info(this,"loaded datasets..."); } catch(DSAccessException dsae) { String s = "Can't retrieve user's datasets."; registry.getLogger().error(this, s+" Error: "+dsae); registry.getUserNotifier().notifyError("Data Retrieval Failure", s, dsae); } catch(DSOutOfServiceException dsose) { ServiceActivationRequest request = new ServiceActivationRequest( ServiceActivationRequest.DATA_SERVICES); registry.getEventBus().post(request); } } return datasets; }
3,231,163
void collectUserCredentials(SplashScreenFuture future) { userCredentials = future; view.user.setText(""); view.user.setEnabled(true); view.pass.setEnabled(true); view.pass.setText(""); view.login.setEnabled(true); }
void collectUserCredentials(SplashScreenFuture future, boolean init) { userCredentials = future; view.user.setText(""); view.user.setEnabled(true); view.pass.setEnabled(true); view.pass.setText(""); view.login.setEnabled(true); }
3,231,164
void collectUserCredentials(SplashScreenFuture future) { userCredentials = future; view.user.setText(""); view.user.setEnabled(true); view.pass.setEnabled(true); view.pass.setText(""); view.login.setEnabled(true); }
void collectUserCredentials(SplashScreenFuture future) { userCredentials = future; view.user.setEnabled(true); view.pass.setEnabled(true); view.pass.setText(""); view.login.setEnabled(true); }
3,231,165
void collectUserCredentials(SplashScreenFuture future) { userCredentials = future; view.user.setText(""); view.user.setEnabled(true); view.pass.setEnabled(true); view.pass.setText(""); view.login.setEnabled(true); }
void collectUserCredentials(SplashScreenFuture future) { userCredentials = future; view.user.setText(""); view.user.setEnabled(true); view.pass.setEnabled(true); view.login.setEnabled(true); }
3,231,166
public boolean lies(PlanePoint p) { if (p == null) throw new NullPointerException("No point."); boolean result = false; double k1, k2; if (direction.x1 == 0 && direction.x2 !=0) { k2 = (p.x2-origin.x2)/direction.x2; if (k2 < 0 || k2 > 1) result = false; else result = (p.x1 == origin.x1); } else if (direction.x1 != 0 && direction.x2 ==0) { k1 = (p.x1-origin.x1)/direction.x1; if (k1 < 0 || k1 > 1) result = false; result = (p.x2 == origin.x2); } else if (direction.x1 != 0 && direction.x2 !=0) { k1 = (p.x1-origin.x1)/direction.x1; k2 = (p.x2-origin.x2)/direction.x2; if (k1 == k2) { if (k1 < 0 || k1 > 1) result = false; else result = true; } } return result; }
public boolean lies(PlanePoint p) { if (p == null) throw new NullPointerException("No point."); boolean result = false; double k1, k2; if (direction.x1 == 0 && direction.x2 !=0) { k2 = (p.x2-origin.x2)/direction.x2; if (k2 < 0 || k2 > 1) result = false; else result = (p.x1 == origin.x1); } else if (direction.x1 != 0 && direction.x2 ==0) { k1 = (p.x1-origin.x1)/direction.x1; if (k1 < 0 || k1 > 1) result = false; else result = (p.x2 == origin.x2); } else if (direction.x1 != 0 && direction.x2 !=0) { k1 = (p.x1-origin.x1)/direction.x1; k2 = (p.x2-origin.x2)/direction.x2; if (k1 == k2) { if (k1 < 0 || k1 > 1) result = false; else result = true; } } return result; }
3,231,168
public RubyObject eval(Ruby ruby, RubyObject self) { // TMP_PROTECT; RubyBlock tmpBlock = ArgsUtil.beginCallArgs(ruby); RubyObject[] argsObj = ArgsUtil.setupArgs(ruby, self, getArgsNode()); ArgsUtil.endCallArgs(ruby, tmpBlock); return self.getRubyClass().call(self, getMId(), argsObj, 1); }
public RubyObject eval(Ruby ruby, RubyObject self) { // TMP_PROTECT; RubyBlock tmpBlock = ArgsUtil.beginCallArgs(ruby); RubyPointer args = ArgsUtil.setupArgs(ruby, self, getArgsNode()); ArgsUtil.endCallArgs(ruby, tmpBlock); return self.getRubyClass().call(self, getMId(), argsObj, 1); }
3,231,169
public RubyObject eval(Ruby ruby, RubyObject self) { // TMP_PROTECT; RubyBlock tmpBlock = ArgsUtil.beginCallArgs(ruby); RubyObject[] argsObj = ArgsUtil.setupArgs(ruby, self, getArgsNode()); ArgsUtil.endCallArgs(ruby, tmpBlock); return self.getRubyClass().call(self, getMId(), argsObj, 1); }
public RubyObject eval(Ruby ruby, RubyObject self) { // TMP_PROTECT; RubyBlock tmpBlock = ArgsUtil.beginCallArgs(ruby); RubyObject[] argsObj = ArgsUtil.setupArgs(ruby, self, getArgsNode()); ArgsUtil.endCallArgs(ruby, tmpBlock); return self.getRubyClass().call(self, getMId(), args, 1); }
3,231,170
public static RubyObject[] setupArgs(Ruby ruby, RubyObject self, Node node) { RubyObject[] result = new RubyObject[0]; if (node != null) { RubyObject args = node.eval(ruby, self); String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); if (!(args instanceof RubyArray)) { args = RubyArray.m_newArray(ruby, args); } result = ((RubyArray)args).getList().toRubyArray(); ruby.setSourceFile(file); ruby.setSourceLine(line); } return result; }
public static RubyObject[] setupArgs(Ruby ruby, RubyObject self, Node node) { RubyObject[] result = new RubyObject[0]; if (node != null) { RubyObject args = node.eval(ruby, self); String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); if (!(args instanceof RubyArray)) { args = RubyArray.m_newArray(ruby, args); } result = ((RubyArray)args).getList().toRubyArray(); ruby.setSourceFile(file); ruby.setSourceLine(line); } return result; }
3,231,171
public static RubyObject[] setupArgs(Ruby ruby, RubyObject self, Node node) { RubyObject[] result = new RubyObject[0]; if (node != null) { RubyObject args = node.eval(ruby, self); String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); if (!(args instanceof RubyArray)) { args = RubyArray.m_newArray(ruby, args); } result = ((RubyArray)args).getList().toRubyArray(); ruby.setSourceFile(file); ruby.setSourceLine(line); } return result; }
public static RubyObject[] setupArgs(Ruby ruby, RubyObject self, Node node) { RubyObject[] result = new RubyObject[0]; if (node != null) { RubyObject args = node.eval(ruby, self); String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); if (!(args instanceof RubyArray)) { args = RubyArray.m_newArray(ruby, args); } result = ((RubyArray)args).getList().toRubyArray(); ruby.setSourceFile(file); ruby.setSourceLine(line); } return result; }
3,231,172
public static RubyObject[] setupArgs(Ruby ruby, RubyObject self, Node node) { RubyObject[] result = new RubyObject[0]; if (node != null) { RubyObject args = node.eval(ruby, self); String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); if (!(args instanceof RubyArray)) { args = RubyArray.m_newArray(ruby, args); } result = ((RubyArray)args).getList().toRubyArray(); ruby.setSourceFile(file); ruby.setSourceLine(line); } return result; }
public static RubyObject[] setupArgs(Ruby ruby, RubyObject self, Node node) { RubyObject[] result = new RubyObject[0]; if (node != null) { RubyObject args = node.eval(ruby, self); String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); if (!(args instanceof RubyArray)) { args = RubyArray.m_newArray(ruby, args); } result = ((RubyArray)args).getList().toRubyArray(); ruby.setSourceFile(file); ruby.setSourceLine(line); } ruby.setSourceFile(file); ruby.setSourceLine(line); return args; }
3,231,173
public RubyException m_exception(RubyObject[] args) { switch (args.length) { case 0 : return this; case 1 : return (RubyException) m_new(getRuby(), this, args); default : throw new RubyArgumentException(getRuby(), "Wrong argument count"); } }
public RubyException m_exception(RubyObject[] args) { switch (args.length) { case 0 : return this; case 1 : return (RubyException) m_new(getRuby(), this, args); default : throw new RubyArgumentException(getRuby(), "Wrong argument count"); } }
3,231,174
public RubyException m_exception(RubyObject[] args) { switch (args.length) { case 0 : return this; case 1 : return (RubyException) m_new(getRuby(), this, args); default : throw new RubyArgumentException(getRuby(), "Wrong argument count"); } }
public RubyException m_exception(RubyObject[] args) { switch (args.length) { case 0 : return this; case 1 : return (RubyException) m_new(getRuby(), this, args); default : throw new RubyArgumentException(getRuby(), "Wrong argument count"); } }
3,231,175
public RubyString m_inspect() { RubyModule rubyClass = getRubyClass(); RubyString exception = RubyString.stringValue(this); if (exception.getValue().length() == 0) { return rubyClass.getClassPath(); } else { StringBuffer sb = new StringBuffer(); sb.append("#<"); sb.append(rubyClass.getClassPath().getValue()); sb.append(": "); sb.append(exception.getValue()); sb.append(">"); return RubyString.m_newString(getRuby(), sb.toString()); } }
public RubyString m_inspect() { RubyModule rubyClass = getRubyClass(); RubyString exception = RubyString.stringValue(this); if (exception.getValue().length() == 0) { return rubyClass.getClassPath(); } else { StringBuffer sb = new StringBuffer(); sb.append("#<"); sb.append(rubyClass.getClassPath().getValue()); sb.append(": "); sb.append(exception.getValue()); sb.append(">"); return RubyString.m_newString(getRuby(), sb.toString()); } }
3,231,176
public RubyString m_inspect() { RubyModule rubyClass = getRubyClass(); RubyString exception = RubyString.stringValue(this); if (exception.getValue().length() == 0) { return rubyClass.getClassPath(); } else { StringBuffer sb = new StringBuffer(); sb.append("#<"); sb.append(rubyClass.getClassPath().getValue()); sb.append(": "); sb.append(exception.getValue()); sb.append(">"); return RubyString.m_newString(getRuby(), sb.toString()); } }
public RubyString m_inspect() { RubyModule rubyClass = getRubyClass(); RubyString exception = RubyString.stringValue(this); if (exception.getValue().length() == 0) { return rubyClass.getClassPath(); } else { StringBuffer sb = new StringBuffer(); sb.append("#<"); sb.append(rubyClass.getClassPath().getValue()); sb.append(": "); sb.append(exception.getValue()); sb.append(">"); return RubyString.m_newString(getRuby(), sb.toString()); } }
3,231,177
public RubyString m_inspect() { RubyModule rubyClass = getRubyClass(); RubyString exception = RubyString.stringValue(this); if (exception.getValue().length() == 0) { return rubyClass.getClassPath(); } else { StringBuffer sb = new StringBuffer(); sb.append("#<"); sb.append(rubyClass.getClassPath().getValue()); sb.append(": "); sb.append(exception.getValue()); sb.append(">"); return RubyString.m_newString(getRuby(), sb.toString()); } }
public RubyString m_inspect() { RubyModule rubyClass = getRubyClass(); RubyString exception = RubyString.stringValue(this); if (exception.getValue().length() == 0) { return rubyClass.getClassPath(); } else { StringBuffer sb = new StringBuffer(); sb.append("#<"); sb.append(rubyClass.getClassPath().getValue()); sb.append(": "); sb.append(exception.getValue()); sb.append(">"); return RubyString.m_newString(getRuby(), sb.toString()); } }
3,231,178
public static RubyException m_new(Ruby ruby, RubyObject recv, RubyObject[] args) { return s_new(ruby, recv.getRubyClass(), args); }
public static RubyException m_new(Ruby ruby, RubyObject recv, RubyObject[] args) { return s_new(ruby, recv.getRubyClass(), args); }
3,231,179
public RubyString m_to_s() { RubyObject message = getInstanceVar("mesg"); if (message.isNil()) { return getRubyClass().getClassPath(); } else { message.setTaint(isTaint()); return (RubyString) message; } }
public RubyString m_to_s() { RubyObject message = getInstanceVar("mesg"); if (message.isNil()) { return getRubyClass().getClassPath(); } else { message.setTaint(isTaint()); return (RubyString) message; } }
3,231,180
public RubyString m_to_s() { RubyObject message = getInstanceVar("mesg"); if (message.isNil()) { return getRubyClass().getClassPath(); } else { message.setTaint(isTaint()); return (RubyString) message; } }
public RubyString m_to_s() { RubyObject message = getInstanceVar("mesg"); if (message.isNil()) { return getRubyClass().getClassPath(); } else { message.setTaint(isTaint()); return (RubyString) message; } }
3,231,181
public RubyString m_to_s() { RubyObject message = getInstanceVar("mesg"); if (message.isNil()) { return getRubyClass().getClassPath(); } else { message.setTaint(isTaint()); return (RubyString) message; } }
public RubyString m_to_s() { RubyObject message = getInstanceVar("mesg"); if (message.isNil()) { return getRubyClass().getClassPath(); } else { message.setTaint(isTaint()); return (RubyString) message; } }
3,231,182
public static RubyException s_new(Ruby ruby, RubyObject recv, RubyObject[] args) { RubyException newException = new RubyException(ruby, (RubyClass)recv); if (args.length == 1) { newException.setInstanceVar("mesg", args[0]); } return newException; }
public static RubyException s_new(Ruby ruby, RubyObject recv, RubyObject[] args) { RubyException newException = new RubyException(ruby, (RubyClass)recv); if (args.length == 1) { newException.setInstanceVar("mesg", args[0]); } return newException; }
3,231,183
public static void flood(String directory, String fileName, String fileExt, int numOfFiles, int linesPerFile) { File dir = new File(directory); if (dir.exists() && dir.isDirectory()) { for (int i = 1; i <= numOfFiles; i++) { try { File file = new File(directory + "/" + fileName + i + "." + fileExt); LOGGER.info("Writing file: " + file.getAbsolutePath()); FileWriter writer = new FileWriter(file); for (int l = 1; l <= linesPerFile; l++) { writer.write("This is a test file. blah.... blah.... blah....\n"); } } catch(IOException ioe) { LOGGER.error("Error while writing file.", ioe); } } } }
public static void flood(String directory, String fileName, String fileExt, int numOfFiles, int linesPerFile) { File dir = new File(directory); if (dir.exists() && dir.isDirectory()) { for (int i = 1; i <= numOfFiles; i++) { try { File file = new File(directory + "/" + fileName + i + "." + fileExt); LOGGER.info("Writing file: " + file.getAbsolutePath()); FileWriter writer = new FileWriter(file); for (int l = 1; l <= linesPerFile; l++) { writer.write("This is a test file. blah.... blah.... blah....\n"); } } catch(IOException ioe) { LOGGER.error("Error while writing file.", ioe); } } } }
3,231,185
public static void main(String[] args) { FileFlooder.flood(".", "file", "txt", 100, 1000); System.out.println("done"); }
public static void main(String[] args) { FileFlooder.flood(".", "file", "txt", 100, 1000); System.out.println("done"); }
3,231,186
protected WikiPage createNewPage (WikiSystem wiki, WebContext wc, WikiUser user) throws Exception { // get the page elements from the request String editor = user.getIdentifier(); String text = wc.getForm ("TEXT"); boolean moderated = wc.getForm ("MODERATED") != null && wc.getForm("MODERATED").equals ("true"); String keywords = wc.getForm ("RELATED_TITLES"); String pageName = wc.getForm ("save"); // create the page System.err.println ("pageName: " + pageName); WikiPage newPage = wiki.createPage (pageName, editor, text); newPage.setRelatedTitles (keywordsToStringArray(keywords)); newPage.setIsModerated(moderated); System.err.println ("pageName: " + newPage.getTitle()); // make sure to save the page wiki.savePage (newPage); return newPage; }
protected WikiPage createNewPage (WikiSystem wiki, WebContext wc, WikiUser user) throws Exception { // get the page elements from the request String editor = user.getIdentifier(); String text = wc.getForm ("TEXT"); boolean moderated = wc.getForm ("MODERATED") != null && wc.getForm("MODERATED").equals ("true"); String keywords = wc.getForm ("RELATED_TITLES"); String pageName = wc.getForm ("save"); // create the page WikiPage newPage = wiki.createPage (pageName, editor, text); newPage.setRelatedTitles (keywordsToStringArray(keywords)); newPage.setIsModerated(moderated); System.err.println ("pageName: " + newPage.getTitle()); // make sure to save the page wiki.savePage (newPage); return newPage; }
3,231,188
protected WikiPage createNewPage (WikiSystem wiki, WebContext wc, WikiUser user) throws Exception { // get the page elements from the request String editor = user.getIdentifier(); String text = wc.getForm ("TEXT"); boolean moderated = wc.getForm ("MODERATED") != null && wc.getForm("MODERATED").equals ("true"); String keywords = wc.getForm ("RELATED_TITLES"); String pageName = wc.getForm ("save"); // create the page System.err.println ("pageName: " + pageName); WikiPage newPage = wiki.createPage (pageName, editor, text); newPage.setRelatedTitles (keywordsToStringArray(keywords)); newPage.setIsModerated(moderated); System.err.println ("pageName: " + newPage.getTitle()); // make sure to save the page wiki.savePage (newPage); return newPage; }
protected WikiPage createNewPage (WikiSystem wiki, WebContext wc, WikiUser user) throws Exception { // get the page elements from the request String editor = user.getIdentifier(); String text = wc.getForm ("TEXT"); boolean moderated = wc.getForm ("MODERATED") != null && wc.getForm("MODERATED").equals ("true"); String keywords = wc.getForm ("RELATED_TITLES"); String pageName = wc.getForm ("save"); // create the page System.err.println ("pageName: " + pageName); WikiPage newPage = wiki.createPage (pageName, editor, text); newPage.setRelatedTitles (keywordsToStringArray(keywords)); newPage.setIsModerated(moderated); // make sure to save the page wiki.savePage (newPage); return newPage; }
3,231,189
TreeCheckRenderer(boolean leafOnly) { this.leafOnly = leafOnly; restoredSize = null; setLayout(null); setOpaque(true); label = new TreeCheckLabel(); check = new JCheckBox(); check.setBackground(UIManager.getColor("Tree.textBackground")); setBackground(UIManager.getColor("Tree.textBackground")); }
TreeCheckRenderer(boolean leafOnly) { this.leafOnly = leafOnly; restoredSize = null; setLayout(null); setOpaque(false); label = new TreeCheckLabel(); check = new JCheckBox(); check.setBackground(UIManager.getColor("Tree.textBackground")); setBackground(UIManager.getColor("Tree.textBackground")); }
3,231,190
protected InputStream loadResource(String uri) { if (System.getProperty("xbean.dir") != null) { File f = new File(System.getProperty("xbean.dir") + uri); try { return new FileInputStream(f); } catch (FileNotFoundException e) { // Ignore } } // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { log.debug("Could not find resource: " + uri); } } return in; }
protected InputStream loadResource(String uri) { if (System.getProperty("xbean.dir") != null) { File f = new File(System.getProperty("xbean.dir") + uri); try { return new FileInputStream(f); } catch (FileNotFoundException e) { // Ignore } } // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { ClassLoader cl = parserContext.getReaderContext().getReader().getBeanClassLoader(); if (cl != null) { in = cl.getResourceAsStream(uri); } if (in == null) { log.debug("Could not find resource: " + uri); } } return in; }
3,231,191
protected InputStream loadResource(String uri) { if (System.getProperty("xbean.dir") != null) { File f = new File(System.getProperty("xbean.dir") + uri); try { return new FileInputStream(f); } catch (FileNotFoundException e) { // Ignore } } // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { log.debug("Could not find resource: " + uri); } } return in; }
protected InputStream loadResource(String uri) { if (System.getProperty("xbean.dir") != null) { File f = new File(System.getProperty("xbean.dir") + uri); try { return new FileInputStream(f); } catch (FileNotFoundException e) { // Ignore } } // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { log.debug("Could not find resource: " + uri); } } } return in; }
3,231,192
protected String renderListItem() { return "* "; }
protected String renderListItem() { return _number > 0 ? "" + (++_number) : "* "; }
3,231,193
public void testParsing() { CommandlineParser c = new CommandlineParser(new String[] { "-e", "hello", "-e", "world" }); assertEquals("hello\nworld\n", c.inlineScript()); assertNull(c.scriptFileName); assertEquals("-e", c.displayedFileName()); c = new CommandlineParser(new String[] { "--version" }); assertTrue(c.showVersion); c = new CommandlineParser(new String[] { "-n", "myfile.rb" }); assertTrue(c.assumeLoop); assertEquals("myfile.rb", c.scriptFileName); assertEquals("myfile.rb", c.displayedFileName()); c = new CommandlineParser(new String[0]); assertEquals("-", c.displayedFileName()); }
public void testParsing() { CommandlineParser c = new CommandlineParser(new String[] { "-e", "hello", "-e", "world" }); assertEquals("hello\nworld\n", c.inlineScript()); assertNull(c.getScriptFileName()); assertEquals("-e", c.displayedFileName()); c = new CommandlineParser(new String[] { "--version" }); assertTrue(c.showVersion); c = new CommandlineParser(new String[] { "-n", "myfile.rb" }); assertTrue(c.assumeLoop); assertEquals("myfile.rb", c.scriptFileName); assertEquals("myfile.rb", c.displayedFileName()); c = new CommandlineParser(new String[0]); assertEquals("-", c.displayedFileName()); }
3,231,195
public void testParsing() { CommandlineParser c = new CommandlineParser(new String[] { "-e", "hello", "-e", "world" }); assertEquals("hello\nworld\n", c.inlineScript()); assertNull(c.scriptFileName); assertEquals("-e", c.displayedFileName()); c = new CommandlineParser(new String[] { "--version" }); assertTrue(c.showVersion); c = new CommandlineParser(new String[] { "-n", "myfile.rb" }); assertTrue(c.assumeLoop); assertEquals("myfile.rb", c.scriptFileName); assertEquals("myfile.rb", c.displayedFileName()); c = new CommandlineParser(new String[0]); assertEquals("-", c.displayedFileName()); }
public void testParsing() { CommandlineParser c = new CommandlineParser(new String[] { "-e", "hello", "-e", "world" }); assertEquals("hello\nworld\n", c.inlineScript()); assertNull(c.scriptFileName); assertEquals("-e", c.displayedFileName()); c = new CommandlineParser(new String[] { "--version" }); assertTrue(c.isShowVersion()); c = new CommandlineParser(new String[] { "-n", "myfile.rb" }); assertTrue(c.assumeLoop); assertEquals("myfile.rb", c.scriptFileName); assertEquals("myfile.rb", c.displayedFileName()); c = new CommandlineParser(new String[0]); assertEquals("-", c.displayedFileName()); }
3,231,196
public void testParsing() { CommandlineParser c = new CommandlineParser(new String[] { "-e", "hello", "-e", "world" }); assertEquals("hello\nworld\n", c.inlineScript()); assertNull(c.scriptFileName); assertEquals("-e", c.displayedFileName()); c = new CommandlineParser(new String[] { "--version" }); assertTrue(c.showVersion); c = new CommandlineParser(new String[] { "-n", "myfile.rb" }); assertTrue(c.assumeLoop); assertEquals("myfile.rb", c.scriptFileName); assertEquals("myfile.rb", c.displayedFileName()); c = new CommandlineParser(new String[0]); assertEquals("-", c.displayedFileName()); }
public void testParsing() { CommandlineParser c = new CommandlineParser(new String[] { "-e", "hello", "-e", "world" }); assertEquals("hello\nworld\n", c.inlineScript()); assertNull(c.scriptFileName); assertEquals("-e", c.displayedFileName()); c = new CommandlineParser(new String[] { "--version" }); assertTrue(c.showVersion); c = new CommandlineParser(new String[] { "-n", "myfile.rb" }); assertTrue(c.assumeLoop); assertEquals("myfile.rb", c.scriptFileName); assertEquals("myfile.rb", c.displayedFileName()); c = new CommandlineParser(new String[0]); assertEquals("-", c.displayedFileName()); }
3,231,197
main(String[] args) { int status = 0; Ice.Communicator ic = null; try { ic = Ice.Util.initialize(args); Ice.ObjectPrx base = ic.stringToProxy( "T:default -p 10000"); test.TPrx printer = test.TPrxHelper.checkedCast(base); if (printer == null) throw new Error("Invalid proxy"); Roi5DRemote r5 = printer.getRoi5D(); Roi4DRemote r4 = (Roi4DRemote) r5.roi4ds.get(0); Roi4DRemote r4_ = (Roi4DRemote) r5.roi4ds.get(0); System.out.println(r4.roi3ds); System.out.println(r4_.roi3ds); } catch (Ice.LocalException e) { e.printStackTrace(); status = 1; } catch (Exception e) { System.err.println(e.getMessage()); status = 1; } if (ic != null) { // Clean up // try { ic.destroy(); } catch (Exception e) { System.err.println(e.getMessage()); status = 1; } } System.exit(status); }
main(String[] args) { int status = 0; Ice.Communicator ic = null; try { ic = Ice.Util.initialize(args); Ice.ObjectPrx base = ic.stringToProxy( "T:default -p 10000"); test.TPrx printer = test.TPrxHelper.checkedCast(base); if (printer == null) throw new Error("Invalid proxy"); Roi5DRemote r5 = printer.getRoi5D(); Roi4DRemote r4 = (Roi4DRemote) r5.roi4ds.get(0); Roi4DRemote r4_ = (Roi4DRemote) r5.roi4ds.get(0); System.out.println(r4.roi3ds); System.out.println(r4_.roi3ds); } catch (Ice.LocalException e) { e.printStackTrace(); status = 1; } catch (Exception e) { System.err.println(e.getMessage()); status = 1; } if (ic != null) { // Clean up // try { ic.destroy(); } catch (Exception e) { System.err.println(e.getMessage()); status = 1; } } System.exit(status); }
3,231,198