rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
suite.addTest(TestProxyRefDispatcher.suite()); | public static Test suite() throws Exception{ System.getProperties().list(System.out); TestSuite suite = new TestSuite(); //security // proxy suite.addTest(TestEnhancer.suite()); suite.addTest(TestProxy.suite()); suite.addTest(TestDispatch... | |
public void add(Rectangle r) | public void add(int x, int y) | public void add(Rectangle r) { union(this, r, this); } |
union(this, r, this); | add((double) x, (double) y); | public void add(Rectangle r) { union(this, r, this); } |
return contains(x, y); | return width > 0 && height > 0 && x >= this.x && x < this.x + width && y >= this.y && y < this.y + height; | public boolean inside(int x, int y) { return contains(x, y); } |
setLocation(x, y); | this.x = x; this.y = y; | public void move(int x, int y) { setLocation(x, y); } |
setBounds(x, y, width, height); | this.x = x; this.y = y; this.width = width; this.height = height; | public void reshape(int x, int y, int width, int height) { setBounds(x, y, width, height); } |
setSize(width, height); | this.width = width; this.height = height; | public void resize(int width, int height) { setSize(width, height); } |
this.x = p.x; this.y = p.y; | setLocation (p.x, p.y); | public void setLocation(Point p) { this.x = p.x; this.y = p.y; } |
width = d.width; height = d.height; | setSize (d.width, d.height); | public void setSize(Dimension d) { width = d.width; height = d.height; } |
NSArray attributesFromEntity = entity.attributesToFetch(); EOSQLExpression ex = sqlFactory.expressionForEntity(entity); ex.setUseAliases(true); ex.setUseBindVariables(true); ex.prepareSelectExpressionWithAttributes(attributesFromEntity, false, spec); System.out.println(" ex.statement():" + ex.statement()); EOSQ... | NSArray attributes = spec.rawRowKeyPaths(); if(attributes == null || attributes.count() == 0) attributes = entity.attributesToFetch(); EOSQLExpression sqlExpr = sqlFactory.selectStatementForAttributes(attributes, false, spec, entity); | public static EOSQLExpression sqlExpressionForFetchSpecificationAndEditingContext(EOFetchSpecification spec, EOEditingContext ec, long start, long end) { EOModel model = modelForFetchSpecificationAndEditingContext(spec, ec); EOEntity entity = model.entityNamed(spec.entityName()); EOAdaptor adap... |
String p = System.getProperty ("gnu.gcj.runtime.VMClassLoader.library_control", ""); if ("never".equals(p)) lib_control = LIB_NEVER; else if ("cache".equals(p)) lib_control = LIB_CACHE; else if ("full".equals(p)) { lib_control = LIB_FULL; } else lib_control = LIB_FULL; | private VMClassLoader () { super (init()); } | |
return(lineIncrement); | return lineIncrement; | getLineIncrement(){ return(lineIncrement);} |
return(pageIncrement); | return pageIncrement; | getPageIncrement(){ return(pageIncrement);} |
return(getVisibleAmount()); | return visibleAmount; | getVisible(){ return(getVisibleAmount());} |
setUnitIncrement(lineIncrement); | if (lineIncrement < 0) throw new IllegalArgumentException ("Unit increment less than zero."); int range = maximum - minimum; if (lineIncrement > range) { if (range == 0) lineIncrement = 1; else lineIncrement = range; } if (lineIncrement == this.lineIncrement) return; this.lineIncrement = lineIncrement; ScrollbarPee... | setLineIncrement(int lineIncrement){ setUnitIncrement(lineIncrement);} |
setBlockIncrement(pageIncrement); | if (pageIncrement < 0) throw new IllegalArgumentException ("Block increment less than zero."); int range = maximum - minimum; if (pageIncrement > range) { if (range == 0) pageIncrement = 1; else pageIncrement = range; } if (pageIncrement == this.pageIncrement) return; this.pageIncrement = pageIncrement; ScrollbarPe... | setPageIncrement(int pageIncrement){ setBlockIncrement(pageIncrement);} |
public String title() { return _title; } | public String title() { if(_title == null) { _title = (String) d2wContext().valueForKey("displayNameForPageConfiguration"); } return _title; } | public String title() { return _title; } |
result.append("CSMART configuration DB (org.cougaar.configuration.database)=" + System.getProperty("org.cougaar.configuration.database") + "\n"); | public static String writeDebug() { // Cougaar version, build info StringBuffer result = new StringBuffer(); String version = null; long buildtime = 0; try { Class vc = Class.forName("org.cougaar.Version"); Field vf = vc.getField("version"); Field bf = vc.getField("buildTime"); vers... | |
epi.setMessage(e.toString()+" \n\n "+ERXUtilities.stackTrace(e)); | epi.setMessage(ERXUtilities.stackTrace(e)); | public static WOComponent errorPageForException(Throwable e, WOSession s) { ErrorPageInterface epi=D2W.factory().errorPage(s); epi.setMessage(e.toString()+" \n\n "+ERXUtilities.stackTrace(e)); epi.setNextPage(s.context().page()); return (WOComponent)epi; } |
init(libname, flags); | URL url; try { url = new URL("file", "", libname); } catch (MalformedURLException _) { url = null; } helper = SharedLibHelper.findHelper(this, libname, new CodeSource(url, null)); | public SharedLibLoader(String libname, ClassLoader parent, int flags) { super(parent); init(libname, flags); } |
Object cls = classMap.get(name); | Class cls = helper.findClass(name); | public Class findClass(String name) throws ClassNotFoundException { Object cls = classMap.get(name); if (cls == null) throw new ClassNotFoundException(name); return (Class) cls; } |
return (Class) cls; | return cls; | public Class findClass(String name) throws ClassNotFoundException { Object cls = classMap.get(name); if (cls == null) throw new ClassNotFoundException(name); return (Class) cls; } |
else if (osName.indexOf("macos")!=-1) _operatingSystem=MacOSXOperatingSystem; | else if (osName.indexOf("macos")!=-1 || osName.indexOf("mac os")!=-1) _operatingSystem=MacOSXOperatingSystem; | public int operatingSystem() { if (_operatingSystem==0) { String osName=System.getProperty("os.name").toLowerCase(); if (osName.indexOf("windows")!=-1) _operatingSystem=WindowsOperatingSystem; else if (osName.indexOf("solaris")!=-1) _operatingSystem=SolarisOperatingSystem; ... |
HostComponent nhost = experimentCopy.addHost(hosts[i].getFullName().toString()); nhost.setServerPort(hosts[i].getServerPort()); nhost.setMonitoringPort(hosts[i].getMonitoringPort()); | nhosts[i] = experimentCopy.addHost(hosts[i].getShortName().toString()); nhosts[i].setServerPort(hosts[i].getServerPort()); nhosts[i].setMonitoringPort(hosts[i].getMonitoringPort()); } NodeComponent[] nodes = getNodes(); NodeComponent[] nnodes = new NodeComponent[nodes.length]; for (int i = 0; i < nodes.length; i++) nn... | public Experiment copy(Organizer organizer, Object context) { String uniqueName = organizer.generateExperimentName(getExperimentName()); Experiment experimentCopy = null; if (inDatabase) experimentCopy = new Experiment(uniqueName, expID, trialID); else experimentCopy = new Experiment(uniqueName... |
NodeComponent nnode = experimentCopy.addNode(onodes[j].getFullName().toString()); AgentComponent[] oagents = onodes[j].getAgents(); for (int x=0; x < oagents.length; x++) { AgentComponent[] nagents = experimentCopy.getAgents(); for (int y=0; y < nagents.length; y++ ) { if (nagents[y].getShortName().equals(oagents[x].g... | for (int k = 0; k < nnodes.length; k++) { if (nnodes[k].getShortName().equals(onodes[j].getShortName())) { nnode = nnodes[k]; nhosts[i].addNode(nnode); break; } } AgentComponent[] oagents = onodes[j].getAgents(); for (int x = 0; x < oagents.length; x++) for (int y = 0; y < nagents.length; y++) if (nagents[y].getShort... | public Experiment copy(Organizer organizer, Object context) { String uniqueName = organizer.generateExperimentName(getExperimentName()); Experiment experimentCopy = null; if (inDatabase) experimentCopy = new Experiment(uniqueName, expID, trialID); else experimentCopy = new Experiment(uniqueName... |
} } } nhost.addNode(nnode); | public Experiment copy(Organizer organizer, Object context) { String uniqueName = organizer.generateExperimentName(getExperimentName()); Experiment experimentCopy = null; if (inDatabase) experimentCopy = new Experiment(uniqueName, expID, trialID); else experimentCopy = new Experiment(uniqueName... | |
if(log.isDebugEnabled()) { log.debug("File: " + filename + " parse success"); } | public static ComponentDescription[] parseFile(String filename) { ComponentDescription[] desc = null; String containerInsertionPoint = ""; Logger log = CSMART.createLogger("org.cougaar.tools.csmart.core.cdata.ComponentConnector"); if(!filename.endsWith(".ini")) { filename = filename + ".ini"; ... | |
&& ReflectUtils.arrayEquals(array, ((ClassesKey)o).array); | && CollectionUtils.arrayEquals(array, ((ClassesKey)o).array); | public boolean equals(Object o) { return o != null && (o instanceof ClassesKey) && ReflectUtils.arrayEquals(array, ((ClassesKey)o).array); } |
readDefaultValues(); | public ERXEntityClassDescription(EOEntity entity) { super(entity); _validationInfo = ERXValueUtilities.dictionaryValue(entity.userInfo().objectForKey("ERXValidation")); _validationQualiferCache = new NSMutableDictionary(); _initialDefaultValues = new NSMutableDictionary(); readDef... | |
returnValue = JOptionPane.CANCEL_OPTION; setVisible(false); } | setVisible(false); } | public void actionPerformed(ActionEvent e) { returnValue = JOptionPane.CANCEL_OPTION; setVisible(false); } |
model.addRow("", ""); | Component c = argTable.getEditorComponent(); if (c != null) if (c instanceof JTextField) { int rowIndex = argTable.getEditingRow(); int colIndex = argTable.getEditingColumn(); if (rowIndex != -1 && colIndex != -1) model.setValueAt(((JTextField)c).getText(), rowIndex, colIndex); } else if(log.isErrorEnabled()) { log.err... | public void actionPerformed(ActionEvent e) { model.addRow("", ""); } |
int i = argTable.getSelectedRow(); if (i != -1) model.removeRow(i); | returnValue = JOptionPane.CANCEL_OPTION; setVisible(false); | public void actionPerformed(ActionEvent e) { int i = argTable.getSelectedRow(); if (i != -1) model.removeRow(i); } |
readPropertiesFromFile(); | model.addRow("", ""); | public void actionPerformed(ActionEvent e) { readPropertiesFromFile(); } |
NodeArgumentDialog nad = new NodeArgumentDialog("Test", props, true); | NodeArgumentDialog nad = new NodeArgumentDialog("Test", props, true, false); | public static void main(String[] args) { Properties props = new Properties(); props.setProperty("Color", "Red"); props.setProperty("Number", "33"); props.setProperty("Day", "Friday"); NodeArgumentDialog nad = new NodeArgumentDialog("Test", props, true); nad.setVisible(true); if (nad.getValue() !=... |
for (int i = 0; i < ids.count(); i++) { | for (int i = 0; i < eos.count(); i++) { | public static NSArray globalIDsForObjects(NSArray eos) { NSMutableArray ids = new NSMutableArray(eos.count()); for (int i = 0; i < ids.count(); i++) { EOEnterpriseObject eo = (EOEnterpriseObject)eos.objectAtIndex(i); EOEditingContext ec = eo.editingContext(); EOGlobalI... |
elementID = "foo"; | protected void updateVarNames() { String elementID = context().elementID(); elementID = ERXStringUtilities.replaceStringByStringInString(".", "_", elementID); elementID = "foo"; parentSelectName = "parent_" + elementID; childSelectName = "child_" + elementID; selectedParent... | |
if (editRelationshipPageConfiguration != null) { | if (editRelationshipPageConfiguration != null && editRelationshipPageConfiguration.length() > 0) { | public WOComponent editValues() { WOComponent editPage = null; String editRelationshipPageConfiguration = (String)d2wContext().valueForKey("editRelationshipPageConfiguration"); if (editRelationshipPageConfiguration != null) { editPage = D2W.factory().pageForConfigurationNamed(editRel... |
private String normalize(String vfsURI) { | public static String normalize(String vfsURI) { | private String normalize(String vfsURI) { if (vfsURI == null) { return ""; } if (vfsURI.startsWith("file:////")) { vfsURI = vfsURI.replaceFirst("////", "///"); } return vfsURI; } |
Date d = (Date) parse_sdf.parseObject(str); | java.util.Date d = (java.util.Date)parse_sdf.parseObject(str); | public static Timestamp valueOf(String str) { try { Date d = (Date) parse_sdf.parseObject(str); if (d == null) throw new IllegalArgumentException(str); else return new Timestamp(d.getTime()); } catch (ParseException e) { throw new IllegalArgumentException(str); } } |
public PainterThread (GdkGraphics2D g, Image im, AffineTransform xf) | public PainterThread (GdkGraphics2D g, Image im, AffineTransform xf, Color bg) | public PainterThread (GdkGraphics2D g, Image im, AffineTransform xf) { image = im; xform = xf; this.gr = (GdkGraphics2D) g.create (); new Thread (this).start (); } |
bgcolor = bg; | public PainterThread (GdkGraphics2D g, Image im, AffineTransform xf) { image = im; xform = xf; this.gr = (GdkGraphics2D) g.create (); new Thread (this).start (); } | |
public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) | private boolean drawImage(Image img, AffineTransform xform, Color bgcolor, ImageObserver obs) | public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) { if (img instanceof GtkOffScreenImage && img.getGraphics () instanceof GdkGraphics2D && (xform == null || xform.getType () == AffineTransform.TYPE_... |
invertedXform); | invertedXform, bgcolor); | public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) { if (img instanceof GtkOffScreenImage && img.getGraphics () instanceof GdkGraphics2D && (xform == null || xform.getType () == AffineTransform.TYPE_... |
new PainterThread (this, img, invertedXform); | new PainterThread (this, img, invertedXform, bgcolor); | public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) { if (img instanceof GtkOffScreenImage && img.getGraphics () instanceof GdkGraphics2D && (xform == null || xform.getType () == AffineTransform.TYPE_... |
AffineTransform imageToUser) | AffineTransform imageToUser, Color bgcolor) | private boolean drawRaster (ColorModel cm, Raster r, AffineTransform imageToUser) { if (r == null) return false; SampleModel sm = r.getSampleModel (); DataBuffer db = r.getDataBuffer (); if (db == null || sm == null) return false; if (cm == null) cm = Color... |
if (bgcolor != null) { for (int i = 0; i < pixels.length; i++) { if (cm.getAlpha (pixels[i]) == 0) pixels[i] = bgcolor.getRGB (); } } | private boolean drawRaster (ColorModel cm, Raster r, AffineTransform imageToUser) { if (r == null) return false; SampleModel sm = r.getSampleModel (); DataBuffer db = r.getDataBuffer (); if (db == null || sm == null) return false; if (cm == null) cm = Color... | |
drawRaster (image.getColorModel(), image.getData(), xform); | drawRaster (image.getColorModel(), image.getData(), xform, bg); | public void drawRenderedImage(RenderedImage image, AffineTransform xform) { drawRaster (image.getColorModel(), image.getData(), xform); } |
if(log.isDebugEnabled()) { log.error("ULPlanFinder: " + e); | if(log.isErrorEnabled()) { log.error("ULPlanFinder: ", e); | private Vector getNodesInDoubleRange(Vector nodes, String attributeName, double startTime, double endTime) { Vector selectedNodes = new Vector(nodes.size()); double nodeValue; for (int i = 0; i < nodes.size(); i++) { Node node = (Node)nodes.elementAt(i); String s = (String)node.get... |
if(log.isDebugEnabled()) { log.error("ULPlanFinder: " + e); | if(log.isErrorEnabled()) { log.error("ULPlanFinder: ", e); | private Vector getNodesInFloatRange(Vector nodes, String attributeName, float startTime, float endTime) { Vector selectedNodes = new Vector(nodes.size()); float nodeValue; for (int i = 0; i < nodes.size(); i++) { Node node = (Node)nodes.elementAt(i); String s = (String)node.getAt... |
if(log.isDebugEnabled()) { log.error("ULPlanFinder: " + e); | if(log.isErrorEnabled()) { log.error("ULPlanFinder: ", e); | private Vector getNodesInLongRange(Vector nodes, String attributeName, long startTime, long endTime) { Vector selectedNodes = new Vector(nodes.size()); long nodeValue; for (int i = 0; i < nodes.size(); i++) { Node node = (Node)nodes.elementAt(i); String s = (String)node.getAttribut... |
if(log.isDebugEnabled()) { log.error("ULPlanFinder: " + e); | if(log.isErrorEnabled()) { log.error("ULPlanFinder: ", e); | private Vector getNodesWithFloatAttribute(Vector nodes, String attributeName, float value) { Vector selectedNodes = new Vector(nodes.size()); float nodeValue; for (int i = 0; i < nodes.size(); i++) { Node node = (Node)nodes.elementAt(i); String s = (String)node.getAttributeValue(at... |
if(log.isDebugEnabled()) { log.error("ULPlanFinder: " + e); | if(log.isErrorEnabled()) { log.error("ULPlanFinder: ", e); | private Vector getNodesWithLongAttribute(Vector nodes, String attributeName, long value) { Vector selectedNodes = new Vector(nodes.size()); long nodeValue; for (int i = 0; i < nodes.size(); i++) { Node node = (Node)nodes.elementAt(i); String s = (String)node.getAttributeValue(attribu... |
if(log.isDebugEnabled()) { | if(log.isInfoEnabled()) { | private void planObjectTypeActionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); String s = (String)cb.getSelectedItem(); if (s.equals(ALL)){ if (!loadedPanels.isEmpty()) { for (int i=0; i<loadedPanels.size(); i++) box.remove((JPanel)loadedPanels.elementAt(i)); ... |
if(log.isDebugEnabled()) { | if(log.isInfoEnabled()) { | public void actionPerformed(ActionEvent evt) { allTimeFilter = true; fromLabel.setEnabled(false); startTimeField.setEnabled(false); toLabel.setEnabled(false); endTimeField.setEnabled(false); estimatedButton.setSelected(false); if(log.isDebugEnabled(... |
throw new IOException("null file"); | throw new IllegalStateException("null file"); | public static byte[] bytesFromFile(File f) throws IOException { if (f == null) throw new IOException("null file"); int size = (int)f.length(); FileInputStream fis = new FileInputStream(f); byte[] data = new byte[size]; int bytesRead = 0; while (bytesRead < size) ... |
throw new IOException("Attempting to write to a null file!"); | throw new IllegalStateException("Attempting to write to a null file!"); | public static void writeInputStreamToFile(File file, InputStream stream) throws IOException { if (file == null) throw new IOException("Attempting to write to a null file!"); FileOutputStream out = new FileOutputStream(file); //50 KBytes buffer byte buf[] = new byte[1024 * 50];... |
appendTagAttributeToResponse(response, "updateUrl", context.componentActionURL()); appendTagAttributeToResponse(response, "woElementID", context.elementID()); | appendTagAttributeToResponse(response, "updateUrl", AjaxUtils.ajaxComponentActionUrl(context)); | public void appendToResponse(WOResponse response, WOContext context) { WOComponent component = context.component(); String elementName = (String) valueForBinding("elementName", "span", component); String id = containerID(context); response.appendContentString("<" + elementName + " "); ... |
String id = containerID(context); | protected WOActionResults handleRequest(WORequest request, WOContext context) { WOComponent component = context.component(); WOResponse response = AjaxUtils.createResponse(context); AjaxUtils.setPageReplacementCacheKey(context, containerID(context)); if(hasChildrenElements()) { ... | |
System.out.println("Sent cluster urls"); | System.out.println("Sent agent urls"); | public void execute( HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // this.out = response.getWriter(); this.out = response.getOutputStream(); // create a URL parameter visitor ServletUtil.ParamVisitor vis = new ServletUtil.... |
Collection container = support.queryBlackboard(getSelfPred()); Iterator iter = container.iterator(); Vector results = new Vector(1); int n = 0; while (iter.hasNext()) { Asset asset = (Asset)iter.next(); PropertyTree properties = new PropertyTree(); properties.put(PropertyNames.UID_ATTR, getUIDAsString(asset.getUID()));... | Collection container = support.queryBlackboard(getSelfPred()); Iterator iter = container.iterator(); Vector results = new Vector(1); int n = 0; while (iter.hasNext()) { Asset asset = (Asset)iter.next(); PropertyTree properties = new PropertyTree(); properties.put(PropertyNames.UID_ATTR, getUIDAsString(asset.getUID()));... | private Vector getSelfInformation(StringBuffer buf) { Collection container = support.queryBlackboard(getSelfPred()); Iterator iter = container.iterator(); Vector results = new Vector(1); int n = 0; // unique index for relationships while (iter.hasNext()) { Asset asset = (Asset)iter.next(); ... |
} else { communityName = "COUGAAR"; | if (communityName != null) properties.put(PropertyNames.AGENT_COMMUNITY_NAME, communityName); String url = buf.toString(); if (url != null) properties.put(PropertyNames.AGENT_URL, url.toString()); results.add(properties); | private Vector getSelfInformation(StringBuffer buf) { Collection container = support.queryBlackboard(getSelfPred()); Iterator iter = container.iterator(); Vector results = new Vector(1); int n = 0; // unique index for relationships while (iter.hasNext()) { Asset asset = (Asset)iter.next(); ... |
if (communityName != null) properties.put(PropertyNames.AGENT_COMMUNITY_NAME, communityName); String url = buf.toString(); if (url != null) properties.put(PropertyNames.AGENT_URL, url.toString()); results.add(properties); | return results; | private Vector getSelfInformation(StringBuffer buf) { Collection container = support.queryBlackboard(getSelfPred()); Iterator iter = container.iterator(); Vector results = new Vector(1); int n = 0; // unique index for relationships while (iter.hasNext()) { Asset asset = (Asset)iter.next(); ... |
return results; } | private Vector getSelfInformation(StringBuffer buf) { Collection container = support.queryBlackboard(getSelfPred()); Iterator iter = container.iterator(); Vector results = new Vector(1); int n = 0; // unique index for relationships while (iter.hasNext()) { Asset asset = (Asset)iter.next(); ... | |
return new UnaryPredicate() { public boolean execute(Object obj) { if (obj instanceof Asset) { Asset asset = (Asset)obj; if ((asset instanceof HasRelationships) && ((HasRelationships)asset).isLocal() && asset.hasClusterPG()) return true; | return new UnaryPredicate() { public boolean execute(Object obj) { if (obj instanceof Asset) { Asset asset = (Asset)obj; if ((asset instanceof HasRelationships) && ((HasRelationships)asset).isLocal() && asset.hasClusterPG()) return true; } return false; | private static UnaryPredicate getSelfPred() { return new UnaryPredicate() { public boolean execute(Object obj) { if (obj instanceof Asset) { Asset asset = (Asset)obj; if ((asset instanceof HasRelationships) && ((HasRelationships)asset).isLocal() && asset.hasClusterPG()) return true; } return ... |
return false; } }; } | }; } | private static UnaryPredicate getSelfPred() { return new UnaryPredicate() { public boolean execute(Object obj) { if (obj instanceof Asset) { Asset asset = (Asset)obj; if ((asset instanceof HasRelationships) && ((HasRelationships)asset).isLocal() && asset.hasClusterPG()) return true; } return ... |
if (obj instanceof Asset) { Asset asset = (Asset)obj; if ((asset instanceof HasRelationships) && ((HasRelationships)asset).isLocal() && asset.hasClusterPG()) return true; | if (obj instanceof Asset) { Asset asset = (Asset)obj; if ((asset instanceof HasRelationships) && ((HasRelationships)asset).isLocal() && asset.hasClusterPG()) return true; } return false; | public boolean execute(Object obj) { if (obj instanceof Asset) { Asset asset = (Asset)obj; if ((asset instanceof HasRelationships) && ((HasRelationships)asset).isLocal() && asset.hasClusterPG()) return true; } return false; } |
return false; } | public boolean execute(Object obj) { if (obj instanceof Asset) { Asset asset = (Asset)obj; if ((asset instanceof HasRelationships) && ((HasRelationships)asset).isLocal() && asset.hasClusterPG()) return true; } return false; } | |
System.err.println("Chosen GLCapabilities: " + drawable.getChosenGLCapabilities()); | public void init(GLAutoDrawable drawable) { // Use debug pipeline // drawable.setGL(new DebugGL(drawable.getGL())); GL gl = drawable.getGL(); System.err.println("INIT GL IS: " + gl.getClass().getName()); gl.setSwapInterval(1); float pos[] = { 5.0f, 5.0f, 10.0f, 0.0f }; float red[] = { 0.8f, 0.1f,... | |
LongBuffer a = (LongBuffer) obj; | LongBuffer other = (LongBuffer) obj; | public int compareTo (Object obj) { LongBuffer a = (LongBuffer) obj; if (a.remaining () != remaining ()) return 1; if (! hasArray () || ! a.hasArray ()) { return 1; } int r = remaining (); int i1 = position (); int i2 = a.position (); for (int i = 0; i < r; i++) ... |
if (a.remaining () != remaining ()) return 1; if (! hasArray () || ! a.hasArray ()) | int num = Math.min(remaining(), other.remaining()); int pos_this = position(); int pos_other = other.position(); for (int count = 0; count < num; count++) | public int compareTo (Object obj) { LongBuffer a = (LongBuffer) obj; if (a.remaining () != remaining ()) return 1; if (! hasArray () || ! a.hasArray ()) { return 1; } int r = remaining (); int i1 = position (); int i2 = a.position (); for (int i = 0; i < r; i++) ... |
return 1; | long a = get(pos_this++); long b = other.get(pos_other++); if (a == b) continue; if (a < b) return -1; return 1; | public int compareTo (Object obj) { LongBuffer a = (LongBuffer) obj; if (a.remaining () != remaining ()) return 1; if (! hasArray () || ! a.hasArray ()) { return 1; } int r = remaining (); int i1 = position (); int i2 = a.position (); for (int i = 0; i < r; i++) ... |
int r = remaining (); int i1 = position (); int i2 = a.position (); for (int i = 0; i < r; i++) { int t = (int) (get (i1) - a.get (i2)); if (t != 0) { return (int) t; } } return 0; | return remaining() - other.remaining(); | public int compareTo (Object obj) { LongBuffer a = (LongBuffer) obj; if (a.remaining () != remaining ()) return 1; if (! hasArray () || ! a.hasArray ()) { return 1; } int r = remaining (); int i1 = position (); int i2 = a.position (); for (int i = 0; i < r; i++) ... |
if (log.isDebugEnabled()) { | if (log.isErrorEnabled()) { | private void finishStatistics() { writer.close(); if (writer.checkError()) { if (log.isDebugEnabled()) { log.error("Error writing statistics file"); } } } |
if (log.isDebugEnabled()) { | if (log.isErrorEnabled()) { | public void setupSubscriptions() { log = CSMART.createLogger(this.getClass().getName()); // Is this necessary? // This asset, in this plugin, is only used to be the place // control tasks are allocated to Asset prototype = theLDMF.createPrototype(AbstractAsset.class, "Statistics"); dummyAsset = the... |
VfsResource res = new VfsResource(vfsURI, getVFSManager()); return res.getChildren(); } | ArrayList list = new ArrayList(); Message.debug("list called for URI" + vfsURI); FileObject resourceImpl = getVFSManager().resolveFile(vfsURI); Message.debug("resourceImpl=" + resourceImpl.toString()); Message.debug("resourceImpl.exists()" + resourceImpl.exists()); Message.debug("resourceImpl.getType()" + resourceImpl.... | public List list(String vfsURI) throws IOException { VfsResource res = new VfsResource(vfsURI, getVFSManager()); return res.getChildren(); } |
assertTrue(map.size() == 6); | public void testBeanMap() { TestBean bean = new TestBean(); BeanMap map = BeanMap.create(bean); assertTrue(map.get("foo") == null); map.put("foo", "FOO"); assertTrue("FOO".equals(map.get("foo"))); assertTrue(bean.getFoo().equals("FOO")); assertTrue("x".equals(map.get... | |
ERXEOFLogEntryInterface logEntry = (ERXEOFLogEntryInterface)ERXUtilities.createEO(getLoggingEntity(), editingContext()); | ERXEOFLogEntryInterface logEntry = (ERXEOFLogEntryInterface)ERXEOControlUtilities.createAndInsertObject(editingContext(), getLoggingEntity()); | protected void subAppend(LoggingEvent event) { // Create Log Entry for event. if (editingContext() != null) { ERXEOFLogEntryInterface logEntry = (ERXEOFLogEntryInterface)ERXUtilities.createEO(getLoggingEntity(), ... |
this.log = support.getLog(); | public MetricProvider(SimpleServletSupport support) { this.support = support; } | |
final GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); | final GLCanvas canvas = new GLCanvas(); | public void run(String[] args) { dev = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); origMode = dev.getDisplayMode(); DisplayMode newMode = null; if (dev.isFullScreenSupported()) { newMode = ScreenResSelector.showSelectionDialog(); if (newMode != null) { init... |
public InputStream getStream(String key); | InputStream getStream(String key); | public InputStream getStream(String key); |
public Iterator getStreamKeys(); | Iterator getStreamKeys(); | public Iterator getStreamKeys(); |
public void setStream(String key, InputStream stream) throws IOException; | void setStream(String key, InputStream stream) throws IOException; | public void setStream(String key, InputStream stream) throws IOException; |
if(value != this.value) { | if ((value == null && this.value != null) || (value != null && ! value.equals(this.value))) { | public void setValue(Object value) { if(value != this.value) { Object old = this.value; this.value = value; try { fireValueChanged(old); } catch (RuntimeException re) { this.value = old; throw re; } } } |
if (value instanceof String) { String v = (String) value; if (v.length() < 16) { value = v.intern(); } } | public void setValue(Object value) { if(value != this.value) { Object old = this.value; this.value = value; try { fireValueChanged(old); } catch (RuntimeException re) { this.value = old; throw re; } } } | |
if (experiment != null) { saveExperiment(); return; } | private void saveToDatabase(boolean silently) { if (experiment != null) { saveExperiment(); return; } if (configComponent instanceof SocietyComponent) { if (((SocietyComponent)configComponent).isModified()) { final PropertyBuilder propertyBuilder = this; GUIUtils.timeConsumingTaskStart(this); ... | |
CSMART.getOrganizer().displayExperiments((SocietyComponent)configComponent); | if (experiment == null) CSMART.getOrganizer().displayExperiments((SocietyComponent)configComponent); | private void saveToDatabase(boolean silently) { if (experiment != null) { saveExperiment(); return; } if (configComponent instanceof SocietyComponent) { if (((SocietyComponent)configComponent).isModified()) { final PropertyBuilder propertyBuilder = this; GUIUtils.timeConsumingTaskStart(this); ... |
CSMART.getOrganizer().displayExperiments(rc); | if (experiment == null) CSMART.getOrganizer().displayExperiments(rc); | private void saveToDatabase(boolean silently) { if (experiment != null) { saveExperiment(); return; } if (configComponent instanceof SocietyComponent) { if (((SocietyComponent)configComponent).isModified()) { final PropertyBuilder propertyBuilder = this; GUIUtils.timeConsumingTaskStart(this); ... |
if (experiment != null && experiment.isModified()) { saveExperiment(); } | private void saveToDatabase(boolean silently) { if (experiment != null) { saveExperiment(); return; } if (configComponent instanceof SocietyComponent) { if (((SocietyComponent)configComponent).isModified()) { final PropertyBuilder propertyBuilder = this; GUIUtils.timeConsumingTaskStart(this); ... | |
return (Element)elements.get(0); | for (int i=0; i<elements.size(); i++) { Element element = (Element)elements.get(i); String namespace = element.getNamespaceURI(); if (!namespace.equals("") && !namespace.equals("jabber:client") && !namespace.equals("jabber:server")) { return element; } } return null; | public Element getChildElement() { List elements = element.elements(); if (elements.isEmpty()) { return null; } else { return (Element)elements.get(0); } } |
csmartTests.addTest(new TestSuite(org.cougaar.tools.csmart.experiment.AgentComponentDataTest.class)); | csmartTests.addTest(new TestSuite(org.cougaar.tools.csmart.core.cdata.AgentComponentDataTest.class)); | public static Test suite() { TestSuite csmartTests = new TestSuite(); csmartTests.addTest(new TestSuite(org.cougaar.tools.csmart.util.parser.ParserTest.class)); csmartTests.addTest(new TestSuite(org.cougaar.tools.csmart.util.parser.SimpleParserTest.class)); csmartTests.addTest(new TestSuite(org.cougaar.to... |
for(int i=0; i < nParameters; i++) { if (getProperty(PROP_PARAM + i) != null) self.addParameter(getProperty(PROP_PARAM + i).getValue()); | Iterator names = getSortedLocalPropertyNames(); while (names.hasNext()) { CompositeName cname = (CompositeName) names.next(); String name = cname.toString(); if (log.isDebugEnabled()) { log.debug("Looking at property " + name); } if (name.indexOf(PROP_PARAM) != -1) { if (log.isDebugEnabled()) { log.debug("Found paramet... | public ComponentData addComponentData(ComponentData data) { // Warning: This assumes it has been handed the component in // which to add itself if (data.getType() != ComponentData.AGENT && data.getType() != ComponentData.NODE) { if (log.isErrorEnabled()) { log.error("Asked to add to non Agent/Node: " + ... |
for (int j = 0; j < nParameters; j++) { | for (int j = 0; j < kid.parameterCount(); j++) { | protected boolean alreadyAdded(ComponentData parent, ComponentData self) { ComponentData[] children = parent.getChildren(); for (int i = 0; i < children.length; i++) { boolean isdiff = false; ComponentData kid = children[i]; if (kid.getClassName().equals(self.getClassName())) { if (kid.getType().... |
log = CSMART.createLogger(this.getClass().getName()); | log = CSMART.createLogger("org.cougaar.tools.csmart.society.ComponentBase"); | private void createLogger() { log = CSMART.createLogger(this.getClass().getName()); } |
String dirs = className.replace('.',File.separatorChar); | public byte[] toByteArray() { byte[] b = super.toByteArray(); if (debugLocation != null) { try { new File(debugLocation).mkdirs(); File file = new File(new File(debugLocation), className + ".class"); OutputStream out = new BufferedOut... | |
new File(debugLocation).mkdirs(); File file = new File(new File(debugLocation), className + ".class"); | new File(debugLocation + File.separatorChar + dirs).getParentFile().mkdirs(); File file = new File(new File(debugLocation), dirs + ".class"); | public byte[] toByteArray() { byte[] b = super.toByteArray(); if (debugLocation != null) { try { new File(debugLocation).mkdirs(); File file = new File(new File(debugLocation), className + ".class"); OutputStream out = new BufferedOut... |
file = new File(new File(debugLocation), className + ".asm"); | file = new File(new File(debugLocation), dirs + ".asm"); | public byte[] toByteArray() { byte[] b = super.toByteArray(); if (debugLocation != null) { try { new File(debugLocation).mkdirs(); File file = new File(new File(debugLocation), className + ".class"); OutputStream out = new BufferedOut... |
assert("Test isInRange()", fr.isInRange(new Float(8.5))); assert("Test isInRange()", fr.isInRange(new Float(0.01))); assert("Test isInRange()", !fr.isInRange(new Integer(5))); assert("Test isInRange()", !fr.isInRange(new Float(10.1))); assert("Test isInRange()", !fr.isInRange(new String("Hello"))); | assertTrue("Test isInRange()", fr.isInRange(new Float(8.5))); assertTrue("Test isInRange()", fr.isInRange(new Float(0.01))); assertTrue("Test isInRange()", !fr.isInRange(new Integer(5))); assertTrue("Test isInRange()", !fr.isInRange(new Float(10.1))); assertTrue("Test isInRange()", !fr.isInRange(new String("Hello"))); | public void testIsInRange() { assert("Test isInRange()", fr.isInRange(new Float(8.5))); assert("Test isInRange()", fr.isInRange(new Float(0.01))); assert("Test isInRange()", !fr.isInRange(new Integer(5))); assert("Test isInRange()", !fr.isInRange(new Float(10.1))); assert("Test isInRange()", !fr.isInRa... |
public void testToString() { String expect = new String(minimum + ":" + maximum); assertEquals("Test toString()", expect, fr.toString()); } | public void testIsInRange() { assert("Test isInRange()", fr.isInRange(new Float(8.5))); assert("Test isInRange()", fr.isInRange(new Float(0.01))); assert("Test isInRange()", !fr.isInRange(new Integer(5))); assert("Test isInRange()", !fr.isInRange(new Float(10.1))); assert("Test isInRange()", !fr.isInRa... | |
if (menuBar != null) menuBar.addNotify(); | setMenuBar(MenuBar menuBar){ this.menuBar = menuBar; if (peer != null) ((FramePeer) peer).setMenuBar(menuBar);} | |
public WOComponent update() { return null; } | public WOComponent update() { ERXExtensions.configureAdaptorContext(); return null; } | public WOComponent update() { return null; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.