rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
Thread.sleep(1000); | Thread.sleep(2000); | private void startAutoMode() { new Thread(new Runnable() { public void run() { while (true) { try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { curFrame = addWindow(false); } }); ... |
Thread.sleep(1000); | Thread.sleep(2000); | public void run() { while (true) { try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { curFrame = addWindow(false); } }); } catch (Exception e) { e.printStackTrace(); ... |
return true; | { position = match.getEndIndex(); return true; } | public boolean lookingAt () { match = pattern.getRE().getMatch(input, 0); if (match != null) { if (match.getStartIndex() == 0) return true; match = null; } return false; } |
System.out.println("Before"); filter.Update(); System.out.println("After"); | public static void main( String argv[] ) { System.out.println("VoronoiSegmentationImageFilter Example"); itkImageFileReaderUC2_Pointer readerInput = itkImageFileReaderUC2.itkImageFileReaderUC2_New(); itkImageFileReaderUC2_Pointer readerPrior = itkImageFileReaderUC2.itkImageFileReaderUC2_New(... | |
final GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(caps); | final GLCanvas canvas = new GLCanvas(caps); | public static void main(String[] args) { GLCapabilities caps = new GLCapabilities(); caps.setStencilBits(16); final GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(caps); InfiniteShadowVolumes demo = new InfiniteShadowVolumes(); canvas.addGLEventListener(demo); demo.setDemoListener(n... |
final public static FloatBuffer wrap (float[] array) | final public static FloatBuffer wrap (float[] array, int offset, int length) | final public static FloatBuffer wrap (float[] array) { return wrap (array, 0, array.length); } |
return wrap (array, 0, array.length); | return new FloatBufferImpl (array, 0, array.length, offset + length, offset, -1, false); | final public static FloatBuffer wrap (float[] array) { return wrap (array, 0, array.length); } |
return d2wContext().propertyKey() != null ? keyPathsWithValidationExceptions().containsObject(d2wContext().propertyKey()) : false; | if (d2wContext().propertyKey() == null) { return false; } else { String propertyKey = d2wContext().propertyKey(); boolean contains = keyPathsWithValidationExceptions().containsObject(propertyKey); if (log.isDebugEnabled()) log.debug("propertyKey="+propertyKey+", keyPathsWithValidationExceptions="+keyPathsWithValidation... | public boolean validationExceptionOccurredForPropertyKey() { return d2wContext().propertyKey() != null ? keyPathsWithValidationExceptions().containsObject(d2wContext().propertyKey()) : false; } |
if(log.isDebugEnabled()) { | if(log.isErrorEnabled()) { | public BaseComponent copy(BaseComponent result) { // Make sure we're copying apples into apples // The result can be a sub-class, but we want it // to at least have the same set of properties if (! (this.getClass().isAssignableFrom(result.getClass()))) return null; Iterator iter = getSortedLocalPr... |
leftIndent = leftIndent - 5; add(new JLabel("Organization Groups:"), new GridBagConstraints(x, y++, 1, 1, 0.0, 0.0, | Map groupNameToId = ExperimentDB.getOrganizationGroups(experimentId); Set groups = groupNameToId.keySet(); groupNames = (String[])groups.toArray(new String[groups.size()]); int nGroupNames = groupNames.length; if (nGroupNames > 0) { leftIndent = leftIndent - 5; add(new JLabel("Organization Groups:"), new GridBagConst... | private void updateDisplay() { removeAll(); // remove previous components if (experiment == null || !DBUtils.dbMode || !ExperimentDB.isExperimentNameInDatabase(experiment.getExperimentName())) { setLayout(new BorderLayout()); add(new JLabel("Experiment is not in database or otherwise has no thr... |
leftIndent = leftIndent + 5; Map groupNameToId = ExperimentDB.getOrganizationGroups(experimentId); Set groups = groupNameToId.keySet(); groupNames = (String[])groups.toArray(new String[groups.size()]); int nGroupNames = groupNames.length; for (int i = 0; i < nGroupNames; i++) { String groupName = (String)groupNames[i];... | leftIndent = leftIndent + 5; for (int i = 0; i < nGroupNames; i++) { String groupName = (String)groupNames[i]; JCheckBox groupCB = new JCheckBox(groupName); boolean sel = ExperimentDB.isGroupSelected(trialId, groupName); groupCheckBoxes.add(groupCB); originalGroupSelected.add(new Boolean(sel)); groupCB.setSelected(sel)... | private void updateDisplay() { removeAll(); // remove previous components if (experiment == null || !DBUtils.dbMode || !ExperimentDB.isExperimentNameInDatabase(experiment.getExperimentName())) { setLayout(new BorderLayout()); add(new JLabel("Experiment is not in database or otherwise has no thr... |
} | } } | private void updateDisplay() { removeAll(); // remove previous components if (experiment == null || !DBUtils.dbMode || !ExperimentDB.isExperimentNameInDatabase(experiment.getExperimentName())) { setLayout(new BorderLayout()); add(new JLabel("Experiment is not in database or otherwise has no thr... |
exLog.warn("JDBC Exception occured: " + throwable, throwable); | public boolean databaseContextShouldHandleDatabaseException(EODatabaseContext databaseContext, Throwable throwable) { if(exLog.isDebugEnabled()) { exLog.debug("JDBC Exception occured: " + throwable, throwable); } return true; } | |
NSArray adaptorOps, EOAdaptorChannel adChannel) { NSMutableArray result = new NSMutableArray(); NSDictionary groupedOps = ERXArrayUtilities.arrayGroupedByKeyPath(adaptorOps, "adaptorOperator"); Integer insertKey = ERXConstant.integerForInt(EODatabaseOperation.AdaptorInsertOperator); NSArray insertOps = (NSArray) groupe... | NSArray adaptorOps, EOAdaptorChannel adChannel) { NSMutableArray result = new NSMutableArray(); NSDictionary groupedOps = ERXArrayUtilities.arrayGroupedByKeyPath(adaptorOps, "adaptorOperator"); Integer insertKey = ERXConstant.integerForInt(EODatabaseOperation.AdaptorInsertOperator); NSArray insertOps = (NSArray) groupe... | public NSArray databaseContextWillPerformAdaptorOperations(EODatabaseContext dbCtxt, NSArray adaptorOps, EOAdaptorChannel adChannel) { NSMutableArray result = new NSMutableArray(); NSDictionary groupedOps = ERXArrayUtilities.arrayGroupedByKeyPath(adaptorOps, "adaptorOperator"); Integer insertKey = ER... |
String js=request.cookieValueForKey(JAVASCRIPT_ENABLED_COOKIE_NAME); | String js=null; try { request.cookieValueForKey(JAVASCRIPT_ENABLED_COOKIE_NAME); } catch (StringIndexOutOfBoundsException e) { } | public void awake() { super.awake(); ERXExtensions.setSession(this); ERXLocalizer.setCurrentLocalizer(localizer()); NSNotificationCenter.defaultCenter().postNotification(SessionWillAwakeNotification, this); WORequest request=context()!=null ? context().request() : null; // ... |
Thread.yield(); | public void display(GLDrawable drawable) { // printThreadName("display for Listener"); if (initFailed) { return; } if (!firstRender) { if (++frameCount == 30) { timer.stop(); System.err.println("Frames per second: " + (30.0f / timer.getDurationAsSeconds())); ... | |
options.setObjectForKey("function(v) {new Ajax.Request('"+context().componentActionURL() | options.setObjectForKey("function(v) {new Ajax.Request('"+ AjaxUtils.ajaxComponentActionUrl(context()) | public void appendToResponse(WOResponse res, WOContext ctx) { super.appendToResponse(res, ctx); _trackerId = safeElementID() + "_tracker"; _handleId = safeElementID() + "_handle"; NSMutableDictionary options = new NSMutableDictionary(); new AjaxOption("axis", AjaxOption.ST... |
gtkSetFont(f.getName(), f.getSize()); | gtkSetFont(f.getName(), f.getStyle(), f.getSize()); | public void setFont (Font f) { gtkSetFont(f.getName(), f.getSize()); } |
jsp.setPreferredSize(new Dimension(400, 100)); | jsp.setPreferredSize(new Dimension(550, 200)); | private void displayPlugins(String agentName) { ArrayList entries = console.getAgentComponentDescriptions(nodeName, agentName); if (entries == null) return; JList plugInsList = new JList(entries.toArray()); JScrollPane jsp = new JScrollPane(plugInsList, ScrollPaneCon... |
executeUpdate(dbp.getQuery("insertAlibComponent", substitutions)); | while(true) { ResultSet rs2 = executeQuery(stmt, dbp.getQuery("checkAlibComponent", substitutions)); if (!rs2.next()) { if (log.isDebugEnabled()) log.debug("New ALIB ID is OK, will insert"); rs2.close(); executeUpdate(dbp.getQuery("insertAlibComponent", substitutions)); break; } else { if (log.isInfoEnabled()) log.inf... | private String insureAlib(ComponentData data) throws SQLException { String id = (String) substitutions.get(":component_alib_id:"); if (alibComponents.contains(id)) return id; // Already present // may need to be added insureLib(); String query1 = dbp.getQuery("checkAlibComponent", substitutions);// ... |
"Do you want to overwrite the definition?" | "Do you want to overwrite the definition (typical)?" | private String insureAlib(ComponentData data) throws SQLException { String id = (String) substitutions.get(":component_alib_id:"); if (alibComponents.contains(id)) return id; // Already present // may need to be added insureLib(); String query1 = dbp.getQuery("checkAlibComponent", substitutions);// ... |
"Do you want to overwrite the definition?" | "Do you want to overwrite the definition (typical)?" | private void insureLib() throws SQLException { Statement stmt = getStatement(); ResultSet rs = executeQuery(stmt, dbp.getQuery("checkLibComponent", substitutions)); if (!rs.next()) { executeUpdate(dbp.getQuery("insertLibComponent", substitutions)); } else { String[] subvars = { ":component_categ... |
log.info("saveToDatabase society (" + getSocietyName() + ") with asb: " + getAssemblyId()); | log.info("saveToDatabase society (" + getSocietyName() + ") with asb: " + getAssemblyId() + " and old Assembly: " + oldAssemblyId); | public boolean saveToDatabase() { if(log.isInfoEnabled()) { log.info("saveToDatabase society (" + getSocietyName() + ") with asb: " + getAssemblyId()); } // TODO: // Should I notice when I need to save and only save then? // Should I resist creating a new assembly ID, to avoid // breaking other... |
return getBounds(); | if (bounds == null) { if (npoints == 0) return bounds = new Rectangle (); int i = npoints - 1; int minx = xpoints[i]; int maxx = minx; int miny = ypoints[i]; int maxy = miny; while (--i >= 0) { int x = xpoints[i]; int y = ypoints[i]; if (x < minx) minx = x; else if (x > maxx) maxx = x; if (y < miny) miny = y; else if (... | public Rectangle getBoundingBox() { return getBounds(); } |
private void doFetchDependencies(IvyNode node, String conf, boolean shouldBePublic) { | private void doFetchDependencies(IvyNode node, String conf) { | private void doFetchDependencies(IvyNode node, String conf, boolean shouldBePublic) { Configuration c = node.getConfiguration(conf); if (c == null) { Message.error("configuration not found in "+node+": "+conf+". It was required from "+node.getParent()+" "+node.getParentConf()); } els... |
if (c == null) { Message.error("configuration not found in "+node+": "+conf+". It was required from "+node.getParent()+" "+node.getParentConf()); } else if (c.getVisibility() != Configuration.Visibility.PUBLIC && shouldBePublic) { Message.error("configuration not public in "+node+": "+c+". It was required from "+node.g... | String[] extendedConfs = c.getExtends(); if (extendedConfs.length > 0) { node.updateConfsToFetch(Arrays.asList(extendedConfs)); } for (int i = 0; i < extendedConfs.length; i++) { fetchDependencies(node, extendedConfs[i]); } if (node.getDependencyDescriptor() == null || node.getDependencyDescriptor().isTransitive()) { ... | private void doFetchDependencies(IvyNode node, String conf, boolean shouldBePublic) { Configuration c = node.getConfiguration(conf); if (c == null) { Message.error("configuration not found in "+node+": "+conf+". It was required from "+node.getParent()+" "+node.getParentConf()); } els... |
private void fetchDependencies(IvyNode node, String conf, boolean shouldBePublic) { | private void fetchDependencies(IvyNode node, String conf) { | private void fetchDependencies(IvyNode node, String conf, boolean shouldBePublic) { resolveConflict(node, node.getParent(), Collections.EMPTY_SET); if (node.loadData(conf)) { node = node.getRealNode(); // if data loading discarded the node, get the real one resolveConflic... |
doFetchDependencies(node, confs[i], shouldBePublic); | doFetchDependencies(node, confs[i]); | private void fetchDependencies(IvyNode node, String conf, boolean shouldBePublic) { resolveConflict(node, node.getParent(), Collections.EMPTY_SET); if (node.loadData(conf)) { node = node.getRealNode(); // if data loading discarded the node, get the real one resolveConflic... |
doFetchDependencies(node, conf, shouldBePublic); | doFetchDependencies(node, conf); | private void fetchDependencies(IvyNode node, String conf, boolean shouldBePublic) { resolveConflict(node, node.getParent(), Collections.EMPTY_SET); if (node.loadData(conf)) { node = node.getRealNode(); // if data loading discarded the node, get the real one resolveConflic... |
fetchDependencies(selected, conf, shouldBePublic); | fetchDependencies(selected, conf); | private void fetchDependencies(IvyNode node, String conf, boolean shouldBePublic) { resolveConflict(node, node.getParent(), Collections.EMPTY_SET); if (node.loadData(conf)) { node = node.getRealNode(); // if data loading discarded the node, get the real one resolveConflic... |
if ((Thread.currentThread () instanceof EventDispatchThread) && !(this instanceof FileDialog)) return; | if (EventQueue.isDispatchThread ()) { EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); eq2 = new EventQueue (); eq.push (eq2); } | show(){ super.show(); if (isModal()) { // If already shown (and blocked) just return if (blocked) return; /* FIXME: Currently this thread may block forever if it called from the event dispatch thread, so we only do this for FileDialog which only depends on a signal which is delivered... |
return; | show(){ super.show(); if (isModal()) { // If already shown (and blocked) just return if (blocked) return; /* FIXME: Currently this thread may block forever if it called from the event dispatch thread, so we only do this for FileDialog which only depends on a signal which is delivered... | |
if (eq2 != null) { eq2.pop (); eq2 = null; } | show(){ super.show(); if (isModal()) { // If already shown (and blocked) just return if (blocked) return; /* FIXME: Currently this thread may block forever if it called from the event dispatch thread, so we only do this for FileDialog which only depends on a signal which is delivered... | |
Object reference = getProject().getReference("ivy.instance"); if (reference == null) { | Object ref = getProject().getReference("ivy.instances"); if (ref != null && !(ref instanceof Map)) { throw new BuildException("ivy problem with ant: ivy.instances reference is not a Map. Please do not sett ivy.instances reference in your ant project. current reference: "+ref+" class="+ref.getClass()+" classloader="+ref... | protected Ivy getIvyInstance() { ensureMessageInitialised(); Object reference = getProject().getReference("ivy.instance"); if (reference == null) { Message.verbose("no ivy instance found: auto configuring ivy"); IvyConfigure configure = new IvyConfigure(); confi... |
reference = getProject().getReference("ivy.instance"); if (reference == null) { throw new BuildException("ivy internal problem: impossible to get ivy instance !"); | instances = (Map) getProject().getReference("ivy.instances"); if (instances == null || !instances.containsKey(Ivy.class)) { throw new BuildException("ivy internal problem: impossible to get ivy instance after configure... maybe a classloader problem"); | protected Ivy getIvyInstance() { ensureMessageInitialised(); Object reference = getProject().getReference("ivy.instance"); if (reference == null) { Message.verbose("no ivy instance found: auto configuring ivy"); IvyConfigure configure = new IvyConfigure(); confi... |
if (! (reference instanceof Ivy)) { throw new BuildException("ivy internal problem: bad ivy instance class: "+reference.getClass()); } return (Ivy)reference; | return (Ivy)instances.get(Ivy.class); | protected Ivy getIvyInstance() { ensureMessageInitialised(); Object reference = getProject().getReference("ivy.instance"); if (reference == null) { Message.verbose("no ivy instance found: auto configuring ivy"); IvyConfigure configure = new IvyConfigure(); confi... |
if (ivy != null) { Message.debug("setting ivy.instance on "+getProject()+": "+ivy+" class="+ivy.getClass().getName()+" classloader="+ivy.getClass().getClassLoader()); Map instances = (Map) getProject().getReference("ivy.instances"); if (instances == null) { instances = new HashMap(); getProject().addReference("ivy.ins... | protected void setIvyInstance(Ivy ivy) { getProject().addReference("ivy.instance", ivy); } | |
dbp.setDebug(true); | public PopulateDb(String cmtType, String hnaType, String csmiType, String experimentName, String exptId, String trialId, boolean createNew) throws SQLException, IOException { if (cmtType == null) throw new IllegalArgumentException("null cmtType"); if... | |
csmAssemblyId = addAssembly(csmiType); | if (hnaType.equals(csmiType)) csmiAssemblyId = hnaAssemblyId; else csmiAssemblyId = addAssembly(csmiType); | public PopulateDb(String cmtType, String hnaType, String csmiType, String experimentName, String exptId, String trialId, boolean createNew) throws SQLException, IOException { if (cmtType == null) throw new IllegalArgumentException("null cmtType"); if... |
substitutions.put(":expt_id:", exptId); | private String addAssembly(String idType) throws SQLException { String assemblyId; String assemblyIdPrefix = idType + "-"; substitutions.put(":assembly_id_pattern:", assemblyIdPrefix + "____"); substitutions.put(":assembly_type:", idType); DecimalFormat assemblyIdFormat ... | |
substitutions.put(":expt_id:", exptId); | private void newTrial(String idType, String trialName) throws SQLException { String trialIdPrefix = idType + "-"; substitutions.put(":trial_id_pattern:", trialIdPrefix + "____"); substitutions.put(":trial_type:", idType); DecimalFormat trialIdFormat = new DecimalForm... | |
return "tabs.xml"; | return Utilities.getPathToXDocs() + java.io.File.separator + "tabs.xml"; | protected String getFilename() { return "tabs.xml"; } |
if( variableProps != null && count != variableProps.length ) { for(int i=0; i < variableProps.length; i++) { removeProperty(variableProps[i]); } } | private void updatePropCount(Integer newCount) { int count = newCount.intValue(); variableProps = 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++) { variableProps[i] = addProperty("Value " + (i+1),... | |
public static NSArray convertInternetAddressesToNSArray (Address [] addressesArray) throws AddressException { | public static NSArray convertInternetAddressesToNSArray (Address [] addressesArray) { | public static NSArray convertInternetAddressesToNSArray (Address [] addressesArray) throws AddressException { if( addressesArray == null) return NSArray.EmptyArray; NSMutableArray addresses = new NSMutableArray (addressesArray.length); for (int i = 0 ; i < addressesArray.length ; i++... |
WOComponent mailPage = (WOComponent) ERMailUtils.instantiatePage | WOComponent mailPage = ERMailUtils.instantiatePage | public static void sendHTMLMail (ERMailDeliveryHTML delivery, String pageName, String alternatePageName, String emailFrom, String emailTo, String emailReplyTo, String subject) { WOComponent mailPage =... |
(WOComponent) ERMailUtils.instantiatePage | ERMailUtils.instantiatePage | public static void sendHTMLMail (ERMailDeliveryHTML delivery, String pageName, String alternatePageName, String emailFrom, String emailTo, String emailReplyTo, String subject) { WOComponent mailPage =... |
e.printStackTrace(); | if(log.isErrorEnabled()) { log.error("Exception", e); } | public void initProperties() { Map substitutions = new HashMap(); if (assemblyID.size() > 0) { substitutions.put(":assemblyMatch", DBUtils.getListMatch(assemblyID)); substitutions.put(":insertion_point", "Node.AgentManager.Agent"); try { Connection conn = DBUtils.getConnection(); try { Statemen... |
addAgents(experiment, nodes, soc.getAgents(), trialId, assemblyMatch); | addAgents(experiment, nodes, allagents, trialId, assemblyMatch); | private void createCMTExperiment(DefaultMutableTreeNode node, String originalExperimentName, String experimentName, String experimentId, String trialId, ... |
System.err.println("[setRecipeComponentProperties] Caught exception: " + e); | System.err.println("Organizer: [setRecipeComponentProperties] Caught exception: " + e); | private void setRecipeComponentProperties(DbRecipe dbRecipe, RecipeComponent mc) { for (Iterator i = dbRecipe.props.keySet().iterator(); i.hasNext(); ) { try { String propName = (String) i.next(); String propValue = (String) dbRecipe.props.get(propName); Property prop = mc.getProperty(pro... |
return access (checkRead (), READ); | checkRead(); return access (READ); | public boolean canRead () { return access (checkRead (), READ); } |
SecurityManager s = System.getSecurityManager(); String p = safeCanonicalPath (); if (p == null) return false; if (s != null) s.checkWrite(p); return access (p, WRITE); | checkWrite(); return access (WRITE); | public boolean canWrite () { SecurityManager s = System.getSecurityManager(); String p = safeCanonicalPath (); // FIXME: it isn't entirely clear what to do if we can't find the // canonical path. if (p == null) return false; if (s != null) s.checkWrite(p); return access (p, WRITE); } |
private final String checkRead () | private void checkRead () | private final String checkRead () { SecurityManager s = System.getSecurityManager(); String p = safeCanonicalPath (); if (p == null) return null; if (s != null) s.checkRead(p); return p; } |
String p = safeCanonicalPath (); if (p == null) return null; | private final String checkRead () { SecurityManager s = System.getSecurityManager(); String p = safeCanonicalPath (); if (p == null) return null; if (s != null) s.checkRead(p); return p; } | |
s.checkRead(p); return p; | s.checkRead(path); | private final String checkRead () { SecurityManager s = System.getSecurityManager(); String p = safeCanonicalPath (); if (p == null) return null; if (s != null) s.checkRead(p); return p; } |
int max_length = 255; | public static File createTempFile (String prefix, String suffix, File directory) throws IOException { // Grab the system temp directory if necessary if (directory == null) { String dirname = tmpdir; if (dirname == null) throw new IOException("Cannot determine system temporary directory")... | |
if (prefix.length () + 6 + suffix.length () > max_length) | if (prefix.length () + 6 + suffix.length () > maxPathLen) | public static File createTempFile (String prefix, String suffix, File directory) throws IOException { // Grab the system temp directory if necessary if (directory == null) { String dirname = tmpdir; if (dirname == null) throw new IOException("Cannot determine system temporary directory")... |
if (prefix.length () + 6 + suf_len > max_length) prefix = prefix.substring(0, max_length - 6 - suf_len); | if (prefix.length () + 6 + suf_len > maxPathLen) prefix = prefix.substring(0, maxPathLen - 6 - suf_len); | public static File createTempFile (String prefix, String suffix, File directory) throws IOException { // Grab the system temp directory if necessary if (directory == null) { String dirname = tmpdir; if (dirname == null) throw new IOException("Cannot determine system temporary directory")... |
if (f.exists()) continue; else { String af = f.getAbsolutePath (); SecurityManager s = System.getSecurityManager(); if (s != null) s.checkWrite (af); FileDescriptor fd = new FileDescriptor (af, FileDescriptor.WRITE | FileDescriptor.EXCL); fd.close (); return f; } | if (f.createNewFile()) return f; | public static File createTempFile (String prefix, String suffix, File directory) throws IOException { // Grab the system temp directory if necessary if (directory == null) { String dirname = tmpdir; if (dirname == null) throw new IOException("Cannot determine system temporary directory")... |
catch (IOException _) | catch (IOException ignored) | public static File createTempFile (String prefix, String suffix, File directory) throws IOException { // Grab the system temp directory if necessary if (directory == null) { String dirname = tmpdir; if (dirname == null) throw new IOException("Cannot determine system temporary directory")... |
String p = safeCanonicalPath (); if (p == null) return false; | String name = path; | public boolean delete () { SecurityManager s = System.getSecurityManager(); String p = safeCanonicalPath (); // FIXME: what is right? if (p == null) return false; if (s != null) s.checkDelete(p); return performDelete (p); } |
s.checkDelete(p); return performDelete (p); | s.checkDelete(path); return performDelete (); | public boolean delete () { SecurityManager s = System.getSecurityManager(); String p = safeCanonicalPath (); // FIXME: what is right? if (p == null) return false; if (s != null) s.checkDelete(p); return performDelete (p); } |
return path.compareTo(other.path) == 0; | if (caseSensitive) return (path.equals(other.path)); else return (path.equalsIgnoreCase(other.path)); | public boolean equals (Object obj) { if (! (obj instanceof File)) return false; File other = (File) obj; return path.compareTo(other.path) == 0; } |
return access (checkRead (), EXISTS); | checkRead(); return access (EXISTS); | public boolean exists () { return access (checkRead (), EXISTS); } |
return path.hashCode(); | if (caseSensitive) return (path.hashCode() ^ 1234321); else return (path.toLowerCase().hashCode() ^ 1234321); | public int hashCode () { // FIXME: test. return path.hashCode(); } |
return stat (checkRead (), DIRECTORY); | checkRead(); return stat (DIRECTORY); | public boolean isDirectory () { return stat (checkRead (), DIRECTORY); } |
return stat (checkRead (), ISFILE); | checkRead(); return stat (ISFILE); | public boolean isFile () { return stat (checkRead (), ISFILE); } |
return attr (checkRead (), MODIFIED); | checkRead(); return attr (MODIFIED); | public long lastModified () { return attr (checkRead (), MODIFIED); } |
return attr (checkRead (), LENGTH); | checkRead(); return attr (LENGTH); | public long length () { return attr (checkRead (), LENGTH); } |
return performList (checkRead (), filter); | checkRead(); return (String[]) performList (filter, null, String.class); | public String[] list (FilenameFilter filter) { return performList (checkRead (), filter); } |
SecurityManager s = System.getSecurityManager(); if (s != null) { s.checkWrite(path); } | checkWrite(); | public boolean mkdir () { SecurityManager s = System.getSecurityManager(); if (s != null) { // NOTE: in theory we should use the canonical path. In // practice, we can't compute the canonical path until we've // made this completely. Lame. s.checkWrite(path); } return performMkdir (); } |
x.setPath(parent); | x.path = parent; | private static boolean mkdirs (File x) { if (x.isDirectory()) return true; String p = x.getPath(); String parent = x.getParent(); if (parent != null) { x.setPath(parent); if (! mkdirs (x)) return false; x.setPath(p); } return x.mkdir(); } |
x.setPath(p); | x.path = p; | private static boolean mkdirs (File x) { if (x.isDirectory()) return true; String p = x.getPath(); String parent = x.getParent(); if (parent != null) { x.setPath(parent); if (! mkdirs (x)) return false; x.setPath(p); } return x.mkdir(); } |
s.checkWrite(safeCanonicalPath()); | s.checkWrite(sname); s.checkWrite(dname); | public boolean renameTo (File dest) { SecurityManager s = System.getSecurityManager(); if (s != null) { // FIXME: JCL doesn't specify which path to check. We check the // source since we can canonicalize it. s.checkWrite(safeCanonicalPath()); } return performRenameTo (dest); } |
System.out.println("Not implemented yet"); | private void initBindersFromDb() { System.out.println("Not implemented yet"); } | |
for (int j=0; j < componentData.size(); j++) { BaseComponent baseComponent = new BaseCDataComponent((ComponentData)componentData.get(j)); baseComponent.initProperties(); addChild(baseComponent); } | private void initFromCData() { // create society properties from cdata // create agents from cdata ArrayList agentData = new ArrayList(); ArrayList alldata = new ArrayList(); if (cdata != null) alldata.add(cdata); // FIXME: It'd be nice to deal with binders of Agents in here!!! // Find a... | |
initTargetsFromDb(); | private void initFromDatabase() { if(assemblyId != null) { try { dbp = DBProperties.readQueryFile(DBUtils.QUERY_FILE); } catch (IOException ioe) { if(log.isErrorEnabled()) { log.error("IO Exception reading Query File", ioe); } } initAgentsFromDb(); initPlugins... | |
return (ERXComponentActionRedirector)responses.valueForKeyPath(request.sessionID() + "." + request.uri()); | ERXComponentActionRedirector redirector = (ERXComponentActionRedirector)responses.valueForKeyPath(request.sessionID() + "." + request.uri()); if(redirector != null) { log.info("Retrieved URL: " + redirector.url()); } else { log.info("No Redirector for request: " + request.uri()); } return redirector; | public static ERXComponentActionRedirector redirectorForRequest(WORequest request) { return (ERXComponentActionRedirector)responses.valueForKeyPath(request.sessionID() + "." + request.uri()); } |
log.info("Stored URL: " + redirector.url()); | public static void storeRedirector(ERXComponentActionRedirector redirector) { NSMutableDictionary sessionRef = (NSMutableDictionary)responses.objectForKey(redirector.sessionID()); if(sessionRef == null) { sessionRef = new NSMutableDictionary(); responses.setObjectForKey(sessionRe... | |
deleteFromDatabaseMenuItem = new JMenuItem("Delete From Database"); deleteFromDatabaseMenuItem.addActionListener(new ActionListener() { | deleteExperimentFromDatabaseMenuItem = new JMenuItem("Delete Experiment From Database"); deleteExperimentFromDatabaseMenuItem.addActionListener(new ActionListener() { | public CSMART() { setTitle("CSMART"); // Setup the database parameters. dbConfig = Parameters.findParameter(DBUtils.DATABASE); dbName = Parameters.findParameter(DBUtils.USER); dbPassword = Parameters.findParameter(DBUtils.PASSWORD); // CSMART.inDBMode(true); JMenuBar menuBar = new JMenuB... |
fileMenu.add(deleteFromDatabaseMenuItem); | fileMenu.add(deleteExperimentFromDatabaseMenuItem); deleteRecipeFromDatabaseMenuItem = new JMenuItem("Delete Recipe From Database"); deleteRecipeFromDatabaseMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { organizer.deleteRecipeFromDatabase(); } }); fileMenu.add(deleteRecip... | public CSMART() { setTitle("CSMART"); // Setup the database parameters. dbConfig = Parameters.findParameter(DBUtils.DATABASE); dbName = Parameters.findParameter(DBUtils.USER); dbPassword = Parameters.findParameter(DBUtils.PASSWORD); // CSMART.inDBMode(true); JMenuBar menuBar = new JMenuB... |
organizer.rename(); | organizer.deleteRecipeFromDatabase(); | public void actionPerformed(ActionEvent e) { organizer.rename(); } |
organizer.saveRecipe(); | organizer.rename(); | public void actionPerformed(ActionEvent e) { organizer.saveRecipe(); } |
dbConfigMenuItem_actionPerformed(); } | organizer.saveRecipe(); } | public void actionPerformed(ActionEvent e) { dbConfigMenuItem_actionPerformed(); } |
dbConfig = dbConfigField.getText(); dbName = dbNameField.getText(); dbPassword = new String(dbPasswordField.getPassword()); | public void actionPerformed(ActionEvent e) { dbConfigDialog.setVisible(false); } | |
if ((node.getDependencyDescriptor() == null || node.getDependencyDescriptor().isTransitive())) { | DependencyDescriptor dd = node.getDependencyDescriptor(node.getParent()); if ((dd == null || dd.isTransitive())) { | private void doFetchDependencies(IvyNode node, String conf) { Configuration c = node.getConfiguration(conf); if (c == null) { Message.warn("configuration not found '"+conf+"' in "+node.getResolvedId()+": ignoring"); if (node.getParent() != null) { Message.warn("it ... |
if(epf instanceof ERDErrorPageInterface) { ((ERDErrorPageInterface)epf).setException(ex); } | public WOActionResults reportException(Exception ex) { WOActionResults newPage = null; try { ErrorPageInterface epf=D2W.factory().errorPage(session()); epf.setMessage(ex.toString()); epf.setNextPage(previousPageFromRequest()); newPage = (WOActionResults)epf;... | |
try { Class clazz = new KeyFactoryGenerator(getNextName(keyInterface.getPackage()), keyInterface, loader).define(); return (KeyFactory)clazz.getConstructor(new Class[]{}).newInstance(new Object[]{}); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new CodeGenerationException(e); } | Class result = new KeyFactoryGenerator(getNextName(keyInterface.getPackage()), keyInterface, loader).define(); return (KeyFactory)FactoryCache.newInstance(result, Constants.TYPES_EMPTY, null); | public static KeyFactory makeFactory(Class keyInterface, ClassLoader loader) { // TODO: caching? if (loader == null) { loader = defaultLoader; } try { Class clazz = new KeyFactoryGenerator(getNextName(keyInterface.getPackage()), ... |
if (log.isWarnEnabled()) log.warn("Remote process suddenly null for " + nodeName + ". Assuming it is dead."); markNodeDead(nodeName); | if (! stopping) { if (log.isWarnEnabled()) log.warn("Remote process suddenly null for " + nodeName + ". Assuming it is dead."); markNodeDead(nodeName); } else { if (log.isInfoEnabled()) log.info("Remote process suddenly null for " + nodeName + ", but we're in process of stopping, so its OK."); } | private void noticeIfServerDead() { Enumeration nodeNames; synchronized (runningNodesLock) { nodeNames = runningNodes.keys(); } while (nodeNames.hasMoreElements()) { String nodeName = (String)nodeNames.nextElement(); NodeInfo ni = (NodeInfo)nodeToNodeInfo.get(nodeName); if (ni == null)... |
if (log.isWarnEnabled()) log.warn("Remote Process for " + nodeName + " says it is not alive. Marking it dead."); | private void noticeIfServerDead() { Enumeration nodeNames; synchronized (runningNodesLock) { nodeNames = runningNodes.keys(); } while (nodeNames.hasMoreElements()) { String nodeName = (String)nodeNames.nextElement(); NodeInfo ni = (NodeInfo)nodeToNodeInfo.get(nodeName); if (ni == null)... | |
markNodeDead(nodeName); | RemoteProcess rp2 = null; synchronized (runningNodesLock) { rp2 = (RemoteProcess)runningNodes.get(nodeName); } if (rp2 == null || stopping) { if (log.isInfoEnabled()) log.info("Remote Process must have just been killed by someone else, so it's OK - no need to mark it dead."); } else { if (log.isWarnEnabled())... | private void noticeIfServerDead() { Enumeration nodeNames; synchronized (runningNodesLock) { nodeNames = runningNodes.keys(); } while (nodeNames.hasMoreElements()) { String nodeName = (String)nodeNames.nextElement(); NodeInfo ni = (NodeInfo)nodeToNodeInfo.get(nodeName); if (ni == null)... |
try { RemoteListenable rl = remoteNode.getRemoteListenable(); if (rl != null) { rl.flushOutput(); remoteNode.destroy(); } } catch (Exception ex) { if(log.isWarnEnabled()) { log.warn("Unable to destroy node, assuming it's dead: ", ex); } markNodeDead(nodeName); } } | RemoteListenable rl = null; for (int retries = 5; retries > 0; retries--) { try { rl = remoteNode.getRemoteListenable(); if (rl != null) { rl.flushOutput(); remoteNode.destroy(); retries = 0; } } catch (Exception ex) { if (rl == null) { if (log.isWarnEnabled()) log.warn("Never got RemoteListenable. Ex... | private void stopAllNodes() { // if there's a thread still creating nodes, stop it stopNodeCreation = true; // wait for the creating thread to stop if (nodeCreator != null) { try { nodeCreator.join(); } catch (InterruptedException ie) { if(log.isErrorEnabled()) { log.error... |
try { RemoteListenable rl = remoteNode.getRemoteListenable(); if (rl != null) { rl.flushOutput(); remoteNode.destroy(); } } catch (Exception ex) { if(log.isWarnEnabled()) { log.warn("Unable to destroy node, assuming it's dead: ", ex); } markNodeDead(nodeName); } } | RemoteListenable rl = null; for (int retries = 5; retries > 0; retries--) { try { rl = remoteNode.getRemoteListenable(); if (rl != null) { rl.flushOutput(); remoteNode.destroy(); retries = 0; } } catch (Exception ex) { if (rl == null) { if (log.isWarnEnabled()) log.warn("Never got RemoteListenable. Ex... | public void run() { RemoteProcess remoteNode; synchronized (runningNodesLock) { remoteNode = (RemoteProcess)runningNodes.get(nodeName); } // end synchronized if (remoteNode == null) { if(log.isErrorEnabled()) { log.error("Unknown node name: ... |
throw new JellyException( "Not within a blissed element" ); | throw new JellyException( "Not within a process library" ); | public void doTag(XMLOutput output) throws Exception { ProcessLibrary library = (ProcessLibrary) findAncestorWithClass( ProcessLibrary.class ); if ( library == null ) { throw new JellyException( "Not within a blissed element" ); } if ( this.name == null ) { ... |
EOEditingContext ec = session.defaultEditingContext(); | public Object invoke(Object ctx) { Session session = (Session)ctx; WOComponent result = null; if ((numberFromRequest == null) || (numberFromRequest.equals(""))) { result = errorPage("Invalid Request", session); } else { try { ... | |
} finally { ec.unlock(); | public Object invoke(Object ctx) { Session session = (Session)ctx; WOComponent result = null; if ((numberFromRequest == null) || (numberFromRequest.equals(""))) { result = errorPage("Invalid Request", session); } else { try { ... | |
EOUtilities.rawRowsForSQL(pingEditingContext(), | EOUtilities.rawRowsForSQL(ec, | public WOComponent pingAction() { WOComponent result = null; try{ EOUtilities.rawRowsForSQL(pingEditingContext(), "bug", "select count(*) from PRIORITY"); result=pageWithName("ERXSuccess"); } catch(E... |
} catch(Exception e) {} | } catch(Exception e) { } finally { ec.unlock(); } | public WOComponent pingAction() { WOComponent result = null; try{ EOUtilities.rawRowsForSQL(pingEditingContext(), "bug", "select count(*) from PRIORITY"); result=pageWithName("ERXSuccess"); } catch(E... |
_pingEditingContext = ERXExtensions.newEditingContext(); | _pingEditingContext = ERXEC.newEditingContext(); | protected static EOEditingContext pingEditingContext() { if (_pingEditingContext == null) _pingEditingContext = ERXExtensions.newEditingContext(); return _pingEditingContext; } |
EOEditingContext ec = ERXExtensions.newEditingContext(); NSArray bugs = EOUtilities.objectsWithFetchSpecificationAndBindings(ec, "Bug", "BugsToTransfert", null); for(Enumeration e = bugs.objectEnumerator(); e.hasMoreElements();){ Bug bug = (Bug)e.nextElement(); System.out.println("bug = "+bug.valueForKey("subject")); S... | EOEditingContext ec = ERXEC.newEditingContext(); ec.lock(); try { NSArray bugs = EOUtilities.objectsWithFetchSpecificationAndBindings(ec, "Bug", "BugsToTransfert", null); for(Enumeration e = bugs.objectEnumerator(); e.hasMoreElements();){ Bug bug = (Bug)e.nextElement(); System.out.println("bug = "+bug.valueForKey("subj... | public WOComponent transfertDescriptionAction(){ EOEditingContext ec = ERXExtensions.newEditingContext(); NSArray bugs = EOUtilities.objectsWithFetchSpecificationAndBindings(ec, "Bug", "BugsToTransfert", null); for(Enume... |
} finally { ec.unlock(); | public static People userFromRequest(WORequest r, EOEditingContext ec) { People user=null; //This gets us the encrypted ID stored for the login cookie String encryptedPrimaryKey=r.cookieValueForKey("BTL"); if (encryptedPrimaryKey !=null && !encryptedPrimaryKey.equals("") && ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.