rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
return CALSS_KEY_FACTORY.newInstance(args); | return CLASS_KEY_FACTORY.newInstance(args); | public static Object newClassKey(Class[] args){ return CALSS_KEY_FACTORY.newInstance(args); } |
BigInteger size = new BigInteger(Integer.toString(capacity * 3/2)); | BigInteger size = new BigInteger(Integer.toString(((capacity*3)+1)/2)); | private void init (PersistentByteMap m, File f, int capacity, int strtabSize) throws IOException { f.createNewFile(); RandomAccessFile raf = new RandomAccessFile(f, "rw"); { // The user has explicitly provided a size for the table. // We're going to make that size prime. This isn't ... |
JTextField tf = new JTextField("localhost:8484", 20); | JTextField tf = new JTextField("localhost:" + Experiment.APP_SERVER_DEFAULT_PORT, 20); | public void addAppServer() { JTextField tf = new JTextField("localhost:8484", 20); JPanel panel = new JPanel(); panel.add(new JLabel("Enter HostName:Port:")); panel.add(tf); int result = JOptionPane.showOptionDialog(null, panel, "Add Application Server", JOptionPane.OK_CANCEL_OPTION, ... |
if (index == -1) return; | String hostName = s; String port = String.valueOf(Experiment.APP_SERVER_DEFAULT_PORT); | public void addAppServer() { JTextField tf = new JTextField("localhost:8484", 20); JPanel panel = new JPanel(); panel.add(new JLabel("Enter HostName:Port:")); panel.add(tf); int result = JOptionPane.showOptionDialog(null, panel, "Add Application Server", JOptionPane.OK_CANCEL_OPTION, ... |
String hostName = s.substring(0, index); hostName = hostName.trim(); if (hostName.equals("")) return; | if (index != -1) { hostName = s.substring(0, index); hostName = hostName.trim(); if (hostName.equals("")) hostName = "localhost"; | public void addAppServer() { JTextField tf = new JTextField("localhost:8484", 20); JPanel panel = new JPanel(); panel.add(new JLabel("Enter HostName:Port:")); panel.add(tf); int result = JOptionPane.showOptionDialog(null, panel, "Add Application Server", JOptionPane.OK_CANCEL_OPTION, ... |
String port = s.substring(index+1); port = port.trim(); | port = s.substring(index+1); port = port.trim(); if (port.equals("")) port = String.valueOf(Experiment.APP_SERVER_DEFAULT_PORT); } | public void addAppServer() { JTextField tf = new JTextField("localhost:8484", 20); JPanel panel = new JPanel(); panel.add(new JLabel("Enter HostName:Port:")); panel.add(tf); int result = JOptionPane.showOptionDialog(null, panel, "Add Application Server", JOptionPane.OK_CANCEL_OPTION, ... |
GLDrawableFactory.getFactory().createGLJPanel(caps); | new GLJPanel(caps); | private JInternalFrame addWindow(int which) { // FIXME: workaround for problem in 1.6 where ALL Components, // including Swing components, are Finalizable, requiring two full // GC cycles (and running of finalizers) to reclaim System.gc(); // Try to get finalizers run try { Thread.sleep(1); ... |
return argument.substring(argument.indexOf("=")+1, argument.indexOf(",")); | return argument.substring(0, argument.indexOf(",")); | private String parseHomeLocation(String argument) { return argument.substring(argument.indexOf("=")+1, argument.indexOf(",")); } |
String uic = aad.getUIC(); aad.addPropertyGroup(setItemIdentificationPG(uic, uic.substring(uic.indexOf("/")+1), "")); | String name = clusterId.substring(clusterId.lastIndexOf(File.separatorChar)+1); aad.addPropertyGroup(setItemIdentificationPG(name, name, "")); | public AgentAssetData parsePrototypeFile(String cId) { clusterId = cId; String dataItem = ""; int newVal; String filename = getFileName(); BufferedReader input = null; Reader fileStream = null; AgentAssetData aad = new AgentAssetData(null); if(log.isDebugEnabled()) { log.debug("Setting IN... |
propData.setValue(getValue(parseArgs(dataType, tokens.sval))); | if(propData.getName().equals("HomeLocation")) { propData.setValue(parseHomeLocation(tokens.sval)); } else { propData.setValue(getValue(parseArgs(dataType, tokens.sval))); } | protected int setPropertyForAsset(String prop, int newVal, StreamTokenizer tokens, AgentAssetData aad) throws IOException { String propertyName = prop.substring(1, prop.length()-1).trim(); if(log.isDebugEnabled()) { log.debug("Creating PropGroupData: " + propertyName)... |
createLogger(); | public UnboundPropertyBuilder(Experiment experiment, ExperimentBuilder experimentBuilder) { this.experiment = experiment; this.experimentBuilder = experimentBuilder; isEditable = experiment.isEditable(); root = new DefaultMutableTreeNode(); model = new DefaultTreeModel(r... | |
societiesMenu.show(tree, e.getX(), e.getY()); | private void doPopup(MouseEvent e) { TreePath selPath = tree.getPathForLocation(e.getX(), e.getY()); if (selPath == null) return; // set the selected node to be the node the mouse is pointing at tree.setSelectionPath(selPath); DefaultMutableTreeNode popupNode = (DefaultMutableTreeNode) selPath.get... | |
System.err.println("Only 1 society in an experiment!"); | if (log.isErrorEnabled()) log.error("More than one society in experiment."); | private void reconcileExperimentNodes() { int nSocieties = societies.getChildCount(); if (nSocieties > 1) { // Only 1 society should be allowed! System.err.println("Only 1 society in an experiment!"); } else if (nSocieties == 1) { SocietyComponent society = (SocietyComponent) ((DefaultMutableT... |
SocietyComponent society = (SocietyComponent) ((DefaultMutableTreeNode) societies.getChildAt(0)).getUserObject(); | SocietyComponent newSociety = (SocietyComponent) ((DefaultMutableTreeNode) societies.getChildAt(0)).getUserObject(); | private void reconcileExperimentNodes() { int nSocieties = societies.getChildCount(); if (nSocieties > 1) { // Only 1 society should be allowed! System.err.println("Only 1 society in an experiment!"); } else if (nSocieties == 1) { SocietyComponent society = (SocietyComponent) ((DefaultMutableT... |
experiment.addSocietyComponent(society); | SocietyComponent society = experiment.getSocietyComponent(); if (society == null) experiment.addSocietyComponent(newSociety); else if (!society.equals(newSociety)) if (log.isErrorEnabled()) log.error("Attempted to add society to experiment that has a society."); } else if (nSocieties == 0) { experiment.removeSocietyCom... | private void reconcileExperimentNodes() { int nSocieties = societies.getChildCount(); if (nSocieties > 1) { // Only 1 society should be allowed! System.err.println("Only 1 society in an experiment!"); } else if (nSocieties == 1) { SocietyComponent society = (SocietyComponent) ((DefaultMutableT... |
public void setEditable(boolean param1) | public void setEditable(boolean editable) | public void setEditable(boolean param1) { this.editable = editable; } |
return f1.invoke(i1, obj, args); | try { return f1.invoke(i1, obj, args); } catch (InvocationTargetException e) { throw e.getTargetException(); } | public Object invoke(Object obj, Object[] args) throws Throwable { if (i1 == -1) { throw new IllegalAccessException("Protected method: " + m1); } else { return f1.invoke(i1, obj, args); } } |
return f2.invoke(i2, obj, args); | try { return f2.invoke(i2, obj, args); } catch (InvocationTargetException e) { throw e.getTargetException(); } | public Object invokeSuper(Object obj, Object[] args) throws Throwable { if (i2 == -1) { throw new IllegalAccessException("Protected method: " + m2); } else { return f2.invoke(i2, obj, args); } } |
log.error("Unlocking context that wasn't unlocked in RR-Loop!: " + ec); | log.warn("Unlocking context that wasn't unlocked in RR-Loop!: " + ec); | public static void unlockAllContextsForCurrentThread() { Vector ecs = (Vector)ERXThreadStorage.valueForKey(LockedContextsForCurrentThreadKey+Thread.currentThread().getName()); ERXThreadStorage.removeValueForKey(LockedContextsForCurrentThreadKey+Thread.currentThread().getName()); log.debug("unlockAllCont... |
animator.stop(); System.exit(0); | new Thread(new Runnable() { public void run() { animator.stop(); System.exit(0); } }).start(); | public static void main(String[] args) { Frame frame = new Frame("Gear Demo"); GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); // Use debug pipeline // canvas.setGL(new DebugGL(canvas.getGL())); System.err.println("CANVAS GL IS: " + canvas.getGL().getClass().ge... |
GregorianCalendar calendar = calendarForTimestamp(t); | GregorianCalendar calendar = (GregorianCalendar) Calendar.getInstance(); | public static GregorianCalendar calendarForTimestamp(NSTimestamp t) { GregorianCalendar calendar = calendarForTimestamp(t); calendar.setTime(t); return calendar; } |
return target.getAllowsChildren() && (isDroppable(possibleFlavors, target) == DnDConstants.ACTION_MOVE); | if (target.getAllowsChildren()) { int result = isDroppable(possibleFlavors, target); return (result == DnDConstants.ACTION_MOVE || result == DnDConstants.ACTION_COPY); } else return false; | private boolean isAllowed(DataFlavor[] possibleFlavors, DefaultMutableTreeNode target) { return target.getAllowsChildren() && (isDroppable(possibleFlavors, target) == DnDConstants.ACTION_MOVE); } |
substitutions.put(":cmt_type", cmtType); | substitutions.put(":cmt_type:", cmtType); | public PopulateDb(String cmtType, String hnaType, String csmType, String experimentName, String exptId, String trialId, boolean createNew) throws SQLException, IOException { if (cmtType == null) throw new IllegalArgumentException("null cmtType"); if ... |
setAssemblyMatch(); | public PopulateDb(String cmtType, String hnaType, String csmType, String experimentName, String exptId, String trialId, boolean createNew) throws SQLException, IOException { if (cmtType == null) throw new IllegalArgumentException("null cmtType"); if ... | |
log = CSMART.createLogger("org.cougaar.tools.csmart.runtime.binder"); | createLogger(); | protected CapacityChartImpl() { log = CSMART.createLogger("org.cougaar.tools.csmart.runtime.binder"); } |
return ("ActionEvent[" + actionCommand + "," + modifiers + ";" + super.paramString () + "]"); | String r; switch (id) { case ACTION_PERFORMED: r = "ACTION_PERFORMED"; break; default: r = "unknown type"; break; } r += ",cmd=" + cmd; return r; | public String paramString () { return ("ActionEvent[" + actionCommand + "," + modifiers + ";" + super.paramString () + "]"); } |
JOptionPane.OK_OPTION); | JOptionPane.PLAIN_MESSAGE); | private void displayProcessInfo(ProcessStatus[] ps) { String[][] psInfo = new String[ps.length][]; for (int i = 0; i < ps.length; i++) { String[] singlePSInfo = new String[5]; singlePSInfo[0] = String.valueOf(ps[i].getProcessIdentifier()); singlePSInfo[1] = String.valueOf(ps[i].getStartTime()); ... |
if (Configuration.DEBUG) { String val = System.getProperty("gcj.dumpobjects"); if (dump == false && val != null && !val.equals("")) { dump = true; System.out.println ("Serialization debugging enabled"); } else if (dump == true && (val == null || val.equals(""))) { dump = false; System.out.println ("Serialization debugg... | public ObjectInputStream (InputStream in) throws IOException, StreamCorruptedException { this.resolveEnabled = false; this.isDeserializing = false; this.blockDataPosition = 0; this.blockDataBytes = 0; this.blockData = new byte[BUFFER_SIZE]; this.blockDataInput = new DataInputStream (this); th... | |
try { if (myProp.getExperimentValues() != null) { List experimentValues = myProp.getExperimentValues(); Object newValue = Array.newInstance(myProp.getPropertyClass(), experimentValues.size()); for (int j = 0; j < experimentValues.size(); j++) Array.set(newValue, j, PropertyHelper.validateValue(myProp, experimentValue... | if (hisProp == null) { if (log.isErrorEnabled()) { log.error("Report bug 1377: Using " + CSMART.writeDebug() + " couldn't find " + hisPropName.toString() + " in " + result.getFullName().toString() + " copying from " + name.toString() + " in " + this.getFullName().toString()); | public BaseComponent copy(BaseComponent result) { // Make sure we're copying apples into apples // The result can be a sub-class, but we want it // to at least have the same set of properties if (! (this.getClass().isAssignableFrom(result.getClass()))) return null; Iterator iter = getSortedLocalPr... |
} catch (InvalidPropertyValueException e) { if(log.isErrorEnabled()) { log.error("Caught InvalidPropertyValueException: " + getClass().getName() + e); } } } | } else { try { if (myProp.getExperimentValues() != null) { List experimentValues = myProp.getExperimentValues(); Object newValue = Array.newInstance(myProp.getPropertyClass(), experimentValues.size()); for (int j = 0; j < experimentValues.size(); j++) Array.set(newValue, j, PropertyHelper.validateValue(myProp, experi... | public BaseComponent copy(BaseComponent result) { // Make sure we're copying apples into apples // The result can be a sub-class, but we want it // to at least have the same set of properties if (! (this.getClass().isAssignableFrom(result.getClass()))) return null; Iterator iter = getSortedLocalPr... |
switch (Integer.valueOf(theProps.getProperty("sms.gsm.myBit", "8")).intValue()){ | switch (Integer.valueOf(theProps.getProperty("sms.gsm.bit", "8")).intValue()){ | public void init(Properties theProps) throws SmsException { mySerialPortName=theProps.getProperty("sms.gsm.serialport", "COM1"); CommPortIdentifier portId = null; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); /* find the requested port */ while (portList.hasMo... |
if(log.isDebugEnabled()) { | if(log.isInfoEnabled()) { | public SlowMessageTransportServiceFilter() { createLogger(); if(log.isDebugEnabled()) { log.info("\n\n SlowMT created\n\n"); } } |
if(log.isDebugEnabled()) { | if(log.isInfoEnabled()) { | public SlowMessageTransportServiceProxy createSlowMessageTransportServiceProxy( MessageTransportService origMT, Object requestor) { if(log.isDebugEnabled()) { log.info("\n\nCreate slow MT for "+requestor+"\n\n"); } // create a new wrapped MessageTransportService // // requestor should be... |
protected PropertyEditorSupport() { this.eventSource = this; this.pSupport = new PropertyChangeSupport(this); } | public PropertyEditorSupport() { eventSource = this; pSupport = new PropertyChangeSupport(this); } | protected PropertyEditorSupport() { this.eventSource = this; this.pSupport = new PropertyChangeSupport(this); } |
public void setAsText(String s) throws IllegalArgumentException { if(s.equals("null")) { setValue(null); } else { throw new IllegalArgumentException(); } } | public void setAsText(String s) throws IllegalArgumentException { if (s.equals("null")) setValue(null); else throw new IllegalArgumentException(); } | public void setAsText(String s) throws IllegalArgumentException { if(s.equals("null")) { setValue(null); } else { throw new IllegalArgumentException(); } } |
if (!closed) flush (); return error_occurred | pw.checkError (); | flush (); return error_occurred; | public boolean checkError () { if (!closed) flush (); return error_occurred | pw.checkError (); } |
pw.close (); closed = true; | try { flush(); out.close(); } catch (InterruptedIOException iioe) { Thread.currentThread().interrupt(); } catch (IOException e) { setError (); } | public void close () { pw.close (); closed = true; } |
pw.flush(); | try { out.flush(); } catch (InterruptedIOException iioe) { Thread.currentThread().interrupt(); } catch (IOException e) { setError (); } | public void flush () { pw.flush(); } |
public void print (boolean bool) | private synchronized void print (String str, boolean println) | public void print (boolean bool) { print (String.valueOf (bool)); } |
print (String.valueOf (bool)); | try { writeChars(str, 0, str.length()); if (println) writeChars(line_separator, 0, line_separator.length); if (auto_flush) flush(); } catch (InterruptedIOException iioe) { Thread.currentThread().interrupt(); } catch (IOException e) { setError (); } | public void print (boolean bool) { print (String.valueOf (bool)); } |
pw.println(); | print(line_separator, 0, line_separator.length, false); | public void println () { pw.println(); } |
flush(); | public void write (int oneByte) { // We actually have to implement this method. Flush first so that // things get written in the right order. flush(); try { out.write (oneByte & 0xff); if (auto_flush && (oneByte == '\n')) flush (); } catch (IOException e) ... | |
catch (InterruptedIOException iioe) { Thread.currentThread ().interrupt (); } | public void write (int oneByte) { // We actually have to implement this method. Flush first so that // things get written in the right order. flush(); try { out.write (oneByte & 0xff); if (auto_flush && (oneByte == '\n')) flush (); } catch (IOException e) ... | |
String anEntityName = _localSourceEntityName(); EOModelGroup aModelGroup = EOModelGroup.defaultGroup(); EOEntity anEntity = aModelGroup.entityNamed(anEntityName); if (anEntity == null) { throw new IllegalStateException("<" + getClass().getName() + " could not find entity named " + anEntityName + ">"); } | String anEntityName = (String)valueForBinding("destinationEntityName"); | protected EOEntity destinationEntity() { String anEntityName = _localSourceEntityName(); // FIXME (msanchez, 08/00, 2520053): use modelGroup on ObjectStoreCoordinator of our editingContext EOModelGroup aModelGroup = EOModelGroup.defaultGroup(); EOEntity anEntity = aModelGroup.entityNamed... |
EORelationship relationship = ERXUtilities.relationshipWithObjectAndKeyPath((EOEnterpriseObject)_source, _localRelationshipKey()); if(relationship!=null) { destinationEntity = relationship.destinationEntity(); | anEditingContext = ((EOEnterpriseObject)_source).editingContext(); } if (anEditingContext == null) { anEditingContext = session().defaultEditingContext() ; } if(anEntityName != null) { anEntityName = _localSourceEntityName(); EOEntity anEntity = EOUtilities.entityNamed(anEditingContext, anEntityName); if (anEntity == ... | protected EOEntity destinationEntity() { String anEntityName = _localSourceEntityName(); // FIXME (msanchez, 08/00, 2520053): use modelGroup on ObjectStoreCoordinator of our editingContext EOModelGroup aModelGroup = EOModelGroup.defaultGroup(); EOEntity anEntity = aModelGroup.entityNamed... |
} if (destinationEntity == null) { destinationEntity = entityWithEntityAndKeyPath(anEntity, _localRelationshipKey()); | if (_source instanceof EOEnterpriseObject) { EORelationship relationship = ERXUtilities.relationshipWithObjectAndKeyPath((EOEnterpriseObject)_source, _localRelationshipKey()); if(relationship!=null) { destinationEntity = relationship.destinationEntity(); } } if (destinationEntity == null) { destinationEntity = entityWi... | protected EOEntity destinationEntity() { String anEntityName = _localSourceEntityName(); // FIXME (msanchez, 08/00, 2520053): use modelGroup on ObjectStoreCoordinator of our editingContext EOModelGroup aModelGroup = EOModelGroup.defaultGroup(); EOEntity anEntity = aModelGroup.entityNamed... |
FloatBuffer a = (FloatBuffer) obj; | FloatBuffer other = (FloatBuffer) obj; | public int compareTo (Object obj) { FloatBuffer a = (FloatBuffer) 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) { FloatBuffer a = (FloatBuffer) 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; | float a = get(pos_this++); float b = other.get(pos_other++); if (a == b) continue; if (a < b) return -1; return 1; | public int compareTo (Object obj) { FloatBuffer a = (FloatBuffer) 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) { FloatBuffer a = (FloatBuffer) 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(varName == null) { varName = "dhtml_" + ERXExtensions.replaceStringByStringInString("-", "_", "" + context().elementID().hashCode()); } | public String varName() { String varName = (String)valueForBinding("varName"); return varName; } | |
adjustForGravity (gbc, rect); | throw new Error ("Not implemented"); | protected void AdjustForGravity (GridBagConstraints gbc, Rectangle rect) { adjustForGravity (gbc, rect); } |
arrangeGrid (parent); | Component[] components = parent.getComponents(); if (components.length == 0) return; GridBagLayoutInfo info = getLayoutInfo (parent, PREFERREDSIZE); if (info.cols == 0 && info.rows == 0) return; layoutInfo = info; for(int i = 0; i < components.length; i++) { Component component = components [i]; if (!component.... | protected void ArrangeGrid (Container parent) { arrangeGrid (parent); } |
return getLayoutInfo (parent, sizeflag); | if (sizeflag != MINSIZE && sizeflag != PREFERREDSIZE) throw new IllegalArgumentException(); Dimension parentDim = parent.getSize (); Insets parentInsets = parent.getInsets (); parentDim.width -= parentInsets.left + parentInsets.right; parentDim.height -= parentInsets.top + parentInsets.bottom; int x = 0; int y = 0; i... | protected GridBagLayoutInfo GetLayoutInfo (Container parent, int sizeflag) { return getLayoutInfo (parent, sizeflag); } |
return getMinSize (parent, info); | if (parent == null || info == null) return new Dimension (0, 0); Insets insets = parent.getInsets(); int width = sumIntArray (info.colWidths) + insets.left + insets.right; int height = sumIntArray (info.rowHeights) + insets.top + insets.bottom; return new Dimension (width, height); | protected Dimension GetMinSize (Container parent, GridBagLayoutInfo info) { return getMinSize (parent, info); } |
throw new Error ("Not implemented"); | AdjustForGravity (gbc, rect); | protected void adjustForGravity (GridBagConstraints gbc, Rectangle rect) { // FIXME throw new Error ("Not implemented"); } |
Component[] components = parent.getComponents(); if (components.length == 0) return; GridBagLayoutInfo info = getLayoutInfo (parent, PREFERREDSIZE); if (info.cols == 0 && info.rows == 0) return; layoutInfo = info; for(int i = 0; i < components.length; i++) { Component component = components [i]; if (!component.... | ArrangeGrid (parent); | protected void arrangeGrid (Container parent) { Component[] components = parent.getComponents(); if (components.length == 0) return; GridBagLayoutInfo info = getLayoutInfo (parent, PREFERREDSIZE); if (info.cols == 0 && info.rows == 0) return; layoutInfo = info; // DEBUG //dumpLayoutInfo (layoutInfo); ... |
if (sizeflag != MINSIZE && sizeflag != PREFERREDSIZE) throw new IllegalArgumentException(); Dimension parentDim = parent.size(); Insets parentInsets = parent.insets(); parentDim.width -= parentInsets.left + parentInsets.right; parentDim.height -= parentInsets.top + parentInsets.bottom; int x = 0; int y = 0; int max_x... | return GetLayoutInfo (parent, sizeflag); | protected GridBagLayoutInfo getLayoutInfo (Container parent, int sizeflag) { if (sizeflag != MINSIZE && sizeflag != PREFERREDSIZE) throw new IllegalArgumentException(); Dimension parentDim = parent.size(); Insets parentInsets = parent.insets(); parentDim.width -= parentInsets.left + parentInsets.right; paren... |
if (parent == null || info == null) return new Dimension (0, 0); Insets insets = parent.getInsets(); int width = sumIntArray (info.colWidths) + insets.left + insets.right; int height = sumIntArray (info.rowHeights) + insets.top + insets.bottom; return new Dimension (width, height); | return GetMinSize (parent, info); | protected Dimension getMinSize (Container parent, GridBagLayoutInfo info) { if (parent == null || info == null) return new Dimension (0, 0); Insets insets = parent.getInsets(); int width = sumIntArray (info.colWidths) + insets.left + insets.right; int height = sumIntArray (info.rowHeights) + insets.top + ins... |
if (action.equals(BUILD_COMMUNITY_ACTION)) return true; | private static boolean isActionAllowedOnExperiment(String action, Organizer organizer, Experiment experiment) { if (action.equals(BUILD_COMMUNITY_ACTION)) return true; if (action.equals(DUPLICATE_ACTION)... | |
if (xmlFile != null && !CommunityDbUtils.importCommunityXML(xmlFile, experiment.getCommAsbID())) { if (log.isInfoEnabled()) { log.info("crtExpFromFile got no Community XML data out of " + xmlFile.getAbsolutePath()); } } | protected void createExperimentFromFile() { SocietyComponent society = helper.createSocietyFromFile(); if (society == null) return; Experiment experiment = createExperiment(society); // Add in community info for this society JFileChooser chooser = new JFileChooser(SocietyFinder.getInstance()... | |
Float f = (Float) obj; | float f = ((Float) obj).value; | public boolean equals (Object obj) { if (!(obj instanceof Float)) return false; Float f = (Float) obj; return floatToIntBits (value) == floatToIntBits (f.floatValue ()); } |
return floatToIntBits (value) == floatToIntBits (f.floatValue ()); | return floatToIntBits (value) == floatToIntBits (f); | public boolean equals (Object obj) { if (!(obj instanceof Float)) return false; Float f = (Float) obj; return floatToIntBits (value) == floatToIntBits (f.floatValue ()); } |
break; | public void execute() { switch (state) { case INITIAL: // No point in looking for metrics providers if there ate no local // Assets if (localAssets.size() > 0) { for (Iterator iterator = localAssets.getCollection().iterator(); iterator.hasNext();) { addMetricsProvider... | |
ERXArrayUtilities.sortedArraySortedWithKey(aSortedArray, _localSortKey()); | ERXArrayUtilities.sortArrayWithKey(aSortedArray, _localSortKey()); | public NSArray theList() { NSMutableArray aSortedArray; NSArray anUnsortedArray; if (_privateList()==null) { EODataSource aDataSource = _localDataSource(); // Need to make sure that the eos are in the right editingContext. anUnsortedArray = ERXUtilities.localIns... |
log = CSMART.createLogger("org.cougaar.tools.csmart.core.cdata"); | public GenericComponentData() { children = new ArrayList(); parameters = new ArrayList(); leafComponents = new ArrayList(); timePhasedData = new ArrayList(); log = CSMART.createLogger("org.cougaar.tools.csmart.core.cdata"); } | |
assert("Test endsWith()", tst.endsWith(new SimpleName(componentName))); | assertTrue("Test endsWith()", tst.endsWith(new SimpleName(componentName))); | public void testEndsWith() { assert("Test endsWith()", tst.endsWith(new SimpleName(componentName))); } public void testStartsWith() { assert("Test starsWith()", tst.startsWith(new SimpleName("Parent"))); } public void testEquals() { assert("Test equals()", tst.equals(tst)); } public void testCompareTo(... |
public void testStartsWith() { assert("Test starsWith()", tst.startsWith(new SimpleName("Parent"))); } public void testEquals() { assert("Test equals()", tst.equals(tst)); } public void testCompareTo() { assert("Test compareTo() [0]", (tst.compareTo(new SimpleMultiName(componentName)) == 0)); SimpleName sn = new Simp... | public void testEndsWith() { assert("Test endsWith()", tst.endsWith(new SimpleName(componentName))); } public void testStartsWith() { assert("Test starsWith()", tst.startsWith(new SimpleName("Parent"))); } public void testEquals() { assert("Test equals()", tst.equals(tst)); } public void testCompareTo(... | |
ivy.setVariable("ivy.custom.test.dir", new File("test/java/fr/jayasoft/ivy").toURL().toString()); | public void testTypedefWithCustomClasspath() throws Exception { Ivy ivy = new Ivy(); ivy.configure(ConfigureTest.class.getResource("ivyconf-custom-typedef.xml")); DependencyResolver custom = ivy.getResolver("custom"); assertNotNull(custom); assertEquals("fr.jayasoft.ivy.re... | |
Range r = findLastNumber(_default); if (r == null) { return new NewRevision(revision, _default, null, null); | if (revPrefix.length() > 0) { return new NewRevision(revision, revPrefix+(revPrefix.endsWith(".")?"0":".0"), null, "0"); | private NewRevision computeNewRevision(String revision) { if (revision == null) { Range r = findLastNumber(_default); if (r == null) { // no number found return new NewRevision(revision, _default, null, null); } else { long n = Long.parseLong(_default.substring(r.startIndex, r.endIndex)); return new Ne... |
long n = Long.parseLong(_default.substring(r.startIndex, r.endIndex)); return new NewRevision(revision, _default, null, String.valueOf(n)); | Range r = findLastNumber(_default); if (r == null) { return new NewRevision(revision, _default, null, null); } else { long n = Long.parseLong(_default.substring(r.startIndex, r.endIndex)); return new NewRevision(revision, _default, null, String.valueOf(n)); } | private NewRevision computeNewRevision(String revision) { if (revision == null) { Range r = findLastNumber(_default); if (r == null) { // no number found return new NewRevision(revision, _default, null, null); } else { long n = Long.parseLong(_default.substring(r.startIndex, r.endIndex)); return new Ne... |
} String revPrefix = "latest.integration".equals(_revision)?"":_revision.substring(0, _revision.length() - 1); if (!revision.startsWith(revPrefix)) { throw new BuildException("invalid exception found in repository: '"+revision+"' for '"+revPrefix+"'"); | private NewRevision computeNewRevision(String revision) { if (revision == null) { Range r = findLastNumber(_default); if (r == null) { // no number found return new NewRevision(revision, _default, null, null); } else { long n = Long.parseLong(_default.substring(r.startIndex, r.endIndex)); return new Ne... | |
log = CSMART.createLogger("org.cougaar.tools.csmart.experiment"); | createLogger(); | public Experiment(String name, SocietyComponent[] societyComponents, RecipeComponent[] recipes) { this(name); log = CSMART.createLogger("org.cougaar.tools.csmart.experiment"); setSocietyComponents(societyComponents); setRecipes(recipes); setDefaultNodeArguments(); } |
organizer.buildCommunityAction, | public OrganizerMouseListener(Organizer organizer, OrganizerTree workspace) { this.organizer = organizer; this.workspace = workspace; // define pop-up menus Object[] rootMenuItems = { newExperimentMenu, newRecipeMenu, organizer.newFolderAction, organizer.... | |
case 'W': addConverter(new AppInfoPatternConverter(formattingInfo, extractOption())); currentLiteral.setLength(0); break; | public void finalizeConverter(char c) { switch (c) { case '$': addConverter(new AppNamePatternConverter(formattingInfo)); currentLiteral.setLength(0); break; case '#': addConverter(new AdaptorPortNumberConverter(formattingInf... | |
if (_source instanceof EOEnterpriseObject) { | if (_localSourceObjectIsEO()) { | protected EODataSource _localDataSource() { if (null==dataSource()) { setDataSource((EODataSource)valueForBinding("dataSource")); if (dataSource() == null) { String anEntityName = (String)valueForBinding("destinationEntityName"); EOEntity destinationEntity ... |
if (_localSourceObject() instanceof EOEnterpriseObject && hasKeyPath()) { | if (_localSourceObjectIsEO() && hasKeyPath()) { | protected Object _localRelativeSourceObject() { Object relativeSourceObject = null; if (_localSourceObject() instanceof EOEnterpriseObject && hasKeyPath()) { String partialKeyPath=ERXStringUtilities.keyPathWithoutLastProperty(_localRelationshipKey()); relativeSourceObject = ((EOE... |
protected boolean hasKeyPath() { return _localRelationshipKey().indexOf(".") != -1; } | protected boolean hasKeyPath() { return _localSourceObjectIsEO() ? _localRelationshipKey().indexOf(".") != -1 : false; } | protected boolean hasKeyPath() { return _localRelationshipKey().indexOf(".") != -1; } |
if (_localRelativeSourceObject() instanceof EOEnterpriseObject) { | if (_localSourceObjectIsEO()) { | public void takeValuesFromRequest(WORequest r, WOContext c) { // we want to pass the validation here for the case where we are creating a new object // and are given isMandatory=0 on a mandatory relationship to force users to pick one.. super.takeValuesFromRequest(r, c); if (_localRelati... |
if(_sourceObject instanceof EOEnterpriseObject && ((EOEnterpriseObject)_sourceObject).editingContext() != null) | if(_localSourceObjectIsEO() && ((EOEnterpriseObject)_sourceObject).editingContext() != null) | public NSArray theList() { NSMutableArray aSortedArray; NSArray anUnsortedArray; if (_privateList()==null ) { EODataSource aDataSource = _localDataSource(); // Need to make sure that the eos are in the right editingContext. // ak: We get a dictionary as object if we us... |
if (_localSourceObject() instanceof EOEnterpriseObject && | if (_localSourceObjectIsEO() && | public NSArray theList() { NSMutableArray aSortedArray; NSArray anUnsortedArray; if (_privateList()==null ) { EODataSource aDataSource = _localDataSource(); // Need to make sure that the eos are in the right editingContext. // ak: We get a dictionary as object if we us... |
if (_localSourceObject() instanceof EOEnterpriseObject) { | if (_localSourceObjectIsEO()) { | public NSArray theList() { NSMutableArray aSortedArray; NSArray anUnsortedArray; if (_privateList()==null ) { EODataSource aDataSource = _localDataSource(); // Need to make sure that the eos are in the right editingContext. // ak: We get a dictionary as object if we us... |
boolean isDictionary = (aSourceObject instanceof NSMutableDictionary); | boolean isDictionary = !_localSourceObjectIsEO(); | public void updateSourceObject(Object anEO) { String masterKey = _localRelationshipKey(); Object aSourceObject = _localSourceObject(); boolean isDictionary = (aSourceObject instanceof NSMutableDictionary); NSMutableDictionary _dictionary = (isDictionary) ? (NSMutableDictionary)aSourceObj... |
if (_eo != null && masterKey.indexOf(".") != -1) { | if (_eo != null && masterKey.indexOf(".") != -1 && !isDictionary) { | public void updateSourceObject(Object anEO) { String masterKey = _localRelationshipKey(); Object aSourceObject = _localSourceObject(); boolean isDictionary = (aSourceObject instanceof NSMutableDictionary); NSMutableDictionary _dictionary = (isDictionary) ? (NSMutableDictionary)aSourceObj... |
super.redo(); | public void redo() { object.restoreState(postState); } | |
super.undo(); | public void undo() { object.restoreState(preState); } | |
ensureResolved(isHaltonfailure()); _conf = getProperty(_conf, ivy, "ivy.resolved.configurations"); if (_conf.equals("*")) { _conf = getProperty(ivy, "ivy.resolved.configurations"); } _organisation = getProperty(_organisation, ivy, "ivy.organisation"); _module = getProperty(_module, ivy, "ivy.module"); if (_cache == nul... | protected List getPaths() throws BuildException, ParseException, IOException { Ivy ivy = getIvyInstance(); ensureResolved(isHaltonfailure()); _conf = getProperty(_conf, ivy, "ivy.resolved.configurations"); if (_conf.equals("*")) { _conf = getProperty(ivy, "ivy.resolved... | |
AWTEventMulticaster.add (windowFocusListener, wfl); | windowFocusListener = AWTEventMulticaster.add (windowFocusListener, wfl); | public void addWindowFocusListener (WindowFocusListener wfl) { AWTEventMulticaster.add (windowFocusListener, wfl); } |
AWTEventMulticaster.add (windowStateListener, wsl); | windowStateListener = AWTEventMulticaster.add (windowStateListener, wsl); | public void addWindowStateListener (WindowStateListener wsl) { AWTEventMulticaster.add (windowStateListener, wsl); } |
&& (windowListener != null | && (windowListener != null || windowFocusListener != null || windowStateListener != null | void dispatchEventImpl(AWTEvent e) { // Make use of event id's in order to avoid multiple instanceof tests. if (e.id <= WindowEvent.WINDOW_LAST && e.id >= WindowEvent.WINDOW_FIRST && (windowListener != null || (eventMask & AWTEvent.WINDOW_EVENT_MASK) != 0)) processEvent(e); else ... |
synchronized (ownedWindows) | synchronized (getTreeLock ()) | public void dispose() { hide(); synchronized (ownedWindows) { Iterator e = ownedWindows.iterator(); while(e.hasNext()) { Window w = (Window)(((Reference) e.next()).get()); if (w != null) w.dispose(); else // Remove null weak reference from ownedWindows. e.remove(); } ... |
for (int i = 0; i < ncomponents; ++i) component[i].removeNotify(); this.removeNotify(); | public void dispose() { hide(); synchronized (ownedWindows) { Iterator e = ownedWindows.iterator(); while(e.hasNext()) { Window w = (Window)(((Reference) e.next()).get()); if (w != null) w.dispose(); else // Remove null weak reference from ownedWindows. e.remove(); } ... | |
synchronized (ownedWindows) | synchronized (getTreeLock ()) | public Window[] getOwnedWindows() { Window [] trimmedList; synchronized (ownedWindows) { // Windows with non-null weak references in ownedWindows. Window [] validList = new Window [ownedWindows.size()]; Iterator e = ownedWindows.iterator(); int numValid = 0; while (e.hasNext()) { Window w = (Window)... |
synchronized (ownedWindows) | synchronized (getTreeLock ()) | public void hide() { // Hide visible owned windows. synchronized (ownedWindows) { Iterator e = ownedWindows.iterator(); while(e.hasNext()) { Window w = (Window)(((Reference) e.next()).get()); if (w != null) { if (w.isVisible() && w.getPeer() != null) w.getPeer().setVisible(false); ... |
if (windowListener != null) | int id = evt.getID(); if (id == WindowEvent.WINDOW_GAINED_FOCUS || id == WindowEvent.WINDOW_LOST_FOCUS) processWindowFocusEvent (evt); else if (id == WindowEvent.WINDOW_STATE_CHANGED) processWindowStateEvent (evt); else | protected void processWindowEvent(WindowEvent evt) { if (windowListener != null) { switch (evt.getID()) { case WindowEvent.WINDOW_ACTIVATED: windowListener.windowActivated(evt); break; case WindowEvent.WINDOW_CLOSED: windowListener.windowClos... |
switch (evt.getID()) { case WindowEvent.WINDOW_ACTIVATED: windowListener.windowActivated(evt); break; case WindowEvent.WINDOW_CLOSED: windowListener.windowClosed(evt); break; case WindowEvent.WINDOW_CLOSING: windowListener.windowClosing(evt); break; case WindowEvent.WINDOW_DEACTIVATED: windowListener.windowDeactivated(... | if (windowListener != null) { switch (evt.getID()) { case WindowEvent.WINDOW_ACTIVATED: windowListener.windowActivated(evt); break; case WindowEvent.WINDOW_CLOSED: windowListener.windowClosed(evt); break; case WindowEvent.WINDOW_CLOSING: windowListener.windowClosing(evt); break; case WindowEvent.WINDOW_DEACTIVATED: ... | protected void processWindowEvent(WindowEvent evt) { if (windowListener != null) { switch (evt.getID()) { case WindowEvent.WINDOW_ACTIVATED: windowListener.windowActivated(evt); break; case WindowEvent.WINDOW_CLOSED: windowListener.windowClos... |
AWTEventMulticaster.remove (windowFocusListener, wfl); | windowFocusListener = AWTEventMulticaster.remove (windowFocusListener, wfl); | public void removeWindowFocusListener (WindowFocusListener wfl) { AWTEventMulticaster.remove (windowFocusListener, wfl); } |
AWTEventMulticaster.remove (windowStateListener, wsl); | windowStateListener = AWTEventMulticaster.remove (windowStateListener, wsl); | public void removeWindowStateListener (WindowStateListener wsl) { AWTEventMulticaster.remove (windowStateListener, wsl); } |
synchronized (ownedWindows) | synchronized (getTreeLock()) | public void show() { if (parent != null && !parent.isDisplayable()) parent.addNotify(); if (peer == null) addNotify(); // Show visible owned windows. synchronized (ownedWindows) { Iterator e = ownedWindows.iterator(); while(e.hasNext()) { Window w = (Window)(((Reference) e.next()).ge... |
public static ERD2WModel erDefaultModel() { return (ERD2WModel)D2WModel.defaultModel(); } | public static ERD2WModel erDefaultModel() { if(!(D2WModel.defaultModel() instanceof ERD2WModel)) { D2WModel.setDefaultModel(new ERD2WModel(NSArray.EmptyArray)); log.warn("erDefaultModel had wrong class, fixing to ERD2WModel"); } return (ERD2WModel)D2WModel.defaultModel(); } | public static ERD2WModel erDefaultModel() { return (ERD2WModel)D2WModel.defaultModel(); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.