rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
checkUpdate(false); | checkForUpdates(false); | public void run() { checkUpdate(false); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/97917d876023996dcd3bd220e88b62b3f6dcb7fc/MainWindow.java/buggy/src/java/org/jivesoftware/MainWindow.java |
checkUpdate(true); | checkForUpdates(true); | public void actionPerformed(ActionEvent actionEvent) { checkUpdate(true); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/97917d876023996dcd3bd220e88b62b3f6dcb7fc/MainWindow.java/buggy/src/java/org/jivesoftware/MainWindow.java |
String status = inputTextDialog.getInput("Status Message", "Let others know your current status or activity.", | String status = inputTextDialog.getInput(Res.getString("title.status.message"), Res.getString("message.current.status"), | public void logout(boolean sendStatus) { final XMPPConnection con = SparkManager.getConnection(); if (con.isConnected() && sendStatus) { final InputTextAreaDialog inputTextDialog = new InputTextAreaDialog(); String status = inputTextDialog.getInput("Status Message", "Let others know your current status or activity.", SparkRes.getImageIcon(SparkRes.USER1_MESSAGE_24x24), this); if (status != null) { Presence presence = new Presence(Presence.Type.unavailable); presence.setStatus(status); con.sendPacket(presence); } } // Set auto-login to false SettingsManager.getLocalPreferences().setAutoLogin(false); // Notify all MainWindowListeners try { fireWindowShutdown(); setVisible(false); } finally { final SwingWorker shutdownThread = new SwingWorker() { public Object construct() { try { Thread.sleep(10); } catch (InterruptedException e) { Log.error(e); } return true; } public void finished() { closeConnectionAndInvoke(); } }; shutdownThread.start(); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/97917d876023996dcd3bd220e88b62b3f6dcb7fc/MainWindow.java/buggy/src/java/org/jivesoftware/MainWindow.java |
LogMessage msg = new LogMessage(); msg.println("Get thumbnail direct, PixelsID: "+pix.getId()); Logger logger = context.getLogger(); logger.debug(this, msg); | public BufferedImage getThumbnail(PixelsData pix, int sizeX, int sizeY) throws RenderingServiceException { try { byte[] v = gateway.getThumbnail(pix.asPixels(), sizeX, sizeY); return createImage(v); } catch (Exception e) { throw new RenderingServiceException("Get Thumbnail", e); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7bf166a5aea933565232544ef7535e345cd27f93/OmeroImageServiceImpl.java/clean/SRC/org/openmicroscopy/shoola/env/data/OmeroImageServiceImpl.java |
|
delegate = (IPixels) applicationContext.getBean( IPixels.class.getName()); | delegate = serviceFactory.getPixelsService(); | public void create() { super.create(); delegate = (IPixels) applicationContext.getBean( IPixels.class.getName()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/PixelsBean.java/clean/components/ejb/src/ome/ro/ejb/PixelsBean.java |
return wrap( context, "&pixelsService" ); | return wrap( context, IPixels.class ); | public Object invoke( InvocationContext context ) throws Exception { return wrap( context, "&pixelsService" ); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/PixelsBean.java/clean/components/ejb/src/ome/ro/ejb/PixelsBean.java |
lastRead = result; | public void unread() { synchronized (buffer) { char result; if (offset > 0) { result = buffer.charAt(--offset); } else { result = 0; } if (result == '\n') { line--; } return; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/58dbf49420f066da48682902fcdf32e439c64e83/AbstractLexerSource.java/buggy/src/org/ablaf/internal/lexer/AbstractLexerSource.java |
|
container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS)); | GridBagConstraints gbc = new GridBagConstraints(); gbc.anchor = GridBagConstraints.WEST; gbc.weightx = 0.0; container.setLayout(new GridBagLayout()); | void createUI() { createWheel(); createHSVSlider(); createAlphaSlider(); createAlphaTextbox(); JPanel container = new JPanel(); container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS)); //setLayout(new FlowLayout()); container.add(wheel); container.add(UIUtilities.buildComponentPanel(HSVSlider)); // JPanel p = new JPanel(); GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.WEST; c.weightx = 0.0; p.setLayout(new GridBagLayout()); p.add(alphaSlider, c); c.gridx = 1; p.add(alphaTextbox, c); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(container); add(UIUtilities.buildComponentPanel(p)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a120269806e5dce185dd2b5b26374a782df23119/HSVColourWheelUI.java/buggy/SRC/org/openmicroscopy/shoola/util/ui/colourpicker/HSVColourWheelUI.java |
container.add(wheel); container.add(UIUtilities.buildComponentPanel(HSVSlider)); | container.add(wheel, gbc); gbc.gridx = 1; container.add(HSVSlider); | void createUI() { createWheel(); createHSVSlider(); createAlphaSlider(); createAlphaTextbox(); JPanel container = new JPanel(); container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS)); //setLayout(new FlowLayout()); container.add(wheel); container.add(UIUtilities.buildComponentPanel(HSVSlider)); // JPanel p = new JPanel(); GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.WEST; c.weightx = 0.0; p.setLayout(new GridBagLayout()); p.add(alphaSlider, c); c.gridx = 1; p.add(alphaTextbox, c); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(container); add(UIUtilities.buildComponentPanel(p)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a120269806e5dce185dd2b5b26374a782df23119/HSVColourWheelUI.java/buggy/SRC/org/openmicroscopy/shoola/util/ui/colourpicker/HSVColourWheelUI.java |
return object.callMethod(recv.getRuntime().getCurrentContext(), "to_f"); | if(object instanceof RubyString) { return RubyNumeric.str2fnum(recv.getRuntime(),(RubyString)object,true); } else { return object.callMethod(recv.getRuntime().getCurrentContext(), "to_f"); } | public static IRubyObject new_float(IRubyObject recv, IRubyObject object) { return object.callMethod(recv.getRuntime().getCurrentContext(), "to_f"); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a8583bc4b548ea3f09cf86cc0ce0b77670255f40/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
return recv.getRuntime().newString(val.substring(2)).callMethod(context,"to_i", recv.getRuntime().newFixnum(16)); | return RubyNumeric.str2inum(recv.getRuntime(),recv.getRuntime().newString(val.substring(2)),16,true); | public static IRubyObject new_integer(IRubyObject recv, IRubyObject object) { ThreadContext context = recv.getRuntime().getCurrentContext(); if(object instanceof RubyString) { String val = object.toString(); if(val.length() > 0 && val.charAt(0) == '0') { if(val.length() > 1) { if(val.charAt(1) == 'x') { return recv.getRuntime().newString(val.substring(2)).callMethod(context,"to_i", recv.getRuntime().newFixnum(16)); } else if(val.charAt(1) == 'b') { return recv.getRuntime().newString(val.substring(2)).callMethod(context,"to_i", recv.getRuntime().newFixnum(2)); } else { return recv.getRuntime().newString(val.substring(1)).callMethod(context,"to_i", recv.getRuntime().newFixnum(8)); } } } } return object.callMethod(context, "to_i"); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a8583bc4b548ea3f09cf86cc0ce0b77670255f40/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
return recv.getRuntime().newString(val.substring(2)).callMethod(context,"to_i", recv.getRuntime().newFixnum(2)); | return RubyNumeric.str2inum(recv.getRuntime(),recv.getRuntime().newString(val.substring(2)),2,true); | public static IRubyObject new_integer(IRubyObject recv, IRubyObject object) { ThreadContext context = recv.getRuntime().getCurrentContext(); if(object instanceof RubyString) { String val = object.toString(); if(val.length() > 0 && val.charAt(0) == '0') { if(val.length() > 1) { if(val.charAt(1) == 'x') { return recv.getRuntime().newString(val.substring(2)).callMethod(context,"to_i", recv.getRuntime().newFixnum(16)); } else if(val.charAt(1) == 'b') { return recv.getRuntime().newString(val.substring(2)).callMethod(context,"to_i", recv.getRuntime().newFixnum(2)); } else { return recv.getRuntime().newString(val.substring(1)).callMethod(context,"to_i", recv.getRuntime().newFixnum(8)); } } } } return object.callMethod(context, "to_i"); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a8583bc4b548ea3f09cf86cc0ce0b77670255f40/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
return recv.getRuntime().newString(val.substring(1)).callMethod(context,"to_i", recv.getRuntime().newFixnum(8)); | return RubyNumeric.str2inum(recv.getRuntime(),recv.getRuntime().newString(val.substring(1)),8,true); | public static IRubyObject new_integer(IRubyObject recv, IRubyObject object) { ThreadContext context = recv.getRuntime().getCurrentContext(); if(object instanceof RubyString) { String val = object.toString(); if(val.length() > 0 && val.charAt(0) == '0') { if(val.length() > 1) { if(val.charAt(1) == 'x') { return recv.getRuntime().newString(val.substring(2)).callMethod(context,"to_i", recv.getRuntime().newFixnum(16)); } else if(val.charAt(1) == 'b') { return recv.getRuntime().newString(val.substring(2)).callMethod(context,"to_i", recv.getRuntime().newFixnum(2)); } else { return recv.getRuntime().newString(val.substring(1)).callMethod(context,"to_i", recv.getRuntime().newFixnum(8)); } } } } return object.callMethod(context, "to_i"); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a8583bc4b548ea3f09cf86cc0ce0b77670255f40/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
return object.callMethod(context, "to_i"); | return object.callMethod(context,"to_i"); | public static IRubyObject new_integer(IRubyObject recv, IRubyObject object) { ThreadContext context = recv.getRuntime().getCurrentContext(); if(object instanceof RubyString) { String val = object.toString(); if(val.length() > 0 && val.charAt(0) == '0') { if(val.length() > 1) { if(val.charAt(1) == 'x') { return recv.getRuntime().newString(val.substring(2)).callMethod(context,"to_i", recv.getRuntime().newFixnum(16)); } else if(val.charAt(1) == 'b') { return recv.getRuntime().newString(val.substring(2)).callMethod(context,"to_i", recv.getRuntime().newFixnum(2)); } else { return recv.getRuntime().newString(val.substring(1)).callMethod(context,"to_i", recv.getRuntime().newFixnum(8)); } } } } return object.callMethod(context, "to_i"); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a8583bc4b548ea3f09cf86cc0ce0b77670255f40/RubyKernel.java/buggy/src/org/jruby/RubyKernel.java |
try { serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); | if (service != null) { try { serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } | public void destroy(StopStrategy stopStrategy) throws IllegalServiceStateException, UnsatisfiedConditionsException { // if we are not restartable, we need to stop try { if (!stop(stopStrategy)) { throw new IllegalServiceStateException("Service did not stop", serviceName); } } catch (UnsatisfiedConditionsException e) { throw e; } if (!serviceFactory.isRestartable()) { lock("destroy"); try { if (state != ServiceState.STOPPED) { state = ServiceState.STARTING; serviceMonitor.serviceStopping(createServiceEvent()); try { // destroy the service serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } destroyAllConditions(serviceMonitor); service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } } finally { unlock(); } } // cool we can unregistered serviceMonitor.serviceUnregistered(createServiceEvent()); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
if (startConditions != null) { List errors = startConditions.destroy(); | if (startCondition != null) { List errors = startCondition.destroy(); | private void destroyAllConditions(ServiceMonitor monitor) { if (!lock.isHeldByCurrentThread()) { throw new IllegalStateException("Current thread must hold lock before calling destroyAllConditions"); } if (startConditions != null) { List errors = startConditions.destroy(); // errors from destroying the start conditions are stop errors because destroy is only called while // stopping the service for (Iterator iterator = errors.iterator(); iterator.hasNext();) { Throwable stopError = (Throwable) iterator.next(); monitor.serviceStopError(createErrorServiceEvent(stopError)); } startConditions = null; } if (stopConditions != null) { List errors = stopConditions.destroy(); for (Iterator iterator = errors.iterator(); iterator.hasNext();) { Throwable stopError = (Throwable) iterator.next(); monitor.serviceStopError(createErrorServiceEvent(stopError)); } stopConditions = null; } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
startConditions = null; | startCondition = null; | private void destroyAllConditions(ServiceMonitor monitor) { if (!lock.isHeldByCurrentThread()) { throw new IllegalStateException("Current thread must hold lock before calling destroyAllConditions"); } if (startConditions != null) { List errors = startConditions.destroy(); // errors from destroying the start conditions are stop errors because destroy is only called while // stopping the service for (Iterator iterator = errors.iterator(); iterator.hasNext();) { Throwable stopError = (Throwable) iterator.next(); monitor.serviceStopError(createErrorServiceEvent(stopError)); } startConditions = null; } if (stopConditions != null) { List errors = stopConditions.destroy(); for (Iterator iterator = errors.iterator(); iterator.hasNext();) { Throwable stopError = (Throwable) iterator.next(); monitor.serviceStopError(createErrorServiceEvent(stopError)); } stopConditions = null; } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
if (stopConditions != null) { List errors = stopConditions.destroy(); | if (stopCondition != null) { List errors = stopCondition.destroy(); | private void destroyAllConditions(ServiceMonitor monitor) { if (!lock.isHeldByCurrentThread()) { throw new IllegalStateException("Current thread must hold lock before calling destroyAllConditions"); } if (startConditions != null) { List errors = startConditions.destroy(); // errors from destroying the start conditions are stop errors because destroy is only called while // stopping the service for (Iterator iterator = errors.iterator(); iterator.hasNext();) { Throwable stopError = (Throwable) iterator.next(); monitor.serviceStopError(createErrorServiceEvent(stopError)); } startConditions = null; } if (stopConditions != null) { List errors = stopConditions.destroy(); for (Iterator iterator = errors.iterator(); iterator.hasNext();) { Throwable stopError = (Throwable) iterator.next(); monitor.serviceStopError(createErrorServiceEvent(stopError)); } stopConditions = null; } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
stopConditions = null; | stopCondition = null; | private void destroyAllConditions(ServiceMonitor monitor) { if (!lock.isHeldByCurrentThread()) { throw new IllegalStateException("Current thread must hold lock before calling destroyAllConditions"); } if (startConditions != null) { List errors = startConditions.destroy(); // errors from destroying the start conditions are stop errors because destroy is only called while // stopping the service for (Iterator iterator = errors.iterator(); iterator.hasNext();) { Throwable stopError = (Throwable) iterator.next(); monitor.serviceStopError(createErrorServiceEvent(stopError)); } startConditions = null; } if (stopConditions != null) { List errors = stopConditions.destroy(); for (Iterator iterator = errors.iterator(); iterator.hasNext();) { Throwable stopError = (Throwable) iterator.next(); monitor.serviceStopError(createErrorServiceEvent(stopError)); } stopConditions = null; } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
stopConditions = new NonRestartableStopConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock, serviceFactory); | stopCondition = new NonRestartableStopCondition(kernel, serviceName, classLoader, lock, serviceFactory); | public void initialize() throws IllegalServiceStateException, UnsatisfiedConditionsException, Exception { if (!serviceFactory.isRestartable() && !serviceFactory.isEnabled()) { throw new IllegalServiceStateException("A disabled non-restartable service factory can not be initalized", serviceName); } serviceMonitor.serviceRegistered(createServiceEvent()); // if we are not restartable, we need to start immediately, otherwise we are not going to register this service if (!serviceFactory.isRestartable()) { try { start(false, StartStrategies.UNREGISTER); } catch (UnregisterServiceException e) { serviceMonitor.serviceUnregistered(createServiceEvent()); Throwable cause = e.getCause(); if (cause instanceof Exception) { throw (Exception) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new AssertionError(cause); } } // a non restartable service uses a special stop conditions object that picks up stop conditions as they // are added. When the stop() method is called on a non-restartable service all of the stop conditions // registered with the service factory are initialized (if not already initialized), and the isSatisfied // method is called. This should cause the stop logic of a stop condition to fire. lock("initialize"); try { stopConditions = new NonRestartableStopConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock, serviceFactory); } finally { unlock(); } } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
synchronized (serviceFactory) { state = ServiceState.STARTING; startConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock); } | public void start(boolean recursive, StartStrategy startStrategy) throws IllegalServiceStateException, UnregisterServiceException, UnsatisfiedConditionsException, Exception { // verify that it is possible to start this service in the current state before obtaining the lock if (!verifyStartable(state)) { if (recursive) { startOwnedServices(startStrategy); } return; } boolean shouldStartRecursive = false; lock("start"); try { // update the recursive flag this.recursive = this.recursive || recursive; Throwable startError = null; try { // // Loop until all start conditions have been satified. The start strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to start? if (!verifyStartable(state)) { // assume someone else called startOwnedServices return; } // if we are in the STOPPED state, we need to move to the STARTING state if (state == ServiceState.STOPPED) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the startConditions. This allows other code to assure the service is in the correct state before // adding a startCondition. synchronized (serviceFactory) { state = ServiceState.STARTING; startConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock); } // we are now officially starting serviceMonitor.serviceStarting(createServiceEvent()); // initialize the start conditions startConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = startConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (startStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop startConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStart(createWaitingServiceEvent(unsatisfiedConditions)); return; } } } // we are ready to create the service service = serviceFactory.createService(standardServiceContext); // success transition to running startTime = System.currentTimeMillis(); state = ServiceState.RUNNING; serviceMonitor.serviceRunning(createServiceEvent()); // should we recursively start our children shouldStartRecursive = this.recursive || recursive; this.recursive = false; } catch (UnsatisfiedConditionsException e) { // thrown from waitForUnsatisfiedConditions throw e; } catch (IllegalServiceStateException e) { // this can be thrown while awaiting satisfaction throw e; } catch (Exception e) { startError = e; } catch (Error e) { startError = e; } if (startError != null) { try { if (startError instanceof UnregisterServiceException) { throw (UnregisterServiceException) startError; } else { // the strategy will normally rethrow the startError, but if it doesn't notify the service monitor startStrategy.startError(serviceName, startError); serviceMonitor.serviceStartError(createErrorServiceEvent(startError)); } } finally { // we are now STOPPING state = ServiceState.STOPPING; serviceMonitor.serviceStopping(createServiceEvent()); // clean up the conditons destroyAllConditions(serviceMonitor); // transition to the STOPPED state service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } } } finally { unlock(); } // startRecursive all of the owned services if (shouldStartRecursive) { startOwnedServices(startStrategy); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
|
startConditions.initialize(); | startCondition = new AggregateCondition(kernel, serviceName, classLoader, lock, serviceFactory.getStartConditions()); startCondition.initialize(); | public void start(boolean recursive, StartStrategy startStrategy) throws IllegalServiceStateException, UnregisterServiceException, UnsatisfiedConditionsException, Exception { // verify that it is possible to start this service in the current state before obtaining the lock if (!verifyStartable(state)) { if (recursive) { startOwnedServices(startStrategy); } return; } boolean shouldStartRecursive = false; lock("start"); try { // update the recursive flag this.recursive = this.recursive || recursive; Throwable startError = null; try { // // Loop until all start conditions have been satified. The start strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to start? if (!verifyStartable(state)) { // assume someone else called startOwnedServices return; } // if we are in the STOPPED state, we need to move to the STARTING state if (state == ServiceState.STOPPED) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the startConditions. This allows other code to assure the service is in the correct state before // adding a startCondition. synchronized (serviceFactory) { state = ServiceState.STARTING; startConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock); } // we are now officially starting serviceMonitor.serviceStarting(createServiceEvent()); // initialize the start conditions startConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = startConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (startStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop startConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStart(createWaitingServiceEvent(unsatisfiedConditions)); return; } } } // we are ready to create the service service = serviceFactory.createService(standardServiceContext); // success transition to running startTime = System.currentTimeMillis(); state = ServiceState.RUNNING; serviceMonitor.serviceRunning(createServiceEvent()); // should we recursively start our children shouldStartRecursive = this.recursive || recursive; this.recursive = false; } catch (UnsatisfiedConditionsException e) { // thrown from waitForUnsatisfiedConditions throw e; } catch (IllegalServiceStateException e) { // this can be thrown while awaiting satisfaction throw e; } catch (Exception e) { startError = e; } catch (Error e) { startError = e; } if (startError != null) { try { if (startError instanceof UnregisterServiceException) { throw (UnregisterServiceException) startError; } else { // the strategy will normally rethrow the startError, but if it doesn't notify the service monitor startStrategy.startError(serviceName, startError); serviceMonitor.serviceStartError(createErrorServiceEvent(startError)); } } finally { // we are now STOPPING state = ServiceState.STOPPING; serviceMonitor.serviceStopping(createServiceEvent()); // clean up the conditons destroyAllConditions(serviceMonitor); // transition to the STOPPED state service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } } } finally { unlock(); } // startRecursive all of the owned services if (shouldStartRecursive) { startOwnedServices(startStrategy); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
Set unsatisfiedConditions = startConditions.getUnsatisfied(); | Set unsatisfiedConditions = startCondition.getUnsatisfied(); | public void start(boolean recursive, StartStrategy startStrategy) throws IllegalServiceStateException, UnregisterServiceException, UnsatisfiedConditionsException, Exception { // verify that it is possible to start this service in the current state before obtaining the lock if (!verifyStartable(state)) { if (recursive) { startOwnedServices(startStrategy); } return; } boolean shouldStartRecursive = false; lock("start"); try { // update the recursive flag this.recursive = this.recursive || recursive; Throwable startError = null; try { // // Loop until all start conditions have been satified. The start strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to start? if (!verifyStartable(state)) { // assume someone else called startOwnedServices return; } // if we are in the STOPPED state, we need to move to the STARTING state if (state == ServiceState.STOPPED) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the startConditions. This allows other code to assure the service is in the correct state before // adding a startCondition. synchronized (serviceFactory) { state = ServiceState.STARTING; startConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock); } // we are now officially starting serviceMonitor.serviceStarting(createServiceEvent()); // initialize the start conditions startConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = startConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (startStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop startConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStart(createWaitingServiceEvent(unsatisfiedConditions)); return; } } } // we are ready to create the service service = serviceFactory.createService(standardServiceContext); // success transition to running startTime = System.currentTimeMillis(); state = ServiceState.RUNNING; serviceMonitor.serviceRunning(createServiceEvent()); // should we recursively start our children shouldStartRecursive = this.recursive || recursive; this.recursive = false; } catch (UnsatisfiedConditionsException e) { // thrown from waitForUnsatisfiedConditions throw e; } catch (IllegalServiceStateException e) { // this can be thrown while awaiting satisfaction throw e; } catch (Exception e) { startError = e; } catch (Error e) { startError = e; } if (startError != null) { try { if (startError instanceof UnregisterServiceException) { throw (UnregisterServiceException) startError; } else { // the strategy will normally rethrow the startError, but if it doesn't notify the service monitor startStrategy.startError(serviceName, startError); serviceMonitor.serviceStartError(createErrorServiceEvent(startError)); } } finally { // we are now STOPPING state = ServiceState.STOPPING; serviceMonitor.serviceStopping(createServiceEvent()); // clean up the conditons destroyAllConditions(serviceMonitor); // transition to the STOPPED state service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } } } finally { unlock(); } // startRecursive all of the owned services if (shouldStartRecursive) { startOwnedServices(startStrategy); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
startConditions.awaitSatisfaction(); | startCondition.awaitSatisfaction(); | public void start(boolean recursive, StartStrategy startStrategy) throws IllegalServiceStateException, UnregisterServiceException, UnsatisfiedConditionsException, Exception { // verify that it is possible to start this service in the current state before obtaining the lock if (!verifyStartable(state)) { if (recursive) { startOwnedServices(startStrategy); } return; } boolean shouldStartRecursive = false; lock("start"); try { // update the recursive flag this.recursive = this.recursive || recursive; Throwable startError = null; try { // // Loop until all start conditions have been satified. The start strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to start? if (!verifyStartable(state)) { // assume someone else called startOwnedServices return; } // if we are in the STOPPED state, we need to move to the STARTING state if (state == ServiceState.STOPPED) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the startConditions. This allows other code to assure the service is in the correct state before // adding a startCondition. synchronized (serviceFactory) { state = ServiceState.STARTING; startConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock); } // we are now officially starting serviceMonitor.serviceStarting(createServiceEvent()); // initialize the start conditions startConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = startConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (startStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop startConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStart(createWaitingServiceEvent(unsatisfiedConditions)); return; } } } // we are ready to create the service service = serviceFactory.createService(standardServiceContext); // success transition to running startTime = System.currentTimeMillis(); state = ServiceState.RUNNING; serviceMonitor.serviceRunning(createServiceEvent()); // should we recursively start our children shouldStartRecursive = this.recursive || recursive; this.recursive = false; } catch (UnsatisfiedConditionsException e) { // thrown from waitForUnsatisfiedConditions throw e; } catch (IllegalServiceStateException e) { // this can be thrown while awaiting satisfaction throw e; } catch (Exception e) { startError = e; } catch (Error e) { startError = e; } if (startError != null) { try { if (startError instanceof UnregisterServiceException) { throw (UnregisterServiceException) startError; } else { // the strategy will normally rethrow the startError, but if it doesn't notify the service monitor startStrategy.startError(serviceName, startError); serviceMonitor.serviceStartError(createErrorServiceEvent(startError)); } } finally { // we are now STOPPING state = ServiceState.STOPPING; serviceMonitor.serviceStopping(createServiceEvent()); // clean up the conditons destroyAllConditions(serviceMonitor); // transition to the STOPPED state service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } } } finally { unlock(); } // startRecursive all of the owned services if (shouldStartRecursive) { startOwnedServices(startStrategy); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
if (stopConditions == null) { synchronized (serviceFactory) { state = ServiceState.STOPPING; stopConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStopConditions(), lock); } | if (stopCondition == null) { | public boolean stop(StopStrategy stopStrategy) throws UnsatisfiedConditionsException { // check that we aren't already stopped before attempting to acquire the lock ServiceState initialState = state; if (initialState == ServiceState.STOPPED) { return true; } lock("stop"); try { try { // // Loop until all stop conditions have been satified. The stop strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to stop? if (state == ServiceState.STOPPED) { return true; } // if we are not the STOPPING state, transition to it // we check on the stopConditions variable because non-restartable services preset this in the // intialization method if (stopConditions == null) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the stopConditions. This allows other code to assure the service is in the correct state before // adding a stopCondition. // todo broken synchronized (serviceFactory) { state = ServiceState.STOPPING; stopConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStopConditions(), lock); } serviceMonitor.serviceStopping(createServiceEvent()); // initialize all of the stop conditions stopConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = stopConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (stopStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop stopConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStop(createWaitingServiceEvent(unsatisfiedConditions)); return false; } } } } catch (UnsatisfiedConditionsException e) { throw e; } catch (ForcedStopException e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Exception e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Error e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } if (serviceFactory.isRestartable()) { try { // destroy the service serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } destroyAllConditions(serviceMonitor); service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } return true; } finally { unlock(); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
stopConditions.initialize(); | stopCondition = new AggregateCondition(kernel, serviceName, classLoader, lock, serviceFactory.getStopConditions()); stopCondition.initialize(); | public boolean stop(StopStrategy stopStrategy) throws UnsatisfiedConditionsException { // check that we aren't already stopped before attempting to acquire the lock ServiceState initialState = state; if (initialState == ServiceState.STOPPED) { return true; } lock("stop"); try { try { // // Loop until all stop conditions have been satified. The stop strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to stop? if (state == ServiceState.STOPPED) { return true; } // if we are not the STOPPING state, transition to it // we check on the stopConditions variable because non-restartable services preset this in the // intialization method if (stopConditions == null) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the stopConditions. This allows other code to assure the service is in the correct state before // adding a stopCondition. // todo broken synchronized (serviceFactory) { state = ServiceState.STOPPING; stopConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStopConditions(), lock); } serviceMonitor.serviceStopping(createServiceEvent()); // initialize all of the stop conditions stopConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = stopConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (stopStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop stopConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStop(createWaitingServiceEvent(unsatisfiedConditions)); return false; } } } } catch (UnsatisfiedConditionsException e) { throw e; } catch (ForcedStopException e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Exception e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Error e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } if (serviceFactory.isRestartable()) { try { // destroy the service serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } destroyAllConditions(serviceMonitor); service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } return true; } finally { unlock(); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
Set unsatisfiedConditions = stopConditions.getUnsatisfied(); | Set unsatisfiedConditions = stopCondition.getUnsatisfied(); | public boolean stop(StopStrategy stopStrategy) throws UnsatisfiedConditionsException { // check that we aren't already stopped before attempting to acquire the lock ServiceState initialState = state; if (initialState == ServiceState.STOPPED) { return true; } lock("stop"); try { try { // // Loop until all stop conditions have been satified. The stop strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to stop? if (state == ServiceState.STOPPED) { return true; } // if we are not the STOPPING state, transition to it // we check on the stopConditions variable because non-restartable services preset this in the // intialization method if (stopConditions == null) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the stopConditions. This allows other code to assure the service is in the correct state before // adding a stopCondition. // todo broken synchronized (serviceFactory) { state = ServiceState.STOPPING; stopConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStopConditions(), lock); } serviceMonitor.serviceStopping(createServiceEvent()); // initialize all of the stop conditions stopConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = stopConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (stopStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop stopConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStop(createWaitingServiceEvent(unsatisfiedConditions)); return false; } } } } catch (UnsatisfiedConditionsException e) { throw e; } catch (ForcedStopException e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Exception e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Error e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } if (serviceFactory.isRestartable()) { try { // destroy the service serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } destroyAllConditions(serviceMonitor); service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } return true; } finally { unlock(); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
stopConditions.awaitSatisfaction(); | stopCondition.awaitSatisfaction(); | public boolean stop(StopStrategy stopStrategy) throws UnsatisfiedConditionsException { // check that we aren't already stopped before attempting to acquire the lock ServiceState initialState = state; if (initialState == ServiceState.STOPPED) { return true; } lock("stop"); try { try { // // Loop until all stop conditions have been satified. The stop strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to stop? if (state == ServiceState.STOPPED) { return true; } // if we are not the STOPPING state, transition to it // we check on the stopConditions variable because non-restartable services preset this in the // intialization method if (stopConditions == null) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the stopConditions. This allows other code to assure the service is in the correct state before // adding a stopCondition. // todo broken synchronized (serviceFactory) { state = ServiceState.STOPPING; stopConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStopConditions(), lock); } serviceMonitor.serviceStopping(createServiceEvent()); // initialize all of the stop conditions stopConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = stopConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (stopStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop stopConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStop(createWaitingServiceEvent(unsatisfiedConditions)); return false; } } } } catch (UnsatisfiedConditionsException e) { throw e; } catch (ForcedStopException e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Exception e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Error e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } if (serviceFactory.isRestartable()) { try { // destroy the service serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } destroyAllConditions(serviceMonitor); service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } return true; } finally { unlock(); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
try { serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); | if (service != null) { try { serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } | public boolean stop(StopStrategy stopStrategy) throws UnsatisfiedConditionsException { // check that we aren't already stopped before attempting to acquire the lock ServiceState initialState = state; if (initialState == ServiceState.STOPPED) { return true; } lock("stop"); try { try { // // Loop until all stop conditions have been satified. The stop strategy can break this loop. // boolean satisfied = false; while (!satisfied) { // do we still want to stop? if (state == ServiceState.STOPPED) { return true; } // if we are not the STOPPING state, transition to it // we check on the stopConditions variable because non-restartable services preset this in the // intialization method if (stopConditions == null) { // Grab a synchronized lock on the service factory before changing state and getting a snapshot of // the stopConditions. This allows other code to assure the service is in the correct state before // adding a stopCondition. // todo broken synchronized (serviceFactory) { state = ServiceState.STOPPING; stopConditions = new AggregateConditions(kernel, serviceName, classLoader, serviceFactory.getStopConditions(), lock); } serviceMonitor.serviceStopping(createServiceEvent()); // initialize all of the stop conditions stopConditions.initialize(); } // are we satisfied? Set unsatisfiedConditions = stopConditions.getUnsatisfied(); satisfied = unsatisfiedConditions.isEmpty(); if (!satisfied) { // if the stragegy wants us to wait for conditions to be satisfied, it will return true if (stopStrategy.waitForUnsatisfiedConditions(serviceName, unsatisfiedConditions)) { // wait for satisfaction and loop stopConditions.awaitSatisfaction(); } else { // no wait, notify the monitor and exit serviceMonitor.serviceWaitingToStop(createWaitingServiceEvent(unsatisfiedConditions)); return false; } } } } catch (UnsatisfiedConditionsException e) { throw e; } catch (ForcedStopException e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Exception e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } catch (Error e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } if (serviceFactory.isRestartable()) { try { // destroy the service serviceFactory.destroyService(standardServiceContext); } catch (Throwable e) { serviceMonitor.serviceStopError(createErrorServiceEvent(e)); } destroyAllConditions(serviceMonitor); service = null; startTime = 0; state = ServiceState.STOPPED; serviceMonitor.serviceStopped(createServiceEvent()); } return true; } finally { unlock(); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/e4a9cb81c5b1bfeb724fd5cb9f7325ab7867ae4b/ServiceManager.java/buggy/kernel/src/java/org/gbean/kernel/standard/ServiceManager.java |
this.iterator = new ArrayList(references).iterator(); prefetch(); | synchronized(references) { iterator = new ArrayList(references).iterator(); prefetch(); } | public ObjectSpaceIterator(RubyModule rubyClass) { this.rubyClass = rubyClass; this.iterator = new ArrayList(references).iterator(); prefetch(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e83dbfadcac8b3a15bf326de9a826209fe49c87c/ObjectSpace.java/clean/src/org/jruby/runtime/ObjectSpace.java |
return "Project"+(projectId==null ? ":Hash"+this.hashCode() : ":"+projectId); | return "Project"+(projectId==null ? ":Hash_"+this.hashCode() : ":Id_"+projectId); | public String toString(){ return "Project"+(projectId==null ? ":Hash"+this.hashCode() : ":"+projectId); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51a3c546dfc7a7a98b29771a459df19094fc5b51/Project.java/buggy/components/common/src/ome/model/Project.java |
for(Iterator iter = groupModels.iterator(); iter.hasNext();) | GroupModel[] models = groupingMethod.getGroups(); for(int i=0;i<models.length;i++) | public void clearThumbnails() { thumbnailSet.clear(); for(Iterator iter = groupModels.iterator(); iter.hasNext();) { GroupModel group = (GroupModel)iter.next(); group.clearThumbnails(); } updateModelListeners(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f82d914fe97ef0c74bef944bf12ae4961776c814/BrowserModel.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/BrowserModel.java |
GroupModel group = (GroupModel)iter.next(); group.clearThumbnails(); | models[i].clearThumbnails(); | public void clearThumbnails() { thumbnailSet.clear(); for(Iterator iter = groupModels.iterator(); iter.hasNext();) { GroupModel group = (GroupModel)iter.next(); group.clearThumbnails(); } updateModelListeners(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f82d914fe97ef0c74bef944bf12ae4961776c814/BrowserModel.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/BrowserModel.java |
groupModels = Arrays.asList(groupingMethod.getGroups()); | defaultGroupingMethod = groupingMethod; | private void init() { env = BrowserEnvironment.getInstance(); progressListeners = new HashSet(); modelListeners = new HashSet(); selectedThumbnails = new HashSet(); attributeMap = new AttributeMap(); groupingMethod = new SingleGroupingMethod(); groupModels = Arrays.asList(groupingMethod.getGroups()); thumbnailSet = new HashSet(); imageIDMap = new HashMap(); annotationModel = new PaintMethodZOrder(); modeClassMap = new HashMap(); availableTypesList = new ArrayList(); categoryTree = new CategoryTree(); // empty category tree. panActionClass = new BrowserModeClass(PAN_MODE_NAME, new BrowserMode[] { BrowserMode.DEFAULT_MODE, BrowserMode.HAND_MODE}, BrowserMode.DEFAULT_MODE); majorUIModeClass = new BrowserModeClass(MAJOR_UI_MODE_NAME, new BrowserMode[] { BrowserMode.DEFAULT_MODE, BrowserMode.ANNOTATE_MODE, BrowserMode.CLASSIFY_MODE, BrowserMode.GRAPH_MODE}, BrowserMode.DEFAULT_MODE); selectModeClass = new BrowserModeClass(SELECT_MODE_NAME, new BrowserMode[] { BrowserMode.UNSELECTED_MODE, BrowserMode.SELECTING_MODE, BrowserMode.SELECTED_MODE}, BrowserMode.UNSELECTED_MODE); zoomModeClass = new BrowserModeClass(ZOOM_MODE_NAME, new BrowserMode[] { BrowserMode.ZOOM_TO_FIT_MODE, BrowserMode.ZOOM_50_MODE, BrowserMode.ZOOM_75_MODE, BrowserMode.ZOOM_ACTUAL_MODE, BrowserMode.ZOOM_200_MODE}, BrowserMode.ZOOM_TO_FIT_MODE); semanticModeClass = new BrowserModeClass(SEMANTIC_MODE_NAME, new BrowserMode[] { BrowserMode.NOOP_MODE, BrowserMode.IMAGE_NAME_MODE, BrowserMode.SEMANTIC_ZOOMING_MODE}, BrowserMode.SEMANTIC_ZOOMING_MODE); modeClassMap.put(PAN_MODE_NAME,panActionClass); modeClassMap.put(MAJOR_UI_MODE_NAME,majorUIModeClass); modeClassMap.put(SELECT_MODE_NAME,selectModeClass); modeClassMap.put(ZOOM_MODE_NAME,zoomModeClass); modeClassMap.put(SEMANTIC_MODE_NAME,semanticModeClass); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f82d914fe97ef0c74bef944bf12ae4961776c814/BrowserModel.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/BrowserModel.java |
fireModelUpdated(); | public void setCategoryTree(CategoryTree tree) { this.categoryTree = tree; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f82d914fe97ef0c74bef944bf12ae4961776c814/BrowserModel.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/BrowserModel.java |
|
Thumbnail[] ts = new Thumbnail[thumbnailSet.size()]; thumbnailSet.toArray(ts); gm.assignGroups(ts); | public void setGroupingMethod(GroupingMethod gm) { // TODO: reestablish groups, likely if(gm != null) { this.groupingMethod = gm; updateModelListeners(); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f82d914fe97ef0c74bef944bf12ae4961776c814/BrowserModel.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/BrowserModel.java |
|
{ int index = Integer.parseInt(e.getActionCommand()); try { switch (index) { case T_FIELD_CMD: tFieldActionHandler(); break; case Z_FIELD_CMD: zFieldActionHandler(); break; case RENDER_CMD: control.showRendering(); break; case INSPECTOR_CMD: control.showInspector(); break; case SAVEAS_CMD: control.showImageSaver(); break; case VIEWER3D_CMD: control.showImage3DViewer(); break; | { int index = Integer.parseInt(e.getActionCommand()); try { switch (index) { case T_FIELD_CMD: tFieldActionHandler(); break; case Z_FIELD_CMD: zFieldActionHandler(); break; case RENDER_CMD: control.showRendering(); break; case INSPECTOR_CMD: control.showInspector(); break; case SAVEAS_CMD: control.showImageSaver(); break; case VIEWER3D_CMD: control.showImage3DViewer(); break; | public void actionPerformed(ActionEvent e) { int index = Integer.parseInt(e.getActionCommand()); try { switch (index) { case T_FIELD_CMD: tFieldActionHandler(); break; case Z_FIELD_CMD: zFieldActionHandler(); break; case RENDER_CMD: control.showRendering(); break; case INSPECTOR_CMD: control.showInspector(); break; case SAVEAS_CMD: control.showImageSaver(); break; case VIEWER3D_CMD: control.showImage3DViewer(); break; case MOVIE_CMD: control.showMovie(); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ToolBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/ToolBarManager.java |
control.showMovie(); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } } | control.showMovie(); break; case ROI_CMD: control.showROI(); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } } | public void actionPerformed(ActionEvent e) { int index = Integer.parseInt(e.getActionCommand()); try { switch (index) { case T_FIELD_CMD: tFieldActionHandler(); break; case Z_FIELD_CMD: zFieldActionHandler(); break; case RENDER_CMD: control.showRendering(); break; case INSPECTOR_CMD: control.showInspector(); break; case SAVEAS_CMD: control.showImageSaver(); break; case VIEWER3D_CMD: control.showImage3DViewer(); break; case MOVIE_CMD: control.showMovie(); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ToolBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/ToolBarManager.java |
{ String tVal = view.getTField().getText(), t = ""+curT; String zVal = view.getZField().getText(), z = ""+curZ; if (tVal == null || !tVal.equals(t)) view.getTField().setText(t); if (zVal == null || !zVal.equals(z)) view.getZField().setText(z); } | { String tVal = view.getTField().getText(), t = ""+curT; String zVal = view.getZField().getText(), z = ""+curZ; if (tVal == null || !tVal.equals(t)) view.getTField().setText(t); if (zVal == null || !zVal.equals(z)) view.getZField().setText(z); } | public void focusLost(FocusEvent e) { String tVal = view.getTField().getText(), t = ""+curT; String zVal = view.getZField().getText(), z = ""+curZ; if (tVal == null || !tVal.equals(t)) view.getTField().setText(t); if (zVal == null || !zVal.equals(z)) view.getZField().setText(z); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ToolBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/ToolBarManager.java |
{ boolean valid = false; int val = 0; try { val = Integer.parseInt(view.getTField().getText()); if (0 <= val && val <= maxT) valid = true; } catch(NumberFormatException nfe) {} if (valid) { curT = val; control.onTChange(curZ, curT); } else { view.getTField().selectAll(); UserNotifier un = control.getRegistry().getUserNotifier(); un.notifyInfo("Invalid timepoint", "Please enter a timepoint between 0 and "+maxT); } } | { boolean valid = false; int val = 0; try { val = Integer.parseInt(view.getTField().getText()); if (0 <= val && val <= maxT) valid = true; } catch(NumberFormatException nfe) {} if (valid) { curT = val; control.onTChange(curZ, curT); } else { view.getTField().selectAll(); UserNotifier un = control.getRegistry().getUserNotifier(); un.notifyInfo("Invalid timepoint", "Please enter a timepoint between 0 and "+maxT); } } | private void tFieldActionHandler() { boolean valid = false; int val = 0; try { val = Integer.parseInt(view.getTField().getText()); if (0 <= val && val <= maxT) valid = true; } catch(NumberFormatException nfe) {} if (valid) { curT = val; control.onTChange(curZ, curT); } else { view.getTField().selectAll(); UserNotifier un = control.getRegistry().getUserNotifier(); un.notifyInfo("Invalid timepoint", "Please enter a timepoint between 0 and "+maxT); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ToolBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/ToolBarManager.java |
{ boolean valid = false; int val = 0; try { val = Integer.parseInt(view.getZField().getText()); if (0 <= val && val <= maxZ) valid = true; } catch(NumberFormatException nfe) {} if (valid) { curZ = val; control.onZChange(curZ, curT); } else { view.getZField().selectAll(); UserNotifier un = control.getRegistry().getUserNotifier(); un.notifyInfo("Invalid z-section", "Please enter a z-section between 0 and "+maxZ); } } | { boolean valid = false; int val = 0; try { val = Integer.parseInt(view.getZField().getText()); if (0 <= val && val <= maxZ) valid = true; } catch(NumberFormatException nfe) {} if (valid) { curZ = val; control.onZChange(curZ, curT); } else { view.getZField().selectAll(); UserNotifier un = control.getRegistry().getUserNotifier(); un.notifyInfo("Invalid z-section", "Please enter a z-section between 0 and "+maxZ); } } | private void zFieldActionHandler() { boolean valid = false; int val = 0; try { val = Integer.parseInt(view.getZField().getText()); if (0 <= val && val <= maxZ) valid = true; } catch(NumberFormatException nfe) {} if (valid) { curZ = val; control.onZChange(curZ, curT); } else { view.getZField().selectAll(); UserNotifier un = control.getRegistry().getUserNotifier(); un.notifyInfo("Invalid z-section", "Please enter a z-section between 0 and "+maxZ); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ToolBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/ToolBarManager.java |
SpotsTrajectoryEntry pt = traj.getPoint(i); pts[i] = extents.calculatePoint(pt); | SpotsTrajectoryEntry pt = traj.getPoint(i); pts[i] = extents.calculatePoint(pt); | public LineGeometry(SpotsTrajectory t,Extents extents) { super(t.getLength(),GeometryArray.COORDINATES,new int[] {t.getLength()}); this.traj=t; this.extents = extents; // set coordinates pts = new Point3d[t.getLength()]; for (int i = 0; i < t.getLength(); i++) { SpotsTrajectoryEntry pt = traj.getPoint(i); pts[i] = extents.calculatePoint(pt); } // setCapability(GeometryArray.ALLOW_COORDINATE_READ); setCapability(GeometryArray.ALLOW_COORDINATE_WRITE); setCapability(GeometryArray.ALLOW_REF_DATA_READ); setCapability(GeometryArray.ALLOW_REF_DATA_WRITE); setCapability(GeometryArray.ALLOW_INTERSECT); setCapability(Primitive.ENABLE_GEOMETRY_PICKING); setCoordinates(0,pts); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c6da99e2ef56fe4fd5b8aaa3b3a9610e91ee0ba/LineGeometry.java/clean/SRC/org/openmicroscopy/shoola/agents/spots/ui/java3d/LineGeometry.java |
Point p = new Point(e.getPoint()); view.resetLens(); if (!dragging && onOff && drawingArea.contains(p)) { dragging = true; drawLens(p); } | if (e.getClickCount() == 1 && click) { Point p = new Point(e.getPoint()); view.resetLens(); if (!dragging && onOff && drawingArea.contains(p)) { dragging = true; drawLens(p); } } else if (e.getClickCount() == 2 && !click) control.showInspector(); | public void mousePressed(MouseEvent e) { Point p = new Point(e.getPoint()); view.resetLens(); if (!dragging && onOff && drawingArea.contains(p)) { dragging = true; drawLens(p); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/637cfc480ca0f34d360e30b6cf903cef502fa8dc/ImageCanvasMng.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/canvas/ImageCanvasMng.java |
{ this.view = view; | { this.view = view; | public ImageInspectorManager(ImageInspector view, ViewerCtrl control, double magFactor) { this.view = view; this.control = control; curZoomLevel = magFactor; attachListener(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a2f4cd0a125d188c1e246cd85608e59a51e3d85c/ImageInspectorManager.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspectorManager.java |
curZoomLevel = magFactor; attachListener(); } | curZoomLevel = magFactor; attachListener(); } | public ImageInspectorManager(ImageInspector view, ViewerCtrl control, double magFactor) { this.view = view; this.control = control; curZoomLevel = magFactor; attachListener(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a2f4cd0a125d188c1e246cd85608e59a51e3d85c/ImageInspectorManager.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspectorManager.java |
{ view.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { onClosing(); } }); } | { view.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { onClosing(); } }); } | private void attachListener() { view.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { onClosing(); } }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a2f4cd0a125d188c1e246cd85608e59a51e3d85c/ImageInspectorManager.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspectorManager.java |
control.setMagFactor(curZoomLevel); | canvas.resetLens(); canvas.repaint(); | private void onClosing() { control.setMagFactor(curZoomLevel); view.dispose(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a2f4cd0a125d188c1e246cd85608e59a51e3d85c/ImageInspectorManager.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspectorManager.java |
{ imageWidth = width; imageHeight = height; } | { imageWidth = width; imageHeight = height; } | void setImageDimension(int width, int height) { imageWidth = width; imageHeight = height; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a2f4cd0a125d188c1e246cd85608e59a51e3d85c/ImageInspectorManager.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspectorManager.java |
{ if (curZoomLevel != level) { zoom(level); curZoomLevel = level; } } | { if (curZoomLevel != level) { curZoomLevel = level; zoom(level); } } | public void setZoomLevel(double level) { if (curZoomLevel != level) { zoom(level); curZoomLevel = level; } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a2f4cd0a125d188c1e246cd85608e59a51e3d85c/ImageInspectorManager.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspectorManager.java |
{ ZoomBar zoomBar = view.toolBar.getZoomBar(); zoomBar.getManager().setText(level); ZoomMenu zoomMenu = view.menuBar.getZoomMenu(); zoomMenu.getManager().setItemSelected(level); int w = (int) (imageWidth*level)+2*ViewerUIF.START; | { ZoomBar zoomBar = view.toolBar.getZoomBar(); zoomBar.getManager().setText(level); ZoomMenu zoomMenu = view.menuBar.getZoomMenu(); zoomMenu.getManager().setItemSelected(level); int w = (int) (imageWidth*level)+2*ViewerUIF.START; | private void zoom(double level) { ZoomBar zoomBar = view.toolBar.getZoomBar(); zoomBar.getManager().setText(level); ZoomMenu zoomMenu = view.menuBar.getZoomMenu(); zoomMenu.getManager().setItemSelected(level); int w = (int) (imageWidth*level)+2*ViewerUIF.START; int h = (int) (imageHeight*level)+2*ViewerUIF.START; control.setSizePaintedComponents(new Dimension(w, h)); canvas.paintImage(level, w, h); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a2f4cd0a125d188c1e246cd85608e59a51e3d85c/ImageInspectorManager.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspectorManager.java |
canvas.paintImage(level, w, h); } | control.setMagFactor(level); canvas.paintImage(level, w, h); } | private void zoom(double level) { ZoomBar zoomBar = view.toolBar.getZoomBar(); zoomBar.getManager().setText(level); ZoomMenu zoomMenu = view.menuBar.getZoomMenu(); zoomMenu.getManager().setItemSelected(level); int w = (int) (imageWidth*level)+2*ViewerUIF.START; int h = (int) (imageHeight*level)+2*ViewerUIF.START; control.setSizePaintedComponents(new Dimension(w, h)); canvas.paintImage(level, w, h); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a2f4cd0a125d188c1e246cd85608e59a51e3d85c/ImageInspectorManager.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/transform/ImageInspectorManager.java |
sb.append("-----------------------------\n"); | sb.append("\n-----------------------------\n"); | public static String summary(Object a) { Map count = new HashMap(); StringBuffer sb = new StringBuffer(summary(a, "\n", count)); sb.append("-----------------------------\n"); for (Iterator i = count.keySet().iterator(); i.hasNext();) { Class c = (Class) i.next(); Set set = (Set) count.get(c); sb.append(set.size()); sb.append("\t"); sb.append(c); sb.append("\n"); } return sb.toString(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fe14dc19a3cb8aef0082070000d68b42a88ac770/ComparisonUtils.java/clean/components/test/src/org/openmicroscopy/omero/itests/ComparisonUtils.java |
else if (e instanceof AnnotateROI) handleAnnotateROI((AnnotateROI) e); | public void eventFired(AgentEvent e) { if (e instanceof ImageLoaded) handleImageLoaded((ImageLoaded) e); else if (e instanceof ImageRendered) handleImageRendered((ImageRendered) e); else if (e instanceof LoadImage) handleLoadImage((LoadImage) e); else if (e instanceof AddROICanvas) handleAddROI((AddROICanvas) e); //else if (e instanceof DisplayViewer3D) // handleDisplayViewer3D((DisplayViewer3D) e); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ff5419c429a530b7d53a76f42ded518c0b34b986/Viewer.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/Viewer.java |
|
bus.register(this, AnnotateROI.class); | public void setContext(Registry ctx) { registry = ctx; EventBus bus = registry.getEventBus(); bus.register(this, LoadImage.class); bus.register(this, ImageLoaded.class); bus.register(this, ImageRendered.class); bus.register(this, AddROICanvas.class); //bus.register(this, DisplayViewer3D.class); control = new ViewerCtrl(this); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ff5419c429a530b7d53a76f42ded518c0b34b986/Viewer.java/clean/SRC/org/openmicroscopy/shoola/agents/viewer/Viewer.java |
|
setResult(raisedException); | flushResults(); | private void handleRaise(JumpException je) { RaiseException re = (RaiseException)je; RubyException raisedException = re.getException(); setResult(raisedException); // TODO: Rubicon TestKernel dies without this line. A cursory glance implies we // falsely set $! to nil and this sets it back to something valid. This should // get fixed at the same time we address bug #1296484. runtime.getGlobalVariables().set("$!", raisedException); // FIXME: don't use the raise rethrower; work with the exception rethrower like all other handlers do // pop everything but nearest rescuable while (!(getCurrentInstructionStack() == null || getCurrentInstructionStack().rescuable)) { InstructionBundle ib = getCurrentInstructionStack(); if (ib.ensured) { // exec ensured node, return to "breaking" afterwards popCurrentInstruction(); setCurrentException(je); addInstruction(ib.instructionContext, raiseRethrower); addInstructionBundle(ib); return; } popCurrentInstruction(); } if (getCurrentInstructionStack() == null ) { // no rescuers, throw exception to next level throw re; } // we're at rescuer now RescueNode iVisited = (RescueNode)getCurrentInstructionStack().instructionContext; popCurrentInstruction(); RescueBodyNode rescueBodyNode = iVisited.getRescueNode(); while (rescueBodyNode != null) { Node exceptionNodes = rescueBodyNode.getExceptionNodes(); ListNode exceptionNodesList; // need to make these iterative if (exceptionNodes instanceof SplatNode) { exceptionNodesList = (ListNode) begin(exceptionNodes); } else { exceptionNodesList = (ListNode) exceptionNodes; } if (isRescueHandled(raisedException, exceptionNodesList)) { addRetriableInstruction(iVisited); addNodeInstruction(rescueBodyNode); setCurrentException(null); clearResult(); return; } rescueBodyNode = rescueBodyNode.getOptRescueNode(); } // no takers; bubble up throw je; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/35eebc6cb762fe7b3d83365ecc69052bd0c8e5d4/EvaluationState.java/clean/src/org/jruby/evaluator/EvaluationState.java |
public void initLoad(ArrayList ioAdditionalDirectory) { // don't know what this is used for in MRI, it holds the handle of all loaded libs // ruby_dln_librefs = rb_ary_new(); //in MRI the ruby installation path is determined from the place where the ruby lib is found //of course we can't do that, let's just use the jruby.home property String lRubyHome = System.getProperty("jruby.home"); String lRubyLib = System.getProperty("jruby.lib", lRubyHome + File.separatorChar + "lib"); for (int i = ioAdditionalDirectory.size() - 1; i >= 0; i--) { ioAdditionalDirectory.set(i, new RubyString(this, (String) ioAdditionalDirectory.get(i))); } if (lRubyLib != null && lRubyLib.length() != 0) { ioAdditionalDirectory.add(new RubyString(this, lRubyLib)); } if (lRubyHome != null && lRubyHome.length() != 0) { //FIXME: use the version number in some other way than hardcoded here String lRuby = lRubyHome + File.separatorChar + "lib" + File.separatorChar + "ruby" + File.separatorChar; String lSiteRuby = lRuby + "site_ruby"; String lSiteRubyVersion = lSiteRuby + File.separatorChar + RUBY_VERSION; String lArch = File.separatorChar + "JAVA"; String lRubyVersion = lRuby + RUBY_VERSION; ioAdditionalDirectory.add(new RubyString(this, lSiteRubyVersion)); ioAdditionalDirectory.add(new RubyString(this, lSiteRubyVersion + lArch)); ioAdditionalDirectory.add(new RubyString(this, lSiteRuby)); ioAdditionalDirectory.add(new RubyString(this, lRubyVersion)); ioAdditionalDirectory.add(new RubyString(this, lRubyVersion + lArch)); } //FIXME: safe level pb here ioAdditionalDirectory.add(new RubyString(this, ".")); RubyArray rb_load_path = new RubyArray(this, ioAdditionalDirectory); defineReadonlyVariable("$:", rb_load_path); defineReadonlyVariable("$-I", rb_load_path); defineReadonlyVariable("$LOAD_PATH", rb_load_path); RubyArray rb_features = new RubyArray(this); defineReadonlyVariable("$\"", rb_features); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/774c5d3d592dfd020e3a8f961b73f629c4c55cf0/Ruby.java/clean/org/jruby/Ruby.java |
||
String lRubyLib = System.getProperty("jruby.lib", lRubyHome + File.separatorChar + "lib"); | String lRubyLib = System.getProperty("jruby.lib"); /*if (lRubyLib == null && lRubyHome != null && lRubyHome.length() != 0) { lRubyLib = lRubyHome + File.separatorChar + "lib"; }*/ | public void initLoad(ArrayList ioAdditionalDirectory) { // don't know what this is used for in MRI, it holds the handle of all loaded libs // ruby_dln_librefs = rb_ary_new(); //in MRI the ruby installation path is determined from the place where the ruby lib is found //of course we can't do that, let's just use the jruby.home property String lRubyHome = System.getProperty("jruby.home"); String lRubyLib = System.getProperty("jruby.lib", lRubyHome + File.separatorChar + "lib"); for (int i = ioAdditionalDirectory.size() - 1; i >= 0; i--) { ioAdditionalDirectory.set(i, new RubyString(this, (String) ioAdditionalDirectory.get(i))); } if (lRubyLib != null && lRubyLib.length() != 0) { ioAdditionalDirectory.add(new RubyString(this, lRubyLib)); } if (lRubyHome != null && lRubyHome.length() != 0) { //FIXME: use the version number in some other way than hardcoded here String lRuby = lRubyHome + File.separatorChar + "lib" + File.separatorChar + "ruby" + File.separatorChar; String lSiteRuby = lRuby + "site_ruby"; String lSiteRubyVersion = lSiteRuby + File.separatorChar + RUBY_VERSION; String lArch = File.separatorChar + "JAVA"; String lRubyVersion = lRuby + RUBY_VERSION; ioAdditionalDirectory.add(new RubyString(this, lSiteRubyVersion)); ioAdditionalDirectory.add(new RubyString(this, lSiteRubyVersion + lArch)); ioAdditionalDirectory.add(new RubyString(this, lSiteRuby)); ioAdditionalDirectory.add(new RubyString(this, lRubyVersion)); ioAdditionalDirectory.add(new RubyString(this, lRubyVersion + lArch)); } //FIXME: safe level pb here ioAdditionalDirectory.add(new RubyString(this, ".")); RubyArray rb_load_path = new RubyArray(this, ioAdditionalDirectory); defineReadonlyVariable("$:", rb_load_path); defineReadonlyVariable("$-I", rb_load_path); defineReadonlyVariable("$LOAD_PATH", rb_load_path); RubyArray rb_features = new RubyArray(this); defineReadonlyVariable("$\"", rb_features); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/774c5d3d592dfd020e3a8f961b73f629c4c55cf0/Ruby.java/clean/org/jruby/Ruby.java |
menuItems.add(item); | private JMenu createEditMenu() { JMenu menu = new JMenu("Edit"); menu.setMnemonic(KeyEvent.VK_E); menu.add(new JMenuItem( controller.getAction(TreeViewerControl.CUT_OBJECT))); menu.add(new JMenuItem( controller.getAction(TreeViewerControl.COPY_OBJECT))); menu.add(new JMenuItem( controller.getAction(TreeViewerControl.PASTE_OBJECT))); menu.add(new JMenuItem( controller.getAction(TreeViewerControl.DELETE_OBJECT))); menu.add(new JSeparator(JSeparator.HORIZONTAL)); menu.add(new JMenuItem( controller.getAction(TreeViewerControl.FIND))); menu.add(new JMenuItem( controller.getAction(TreeViewerControl.CLEAR))); menu.add(new JSeparator(JSeparator.HORIZONTAL)); menu.add(new JMenuItem( controller.getAction(TreeViewerControl.CLASSIFY))); TreeViewerAction a = controller.getAction(TreeViewerControl.ANNOTATE); JMenuItem item = new JMenuItem(a); item.setText(a.getActionName()); menu.add(item); menu.add(new JSeparator(JSeparator.HORIZONTAL)); a = controller.getAction(TreeViewerControl.PROPERTIES); item = new JMenuItem(a); item.setText(a.getActionName()); menu.add(item); return menu; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/146920a8791fff71320ced0f240b9d8f3d319a13/TreeViewerWin.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerWin.java |
|
menuItems.add(item); | private JMenu createFileMenu() { JMenu menu = new JMenu("File"); menu.setMnemonic(KeyEvent.VK_F); TreeViewerAction a = controller.getAction( TreeViewerControl.CREATE_TOP_CONTAINER); JMenuItem item = new JMenuItem(a); item.setText(a.getActionName()); menu.add(item); menu.add(new JMenuItem( controller.getAction(TreeViewerControl.CREATE_OBJECT))); menu.add(createRootMenu()); menu.add(new JSeparator(JSeparator.HORIZONTAL)); a = controller.getAction(TreeViewerControl.VIEW); item = new JMenuItem(a); item.setText(a.getActionName()); menu.add(item); menu.add(new JMenuItem( controller.getAction(TreeViewerControl.REFRESH_TREE))); menu.add(new JSeparator(JSeparator.HORIZONTAL)); menu.add(new JMenuItem( controller.getAction(TreeViewerControl.EXIT))); return menu; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/146920a8791fff71320ced0f240b9d8f3d319a13/TreeViewerWin.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerWin.java |
|
public BlockBuilder parseBlock(String name, Reader in) throws ParseException, IOException { BlockBuilder bb = new BlockBuilder(); char buf[] = new char[512]; int num; ByteArrayOutputStream os = new ByteArrayOutputStream(256); FastWriter fw = new FastWriter(os, "UTF8"); while ((num = in.read(buf)) != -1) { fw.write(buf,0,num); } fw.flush(); bb.addElement(os.toString("UTF8")); in.close(); return bb; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/9dc4324fb914abcbf2ec188e4eb77b1bf503f330/TextParser.java/buggy/webmacro/src/org/webmacro/engine/TextParser.java |
||
workspace.getWorkspacePane().addTab("Contacts", SparkRes.getImageIcon(SparkRes.SMALL_ALL_CHATS_IMAGE), this); | workspace.getWorkspacePane().addTab(Res.getString("tab.contacts"), SparkRes.getImageIcon(SparkRes.SMALL_ALL_CHATS_IMAGE), this); | private void addContactListToWorkspace() { Workspace workspace = SparkManager.getWorkspace(); workspace.getWorkspacePane().addTab("Contacts", SparkRes.getImageIcon(SparkRes.SMALL_ALL_CHATS_IMAGE), this); //NOTRANS // Add To Contacts Menu final JMenu contactsMenu = SparkManager.getMainWindow().getMenuByName("Contacts"); JMenuItem addContactsMenu = new JMenuItem("", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); ResourceUtils.resButton(addContactsMenu, "&Add Contact"); ResourceUtils.resButton(addContactGroupMenu, "Add Contact &Group"); contactsMenu.add(addContactsMenu); contactsMenu.add(addContactGroupMenu); addContactsMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); addContactGroupMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), Res.getString("message.name.of.group") + ":", Res.getString("title.add.new.group"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); contactGroup.setVisible(true); validateTree(); repaint(); } } } }); // Add Toggle Contacts Menu ResourceUtils.resButton(showHideMenu, Res.getString("menuitem.show.empty.groups")); contactsMenu.add(showHideMenu); showHideMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(showHideMenu.isSelected()); } }); // Initialize vcard support SparkManager.getVCardManager(); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/14ea39b618da081c2691e108cef14b1883107986/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java |
final JMenu contactsMenu = SparkManager.getMainWindow().getMenuByName("Contacts"); | final JMenu contactsMenu = SparkManager.getMainWindow().getMenuByName(Res.getString("menuitem.contacts")); | private void addContactListToWorkspace() { Workspace workspace = SparkManager.getWorkspace(); workspace.getWorkspacePane().addTab("Contacts", SparkRes.getImageIcon(SparkRes.SMALL_ALL_CHATS_IMAGE), this); //NOTRANS // Add To Contacts Menu final JMenu contactsMenu = SparkManager.getMainWindow().getMenuByName("Contacts"); JMenuItem addContactsMenu = new JMenuItem("", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); ResourceUtils.resButton(addContactsMenu, "&Add Contact"); ResourceUtils.resButton(addContactGroupMenu, "Add Contact &Group"); contactsMenu.add(addContactsMenu); contactsMenu.add(addContactGroupMenu); addContactsMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); addContactGroupMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), Res.getString("message.name.of.group") + ":", Res.getString("title.add.new.group"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); contactGroup.setVisible(true); validateTree(); repaint(); } } } }); // Add Toggle Contacts Menu ResourceUtils.resButton(showHideMenu, Res.getString("menuitem.show.empty.groups")); contactsMenu.add(showHideMenu); showHideMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(showHideMenu.isSelected()); } }); // Initialize vcard support SparkManager.getVCardManager(); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/14ea39b618da081c2691e108cef14b1883107986/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java |
ResourceUtils.resButton(addContactsMenu, "&Add Contact"); ResourceUtils.resButton(addContactGroupMenu, "Add Contact &Group"); | ResourceUtils.resButton(addContactsMenu, Res.getString("menuitem.add.contact")); ResourceUtils.resButton(addContactGroupMenu, Res.getString("menuitem.add.contact.group")); | private void addContactListToWorkspace() { Workspace workspace = SparkManager.getWorkspace(); workspace.getWorkspacePane().addTab("Contacts", SparkRes.getImageIcon(SparkRes.SMALL_ALL_CHATS_IMAGE), this); //NOTRANS // Add To Contacts Menu final JMenu contactsMenu = SparkManager.getMainWindow().getMenuByName("Contacts"); JMenuItem addContactsMenu = new JMenuItem("", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); ResourceUtils.resButton(addContactsMenu, "&Add Contact"); ResourceUtils.resButton(addContactGroupMenu, "Add Contact &Group"); contactsMenu.add(addContactsMenu); contactsMenu.add(addContactGroupMenu); addContactsMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); addContactGroupMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), Res.getString("message.name.of.group") + ":", Res.getString("title.add.new.group"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); contactGroup.setVisible(true); validateTree(); repaint(); } } } }); // Add Toggle Contacts Menu ResourceUtils.resButton(showHideMenu, Res.getString("menuitem.show.empty.groups")); contactsMenu.add(showHideMenu); showHideMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(showHideMenu.isSelected()); } }); // Initialize vcard support SparkManager.getVCardManager(); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/14ea39b618da081c2691e108cef14b1883107986/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java |
private void attachListeners(JMenu menu) { menu.addMenuListener(new MenuListener() { /** Adds menu items when selected. */ public void menuSelected(MenuEvent e) { Object source = e.getSource(); if (source instanceof JMenu) createWindowsMenuItems((JMenu) source); } /** * Required by I/F but not actually needed in our case, * no op implementation. * @see MenuListener#menuCanceled(MenuEvent) */ public void menuCanceled(MenuEvent e) {} /** * Required by I/F but not actually needed in our case, * no op implementation. * @see MenuListener#menuDeselected(MenuEvent) */ public void menuDeselected(MenuEvent e) {} }); //Listen to keyboard selection menu.addMenuKeyListener(new MenuKeyListener() { /** Adds menu items when selected. */ public void menuKeyReleased(MenuKeyEvent e) { Object source = e.getSource(); if (source instanceof JMenu) createWindowsMenuItems((JMenu) source); } /** * Required by I/F but not actually needed in our case, * no op implementation. * @see MenuKeyListener#menuKeyPressed(MenuKeyEvent) */ public void menuKeyPressed(MenuKeyEvent e) {} /** * Required by I/F but not actually needed in our case, * no op implementation. * @see MenuKeyListener#menuKeyTyped(MenuKeyEvent) */ public void menuKeyTyped(MenuKeyEvent e) {} }); view.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); view.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { model.discard(); } }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/58be91fb535c971d0bef1fde12344382b140273b/HiViewerControl.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerControl.java |
||
if (!HiViewerFactory.isWindowMenuAttachedToTaskBar()) { attachListeners(HiViewerFactory.getWindowMenu()); HiViewerFactory.attachWindowMenuToTaskBar(); } | attachListeners(HiViewerFactory.getWindowMenu()); HiViewerFactory.attachWindowMenuToTaskBar(); | void initialize(HiViewerWin view) { if (view == null) throw new NullPointerException("No view."); this.view = view; historyState = -1; model.addChangeListener(this); if (!HiViewerFactory.isWindowMenuAttachedToTaskBar()) { attachListeners(HiViewerFactory.getWindowMenu()); HiViewerFactory.attachWindowMenuToTaskBar(); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/58be91fb535c971d0bef1fde12344382b140273b/HiViewerControl.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerControl.java |
if (null == p.getProjectId()) { | if (null == p.getProjectId()) { | static public ProjectData go(Project p, Map cache) { if (!ok(cache)) throw new IllegalArgumentException(cacheError); if (check(cache,p)) { return (ProjectData) from(cache, p); } ProjectData pd = new ProjectData(); to(cache, p, pd); if (null == p.getProjectId()) { // FIXME here NPE if (log.isDebugEnabled())log.debug(nullId+p); } else { pd.setID(p.getProjectId().intValue()); } pd.setName(p.getName()); pd.setDescription(p.getDescription()); if (null==p.getExperimenter()){ if (log.isDebugEnabled())log.debug(nullExp + p); } else { pd.setOwnerFirstName(p.getExperimenter().getFirstname()); } //TODO if (null==p.getDatasets()){ if (log.isDebugEnabled())log.debug(nullDs + p); } else { Set set = new HashSet(); for (Iterator i = p.getDatasets().iterator(); i.hasNext();) { Dataset d = (Dataset) i.next(); set.add(go(d,cache)); } pd.setDatasets(new ArrayList(set)); } return pd; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1399d9d073523c4fa809dbfe49c348c809f7d95c/AdapterUtils.java/buggy/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/AdapterUtils.java |
static void to(Map cache, Object key, Object value) { // FIXME Why are there NULLs in the Cache!!!! cache.put(key, value); // TODO return either original value or a new one -- tough. Not when all // inherit from a single DataObject!!?? } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1399d9d073523c4fa809dbfe49c348c809f7d95c/AdapterUtils.java/buggy/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/AdapterUtils.java |
||
static void to(Map cache, Object key, Object value) { // FIXME Why are there NULLs in the Cache!!!! cache.put(key, value); // TODO return either original value or a new one -- tough. Not when all // inherit from a single DataObject!!?? } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1399d9d073523c4fa809dbfe49c348c809f7d95c/AdapterUtils.java/buggy/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/AdapterUtils.java |
||
public String getChannelFamily(int w) { return rndDef.getChannel(w).getFamily(); //return servant.getChannelFamily(w).getValue(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2264b41cad5f5a8f753df78c8ae071e93710a6ec/RenderingControlProxy.java/buggy/SRC/org/openmicroscopy/shoola/env/rnd/RenderingControlProxy.java |
||
public String getModel() { return rndDef.getColorModel(); //return servant.getModel().getValue(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2264b41cad5f5a8f753df78c8ae071e93710a6ec/RenderingControlProxy.java/buggy/SRC/org/openmicroscopy/shoola/env/rnd/RenderingControlProxy.java |
||
ResourceUtils.resButton(incomingMessageBox, "&Play sound when new message arrives"); ResourceUtils.resButton(outgoingMessageBox, "&Play sound when a message is sent"); ResourceUtils.resButton(userOfflineCheckbox, "&Play sound when user goes offline"); | ResourceUtils.resButton(incomingMessageBox, "Play sound when new message &arrives"); ResourceUtils.resButton(outgoingMessageBox, "Play sound when a message is &sent"); ResourceUtils.resButton(userOfflineCheckbox, "Play sound when user goes &offline"); | public SoundPanel() { setLayout(new GridBagLayout()); // Add ResourceUtils ResourceUtils.resButton(incomingMessageBox, "&Play sound when new message arrives"); ResourceUtils.resButton(outgoingMessageBox, "&Play sound when a message is sent"); ResourceUtils.resButton(userOfflineCheckbox, "&Play sound when user goes offline"); ResourceUtils.resButton(incomingBrowseButton, "&Browse"); ResourceUtils.resButton(outgoingBrowseButton, "B&rowse"); ResourceUtils.resButton(offlineBrowseButton, "Br&owse"); // Handle incoming sounds add(incomingMessageBox, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(incomingMessageSound, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); add(incomingBrowseButton, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); // Handle sending sounds add(outgoingMessageBox, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(outgoingMessageSound, new GridBagConstraints(0, 3, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); add(outgoingBrowseButton, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); // Handle User Online Sound add(userOfflineCheckbox, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(userOfflineField, new GridBagConstraints(0, 5, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); add(offlineBrowseButton, new GridBagConstraints(1, 5, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); incomingBrowseButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { pickFile("Choose Incoming Sound File", incomingMessageSound); } }); outgoingBrowseButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { pickFile("Choose Outgoing Sound File", outgoingMessageSound); } }); offlineBrowseButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { pickFile("Choose Offline Sound File", userOfflineField); } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/731e3370b8b95169ecf820b7f8451a002d665c48/SoundPreference.java/buggy/src/java/org/jivesoftware/sparkimpl/preference/sounds/SoundPreference.java |
return argumentError; } | return argumentError; } | public RubyClass getArgumentError() { return argumentError; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
return fatal; } | return fatal; } | public RubyClass getFatal() { return fatal; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
return indexError; } | return indexError; } | public RubyClass getIndexError() { return indexError; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
return interrupt; } | return interrupt; } | public RubyClass getInterrupt() { return interrupt; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
return loadError; } | return loadError; } | public RubyClass getLoadError() { return loadError; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
return nameError; } | return nameError; } | public RubyClass getNameError() { return nameError; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
return noMemError; } | return noMemError; } | public RubyClass getNoMemError() { return noMemError; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
return notImplementedError; } | return notImplementedError; } | public RubyClass getNotImplementedError() { return notImplementedError; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
return rangeError; } | return rangeError; } | public RubyClass getRangeError() { return rangeError; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
return regexpError; } | return regexpError; } | public RubyClass getRegexpError() { return regexpError; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
return scriptError; } | return scriptError; } | public RubyClass getScriptError() { return scriptError; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
return securityError; } | return securityError; } | public RubyClass getSecurityError() { return securityError; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
return signalException; } | return signalException; } | public RubyClass getSignalException() { return signalException; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
return standardError; } | return standardError; } | public RubyClass getStandardError() { return standardError; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
return syntaxError; } | return syntaxError; } | public RubyClass getSyntaxError() { return syntaxError; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
return systemExit; } | return systemExit; } | public RubyClass getSystemExit() { return systemExit; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
return typeError; } | return typeError; } | public RubyClass getTypeError() { return typeError; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyExceptions.java/buggy/org/jruby/runtime/RubyExceptions.java |
final Image backgroundImage = SparkRes.getImageIcon(SparkRes.STICKY_NOTE_IMAGE).getImage(); | private void retrieveNotes() { final PrivateNotes privateNotes = PrivateNotes.getPrivateNotes(); String text = privateNotes.getNotes(); final JLabel titleLabel = new JLabel("Notepad"); titleLabel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.LIGHT_GRAY)); titleLabel.setFont(new Font("Dialog", Font.BOLD, 13)); titleLabel.setHorizontalAlignment(JLabel.CENTER); final Image backgroundImage = SparkRes.getImageIcon(SparkRes.STICKY_NOTE_IMAGE).getImage(); final JTextPane pane = new JTextPane(); pane.setOpaque(false); final JScrollPane scrollPane = new JScrollPane(pane, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setOpaque(false); scrollPane.getViewport().setOpaque(false); scrollPane.setBorder(null); pane.setText(text); final RolloverButton button = new RolloverButton("Save", null); final RolloverButton cancelButton = new RolloverButton("Cancel", null); final JFrame frame = new JFrame("Notes"); frame.setUndecorated(true); titleLabel.addMouseMotionListener(new DragWindowAdapter(frame)); final JPanel mainPanel = new JPanel() { public void paintComponent(Graphics g) { double scaleX = getWidth() / (double)backgroundImage.getWidth(null); double scaleY = getHeight() / (double)backgroundImage.getHeight(null); AffineTransform xform = AffineTransform.getScaleInstance(scaleX, scaleY); ((Graphics2D)g).drawImage(backgroundImage, xform, this); } }; pane.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent e) { if (e.getKeyChar() == KeyEvent.VK_ESCAPE) { frame.dispose(); // Save it. String text = pane.getText(); privateNotes.setNotes(text); PrivateNotes.savePrivateNotes(privateNotes); } } }); mainPanel.setBackground(Color.white); mainPanel.setLayout(new GridBagLayout()); frame.setIconImage(SparkManager.getMainWindow().getIconImage()); frame.getContentPane().add(mainPanel); mainPanel.add(titleLabel, new GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(scrollPane, new GridBagConstraints(0, 1, 3, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(button, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(cancelButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); frame.pack(); frame.setSize(400, 400); GraphicUtils.centerWindowOnComponent(frame, SparkManager.getMainWindow()); frame.setVisible(true); pane.setCaretPosition(0); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { frame.dispose(); // Save it. String text = pane.getText(); privateNotes.setNotes(text); PrivateNotes.savePrivateNotes(privateNotes); } }); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { frame.dispose(); } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/fea468feedc212a5d28808907b5dfa7da841d129/ScratchPadPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/scratchpad/ScratchPadPlugin.java |
|
frame.setUndecorated(true); titleLabel.addMouseMotionListener(new DragWindowAdapter(frame)); final JPanel mainPanel = new JPanel() { public void paintComponent(Graphics g) { double scaleX = getWidth() / (double)backgroundImage.getWidth(null); double scaleY = getHeight() / (double)backgroundImage.getHeight(null); AffineTransform xform = AffineTransform.getScaleInstance(scaleX, scaleY); ((Graphics2D)g).drawImage(backgroundImage, xform, this); } }; | final JPanel mainPanel = new JPanel(); | private void retrieveNotes() { final PrivateNotes privateNotes = PrivateNotes.getPrivateNotes(); String text = privateNotes.getNotes(); final JLabel titleLabel = new JLabel("Notepad"); titleLabel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.LIGHT_GRAY)); titleLabel.setFont(new Font("Dialog", Font.BOLD, 13)); titleLabel.setHorizontalAlignment(JLabel.CENTER); final Image backgroundImage = SparkRes.getImageIcon(SparkRes.STICKY_NOTE_IMAGE).getImage(); final JTextPane pane = new JTextPane(); pane.setOpaque(false); final JScrollPane scrollPane = new JScrollPane(pane, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setOpaque(false); scrollPane.getViewport().setOpaque(false); scrollPane.setBorder(null); pane.setText(text); final RolloverButton button = new RolloverButton("Save", null); final RolloverButton cancelButton = new RolloverButton("Cancel", null); final JFrame frame = new JFrame("Notes"); frame.setUndecorated(true); titleLabel.addMouseMotionListener(new DragWindowAdapter(frame)); final JPanel mainPanel = new JPanel() { public void paintComponent(Graphics g) { double scaleX = getWidth() / (double)backgroundImage.getWidth(null); double scaleY = getHeight() / (double)backgroundImage.getHeight(null); AffineTransform xform = AffineTransform.getScaleInstance(scaleX, scaleY); ((Graphics2D)g).drawImage(backgroundImage, xform, this); } }; pane.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent e) { if (e.getKeyChar() == KeyEvent.VK_ESCAPE) { frame.dispose(); // Save it. String text = pane.getText(); privateNotes.setNotes(text); PrivateNotes.savePrivateNotes(privateNotes); } } }); mainPanel.setBackground(Color.white); mainPanel.setLayout(new GridBagLayout()); frame.setIconImage(SparkManager.getMainWindow().getIconImage()); frame.getContentPane().add(mainPanel); mainPanel.add(titleLabel, new GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(scrollPane, new GridBagConstraints(0, 1, 3, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(button, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(cancelButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); frame.pack(); frame.setSize(400, 400); GraphicUtils.centerWindowOnComponent(frame, SparkManager.getMainWindow()); frame.setVisible(true); pane.setCaretPosition(0); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { frame.dispose(); // Save it. String text = pane.getText(); privateNotes.setNotes(text); PrivateNotes.savePrivateNotes(privateNotes); } }); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { frame.dispose(); } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/fea468feedc212a5d28808907b5dfa7da841d129/ScratchPadPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/scratchpad/ScratchPadPlugin.java |
mainPanel.add(titleLabel, new GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); | private void retrieveNotes() { final PrivateNotes privateNotes = PrivateNotes.getPrivateNotes(); String text = privateNotes.getNotes(); final JLabel titleLabel = new JLabel("Notepad"); titleLabel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.LIGHT_GRAY)); titleLabel.setFont(new Font("Dialog", Font.BOLD, 13)); titleLabel.setHorizontalAlignment(JLabel.CENTER); final Image backgroundImage = SparkRes.getImageIcon(SparkRes.STICKY_NOTE_IMAGE).getImage(); final JTextPane pane = new JTextPane(); pane.setOpaque(false); final JScrollPane scrollPane = new JScrollPane(pane, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setOpaque(false); scrollPane.getViewport().setOpaque(false); scrollPane.setBorder(null); pane.setText(text); final RolloverButton button = new RolloverButton("Save", null); final RolloverButton cancelButton = new RolloverButton("Cancel", null); final JFrame frame = new JFrame("Notes"); frame.setUndecorated(true); titleLabel.addMouseMotionListener(new DragWindowAdapter(frame)); final JPanel mainPanel = new JPanel() { public void paintComponent(Graphics g) { double scaleX = getWidth() / (double)backgroundImage.getWidth(null); double scaleY = getHeight() / (double)backgroundImage.getHeight(null); AffineTransform xform = AffineTransform.getScaleInstance(scaleX, scaleY); ((Graphics2D)g).drawImage(backgroundImage, xform, this); } }; pane.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent e) { if (e.getKeyChar() == KeyEvent.VK_ESCAPE) { frame.dispose(); // Save it. String text = pane.getText(); privateNotes.setNotes(text); PrivateNotes.savePrivateNotes(privateNotes); } } }); mainPanel.setBackground(Color.white); mainPanel.setLayout(new GridBagLayout()); frame.setIconImage(SparkManager.getMainWindow().getIconImage()); frame.getContentPane().add(mainPanel); mainPanel.add(titleLabel, new GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(scrollPane, new GridBagConstraints(0, 1, 3, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(button, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); mainPanel.add(cancelButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); frame.pack(); frame.setSize(400, 400); GraphicUtils.centerWindowOnComponent(frame, SparkManager.getMainWindow()); frame.setVisible(true); pane.setCaretPosition(0); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { frame.dispose(); // Save it. String text = pane.getText(); privateNotes.setNotes(text); PrivateNotes.savePrivateNotes(privateNotes); } }); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { frame.dispose(); } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/fea468feedc212a5d28808907b5dfa7da841d129/ScratchPadPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/scratchpad/ScratchPadPlugin.java |
|
String text = pane.getText(); privateNotes.setNotes(text); PrivateNotes.savePrivateNotes(privateNotes); | public void actionPerformed(ActionEvent actionEvent) { frame.dispose(); // Save it. String text = pane.getText(); privateNotes.setNotes(text); PrivateNotes.savePrivateNotes(privateNotes); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/fea468feedc212a5d28808907b5dfa7da841d129/ScratchPadPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/scratchpad/ScratchPadPlugin.java |
|
return "FormalInput"+(formalInputId==null ? ":Hash"+this.hashCode() : ":"+formalInputId); | return "FormalInput"+(formalInputId==null ? ":Hash_"+this.hashCode() : ":Id_"+formalInputId); | public String toString(){ return "FormalInput"+(formalInputId==null ? ":Hash"+this.hashCode() : ":"+formalInputId); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51a3c546dfc7a7a98b29771a459df19094fc5b51/FormalInput.java/buggy/components/common/src/ome/model/FormalInput.java |
assert (!WebMacro.VERSION.equals("@BUILD_DATE")); | assert (!WebMacro.BUILD_DATE.equals("@BUILD_DATE@")); | public void testBuildDate() throws Exception { assert (!WebMacro.VERSION.equals("@BUILD_DATE")); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2fb446fb4737fe828750d36d6cdc0dc42e2106db/TestVersion.java/clean/webmacro/test/unit/org/webmacro/TestVersion.java |
LinkedList executeConstructors = new LinkedList(Arrays.asList(constructors)); | LinkedList executeConstructors = new LinkedList(Arrays.asList(constructors)); | public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { LinkedList executeConstructors = new LinkedList(Arrays.asList(constructors)); int argsLength = args != null ? args.length : 0; // remove constructors with wrong parameter count. Iterator iter = executeConstructors.iterator(); while (iter.hasNext()) { Constructor constructor = (Constructor) iter.next(); if (constructor.getParameterTypes().length != argsLength) { iter.remove(); } } // remove constructors with wrong parameter types. iter = executeConstructors.iterator(); while (iter.hasNext()) { Constructor constructor = (Constructor) iter.next(); for (int i = 0; i < constructor.getParameterTypes().length; i++) { if (!JavaUtil.isCompatible(args[i], constructor.getParameterTypes()[i])) { iter.remove(); break; } } } if (executeConstructors.isEmpty()) { throw new RubyArgumentException(ruby, "wrong arguments."); } // take the first constructor. Constructor constructor = (Constructor) executeConstructors.getFirst(); Object[] newArgs = new Object[argsLength]; for (int i = 0; i < argsLength; i++) { newArgs[i] = JavaUtil.convertRubyToJava(ruby, args[i], constructor.getParameterTypes()[i]); } try { Object javaValue = constructor.newInstance(newArgs); RubyJavaObject javaObject = new RubyJavaObject(ruby, (RubyModule) recv, javaValue); javaObject.callInit(args); return javaObject; } catch (IllegalAccessException iaExcptn) { } catch (InstantiationException iExcptn) { } catch (IllegalArgumentException iaExcptn) { } catch (InvocationTargetException itExcptn) { } return ruby.getNil(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/JavaConstructor.java/clean/org/jruby/javasupport/JavaConstructor.java |
int argsLength = args != null ? args.length : 0; | int argsLength = args != null ? args.length : 0; | public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { LinkedList executeConstructors = new LinkedList(Arrays.asList(constructors)); int argsLength = args != null ? args.length : 0; // remove constructors with wrong parameter count. Iterator iter = executeConstructors.iterator(); while (iter.hasNext()) { Constructor constructor = (Constructor) iter.next(); if (constructor.getParameterTypes().length != argsLength) { iter.remove(); } } // remove constructors with wrong parameter types. iter = executeConstructors.iterator(); while (iter.hasNext()) { Constructor constructor = (Constructor) iter.next(); for (int i = 0; i < constructor.getParameterTypes().length; i++) { if (!JavaUtil.isCompatible(args[i], constructor.getParameterTypes()[i])) { iter.remove(); break; } } } if (executeConstructors.isEmpty()) { throw new RubyArgumentException(ruby, "wrong arguments."); } // take the first constructor. Constructor constructor = (Constructor) executeConstructors.getFirst(); Object[] newArgs = new Object[argsLength]; for (int i = 0; i < argsLength; i++) { newArgs[i] = JavaUtil.convertRubyToJava(ruby, args[i], constructor.getParameterTypes()[i]); } try { Object javaValue = constructor.newInstance(newArgs); RubyJavaObject javaObject = new RubyJavaObject(ruby, (RubyModule) recv, javaValue); javaObject.callInit(args); return javaObject; } catch (IllegalAccessException iaExcptn) { } catch (InstantiationException iExcptn) { } catch (IllegalArgumentException iaExcptn) { } catch (InvocationTargetException itExcptn) { } return ruby.getNil(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/JavaConstructor.java/clean/org/jruby/javasupport/JavaConstructor.java |
Iterator iter = executeConstructors.iterator(); while (iter.hasNext()) { Constructor constructor = (Constructor) iter.next(); if (constructor.getParameterTypes().length != argsLength) { iter.remove(); } } | Iterator iter = executeConstructors.iterator(); while (iter.hasNext()) { Constructor constructor = (Constructor) iter.next(); if (constructor.getParameterTypes().length != argsLength) { iter.remove(); } } | public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { LinkedList executeConstructors = new LinkedList(Arrays.asList(constructors)); int argsLength = args != null ? args.length : 0; // remove constructors with wrong parameter count. Iterator iter = executeConstructors.iterator(); while (iter.hasNext()) { Constructor constructor = (Constructor) iter.next(); if (constructor.getParameterTypes().length != argsLength) { iter.remove(); } } // remove constructors with wrong parameter types. iter = executeConstructors.iterator(); while (iter.hasNext()) { Constructor constructor = (Constructor) iter.next(); for (int i = 0; i < constructor.getParameterTypes().length; i++) { if (!JavaUtil.isCompatible(args[i], constructor.getParameterTypes()[i])) { iter.remove(); break; } } } if (executeConstructors.isEmpty()) { throw new RubyArgumentException(ruby, "wrong arguments."); } // take the first constructor. Constructor constructor = (Constructor) executeConstructors.getFirst(); Object[] newArgs = new Object[argsLength]; for (int i = 0; i < argsLength; i++) { newArgs[i] = JavaUtil.convertRubyToJava(ruby, args[i], constructor.getParameterTypes()[i]); } try { Object javaValue = constructor.newInstance(newArgs); RubyJavaObject javaObject = new RubyJavaObject(ruby, (RubyModule) recv, javaValue); javaObject.callInit(args); return javaObject; } catch (IllegalAccessException iaExcptn) { } catch (InstantiationException iExcptn) { } catch (IllegalArgumentException iaExcptn) { } catch (InvocationTargetException itExcptn) { } return ruby.getNil(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/JavaConstructor.java/clean/org/jruby/javasupport/JavaConstructor.java |
iter = executeConstructors.iterator(); while (iter.hasNext()) { Constructor constructor = (Constructor) iter.next(); for (int i = 0; i < constructor.getParameterTypes().length; i++) { if (!JavaUtil.isCompatible(args[i], constructor.getParameterTypes()[i])) { iter.remove(); break; } } } | iter = executeConstructors.iterator(); while (iter.hasNext()) { Constructor constructor = (Constructor) iter.next(); for (int i = 0; i < constructor.getParameterTypes().length; i++) { if (!JavaUtil.isCompatible(args[i], constructor.getParameterTypes()[i])) { iter.remove(); break; } } } | public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { LinkedList executeConstructors = new LinkedList(Arrays.asList(constructors)); int argsLength = args != null ? args.length : 0; // remove constructors with wrong parameter count. Iterator iter = executeConstructors.iterator(); while (iter.hasNext()) { Constructor constructor = (Constructor) iter.next(); if (constructor.getParameterTypes().length != argsLength) { iter.remove(); } } // remove constructors with wrong parameter types. iter = executeConstructors.iterator(); while (iter.hasNext()) { Constructor constructor = (Constructor) iter.next(); for (int i = 0; i < constructor.getParameterTypes().length; i++) { if (!JavaUtil.isCompatible(args[i], constructor.getParameterTypes()[i])) { iter.remove(); break; } } } if (executeConstructors.isEmpty()) { throw new RubyArgumentException(ruby, "wrong arguments."); } // take the first constructor. Constructor constructor = (Constructor) executeConstructors.getFirst(); Object[] newArgs = new Object[argsLength]; for (int i = 0; i < argsLength; i++) { newArgs[i] = JavaUtil.convertRubyToJava(ruby, args[i], constructor.getParameterTypes()[i]); } try { Object javaValue = constructor.newInstance(newArgs); RubyJavaObject javaObject = new RubyJavaObject(ruby, (RubyModule) recv, javaValue); javaObject.callInit(args); return javaObject; } catch (IllegalAccessException iaExcptn) { } catch (InstantiationException iExcptn) { } catch (IllegalArgumentException iaExcptn) { } catch (InvocationTargetException itExcptn) { } return ruby.getNil(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/JavaConstructor.java/clean/org/jruby/javasupport/JavaConstructor.java |
if (executeConstructors.isEmpty()) { throw new RubyArgumentException(ruby, "wrong arguments."); } | if (executeConstructors.isEmpty()) { throw new RubyArgumentException(ruby, "wrong arguments."); } | public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { LinkedList executeConstructors = new LinkedList(Arrays.asList(constructors)); int argsLength = args != null ? args.length : 0; // remove constructors with wrong parameter count. Iterator iter = executeConstructors.iterator(); while (iter.hasNext()) { Constructor constructor = (Constructor) iter.next(); if (constructor.getParameterTypes().length != argsLength) { iter.remove(); } } // remove constructors with wrong parameter types. iter = executeConstructors.iterator(); while (iter.hasNext()) { Constructor constructor = (Constructor) iter.next(); for (int i = 0; i < constructor.getParameterTypes().length; i++) { if (!JavaUtil.isCompatible(args[i], constructor.getParameterTypes()[i])) { iter.remove(); break; } } } if (executeConstructors.isEmpty()) { throw new RubyArgumentException(ruby, "wrong arguments."); } // take the first constructor. Constructor constructor = (Constructor) executeConstructors.getFirst(); Object[] newArgs = new Object[argsLength]; for (int i = 0; i < argsLength; i++) { newArgs[i] = JavaUtil.convertRubyToJava(ruby, args[i], constructor.getParameterTypes()[i]); } try { Object javaValue = constructor.newInstance(newArgs); RubyJavaObject javaObject = new RubyJavaObject(ruby, (RubyModule) recv, javaValue); javaObject.callInit(args); return javaObject; } catch (IllegalAccessException iaExcptn) { } catch (InstantiationException iExcptn) { } catch (IllegalArgumentException iaExcptn) { } catch (InvocationTargetException itExcptn) { } return ruby.getNil(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/JavaConstructor.java/clean/org/jruby/javasupport/JavaConstructor.java |
Constructor constructor = (Constructor) executeConstructors.getFirst(); | Constructor constructor = (Constructor) executeConstructors.getFirst(); | public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { LinkedList executeConstructors = new LinkedList(Arrays.asList(constructors)); int argsLength = args != null ? args.length : 0; // remove constructors with wrong parameter count. Iterator iter = executeConstructors.iterator(); while (iter.hasNext()) { Constructor constructor = (Constructor) iter.next(); if (constructor.getParameterTypes().length != argsLength) { iter.remove(); } } // remove constructors with wrong parameter types. iter = executeConstructors.iterator(); while (iter.hasNext()) { Constructor constructor = (Constructor) iter.next(); for (int i = 0; i < constructor.getParameterTypes().length; i++) { if (!JavaUtil.isCompatible(args[i], constructor.getParameterTypes()[i])) { iter.remove(); break; } } } if (executeConstructors.isEmpty()) { throw new RubyArgumentException(ruby, "wrong arguments."); } // take the first constructor. Constructor constructor = (Constructor) executeConstructors.getFirst(); Object[] newArgs = new Object[argsLength]; for (int i = 0; i < argsLength; i++) { newArgs[i] = JavaUtil.convertRubyToJava(ruby, args[i], constructor.getParameterTypes()[i]); } try { Object javaValue = constructor.newInstance(newArgs); RubyJavaObject javaObject = new RubyJavaObject(ruby, (RubyModule) recv, javaValue); javaObject.callInit(args); return javaObject; } catch (IllegalAccessException iaExcptn) { } catch (InstantiationException iExcptn) { } catch (IllegalArgumentException iaExcptn) { } catch (InvocationTargetException itExcptn) { } return ruby.getNil(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/JavaConstructor.java/clean/org/jruby/javasupport/JavaConstructor.java |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.