rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
checked.set(index); dup(); aaload(index); invoke(MethodConstants.CLASS_GET_NAME); final Map fbuckets = buckets; String[] names = (String[])buckets.keySet().toArray(new String[buckets.size()]); string_switch_hash(names, new ObjectSwitchCallback() { public void processCase(Object key, Label dontUseEnd) throws Exceptio... | private void member_helper_type(List members, final ObjectSwitchCallback callback, final ParameterTyper typer, final Label def, final Label end, ... | |
if( propRelations != null && count != propRelations.length ) { for(int i=0; i < propRelations.length; i++) { removeProperty(propRelations[i]); } } if( propRoles != null && count != propRoles.length ) { for(int i=0; i < propRoles.length; i++) { removeProperty(propRoles[i]); } } | private void updateRelationCount(Integer newCount) { int count = newCount.intValue(); propRelations = new Property[count]; propRoles = new Property[count]; // Note: If you feel you want to change the name of these // properties, see the "Hack Note" above. for(int i=0; i < count; i++) { propRela... | |
else if (separatorChar == '\\' && path.length () > 1 && path.charAt (1) == ':' && ((path.charAt (0) >= 'a' && path.charAt (0) <= 'z') || (path.charAt (0) >= 'A' && path.charAt (0) <= 'Z'))) { String drvDir = null; try { drvDir = new File (path.substring (0, 2)).getCanonicalPath (); } catch (IOException e) { drvDir ... | public String getAbsolutePath () { if (isAbsolute ()) return path; else if (separatorChar == '\\' && path.length () > 0 && path.charAt (0) == '\\') { // On Windows, even if the path starts with a '\\' it is not // really absolute until we prefix the drive specifier from ... | |
int last = path.lastIndexOf(separatorChar); return path.substring(last + 1); | int nameSeqIndex = 0; if (separatorChar == '\\' && path.length () > 1) { if ((path.charAt (0) == '\\' && path.charAt (1) == '\\') || (((path.charAt (0) >= 'a' && path.charAt (0) <= 'z') || (path.charAt (0) >= 'A' && path.charAt (0) <= 'Z')) && path.charAt (1) == ':')) { if (path.length () > 2) nameSeqIndex = 2; else... | public String getName () { int last = path.lastIndexOf(separatorChar); return path.substring(last + 1); } |
int last = path.lastIndexOf(separatorChar); if (last == -1) | String prefix = null; int nameSeqIndex = 0; if (separatorChar == '/' && path.charAt (0) == '/') { prefix = "/"; nameSeqIndex = 1; } else if (separatorChar == '\\' && path.length () > 1) { if ((path.charAt (0) == '\\' && path.charAt (1) == '\\') || (((path.charAt (0) >= 'a' && path.charAt (0) <= 'z') || (path.charAt... | public String getParent () { int last = path.lastIndexOf(separatorChar); if (last == -1) return null; // FIXME: POSIX assumption. if (last == 0 && path.charAt (0) == '/') ++last; return path.substring(0, last); } |
if (last == 0 && path.charAt (0) == '/') ++last; return path.substring(0, last); | public String getParent () { int last = path.lastIndexOf(separatorChar); if (last == -1) return null; // FIXME: POSIX assumption. if (last == 0 && path.charAt (0) == '/') ++last; return path.substring(0, last); } | |
String elementName = (String) valueForBinding("elementName", "span", component); | String elementName = (String) valueForBinding("elementName", "div", component); | 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 + " "); appendTagAttributeToRespons... |
AjaxObserveField.appendToResponse(response, context, observeFieldID, id, false, null); | AjaxObserveField.appendToResponse(response, context, this, observeFieldID, id, false, null); | 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 + " "); appendTagAttributeToRespons... |
src.put (toPut); | put (toPut); | public FloatBuffer put (FloatBuffer src) { if (src == this) throw new IllegalArgumentException (); checkForOverflow(src.remaining()); if (src.remaining () > 0) { float[] toPut = new float [src.remaining ()]; src.get (toPut); src.put (toPut); } return this; } |
this.count = count; | for(int i = 0; i < count; i++) { insertObjectAtIndex(new NSKeyValueCoding.ErrorHandling() { public Object handleQueryWithUnboundKey(String anS) { return null; } public void handleTakeValueForUnboundKey(Object anObj, String anS) { } public void unableToSetNullForKey(String anS) { }}, i); } | public FakeArray(int count) { this.count = count; } |
if(numberOfObjectsPerBatch() == 0) { return 0; } if(rowCount() == 0) { return 1; } else { return (rowCount() - 1) / numberOfObjectsPerBatch() + 1; } | return _batchCount; | public int batchCount() { if(isBatching()) { if(numberOfObjectsPerBatch() == 0) { return 0; } if(rowCount() == 0) { return 1; } else { return (rowCount() - 1) / numberOfObjectsPerBatch() + 1; } } ... |
if (!isBatching()) { return super.displayedObjects(); } else { | if (isBatching()) { | public NSArray displayedObjects() { if (!isBatching()) { return super.displayedObjects(); } else { if(_displayedObjects == null) { //check the start and end based on currentBatchIndex and numberOfObjectsPerBatch() int count = rowCount(); ... |
int count = rowCount(); int start = (currentBatchIndex()-1) * numberOfObjectsPerBatch(); int end = start + numberOfObjectsPerBatch(); if (numberOfObjectsPerBatch() == 0) { start = 0; end = rowCount(); } EOFetchSpecification spec = databaseDataSource().fetchSpecificationForFetch(); spec.setSortOrderings(sortOrderings(... | refetch(); | public NSArray displayedObjects() { if (!isBatching()) { return super.displayedObjects(); } else { if(_displayedObjects == null) { //check the start and end based on currentBatchIndex and numberOfObjectsPerBatch() int count = rowCount(); ... |
return _displayedObjects; | return super.displayedObjects(); | public NSArray displayedObjects() { if (!isBatching()) { return super.displayedObjects(); } else { if(_displayedObjects == null) { //check the start and end based on currentBatchIndex and numberOfObjectsPerBatch() int count = rowCount(); ... |
public boolean isBatching() { if(_isBatching == null) { _isBatching = dataSource() instanceof EODatabaseDataSource ? Boolean.TRUE : Boolean.FALSE; } return _isBatching.booleanValue(); | private boolean isBatching() { return _isBatching == null ? false : _isBatching.booleanValue(); | public boolean isBatching() { if(_isBatching == null) { _isBatching = dataSource() instanceof EODatabaseDataSource ? Boolean.TRUE : Boolean.FALSE; } return _isBatching.booleanValue(); } |
_displayedObjects = null; | if(isBatching() && currentBatchIndex() != index) { _displayedObjects = null; } | public void setCurrentBatchIndex(int index) { _displayedObjects = null; super.setCurrentBatchIndex(index); } |
_isBatching = null; | _isBatching = (eodatasource instanceof EODatabaseDataSource) ? Boolean.TRUE : Boolean.FALSE; | public void setDataSource(EODataSource eodatasource) { _isBatching = null; super.setDataSource(eodatasource); } |
return parent().valueForKeyPath("d2wContext."+key); | return d2wContext().valueForKeyPath(key); | public Object debugValueForKey() { if(key != null && !"".equals(key)) return parent().valueForKeyPath("d2wContext."+key); return null; } |
configComponent.setEditable(true); if (originalComponent != null) originalComponent.setEditable(true); | private void exit() { propertyEditor.stopEditing(); // accept any edit in progress propertyEditor.exit(); // if component is modified, or was modified and was saved // update it in the experiment if (isModified() || componentWasSaved) { if (experiment != null) { if (configComponent instance... | |
deleteExperiment(popupNode); | startConsole(popupNode); | public void actionPerformed(ActionEvent e) { deleteExperiment(popupNode); } |
renameExperiment(popupNode); | copyExperimentInNode(popupNode); | public void actionPerformed(ActionEvent e) { renameExperiment(popupNode); } |
startBuilder(popupNode, e.getActionCommand().equals("Configure")); | deleteExperiment(popupNode); | public void actionPerformed(ActionEvent e) { startBuilder(popupNode, e.getActionCommand().equals("Configure")); } |
startExperimentBuilder(popupNode, true); | renameExperiment(popupNode); | public void actionPerformed(ActionEvent e) { startExperimentBuilder(popupNode, true); } |
startConsole(popupNode); | startBuilder(popupNode, e.getActionCommand().equals("Configure")); | public void actionPerformed(ActionEvent e) { startConsole(popupNode); } |
copySocietyInNode(popupNode); | startExperimentBuilder(popupNode, true); | public void actionPerformed(ActionEvent e) { copySocietyInNode(popupNode); } |
deleteSociety(popupNode); | startConsole(popupNode); | public void actionPerformed(ActionEvent e) { deleteSociety(popupNode); } |
renameSociety(popupNode); | copySocietyInNode(popupNode); | public void actionPerformed(ActionEvent e) { renameSociety(popupNode); } |
startExperimentBuilder(popupNode, true); | deleteSociety(popupNode); | public void actionPerformed(ActionEvent e) { startExperimentBuilder(popupNode, true); } |
copyComponentInNode(popupNode); | renameSociety(popupNode); | public void actionPerformed(ActionEvent e) { copyComponentInNode(popupNode); } |
deleteComponent(popupNode); | startExperimentBuilder(popupNode, true); | public void actionPerformed(ActionEvent e) { deleteComponent(popupNode); } |
renameComponent(popupNode); | copyComponentInNode(popupNode); | public void actionPerformed(ActionEvent e) { renameComponent(popupNode); } |
GUIUtils.timeConsumingTaskStart(organizer); try { new Thread("SelectRecipe") { public void run() { selectRecipeFromDatabase(popupNode); GUIUtils.timeConsumingTaskEnd(organizer); } }.start(); } catch (RuntimeException re) { System.out.println("Runtime exception creating recipe: " + re); re.printStackTrace(); GUIUtils.ti... | deleteComponent(popupNode); } | public void actionPerformed(ActionEvent e) { GUIUtils.timeConsumingTaskStart(organizer); try { new Thread("SelectRecipe") { public void run() { selectRecipeFromDatabase(popupNode); GUIUtils.timeConsumingTaskEnd(organizer); } ... |
newRecipe(popupNode); } | GUIUtils.timeConsumingTaskStart(organizer); try { new Thread("SelectRecipe") { public void run() { selectRecipeFromDatabase(popupNode); GUIUtils.timeConsumingTaskEnd(organizer); } }.start(); } catch (RuntimeException re) { System.out.println("Runtime exception creating recipe: " + re); re.printStackTrace(); GUIUtils.ti... | public void actionPerformed(ActionEvent e) { newRecipe(popupNode); } |
startExperimentBuilder(popupNode, true); | newRecipe(popupNode); | public void actionPerformed(ActionEvent e) { startExperimentBuilder(popupNode, true); } |
copyRecipeInNode(popupNode); | startBuilder(popupNode, e.getActionCommand().equals("Configure")); | public void actionPerformed(ActionEvent e) { copyRecipeInNode(popupNode); } |
deleteRecipe(popupNode); | startExperimentBuilder(popupNode, true); | public void actionPerformed(ActionEvent e) { deleteRecipe(popupNode); } |
renameRecipe(popupNode); | copyRecipeInNode(popupNode); | public void actionPerformed(ActionEvent e) { renameRecipe(popupNode); } |
saveRecipe(popupNode); | deleteRecipe(popupNode); | public void actionPerformed(ActionEvent e) { saveRecipe(popupNode); } |
while (! popupNode.getAllowsChildren()) popupNode = (DefaultMutableTreeNode)popupNode.getParent(); newSociety(popupNode); | renameRecipe(popupNode); | public void actionPerformed(ActionEvent e) { while (! popupNode.getAllowsChildren()) popupNode = (DefaultMutableTreeNode)popupNode.getParent(); newSociety(popupNode); } |
while (! popupNode.getAllowsChildren()) popupNode = (DefaultMutableTreeNode)popupNode.getParent(); newRecipe(popupNode); | saveRecipe(popupNode); | public void actionPerformed(ActionEvent e) { while (! popupNode.getAllowsChildren()) popupNode = (DefaultMutableTreeNode)popupNode.getParent(); newRecipe(popupNode); } |
newFolder(popupNode); | newSociety(popupNode); | public void actionPerformed(ActionEvent e) { while (! popupNode.getAllowsChildren()) popupNode = (DefaultMutableTreeNode)popupNode.getParent(); newFolder(popupNode); } |
deleteFolder(popupNode); | while (! popupNode.getAllowsChildren()) popupNode = (DefaultMutableTreeNode)popupNode.getParent(); newRecipe(popupNode); | public void actionPerformed(ActionEvent e) { deleteFolder(popupNode); } |
renameFolder(popupNode); | while (! popupNode.getAllowsChildren()) popupNode = (DefaultMutableTreeNode)popupNode.getParent(); newFolder(popupNode); | public void actionPerformed(ActionEvent e) { renameFolder(popupNode); } |
GUIUtils.timeConsumingTaskStart(organizer); try { new Thread("SelectExperiment") { public void run() { selectExperimentFromDatabase(popupNode); GUIUtils.timeConsumingTaskEnd(organizer); } }.start(); } catch (RuntimeException re) { System.out.println("Runtime exception creating experiment: " + re); re.printStackTrace();... | GUIUtils.timeConsumingTaskStart(organizer); try { new Thread("DeleteExperiment") { public void run() { deleteExperimentFromDatabase(); GUIUtils.timeConsumingTaskEnd(organizer); } }.start(); } catch (RuntimeException re) { System.out.println("Runtime exception deleting experiment: " + re); re.printStackTrace(); GUIUtils... | public void actionPerformed(ActionEvent e) { GUIUtils.timeConsumingTaskStart(organizer); try { new Thread("SelectExperiment") { public void run() { selectExperimentFromDatabase(popupNode); GUIUtils.timeConsumingTaskEnd(organizer); } ... |
selectExperimentFromDatabase(popupNode); GUIUtils.timeConsumingTaskEnd(organizer); } | deleteExperimentFromDatabase(); GUIUtils.timeConsumingTaskEnd(organizer); } | public void run() { selectExperimentFromDatabase(popupNode); GUIUtils.timeConsumingTaskEnd(organizer); } |
newExperiment(popupNode); } | GUIUtils.timeConsumingTaskStart(organizer); try { new Thread("SelectExperiment") { public void run() { selectExperimentFromDatabase(popupNode); GUIUtils.timeConsumingTaskEnd(organizer); } }.start(); } catch (RuntimeException re) { System.out.println("Runtime exception creating experiment: " + re); re.printStackTrace();... | public void actionPerformed(ActionEvent e) { newExperiment(popupNode); } |
startConsole(popupNode); | newExperiment(popupNode); | public void actionPerformed(ActionEvent e) { startConsole(popupNode); } |
copyExperimentInNode(popupNode); | startExperimentBuilder(popupNode, e.getActionCommand().equals("Configure")); | public void actionPerformed(ActionEvent e) { copyExperimentInNode(popupNode); } |
Experiment experimentCopy = experiment.copy(this, context); | final Experiment experimentCopy = experiment.copy(this, context); if (experiment.isInDatabase()) { experimentCopy.setCloned(false); GUIUtils.timeConsumingTaskStart(organizer); try { new Thread("DuplicateExperiment") { public void run() { experimentCopy.saveToDb(); GUIUtils.timeConsumingTaskEnd(organizer); } }.start(... | public Experiment copyExperiment(Experiment experiment, Object context) { // context is the tree node of the folder containing the experiment // Fixme: if make Experiment hold everything in properties, then can // use the Component copy method Experiment experimentCopy = experiment.copy(this, context); ... |
if (result == JOptionPane.YES_OPTION) ExperimentDB.deleteExperiment(experiment.getExperimentID()); | if (result != JOptionPane.YES_OPTION) return; final String id = experiment.getExperimentID(); GUIUtils.timeConsumingTaskStart(organizer); try { new Thread("DeleteExperiment") { public void run() { ExperimentDB.deleteExperiment(id); GUIUtils.timeConsumingTaskEnd(organizer); } }.start(); } catch (RuntimeException re) { ... | private void deleteExperiment(DefaultMutableTreeNode node) { if (node == null) return; Experiment experiment = (Experiment)node.getUserObject(); if (!experiment.isEditable()) { String reason = "has been run"; if (experiment.isRunning()) reason = "is in use"; int result = JOptionPane.showConfir... |
experimentNamesHT = ExperimentDB.getExperimentNames(); if (experimentNamesHT == null) { return; } Set dbExperimentNames = experimentNamesHT.keySet(); if (dbExperimentNames == null) return; JComboBox cb = new JComboBox(dbExperimentNames.toArray()); | Map experimentNamesMap = ExperimentDB.getExperimentNames(); Set keys = experimentNamesMap.keySet(); JComboBox cb = new JComboBox(keys.toArray(new String[keys.size()])); | private void selectExperimentFromDatabase(DefaultMutableTreeNode node) { experimentNamesHT = ExperimentDB.getExperimentNames(); if (experimentNamesHT == null) { return; } Set dbExperimentNames = experimentNamesHT.keySet(); if (dbExperimentNames == null) return; JComboBox cb = new JComboBox... |
String experimentId = (String)experimentNamesHT.get(experimentName); | String experimentId = (String)experimentNamesMap.get(experimentName); | private void selectExperimentFromDatabase(DefaultMutableTreeNode node) { experimentNamesHT = ExperimentDB.getExperimentNames(); if (experimentNamesHT == null) { return; } Set dbExperimentNames = experimentNamesHT.keySet(); if (dbExperimentNames == null) return; JComboBox cb = new JComboBox... |
ERXValidation.setPushChangesDefault(ERXUtilities.booleanValueWithDefault(System.getProperties().getProperty("er.extensions.ERXValidationShouldPushChangesToObject"), ERXValidation.DO_NOT_PUSH_INCORRECT_VALUE_ON_EO)); | ERXValidation.setPushChangesDefault(ERXValueUtilities.booleanValueWithDefault(System.getProperties().getProperty("er.extensions.ERXValidationShouldPushChangesToObject"), ERXValidation.DO_NOT_PUSH_INCORRECT_VALUE_ON_EO)); | public void configureFactory() { // CHECKME: This might be better configured in a static init block of ERXValidationFactory. ERXValidation.setPushChangesDefault(ERXUtilities.booleanValueWithDefault(System.getProperties().getProperty("er.extensions.ERXValidationShouldPushChangesToObject"), ERXV... |
name.substring(MethodInterceptorGenerator.ACCESS_PREFIX.length(), name.lastIndexOf('_')).equals(method.getName()) && | public static String getSuperName(Class type, Method method) { List params = Arrays.asList(method.getParameterTypes()); Method[] methods = type.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { String name = methods[i].getName(); if (name.startsWith(MethodIn... | |
if(log.isDebugEnabled()) { log.debug("Skipping Agent: " + agentsToWrite[i].getShortName()); } | public boolean generateCompleteSociety() { Set savedNodes = new HashSet(); Set savedAgents = new HashSet(); NodeComponent[] nodesToWrite = getNodeComponents(); AgentComponent[] agentsToWrite = getAgents(); List components = getComponents(); completeSociety = new GenericComponentData(); completeSo... | |
if(log.isDebugEnabled()) { log.debug("# Agents for node: " + nc.getName() + " is: " + writtenAgents.size()); } | private Collection generateNodeComponent(NodeComponent node, ComponentData parent) { Set writtenAgents = new HashSet(); ComponentData nc = new GenericComponentData(); nc.setType(ComponentData.NODE); nc.setName(node.getShortName()); nc.setClassName(Node.class.getName()); // leave this out?? FIXME nc.... | |
if(log.isDebugEnabled()) { log.debug("new editable " + editable); } | public void setEditable(boolean editable) { if (editable == overrideEditable) return; // no change overrideEditable = editable; if(log.isDebugEnabled()) { log.debug("new editable " + editable); } fireModification(); } | |
if(log.isDebugEnabled()) { log.debug("Keeping Name Server: " + nameServerHost); } | public void updateNameServerHostName() { Properties defaultNodeArgs = getDefaultNodeArguments(); String oldNameServer = defaultNodeArgs.getProperty("org.cougaar.name.server"); String newNameServer = null; String dfltNameServer = null; String nameServerHost = null; if (oldNameServer != null) { i... | |
e.push(PRIMES[(int)(seed % PRIMES.length)]); e.push(PRIMES[(int)((seed * 13) % PRIMES.length)]); | int hc = (constant != 0) ? constant : PRIMES[(int)(seed % PRIMES.length)]; int hm = (multiplier != 0) ? multiplier : PRIMES[(int)((seed * 13) % PRIMES.length)]; e.push(hc); | public void generateClass(ClassVisitor v) { ClassEmitter ce = new ClassEmitter(v); Method newInstance = ReflectUtils.findNewInstance(keyInterface); if (!newInstance.getReturnType().equals(Object.class)) { throw new IllegalArgumentException("newInstance... |
ComplexOps.hash_code(e, parameterTypes[i], customizer); | ComplexOps.hash_code(e, parameterTypes[i], hm, customizer); | public void generateClass(ClassVisitor v) { ClassEmitter ce = new ClassEmitter(v); Method newInstance = ReflectUtils.findNewInstance(keyInterface); if (!newInstance.getReturnType().equals(Object.class)) { throw new IllegalArgumentException("newInstance... |
e.swap(); e.pop(); | public void generateClass(ClassVisitor v) { ClassEmitter ce = new ClassEmitter(v); Method newInstance = ReflectUtils.findNewInstance(keyInterface); if (!newInstance.getReturnType().equals(Object.class)) { throw new IllegalArgumentException("newInstance... | |
public static void hash_code(CodeEmitter e, Type type, Customizer customizer) { | public static void hash_code(CodeEmitter e, Type type, int multiplier, Customizer customizer) { | public static void hash_code(CodeEmitter e, Type type, Customizer customizer) { if (TypeUtils.isArray(type)) { hash_array(e, type, customizer); } else { if (TypeUtils.isPrimitive(type)) { hash_primitive(e, type); } else { hash_object(e, ty... |
hash_array(e, type, customizer); | hash_array(e, type, multiplier, customizer); | public static void hash_code(CodeEmitter e, Type type, Customizer customizer) { if (TypeUtils.isArray(type)) { hash_array(e, type, customizer); } else { if (TypeUtils.isPrimitive(type)) { hash_primitive(e, type); } else { hash_object(e, ty... |
e.swap(); e.dup_x1(); e.math(e.MUL, Type.INT_TYPE); | public static void hash_code(CodeEmitter e, Type type, Customizer customizer) { if (TypeUtils.isArray(type)) { hash_array(e, type, customizer); } else { if (TypeUtils.isPrimitive(type)) { hash_primitive(e, type); } else { hash_object(e, ty... | |
public static void not_equals(final CodeEmitter e, Type type, final Label notEquals, final Customizer customizer) { (new ProcessArrayCallback() { public void processElement(Type type) { not_equals_helper(e, type, notEquals, customizer, this); } }).processElement(type); | public static void not_equals(CodeEmitter e, Type type, Label notEquals) { not_equals(e, type, notEquals, null); | public static void not_equals(final CodeEmitter e, Type type, final Label notEquals, final Customizer customizer) { (new ProcessArrayCallback() { public void processElement(Type type) { not_equals_helper(e, type, notEquals, customizer, this); } }).processElement(ty... |
if (trialTableModel.getRowCount() < 2) trialMenu.getComponent(0).setEnabled(false); | private void doPopup(MouseEvent e) { Point pt = e.getPoint(); int rowIndex = trialTable.rowAtPoint(pt); int columnIndex = trialTable.columnAtPoint(pt); if (rowIndex == -1 || columnIndex == -1) return; // ignore, clicked outside of table else { trialMenu.show(e.getComponent(), e.getX(), e.getY... | |
if(log.isDebugEnabled()) { log.debug("setterName: " + setterName); log.debug("type: " + type); for(int i=0; i < arguments.length; i++) { log.debug("Argument[" + i + "]: " + arguments[i]); } } | public void callSetter(String setterName, String type, Object[] arguments) { String name = setterName.substring(3); if(log.isWarnEnabled() && arguments.length > 1) { log.warn("Arguments is greater than one!"); } PGPropData data = new PGPropData(); data.setName(name); if(log.isDebugEnabled()) { ... | |
if(arguments[0] instanceof Collection) { Iterator iter = ((Collection)arguments[0]).iterator(); PGPropMultiVal multi = new PGPropMultiVal(); while(iter.hasNext()) { multi.addValue((String)iter.next()); | if(data.getName().equals("HomeLocation")) { data.setValue(parseHomeLocation((String)arguments[0])); } else { if(arguments[0] instanceof Collection) { Iterator iter = ((Collection)arguments[0]).iterator(); PGPropMultiVal multi = new PGPropMultiVal(); while(iter.hasNext()) { multi.addValue((String)iter.next()); } data.se... | public void callSetter(String setterName, String type, Object[] arguments) { String name = setterName.substring(3); if(log.isWarnEnabled() && arguments.length > 1) { log.warn("Arguments is greater than one!"); } PGPropData data = new PGPropData(); data.setName(name); if(log.isDebugEnabled()) { ... |
data.setValue(multi); } else { data.setValue(arguments[0]); | public void callSetter(String setterName, String type, Object[] arguments) { String name = setterName.substring(3); if(log.isWarnEnabled() && arguments.length > 1) { log.warn("Arguments is greater than one!"); } PGPropData data = new PGPropData(); data.setName(name); if(log.isDebugEnabled()) { ... | |
if (CSMART.isSocietyInEditor(society)) | if (society != null && CSMART.isSocietyInEditor(society)) | private static boolean isActionAllowedOnExperiment(String action, Organizer organizer, Experiment experiment) { if (action.equals(DUPLICATE_ACTION)) return true; SocietyComponent society = experiment.get... |
return false; } if (society == null) { if (action.equals(RUN_ACTION) || action.equals(CONFIGURE_ACTION)) | private static boolean isActionAllowedOnExperiment(String action, Organizer organizer, Experiment experiment) { if (action.equals(DUPLICATE_ACTION)) return true; SocietyComponent society = experiment.get... | |
Logger log = (Logger) NullLoggingServiceImpl.getNullLoggingServiceImpl(); | private static void replyWithHTML( PrintWriter out, ClusterIdentifier cid, Set startUIDs, boolean isDown, List l) { Logger log = (Logger) NullLoggingServiceImpl.getNullLoggingServiceImpl(); int nStartUIDs = ((startUIDs != null) ? startUIDs.size() : 0); ou... | |
if (log.isErrorEnabled()) log.error("Exception Encoding ", e); | System.err.println("Exception Encoding: "+e.getMessage()); | private static void replyWithHTML( PrintWriter out, ClusterIdentifier cid, Set startUIDs, boolean isDown, List l) { Logger log = (Logger) NullLoggingServiceImpl.getNullLoggingServiceImpl(); int nStartUIDs = ((startUIDs != null) ? startUIDs.size() : 0); ou... |
log = CSMART.createLogger("org.cougaar.tools.csmart.ui.viewer"); | createLogger(); | public UniqueNameSet(String prefix) { this.prefix = prefix; log = CSMART.createLogger("org.cougaar.tools.csmart.ui.viewer"); } |
public BigInteger gcd(BigInteger y) | private static final int gcd(int a, int b) | public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return BigInteger.abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; ... |
int xval = ival; int yval = y.ival; if (words == null) | if (b > a) | public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return BigInteger.abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; ... |
if (xval == 0) return BigInteger.abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) | int tmp = a; a = b; b = tmp; } for(;;) { if (b == 0) return a; else if (b == 1) return b; else | public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return BigInteger.abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; ... |
if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; return BigInteger.make(BigInteger.gcd(xval, yval)); | int tmp = b; b = a % b; a = tmp; | public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return BigInteger.abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; ... |
xval = 1; | public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return BigInteger.abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; ... | |
if (y.words == null) { if (yval == 0) return BigInteger.abs(this); yval = 1; } int len = (xval > yval ? xval : yval) + 1; int[] xwords = new int[len]; int[] ywords = new int[len]; getAbsolute(xwords); y.getAbsolute(ywords); len = MPN.gcd(xwords, ywords, len); BigInteger result = new BigInteger(0); result.ival = len; re... | public BigInteger gcd(BigInteger y) { int xval = ival; int yval = y.ival; if (words == null) { if (xval == 0) return BigInteger.abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { if (xval < 0) xval = -xval; if (yval < 0) yval = -yval; ... | |
observer = new Observer(); monitoredFiles = new NSMutableArray(); | public static void initialize() { if(!isInitialized) { isLocalizationEnabled = ERXProperties.booleanForKeyWithDefault("er.extensions.ERXLocalizer.isLocalizationEnabled", true); if (isLocalizationEnabled) { // To detect ERXLocalizer and its subclasses are recompiled at run... | |
String template = localizedStringForKeyWithDefault(key); | String template = (String)valueForKeyPath(key); | public String localizedTemplateStringForKeyWithObjectOtherObject(String key, Object o1, Object o2) { String template = localizedStringForKeyWithDefault(key); if (template != null) return ERXSimpleTemplateParser.sharedInstance().parseTemplateWithObject(template, null, o1, o2); return ... |
Object o = e.nextElement(); String language = (String)o; | String language = (String)e.nextElement(); | public static ERXLocalizer localizerForLanguages(NSArray languages) { if (! isLocalizationEnabled) return createLocalizerForLanguage("Nonlocalized", false); if (languages == null || languages.count() == 0) return localizerForLanguage(defaultLanguage()); ERXLocalizer l = null; ... |
return localizedValueForKey(key); | return valueForKeyPath(key); | public Object valueForKey(String key) { return localizedValueForKey(key); } |
if (resource instanceof IProject) { activeProject = (IProject) resource; projectName = activeProject.getProject().getName(); xDocPath = (activeProject.getProject().getLocation() | if (resource != null) { IProject newActiveProject = resource.getProject(); if (newActiveProject != activeProject){ activeProject = newActiveProject; projectName = activeProject.getProject().getName(); xDocPath = (activeProject.getProject().getLocation() | public void selectionChanged(IWorkbenchPart part, ISelection selection) { if (selection instanceof IStructuredSelection) { Object first = ((IStructuredSelection) selection).getFirstElement(); IResource resource = (IResource) first; if (resource instanceof IProject) { ... |
path = xDocPath + getFilename(); document = DOMUtilities.loadDOM(path); treeViewer.setInput(document); | path = xDocPath + getFilename(); document = DOMUtilities.loadDOM(path); treeViewer.setInput(document); } | public void selectionChanged(IWorkbenchPart part, ISelection selection) { if (selection instanceof IStructuredSelection) { Object first = ((IStructuredSelection) selection).getFirstElement(); IResource resource = (IResource) first; if (resource instanceof IProject) { ... |
protected void createSiPush(SIPush push) | protected void createSiPush(SIPush push, boolean uaAgentCompatable) | protected void createSiPush(SIPush push) { ByteArrayOutputStream pushMsg = new ByteArrayOutputStream(); try { push.writeTo(SIPush.getWbxmlWriter(), pushMsg); pushMsg.close(); } catch (IOException e) { // Should not happen } ... |
createMessage(pushMsg.toByteArray(), "application/vnd.wap.sic", "x-wap-application:wml.ua", null); | if (uaAgentCompatable){ createMessage(pushMsg.toByteArray(), "application/vnd.wap.sic", "x-wap-application:wml.ua", null); } else { createMessage(pushMsg.toByteArray(), "application/vnd.wap.sic", "x-wap-application:*", null); } | protected void createSiPush(SIPush push) { ByteArrayOutputStream pushMsg = new ByteArrayOutputStream(); try { push.writeTo(SIPush.getWbxmlWriter(), pushMsg); pushMsg.close(); } catch (IOException e) { // Should not happen } ... |
System.err.println("Unable to parse parameters:"); | System.err.println("SearchServlet: Unable to parse parameters:"); | public void execute(HttpServletRequest request, HttpServletResponse response) throws IOException { // parse the URL parameters and attached (binary) data try { parseParams(request); // if zero UIDs were posted then look for a "?uid=" parameter if ((startUIDs == null) && //(optUID != null)... |
System.err.println("Unable to search for data:"); | System.err.println("SearchServlet: Unable to search for data:"); | public void execute(HttpServletRequest request, HttpServletResponse response) throws IOException { // parse the URL parameters and attached (binary) data try { parseParams(request); // if zero UIDs were posted then look for a "?uid=" parameter if ((startUIDs == null) && //(optUID != null)... |
System.err.println("Unable to send response back:"); | System.err.println("SearchServlet: Unable to send response back:"); | public void execute(HttpServletRequest request, HttpServletResponse response) throws IOException { // parse the URL parameters and attached (binary) data try { parseParams(request); // if zero UIDs were posted then look for a "?uid=" parameter if ((startUIDs == null) && //(optUID != null)... |
System.out.println("Sent Objects"); | System.out.println("SearchServlet: Sent Objects"); | private static void replyWithData( OutputStream out, ClusterIdentifier cid, List l) throws IOException { // convert to PropertyTrees, all tagged with this agent's name List retL = TranslateUtils.toPropertyTrees(l, cid.toString()); try { if (retL != null ){ /... |
System.out.println("PlanServlet Exception: " + e); | System.out.println("SearchServlet Exception: " + e); | private static void replyWithData( OutputStream out, ClusterIdentifier cid, List l) throws IOException { // convert to PropertyTrees, all tagged with this agent's name List retL = TranslateUtils.toPropertyTrees(l, cid.toString()); try { if (retL != null ){ /... |
private String insertLibRecipe(RecipeComponent rc, String recipeId) throws SQLException { | private String insertLibRecipe(RecipeComponent rc, String recipeId) { try { if (recipeId != null) { substitutions.put(":recipe_id:", recipeId); substitutions.put(":java_class:", rc.getClass().getName()); | private String insertLibRecipe(RecipeComponent rc, String recipeId) throws SQLException { if (rc instanceof ComplexRecipeComponent) { return insertComplexLibRecipe(rc, recipeId); } else { return insertSimpleLibRecipe(rc, recipeId); } } |
if (rc instanceof ComplexRecipeComponent) { return insertComplexLibRecipe(rc, recipeId); } else { return insertSimpleLibRecipe(rc, recipeId); | if (log.isDebugEnabled()) { log.debug("insertLibRecipe updating old ID " + recipeId + " with new class " + rc.getClass().getName() + " and name " + rc.getRecipeName()); } executeUpdate(dbp.getQuery("deleteLibRecipeArgs", substitutions)); executeUpdate(dbp.getQuery("updateLibRecipe", substitutions)); } else { recip... | private String insertLibRecipe(RecipeComponent rc, String recipeId) throws SQLException { if (rc instanceof ComplexRecipeComponent) { return insertComplexLibRecipe(rc, recipeId); } else { return insertSimpleLibRecipe(rc, recipeId); } } |
if (!recipeIdAndClass[1].equals(rc.getClass().getName())) | if (!recipeIdAndClass[1].equals(rc.getClass().getName())) { if (log.isDebugEnabled()) { log.debug("isRecipeEqual got new class " + rc.getClass().getName() + " compared to " + recipeIdAndClass[1]); } | private boolean isRecipeEqual(String[] recipeIdAndClass, RecipeComponent rc) { if (!recipeIdAndClass[1].equals(rc.getClass().getName())) return false; // different class Map newProps = new HashMap(); for (Iterator j = rc.getProperties(); j.hasNext(); ) { Property pro... |
for (Iterator j = rc.getProperties(); j.hasNext(); ) { Property prop = (Property) j.next(); | for (Iterator j = rc.getLocalPropertyNames(); j.hasNext(); ) { CompositeName pname = (CompositeName) j.next(); Property prop = rc.getProperty(pname); if (prop == null) { prop = rc.getInvisibleProperty(pname); if (prop == null) { continue; } } | private boolean isRecipeEqual(String[] recipeIdAndClass, RecipeComponent rc) { if (!recipeIdAndClass[1].equals(rc.getClass().getName())) return false; // different class Map newProps = new HashMap(); for (Iterator j = rc.getProperties(); j.hasNext(); ) { Property pro... |
newProps.put(prop.getName().last().toString(), sval); | String name = pname.last().toString(); newProps.put(name, sval); | private boolean isRecipeEqual(String[] recipeIdAndClass, RecipeComponent rc) { if (!recipeIdAndClass[1].equals(rc.getClass().getName())) return false; // different class Map newProps = new HashMap(); for (Iterator j = rc.getProperties(); j.hasNext(); ) { Property pro... |
PropertyTree locPT = new PropertyTree(); locPT.put(PropertyNames.ORGANIZATION_LOCATION_ELEMENT_START_TIME, new Long(lse.getStartTime())); locPT.put(PropertyNames.ORGANIZATION_LOCATION_ELEMENT_END_TIME, new Long(lse.getEndTime())); locPT.put(PropertyNames.ORGANIZATION_LOCATION_ELEMENT_LATITUDE, new Double(lseLoc.getLati... | properties.put(PropertyNames.ORGANIZATION_LOCATION_ELEMENT_START_TIME + "_" + locNumber, new Long(lse.getStartTime())); properties.put(PropertyNames.ORGANIZATION_LOCATION_ELEMENT_END_TIME + "_" + locNumber, new Long(lse.getEndTime())); properties.put(PropertyNames.ORGANIZATION_LOCATION_ELEMENT_LATITUDE + "_" + locNumbe... | private Vector getSelfInformation(PlanServiceContext psc) { Collection container = psc.getServerPlugInSupport().queryForSubscriber(getSelfPred()); Iterator iter = container.iterator(); Vector results = new Vector(1); int n = 0; // unique index for relationships while (iter.hasNext()) { Asset... |
if (locPTs.size() > 0) { | if (includeStartEndTime) { | private Vector getSelfInformation(PlanServiceContext psc) { Collection container = psc.getServerPlugInSupport().queryForSubscriber(getSelfPred()); Iterator iter = container.iterator(); Vector results = new Vector(1); int n = 0; // unique index for relationships while (iter.hasNext()) { Asset... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.