rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
return (society == null ? 0 : 1);
return (this.societyComponent == null ? 0 : 1);
public int getSocietyComponentCount() { return (society == null ? 0 : 1); }
return theWholeSoc;
return completeSociety;
public ComponentData getSocietyComponentData() { saveToDb(); // if modified, update component data and save to database return theWholeSoc; }
int n = getComponentCount();
ModifiableComponent comp = getSocietyComponent(); Iterator names = comp.getPropertyNames(); while (names.hasNext()) { Property property = comp.getProperty((CompositeName)names.next()); List values = property.getExperimentValues(); if (values != null) experimentValueCounts.add(new Integer(values.size())); } int n = ge...
public int getTrialCount() { if (hasValidTrials) return numberOfTrials; ArrayList experimentValueCounts = new ArrayList(100); int n = getComponentCount(); for (int i = 0; i < n; i++) { ModifiableComponent comp = getComponent(i); Iterator names = comp.getPropertyNames(); while (names.h...
ModifiableComponent comp = getComponent(i); Iterator names = comp.getPropertyNames();
comp = getRecipeComponent(i); names = comp.getPropertyNames();
public int getTrialCount() { if (hasValidTrials) return numberOfTrials; ArrayList experimentValueCounts = new ArrayList(100); int n = getComponentCount(); for (int i = 0; i < n; i++) { ModifiableComponent comp = getComponent(i); Iterator names = comp.getPropertyNames(); while (names.h...
int n = getComponentCount();
ModifiableComponent comp = getSocietyComponent(); List propertyNames = comp.getPropertyNamesList(); for (Iterator j = propertyNames.iterator(); j.hasNext(); ) { Property property = comp.getProperty((CompositeName)j.next()); List values = property.getExperimentValues(); if (values != null && values.size() != 0) { proper...
public Trial[] getTrials() { if (hasValidTrials) return (Trial[])trials.toArray(new Trial[trials.size()]); getTrialCount(); // update trial count // get lists of unbound properties and their experimental values List properties = new ArrayList(); List experimentValues = new ArrayList(); int n = ...
ModifiableComponent comp = getComponent(i); List propertyNames = comp.getPropertyNamesList();
comp = getRecipeComponent(i); propertyNames = comp.getPropertyNamesList();
public Trial[] getTrials() { if (hasValidTrials) return (Trial[])trials.toArray(new Trial[trials.size()]); getTrialCount(); // update trial count // get lists of unbound properties and their experimental values List properties = new ArrayList(); List experimentValues = new ArrayList(); int n = ...
HostComponent[] hosts = getHosts();
HostComponent[] hosts = getHostComponents();
public boolean hasConfiguration() { if (hosts.isEmpty() || nodes.isEmpty() || getAgents() == null || getAgents().length == 0) { return false; } HostComponent[] hosts = getHosts(); for (int i = 0; i < hosts.length; i++) { if (hosts[i] == null) continue; NodeComponent[] nodes = hosts[i].getNo...
int n = getComponentCount();
ModifiableComponent comp = getSocietyComponent(); List propertyNames = comp.getPropertyNamesList(); for (Iterator j = propertyNames.iterator(); j.hasNext(); ) { Property property = comp.getProperty((CompositeName)j.next()); if (! property.isValueSet()) { List values = property.getExperimentValues(); if (values == null ...
public boolean hasUnboundProperties() { int n = getComponentCount(); for (int i = 0; i < n; i++) { ModifiableComponent comp = getComponent(i); List propertyNames = comp.getPropertyNamesList(); for (Iterator j = propertyNames.iterator(); j.hasNext(); ) { Property property = comp.getProperty((Compo...
ModifiableComponent comp = getComponent(i); List propertyNames = comp.getPropertyNamesList();
comp = getRecipeComponent(i); propertyNames = comp.getPropertyNamesList();
public boolean hasUnboundProperties() { int n = getComponentCount(); for (int i = 0; i < n; i++) { ModifiableComponent comp = getComponent(i); List propertyNames = comp.getPropertyNamesList(); for (Iterator j = propertyNames.iterator(); j.hasNext(); ) { Property property = comp.getProperty((Compo...
public void removeComponent(ModifiableComponent comp) { if (comp instanceof SocietyComponent) removeSociety((SocietyComponent)comp); if (comp instanceof RecipeComponent) removeRecipe((RecipeComponent)comp);
public void removeComponent(ModifiableComponent comp) throws IllegalArgumentException { if (comp instanceof SocietyComponent) { removeSocietyComponent(); } else if (comp instanceof RecipeComponent) { removeRecipeComponent((RecipeComponent)comp); } else { throw new IllegalArgumentException("Unsupported Component Type");...
public void removeComponent(ModifiableComponent comp) { if (comp instanceof SocietyComponent) removeSociety((SocietyComponent)comp); if (comp instanceof RecipeComponent) removeRecipe((RecipeComponent)comp); // Must handle random components!!! }
ExperimentHost sc = (ExperimentHost) hostComponent;
public void removeHost(HostComponent hostComponent) { ExperimentHost sc = (ExperimentHost) hostComponent; hosts.remove(hostComponent); sc.dispose(); // Let the host disassociate itself from nodes sc.removeModificationListener(this); fireModification(); }
sc.dispose(); sc.removeModificationListener(this);
((ExperimentHost)hostComponent).dispose(); ((ExperimentHost)hostComponent).removeModificationListener(this);
public void removeHost(HostComponent hostComponent) { ExperimentHost sc = (ExperimentHost) hostComponent; hosts.remove(hostComponent); sc.dispose(); // Let the host disassociate itself from nodes sc.removeModificationListener(this); fireModification(); }
public void renameHost(HostComponent hostComponent, String name) { hosts.remove(hostComponent); hostComponent.setName(name); hosts.add(hostComponent); fireModification();
public void renameHost(HostComponent hostComponent, String name) throws IllegalArgumentException { ExperimentHost testHost = new ExperimentHost(name); if(hosts.contains(testHost)) { throw new IllegalArgumentException("Host Already Exists in Society"); } else { hosts.remove(hostComponent); hostComponent.setName(name); h...
public void renameHost(HostComponent hostComponent, String name) { // FIXME! This allows 2 Hosts with the same name! hosts.remove(hostComponent); hostComponent.setName(name); hosts.add(hostComponent); fireModification(); }
public void renameNode(NodeComponent nc, String name) { nodes.remove(nc); nc.setName(name); nodes.add(nc); fireModification();
public void renameNode(NodeComponent nc, String name) throws IllegalArgumentException { if(nodeExists(name)) { throw new IllegalArgumentException("Node name already exists!"); } else { nodes.remove(nc); nc.setName(name); nodes.add(nc); fireModification(); }
public void renameNode(NodeComponent nc, String name) { // FIXME! This allows 2 Nodes with the same name! nodes.remove(nc); nc.setName(name); //fireModification(); nodes.add(nc); fireModification(); }
Set writtenNodes = new HashSet();
public void saveToDb(DBConflictHandler ch) { if (!modified) { if (log.isDebugEnabled()) log.debug("Save to database not needed; experiment not modified"); return; } try { updateNameServerHostName(); // Be sure this is up-to-date Set writtenNodes = new HashSet(); List componen...
NodeComponent[] nodesToWrite = getNodes(); ComponentData theSoc = new GenericComponentData(); theSoc.setType(ComponentData.SOCIETY); theSoc.setName(getExperimentName()); theSoc.setClassName("java.lang.Object"); theSoc.setOwner(this); theSoc.setParent(null); addDefaultNodeArguments(theSoc);
boolean componentWasRemoved = generateCompleteSociety();
public void saveToDb(DBConflictHandler ch) { if (!modified) { if (log.isDebugEnabled()) log.debug("Save to database not needed; experiment not modified"); return; } try { updateNameServerHostName(); // Be sure this is up-to-date Set writtenNodes = new HashSet(); List componen...
for (Iterator i = hosts.iterator(); i.hasNext(); ) { ExperimentHost host = (ExperimentHost) i.next(); ComponentData hc = new GenericComponentData(); hc.setType(ComponentData.HOST); hc.setName(host.getShortName()); hc.setClassName(""); hc.setOwner(this); hc.setParent(theSoc); addPropertiesAsParameters(hc, host); theSoc....
public void saveToDb(DBConflictHandler ch) { if (!modified) { if (log.isDebugEnabled()) log.debug("Save to database not needed; experiment not modified"); return; } try { updateNameServerHostName(); // Be sure this is up-to-date Set writtenNodes = new HashSet(); List componen...
if(log.isDebugEnabled()) { log.debug("Adding All Components"); }
public void saveToDb(DBConflictHandler ch) { if (!modified) { if (log.isDebugEnabled()) log.debug("Save to database not needed; experiment not modified"); return; } try { updateNameServerHostName(); // Be sure this is up-to-date Set writtenNodes = new HashSet(); List componen...
boolean componentWasRemoved = false; for (int i = 0, n = components.size(); i < n; i++) { BaseComponent soc = (BaseComponent) components.get(i); if(log.isDebugEnabled()) { log.debug(soc + ".addComponentData"); } soc.addComponentData(theSoc); componentWasRemoved |= soc.componentWasRemoved(); }
public void saveToDb(DBConflictHandler ch) { if (!modified) { if (log.isDebugEnabled()) log.debug("Save to database not needed; experiment not modified"); return; } try { updateNameServerHostName(); // Be sure this is up-to-date Set writtenNodes = new HashSet(); List componen...
if (componentWasRemoved) pdb.repopulateCMT(theSoc); pdb.populateHNA(theSoc);
if (componentWasRemoved) pdb.repopulateCMT(completeSociety); if(log.isErrorEnabled() && completeSociety == null) { log.error("Society Data is null!"); } pdb.populateHNA(completeSociety);
public void saveToDb(DBConflictHandler ch) { if (!modified) { if (log.isDebugEnabled()) log.debug("Save to database not needed; experiment not modified"); return; } try { updateNameServerHostName(); // Be sure this is up-to-date Set writtenNodes = new HashSet(); List componen...
soc.modifyComponentData(theSoc, pdb);
soc.modifyComponentData(completeSociety, pdb);
public void saveToDb(DBConflictHandler ch) { if (!modified) { if (log.isDebugEnabled()) log.debug("Save to database not needed; experiment not modified"); return; } try { updateNameServerHostName(); // Be sure this is up-to-date Set writtenNodes = new HashSet(); List componen...
pdb.repopulateCMT(theSoc);
pdb.repopulateCMT(completeSociety);
public void saveToDb(DBConflictHandler ch) { if (!modified) { if (log.isDebugEnabled()) log.debug("Save to database not needed; experiment not modified"); return; } try { updateNameServerHostName(); // Be sure this is up-to-date Set writtenNodes = new HashSet(); List componen...
pdb.populateCSMI(theSoc);
pdb.populateCSMI(completeSociety);
public void saveToDb(DBConflictHandler ch) { if (!modified) { if (log.isDebugEnabled()) log.debug("Save to database not needed; experiment not modified"); return; } try { updateNameServerHostName(); // Be sure this is up-to-date Set writtenNodes = new HashSet(); List componen...
theWholeSoc = theSoc;
public void saveToDb(DBConflictHandler ch) { if (!modified) { if (log.isDebugEnabled()) log.debug("Save to database not needed; experiment not modified"); return; } try { updateNameServerHostName(); // Be sure this is up-to-date Set writtenNodes = new HashSet(); List componen...
defaultNodeArguments = new ReadOnlyProperties(Collections.singleton("org.cougaar.experiment.id")); defaultNodeArguments.put("org.cougaar.core.persistence.enable", "false"); defaultNodeArguments.put("user.timezone", "GMT"); defaultNodeArguments.put("org.cougaar.core.agent.startTime", "08/10/2005"); defaultNodeArguments....
defaultNodeArguments = new ReadOnlyProperties(Collections.singleton(EXPERIMENT_ID)); defaultNodeArguments.put(PERSISTENCE_ENABLE, PERSISTENCE_DFLT); defaultNodeArguments.put(TIMEZONE, TIMEZONE_DFLT); defaultNodeArguments.put(AGENT_STARTTIME, AGENT_STARTTIME_DFLT); defaultNodeArguments.put(COMPLAININGLP_LEVEL, COMPLAINI...
private void setDefaultNodeArguments() { defaultNodeArguments = new ReadOnlyProperties(Collections.singleton("org.cougaar.experiment.id")); defaultNodeArguments.put("org.cougaar.core.persistence.enable", "false"); defaultNodeArguments.put("user.timezone", "GMT"); defaultNodeArguments.put("org.cougaar.core...
defaultNodeArguments.put("org.cougaar.configuration.database",
defaultNodeArguments.put(CONFIG_DATABASE,
private void setDefaultNodeArguments() { defaultNodeArguments = new ReadOnlyProperties(Collections.singleton("org.cougaar.experiment.id")); defaultNodeArguments.put("org.cougaar.core.persistence.enable", "false"); defaultNodeArguments.put("user.timezone", "GMT"); defaultNodeArguments.put("org.cougaar.core...
defaultNodeArguments.put("org.cougaar.configuration.user",
defaultNodeArguments.put(CONFIG_USER,
private void setDefaultNodeArguments() { defaultNodeArguments = new ReadOnlyProperties(Collections.singleton("org.cougaar.experiment.id")); defaultNodeArguments.put("org.cougaar.core.persistence.enable", "false"); defaultNodeArguments.put("user.timezone", "GMT"); defaultNodeArguments.put("org.cougaar.core...
defaultNodeArguments.put("org.cougaar.configuration.password",
defaultNodeArguments.put(CONFIG_PASSWD,
private void setDefaultNodeArguments() { defaultNodeArguments = new ReadOnlyProperties(Collections.singleton("org.cougaar.experiment.id")); defaultNodeArguments.put("org.cougaar.core.persistence.enable", "false"); defaultNodeArguments.put("user.timezone", "GMT"); defaultNodeArguments.put("org.cougaar.core...
defaultNodeArguments.setReadOnlyProperty("org.cougaar.experiment.id", getTrialID());
defaultNodeArguments.setReadOnlyProperty(EXPERIMENT_ID, getTrialID());
private void setDefaultNodeArguments() { defaultNodeArguments = new ReadOnlyProperties(Collections.singleton("org.cougaar.experiment.id")); defaultNodeArguments.put("org.cougaar.core.persistence.enable", "false"); defaultNodeArguments.put("user.timezone", "GMT"); defaultNodeArguments.put("org.cougaar.core...
defaultNodeArguments .put("env.DISPLAY", InetAddress.getLocalHost().getHostName() + ":0.0");
defaultNodeArguments.put(ENV_DISPLAY, InetAddress.getLocalHost().getHostName() + ":0.0");
private void setDefaultNodeArguments() { defaultNodeArguments = new ReadOnlyProperties(Collections.singleton("org.cougaar.experiment.id")); defaultNodeArguments.put("org.cougaar.core.persistence.enable", "false"); defaultNodeArguments.put("user.timezone", "GMT"); defaultNodeArguments.put("org.cougaar.core...
System.out.println(uhe);
if(log.isErrorEnabled()) { log.error("UnknownHost Exception", uhe); }
private void setDefaultNodeArguments() { defaultNodeArguments = new ReadOnlyProperties(Collections.singleton("org.cougaar.experiment.id")); defaultNodeArguments.put("org.cougaar.core.persistence.enable", "false"); defaultNodeArguments.put("user.timezone", "GMT"); defaultNodeArguments.put("org.cougaar.core...
public void setSocietyComponent(SocietyComponent soc) { society = soc;
private void setSocietyComponent(SocietyComponent society) { this.societyComponent = society;
public void setSocietyComponent(SocietyComponent soc) { society = soc; }
defaultNodeArguments.setReadOnlyProperty("org.cougaar.experiment.id", trialID);
defaultNodeArguments.setReadOnlyProperty(EXPERIMENT_ID, trialID);
public void setTrialID(String trialID) { this.trialID = trialID; defaultNodeArguments.setReadOnlyProperty("org.cougaar.experiment.id", trialID); }
return getShortName();
return this.getShortName();
public String toString() { return getShortName(); }
HostComponent[] hosts = getHosts();
HostComponent[] hosts = getHostComponents();
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...
UID uid = new UID(optUID);
UID uid = UID.toUID(optUID);
public void execute( PrintStream out, HttpInput queryParameters, PlanServiceContext psc, PlanServiceUtilities psu) throws Exception { // parse URL parameters and POST data // // can later add filters as an Operator (UnaryPredicate) Set startUIDs = null; boolean returnAsData = false;...
UID ui = new UID((String)oi);
UID ui = UID.toUID((String)oi);
private static Set getSearchUIDs( HttpInput queryParameters) { // see if data was posted if (!(queryParameters.hasBody())) { return null; } // get the posted Object Object postObj; try { postObj = queryParameters.getBodyAsObject(); } catch (Exception e) { throw new IllegalArgu...
public PlanElement getRegarding();
PlanElement getRegarding();
public PlanElement getRegarding();
if (((EOEnterpriseObject)eo).editingContext()==null || editingContext()==null) throw new RuntimeException("******** Attempted to link to EOs through "+key+" when one of them was not in an editing context: "+this+" and "+eo); throw new RuntimeException("******** Attempted to link to EOs through "+key+" in different edit...
if (((EOEnterpriseObject)eo).editingContext()==null || editingContext()==null) { cat.warn("******** Attempted to link to EOs through "+key+" when one of them was not in an editing context: "+this+":"+editingContext()+" and "+eo+ ":" + ((EOEnterpriseObject)eo).editingContext()); } else { throw new RuntimeException("**...
public void addObjectToBothSidesOfRelationshipWithKey(EORelationshipManipulation eo, String key) { if (eo!=null && ((EOEnterpriseObject)eo).editingContext()!=editingContext() && !(editingContext() instanceof EOSharedEditingContext) && !(((EOEnterpriseObject)eo).editingContex...
String pk = primaryKey(); pk = (pk == null) ? "null pk" : pk;
String pk = "null pk"; try { primaryKey(); pk = (pk == null) ? "null pk" : pk; } catch(NullPointerException ex) { cat.warn(ex); }
public String toString() { String pk = primaryKey(); pk = (pk == null) ? "null pk" : pk; return "<" + getClass().getName() + " "+ pk + ">"; }
this.requestId= parameters.getParameter( DISPATCHER_REQUEST_ATTRIBUTE, null); if (requestId == null) { String error = "dispatcherError:\n" + "You have to set the \"request\" parameter in the sitemap!"; getLogger().error(error); throw new ProcessingException(error); } parameterHelper.put(DISPATCHER_REQUEST_ATTRIBUTE, re...
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException { super.setup(resolver, objectModel, src, par); localRecycle(); try { this.dispatcherHelper = new DispatcherHelper(manag...
boolean f =
boolean f = Base.class.getName().equals(name) ||
public static void main( String args [] )throws Exception{ ClassTransformerFactory transformation = new ClassTransformerFactory (){ public ClassTransformer newInstance(){ try{ InterceptFieldTransformer t1 = new InterceptFieldTransformer( new Fil...
boolean f =
boolean f = Base.class.getName().equals(name) ||
public boolean accept(String name){ System.out.println("load : " + name); boolean f = MA.class.getName().equals(name) || TransformDemo.class.getName().equals(name); if(f){ System.out.println("transforming " ...
ma.setBaseTest("base test field"); ma.getBaseTest();
public static void start(){ MA ma = new MA(); makePersistent(ma); ma.setCharP('A'); ma.getCharP(); ma.setDoubleP(554); ma.setDoubleP(1.2); ma.getFloatP(); ma.setName("testName"); ma.publicField = "set value"; ma.publicField = ma.publicField ...
isStatic = Modifier.isStatic(modifiers);
public void begin_method(int modifiers, Class returnType, String methodName, Class[] parameterTypes, Class[] exceptionTypes) { checkInMethod(); this.methodName = methodName; this.returnType = returnType; this.parameterTypes = parameterTypes; backend.begin_method(modifiers, retu...
return defineClass(className, bytes, classLoader);
Class type = defineClass(className, bytes, classLoader); postDefine(type); return type;
public final Class define() { try { init(); generate(); postGenerate(); byte[] bytes = backend.getBytes(); if (debugLocation != null) { OutputStream out = new FileOutputStream(new File(new File(debugLocation), c...
load_local(parameterTypes[index], 1 + skipArgs(index));
load_local(parameterTypes[index], getLocalOffset() + skipArgs(index));
protected void load_arg(int index) { load_local(parameterTypes[index], 1 + skipArgs(index)); }
if (isStatic) { throw new IllegalStateException("no 'this' pointer within static method"); }
protected void load_this() { backend.emit_var(Opcodes.ALOAD, 0); }
nextLocal = 1 + getStackSize(parameterTypes);
nextLocal = getLocalOffset() + getStackSize(parameterTypes);
private void setNextLocal() { nextLocal = 1 + getStackSize(parameterTypes); }
ResolveReport r = _ivy.resolve(new File("test/repositories/1/org2/mod2.1/ivys/ivy-0.3.1.xml").toURL(), null, new String[] {"runtime", "compile"}, _cache, null, true); assertEquals(1, r.getConfigurationReport("compile").getArtifactsNumber()); assertEquals(2, r.getConfigurationReport("runtime").getArtifactsNumber());
public void testDisableTransitivityPerConfiguration() throws Exception { // mod2.1 (compile, runtime) depends on mod1.1 which depends on mod1.2 // compile conf is not transitive // first we resolve compile conf only _ivy.resolve(new File("test/repositories/1/org2/mod2.1/ivys/ivy-...
return sb.toString();
String id = sb.toString(); if(log.isDebugEnabled()) log.debug("courseId constructed as: " + id); return id;
public String getCourseId(Term term, List requiredFields) { StringBuffer sb = new StringBuffer(); if (term != null) { sb.append(term.getYear()); sb.append(","); sb.append(term.getTerm()); } else { sb.append(",,"); } for (int i = 0; i < requiredFields.size(); i++) { sb.append(","); sb.append((String...
if(log.isDebugEnabled()) { StringBuffer sb = new StringBuffer("Found the following course members for "); sb.append(courseId); sb.append(": "); for(Iterator iter = members.iterator(); iter.hasNext();) { CourseMember member = (CourseMember)iter.next(); sb.append(member.getUniqname()); if(iter.hasNext()) { sb.append(", "...
public List getCourseMembers(String courseId) { Section section = cmService.getSection(courseId); Map userRoles = cmGroupProvider.getUserRolesForGroup(courseId); List members = new ArrayList(); for(Iterator iter = userRoles.keySet().iterator(); iter.hasNext();) { String userEid = (String)iter.next(); String ro...
Set sections = cmService.findInstructingSections(instructorId);
Map groupRoleMap = cmGroupProvider.getGroupRolesForUser(instructorId); if(log.isDebugEnabled()) log.debug("Found the following section EIDs for instructor " + instructorId + ": " + groupRoleMap.keySet());
public List getInstructorCourses(String instructorId, String termYear, String termTerm) { Set sections = cmService.findInstructingSections(instructorId); List courses = new ArrayList(); for(Iterator iter = sections.iterator(); iter.hasNext();) { Section section = (Section)iter.next(); Course course = getLegacyC...
for(Iterator iter = sections.iterator(); iter.hasNext();) { Section section = (Section)iter.next();
for(Iterator iter = groupRoleMap.keySet().iterator(); iter.hasNext();) { String sectionEid = (String)iter.next(); String role = (String)groupRoleMap.get(sectionEid); if( ! sectionMappingRoles.contains(role)) { continue; } Section section = cmService.getSection(sectionEid);
public List getInstructorCourses(String instructorId, String termYear, String termTerm) { Set sections = cmService.findInstructingSections(instructorId); List courses = new ArrayList(); for(Iterator iter = sections.iterator(); iter.hasNext();) { Section section = (Section)iter.next(); Course course = getLegacyC...
if(as.getTitle().indexOf(termYear) != -1 && as.getTitle().indexOf(termTerm) != -1) {
if(as.getTitle().toLowerCase().indexOf(termYear.toLowerCase()) != -1 && as.getTitle().toLowerCase().indexOf(termTerm.toLowerCase()) != -1) { if(log.isDebugEnabled()) log.debug("Section " + section.getEid() + " matches the term " + termTerm + " " + termYear);
public List getInstructorCourses(String instructorId, String termYear, String termTerm) { Set sections = cmService.findInstructingSections(instructorId); List courses = new ArrayList(); for(Iterator iter = sections.iterator(); iter.hasNext();) { Section section = (Section)iter.next(); Course course = getLegacyC...
} else { if(log.isDebugEnabled()) log.debug("Section " + section.getEid() + " does not match the term " + termTerm + " " + termYear);
public List getInstructorCourses(String instructorId, String termYear, String termTerm) { Set sections = cmService.findInstructingSections(instructorId); List courses = new ArrayList(); for(Iterator iter = sections.iterator(); iter.hasNext();) { Section section = (Section)iter.next(); Course course = getLegacyC...
if(log.isDebugEnabled()) log.debug("Provider id = " + sb.toString());
public String getProviderId(List providerIdList) { StringBuffer sb = new StringBuffer(); for(Iterator iter = providerIdList.iterator(); iter.hasNext();) { String id = (String)iter.next(); sb.append(id); if(iter.hasNext()) { sb.append("+"); } } return sb.toString(); }
if (stringTable[i].equals(text))
if ( (stringTable[i] != null) && (stringTable[i].equals(text)) )
public static int findString(String stringTable[], String text) { if (stringTable != null) { for(int i=0; i < stringTable.length; i++) { if (stringTable[i].equals(text)) { return i; } } } ...
case ClickatellException.ERROR_AUTH_FAILED:
private void sendConcatMessage(SmsConcatMessage theMsg, SmsAddress theDestination, SmsAddress theSender) throws SmsException { String requestString; String udStr; String udhStr; byte udhData[]; if (theDestination.getTypeOfNumber() == SmsConstants.TON_ALPHANUMERIC) ...
protected void addEntity(EOEntity entity) {
public void addEntity(EOEntity entity) {
protected void addEntity(EOEntity entity) { entities.addObject(entity); }
columns.addObject("" + column + "");
columns.addObject("\"" + column + "\"");
protected NSArray columnsFromAttributesAsArray(EOAttribute[] attributes, boolean quoteNames) { if (attributes == null) { throw new NullPointerException("attributes cannot be null!"); } NSMutableArray columns = new NSMutableArray(); for (int i = attributes.length; i-- > 0;) { EOAttribute att = attributes...
_quoteSource = Boolean.valueOf((String)aSourceConnectionDict.objectForKey("quote")).booleanValue(); _quoteDestination = Boolean.valueOf((String)aDestConnectionDict.objectForKey("quote")).booleanValue();
public void connect(NSDictionary aSourceConnectionDict, NSDictionary aDestConnectionDict) throws SQLException { source = connectionWithDictionary(aSourceConnectionDict); dest = connectionWithDictionary(aDestConnectionDict); }
String url = (String) dict.objectForKey("url"); Boolean autoCommit = (Boolean) dict.objectForKey("autoCommit");
String url = (String) dict.objectForKey("URL"); if (url == null) { url = (String) dict.objectForKey("url"); } Boolean autoCommit; Object autoCommitObj = dict.objectForKey("autoCommit"); if (autoCommitObj instanceof String) { autoCommit = Boolean.valueOf((String)autoCommitObj); } else { autoCommit = (Boolean)autoCommitO...
protected Connection connectionWithDictionary(NSDictionary dict) throws SQLException { String username = (String) dict.objectForKey("username"); String password = (String) dict.objectForKey("password"); String driver = (String) dict.objectForKey("driver"); String url = (String) dict.objectForKey("url"); Boo...
String columns = columnsFromAttributesAsArray(attributes, true).componentsJoinedByString(", ");
protected void copyEntity(EOEntity entity) throws SQLException { EOAttribute[] attributes = attributesArray(entity.attributes()); String tableName = entity.externalName(); String[] columnNames = columnsFromAttributes(attributes, true); String[] columnNamesWithoutQuotes = columnsFromAttributes(attributes, fals...
selectBuf.append(columns).append(" from ").append(tableName).append(";");
selectBuf.append(columnsFromAttributesAsArray(attributes, _quoteSource).componentsJoinedByString(", ")).append(" from "); if (_quoteSource) { selectBuf.append("\"" + tableName + "\""); } else { selectBuf.append(tableName); } EOQualifier qualifier = entity.restrictingQualifier(); if (qualifier != null) { EOAdaptor adapt...
protected void copyEntity(EOEntity entity) throws SQLException { EOAttribute[] attributes = attributesArray(entity.attributes()); String tableName = entity.externalName(); String[] columnNames = columnsFromAttributes(attributes, true); String[] columnNamesWithoutQuotes = columnsFromAttributes(attributes, fals...
insertBuf.append("insert into ").append("" + tableName + "").append(" (").append(columns).append(") values (");
insertBuf.append("insert into "); if (_quoteDestination) { insertBuf.append("\"" + tableName + "\""); } else { insertBuf.append(tableName); } insertBuf.append(" (").append(columnsFromAttributesAsArray(attributes, _quoteDestination).componentsJoinedByString(", ")).append(") values (");
protected void copyEntity(EOEntity entity) throws SQLException { EOAttribute[] attributes = attributesArray(entity.attributes()); String tableName = entity.externalName(); String[] columnNames = columnsFromAttributes(attributes, true); String[] columnNamesWithoutQuotes = columnsFromAttributes(attributes, fals...
try { ResultSet rows = stmt.executeQuery(sql); int rowsCount = 0; while (rows.next()) { rowsCount++; if (rows.getRow() % 1000 == 0) { log.info("table " + tableName + ", inserted " + rows.getRow() + " rows");
ResultSet rows = stmt.executeQuery(sql); int rowsCount = 0; while (rows.next()) { rowsCount++; if (rows.getRow() % 1000 == 0) { System.out.println("CopyTask.copyEntity: table " + tableName + ", inserted " + rows.getRow() + " rows"); log.info("table " + tableName + ", inserted " + rows.getRow() + " rows"); } NSMutable...
protected void copyEntity(EOEntity entity) throws SQLException { EOAttribute[] attributes = attributesArray(entity.attributes()); String tableName = entity.externalName(); String[] columnNames = columnsFromAttributes(attributes, true); String[] columnNamesWithoutQuotes = columnsFromAttributes(attributes, fals...
NSMutableSet tempfilesToDelete = new NSMutableSet(); for (int i = 0; i < columnNamesWithoutQuotes.length; i++) { String columnName = columnNamesWithoutQuotes[i]; int type = rows.getMetaData().getColumnType(i + 1);
if (o instanceof Blob) { Blob b = (Blob) o; InputStream bis = b.getBinaryStream(); File tempFile = null; try { tempFile = File.createTempFile("TempJDBC", ".blob"); ERXFileUtilities.writeInputStreamToFile(bis, tempFile); } catch (IOException e5) { log.error("could not create tempFile for row " + rows.getRow() + " and c...
protected void copyEntity(EOEntity entity) throws SQLException { EOAttribute[] attributes = attributesArray(entity.attributes()); String tableName = entity.externalName(); String[] columnNames = columnsFromAttributes(attributes, true); String[] columnNamesWithoutQuotes = columnsFromAttributes(attributes, fals...
Object o = rows.getObject(columnName); if (log.isDebugEnabled()) { if (o != null) { log.info("column=" + columnName + ", value class=" + o.getClass().getName() + ", value=" + o); } else { log.info("column=" + columnName + ", value class unknown, value is null"); }
continue;
protected void copyEntity(EOEntity entity) throws SQLException { EOAttribute[] attributes = attributesArray(entity.attributes()); String tableName = entity.externalName(); String[] columnNames = columnsFromAttributes(attributes, true); String[] columnNamesWithoutQuotes = columnsFromAttributes(attributes, fals...
if (o instanceof Blob) { Blob b = (Blob) o; InputStream bis = b.getBinaryStream(); File tempFile = null; try { tempFile = File.createTempFile("TempJDBC", ".blob"); ERXFileUtilities.writeInputStreamToFile(bis, tempFile); } catch (IOException e5) { log.error("could not create tempFile for row " + rows.getRow() + " and c...
continue; } upps.setBinaryStream(i + 1, fis, (int) tempFile.length()); tempfilesToDelete.addObject(tempFile); } else if (o != null) { upps.setObject(i + 1, o); } else { upps.setNull(i + 1, type); } } upps.executeUpdate(); upps.clearParameters(); for (Enumeration e = tempfilesToDelete.objectEnumerator(); e.hasMoreElemen...
protected void copyEntity(EOEntity entity) throws SQLException { EOAttribute[] attributes = attributesArray(entity.attributes()); String tableName = entity.externalName(); String[] columnNames = columnsFromAttributes(attributes, true); String[] columnNamesWithoutQuotes = columnsFromAttributes(attributes, fals...
continue; } FileInputStream fis; try { fis = new FileInputStream(tempFile); } catch (FileNotFoundException e6) { log.error("could not create FileInputStream from tempFile for row " + rows.getRow() + " and column " + columnName + ", setting column value to null!"); upps.setNull(i + 1, type); if (tempFile != null) if (!t...
protected void copyEntity(EOEntity entity) throws SQLException { EOAttribute[] attributes = attributesArray(entity.attributes()); String tableName = entity.externalName(); String[] columnNames = columnsFromAttributes(attributes, true); String[] columnNamesWithoutQuotes = columnsFromAttributes(attributes, fals...
continue; } upps.setBinaryStream(i + 1, fis, (int) tempFile.length()); tempfilesToDelete.addObject(tempFile); } else if (o != null) { upps.setObject(i + 1, o); } else { upps.setNull(i + 1, type); } } upps.executeUpdate(); upps.clearParameters(); for (Enumeration e = tempfilesToDelete.objectEnumerator(); e.hasMoreElemen...
protected void copyEntity(EOEntity entity) throws SQLException { EOAttribute[] attributes = attributesArray(entity.attributes()); String tableName = entity.externalName(); String[] columnNames = columnsFromAttributes(attributes, true); String[] columnNamesWithoutQuotes = columnsFromAttributes(attributes, fals...
catch (SQLException e2) { log.error("could not get next from resultset", e2); }
log.info("table " + tableName + ", inserted " + rowsCount + " rows"); rows.close();
protected void copyEntity(EOEntity entity) throws SQLException { EOAttribute[] attributes = attributesArray(entity.attributes()); String tableName = entity.externalName(); String[] columnNames = columnsFromAttributes(attributes, true); String[] columnNamesWithoutQuotes = columnsFromAttributes(attributes, fals...
public static void writeInputStreamToFile(InputStream stream, File file) throws IOException { if (file == null) throw new IllegalArgumentException("Attempting to write to a null file!"); FileOutputStream out = new FileOutputStream(file); writeInputStreamToOutputStream(stream, out);
public static void writeInputStreamToFile(File f, InputStream is) throws IOException { writeInputStreamToFile(is, f);
public static void writeInputStreamToFile(InputStream stream, File file) throws IOException { if (file == null) throw new IllegalArgumentException("Attempting to write to a null file!"); FileOutputStream out = new FileOutputStream(file); writeInputStreamToOutputStream(stream, out); }
log = CSMART.createLogger(this.getClass().getName());
public void setupSubscriptions() { log = CSMART.createLogger(this.getClass().getName()); if (log.isDebugEnabled()) { log.debug("setupSubscriptions:" + this + ":Entering"); } peSub = (IncrementalSubscription) subscribe(peP); taskSub = (IncrementalSubscription) subscribe(taskP); Asset proto = the...
blackboard.signalClientActivity();
MetricsInitializerPlugin.this.blackboard.signalClientActivity();
public synchronized void expire() { if (!expired) { expired = true; blackboard.signalClientActivity(); } }
public JMenuItem insert(JMenuItem item, int index) { return null;
public void insert(String text, int index) {
public JMenuItem insert(JMenuItem item, int index) { return null; // TODO } // insert()
public void doClick(int pressTime)
public void doClick()
public void doClick(int pressTime) { //Toolkit.tlkBeep (); //Programmatically perform a "click". }
doClick(100);
public void doClick(int pressTime) { //Toolkit.tlkBeep (); //Programmatically perform a "click". }
if (index != 0) { wocontext.deleteLastElementIDComponent(); } wocontext.appendElementIDComponent(index + "-" + hashCodeForObject(object)); } else { if (index != 0) { wocontext.incrementLastElementIDComponent(); } else { wocontext.appendZeroElementIDComponent();
int hashCode = hashCodeForObject(object); if(hashCode != 0) { if (index != 0) { wocontext.deleteLastElementIDComponent(); } String elementID = index + "-" + hashCode; wocontext.appendElementIDComponent(elementID); didAppend = true;
protected void _prepareForIterationWithIndex(Context context, int index, WOContext wocontext, WOComponent wocomponent) { Object object = null; if (_item != null) { object = context.objectAtIndex(index); _item._setValueNoValidation(object, wocomponent); } if (_index ...
} else {
} if(!didAppend) {
protected void _prepareForIterationWithIndex(Context context, int index, WOContext wocontext, WOComponent wocomponent) { Object object = null; if (_item != null) { object = context.objectAtIndex(index); _item._setValueNoValidation(object, wocomponent); } if (_index ...
return (object == null ? 0 : Math.abs(System.identityHashCode(object)));
return (object == null || !(object instanceof EOEnterpriseObject) ? 0 : Math.abs(System.identityHashCode(object)));
private int hashCodeForObject(Object object) { return (object == null ? 0 : Math.abs(System.identityHashCode(object))); }
for (int i = 0; i < nnnodes.length; i++) {
for (int i = 0; i < nnodes.length; i++) {
public ModifiableComponent copy(String uniqueName) { if (log.isDebugEnabled()) { log.debug("Experiment copying " + getExperimentName() + " into new name " + uniqueName); } Experiment experimentCopy = null; if (DBUtils.dbMode) experimentCopy = new Experiment(uniqueName, expID, trialID); else ...
byte [] image_number_array = int2ByteArray(image_number); byte [] image_size_array = int2ByteArray(image_size); byte [] offset_array = int2ByteArray(offset);
byte [] image_number_array = ArrayManipulator.int2ByteArray(image_number); byte [] image_size_array = ArrayManipulator.int2ByteArray(image_size); byte [] offset_array = ArrayManipulator.int2ByteArray(offset);
public static byte[] createImageDatagram(int file_index, int image_number, int image_size, int offset, byte [] fragment) throws InvalidParameterException { //creation if(fragment.length>1006)throw new InvalidParameterException("fragment length too important"); //1006+18 = 1024 = datagram max length byt...
for(i=0; i<4; i++) datagram[i+shift] = image_number_array[i]; shift+=i; for(i=0; i<4; i++) datagram[i+shift] = image_size_array[i]; shift+=i; for(i=0; i<4; i++) datagram[i+shift] = offset_array[i]; shift+=i;
ArrayManipulator.copyArrayAtEnd(datagram, image_number_array, shift); shift+=4; ArrayManipulator.copyArrayAtEnd(datagram, image_size_array, shift); shift+=4; ArrayManipulator.copyArrayAtEnd(datagram, offset_array, shift); shift+=4;
public static byte[] createImageDatagram(int file_index, int image_number, int image_size, int offset, byte [] fragment) throws InvalidParameterException { //creation if(fragment.length>1006)throw new InvalidParameterException("fragment length too important"); //1006+18 = 1024 = datagram max length byt...
fragment_array[i] = fragment[i]; fragment_array = ByteBuffer.wrap(fragment_array).order(ByteOrder.LITTLE_ENDIAN).array(); for(i=0; i<fragment.length; i++) datagram[i+shift] = fragment_array[i];
fragment_array[j--] = fragment[i]; ArrayManipulator.copyArrayAtEnd(datagram, fragment_array, shift);
public static byte[] createImageDatagram(int file_index, int image_number, int image_size, int offset, byte [] fragment) throws InvalidParameterException { //creation if(fragment.length>1006)throw new InvalidParameterException("fragment length too important"); //1006+18 = 1024 = datagram max length byt...
for(int i=0; i<fragment.length; i++) fragment[i] = datagram[i+18];
int j = fragment.length - 1; for(int i=18;i<datagram.length;i++) fragment[j--] = datagram[i];
public static byte[] getFragment(byte [] datagram) { byte fragment[] = new byte[datagram.length-18]; for(int i=0; i<fragment.length; i++) fragment[i] = datagram[i+18]; return fragment; }
return byteArray2Int(image_number);
return ArrayManipulator.byteArray2Int(image_number);
public static int getImageNumber(byte [] datagram) { byte image_number[] = { datagram[UDPDatagramHeader.getHeaderSize()], datagram[UDPDatagramHeader.getHeaderSize()+1], datagram[UDPDatagramHeader.getHeaderSize()+2], datagram[UDPDatagramHeader.getHeaderSize()+3] }; return byteArray2Int(image_number); ...
return byteArray2Int(image_size);
return ArrayManipulator.byteArray2Int(image_size);
public static int getImageSize(byte [] datagram) { byte image_size[] = { datagram[UDPDatagramHeader.getHeaderSize()+4], datagram[UDPDatagramHeader.getHeaderSize()+5], datagram[UDPDatagramHeader.getHeaderSize()+6], datagram[UDPDatagramHeader.getHeaderSize()+7] }; return byteArray2Int(im...
return byteArray2Int(offset);
return ArrayManipulator.byteArray2Int(offset);
public static int getOffset(byte [] datagram) { byte offset[] = { datagram[UDPDatagramHeader.getHeaderSize()+8], datagram[UDPDatagramHeader.getHeaderSize()+9], datagram[UDPDatagramHeader.getHeaderSize()+10], datagram[UDPDatagramHeader.getHeaderSize()+11] }; return byteArray2Int(offset); }
setTarget(cv, this);
setTarget(cv);
public ClassEmitter(ClassVisitor cv) { super(null); setTarget(cv, this); }
if (sig.equals(STATIC_HOOK)) { hook = new CodeEmitter(this, v, access, sig, exceptions) { public boolean isStaticHook() { return true; }
if (sig.equals(Constants.SIG_STATIC) && !TypeUtils.isInterface(this.access)) { rawStaticInit = v; CodeVisitor wrapped = new CodeAdapter(v) {
public CodeEmitter begin_method(int access, Signature sig, Type[] exceptions, Attribute attrs) { CodeVisitor v = cv.visitMethod(access, sig.getName(), sig.getDescriptor(), TypeUtils.toInternalNam...
if (ended) { super.visitMaxs(maxStack, maxLocals); }
public CodeEmitter begin_method(int access, Signature sig, Type[] exceptions, Attribute attrs) { CodeVisitor v = cv.visitMethod(access, sig.getName(), sig.getDescriptor(), TypeUtils.toInternalNam...
if (insn != Constants.RETURN || ended) {
if (insn != Constants.RETURN) {
public CodeEmitter begin_method(int access, Signature sig, Type[] exceptions, Attribute attrs) { CodeVisitor v = cv.visitMethod(access, sig.getName(), sig.getDescriptor(), TypeUtils.toInternalNam...
return hook;
staticInit = new CodeEmitter(this, wrapped, access, sig, exceptions); if (staticHook == null) { getStaticHook(); } else { staticInit.invoke_static_this(staticHookSig); } return staticInit; } else if (sig.equals(staticHookSig)) { return new CodeEmitter(this, v, access, sig, exceptions) { public boolean isStaticHook() {...
public CodeEmitter begin_method(int access, Signature sig, Type[] exceptions, Attribute attrs) { CodeVisitor v = cv.visitMethod(access, sig.getName(), sig.getDescriptor(), TypeUtils.toInternalNam...
CodeEmitter e = new CodeEmitter(this, v, access, sig, exceptions); if (sig.equals(Constants.SIG_STATIC) && !TypeUtils.isInterface(this.access)) { seenStatic = true; e.invoke_static_this(STATIC_HOOK); } return e;
return new CodeEmitter(this, v, access, sig, exceptions);
public CodeEmitter begin_method(int access, Signature sig, Type[] exceptions, Attribute attrs) { CodeVisitor v = cv.visitMethod(access, sig.getName(), sig.getDescriptor(), TypeUtils.toInternalNam...
if (insn != Constants.RETURN || ended) {
if (insn != Constants.RETURN) {
public void visitInsn(int insn) { if (insn != Constants.RETURN || ended) { super.visitInsn(insn); } }
if (ended) { super.visitMaxs(maxStack, maxLocals); }
public void visitMaxs(int maxStack, int maxLocals) { if (ended) { super.visitMaxs(maxStack, maxLocals); } }
if (seenStatic && hook == null) { getStaticHook();
if (staticHook != null && staticInit == null) { begin_static();
public void end_class() { if (seenStatic && hook == null) { getStaticHook(); // force hook method creation } if (hook != null) { if (!seenStatic) { CodeVisitor v = outer.visitMethod(Constants.ACC_STATIC, Const...
if (hook != null) { if (!seenStatic) { CodeVisitor v = outer.visitMethod(Constants.ACC_STATIC, Constants.SIG_STATIC.getName(), Constants.SIG_STATIC.getDescriptor(), null, null); v.visitInsn(Constants.RETURN); v.visitMaxs(0, 0); } ended = true; hook.return_value(); hook.end_method();
if (staticInit != null) { staticHook.return_value(); staticHook.end_method(); rawStaticInit.visitInsn(Constants.RETURN); rawStaticInit.visitMaxs(0, 0); staticInit = staticHook = null; staticHookSig = null;
public void end_class() { if (seenStatic && hook == null) { getStaticHook(); // force hook method creation } if (hook != null) { if (!seenStatic) { CodeVisitor v = outer.visitMethod(Constants.ACC_STATIC, Const...