rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
public boolean remove(Object o) { boolean present = removeObject(o); return present; | public Object remove(int index) { Object result = removeObjectAtIndex(index); return result; | public boolean remove(Object o) { boolean present = removeObject(o); return present; } |
public CMTSociety() { this("CMT"); | public CMTSociety(String name, List assemblyID) { super(name); this.assemblyID = assemblyID; | public CMTSociety() { this("CMT"); } |
DBUtils.executeQuerySet("addRuntimeAssembly",subs, QUERY_FILE); | public static String addAssembly(String experiment_id, String assemblyId, String trialName) { String trial_id = addTrialName(experiment_id,trialName); Map subs = new HashMap(); subs.put(":trial_name",trialName); subs.put(":experiment_id",experiment_id); subs.put(":trial_id",trial_id); subs.put(":ass... | |
DBUtils.executeQuerySet("cloneExperimentEXPT_TRIAL_CONFIG_ASSEMBLY",subs, QUERY_FILE); | public static String cloneExperiment(String experiment_id, String newName) { Map subs = new HashMap(); //String new_expt_id = "EXPT-"+ DBUtils.query1Int("nextExperimentId", subs, QUERY_FILE); String new_expt_id = getNextId("nextExperimentIdHack","EXPT-"); subs.put(":experiment_id",experiment_id); s... | |
DBUtils.dbUpdate("updateRuntimeCMTAssembly",subs, QUERY_FILE); | public static String updateCMTAssembly(String experiment_id) { Map subs = new HashMap(); subs.put(":experiment_id",experiment_id); Set threads = DBUtils.querySet("updateCMTAssemblyThreadID",subs, QUERY_FILE); threads.add("STRATEGIC-TRANS"); threads.add("THEATER-TRANS"); String cfw_group_id = DBUtils... | |
int scanlineStride, int[] bitMasks) | int[] bitMasks) | public SinglePixelPackedSampleModel(int dataType, int w, int h, int scanlineStride, int[] bitMasks) { super(dataType, w, h, bitMasks.length); this.scanlineStride = scanlineStride; this.bitMasks = bitMasks; bitOffsets = new int[numBands]; sampleSize = new int[numBands]; BitMaskE... |
super(dataType, w, h, bitMasks.length); this.scanlineStride = scanlineStride; this.bitMasks = bitMasks; bitOffsets = new int[numBands]; sampleSize = new int[numBands]; BitMaskExtent extent = new BitMaskExtent(); for (int b=0; b<numBands; b++) { extent.setMask(bitMasks[b]); sampleSize[b] = extent.bitWidth; bitOffsets... | this(dataType, w, h, w, bitMasks); | public SinglePixelPackedSampleModel(int dataType, int w, int h, int scanlineStride, int[] bitMasks) { super(dataType, w, h, bitMasks.length); this.scanlineStride = scanlineStride; this.bitMasks = bitMasks; bitOffsets = new int[numBands]; sampleSize = new int[numBands]; BitMaskE... |
if (style & BOLD == BOLD) | if ((style & BOLD) == BOLD) | public boolean isBold() { if (style & BOLD == BOLD) return true; return false; } |
if (style & ITALIC == ITALIC) | if ((style & ITALIC) == ITALIC) | public boolean isItalic() { if (style & ITALIC == ITALIC) return true; return false; } |
source.removeConsumer (this); source.addConsumer (this); | if (source != null) { source.removeConsumer (this); source.addConsumer (this); } | flush () { isLoaded = false; isCacheable = true; width = height = -1; props = null; pixelCache = null; model = null; source.removeConsumer (this); source.addConsumer (this); } |
source.removeConsumer (this); | if (observer != null) { if (status == ImageConsumer.IMAGEERROR) observer.imageUpdate (null, ImageObserver.ERROR, -1, -1, -1, -1); else observer.imageUpdate (null, ImageObserver.ALLBITS, -1, -1, -1, -1); } if (source != null) source.removeConsumer (this); | imageComplete (int status) { if (status == ImageConsumer.STATICIMAGEDONE && isCacheable) isLoaded = true; if (status == ImageConsumer.SINGLEFRAMEDONE) isCacheable = false; source.removeConsumer (this); } |
if (observer != null) observer.imageUpdate (this, (ImageObserver.WIDTH | ImageObserver.HEIGHT), -1, -1, width, height); | setDimensions (int width, int height) { pixelCache = new int[width*height]; this.width = width; this.height = height; for (int i = 0; i < widthObservers.size (); i++) { ImageObserver io = (ImageObserver) widthObservers.elementAt (i); io.imageUpdate (this, ImageObserver.WIDTH, -1, -1, width, heig... | |
if (observer != null) observer.imageUpdate (this, ImageObserver.SOMEBITS, x, y, width, height); | setPixels (int x, int y, int width, int height, ColorModel cm, byte[] pixels, int offset, int scansize) { setPixels (x, y, width, height, cm, convertPixels (pixels), offset, scansize); } | |
source.startProduction (painter); source.removeConsumer (painter); | if (source != null) { source.startProduction (painter); source.removeConsumer (painter); } | startProduction (GtkImagePainter painter) { if (isLoaded) { painter.setDimensions (width, height); painter.setPixels (0, 0, width, height, model, pixelCache, 0, width); } else { source.startProduction (painter); source.removeConsumer (painter); } } |
helper = new OrganizerHelper(this); | public Organizer(CSMART csmart) { this(csmart, null); organizer = this; } | |
if (!societyNames.contains(societyName)) { societyNames.add(societyName); | if (!isInWorkspace(societyComponent)) | private void addExperimentAndComponentsToWorkspace(Experiment experiment, DefaultMutableTreeNode node) { DefaultMutableTreeNode expNode = addExperimentToWorkspace(experiment, node); SocietyComponent societyComponent = experiment.getSocietyComponent(); String societ... |
} | private void addExperimentAndComponentsToWorkspace(Experiment experiment, DefaultMutableTreeNode node) { DefaultMutableTreeNode expNode = addExperimentToWorkspace(experiment, node); SocietyComponent societyComponent = experiment.getSocietyComponent(); String societ... | |
if (!recipeNames.contains(recipes[i].getRecipeName())) | if (!isInWorkspace(recipes[i])) | private void addExperimentAndComponentsToWorkspace(Experiment experiment, DefaultMutableTreeNode node) { DefaultMutableTreeNode expNode = addExperimentToWorkspace(experiment, node); SocietyComponent societyComponent = experiment.getSocietyComponent(); String societ... |
addRecipeToList(recipe); | private DefaultMutableTreeNode addRecipeToWorkspace(RecipeComponent recipe, DefaultMutableTreeNode node) { DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(recipe, false); addNode(node, newNode); recipeNames.add(recipe.getRecipeName()); workspace.setSelection(newNode); insta... | |
addSocietyToList(sc); | protected void addSociety(SocietyComponent sc) { String name = sc.getSocietyName(); // if name is not unique, then get an unique name for the society while (societyNames.contains(name)) { name = societyNames.generateName(name); name = (String)JOptionPane.showInputDialog(this, "Enter Society... | |
addSocietyToList(sc); | private DefaultMutableTreeNode addSocietyToWorkspace(SocietyComponent sc, DefaultMutableTreeNode node) { DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(sc, false); addNode(node, newNode); societyNames.add(sc.getSocietyName()); workspace.setSelection(newNode); installListe... | |
societyNames.remove(society.getSocietyName()); | protected void deleteSocietyInNode(DefaultMutableTreeNode societyNode) { SocietyComponent society = (SocietyComponent)societyNode.getUserObject(); if (!society.isEditable()) { int result = JOptionPane.showConfirmDialog(this, "Society has been or is being used; delete anyway?", "Society Not Edit... | |
societyNames.remove(component.getShortName()); | if (findNode(component) == null) { societyNames.remove(component.getShortName()); removeSocietyFromList((SocietyComponent)component); } | public void replaceComponent(Experiment experiment, ModifiableComponent component, ModifiableComponent newComponent) { // find experiment node DefaultMutableTreeNode expNode = findNode(experiment); if (expNode == null) { if (log.isErrorEnabled(... |
recipeNames.remove(component.getShortName()); | if (findNode(component) == null) { recipeNames.remove(component.getShortName()); removeRecipeFromList((RecipeComponent)component); } | public void replaceComponent(Experiment experiment, ModifiableComponent component, ModifiableComponent newComponent) { // find experiment node DefaultMutableTreeNode expNode = findNode(experiment); if (expNode == null) { if (log.isErrorEnabled(... |
if (o instanceof Experiment) { ((Experiment)o).addModificationListener(myModificationListener); } else if (o instanceof ModifiableComponent) { installListeners((ModifiableComponent) o); } | if (o instanceof ModifiableComponent) installListeners((ModifiableComponent) o); if (o instanceof SocietyComponent && getSociety(((SocietyComponent)o).getSocietyName()) == null) addSocietyToList((SocietyComponent)o); else if (o instanceof RecipeComponent && getRecipe(((RecipeComponent)o).getRecipeName()) == null) addRe... | private void restore(String fileName) { PropertyListener l = null; try { File f = new File(fileName); this.workspaceFileName = f.getPath(); if (f.canRead()) { ObjectInputStream ois = new ObjectInputStream(new FileInputStream(f)); try { root = (DefaultMutableTreeNode) ois.readObject(); for (En... |
String newId = URLEncoder.encode(id); newId = avoidConflicts(doc, sect, this.idAttr, newId); | String newId; try { newId = URLEncoder.encode(id, "UTF-8"); } catch( java.io.UnsupportedEncodingException e ) { getLogger().error("cannot encode Id, using generate-id instead...", e); newId = processor.evaluateAsString(sect, "generate-id()"); } newId = avoidConflicts(doc, sect, this.idAttr, newId); | private Document addIds(Document doc, String elementXPath, String idXPath) throws SAXException { getLogger().debug("## Using element XPath "+elementXPath); NodeList sects = processor.selectNodeList(doc, elementXPath); getLogger().debug("## .. got "+sects.getLength()+" sections"); for (in... |
button.setToolTipText(nodeName + ":" + hostName + ":unknown"); | button.setToolTipText("Node " + nodeName + " (" + hostName + "), unknown"); | private NodeStatusButton createStatusButton(String nodeName, String hostName) { NodeStatusButton button = new NodeStatusButton(new ColoredCircle(NodeStatusButton.unknownStatus, 20, null)); button.setSelectedIcon(new SelectedColoredCircle(NodeStatusButton.unknownStatus, 20, null)); button.setToolTipText(... |
runButton.setToolTipText("Start running experiments."); | runButton.setToolTipText("Start running experiment"); | 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... |
stopButton.setToolTipText("Stop running experiments when the current experiment completes."); | stopButton.setToolTipText("Halt experiment at end of current"); | 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... |
abortButton.setToolTipText("Stop experiment now and discard results."); | abortButton.setToolTipText("Interrupt experiment"); | 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... |
log = CSMART.createLogger("org.cougaar.tools.csmart.experiment"); | createLogger(); | public LeafOnlyConfigWriter(List components, NodeComponent[] nodesToWrite, Experiment exp) { log = CSMART.createLogger("org.cougaar.tools.csmart.experiment"); this.nodesToWrite = nodesToWrite; this.components = components; theSoc = new GenericComponentData(); theSoc.setType(ComponentData.SOCIETY); t... |
public Checkbox (String label, CheckboxGroup group, boolean state) | public Checkbox () | public Checkbox (String label, CheckboxGroup group, boolean state) { this.label = label; this.group = group; this.state = state; } |
this.label = label; this.group = group; this.state = state; | this (null, null, false); | public Checkbox (String label, CheckboxGroup group, boolean state) { this.label = label; this.group = group; this.state = state; } |
super.addNotify (); | public void addNotify () { if (peer == null) peer = getToolkit ().createCheckbox (this); } | |
return null; | return null; } | public byte[] getEncoded() { if (encodedKey != null) return (byte[]) encodedKey.clone(); try { ByteArrayOutputStream out = new ByteArrayOutputStream(); ArrayList spki = new ArrayList(2); ArrayList alg = new ArrayList(2); alg.add(new DERValue(DER.OBJECT_IDENTIFIER, ... |
} | public byte[] getEncoded() { if (encodedKey != null) return (byte[]) encodedKey.clone(); try { ByteArrayOutputStream out = new ByteArrayOutputStream(); ArrayList spki = new ArrayList(2); ArrayList alg = new ArrayList(2); alg.add(new DERValue(DER.OBJECT_IDENTIFIER, ... | |
JList agentsList = (JList)e.getSource(); String agentName = (String)agentsList.getSelectedValue(); | JList myagentsList = (JList)e.getSource(); String agentName = (String)myagentsList.getSelectedValue(); | public void displayAbout() { final ArrayList agentNames = (ArrayList)getPropertyValue(node, "AgentNames"); JPanel aboutPanel = new JPanel(); aboutPanel.setLayout(new GridBagLayout()); int x = 0; int y = 0; // insets are top, left, bottom, right aboutPanel.add(new JLabel("Status:"), ... |
JList agentsList = (JList)e.getSource(); String agentName = (String)agentsList.getSelectedValue(); | JList myagentsList = (JList)e.getSource(); String agentName = (String)myagentsList.getSelectedValue(); | public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting()) return; JList agentsList = (JList)e.getSource(); String agentName = (String)agentsList.getSelectedValue(); if (agentName != null) displayPlugins(agentName); } |
if(log.isDebugEnabled()) { log.debug("NamedFrame: adding: " + title); } | public String addFrame(String title, JFrame frame) { // number commonly used titles for (int i = 0; i < titles.length; i++) { if (title.equals(titles[i])) { title = titles[i] + " " + index[i]++; break; } } String baseTitle = title; int otherIndex = 1; while (titleToFrame.get(title) != null... | |
if(log.isDebugEnabled()) { log.debug("NamedFrame: getFrame: " + title); } | public JFrame getFrame(String title) { if(log.isDebugEnabled()) { log.debug("NamedFrame: getFrame: " + title); } return (JFrame) titleToFrame.get(title); } | |
if(log.isDebugEnabled()) { log.debug("NamedFrame: removing: " + s); } | public void removeFrame(JFrame frame) { // String s = removeTitleColon(frame.getTitle()); String s = frame.getTitle(); if(log.isDebugEnabled()) { log.debug("NamedFrame: removing: " + s); } titleToFrame.remove(s); setChanged(); notifyObservers(new Event(frame, s, Event.REMOVED, null)); } | |
public Menu (String label) | public Menu() | public Menu (String label) { super(label); // ??? throw new Error ("java.awt.Menu: not implemented"); } |
super(label); throw new Error ("java.awt.Menu: not implemented"); | this(null, false); | public Menu (String label) { super(label); // ??? throw new Error ("java.awt.Menu: not implemented"); } |
public void add (String label) { } | public synchronized MenuItem add(MenuItem mi) { items.addElement(mi); if (mi.parent != null) { mi.parent.remove(mi); } mi.parent = this; return mi; } | public void add (String label) { /* FIXME */ } |
public void remove(MenuComponent comp) { } | public synchronized void remove(int index) { items.removeElementAt(index); } | public void remove(MenuComponent comp) { } // FIXME |
agentHost = hosts[0].getShortName(); | for (int i = 0; i < hosts.length; i++) { NodeComponent[] nodes = hosts[i].getNodes(); if (nodes == null || nodes.length == 0) continue; for (int j = 0; j < nodes.length; j++) { AgentComponent[] agents = nodes[j].getAgents(); if (agents == null || agents.length == 0) continue; agentHost = hosts[i].getShortName(); brea... | private void setHostToMonitor(Experiment experiment) { HostComponent[] hosts = experiment.getHosts(); agentHost = hosts[0].getShortName(); agentPort = 5555; // default agentURL = "http://" + agentHost + ":5555/"; agentMap = new CSMARTAgentMap(agentHost, agentPort); } |
private static Map bucket(List values, Indexer t) { | private static Map bucket(List values, Transformer t) { | private static Map bucket(List values, Indexer t) { Map buckets = new HashMap(); for (Iterator it = values.iterator(); it.hasNext();) { Object value = (Object)it.next(); Integer key = new Integer(t.index(value)); List bucket = (List)buckets.get(key); if (buc... |
Integer key = new Integer(t.index(value)); | Object key = t.transform(value); | private static Map bucket(List values, Indexer t) { Map buckets = new HashMap(); for (Iterator it = values.iterator(); it.hasNext();) { Object value = (Object)it.next(); Integer key = new Integer(t.index(value)); List bucket = (List)buckets.get(key); if (buc... |
final StringSwitchCallback callback, | final ObjectSwitchCallback callback, | private void stringSwitchHelper(List strings, final StringSwitchCallback callback, final Label def, final Label end, final int index) throws Exception { final int len = ... |
final Map buckets = bucket(strings, new Indexer() { public int index(Object value) { return ((String)value).charAt(index); | final Map buckets = bucket(strings, new Transformer() { public Object transform(Object value) { return new Integer(((String)value).charAt(index)); | private void stringSwitchHelper(List strings, final StringSwitchCallback callback, final Label def, final Label end, final int index) throws Exception { final int len = ... |
callback.processCase((String)bucket.get(0), end); | callback.processCase(bucket.get(0), end); | private void stringSwitchHelper(List strings, final StringSwitchCallback callback, final Label def, final Label end, final int index) throws Exception { final int len = ... |
callback.processCase((String)bucket.get(0), end); | callback.processCase(bucket.get(0), end); | public void processCase(int key, Label ignore_end) throws Exception { List bucket = (List)buckets.get(new Integer(key)); if (index + 1 == len) { pop(); callback.processCase((String)bucket.get(0), end); ... |
public void string_switch(String[] strings, int switchStyle, StringSwitchCallback callback) | public void string_switch(String[] strings, int switchStyle, ObjectSwitchCallback callback) | public void string_switch(String[] strings, int switchStyle, StringSwitchCallback callback) throws Exception { switch (switchStyle) { case SWITCH_STYLE_TRIE: string_switch_trie(strings, callback); break; case SWITCH_STYLE_HASH: string_switch_hash(strings, cal... |
final StringSwitchCallback callback) throws Exception { final Map buckets = bucket(Arrays.asList(strings), new Indexer() { public int index(Object value) { return value.hashCode(); | final ObjectSwitchCallback callback) throws Exception { final Map buckets = bucket(Arrays.asList(strings), new Transformer() { public Object transform(Object value) { return new Integer(value.hashCode()); | private void string_switch_hash(final String[] strings, final StringSwitchCallback callback) throws Exception { final Map buckets = bucket(Arrays.asList(strings), new Indexer() { public int index(Object value) { return value.hashCode(); ... |
int[] hashCodes = getSwitchKeys(buckets); | private void string_switch_hash(final String[] strings, final StringSwitchCallback callback) throws Exception { final Map buckets = bucket(Arrays.asList(strings), new Indexer() { public int index(Object value) { return value.hashCode(); ... | |
process_switch(hashCodes, new ProcessSwitchCallback() { | process_switch(getSwitchKeys(buckets), new ProcessSwitchCallback() { | private void string_switch_hash(final String[] strings, final StringSwitchCallback callback) throws Exception { final Map buckets = bucket(Arrays.asList(strings), new Indexer() { public int index(Object value) { return value.hashCode(); ... |
private void string_switch_trie(String[] strings, final StringSwitchCallback callback) throws Exception { | private void string_switch_trie(String[] strings, final ObjectSwitchCallback callback) throws Exception { | private void string_switch_trie(String[] strings, final StringSwitchCallback callback) throws Exception { final Label def = make_label(); final Label end = make_label(); final Map buckets = bucket(Arrays.asList(strings), new Indexer() { public int index(Object value) { ... |
final Map buckets = bucket(Arrays.asList(strings), new Indexer() { public int index(Object value) { return ((String)value).length(); | final Map buckets = bucket(Arrays.asList(strings), new Transformer() { public Object transform(Object value) { return new Integer(((String)value).length()); | private void string_switch_trie(String[] strings, final StringSwitchCallback callback) throws Exception { final Label def = make_label(); final Label end = make_label(); final Map buckets = bucket(Arrays.asList(strings), new Indexer() { public int index(Object value) { ... |
public void invoke_constructor(Class type, Class[] parameterTypes) { invoke_constructor(type.getName(), parameterTypes); | public void invoke_constructor(String className, Class[] parameterTypes) { backend.emit_invoke(Opcodes.INVOKESPECIAL, className, Constants.CONSTRUCTOR_NAME, Void.TYPE, parameterTypes); | public void invoke_constructor(Class type, Class[] parameterTypes) { invoke_constructor(type.getName(), parameterTypes); } |
path = (activeProject.getProject().getLocation() | xDocPath = (activeProject.getProject().getLocation() | public void selectionChanged(IWorkbenchPart part, ISelection selection) { if (selection instanceof IStructuredSelection) { Object first = ((IStructuredSelection) selection).getFirstElement(); IResource resource = (IResource) first; if (resource instanceof IProject) { ... |
+ java.io.File.separator + Utilities.getPathToXDocs() + java.io.File.separator + getFilename()); | + java.io.File.separator); path = xDocPath + getFilename(); | public void selectionChanged(IWorkbenchPart part, ISelection selection) { if (selection instanceof IStructuredSelection) { Object first = ((IStructuredSelection) selection).getFirstElement(); IResource resource = (IResource) first; if (resource instanceof IProject) { ... |
void removeAttributes(AttributeSet attributes); | void removeAttributes(Enumeration names); | void removeAttributes(AttributeSet attributes); |
throw new IllegalArgumentException("x and/or y may not be less then 0"); | throw new IllegalArgumentException("x and/or y may not be less than 0"); | protected Size2DSyntax(float x, float y, int units) { if (x < 0.0f || y < 0.0f) throw new IllegalArgumentException("x and/or y may not be less then 0"); if (units < 1) throw new IllegalArgumentException("units may not be less then 1"); this.x = (int) (x * units + 0.5f); this.y = (int) (y * unit... |
OutputStream debug = new FileOutputStream("/tmp/" + name); debug.write(b); debug.close(); | protected Class define() throws CodeGenerationException { try { try { try { generate(); String name = cg.getClassName(); byte[] b = cg.getJavaClass().getBytes(); // DEBUG OutputStream debu... | |
registerTag( "engine", EngineTag.class ); | public BlissedTagLibrary() { registerTag( "blissed", BlissedTag.class ); registerTag( "process", ProcessTag.class ); registerTag( "state", StateTag.class ); registerTag( "transition", TransitionTag.class )... | |
System.out.println("Removing Property: " + prop.getName()); | public void removeProperty(Property prop) { System.out.println("Removing Property: " + prop.getName()); setPropertyVisible(prop, false); // getMyProperties().put(p.getName(), p); firePropertyRemoved(prop); } | |
e.printStackTrace(); | if(log.isErrorEnabled()) { log.error("Exception", e); } | public DefaultMutableTreeNode newExperiment() { String name = getUniqueExperimentName(experimentNames.generateName(), false); if (name == null) return null; try { Experiment experiment = new Experiment(name); DefaultMutableTreeNode newNode = addExperimentToW... |
log.error("Organizer: can't read file: " + f + " got exception: " + e); | log.error("Organizer: can't read file: " + f + " got exception", e); | private void restore(String fileName) { PropertyListener l = null; try { File f = new File(fileName); this.workspaceFileName = f.getPath(); if (f.canRead()) { ObjectInputStream ois = new ObjectInputStream(new FileInputStream(f)); try { root = (DefaultMutableTreeNode) ois.readObject(); for (En... |
DownloadReport dr = resolver.download(new Artifact[] {new DefaultArtifact(mrid, rmr.getPublicationDate(), mrid.getName(), "jar", "jar")}, _ivy, _cache); assertEquals(1, dr.getArtifactsReports(DownloadStatus.SUCCESSFUL).length); | DownloadReport dr = resolver.download(rmr.getDescriptor().getAllArtifacts(), _ivy, _cache); assertEquals(2, dr.getArtifactsReports(DownloadStatus.SUCCESSFUL).length); | public void testChecksum() throws Exception { FileSystemResolver resolver = new FileSystemResolver(); resolver.setName("test"); resolver.setIvy(_ivy); resolver.addIvyPattern("test/repositories/checksums/[module]/[artifact]-[revision].[ext]"); resolver.addArtifactPattern("t... |
writer.print("# Asset Class may have been modified on parse!"); | private void writePrototypeINI(File configDir, AgentComponentData agent) throws IOException { AgentAssetData assetData = agent.getAgentAssetData(); if (assetData == null) { // No Asset info available return; } PrintWriter writer = new PrintWriter(new FileWriter(new File(configDir, agent.getName(... | |
animator.stop(); System.exit(0); | new Thread(new Runnable() { public void run() { animator.stop(); System.exit(0); } }).start(); | public static void main(String[] args) { try { Frame frame = new Frame("Tess Demo"); frame.setSize(500, 500); GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); frame.add(canvas); canvas.addGLEventListener(new TessRend... |
EOEditingContext peer = ERXExtensions.newEditingContext(); | EOEditingContext peer = ERXEC.newEditingContext(); | public WOActionResults signUpAction() { EOEditingContext peer = ERXExtensions.newEditingContext(); EditPageInterface epi = (EditPageInterface)D2W.factory().pageForConfigurationNamed("EditSignUpUser", session()); er.wrox.User user = (er.wrox.User)ERXUtilities.createEO("User", peer); epi.s... |
if (ch != null) return ch.getContent(this); | if (ch == null) return getInputStream(); | public Object getContent() throws IOException { if (!connected) connect(); // FIXME: Doc indicates that other criteria should be applied as // heuristics to determine the true content type, e.g. see // guessContentTypeFromName() and guessContentTypeFromStream methods // as well as FileNameMap cl... |
return getInputStream(); | return ch.getContent(this); | public Object getContent() throws IOException { if (!connected) connect(); // FIXME: Doc indicates that other criteria should be applied as // heuristics to determine the true content type, e.g. see // guessContentTypeFromName() and guessContentTypeFromStream methods // as well as FileNameMap cl... |
StringTokenizer pkgPrefix = new StringTokenizer(propVal, "|"); | private ContentHandler setContentHandler(String contentType) { ContentHandler handler; // No content type so just handle it as the default. if (contentType == null || contentType.equals("")) return null; // See if a handler has been cached for this content type. // For efficiency, if a content ty... | |
StringTokenizer pkgPrefix = new StringTokenizer(propVal, "|"); | private ContentHandler setContentHandler(String contentType) { ContentHandler handler; // No content type so just handle it as the default. if (contentType == null || contentType.equals("")) return null; // See if a handler has been cached for this content type. // For efficiency, if a content ty... | |
super (out); def = new Deflater (level, true); | super (out, new Deflater (Deflater.DEFAULT_COMPRESSION, true), 8192); sum = new CRC32 (); | public ZipOutputStream (OutputStream out) { super (out); def = new Deflater (level, true); } |
int uncompressed_size = def.getTotalIn(); int compressed_size = def.getTotalOut(); long crc = filter.getChecksum().getValue(); | int compressed_size; if (current.method == STORED) { compressed_size = uncompressed_size; } else { super.finish(); compressed_size = def.getTotalOut(); } long crc = sum.getValue(); | public void closeEntry () throws IOException { int uncompressed_size = def.getTotalIn(); int compressed_size = def.getTotalOut(); long crc = filter.getChecksum().getValue(); bytes_written += compressed_size; bytes_written += put4 (0x08074b50); if (current.getCrc() == -1 || current.getCompressedSiz... |
bytes_written += put4 (0x08074b50); | public void closeEntry () throws IOException { int uncompressed_size = def.getTotalIn(); int compressed_size = def.getTotalOut(); long crc = filter.getChecksum().getValue(); bytes_written += compressed_size; bytes_written += put4 (0x08074b50); if (current.getCrc() == -1 || current.getCompressedSiz... | |
else { if (current.getCrc() != crc || current.getCompressedSize() != compressed_size || current.getSize() != uncompressed_size) throw new ZipException ("zip entry field incorrect"); } bytes_written += put4 ((int) (current.getCrc())); bytes_written += put4 ((int) (current.getCompressedSize())); bytes_written += put4 ((i... | else if (current.getCrc() != crc || current.getCompressedSize() != compressed_size || current.getSize() != uncompressed_size) throw new ZipException ("zip entry field incorrect"); | public void closeEntry () throws IOException { int uncompressed_size = def.getTotalIn(); int compressed_size = def.getTotalOut(); long crc = filter.getChecksum().getValue(); bytes_written += compressed_size; bytes_written += put4 (0x08074b50); if (current.getCrc() == -1 || current.getCompressedSiz... |
filter = null; | public void closeEntry () throws IOException { int uncompressed_size = def.getTotalIn(); int compressed_size = def.getTotalOut(); long crc = filter.getChecksum().getValue(); bytes_written += compressed_size; bytes_written += put4 (0x08074b50); if (current.getCrc() == -1 || current.getCompressedSiz... | |
out.write((byte) 0); | public void finish () throws IOException { if (current != null) closeEntry (); // Write the central directory. long offset = bytes_written; int count = 0; int bytes = 0; while (chain != null) { bytes += write_entry (chain, false); ++count; chain = chain.next; } // Write the end of... | |
filter = new CheckedOutputStream (new DeflaterOutputStream (out, def), new CRC32 ()); | sum.reset(); | public void putNextEntry (ZipEntry entry) throws IOException { if (current != null) closeEntry (); if (entry.method < 0 ) entry.method = method; if (entry.method == STORED) { if (entry.getSize() == -1 || entry.getCrc() == -1) throw new ZipException ("required entry not set"); // Just in cas... |
public synchronized void write (byte[] buf, int off, int len) throws IOException | public void write (int bval) throws IOException | public synchronized void write (byte[] buf, int off, int len) throws IOException { if (filter == null) throw new ZipException ("no open zip entry"); filter.write(buf, off, len); } |
if (filter == null) throw new ZipException ("no open zip entry"); filter.write(buf, off, len); | if (current.method == STORED) { out.write(bval); } else super.write(bval); sum.update(bval); uncompressed_size += 1; | public synchronized void write (byte[] buf, int off, int len) throws IOException { if (filter == null) throw new ZipException ("no open zip entry"); filter.write(buf, off, len); } |
long offset = bytes_written; | private int write_entry (ZipEntry entry, boolean is_local) throws IOException { long offset = bytes_written; int bytes = put4 (is_local ? 0x04034b50 : 0x02014b50); if (! is_local) bytes += put_version (); bytes += put_version (); boolean crc_after = false; if (is_local && (entry.getCrc() ==... | |
bytes += put2 (0); | bytes += put4 (0); | private int write_entry (ZipEntry entry, boolean is_local) throws IOException { long offset = bytes_written; int bytes = put4 (is_local ? 0x04034b50 : 0x02014b50); if (! is_local) bytes += put_version (); bytes += put_version (); boolean crc_after = false; if (is_local && (entry.getCrc() ==... |
bytes += put2 ((int) offset); | bytes += put4 ((int) entry.relativeOffset); | private int write_entry (ZipEntry entry, boolean is_local) throws IOException { long offset = bytes_written; int bytes = put4 (is_local ? 0x04034b50 : 0x02014b50); if (! is_local) bytes += put_version (); bytes += put_version (); boolean crc_after = false; if (is_local && (entry.getCrc() ==... |
out.write ((byte) 0); bytes += name.length + 1; | bytes += name.length; | private int write_entry (ZipEntry entry, boolean is_local) throws IOException { long offset = bytes_written; int bytes = put4 (is_local ? 0x04034b50 : 0x02014b50); if (! is_local) bytes += put_version (); bytes += put_version (); boolean crc_after = false; if (is_local && (entry.getCrc() ==... |
out.write((byte) 0); bytes += entry.extra.length + 1; | bytes += entry.extra.length; | private int write_entry (ZipEntry entry, boolean is_local) throws IOException { long offset = bytes_written; int bytes = put4 (is_local ? 0x04034b50 : 0x02014b50); if (! is_local) bytes += put_version (); bytes += put_version (); boolean crc_after = false; if (is_local && (entry.getCrc() ==... |
out.write((byte) 0); bytes += comment.length + 1; | bytes += comment.length; | private int write_entry (ZipEntry entry, boolean is_local) throws IOException { long offset = bytes_written; int bytes = put4 (is_local ? 0x04034b50 : 0x02014b50); if (! is_local) bytes += put_version (); bytes += put_version (); boolean crc_after = false; if (is_local && (entry.getCrc() ==... |
List uids) { | List uids, int limit) { | public static List getLocalThread( AgentMapping am, boolean isDown, String agentName, List uids) { try { // get host and port String host = am.getHost(agentName); int port = am.getPort(agentName); // create URL String surl = "http://"+host+":"+port+ "/$"... |
(isDown ? "down" : "up"); | (isDown ? "down" : "up") + ((limit >= 0) ? ("?limit="+limit) : ""); | public static List getLocalThread( AgentMapping am, boolean isDown, String agentName, List uids) { try { // get host and port String host = am.getHost(agentName); int port = am.getPort(agentName); // create URL String surl = "http://"+host+":"+port+ "/$"... |
DefaultMutableTreeNode root = (DefaultMutableTreeNode)model.getRoot(); if (node == null) { root.removeAllChildren(); model.nodeStructureChanged(root); node = root; } | protected DefaultMutableTreeNode addNode(DefaultMutableTreeNode node, String name, String type, String communityName) { DefaultTreeModel model = (DefaultTreeModel)getModel(); DefaultMutableTreeNode root = (DefaultMutableTreeNode... | |
private void copyChildren(DefaultMutableTreeNode oldNode, DefaultMutableTreeNode newNode) { | private void copyChildren(DefaultMutableTreeNode sourceNode, DefaultMutableTreeNode parentNode, int insertionIndex) { | private void copyChildren(DefaultMutableTreeNode oldNode, DefaultMutableTreeNode newNode) { DefaultTreeModel model = (DefaultTreeModel)getModel(); int nChildren = oldNode.getChildCount(); for (int i=0; i < nChildren; i++) { DefaultMutableTreeNode oldChildNode = (Defaul... |
int nChildren = oldNode.getChildCount(); | int nChildren = sourceNode.getChildCount(); | private void copyChildren(DefaultMutableTreeNode oldNode, DefaultMutableTreeNode newNode) { DefaultTreeModel model = (DefaultTreeModel)getModel(); int nChildren = oldNode.getChildCount(); for (int i=0; i < nChildren; i++) { DefaultMutableTreeNode oldChildNode = (Defaul... |
(DefaultMutableTreeNode)oldNode.getChildAt(i); | (DefaultMutableTreeNode)sourceNode.getChildAt(i); | private void copyChildren(DefaultMutableTreeNode oldNode, DefaultMutableTreeNode newNode) { DefaultTreeModel model = (DefaultTreeModel)getModel(); int nChildren = oldNode.getChildCount(); for (int i=0; i < nChildren; i++) { DefaultMutableTreeNode oldChildNode = (Defaul... |
new DefaultMutableTreeNode(newCTO, newCTO.allowsChildren()); if (isDuplicate(newChildNode, newNode) || isInCommunity(newChildNode, newNode)) | new DefaultMutableTreeNode(newCTO, false); if (isDuplicate(newChildNode, parentNode) || isInCommunity(newChildNode, parentNode)) | private void copyChildren(DefaultMutableTreeNode oldNode, DefaultMutableTreeNode newNode) { DefaultTreeModel model = (DefaultTreeModel)getModel(); int nChildren = oldNode.getChildCount(); for (int i=0; i < nChildren; i++) { DefaultMutableTreeNode oldChildNode = (Defaul... |
model.insertNodeInto(newChildNode, newNode, newNode.getChildCount()); copyChildren(oldChildNode, newChildNode); | model.insertNodeInto(newChildNode, parentNode, insertionIndex++); copyChildren(oldChildNode, parentNode, insertionIndex); | private void copyChildren(DefaultMutableTreeNode oldNode, DefaultMutableTreeNode newNode) { DefaultTreeModel model = (DefaultTreeModel)getModel(); int nChildren = oldNode.getChildCount(); for (int i=0; i < nChildren; i++) { DefaultMutableTreeNode oldChildNode = (Defaul... |
float f1=q((String)o1); float f2=q((String)o2); | float f1=quality((String)o1); float f2=quality((String)o2); | public int compare(Object o1, Object o2) { float f1=q((String)o1); float f2=q((String)o2); return f1<f2 ? OrderedDescending : ( f1==f2 ? OrderedSame : OrderedAscending ); // we want DESCENDING SORT!! } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.