rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
properties.put(PropertyNames.ORGANIZATION_LOCATIONS, locPTs); | includeStartEndTime = false; | 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... |
int nProperties = properties.size(); | 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... | |
Enumeration nodeComponents = oldNodes.keys(); while (nodeComponents.hasMoreElements()) { NodeComponent nodeComponent = (NodeComponent)nodeComponents.nextElement(); | Iterator nodeComponents = oldNodes.iterator(); while (nodeComponents.hasNext()) { NodeComponent nodeComponent = (NodeComponent)nodeComponents.next(); | private void destroyOldNodes() { Enumeration nodeComponents = oldNodes.keys(); while (nodeComponents.hasMoreElements()) { NodeComponent nodeComponent = (NodeComponent)nodeComponents.nextElement(); String nodeName = nodeComponent.getShortName(); removeStatusButton(nodeName); oldNodes.remove(... |
oldNodes.remove(nodeComponent); | private void destroyOldNodes() { Enumeration nodeComponents = oldNodes.keys(); while (nodeComponents.hasMoreElements()) { NodeComponent nodeComponent = (NodeComponent)nodeComponents.nextElement(); String nodeName = nodeComponent.getShortName(); removeStatusButton(nodeName); oldNodes.remove(... | |
oldNodes.clear(); | private void destroyOldNodes() { Enumeration nodeComponents = oldNodes.keys(); while (nodeComponents.hasMoreElements()) { NodeComponent nodeComponent = (NodeComponent)nodeComponents.nextElement(); String nodeName = nodeComponent.getShortName(); removeStatusButton(nodeName); oldNodes.remove(... | |
new ConsoleNodeOutputFilter(null, true); | new ConsoleNodeOutputFilter(this, null, true); | private void filterMenuItem_actionPerformed() { if (displayFilter == null) displayFilter = new ConsoleNodeOutputFilter(null, true); else displayFilter = new ConsoleNodeOutputFilter(displayFilter.getValues(), displayFilter.isAllSelected()); Enumerati... |
new ConsoleNodeOutputFilter(displayFilter.getValues(), | new ConsoleNodeOutputFilter(this, displayFilter.getValues(), | private void filterMenuItem_actionPerformed() { if (displayFilter == null) displayFilter = new ConsoleNodeOutputFilter(null, true); else displayFilter = new ConsoleNodeOutputFilter(displayFilter.getValues(), displayFilter.isAllSelected()); Enumerati... |
oldNodes.put(nodeComponent, runningNodes.get(nodeComponent)); runningNodes.remove(nodeComponent); | if (runningNodes.get(nodeComponent) != null) { oldNodes.add(nodeComponent); runningNodes.remove(nodeComponent); } | public void nodeStopped(NodeComponent nodeComponent) { oldNodes.put(nodeComponent, runningNodes.get(nodeComponent)); runningNodes.remove(nodeComponent); // enable restart command on node output window desktop.getNodeFrame(nodeComponent.getShortName()).enableRestart(); // if any node has stopped, then d... |
oldNodes = new Hashtable(); | oldNodes = new ArrayList(); | private void setSocietyComponent(SocietyComponent cc) { communitySupport = new ClientCommunityController(); runningNodes = new Hashtable(); oldNodes = new Hashtable(); nodeListeners = new Hashtable(); nodePanes = new Hashtable(); // top level menus JMenu fileMenu = new JMenu(FILE_MENU); fileMe... |
Collection coll = org.cougaar.util.CSVUtility.parseToCollection(arg); | List coll = org.cougaar.util.CSVUtility.parseToList(arg); | private Object parseE(String type, String arg) { int i; type = type.trim(); arg = arg.trim(); if ((i = type.indexOf("<")) >= 0) { int j = type.lastIndexOf(">"); String ctype = type.substring(0, i).trim(); String etype = type.substring(i + 1, j).trim(); Collection c = null; if (cty... |
Collection coll = org.cougaar.util.CSVUtility.parseToCollection(arg); | List coll = org.cougaar.util.CSVUtility.parseToList(arg); | public Object parseExpr(String type, String arg) { int i; type = type.trim(); arg = arg.trim(); if ((i = type.indexOf("<")) >= 0) { int j = type.lastIndexOf(">"); String ctype = type.substring(0, i).trim(); String etype = type.substring(i + 1, j).trim(); Collection c = null; if (c... |
synchronized (entityLock(ename)) { s = new Stack(); pkCache.put(ename, s); } | s = new Stack(); pkCache.put(ename, s); | private static Stack cacheStack(String ename) { Stack s = (Stack) pkCache.get(ename); if (s == null) { synchronized (entityLock(ename)) { s = new Stack(); pkCache.put(ename, s); } } return s; } |
synchronized (entityLock(ename)) { | synchronized (s) { | private static Long cachedPkValue(String ename) { Stack s = cacheStack(ename); if (s.empty()) { synchronized (entityLock(ename)) { //we need to check again because after entering the // synchronized statement //it might be possible that another t... |
if (log.isDebugEnabled()) { log.debug("returning " + pkValue + " for " + ename); } | private static Long cachedPkValue(String ename) { Stack s = cacheStack(ename); if (s.empty()) { synchronized (entityLock(ename)) { //we need to check again because after entering the // synchronized statement //it might be possible that another t... | |
static boolean encodeEntityInPkValue() { | public synchronized static boolean encodeEntityInPkValue() { | static boolean encodeEntityInPkValue() { if (encodeEntityInPkValue == null) { synchronized (lock) { boolean b = ERXValueUtilities.booleanValueWithDefault(System .getProperty("ERXIntegerPrimaryKeyFactory.encodeEntityInPkValue"), false); encodeEnt... |
synchronized (lock) { boolean b = ERXValueUtilities.booleanValueWithDefault(System .getProperty("ERXIntegerPrimaryKeyFactory.encodeEntityInPkValue"), false); encodeEntityInPkValue = b ? Boolean.TRUE : Boolean.FALSE; } | boolean b = ERXValueUtilities.booleanValueWithDefault(System.getProperty("er.extensions.ERXLongPrimaryKeyFactory.encodeEntityInPkValue"), false); encodeEntityInPkValue = b ? Boolean.TRUE : Boolean.FALSE; | static boolean encodeEntityInPkValue() { if (encodeEntityInPkValue == null) { synchronized (lock) { boolean b = ERXValueUtilities.booleanValueWithDefault(System .getProperty("ERXIntegerPrimaryKeyFactory.encodeEntityInPkValue"), false); encodeEnt... |
synchronized (entityLock(ename)) { Long pkValueStart = getNextPkValueForEntityIncreaseBy(ename, 10, increaseBy()); long value = pkValueStart.longValue(); log.debug("filling pkCache for " + ename + ", starting at " + value); for (int i = increaseBy(); i-- > 0;) { s.push(new Long(i + value)); } | Long pkValueStart = getNextPkValueForEntityIncreaseBy(ename, 10, increaseBy()); long value = pkValueStart.longValue(); log.debug("filling pkCache for " + ename + ", starting at " + value); for (int i = increaseBy(); i-- > 1;) { s.push(new Long(i + value)); | private static void fillPkCache(Stack s, String ename) { synchronized (entityLock(ename)) { Long pkValueStart = getNextPkValueForEntityIncreaseBy(ename, 10, increaseBy()); long value = pkValueStart.longValue(); log.debug("filling pkCache for " + ename + ", starting at " + val... |
public static Long getNextPkValueForEntity(String ename) { | private static Long getNextPkValueForEntity(String ename) { | public static Long getNextPkValueForEntity(String ename) { Long pk = cachedPkValue(ename); if (encodeEntityInPkValue()) { long l = pk.longValue(); if (l > MAX_PK_VALUE) { throw new IllegalStateException("max PK value reached for entity " + ename + " cannot cont... |
if (log.isDebugEnabled()) { log.debug("new pk value for "+ename+"("+((ERXModelGroup) ERXApplication.erxApplication().defaultModelGroup()).entityCode(ename)+"), db value = "+pk+", new value = "+realPk); } | public static Long getNextPkValueForEntity(String ename) { Long pk = cachedPkValue(ename); if (encodeEntityInPkValue()) { long l = pk.longValue(); if (l > MAX_PK_VALUE) { throw new IllegalStateException("max PK value reached for entity " + ename + " cannot cont... | |
Object entityLock = entityLock(ename); synchronized (entityLock) { ResultSet resultSet = con.createStatement().executeQuery("select pk_value from pk_table " + where); con.commit(); | ResultSet resultSet = con.createStatement().executeQuery("select pk_value from pk_table " + where); con.commit(); | private static Long getNextPkValueForEntityIncreaseBy(String ename, int count, int increaseBy) { if (increaseBy < 1) increaseBy = 1; Connection con = ERXJDBCConnectionBroker.connectionBrokerForEntityNamed(ename).getConnection(); try { con.setAutoCommit(false); con.setReadO... |
boolean hastNext = resultSet.next(); int pk = 1; if (hastNext) { pk = resultSet.getInt("pk_value"); pk += increaseBy; con.createStatement().executeUpdate("update pk_table set pk_value = " + pk + " " + where); } else { con.createStatement().executeUpdate( "insert into pk_table (eoentity_name, pk_value) values ('" + en... | boolean hastNext = resultSet.next(); int pk = 1; if (hastNext) { pk = resultSet.getInt("pk_value"); pk += increaseBy; con.createStatement().executeUpdate("update pk_table set pk_value = " + pk + " " + where); } else { con.createStatement().executeUpdate( "insert into pk_table (eoentity_name, pk_value) values ('" + en... | private static Long getNextPkValueForEntityIncreaseBy(String ename, int count, int increaseBy) { if (increaseBy < 1) increaseBy = 1; Connection con = ERXJDBCConnectionBroker.connectionBrokerForEntityNamed(ename).getConnection(); try { con.setAutoCommit(false); con.setReadO... |
con.commit(); return new Long(pk); | private static Long getNextPkValueForEntityIncreaseBy(String ename, int count, int increaseBy) { if (increaseBy < 1) increaseBy = 1; Connection con = ERXJDBCConnectionBroker.connectionBrokerForEntityNamed(ename).getConnection(); try { con.setAutoCommit(false); con.setReadO... | |
} catch (SQLException e) { synchronized (lock) { String s = NSLog.throwableAsString(e).toLowerCase(); if ((s.indexOf("error code 116") != -1) || (s.indexOf("pk_table") != -1 && s.indexOf("does not exist") != -1)) { try { con.rollback(); log.info("creating pk table"); con.createStatement().executeUpdate( "create table p... | if (count < 10) { log.error("could not get primkey, trying again " + count + ", error was " + e.getMessage()); return getNextPkValueForEntity(ename); } log.error(e, e); throw new RuntimeException("could not get primkey, original message was " + e.getMessage()); | private static Long getNextPkValueForEntityIncreaseBy(String ename, int count, int increaseBy) { if (increaseBy < 1) increaseBy = 1; Connection con = ERXJDBCConnectionBroker.connectionBrokerForEntityNamed(ename).getConnection(); try { con.setAutoCommit(false); con.setReadO... |
ResultSet resultSet = con.createStatement().executeQuery( "select pk_value from pk_table " + where); con.commit(); boolean hastNext = resultSet.next(); int pk = 1; if (hastNext) { pk = resultSet.getInt("pk_value"); pk++; con.createStatement().executeUpdate("update pk_table set pk_value = " + pk + " " + where); } else... | private static Long getNextPkValueForEntityIncreaseBy(String ename, int count, int increaseBy) { if (increaseBy < 1) increaseBy = 1; Connection con = ERXJDBCConnectionBroker.connectionBrokerForEntityNamed(ename).getConnection(); try { con.setAutoCommit(false); con.setReadO... | |
String s = ERXSystem.getProperty("com.cluster9.webobjects.eof.C9ThreadSafePrimaryKeySupport.increaseBy"); if (s == null) { increaseBy = 1000; } else { try { increaseBy = Integer.parseInt(s); } catch (NumberFormatException e) { increaseBy = 1000; } } | increaseBy = 1000; | private static int increaseBy() { if (increaseBy == 0) { String s = ERXSystem.getProperty("com.cluster9.webobjects.eof.C9ThreadSafePrimaryKeySupport.increaseBy"); if (s == null) { increaseBy = 1000; } else { try { increaseBy = ... |
log.info("received max id from table " + tableName + ", setting value in PK_TABLE to " + v); | if (log.isDebugEnabled()) log.debug("received max id from table " + tableName + ", setting value in PK_TABLE to " + v); | private static int maxIdFromTable(String ename) { EOEntity entity = EOModelGroup.defaultGroup().entityNamed(ename); if (entity == null) throw new NullPointerException("could not find an entity named " + ename); String tableName = entity.externalName(); String sql = "select max(id) from "... |
EOEntity entity = EOModelGroup.defaultGroup().entityNamed(entityName); while (entity.parentEntity() != null) { entity = entity.parentEntity(); } entityName = entity.name(); Long pk = getNextPkValueForEntity(entityName); return new NSDictionary(new Object[] { pk}, new Object[] { "id"}); | return primaryKeyDictionary(entityName); | public static NSDictionary primaryKeyDictionary(EOEnterpriseObject eo) { String entityName = eo.entityName(); EOEntity entity = EOModelGroup.defaultGroup().entityNamed(entityName); while (entity.parentEntity() != null) { entity = entity.parentEntity(); } entityName = en... |
for (int i = 0; i < elements.size(); i++) { Element element = (Element)elements.elementAt(i); | Vector myElements = (Vector)elements.clone(); for (int i = 0; i < myElements.size(); i++) { Element element = (Element)myElements.elementAt(i); | private Vector getRelatedElements(Vector elements, String relationship) { for (int i = 0; i < elements.size(); i++) { Element element = (Element)elements.elementAt(i); // remove any subgraphs (in particular the whole graph) if (element instanceof Subgraph) { elements.remove(i--); continue; } ... |
elements.remove(i--); | myElements.remove(i--); | private Vector getRelatedElements(Vector elements, String relationship) { for (int i = 0; i < elements.size(); i++) { Element element = (Element)elements.elementAt(i); // remove any subgraphs (in particular the whole graph) if (element instanceof Subgraph) { elements.remove(i--); continue; } ... |
for (int i = 0; i < elements.size(); i++) { Element element = (Element)elements.elementAt(i); | for (int i = 0; i < myElements.size(); i++) { Element element = (Element)myElements.elementAt(i); | private Vector getRelatedElements(Vector elements, String relationship) { for (int i = 0; i < elements.size(); i++) { Element element = (Element)elements.elementAt(i); // remove any subgraphs (in particular the whole graph) if (element instanceof Subgraph) { elements.remove(i--); continue; } ... |
if (otherNodeNames.contains(getOrganizationName(edge.getTail()))) { if (!elements.contains(edge)) elements.add(edge); | if (otherNodeNames.contains(getOrganizationName(edge.getTail())) && getTails) { if (!myElements.contains(edge)) myElements.add(edge); | private Vector getRelatedElements(Vector elements, String relationship) { for (int i = 0; i < elements.size(); i++) { Element element = (Element)elements.elementAt(i); // remove any subgraphs (in particular the whole graph) if (element instanceof Subgraph) { elements.remove(i--); continue; } ... |
if (!elements.contains(tail)) elements.add(tail); | if (!myElements.contains(tail)) myElements.add(tail); | private Vector getRelatedElements(Vector elements, String relationship) { for (int i = 0; i < elements.size(); i++) { Element element = (Element)elements.elementAt(i); // remove any subgraphs (in particular the whole graph) if (element instanceof Subgraph) { elements.remove(i--); continue; } ... |
} else if (edge.getTail().equals(node)) { | } else if (edge.getTail().equals(node) && !getTails) { | private Vector getRelatedElements(Vector elements, String relationship) { for (int i = 0; i < elements.size(); i++) { Element element = (Element)elements.elementAt(i); // remove any subgraphs (in particular the whole graph) if (element instanceof Subgraph) { elements.remove(i--); continue; } ... |
if (!elements.contains(edge)) elements.add(edge); | if (!myElements.contains(edge)) myElements.add(edge); | private Vector getRelatedElements(Vector elements, String relationship) { for (int i = 0; i < elements.size(); i++) { Element element = (Element)elements.elementAt(i); // remove any subgraphs (in particular the whole graph) if (element instanceof Subgraph) { elements.remove(i--); continue; } ... |
if (!elements.contains(head)) elements.add(head); | if (!myElements.contains(head)) myElements.add(head); | private Vector getRelatedElements(Vector elements, String relationship) { for (int i = 0; i < elements.size(); i++) { Element element = (Element)elements.elementAt(i); // remove any subgraphs (in particular the whole graph) if (element instanceof Subgraph) { elements.remove(i--); continue; } ... |
return elements; | return myElements; | private Vector getRelatedElements(Vector elements, String relationship) { for (int i = 0; i < elements.size(); i++) { Element element = (Element)elements.elementAt(i); // remove any subgraphs (in particular the whole graph) if (element instanceof Subgraph) { elements.remove(i--); continue; } ... |
for (int i = 0; i < relatedElements.size(); i++) { Element element = (Element)relatedElements.elementAt(i); if (element instanceof Node) { Enumeration edges = ((Node)element).edgeElements(); boolean hasEdges = false; while (edges.hasMoreElements()) { if (relatedElements.contains(edges.nextElement())) { hasEdges = true;... | private void showDualRelationship(String rel1, String rel2) { Vector selectedElements = graph.getSelectedElements(); if (selectedElements == null) return; Vector relatedElements = getRelatedElements(selectedElements, rel1); Vector addl = getRelatedElements(selectedElements, rel2); for (int i = 0; ... | |
if (build != null) { | if (build != null && !build.equals("")) { | public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { super.execute(mapping, form, request, response); ActionErrors errors = new ActionErrors(); String project = (String) PropertyUtils.getSimpleProperty(form, "project"); ... |
} else if (deploy != null) { | } else if (deploy != null && !deploy.equals("")) { | public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { super.execute(mapping, form, request, response); ActionErrors errors = new ActionErrors(); String project = (String) PropertyUtils.getSimpleProperty(form, "project"); ... |
static void invokeLater(Runnable runnable) | public static void invokeLater(Runnable runnable) | static void invokeLater(Runnable runnable) { EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); InvocationEvent ie = new InvocationEvent(eq, runnable, null, false); eq.postEvent(ie); } |
static boolean isDispatchThread() | public static boolean isDispatchThread() | static boolean isDispatchThread() { EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); return (Thread.currentThread() == eq.dispatchThread); } |
final Map buckets = bucket(members, new Transformer() { | final Map buckets = CollectionUtils.bucket(members, new Transformer() { | private void member_helper_size(List members, final ObjectSwitchCallback callback, final ParameterTyper typer, final Label def, final Label end) throws Exception { final... |
Map test = bucket(members, new Transformer() { | Map test = CollectionUtils.bucket(members, new Transformer() { | private void member_helper_type(List members, final ObjectSwitchCallback callback, final ParameterTyper typer, final Label def, final Label end, ... |
throw new RuntimeException("assertion failed index=" + index + " m1=" + members.get(0)); | goTo(def); } else { 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 dontUseE... | private void member_helper_type(List members, final ObjectSwitchCallback callback, final ParameterTyper typer, final Label def, final Label end, ... |
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 Exception... | private void member_helper_type(List members, final ObjectSwitchCallback callback, final ParameterTyper typer, final Label def, final Label end, ... | |
final Map buckets = bucket(members, new Transformer() { | final Map buckets = CollectionUtils.bucket(members, new Transformer() { | private void member_switch_helper(List members, final ObjectSwitchCallback callback, boolean useName, final ParameterTyper typer) throws Exception { final Map cache = new HashMap(); final Par... |
final Map buckets = bucket(strings, new Transformer() { | final Map buckets = CollectionUtils.bucket(strings, new Transformer() { | private void stringSwitchHelper(List strings, final ObjectSwitchCallback callback, final Label def, final Label end, final int index) throws Exception { final int len = ... |
final Map buckets = bucket(Arrays.asList(strings), new Transformer() { | final Map buckets = CollectionUtils.bucket(Arrays.asList(strings), new Transformer() { | private void string_switch_hash(final String[] strings, final ObjectSwitchCallback callback) throws Exception { final Map buckets = bucket(Arrays.asList(strings), new Transformer() { public Object transform(Object value) { return new Integer(value.... |
final Map buckets = bucket(Arrays.asList(strings), new Transformer() { | final Map buckets = CollectionUtils.bucket(Arrays.asList(strings), new Transformer() { | private void string_switch_trie(String[] strings, final ObjectSwitchCallback callback) throws Exception { final Label def = make_label(); final Label end = make_label(); final Map buckets = bucket(Arrays.asList(strings), new Transformer() { public Object transform(Object value) { ... |
log.info("Retrieved URL: " + redirector.url()); | if(log.isDebugEnabled()) { log.debug("Retrieved URL: " + redirector.url()); } | public static ERXComponentActionRedirector redirectorForRequest(WORequest request) { ERXComponentActionRedirector redirector = null; synchronized (responses) { redirector = (ERXComponentActionRedirector)responses.valueForKeyPath(request.sessionID() + "." + request.uri()); } if... |
log.info("No Redirector for request: " + request.uri()); | if(log.isDebugEnabled()) { log.debug("No Redirector for request: " + request.uri()); } | public static ERXComponentActionRedirector redirectorForRequest(WORequest request) { ERXComponentActionRedirector redirector = null; synchronized (responses) { redirector = (ERXComponentActionRedirector)responses.valueForKeyPath(request.sessionID() + "." + request.uri()); } if... |
GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); | GLCanvas canvas = new GLCanvas(); | public static void main(String[] args) { GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); VertexProgRefract demo = new VertexProgRefract(); canvas.addGLEventListener(demo); final Animator animator = new Animator(canvas); demo.setDemoListener(new DemoListener() { ... |
gc = new GenericComponent(); gc.initProperties(); agent = (ABCAgent)gc.getChild(0); | protected void setUp() { gc = new GenericComponent(); gc.initProperties(); agent = (ABCAgent)gc.getChild(0); } | |
System.arraycopy( bytes, 0, data, datapos, bytes.length); | System.arraycopy( data, datapos, bytes, 0, bytes.length); | public void engineNextBytes(byte[] bytes) { if( bytes.length < (20 - datapos) ) { System.arraycopy( bytes, 0, data, datapos, bytes.length); datapos += bytes.length; return; } int i, blen = bytes.length, bpos = 0; byte digestdata[]; while( bpos < blen ) { i = 20 - datapos; Syst... |
System.arraycopy( bytes, bpos, data, datapos, i); | System.arraycopy( data, datapos, bytes, bpos, i); | public void engineNextBytes(byte[] bytes) { if( bytes.length < (20 - datapos) ) { System.arraycopy( bytes, 0, data, datapos, bytes.length); datapos += bytes.length; return; } int i, blen = bytes.length, bpos = 0; byte digestdata[]; while( bpos < blen ) { i = 20 - datapos; Syst... |
log = CSMART.createLogger("org.cougaar.tools.csmart.ui.console"); | createLogger(); | public ConsoleInternalFrame(NodeComponent node, ConsoleNodeListener listener, JScrollPane pane, JRadioButton statusButton, String logFileName, NodeServesClient nodeServer, ... |
public MirroredPropertyInfo(String name, int[] value, | public MirroredPropertyInfo(String name, int[] values, | public MirroredPropertyInfo(String name, int[] value, Integer firstValue, Integer lastValue, String tooltip, String help) { this.name = name; this.value = value; this.firstValue = firstValue; this.lastValue = lastValue; this.tooltip = tooltip; this.help = ScalabilityHelp.getUR... |
this.value = value; | this.values = values; | public MirroredPropertyInfo(String name, int[] value, Integer firstValue, Integer lastValue, String tooltip, String help) { this.name = name; this.value = value; this.firstValue = firstValue; this.lastValue = lastValue; this.tooltip = tooltip; this.help = ScalabilityHelp.getUR... |
agentCount[0] = 1; | private void changeLevels(Object prev) { int newLevels = getLevelCount(); if (newLevels < 1) throw new RuntimeException("Must have > 0 levels"); while (newLevels < getChildCount()) { removeChild(getChildCount() - 1); } if (newLevels > getChildCount()) { int[] agentCount = (int[]) getProperty(... | |
setMirroredProperty(child, mp, level, agentCount); | setMirroredProperty(child, mp, level); | private void changeLevels(Object prev) { int newLevels = getLevelCount(); if (newLevels < 1) throw new RuntimeException("Must have > 0 levels"); while (newLevels < getChildCount()) { removeChild(getChildCount() - 1); } if (newLevels > getChildCount()) { int[] agentCount = (int[]) getProperty(... |
int[] values = null; | private void distributeIntArrayProperty(MirroredPropertyInfo mp, PropertyEvent e) throws InvalidPropertyValueException { int nlvls = getChildCount(); Property prop = e.getProperty(); // We expect the value here to have a certain kind of look. // What is it? check it! Object o = PropertyHelper.validateV... | |
values = (int[]) prop.getValue(); if (values.length <= 0) values = new int[0]; | mp.values = (int[]) prop.getValue(); if (mp.values.length <= 0) mp.values = new int[0]; | private void distributeIntArrayProperty(MirroredPropertyInfo mp, PropertyEvent e) throws InvalidPropertyValueException { int nlvls = getChildCount(); Property prop = e.getProperty(); // We expect the value here to have a certain kind of look. // What is it? check it! Object o = PropertyHelper.validateV... |
setMirroredProperty(child, mp, level, values); | setMirroredProperty(child, mp, level); | private void distributeIntArrayProperty(MirroredPropertyInfo mp, PropertyEvent e) throws InvalidPropertyValueException { int nlvls = getChildCount(); Property prop = e.getProperty(); // We expect the value here to have a certain kind of look. // What is it? check it! Object o = PropertyHelper.validateV... |
values[0] = 1; | mp.values[0] = 1; | private void distributeIntArrayProperty(MirroredPropertyInfo mp, PropertyEvent e) throws InvalidPropertyValueException { int nlvls = getChildCount(); Property prop = e.getProperty(); // We expect the value here to have a certain kind of look. // What is it? check it! Object o = PropertyHelper.validateV... |
Property prop = addProperty(mp.name, mp.value, int[].class); | Property prop = addProperty(mp.name, mp.values, int[].class); | public void initProperties() { PropertyListener listener = new ConfigurableComponentPropertyAdapter() { public void propertyValueChanged(PropertyEvent e) { changeLevels(e.getPreviousValue()); } }; propLevelCount = addProperty(PROP_LEVELCOUNT, PROP_LEVELCOUNT_DFLT, listener, PROP_LE... |
int level, int[] values) | int level) | private void setMirroredProperty(ConfigurableComponent child, MirroredPropertyInfo mp, int level, int[] values) { Property cp = child.getProperty(mp.name); if (cp == null) { System.out.println("Child has no " + mp.name); return; } int nlvls = getChildCount(); Integer cv; ... |
System.out.println("Child has no " + mp.name); | private void setMirroredProperty(ConfigurableComponent child, MirroredPropertyInfo mp, int level, int[] values) { Property cp = child.getProperty(mp.name); if (cp == null) { System.out.println("Child has no " + mp.name); return; } int nlvls = getChildCount(); Integer cv; ... | |
} else if (level < values.length) { cv = new Integer(values[level]); } else if (values.length <= 1) { | } else if (level < mp.values.length) { cv = new Integer(mp.values[level]); } else if (mp.values.length <= 0) { | private void setMirroredProperty(ConfigurableComponent child, MirroredPropertyInfo mp, int level, int[] values) { Property cp = child.getProperty(mp.name); if (cp == null) { System.out.println("Child has no " + mp.name); return; } int nlvls = getChildCount(); Integer cv; ... |
cv = new Integer(values[values.length - 1]); | cv = new Integer(mp.values[mp.values.length - 1]); | private void setMirroredProperty(ConfigurableComponent child, MirroredPropertyInfo mp, int level, int[] values) { Property cp = child.getProperty(mp.name); if (cp == null) { System.out.println("Child has no " + mp.name); return; } int nlvls = getChildCount(); Integer cv; ... |
int index; int left; int base; int multiplier; StringBuffer buffer; boolean foundFirst; | StringBuffer buffer = new StringBuffer(); int left = columnIndex; boolean foundFirst = false; for (int index = 6; index >= 0; index--) { int base = (int) (Math.pow (26, index)); if (index > 1) { base = base + (int) (Math.pow (26, index - 1)); } if (base <= left) { int multiplier = left / base; if (foundFirst == fa... | public String getColumnName(int columnIndex) { // Variables int index; int left; int base; int multiplier; StringBuffer buffer; boolean foundFirst; // Ok, this is not the best solution in the world // and it does produce wrong answers starting 1378 // but it's a start. I sure hope there is a more // s... |
buffer = new StringBuffer(); left = columnIndex; foundFirst = false; for (index = 6; index >= 0; index--) { base = (int) (Math.pow(26, index)); if (index > 1) { base = base + (int) (Math.pow(26, index - 1)); } if (base <= left) { multiplier = left / base; if (foundFirst == false && index > 0) { buffer.append((char) (mu... | return buffer.toString(); } | public String getColumnName(int columnIndex) { // Variables int index; int left; int base; int multiplier; StringBuffer buffer; boolean foundFirst; // Ok, this is not the best solution in the world // and it does produce wrong answers starting 1378 // but it's a start. I sure hope there is a more // s... |
if (hostTree.getModel().equals(source)) | if (hostTree.getModel().equals(source)) { | public void treeNodesInserted(TreeModelEvent e) { // System.out.println("CSMARTConsole: treeNodesInserted"); Object source = e.getSource(); if (hostTree.getModel().equals(source)) treeNodesInsertedInHostTree(e); else if (nodeTree.getModel().equals(source)) treeNodesInsertedInNodeTree(e); e... |
else if (nodeTree.getModel().equals(source)) | } else if (nodeTree.getModel().equals(source)) | public void treeNodesInserted(TreeModelEvent e) { // System.out.println("CSMARTConsole: treeNodesInserted"); Object source = e.getSource(); if (hostTree.getModel().equals(source)) treeNodesInsertedInHostTree(e); else if (nodeTree.getModel().equals(source)) treeNodesInsertedInNodeTree(e); e... |
hostComponent.addNode((NodeComponent)cto.getComponent()); | NodeComponent nodeComponent = (NodeComponent)cto.getComponent(); if (!hostComponentHasNode(hostComponent, nodeComponent)) hostComponent.addNode(nodeComponent); | private void treeNodesInsertedInHostTree(TreeModelEvent e) { TreePath path = e.getTreePath(); // parent of the new node DefaultMutableTreeNode changedNode = (DefaultMutableTreeNode)path.getLastPathComponent(); ConsoleTreeObject cto = (ConsoleTreeObject)(changedNode.getUserObject()); // System.out... |
if (hostTree.getModel().equals(source)) | if (hostTree.getModel().equals(source)) { | public void treeNodesRemoved(TreeModelEvent e) { Object source = e.getSource(); if (hostTree.getModel().equals(source)) treeNodesRemovedFromHostTree(e); else if (nodeTree.getModel().equals(source)) treeNodesRemovedFromNodeTree(e); experimentBuilder.setModified(true); } |
else if (nodeTree.getModel().equals(source)) | } else if (nodeTree.getModel().equals(source)) | public void treeNodesRemoved(TreeModelEvent e) { Object source = e.getSource(); if (hostTree.getModel().equals(source)) treeNodesRemovedFromHostTree(e); else if (nodeTree.getModel().equals(source)) treeNodesRemovedFromNodeTree(e); experimentBuilder.setModified(true); } |
int iterations = 10000; | int iterations = 100000; | public void testMetaClassPerformance()throws Throwable{ int iterations = 10000; System.out.println(); System.out.println("iteration count: " + iterations); System.out.println(); MetaClass mClass = new MetaClassReflectImpl( A.class,getters,setters,types ); ... |
resolvedRevisions.put(new ModuleId("yourorg", "yourmodule2"), "2.5"); resolvedRevisions.put(new ModuleId("yourorg", "yourmodule6"), "6.3"); | resolvedRevisions.put(ModuleRevisionId.newInstance("yourorg", "yourmodule2", "2+"), "2.5"); resolvedRevisions.put(ModuleRevisionId.newInstance("yourorg", "yourmodule6", "latest.integration"), "6.3"); | public void testUpdate() throws Exception { /* * For updated file to be equals to updated.xml, * we have to fix the line separator to the one used * in updated.xml, in order for this test to works in * all platforms (default line separator used in * updater being plat... |
private static Object enhanceHelper(boolean delegating, | private synchronized static Object enhanceHelper(boolean delegating, | private static Object enhanceHelper(boolean delegating, Object obj, Class cls, Class[] interfaces, MethodInterceptor ih, ... |
Object key = keyFactory.newInstance(cls, interfaces, wreplace, delegating); Class result = (Class) map.get(key); | Class result = null; synchronized( cls ){ | private static Object enhanceHelper(boolean delegating, Object obj, Class cls, Class[] interfaces, MethodInterceptor ih, ... |
} | private static Object enhanceHelper(boolean delegating, Object obj, Class cls, Class[] interfaces, MethodInterceptor ih, ... | |
drawable.setGL(new DebugGL(drawable.getGL())); | if (!(drawable.getGL() instanceof DebugGL)) { drawable.setGL(new DebugGL(drawable.getGL())); } | public void init(GLDrawable drawable) { gl = drawable.getGL(); glu = drawable.getGLU(); drawable.setGL(new DebugGL(drawable.getGL())); double[][] rect = new double[][]{{50.0, 50.0, 0.0}, {200.0, 50.0, 0.0}, ... |
organizer.removeChildren(experimentCopy); | protected void runBuilder(ModifiableComponent cc, boolean alwaysNew) { // note that cc is guaranteed non-null when this is called Class[] paramClasses = { CSMART.class, ModifiableComponent.class, Experiment.class }; Object[] params = new Object[3]; params[0] = this; Exper... | |
if (_organisation == null && context.endsWith("groupId")) { _organisation = txt; } else if (_module == null && context.endsWith("artifactId")) { _module = txt; } else if (_revision == null && context.endsWith("version")) { _revision = txt; } else if (_scope == null && context.endsWith("scope")) { _scope = txt; | if (_md.getModuleRevisionId() == null || context.startsWith("project/dependencies/dependency")) { if (_organisation == null && context.endsWith("groupId")) { _organisation = txt; } else if (_module == null && context.endsWith("artifactId")) { _module = txt; } else if (_revision == null && context.endsWith("version")) {... | public void characters(char[] ch, int start, int length) throws SAXException { String txt = new String(ch, start, length).trim(); String context = getContext(); if (_organisation == null && context.endsWith("groupId")) { _organisation = txt; } else if (... |
} catch(Exception ex) { log.warn("Error in D2WPage: propertyKey=" + propertyKey() + ", componentName=" + d2wContext().valueForKey("componentName") + ", customComponent=" + d2wContext().valueForKey("customComponentName"), ex); throw new NSForwardException(ex, "Error generating page"); | public void appendToResponse(WOResponse r, WOContext c) { NDC.push("Page: " + getClass().getName()+ (d2wContext()!= null ? (" - Configuration: "+d2wContext().valueForKey("pageConfiguration")) : "")); try { super.appendToResponse(r,c); } finally { NDC.pop(); } } ... | |
} else if(result instanceof ERD2WListPage) { dg = ((ERD2WListPage)result).displayGroup(); | } else if(result instanceof ERDListPageInterface) { dg = ((ERDListPageInterface)result).displayGroup(); | public static WOComponent printerFriendlyVersion(D2WContext d2wContext, WOSession session, EODataSource dataSource, WODisplayGroup displayGroup) { ListPageInterface result=(ListPageInterface)ERDirectToWeb.printerFriendlyPageForD2WContext(d2wContext,session); result.setDataSource(dataSource); WO... |
create (GTK_WINDOW_TOPLEVEL); | create (GDK_WINDOW_TYPE_HINT_NORMAL, true); | void create () { create (GTK_WINDOW_TOPLEVEL); } |
return Math.sqrt(distance(X1, Y1, X2, Y2)); | return Math.sqrt(distanceSq(X1, Y1, X2, Y2)); | static public double distance (double X1, double Y1, double X2, double Y2) { return Math.sqrt(distance(X1, Y1, X2, Y2)); } |
int colon; | int colon, at_host; | protected void parseURL(URL url, String spec, int start, int end) { String host = url.getHost(); int port = url.getPort(); String file = url.getFile(); String ref = url.getRef(); if (spec.regionMatches (start, "//", 0, 2)) { int hostEnd; int colon; start += 2; int slash = spec.indexOf('/', st... |
if ((colon = host.indexOf(':')) >= 0) | if ((colon = genuineHost.indexOf (':')) >= 0) | protected void parseURL(URL url, String spec, int start, int end) { String host = url.getHost(); int port = url.getPort(); String file = url.getFile(); String ref = url.getRef(); if (spec.regionMatches (start, "//", 0, 2)) { int hostEnd; int colon; start += 2; int slash = spec.indexOf('/', st... |
port = Integer.parseInt(host.substring(colon + 1)); | port = Integer.parseInt (genuineHost.substring (colon + 1)); | protected void parseURL(URL url, String spec, int start, int end) { String host = url.getHost(); int port = url.getPort(); String file = url.getFile(); String ref = url.getRef(); if (spec.regionMatches (start, "//", 0, 2)) { int hostEnd; int colon; start += 2; int slash = spec.indexOf('/', st... |
host = host.substring(0, colon); | if (at_host >= 0) host = host.substring (0, at_host + colon); else host = host.substring (0, colon); | protected void parseURL(URL url, String spec, int start, int end) { String host = url.getHost(); int port = url.getPort(); String file = url.getFile(); String ref = url.getRef(); if (spec.regionMatches (start, "//", 0, 2)) { int hostEnd; int colon; start += 2; int slash = spec.indexOf('/', st... |
String protocol, host, file, ref; | String protocol, host, file, ref, user; | protected String toExternalForm(URL u) { String protocol, host, file, ref; int port; protocol = u.getProtocol(); // JDK 1.2 online doc infers that host could be null because it // explicitly states that file cannot be null, but is silent on host. host = u.getHost(); if (host == null) host =... |
sb.append(" | sb.append(" if (user != null && !"".equals(user)) sb.append(user).append('@'); sb.append(host); | protected String toExternalForm(URL u) { String protocol, host, file, ref; int port; protocol = u.getProtocol(); // JDK 1.2 online doc infers that host could be null because it // explicitly states that file cannot be null, but is silent on host. host = u.getHost(); if (host == null) host =... |
private Map storageMap(boolean create) { | private static Map storageMap(boolean create) { | private Map storageMap(boolean create) { Map map = (Map)threadMap.get(); if (map == null && create) { // CHECKME: Does this need to be synchronized? map = Collections.synchronizedMap(new HashMap(DefaultHashMapSize)); threadMap.set(ht); } return map; } |
threadMap.set(ht); | threadMap.set(map); | private Map storageMap(boolean create) { Map map = (Map)threadMap.get(); if (map == null && create) { // CHECKME: Does this need to be synchronized? map = Collections.synchronizedMap(new HashMap(DefaultHashMapSize)); threadMap.set(ht); } return map; } |
static Type toType(Class cls) { | static Type[] toType(Class cls[]) { | static Type toType(Class cls) { if (cls.equals(void.class)) { return Type.VOID; } if (cls.isPrimitive()) { if (int.class.equals(cls)) { return Type.INT; } else if (char.class.equals(cls)) { return Type.CHAR; } els... |
if (cls.equals(void.class)) { return Type.VOID; | Type tp[] = new Type[cls.length]; for (int i = 0; i < cls.length; i++) { tp[i] = toType(cls[i]); | static Type toType(Class cls) { if (cls.equals(void.class)) { return Type.VOID; } if (cls.isPrimitive()) { if (int.class.equals(cls)) { return Type.INT; } else if (char.class.equals(cls)) { return Type.CHAR; } els... |
if (cls.isPrimitive()) { if (int.class.equals(cls)) { return Type.INT; } else if (char.class.equals(cls)) { return Type.CHAR; } else if (short.class.equals(cls)) { return Type.SHORT; } else if (byte.class.equals(cls)) { return Type.BYTE; } else if (long.class.equals(cls)) { return Type.LONG; } else if (float.class.equa... | return tp; | static Type toType(Class cls) { if (cls.equals(void.class)) { return Type.VOID; } if (cls.isPrimitive()) { if (int.class.equals(cls)) { return Type.INT; } else if (char.class.equals(cls)) { return Type.CHAR; } els... |
Artifact artifact = new DefaultArtifact(mrid, null, "ivy", "ivy", "xml"); String revisionToken = mrid.getRevision().startsWith("latest.")?"[any "+mrid.getRevision().substring("latest.".length())+"]":"["+mrid.getRevision()+"]"; Artifact latestArtifact = new DefaultArtifact(new ModuleRevisionId(mrid.getModuleId(), revisi... | Artifact artifact = DefaultArtifact.newIvyArtifact(mrid, null); logMdNotFound(mrid, artifact); | protected void logIvyNotFound(ModuleRevisionId mrid) { Artifact artifact = new DefaultArtifact(mrid, null, "ivy", "ivy", "xml"); String revisionToken = mrid.getRevision().startsWith("latest.")?"[any "+mrid.getRevision().substring("latest.".length())+"]":"["+mrid.getRevision()+"]"; Artifact late... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.