rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
for (int j = 0; j < menus.length; j++) { | for (int j = 0; j < menus.length; j++) | public void addToMenuBar(JMenu[] menus, boolean before) { JMenuBar bar = getJMenuBar(); if (before) { JMenu[] existingMenus = new JMenu[bar.getMenuCount()]; for (int i = 0; i < existingMenus.length; i++) { existingMenus[i] = bar.getMenu(i); } bar.removeAll(); for (int j = 0; j < menus.length; j++) { bar.add(menus[j]); } for (int i = 0; i < existingMenus.length; i++) { bar.add(existingMenus[i]); } } else { for (int j = 0; j < menus.length; j++) { bar.add(menus[j]); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bbd964029121f2811ba2b7cf47a392087032888c/TaskBarView.java/clean/SRC/org/openmicroscopy/shoola/env/ui/TaskBarView.java |
} | public void addToMenuBar(JMenu[] menus, boolean before) { JMenuBar bar = getJMenuBar(); if (before) { JMenu[] existingMenus = new JMenu[bar.getMenuCount()]; for (int i = 0; i < existingMenus.length; i++) { existingMenus[i] = bar.getMenu(i); } bar.removeAll(); for (int j = 0; j < menus.length; j++) { bar.add(menus[j]); } for (int i = 0; i < existingMenus.length; i++) { bar.add(existingMenus[i]); } } else { for (int j = 0; j < menus.length; j++) { bar.add(menus[j]); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bbd964029121f2811ba2b7cf47a392087032888c/TaskBarView.java/clean/SRC/org/openmicroscopy/shoola/env/ui/TaskBarView.java |
|
UIUtilities.formatToolTipText("Connect to OMEDS.")); | UIUtilities.formatToolTipText("Connect to OMERO.")); | private void createButtons() { buttons[CONNECT_BTN] = new JButton( iconManager.getIcon(IconManager.CONNECT_DS)); buttons[CONNECT_BTN].setToolTipText( UIUtilities.formatToolTipText("Connect to OMEDS.")); buttons[DISCONNECT_BTN] = new JButton( iconManager.getIcon(IconManager.DISCONNECT_DS)); buttons[DISCONNECT_BTN].setToolTipText( UIUtilities.formatToolTipText("Disconnect from OMEDS.")); buttons[HELP_BTN] = new JButton(iconManager.getIcon(IconManager.HELP)); buttons[HELP_BTN].setToolTipText( UIUtilities.formatToolTipText("Bring up help contents.")); buttons[EXIT_BTN] = new JButton(iconManager.getIcon(IconManager.EXIT)); buttons[EXIT_BTN].setToolTipText( UIUtilities.formatToolTipText("Exit the application.")); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bbd964029121f2811ba2b7cf47a392087032888c/TaskBarView.java/clean/SRC/org/openmicroscopy/shoola/env/ui/TaskBarView.java |
UIUtilities.formatToolTipText("Disconnect from OMEDS.")); | UIUtilities.formatToolTipText("Disconnect from OMERO.")); | private void createButtons() { buttons[CONNECT_BTN] = new JButton( iconManager.getIcon(IconManager.CONNECT_DS)); buttons[CONNECT_BTN].setToolTipText( UIUtilities.formatToolTipText("Connect to OMEDS.")); buttons[DISCONNECT_BTN] = new JButton( iconManager.getIcon(IconManager.DISCONNECT_DS)); buttons[DISCONNECT_BTN].setToolTipText( UIUtilities.formatToolTipText("Disconnect from OMEDS.")); buttons[HELP_BTN] = new JButton(iconManager.getIcon(IconManager.HELP)); buttons[HELP_BTN].setToolTipText( UIUtilities.formatToolTipText("Bring up help contents.")); buttons[EXIT_BTN] = new JButton(iconManager.getIcon(IconManager.EXIT)); buttons[EXIT_BTN].setToolTipText( UIUtilities.formatToolTipText("Exit the application.")); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bbd964029121f2811ba2b7cf47a392087032888c/TaskBarView.java/clean/SRC/org/openmicroscopy/shoola/env/ui/TaskBarView.java |
buttons[UPDATES_MI] = new JMenuItem("Software Updates", | buttons[UPDATES_MI] = new JMenuItem("About Software", | private void createMenuItems() { buttons[EXIT_MI] = new JMenuItem("Exit", iconManager.getIcon(IconManager.EXIT)); buttons[CONNECT_MI] = new JMenuItem("Connect to OMEDS", iconManager.getIcon(IconManager.CONNECT_DS)); buttons[DISCONNECT_MI] = new JMenuItem("Disconnect from OMEDS", iconManager.getIcon(IconManager.DISCONNECT_DS)); buttons[WELCOME_MI] = new JMenuItem("Welcome...", iconManager.getIcon(IconManager.WELCOME)); buttons[HELP_MI] = new JMenuItem("Help Contents", iconManager.getIcon(IconManager.HELP)); buttons[HOWTO_MI] = new JMenuItem("How To...", iconManager.getIcon(IconManager.HOW_TO)); buttons[UPDATES_MI] = new JMenuItem("Software Updates", iconManager.getIcon(IconManager.SW_UPDATES)); buttons[ABOUT_MI] = new JMenuItem("About OME", IconManager.getOMEIcon()); buttons[COMMENT_MI] = new JMenuItem("Send Comment", iconManager.getIcon(IconManager.COMMENT)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bbd964029121f2811ba2b7cf47a392087032888c/TaskBarView.java/clean/SRC/org/openmicroscopy/shoola/env/ui/TaskBarView.java |
return this.string; | return value; | public String getString() { return this.string; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/086abcd7e5107a6e6813ecb64810deff5780af95/RubyString.java/clean/org/jruby/RubyString.java |
public void setString(String string) { this.string = string; | public void setString(String str) { value = str; | public void setString(String string) { this.string = string; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/086abcd7e5107a6e6813ecb64810deff5780af95/RubyString.java/clean/org/jruby/RubyString.java |
public ModuleExecution(Integer moduleExecutionId, String status, Double attributeDbTime, boolean virtualMex, String inputTag, String iteratorTag, String dependence, Double attributeSortTime, String errorMessage, Date timestamp, Double attributeCreateTime, String newFeatureTag, Double totalTime, org.openmicroscopy.omero.model.Image image, org.openmicroscopy.omero.model.Dataset dataset, org.openmicroscopy.omero.model.Group group, org.openmicroscopy.omero.model.Experimenter experimenter, Set thumbnails, Set classifications, Set repositories, Set categories, Set displayRois, Set imageInfos, Set imagePlates, Set imagePixels, Set groups, Set experimenters, Set categoryGroups, Set imageAnnotations, Set datasetAnnotations, Set imageDimensions, Set channelComponents, Set displayOptions) { this.moduleExecutionId = moduleExecutionId; this.status = status; this.attributeDbTime = attributeDbTime; this.virtualMex = virtualMex; this.inputTag = inputTag; this.iteratorTag = iteratorTag; this.dependence = dependence; this.attributeSortTime = attributeSortTime; this.errorMessage = errorMessage; this.timestamp = timestamp; this.attributeCreateTime = attributeCreateTime; this.newFeatureTag = newFeatureTag; this.totalTime = totalTime; this.image = image; this.dataset = dataset; this.group = group; this.experimenter = experimenter; this.thumbnails = thumbnails; this.classifications = classifications; this.repositories = repositories; this.categories = categories; this.displayRois = displayRois; this.imageInfos = imageInfos; this.imagePlates = imagePlates; this.imagePixels = imagePixels; this.groups = groups; this.experimenters = experimenters; this.categoryGroups = categoryGroups; this.imageAnnotations = imageAnnotations; this.datasetAnnotations = datasetAnnotations; this.imageDimensions = imageDimensions; this.channelComponents = channelComponents; this.displayOptions = displayOptions; | public ModuleExecution() { | public ModuleExecution(Integer moduleExecutionId, String status, Double attributeDbTime, boolean virtualMex, String inputTag, String iteratorTag, String dependence, Double attributeSortTime, String errorMessage, Date timestamp, Double attributeCreateTime, String newFeatureTag, Double totalTime, org.openmicroscopy.omero.model.Image image, org.openmicroscopy.omero.model.Dataset dataset, org.openmicroscopy.omero.model.Group group, org.openmicroscopy.omero.model.Experimenter experimenter, Set thumbnails, Set classifications, Set repositories, Set categories, Set displayRois, Set imageInfos, Set imagePlates, Set imagePixels, Set groups, Set experimenters, Set categoryGroups, Set imageAnnotations, Set datasetAnnotations, Set imageDimensions, Set channelComponents, Set displayOptions) { this.moduleExecutionId = moduleExecutionId; this.status = status; this.attributeDbTime = attributeDbTime; this.virtualMex = virtualMex; this.inputTag = inputTag; this.iteratorTag = iteratorTag; this.dependence = dependence; this.attributeSortTime = attributeSortTime; this.errorMessage = errorMessage; this.timestamp = timestamp; this.attributeCreateTime = attributeCreateTime; this.newFeatureTag = newFeatureTag; this.totalTime = totalTime; this.image = image; this.dataset = dataset; this.group = group; this.experimenter = experimenter; this.thumbnails = thumbnails; this.classifications = classifications; this.repositories = repositories; this.categories = categories; this.displayRois = displayRois; this.imageInfos = imageInfos; this.imagePlates = imagePlates; this.imagePixels = imagePixels; this.groups = groups; this.experimenters = experimenters; this.categoryGroups = categoryGroups; this.imageAnnotations = imageAnnotations; this.datasetAnnotations = datasetAnnotations; this.imageDimensions = imageDimensions; this.channelComponents = channelComponents; this.displayOptions = displayOptions; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/ModuleExecution.java/buggy/components/common/src/org/openmicroscopy/omero/model/ModuleExecution.java |
public org.openmicroscopy.omero.model.Dataset getDataset() { | public Dataset getDataset() { | public org.openmicroscopy.omero.model.Dataset getDataset() { return this.dataset; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/ModuleExecution.java/buggy/components/common/src/org/openmicroscopy/omero/model/ModuleExecution.java |
public org.openmicroscopy.omero.model.Experimenter getExperimenter() { | public Experimenter getExperimenter() { | public org.openmicroscopy.omero.model.Experimenter getExperimenter() { return this.experimenter; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/ModuleExecution.java/buggy/components/common/src/org/openmicroscopy/omero/model/ModuleExecution.java |
public org.openmicroscopy.omero.model.Group getGroup() { | public Group getGroup() { | public org.openmicroscopy.omero.model.Group getGroup() { return this.group; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/ModuleExecution.java/buggy/components/common/src/org/openmicroscopy/omero/model/ModuleExecution.java |
public org.openmicroscopy.omero.model.Image getImage() { | public Image getImage() { | public org.openmicroscopy.omero.model.Image getImage() { return this.image; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/ModuleExecution.java/buggy/components/common/src/org/openmicroscopy/omero/model/ModuleExecution.java |
public void setDataset(org.openmicroscopy.omero.model.Dataset dataset) { | public void setDataset(Dataset dataset) { | public void setDataset(org.openmicroscopy.omero.model.Dataset dataset) { this.dataset = dataset; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/ModuleExecution.java/buggy/components/common/src/org/openmicroscopy/omero/model/ModuleExecution.java |
public void setExperimenter(org.openmicroscopy.omero.model.Experimenter experimenter) { | public void setExperimenter(Experimenter experimenter) { | public void setExperimenter(org.openmicroscopy.omero.model.Experimenter experimenter) { this.experimenter = experimenter; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/ModuleExecution.java/buggy/components/common/src/org/openmicroscopy/omero/model/ModuleExecution.java |
public void setGroup(org.openmicroscopy.omero.model.Group group) { | public void setGroup(Group group) { | public void setGroup(org.openmicroscopy.omero.model.Group group) { this.group = group; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/ModuleExecution.java/buggy/components/common/src/org/openmicroscopy/omero/model/ModuleExecution.java |
public void setImage(org.openmicroscopy.omero.model.Image image) { | public void setImage(Image image) { | public void setImage(org.openmicroscopy.omero.model.Image image) { this.image = image; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/ModuleExecution.java/buggy/components/common/src/org/openmicroscopy/omero/model/ModuleExecution.java |
public void setVirtualMex(boolean virtualMex) { | public void setVirtualMex(Boolean virtualMex) { | public void setVirtualMex(boolean virtualMex) { this.virtualMex = virtualMex; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/ModuleExecution.java/buggy/components/common/src/org/openmicroscopy/omero/model/ModuleExecution.java |
throws DSOutOfServiceException, DSAccessException; | throws DSOutOfServiceException, DSAccessException; | public void updateUserInputAttributes(List attributes) throws DSOutOfServiceException, DSAccessException; | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f5113c7a4ff99bcbee06e1b48554259a952e1a44/SemanticTypesService.java/buggy/SRC/org/openmicroscopy/shoola/env/data/SemanticTypesService.java |
calendar.setFirstDayOfWeek(Calendar.MONDAY); | formatWeekYear(Calendar.MONDAY, toAppendTo); break; | public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { calendar.setTime(date); Iterator iter = compiledPattern.iterator(); while (iter.hasNext()) { Token token = (Token) iter.next(); switch (token.getFormat()) { case FORMAT_STRING: toAppendTo.append(token.getData()); break; case FORMAT_WEEK_LONG: toAppendTo.append(formatSymbols.getWeekdays()[calendar.get(Calendar.DAY_OF_WEEK)]); break; case FORMAT_WEEK_SHORT: toAppendTo.append(formatSymbols.getShortWeekdays()[calendar.get(Calendar.DAY_OF_WEEK)]); break; case FORMAT_MONTH_LONG: toAppendTo.append(formatSymbols.getMonths()[calendar.get(Calendar.MONTH)]); break; case FORMAT_MONTH_SHORT: toAppendTo.append(formatSymbols.getShortMonths()[calendar.get(Calendar.MONTH)]); break; case FORMAT_DAY: int value = calendar.get(Calendar.DAY_OF_MONTH); if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_HOUR: value = calendar.get(Calendar.HOUR_OF_DAY); if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_HOUR_M: value = calendar.get(Calendar.HOUR); if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_DAY_YEAR: value = calendar.get(Calendar.DAY_OF_YEAR); if (value < 10) { toAppendTo.append("00"); } else if (value < 100) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_MINUTES: value = calendar.get(Calendar.MINUTE); if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_MONTH: value = calendar.get(Calendar.MONTH) + 1; if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_MERIDIAN: if (calendar.get(Calendar.AM_PM) == Calendar.AM) { toAppendTo.append("AM"); } else { toAppendTo.append("PM"); } break; case FORMAT_SECONDS: value = calendar.get(Calendar.SECOND); if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_WEEK_YEAR_M: // GregorianCalendar uses Sunday by default; switch to Monday and back calendar.setFirstDayOfWeek(Calendar.MONDAY); // intentional fall-through case FORMAT_WEEK_YEAR_S: // Ruby uses zero-based weeks value = calendar.get(Calendar.WEEK_OF_YEAR) - 1; if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); // to clear MONDAY from above calendar.setFirstDayOfWeek(Calendar.SUNDAY); break; case FORMAT_DAY_WEEK: value = calendar.get(Calendar.DAY_OF_WEEK) - 1; toAppendTo.append(value); break; case FORMAT_YEAR_LONG: value = calendar.get(Calendar.YEAR); if (value < 10) { toAppendTo.append("000"); } else if (value < 100) { toAppendTo.append("00"); } else if (value < 1000) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_YEAR_SHORT: value = calendar.get(Calendar.YEAR) % 100; if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_ZONE_OFF: value = calendar.getTimeZone().getOffset(calendar.getTimeInMillis()); if (value < 0) { toAppendTo.append('+'); } else { toAppendTo.append('-'); } value = Math.abs(value); if (value / 3600000 < 10) { toAppendTo.append('0'); } toAppendTo.append(value / 3600000); value = value % 3600000 / 60000; if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_ZONE_ID: toAppendTo.append(calendar.getTimeZone().getDisplayName(calendar.get(Calendar.DST_OFFSET) != 0, TimeZone.SHORT)); break; } } return toAppendTo; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e0ef4a00b8bf2b12e8991a00385ac0a14c9bb461/RubyDateFormat.java/buggy/src/org/jruby/util/RubyDateFormat.java |
value = calendar.get(Calendar.WEEK_OF_YEAR) - 1; if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); calendar.setFirstDayOfWeek(Calendar.SUNDAY); | formatWeekYear(Calendar.SUNDAY, toAppendTo); | public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { calendar.setTime(date); Iterator iter = compiledPattern.iterator(); while (iter.hasNext()) { Token token = (Token) iter.next(); switch (token.getFormat()) { case FORMAT_STRING: toAppendTo.append(token.getData()); break; case FORMAT_WEEK_LONG: toAppendTo.append(formatSymbols.getWeekdays()[calendar.get(Calendar.DAY_OF_WEEK)]); break; case FORMAT_WEEK_SHORT: toAppendTo.append(formatSymbols.getShortWeekdays()[calendar.get(Calendar.DAY_OF_WEEK)]); break; case FORMAT_MONTH_LONG: toAppendTo.append(formatSymbols.getMonths()[calendar.get(Calendar.MONTH)]); break; case FORMAT_MONTH_SHORT: toAppendTo.append(formatSymbols.getShortMonths()[calendar.get(Calendar.MONTH)]); break; case FORMAT_DAY: int value = calendar.get(Calendar.DAY_OF_MONTH); if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_HOUR: value = calendar.get(Calendar.HOUR_OF_DAY); if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_HOUR_M: value = calendar.get(Calendar.HOUR); if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_DAY_YEAR: value = calendar.get(Calendar.DAY_OF_YEAR); if (value < 10) { toAppendTo.append("00"); } else if (value < 100) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_MINUTES: value = calendar.get(Calendar.MINUTE); if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_MONTH: value = calendar.get(Calendar.MONTH) + 1; if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_MERIDIAN: if (calendar.get(Calendar.AM_PM) == Calendar.AM) { toAppendTo.append("AM"); } else { toAppendTo.append("PM"); } break; case FORMAT_SECONDS: value = calendar.get(Calendar.SECOND); if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_WEEK_YEAR_M: // GregorianCalendar uses Sunday by default; switch to Monday and back calendar.setFirstDayOfWeek(Calendar.MONDAY); // intentional fall-through case FORMAT_WEEK_YEAR_S: // Ruby uses zero-based weeks value = calendar.get(Calendar.WEEK_OF_YEAR) - 1; if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); // to clear MONDAY from above calendar.setFirstDayOfWeek(Calendar.SUNDAY); break; case FORMAT_DAY_WEEK: value = calendar.get(Calendar.DAY_OF_WEEK) - 1; toAppendTo.append(value); break; case FORMAT_YEAR_LONG: value = calendar.get(Calendar.YEAR); if (value < 10) { toAppendTo.append("000"); } else if (value < 100) { toAppendTo.append("00"); } else if (value < 1000) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_YEAR_SHORT: value = calendar.get(Calendar.YEAR) % 100; if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_ZONE_OFF: value = calendar.getTimeZone().getOffset(calendar.getTimeInMillis()); if (value < 0) { toAppendTo.append('+'); } else { toAppendTo.append('-'); } value = Math.abs(value); if (value / 3600000 < 10) { toAppendTo.append('0'); } toAppendTo.append(value / 3600000); value = value % 3600000 / 60000; if (value < 10) { toAppendTo.append('0'); } toAppendTo.append(value); break; case FORMAT_ZONE_ID: toAppendTo.append(calendar.getTimeZone().getDisplayName(calendar.get(Calendar.DST_OFFSET) != 0, TimeZone.SHORT)); break; } } return toAppendTo; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e0ef4a00b8bf2b12e8991a00385ac0a14c9bb461/RubyDateFormat.java/buggy/src/org/jruby/util/RubyDateFormat.java |
throw new PropertyException("No method to set \"" + _vname + | throw new PropertyException("No method to set \"" + getVariableName() + | public final void setValue (Context context, Object newValue) throws PropertyException { if (!context.set(_names, newValue)) { throw new PropertyException("No method to set \"" + _vname + "\" to type " + ((newValue == null) ? "null" : newValue.getClass().toString()) + " in supplied context (" + context.getClass() + ")"); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/976cc762ab65b58fbb5a81d83d913780b9d31fd4/GlobalVariable.java/clean/webmacro/src/org/webmacro/engine/GlobalVariable.java |
return "global:" + _vname; | return "global:" + getVariableName(); | public final String toString () { return "global:" + _vname; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/976cc762ab65b58fbb5a81d83d913780b9d31fd4/GlobalVariable.java/clean/webmacro/src/org/webmacro/engine/GlobalVariable.java |
return getValue() > otherVal ? 1 : getValue() < otherVal ? -1 : 0; | return getLongValue() > otherVal ? 1 : getLongValue() < otherVal ? -1 : 0; | protected int compareValue(RubyNumeric other) { if (other instanceof RubyBignum) { return ((RubyBignum)other).compareValue(this) * -1; } else if (other instanceof RubyFloat) { double otherVal = other.getDoubleValue(); double thisVal = getDoubleValue(); return thisVal > otherVal ? 1 : thisVal < otherVal ? -1 : 0; } else { long otherVal = other.getLongValue(); return getValue() > otherVal ? 1 : getValue() < otherVal ? -1 : 0; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/RubyFixnum.java/buggy/org/jruby/RubyFixnum.java |
public static RubyClass createFixnumClass(Ruby ruby) { RubyClass fixnumClass = ruby.defineClass("Fixnum", ruby.getClasses().getIntegerClass()); fixnumClass.defineMethod("to_s", CallbackFactory.getMethod(RubyFixnum.class, "to_s")); fixnumClass.defineMethod("to_str", CallbackFactory.getMethod(RubyFixnum.class, "to_s")); fixnumClass.defineMethod("hash", CallbackFactory.getMethod(RubyFixnum.class, "hash")); fixnumClass.defineMethod("+", CallbackFactory.getMethod(RubyFixnum.class, "op_plus", RubyObject.class)); fixnumClass.defineMethod("-", CallbackFactory.getMethod(RubyFixnum.class, "op_minus", RubyObject.class)); fixnumClass.defineMethod("*", CallbackFactory.getMethod(RubyFixnum.class, "op_mul", RubyObject.class)); fixnumClass.defineMethod("/", CallbackFactory.getMethod(RubyFixnum.class, "op_div", RubyObject.class)); fixnumClass.defineMethod("%", CallbackFactory.getMethod(RubyFixnum.class, "op_mod", RubyObject.class)); fixnumClass.defineMethod("**", CallbackFactory.getMethod(RubyFixnum.class, "op_pow", RubyObject.class)); fixnumClass.defineMethod("==", CallbackFactory.getMethod(RubyFixnum.class, "op_equal", RubyObject.class)); fixnumClass.defineMethod("<=>", CallbackFactory.getMethod(RubyFixnum.class, "op_cmp", RubyObject.class)); fixnumClass.defineMethod(">", CallbackFactory.getMethod(RubyFixnum.class, "op_gt", RubyObject.class)); fixnumClass.defineMethod(">=", CallbackFactory.getMethod(RubyFixnum.class, "op_ge", RubyObject.class)); fixnumClass.defineMethod("<", CallbackFactory.getMethod(RubyFixnum.class, "op_lt", RubyObject.class)); fixnumClass.defineMethod("<=", CallbackFactory.getMethod(RubyFixnum.class, "op_le", RubyObject.class)); return fixnumClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/RubyFixnum.java/buggy/org/jruby/RubyFixnum.java |
||
return ruby.fixnumCache[(int) value]; | RubyFixnum newNum = ruby.fixnumCache[(int) value]; if (newNum == null) { newNum = new RubyFixnum(ruby, value); ruby.fixnumCache[(int) value] = newNum; } return newNum; } else { return new RubyFixnum(ruby, value); | public static RubyFixnum newFixnum(Ruby ruby, long value) { // Cache for Fixnums (Performance) if ((value & ~Ruby.FIXNUM_CACHE_MAX) == 0) { return ruby.fixnumCache[(int) value]; } return new RubyFixnum(ruby, value); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/RubyFixnum.java/buggy/org/jruby/RubyFixnum.java |
return new RubyFixnum(ruby, value); | public static RubyFixnum newFixnum(Ruby ruby, long value) { // Cache for Fixnums (Performance) if ((value & ~Ruby.FIXNUM_CACHE_MAX) == 0) { return ruby.fixnumCache[(int) value]; } return new RubyFixnum(ruby, value); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/RubyFixnum.java/buggy/org/jruby/RubyFixnum.java |
|
return newFixnum(getRuby(), getValue() / other.getLongValue()); | return newFixnum(getRuby(), getLongValue() / other.getLongValue()); | public RubyNumeric op_div(RubyObject num) { RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuby(), getDoubleValue()).op_div(other); } else if (other instanceof RubyBignum) { return RubyBignum.newBignum(getRuby(), getLongValue()).op_div(other); } else { return newFixnum(getRuby(), getValue() / other.getLongValue()); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/RubyFixnum.java/buggy/org/jruby/RubyFixnum.java |
return newFixnum(getRuby(), getValue() % other.getLongValue()); | return newFixnum(getRuby(), getLongValue() % other.getLongValue()); | public RubyNumeric op_mod(RubyObject num) { RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuby(), getDoubleValue()).op_mod(other); } else if (other instanceof RubyBignum) { return RubyBignum.newBignum(getRuby(), getLongValue()).op_mod(other); } else { return newFixnum(getRuby(), getValue() % other.getLongValue()); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/RubyFixnum.java/buggy/org/jruby/RubyFixnum.java |
return RubyString.newString(getRuby(), String.valueOf(getValue())); | return RubyString.newString(getRuby(), String.valueOf(getLongValue())); | public RubyString to_s() { return RubyString.newString(getRuby(), String.valueOf(getValue())); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/RubyFixnum.java/buggy/org/jruby/RubyFixnum.java |
{ JPanel p = new JPanel(); p.setBorder(new EtchedBorder()); p.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.NORTHWEST; c.fill = GridBagConstraints.BOTH; c.weighty = 1; c.insets = new Insets(3, 3, 3, 3); c.weightx = 0.4; p.add(new JScrollPane(annotationArea), c); c.gridx = 1; c.weightx = 0.2; p.add(listComponent, c); return p; } | { JPanel p = new JPanel(); p.setBorder(new EtchedBorder()); p.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.NORTHWEST; c.fill = GridBagConstraints.BOTH; c.weighty = 1; c.insets = new Insets(3, 3, 3, 3); c.weightx = 0.4; p.add(new JScrollPane(annotationArea), c); c.gridx = 1; c.weightx = 0.2; p.add(listComponent, c); return p; } | private JPanel buildAnnotationPanel() { JPanel p = new JPanel(); p.setBorder(new EtchedBorder()); p.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); // griddy constraints c.anchor = GridBagConstraints.NORTHWEST; c.fill = GridBagConstraints.BOTH; c.weighty = 1; c.insets = new Insets(3, 3, 3, 3); // add annotation area c.weightx = 0.4; p.add(new JScrollPane(annotationArea), c); // add annotated by list c.gridx = 1; c.weightx = 0.2; p.add(listComponent, c); return p; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorUI.java |
{ JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS)); p.add(new JLabel(TITLE)); p.add(messageComponent); return UIUtilities.buildComponentPanel(p); } | { JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS)); p.add(new JLabel(TITLE)); p.add(messageComponent); return UIUtilities.buildComponentPanel(p); } | private JPanel buildCommentsPanel() { JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS)); p.add(new JLabel(TITLE)); p.add(messageComponent); return UIUtilities.buildComponentPanel(p); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorUI.java |
{ setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(buildCommentsPanel()); add(Box.createRigidArea(SMALL_V_SPACER_SIZE)); add(new JSeparator()); add(Box.createRigidArea(SMALL_V_SPACER_SIZE)); add(buildAnnotationPanel()); add(Box.createVerticalGlue()); } | { setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(buildCommentsPanel()); add(Box.createRigidArea(SMALL_V_SPACER_SIZE)); add(new JSeparator()); add(Box.createRigidArea(SMALL_V_SPACER_SIZE)); add(buildAnnotationPanel()); add(Box.createVerticalGlue()); } | private void buildGUI() { setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(buildCommentsPanel()); add(Box.createRigidArea(SMALL_V_SPACER_SIZE)); add(new JSeparator()); add(Box.createRigidArea(SMALL_V_SPACER_SIZE)); add(buildAnnotationPanel()); add(Box.createVerticalGlue()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorUI.java |
{ listModel.removeAllElements(); | { listModel.removeAllElements(); | private void formatList(String[] objects) { // remove all users from list before adding new listModel.removeAllElements(); // add each user to list Timestamp date; DateFormat df = DateFormat.getDateInstance(); AnnotationData data; List list; for (int i = 0; i < objects.length; i++) { list = getDataObjectAnnotation(i); data = ((AnnotationData) list.get(0)); date = data.getLastModified(); if (date == null) date = new Timestamp(new Date().getTime());; listModel.addElement(objects[i]+" ("+df.format(date)+")"); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorUI.java |
Timestamp date; DateFormat df = DateFormat.getDateInstance(); AnnotationData data; List list; for (int i = 0; i < objects.length; i++) { list = getDataObjectAnnotation(i); data = ((AnnotationData) list.get(0)); date = data.getLastModified(); if (date == null) date = new Timestamp(new Date().getTime());; listModel.addElement(objects[i]+" ("+df.format(date)+")"); } } | Timestamp date; DateFormat df = DateFormat.getDateInstance(); AnnotationData data; List list; for (int i = 0; i < objects.length; i++) { list = getDataObjectAnnotation(i); data = ((AnnotationData) list.get(0)); date = data.getLastModified(); if (date == null) date = new Timestamp(new Date().getTime());; listModel.addElement(objects[i]+" ("+df.format(date)+")"); } } | private void formatList(String[] objects) { // remove all users from list before adding new listModel.removeAllElements(); // add each user to list Timestamp date; DateFormat df = DateFormat.getDateInstance(); AnnotationData data; List list; for (int i = 0; i < objects.length; i++) { list = getDataObjectAnnotation(i); data = ((AnnotationData) list.get(0)); date = data.getLastModified(); if (date == null) date = new Timestamp(new Date().getTime());; listModel.addElement(objects[i]+" ("+df.format(date)+")"); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorUI.java |
{ Map annotations = model.getAnnotations(); Long ownerID = (Long) annotatedMap.get(new Integer(index)); if (ownerID == null) return new ArrayList(); return (List) annotations.get(ownerID); } | { Map annotations = model.getAnnotations(); Long ownerID = (Long) annotatedMap.get(new Integer(index)); if (ownerID == null) return new ArrayList(); return (List) annotations.get(ownerID); } | private List getDataObjectAnnotation(int index) { Map annotations = model.getAnnotations(); Long ownerID = (Long) annotatedMap.get(new Integer(index)); if (ownerID == null) return new ArrayList(); //empty list return (List) annotations.get(ownerID); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorUI.java |
{ messageComponent = new JPanel(); messageComponent.setLayout(new BoxLayout(messageComponent, | { messageComponent = new JPanel(); messageComponent.setLayout(new BoxLayout(messageComponent, | private void initComponents() { messageComponent = new JPanel(); messageComponent.setLayout(new BoxLayout(messageComponent, BoxLayout.Y_AXIS)); messageComponent.add(new JLabel(MESSAGE)); messageComponent.add(new JLabel(BODY)); messageComponent.setVisible(false); annotatedMap = new HashMap(); annotationArea = new MultilineLabel(); annotationArea.setBorder(new TitledBorder("Annotation")); annotationArea.setEditable(true); listModel = new DefaultListModel(); annotatedList = new JList(listModel); listComponent = new JScrollPane(annotatedList); listComponent.setVisible(false); annotatedList.setBorder(new TitledBorder("Annotated items")); annotatedList.setSelectionMode( ListSelectionModel.SINGLE_INTERVAL_SELECTION); annotatedList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 1) { showSingleAnnotation(); } } }); annotationArea.getDocument().addDocumentListener( new DocumentListener() { /** * Indicates that the object is annotated. * @see DocumentListener#insertUpdate(DocumentEvent) */ public void insertUpdate(DocumentEvent de) { handleAnnotationAreaInsert(); } /** * Indicates that the object is annotated. * @see DocumentListener#removeUpdate(DocumentEvent) */ public void removeUpdate(DocumentEvent de) { handleAnnotationAreaInsert(); } /** * Required by I/F but no-op implementation in our case. * @see DocumentListener#changedUpdate(DocumentEvent) */ public void changedUpdate(DocumentEvent de) {} }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorUI.java |
messageComponent.add(new JLabel(MESSAGE)); | messageComponent.add(new JLabel(MESSAGE)); | private void initComponents() { messageComponent = new JPanel(); messageComponent.setLayout(new BoxLayout(messageComponent, BoxLayout.Y_AXIS)); messageComponent.add(new JLabel(MESSAGE)); messageComponent.add(new JLabel(BODY)); messageComponent.setVisible(false); annotatedMap = new HashMap(); annotationArea = new MultilineLabel(); annotationArea.setBorder(new TitledBorder("Annotation")); annotationArea.setEditable(true); listModel = new DefaultListModel(); annotatedList = new JList(listModel); listComponent = new JScrollPane(annotatedList); listComponent.setVisible(false); annotatedList.setBorder(new TitledBorder("Annotated items")); annotatedList.setSelectionMode( ListSelectionModel.SINGLE_INTERVAL_SELECTION); annotatedList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 1) { showSingleAnnotation(); } } }); annotationArea.getDocument().addDocumentListener( new DocumentListener() { /** * Indicates that the object is annotated. * @see DocumentListener#insertUpdate(DocumentEvent) */ public void insertUpdate(DocumentEvent de) { handleAnnotationAreaInsert(); } /** * Indicates that the object is annotated. * @see DocumentListener#removeUpdate(DocumentEvent) */ public void removeUpdate(DocumentEvent de) { handleAnnotationAreaInsert(); } /** * Required by I/F but no-op implementation in our case. * @see DocumentListener#changedUpdate(DocumentEvent) */ public void changedUpdate(DocumentEvent de) {} }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorUI.java |
messageComponent.setVisible(false); annotatedMap = new HashMap(); annotationArea = new MultilineLabel(); annotationArea.setBorder(new TitledBorder("Annotation")); annotationArea.setEditable(true); listModel = new DefaultListModel(); annotatedList = new JList(listModel); listComponent = new JScrollPane(annotatedList); listComponent.setVisible(false); annotatedList.setBorder(new TitledBorder("Annotated items")); annotatedList.setSelectionMode( | messageComponent.setVisible(false); annotatedMap = new HashMap(); annotationArea = new MultilineLabel(); annotationArea.setBorder(new TitledBorder("Annotation")); annotationArea.setEditable(true); listModel = new DefaultListModel(); annotatedList = new JList(listModel); listComponent = new JScrollPane(annotatedList); listComponent.setVisible(false); annotatedList.setBorder(new TitledBorder("Annotated items")); annotatedList.setSelectionMode( | private void initComponents() { messageComponent = new JPanel(); messageComponent.setLayout(new BoxLayout(messageComponent, BoxLayout.Y_AXIS)); messageComponent.add(new JLabel(MESSAGE)); messageComponent.add(new JLabel(BODY)); messageComponent.setVisible(false); annotatedMap = new HashMap(); annotationArea = new MultilineLabel(); annotationArea.setBorder(new TitledBorder("Annotation")); annotationArea.setEditable(true); listModel = new DefaultListModel(); annotatedList = new JList(listModel); listComponent = new JScrollPane(annotatedList); listComponent.setVisible(false); annotatedList.setBorder(new TitledBorder("Annotated items")); annotatedList.setSelectionMode( ListSelectionModel.SINGLE_INTERVAL_SELECTION); annotatedList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 1) { showSingleAnnotation(); } } }); annotationArea.getDocument().addDocumentListener( new DocumentListener() { /** * Indicates that the object is annotated. * @see DocumentListener#insertUpdate(DocumentEvent) */ public void insertUpdate(DocumentEvent de) { handleAnnotationAreaInsert(); } /** * Indicates that the object is annotated. * @see DocumentListener#removeUpdate(DocumentEvent) */ public void removeUpdate(DocumentEvent de) { handleAnnotationAreaInsert(); } /** * Required by I/F but no-op implementation in our case. * @see DocumentListener#changedUpdate(DocumentEvent) */ public void changedUpdate(DocumentEvent de) {} }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorUI.java |
annotatedList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { | annotatedList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { | private void initComponents() { messageComponent = new JPanel(); messageComponent.setLayout(new BoxLayout(messageComponent, BoxLayout.Y_AXIS)); messageComponent.add(new JLabel(MESSAGE)); messageComponent.add(new JLabel(BODY)); messageComponent.setVisible(false); annotatedMap = new HashMap(); annotationArea = new MultilineLabel(); annotationArea.setBorder(new TitledBorder("Annotation")); annotationArea.setEditable(true); listModel = new DefaultListModel(); annotatedList = new JList(listModel); listComponent = new JScrollPane(annotatedList); listComponent.setVisible(false); annotatedList.setBorder(new TitledBorder("Annotated items")); annotatedList.setSelectionMode( ListSelectionModel.SINGLE_INTERVAL_SELECTION); annotatedList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 1) { showSingleAnnotation(); } } }); annotationArea.getDocument().addDocumentListener( new DocumentListener() { /** * Indicates that the object is annotated. * @see DocumentListener#insertUpdate(DocumentEvent) */ public void insertUpdate(DocumentEvent de) { handleAnnotationAreaInsert(); } /** * Indicates that the object is annotated. * @see DocumentListener#removeUpdate(DocumentEvent) */ public void removeUpdate(DocumentEvent de) { handleAnnotationAreaInsert(); } /** * Required by I/F but no-op implementation in our case. * @see DocumentListener#changedUpdate(DocumentEvent) */ public void changedUpdate(DocumentEvent de) {} }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorUI.java |
} }); annotationArea.getDocument().addDocumentListener( | } }); annotationArea.getDocument().addDocumentListener( | private void initComponents() { messageComponent = new JPanel(); messageComponent.setLayout(new BoxLayout(messageComponent, BoxLayout.Y_AXIS)); messageComponent.add(new JLabel(MESSAGE)); messageComponent.add(new JLabel(BODY)); messageComponent.setVisible(false); annotatedMap = new HashMap(); annotationArea = new MultilineLabel(); annotationArea.setBorder(new TitledBorder("Annotation")); annotationArea.setEditable(true); listModel = new DefaultListModel(); annotatedList = new JList(listModel); listComponent = new JScrollPane(annotatedList); listComponent.setVisible(false); annotatedList.setBorder(new TitledBorder("Annotated items")); annotatedList.setSelectionMode( ListSelectionModel.SINGLE_INTERVAL_SELECTION); annotatedList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 1) { showSingleAnnotation(); } } }); annotationArea.getDocument().addDocumentListener( new DocumentListener() { /** * Indicates that the object is annotated. * @see DocumentListener#insertUpdate(DocumentEvent) */ public void insertUpdate(DocumentEvent de) { handleAnnotationAreaInsert(); } /** * Indicates that the object is annotated. * @see DocumentListener#removeUpdate(DocumentEvent) */ public void removeUpdate(DocumentEvent de) { handleAnnotationAreaInsert(); } /** * Required by I/F but no-op implementation in our case. * @see DocumentListener#changedUpdate(DocumentEvent) */ public void changedUpdate(DocumentEvent de) {} }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorUI.java |
} | } | private void initComponents() { messageComponent = new JPanel(); messageComponent.setLayout(new BoxLayout(messageComponent, BoxLayout.Y_AXIS)); messageComponent.add(new JLabel(MESSAGE)); messageComponent.add(new JLabel(BODY)); messageComponent.setVisible(false); annotatedMap = new HashMap(); annotationArea = new MultilineLabel(); annotationArea.setBorder(new TitledBorder("Annotation")); annotationArea.setEditable(true); listModel = new DefaultListModel(); annotatedList = new JList(listModel); listComponent = new JScrollPane(annotatedList); listComponent.setVisible(false); annotatedList.setBorder(new TitledBorder("Annotated items")); annotatedList.setSelectionMode( ListSelectionModel.SINGLE_INTERVAL_SELECTION); annotatedList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 1) { showSingleAnnotation(); } } }); annotationArea.getDocument().addDocumentListener( new DocumentListener() { /** * Indicates that the object is annotated. * @see DocumentListener#insertUpdate(DocumentEvent) */ public void insertUpdate(DocumentEvent de) { handleAnnotationAreaInsert(); } /** * Indicates that the object is annotated. * @see DocumentListener#removeUpdate(DocumentEvent) */ public void removeUpdate(DocumentEvent de) { handleAnnotationAreaInsert(); } /** * Required by I/F but no-op implementation in our case. * @see DocumentListener#changedUpdate(DocumentEvent) */ public void changedUpdate(DocumentEvent de) {} }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorUI.java |
} | } | public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 1) { showSingleAnnotation(); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorUI.java |
{ int index = annotatedList.getSelectedIndex(); if (index == -1) return; List list = getDataObjectAnnotation(index); if (list.size() > 0) { AnnotationData data = (AnnotationData) list.get(0); annotationArea.setText(data.getText()); } } | { int index = annotatedList.getSelectedIndex(); if (index == -1) return; List list = getDataObjectAnnotation(index); if (list.size() > 0) { AnnotationData data = (AnnotationData) list.get(0); annotationArea.setText(data.getText()); } } | private void showSingleAnnotation() { int index = annotatedList.getSelectedIndex(); if (index == -1) return; List list = getDataObjectAnnotation(index); if (list.size() > 0) { AnnotationData data = (AnnotationData) list.get(0); annotationArea.setText(data.getText()); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/464efde90db6bc5095c0a7e5952f51ad0f37ca86/AnnotatorUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/util/annotator/view/AnnotatorUI.java |
menu.add(new JMenuItem( controller.getAction(HiViewerControl.VIEW_CGCI))); menu.add(new JSeparator(JSeparator.HORIZONTAL)); | private JMenu createViewMenu() { JMenu menu = new JMenu("View"); menu.setMnemonic(KeyEvent.VK_V); //menu.add(new JMenuItem(controller.getAction(HiViewerControl.VIEW_PDI))); //menu.add(new JMenuItem( //s controller.getAction(HiViewerControl.VIEW_CGCI))); //menu.add(new JSeparator(JSeparator.HORIZONTAL)); JCheckBoxMenuItem item = new JCheckBoxMenuItem(); item.setSelected(false); item.setText(TreeViewAction.NAME); item.setAction(controller.getAction(HiViewerControl.TREE_VIEW)); //menu.add(item); item = new JCheckBoxMenuItem(); item.setSelected(true); item.setAction(controller.getAction(HiViewerControl.CLIPBOARD_VIEW)); item.setText(ClipBoardViewAction.NAME); //menu.add(item); item = new JCheckBoxMenuItem(); item.setSelected(model.isTitleBarVisible()); item.setAction(controller.getAction(HiViewerControl.SHOW_TITLEBAR)); menu.add(item); //item = new JCheckBoxMenuItem(); //item.setSelected(model.isRollOver()); //item.setAction(controller.getAction(HiViewerControl.ROLL_OVER)); //menu.add(item); menu.add(new JSeparator(SwingConstants.HORIZONTAL)); JMenuItem mi = new JMenuItem( controller.getAction(HiViewerControl.ZOOM_IN)); mi.setText(ZoomInAction.NAME); menu.add(mi); mi = new JMenuItem(controller.getAction(HiViewerControl.ZOOM_OUT)); mi.setText(ZoomOutAction.NAME); menu.add(mi); mi = new JMenuItem(controller.getAction(HiViewerControl.ZOOM_FIT)); mi.setText(ZoomFitAction.NAME); menu.add(mi); menu.add(new JSeparator(SwingConstants.HORIZONTAL)); menu.add(createLayoutMenu()); return menu; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/146920a8791fff71320ced0f240b9d8f3d319a13/HiViewerWin.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerWin.java |
|
System.err.println("looking at dataset ..."+browserDataset.getID()); | private BrowserDatasetData findDatasetData(int dsId) { // go through some silliness to find the BrowserDatasetData // that corresponds to ds. must look at _all_ datasets - not // just those currently being displayed Iterator iter = allDatasets.iterator(); BrowserDatasetData browserDataset = null; while (iter.hasNext()) { browserDataset = (BrowserDatasetData) iter.next(); System.err.println("looking at dataset ..."+browserDataset.getID()); if (browserDataset.getID() == dsId) { return browserDataset; } } return null; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e1c1190cf5c65047948165a5ab4e76d3d8909851/DatasetBrowserCanvas.java/buggy/SRC/org/openmicroscopy/shoola/agents/zoombrowser/piccolo/DatasetBrowserCanvas.java |
|
System.err.println("selecting exec with ds ..."+dsId); | public void selectChainExecution(ChainExecutionData exec) { if (exec == null) { setSelectedDataset(null); return; } DatasetData ds = exec.getDataset(); int dsId = ds.getID(); System.err.println("selecting exec with ds ..."+dsId); DatasetNode n = null; BrowserDatasetData browserDataset = findDatasetData(dsId); if (browserDataset != null) n = browserDataset.getNode(); System.err.println("found dataset data.."+browserDataset); // make what I've found selected if (n != null) { // if it isn't displayed, display all if (n.getParent() != layer) doLayout(allDatasets); eventHandler.animateToNode(n); } setSelectedDataset(browserDataset); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e1c1190cf5c65047948165a5ab4e76d3d8909851/DatasetBrowserCanvas.java/buggy/SRC/org/openmicroscopy/shoola/agents/zoombrowser/piccolo/DatasetBrowserCanvas.java |
|
System.err.println("found dataset data.."+browserDataset); | public void selectChainExecution(ChainExecutionData exec) { if (exec == null) { setSelectedDataset(null); return; } DatasetData ds = exec.getDataset(); int dsId = ds.getID(); System.err.println("selecting exec with ds ..."+dsId); DatasetNode n = null; BrowserDatasetData browserDataset = findDatasetData(dsId); if (browserDataset != null) n = browserDataset.getNode(); System.err.println("found dataset data.."+browserDataset); // make what I've found selected if (n != null) { // if it isn't displayed, display all if (n.getParent() != layer) doLayout(allDatasets); eventHandler.animateToNode(n); } setSelectedDataset(browserDataset); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e1c1190cf5c65047948165a5ab4e76d3d8909851/DatasetBrowserCanvas.java/buggy/SRC/org/openmicroscopy/shoola/agents/zoombrowser/piccolo/DatasetBrowserCanvas.java |
|
if (dataset !=null) System.err.println("setting selected dataset .."+dataset.getID()); | public void setSelectedDataset(BrowserDatasetData dataset) { // if they're the same, return // except for if it's null. then we might need to redraw if (dataset == selectedDataset && dataset != null) return; if (selectedDataset != null) selectedDataset.getNode().setHighlighted(false); if (dataset !=null) System.err.println("setting selected dataset .."+dataset.getID()); selectedDataset = dataset; // if a dataset is clicked on to be selected, it has already // told the canvas to draw to it. if (selectedDataset == null) { // selected is not null display it Collection datasetsToDisplay = allDatasets; displayDatasets(datasetsToDisplay); } mainWindow.setSelectedDataset(dataset); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e1c1190cf5c65047948165a5ab4e76d3d8909851/DatasetBrowserCanvas.java/buggy/SRC/org/openmicroscopy/shoola/agents/zoombrowser/piccolo/DatasetBrowserCanvas.java |
|
public static void main(String args[]) { int i, j, n = Integer.parseInt(args[0]); int x[] = new int[n]; int y[] = new int[n]; for (i = 0; i < n; i++) x[i] = i ; for (j = n-1; j >= 0; j--) y[j] = x[j]; System.out.println(y[n-1]); } | 53330 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53330/eb6c850277407b38bcaefb81155941da0f27b849/ary.java/buggy/tests/shootout/java-start/ary.java |
||
TitlePanel titlePanel = new TitlePanel(Res.getString("title.add.contact.group"), Res.getString("message.add.contact.to.list"), SparkRes.getImageIcon(SparkRes.USER1_32x32), true); | TitlePanel titlePanel = new TitlePanel(Res.getString("title.add.contact"), Res.getString("message.add.contact.to.list"), SparkRes.getImageIcon(SparkRes.USER1_32x32), true); | public void showRosterDialog(JFrame parent) { TitlePanel titlePanel = new TitlePanel(Res.getString("title.add.contact.group"), Res.getString("message.add.contact.to.list"), SparkRes.getImageIcon(SparkRes.USER1_32x32), true); JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); mainPanel.add(titlePanel, BorderLayout.NORTH); Object[] options = { Res.getString("add"), Res.getString("cancel") }; pane = new JOptionPane(panel, -1, 2, null, options, options[0]); mainPanel.add(pane, BorderLayout.CENTER); dialog = new JDialog(parent, Res.getString("title.add.contact"), true); dialog.pack(); dialog.setContentPane(mainPanel); dialog.setSize(350, 250); dialog.setLocationRelativeTo(parent); pane.addPropertyChangeListener(this); dialog.setVisible(true); dialog.toFront(); dialog.requestFocus(); jidField.requestFocus(); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/f0a2c9275d080f9ce27d62fcb2dc726a0b45bb64/RosterDialog.java/buggy/src/java/org/jivesoftware/spark/ui/RosterDialog.java |
return pathname.endsWith(".jar") || pathname.endsWith(".zip") || pathname.endsWith(".war") || pathname.endsWith(".ear") || pathname.endsWith(".sar"); | return ArchiveUtil.isArchive(pathname); | boolean isArchive() { if (!isFile()) { return false; } return pathname.endsWith(".jar") || pathname.endsWith(".zip") || pathname.endsWith(".war") || pathname.endsWith(".ear") || pathname.endsWith(".sar"); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/ea44d50de680cfb1f234670ee0209ccd6aa03416/CoberturaFile.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/CoberturaFile.java |
listeners = new HashSet(); | public BrowserManager() { browserList = new ArrayList(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e83036080b3a8ade884eca150f3f3c2004b556c9/BrowserManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/BrowserManager.java |
|
localNames.decreaseBlockLevel(); | localNames.setBlockLevel(localNames.getBlockLevel() - 1); | public StackElement pop() { localNames.decreaseBlockLevel(); return super.pop(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/bfbf574a72dd640d8cff4544774a0d26a18665d8/BlockNamesStack.java/clean/src/org/jruby/parser/BlockNamesStack.java |
localNames.increaseBlockLevel(); | localNames.setBlockLevel(localNames.getBlockLevel() + 1); | public void push(StackElement newElement) { localNames.increaseBlockLevel(); super.push(newElement); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/bfbf574a72dd640d8cff4544774a0d26a18665d8/BlockNamesStack.java/clean/src/org/jruby/parser/BlockNamesStack.java |
Java.createJavaModule(this); | private void initCoreClasses() { ObjectMetaClass objectMetaClass = new ObjectMetaClass(this); objectMetaClass.initializeClass(); objectClass = objectMetaClass; objectClass.setConstant("Object", objectClass); RubyClass moduleClass = new ModuleMetaClass(this, objectClass); objectClass.setConstant("Module", moduleClass); RubyClass classClass = new RubyClass(this, null /* Would be Class if it could */, moduleClass, null, "Class"); objectClass.setConstant("Class", classClass); // I don't think the containment is correct here (parent cref) RubyClass metaClass = objectClass.makeMetaClass(classClass, objectMetaClass.getCRef()); metaClass = moduleClass.makeMetaClass(metaClass, objectMetaClass.getCRef()); metaClass = classClass.makeMetaClass(metaClass, objectMetaClass.getCRef()); ((ObjectMetaClass) moduleClass).initializeBootstrapClass(); kernelModule = RubyKernel.createKernelModule(this); objectClass.includeModule(kernelModule); RubyClass.createClassClass(classClass); nilClass = RubyNil.createNilClass(this); // We cannot define this constant until nil itself was made objectClass.defineConstant("NIL", getNil()); // Pre-create the core classes we know we will get referenced by starting up the runtime. RubyBoolean.createFalseClass(this); RubyBoolean.createTrueClass(this); RubyComparable.createComparable(this); RubyEnumerable.createEnumerableModule(this); stringClass = new StringMetaClass(this); stringClass.initializeClass(); new SymbolMetaClass(this).initializeClass(); RubyThreadGroup.createThreadGroupClass(this); RubyThread.createThreadClass(this); RubyException.createExceptionClass(this); RubyPrecision.createPrecisionModule(this); new NumericMetaClass(this).initializeClass(); new IntegerMetaClass(this).initializeClass(); fixnumClass = new FixnumMetaClass(this); fixnumClass.initializeClass(); new HashMetaClass(this).initializeClass(); new IOMetaClass(this).initializeClass(); new ArrayMetaClass(this).initializeClass(); Java.createJavaModule(this); RubyClass structClass = RubyStruct.createStructClass(this); tmsStruct = RubyStruct.newInstance(structClass, new IRubyObject[] { newString("Tms"), newSymbol("utime"), newSymbol("stime"), newSymbol("cutime"), newSymbol("cstime")}); RubyFloat.createFloatClass(this); new BignumMetaClass(this).initializeClass(); new BindingMetaClass(this).initializeClass(); RubyMath.createMathModule(this); // depends on all numeric types RubyRegexp.createRegexpClass(this); RubyRange.createRangeClass(this); RubyObjectSpace.createObjectSpaceModule(this); RubyGC.createGCModule(this); new ProcMetaClass(this).initializeClass(); RubyMethod.createMethodClass(this); RubyMatchData.createMatchDataClass(this); RubyMarshal.createMarshalModule(this); RubyDir.createDirClass(this); RubyFileTest.createFileTestModule(this); new FileMetaClass(this).initializeClass(); // depends on IO, FileTest RubyProcess.createProcessModule(this); new TimeMetaClass(this).initializeClass(); RubyUnboundMethod.defineUnboundMethodClass(this); RubyClass exceptionClass = getClass("Exception"); RubyClass standardError = defineClass("StandardError", exceptionClass); RubyClass runtimeError = defineClass("RuntimeError", standardError); RubyClass ioError = defineClass("IOError", standardError); RubyClass scriptError = defineClass("ScriptError", exceptionClass); RubyClass nameError = RubyNameError.createNameErrorClass(this, standardError); RubyClass rangeError = defineClass("RangeError", standardError); defineClass("SystemExit", exceptionClass); defineClass("Fatal", exceptionClass); defineClass("Interrupt", exceptionClass); defineClass("SignalException", exceptionClass); defineClass("TypeError", standardError); defineClass("ArgumentError", standardError); defineClass("IndexError", standardError); defineClass("SyntaxError", scriptError); defineClass("LoadError", scriptError); defineClass("NotImplementedError", scriptError); defineClass("NoMethodError", nameError); defineClass("SecurityError", standardError); defineClass("NoMemoryError", exceptionClass); defineClass("RegexpError", standardError); defineClass("EOFError", ioError); defineClass("LocalJumpError", standardError); defineClass("ThreadError", standardError); defineClass("SystemStackError", exceptionClass); defineClass("ZeroDivisionError", standardError); // FIXME: Actually this somewhere defineClass("FloatDomainError", rangeError); NativeException.createClass(this, runtimeError); systemCallError = defineClass("SystemCallError", standardError); errnoModule = defineModule("Errno"); initErrnoErrors(); defineClass("Data",objectClass); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f621b644a7b64cb12bdf5d848d9e284e023964f4/Ruby.java/clean/src/org/jruby/Ruby.java |
|
loadService.registerBuiltin("java.rb", new BuiltinScript("javasupport")); | loadService.registerBuiltin("java.rb", new Library() { public void load(IRuby runtime) throws IOException { Java.createJavaModule(runtime); new BuiltinScript("javasupport").load(runtime); } }); | private void initLibraries() { loadService = new LoadService(this); loadService.registerBuiltin("java.rb", new BuiltinScript("javasupport")); loadService.registerBuiltin("socket.rb", new SocketLibrary()); loadService.registerBuiltin("rbconfig.rb", new RbConfigLibrary()); for (int i=0; i<BUILTIN_LIBRARIES.length; i++) { loadService.registerRubyBuiltin(BUILTIN_LIBRARIES[i]); } loadService.registerBuiltin("jruby.rb", new JRubyLibrary()); loadService.registerBuiltin("iconv.rb", new IConvLibrary()); loadService.registerBuiltin("stringio.rb", new StringIOLibrary()); loadService.registerBuiltin("strscan.rb", new StringScannerLibrary()); loadService.registerBuiltin("zlib.rb", new ZlibLibrary()); loadService.registerBuiltin("yaml_internal.rb", new YamlLibrary()); loadService.registerBuiltin("enumerator.rb", new EnumeratorLibrary()); loadService.registerBuiltin("readline.rb", new Readline.Service()); loadService.registerBuiltin("openssl.so", new RubyOpenSSL.Service()); loadService.registerBuiltin("digest.so", new DigestLibrary()); loadService.registerBuiltin("digest.rb", new DigestLibrary()); loadService.registerBuiltin("digest/md5.rb", new DigestLibrary.MD5()); loadService.registerBuiltin("digest/rmd160.rb", new DigestLibrary.RMD160()); loadService.registerBuiltin("digest/sha1.rb", new DigestLibrary.SHA1()); loadService.registerBuiltin("digest/sha2.rb", new DigestLibrary.SHA2()); loadService.registerBuiltin("bigdecimal.rb", new BigDecimalLibrary()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f621b644a7b64cb12bdf5d848d9e284e023964f4/Ruby.java/clean/src/org/jruby/Ruby.java |
in.close(); | if (in != null) in.close(); | public void parse() throws IOException, TemplateException { if (!_parsed) { Block newContent = null; Map newParameters = null; Map newMacros = null; Reader in = null; try { Parser parser = getParser(); in = getReader(); BlockBuilder bb = parser.parseBlock(getName(), in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getMap(); newMacros = bc.getMacros(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data", be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } catch (Exception e) { _log.error("Error parsing template: " + this, e); throw new BuildException("Error parsing template: " + this, e); } finally { try { in.close(); } catch (Exception e) { } _parameters = newParameters; _content = newContent; _macros = newMacros; _parsed = true; } } else { _log.debug("Ignoring parse request on already parsed template " + this); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8f5880751893a7e5dd9da25d036747a39c9b25b5/WMTemplate.java/buggy/webmacro/src/org/webmacro/engine/WMTemplate.java |
return getTemplate(templateName); | Template t = getTemplate(templateName); return t; | public Template handle(WebContext context) throws HandlerException { Object output = new Object(); String templateName; // get the form variables output = (String) context.getForm("loadFile"); name = (String) context.getForm("name"); email = (String) context.getForm("email"); comment = (String) context.getForm("comment"); if (output == null) { output = "form.wm"; templateName = "form.wm"; } if (name == null) { name = "<!-- form variable 'name' not defined -->"; } if (email == null) { email = "<!-- form variable 'email' not defined -->"; } if (comment == null) { comment = "<!-- form variable 'comment' not defined -->"; } // verifying for submissions if (output.equals("verify")) { myGuestEntry = new GuestEntry(name, email, comment); book.addElement(myGuestEntry); context.put("registry", book); templateName = "verify.wm"; // for guest book view } else if (output.equals("allguest")) { context.put("registry",book); templateName = "allguest.wm"; // default } else { templateName = "form.wm"; } // return the appropriate template try { return getTemplate(templateName); } catch (Exception e) { throw new HandlerException("Could not locate template: " + templateName); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4f312fd00a74365a2671f796aeebcfbe9888b8cc/GuestBook.java/clean/webmacro/examples/GuestBook.java |
defineGlobalDEBUG(runtime); | private void initializeRuntime(final IRuby runtime, String filename) { IRubyObject argumentArray = runtime.newArray(JavaUtil.convertJavaArrayToRuby(runtime, commandline.getScriptArguments())); runtime.setVerbose(runtime.newBoolean(commandline.isVerbose())); defineGlobalVERBOSE(runtime); runtime.getObject().setConstant("$VERBOSE", commandline.isVerbose() ? runtime.getTrue() : runtime.getNil()); runtime.defineGlobalConstant("ARGV", argumentArray); defineGlobal(runtime, "$-p", commandline.isAssumePrinting()); defineGlobal(runtime, "$-n", commandline.isAssumeLoop()); defineGlobal(runtime, "$-a", commandline.isSplit()); defineGlobal(runtime, "$-l", commandline.isProcessLineEnds()); runtime.getGlobalVariables().defineReadonly("$*", new ValueAccessor(argumentArray)); // TODO this is a fake cause we have no real process number in Java runtime.getGlobalVariables().defineReadonly("$$", new ValueAccessor(runtime.newFixnum(runtime.hashCode()))); runtime.defineVariable(new RubyGlobal.StringGlobalVariable(runtime, "$0", runtime.newString(filename))); runtime.getLoadService().init(commandline.loadPaths()); Iterator iter = commandline.requiredLibraries().iterator(); while (iter.hasNext()) { String scriptName = (String) iter.next(); RubyKernel.require(runtime.getTopSelf(), runtime.newString(scriptName)); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a5d41074f98a47c0108b1a75c44775c0f6e4e87b/Main.java/buggy/src/org/jruby/Main.java |
|
out.println(" -d set debugging flags (set $DEBUG to true)"); out.println(" -v print version number, then turn on verbose mode"); | public void printUsage() { if (!hasPrintedUsage) { out.println("Usage: jruby [switches] [--] [rubyfile.rb] [arguments]"); out.println(" -e 'command' one line of script. Several -e's allowed. Omit [programfile]"); out.println(" -b benchmark mode, times the script execution"); out.println(" -Idirectory specify $LOAD_PATH directory (may be used more than once)"); out.println(" -- optional -- before rubyfile.rb for compatibility with ruby"); out.println(" -O run with ObjectSpace disabled (improves performance)"); out.println(" -C pre-compile scripts before running (EXPERIMENTAL)"); hasPrintedUsage = true; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a5d41074f98a47c0108b1a75c44775c0f6e4e87b/Main.java/buggy/src/org/jruby/Main.java |
|
registry.getUserNotifier().notifyInfo("Data Saving Cancellation", info); | public void handleCancellation() { String info = "The data saving has been cancelled."; registry.getLogger().info(this, info); // registry.getUserNotifier().notifyInfo("Data Saving Cancellation", // info); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9794ffbd035a4de717ee211573b4844dd0eb3371/EditorLoader.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/EditorLoader.java |
|
firePropertyChange(LOCALIZE_IMAGE_DISPLAY, oldObject, newObject); | firePropertyChange(ClipBoard.LOCALIZE_IMAGE_DISPLAY, oldObject, newObject); | void setSelectedNode() { DefaultMutableTreeNode node = (DefaultMutableTreeNode) getLastSelectedPathComponent(); if (selectedNode == node) return; ImageDisplay newObject = (ImageDisplay) node.getUserObject(); ImageDisplay oldObject = null; if (selectedNode != null) oldObject = (ImageDisplay) selectedNode.getUserObject(); firePropertyChange(LOCALIZE_IMAGE_DISPLAY, oldObject, newObject); selectedNode = node; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b4992016524102ee0a5c7465d4cc7a94e9ffce2d/SearchResultsPane.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/SearchResultsPane.java |
return getCurrentFrame().isBlockGiven(); | return getCurrentFrame().isBlockGiven() && blockStack.peek() != null; | public boolean isBlockGiven() { return getCurrentFrame().isBlockGiven(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/50d6342dd5da06c42d25bc955addce6aaa0e6b97/ThreadContext.java/buggy/src/org/jruby/runtime/ThreadContext.java |
prev != null ? prev.cloneBlock() : null, | prev, | public RubyBlock cloneBlock() { return new RubyBlock( var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev != null ? prev.cloneBlock() : null, ruby); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e774974ded4f5d3e83d7f3e7d5f152a6de3fffee/RubyBlock.java/buggy/org/jruby/runtime/RubyBlock.java |
return null; | return "RecentChanges"; | public String getWikiPageName(WikiSystem wiki, WebContext wc) { return null; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/76bb847e1a32516a74762100398ded03f39feec8/RecentChangesAction.java/buggy/wiki/src/org/tcdi/opensource/wiki/servlet/RecentChangesAction.java |
isName = false; | ProjectEditorManager(ProjectEditor view, DataManagerCtrl agentCtrl, ProjectData model) { this.view = view; this.agentCtrl = agentCtrl; this.model = model; nameChange = false; isName = false; datasetsToRemove = new ArrayList(); datasetsToAdd = new ArrayList(); datasetsToAddToRemove = new ArrayList(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1ed79437fda6d8f6b2566c6fe677bfaaf3352055/ProjectEditorManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/editors/project/ProjectEditorManager.java |
|
nameField.addMouseListener(this); | void initListeners() { //buttons attachButtonListener(view.getViewButton(), VIEW); attachButtonListener(view.getSaveButton(), SAVE); attachButtonListener(view.getAddButton(), ADD); attachButtonListener(view.getRemoveButton(), REMOVE); attachButtonListener(view.getResetButton(), RESET); attachButtonListener(view.getRemoveToAddButton(), REMOVE_ADDED); attachButtonListener(view.getResetToAddButton(), RESET_ADDED); //text fields. JTextArea nameField = view.getNameField(); nameField.getDocument().addDocumentListener(this); nameField.addMouseListener(this); JTextArea descriptionArea = view.getDescriptionArea(); descriptionArea.getDocument().addDocumentListener(this); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1ed79437fda6d8f6b2566c6fe677bfaaf3352055/ProjectEditorManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/editors/project/ProjectEditorManager.java |
|
view.getSaveButton().setEnabled(isName); | view.getSaveButton().setEnabled(true); | public void insertUpdate(DocumentEvent e) { view.getSaveButton().setEnabled(isName); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1ed79437fda6d8f6b2566c6fe677bfaaf3352055/ProjectEditorManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/editors/project/ProjectEditorManager.java |
view.getSaveButton().setEnabled(isName); | view.getSaveButton().setEnabled(true); | public void removeUpdate(DocumentEvent e) { view.getSaveButton().setEnabled(isName); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1ed79437fda6d8f6b2566c6fe677bfaaf3352055/ProjectEditorManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/editors/project/ProjectEditorManager.java |
LocalPreferences localPref = SettingsManager.getLocalPreferences(); if (localPref.isIdleOn()) { int delay = localPref.getIdleTime() * 60000; if (Spark.isWindows()) { try { setIdleListener(delay); } catch (Exception e) { Log.error(e); } | if (Spark.isWindows()) { try { setIdleListener(); } catch (Exception e) { Log.error(e); | public void initializeSession(XMPPConnection connection, String username, String password) { this.connection = connection; this.username = username; this.password = password; this.userBareAddress = StringUtils.parseBareAddress(connection.getUser()); // create workgroup session personalDataManager = new PrivateDataManager(getConnection()); LocalPreferences localPref = SettingsManager.getLocalPreferences(); // Start Idle listener if (localPref.isIdleOn()) { int delay = localPref.getIdleTime() * 60000; if (Spark.isWindows()) { try { setIdleListener(delay); } catch (Exception e) { Log.error(e); } } } // Discover items discoverItems(); ProviderManager.addExtensionProvider("event", "http://jabber.org/protocol/disco#info", new Features.Provider()); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/743d2e6b128400d102d4977992944808419ad957/SessionManager.java/clean/src/java/org/jivesoftware/spark/SessionManager.java |
private void setIdleListener(final long mill) throws Exception { | private void setIdleListener() throws Exception { | private void setIdleListener(final long mill) throws Exception { final Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > mill) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus("User has locked their workstation."); } else { p.setStatus("Away due to idle."); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } } }, 1000, 1000); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/743d2e6b128400d102d4977992944808419ad957/SessionManager.java/clean/src/java/org/jivesoftware/spark/SessionManager.java |
if (idleTime > mill) { | if (idleTime > delay) { | private void setIdleListener(final long mill) throws Exception { final Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > mill) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus("User has locked their workstation."); } else { p.setStatus("Away due to idle."); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } } }, 1000, 1000); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/743d2e6b128400d102d4977992944808419ad957/SessionManager.java/clean/src/java/org/jivesoftware/spark/SessionManager.java |
if (idleTime > mill) { | if (idleTime > delay) { | public void run() { long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > mill) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus("User has locked their workstation."); } else { p.setStatus("Away due to idle."); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/743d2e6b128400d102d4977992944808419ad957/SessionManager.java/clean/src/java/org/jivesoftware/spark/SessionManager.java |
buttonPanel.add(Box.createHorizontalStrut(250)); | buttonPanel.add(Box.createHorizontalStrut(100)); buttonPanel.add(setDefaultBtn); buttonPanel.add(Box.createHorizontalStrut(50)); | void buildUI() { JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); panel.add(createLabelText(groupNameLabel, groupName, 20)); panel.add(Box.createRigidArea(new Dimension(5, 5))); panel.add(createLabelText(descriptionLabel, description, 60)); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS)); buttonPanel.add(Box.createHorizontalStrut(250)); buttonPanel.add(saveBtn); panel.add(buttonPanel); panel.add(Box.createVerticalStrut(50)); JPanel userGroupListButtonPanel = new JPanel(); userGroupListButtonPanel.setLayout(new BoxLayout( userGroupListButtonPanel, BoxLayout.Y_AXIS)); userGroupListButtonPanel.add(addUserBtn); userGroupListButtonPanel.add(removeUserBtn); JPanel userGroupPanel = new JPanel(); userGroupPanel .setLayout(new BoxLayout(userGroupPanel, BoxLayout.Y_AXIS)); userGroupPanel.add(userGroupListLabel); userGroupPanel.add(groupMembershipList); JPanel userGroupListPanel = new JPanel(); userGroupListPanel.setLayout(new BoxLayout(userGroupListPanel, BoxLayout.X_AXIS)); userGroupListPanel.add(userGroupListButtonPanel); userGroupListPanel.add(userGroupPanel); JPanel infoPanel = new JPanel(); infoPanel.setLayout(new BoxLayout(infoPanel, BoxLayout.Y_AXIS)); infoPanel.add(panel); infoPanel.add(userGroupListPanel); JPanel groupListPanel = new JPanel(); groupListPanel .setLayout(new BoxLayout(groupListPanel, BoxLayout.Y_AXIS)); groupListPanel.add(groupListLabel); groupListPanel.add(groupList); JPanel groupListButtonPanel = new JPanel(); groupListButtonPanel.setLayout(new BoxLayout(groupListButtonPanel, BoxLayout.Y_AXIS)); groupListButtonPanel.add(addGroupBtn); // groupListButtonPanel.add(removeGroupBtn); JPanel groupPanel = new JPanel(); groupPanel.setLayout(new BoxLayout(groupPanel, BoxLayout.X_AXIS)); groupPanel.add(groupListButtonPanel); groupPanel.add(Box.createHorizontalStrut(20)); groupPanel.add(groupListPanel); JPanel usersPanel = new JPanel(); usersPanel.setLayout(new BoxLayout(usersPanel, BoxLayout.Y_AXIS)); usersPanel.add(userListLabel); usersPanel.add(userList); JPanel spacerPanel = new JPanel(); spacerPanel.setLayout(new BoxLayout(spacerPanel, BoxLayout.X_AXIS)); spacerPanel.add(Box.createHorizontalStrut(60)); spacerPanel.add(usersPanel); JPanel listContainer = new JPanel(); listContainer.setLayout(new BoxLayout(listContainer, BoxLayout.Y_AXIS)); listContainer.add(groupPanel); listContainer.add(spacerPanel); JPanel container = new JPanel(); container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS)); container.add(listContainer); container.add(Box.createHorizontalStrut(50)); container.add(infoPanel); container.add(Box.createHorizontalStrut(10)); this.setLayout(new BorderLayout()); this.add(container); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e816110341e2f84a3681405f6c01dc8e685db8b4/GroupsTab.java/clean/components/tools/admin/src/adminTool/groupPanel/GroupsTab.java |
ImageIcon removeUserIcon = ImageFactory.get().image( ImageFactory.RIGHT_ARROW); | void createActionButtons() { saveBtn = new JButton("Save"); ImageIcon addUserIcon = ImageFactory.get().image( ImageFactory.LEFT_ARROW); ImageIcon removeUserIcon = ImageFactory.get().image( ImageFactory.RIGHT_ARROW); ImageIcon addGroupIcon = ImageFactory.get() .image(ImageFactory.ADD_USER); ImageIcon removeGroupIcon = ImageFactory.get().image( ImageFactory.REMOVE_USER); addUserBtn = new JButton(addUserIcon); removeUserBtn = new JButton(removeUserIcon); addGroupBtn = new JButton(addGroupIcon); removeGroupBtn = new JButton(removeGroupIcon); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e816110341e2f84a3681405f6c01dc8e685db8b4/GroupsTab.java/clean/components/tools/admin/src/adminTool/groupPanel/GroupsTab.java |
|
setDefaultBtn.addActionListener(new SetDefaultAction(controller)); | public void setController(GroupsTabController controller) { this.controller = controller; userList.setController(controller); groupList.setController(controller); saveBtn.addActionListener(new SaveAction(controller)); addGroupBtn.addActionListener(new GroupAction(GroupAction.ADD, controller)); removeGroupBtn.addActionListener(new GroupAction(GroupAction.REMOVE, controller)); addUserBtn .addActionListener(new UserAction(UserAction.ADD, controller)); removeUserBtn.addActionListener(new UserAction(UserAction.REMOVE, controller)); groupList.selectFirstGroup(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e816110341e2f84a3681405f6c01dc8e685db8b4/GroupsTab.java/clean/components/tools/admin/src/adminTool/groupPanel/GroupsTab.java |
|
if (selection2D == null) continue; | public void iterate(ROI5D roi) throws DataSourceException { if (roi == null) throw new NullPointerException("No ROI."); PlaneArea selection2D; PlanePoint[] points; PlaneDef pd; notifyIterationStart(); try { //Iterate in ZWT order and notify observers. for (int t = 0; t < dims.sizeT; ++t) { pd = new PlaneDef(PlaneDef.XY, t); for (int w = 0; w < dims.sizeW; ++w) { for (int z = 0; z < dims.sizeZ; ++z) { selection2D = roi.getPlaneArea(z, t, w); points = selection2D.getPoints(); notifyPlaneStart(z, w, t, points.length); pd.setZ(z); iterateArea(points, pd, z, w, t); notifyPlaneEnd(z, w, t, points.length); } } } } finally { //Give the observers a chance to clean up even when //something goes wrong. notifyIterationEnd(); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c3acf0375531681576d4a65f174981535a8919ae/PointIterator.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/roi/PointIterator.java |
|
super(displayedDocument); | this.dd = displayedDocument; | public MainController(DisplayedDocument displayedDocument) { super(displayedDocument); } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/57d4036eb7167d2d27117abe1f0280376377dbaa/MainController.java/clean/trunk/src/de/berlios/koalanotes/controllers/MainController.java |
localUpdate.commit(); | public void saveCurrentSettings() { delegate.saveCurrentSettings(); localUpdate.flush(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3174c2805bbc3341f9872f4461426b51c56c6770/RenderingBean.java/clean/components/ejb/src/ome/ro/ejb/RenderingBean.java |
|
String[] dirs = globPattern.getPattern().split(File.separator); | String[] dirs = globPattern.getPattern().split(pathSplitter); | private void getFiles() { for (Iterator iter = patterns.iterator(); iter.hasNext();) { GlobPattern globPattern = (GlobPattern) iter.next(); String[] dirs = globPattern.getPattern().split(File.separator); File root = new File(dirs[0]); int idx = 1; if (glob2Regexp(dirs[0]) != null) { root = new File("."); idx = 0; } for (int size = dirs.length; idx < size; idx++) { if (glob2Regexp(dirs[idx]) == null) { root = new File(root, dirs[idx]); } else { break; } } ArrayList matchingFiles = new ArrayList(); if (idx == dirs.length) { if (root.exists()) { matchingFiles.add(root); } globPattern.setMatchedFiles(matchingFiles); continue; } matchingFiles.add(root); for (int length = dirs.length; idx < length; idx++) { ArrayList currentMatchingFiles = new ArrayList(); for (int i = 0, size = matchingFiles.size(); i < size; i++) { boolean isDirectory = idx + 1 != length; String pattern = dirs[idx]; File parent = (File) matchingFiles.get(i); currentMatchingFiles.addAll(getMatchingFiles(parent, pattern, isDirectory)); } matchingFiles = currentMatchingFiles; } globPattern.setMatchedFiles(matchingFiles); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6acc52ad20fb231f849a10dff6ce197f6ea9c617/Glob.java/buggy/src/org/jruby/util/Glob.java |
try { getFiles(); } catch (PatternSyntaxException e) { return new String[] {}; } | try { getFiles(); } catch (PatternSyntaxException e) { System.out.println("BAD PATTERN: " + e.getPattern()); return new String[] {}; } | public String[] getNames() { try { getFiles(); } catch (PatternSyntaxException e) { // This can happen if someone does Dir.glob("{") or similiar. return new String[] {}; } ArrayList allMatchedNames = new ArrayList(); for (Iterator iter = patterns.iterator(); iter.hasNext();) { GlobPattern pattern = (GlobPattern) iter.next(); allMatchedNames.addAll(pattern.getMatchedFiles()); } return (String[]) allMatchedNames.toArray(new String[allMatchedNames.size()]); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6acc52ad20fb231f849a10dff6ce197f6ea9c617/Glob.java/buggy/src/org/jruby/util/Glob.java |
public boolean getOnOff() { return onOff; } | boolean getOnOff() { return onOff; } | public boolean getOnOff() { return onOff; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/75759d4628947eccba1f0e97cd7b5035c174f2cc/DrawingCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/canvas/DrawingCanvas.java |
g2D.setColor(roi.getLineColor()); | r = s.getBounds(); g2D.setStroke(dashed); g2D.setColor(alphaColor(roi.getLineColor())); if (roi.getIndex() == indexSelected) { g2D.setStroke(stroke); g2D.setColor(roi.getLineColor()); } | private void paintROICollection(Graphics2D g2D, List l) { Iterator i = l.iterator(); ROIShape roi; Shape s; Rectangle r; magFactor = manager.getCurrentImageAffineTransform().getMagFactor(); while (i.hasNext()) { roi = (ROIShape) i.next(); setShapeBounds(roi); s = roi.getShape(); g2D.setColor(roi.getLineColor()); g2D.draw(s); r = s.getBounds(); if (textOnOff) { Point p = ROIFactory.setLabelLocation(s, roi.getShapeType(), LENGTH); g2D.drawString(roi.getText(), p.x, p.y); } if (roi.getIndex() == indexSelected) { square.setRect(r.x-LENGTH/2, r.y+r.height/2-LENGTH/2, LENGTH, LENGTH); g2D.setPaint(squareColor); g2D.fill(square); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/75759d4628947eccba1f0e97cd7b5035c174f2cc/DrawingCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/canvas/DrawingCanvas.java |
r = s.getBounds(); | private void paintROICollection(Graphics2D g2D, List l) { Iterator i = l.iterator(); ROIShape roi; Shape s; Rectangle r; magFactor = manager.getCurrentImageAffineTransform().getMagFactor(); while (i.hasNext()) { roi = (ROIShape) i.next(); setShapeBounds(roi); s = roi.getShape(); g2D.setColor(roi.getLineColor()); g2D.draw(s); r = s.getBounds(); if (textOnOff) { Point p = ROIFactory.setLabelLocation(s, roi.getShapeType(), LENGTH); g2D.drawString(roi.getText(), p.x, p.y); } if (roi.getIndex() == indexSelected) { square.setRect(r.x-LENGTH/2, r.y+r.height/2-LENGTH/2, LENGTH, LENGTH); g2D.setPaint(squareColor); g2D.fill(square); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/75759d4628947eccba1f0e97cd7b5035c174f2cc/DrawingCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/canvas/DrawingCanvas.java |
|
g2D.drawString(roi.getText(), p.x, p.y); | g2D.drawString(roi.getLabel(), p.x, p.y); | private void paintROICollection(Graphics2D g2D, List l) { Iterator i = l.iterator(); ROIShape roi; Shape s; Rectangle r; magFactor = manager.getCurrentImageAffineTransform().getMagFactor(); while (i.hasNext()) { roi = (ROIShape) i.next(); setShapeBounds(roi); s = roi.getShape(); g2D.setColor(roi.getLineColor()); g2D.draw(s); r = s.getBounds(); if (textOnOff) { Point p = ROIFactory.setLabelLocation(s, roi.getShapeType(), LENGTH); g2D.drawString(roi.getText(), p.x, p.y); } if (roi.getIndex() == indexSelected) { square.setRect(r.x-LENGTH/2, r.y+r.height/2-LENGTH/2, LENGTH, LENGTH); g2D.setPaint(squareColor); g2D.fill(square); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/75759d4628947eccba1f0e97cd7b5035c174f2cc/DrawingCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/canvas/DrawingCanvas.java |
if (roi.getIndex() == indexSelected) { | if (roi.getAnnotation() != null && onOff) { | private void paintROICollection(Graphics2D g2D, List l) { Iterator i = l.iterator(); ROIShape roi; Shape s; Rectangle r; magFactor = manager.getCurrentImageAffineTransform().getMagFactor(); while (i.hasNext()) { roi = (ROIShape) i.next(); setShapeBounds(roi); s = roi.getShape(); g2D.setColor(roi.getLineColor()); g2D.draw(s); r = s.getBounds(); if (textOnOff) { Point p = ROIFactory.setLabelLocation(s, roi.getShapeType(), LENGTH); g2D.drawString(roi.getText(), p.x, p.y); } if (roi.getIndex() == indexSelected) { square.setRect(r.x-LENGTH/2, r.y+r.height/2-LENGTH/2, LENGTH, LENGTH); g2D.setPaint(squareColor); g2D.fill(square); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/75759d4628947eccba1f0e97cd7b5035c174f2cc/DrawingCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/canvas/DrawingCanvas.java |
LENGTH); | LENGTH); | private void paintROICollection(Graphics2D g2D, List l) { Iterator i = l.iterator(); ROIShape roi; Shape s; Rectangle r; magFactor = manager.getCurrentImageAffineTransform().getMagFactor(); while (i.hasNext()) { roi = (ROIShape) i.next(); setShapeBounds(roi); s = roi.getShape(); g2D.setColor(roi.getLineColor()); g2D.draw(s); r = s.getBounds(); if (textOnOff) { Point p = ROIFactory.setLabelLocation(s, roi.getShapeType(), LENGTH); g2D.drawString(roi.getText(), p.x, p.y); } if (roi.getIndex() == indexSelected) { square.setRect(r.x-LENGTH/2, r.y+r.height/2-LENGTH/2, LENGTH, LENGTH); g2D.setPaint(squareColor); g2D.fill(square); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/75759d4628947eccba1f0e97cd7b5035c174f2cc/DrawingCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/canvas/DrawingCanvas.java |
private void setShapeBounds(ROIShape roi) { Shape shape = roi.getShape(); Rectangle r = shape.getBounds(); double factor = roi.getAffineTransform().getMagFactor(); int shapeType = roi.getShapeType(); double coeff = magFactor/factor; ROIFactory.setShapeBounds(shape, shapeType, (int) (r.x*coeff), (int) (r.y*coeff), (int) (r.width*coeff), (int) (r.height*coeff)); roi.getAffineTransform().setMagFactor(magFactor); roi.setShape(shape); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/75759d4628947eccba1f0e97cd7b5035c174f2cc/DrawingCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/canvas/DrawingCanvas.java |
||
public FileSystemXmlApplicationContext(String[] configLocations, boolean refresh, List xmlPreprocessors) throws BeansException { this(configLocations, refresh, null, xmlPreprocessors); | public FileSystemXmlApplicationContext(String configLocation) throws BeansException { this(new String[] {configLocation}, true, null, Collections.EMPTY_LIST); | public FileSystemXmlApplicationContext(String[] configLocations, boolean refresh, List xmlPreprocessors) throws BeansException { this(configLocations, refresh, null, xmlPreprocessors); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/b05052e52d5df78c860e248c9008c7e71be70d95/FileSystemXmlApplicationContext.java/clean/spring/src/java/org/xbean/spring/context/FileSystemXmlApplicationContext.java |
PixelsService service = new PixelsService(); | PixelsService service = new PixelsService(PixelsService.ROOT_DEFAULT); | protected void setUp() throws IOException { // Create set up the base fixture which sets up the database for us baseFixture = new PixbufIOFixture(); pixels = baseFixture.setUp(); // "Our" fixture which creates the planes needed for this test case. PixelsService service = new PixelsService(); pixbuf = service.createPixelBuffer(pixels); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/PixbufCreationUnitTest.java/clean/components/omeio-nio/test/ome/io/nio/itests/PixbufCreationUnitTest.java |
double a = (double) (control.getGlobalMinimum()-b)/(double) rangeGraphics; return (int) (a*y+b); | double a = (c-b)/ (double) rangeGraphics; int r = (int) (a*y+b); if (r < c) r = c; if (r > b) r = b; return r; | int convertGraphicsIntoReal(int x) { int b = control.getGlobalMaximum(); int y = x-tW; double a = (double) (control.getGlobalMinimum()-b)/(double) rangeGraphics; return (int) (a*y+b); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/4b6a9c2b424c068230039a988c19a9a6fb4cf0c5/HistogramDialogManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/HistogramDialogManager.java |
double a = (double) rangeGraphics/(double) (b-c); | double a = (double) rangeGraphics/(b-c); | int convertRealIntoGraphics(int x) { int b = control.getGlobalMinimum(); int c = control.getGlobalMaximum(); double a = (double) rangeGraphics/(double) (b-c); return (int) (a*(x-c)+tW); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/4b6a9c2b424c068230039a988c19a9a6fb4cf0c5/HistogramDialogManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/pane/HistogramDialogManager.java |
try { Object ret = invoke(iteratorMethod, instance, null); if (ret instanceof Iterator) { return (Iterator) ret; } else if (ret instanceof Enumeration) { return new EnumIterator((Enumeration) ret); } else if (ret instanceof Object[]) { return new ArrayIterator((Object[]) ret); } | Object ret = invoke(iteratorMethod, instance, null); if (ret instanceof Iterator) { return (Iterator) ret; | public Iterator findIterator(Object instance) throws PropertyException { if (iteratorMethod != null) { try { Object ret = invoke(iteratorMethod, instance, null); if (ret instanceof Iterator) { return (Iterator) ret; } else if (ret instanceof Enumeration) { return new EnumIterator((Enumeration) ret); } else if (ret instanceof Object[]) { return new ArrayIterator((Object[]) ret); } } catch (NoSuchMethodException e) { throw new PropertyException("Error in PropertyOperator!", e); } } throw new PropertyException(instance + " is not a list", null); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/289617da402a00c35bb091baf41ccd5f8d4042c2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java |
catch (NoSuchMethodException e) { throw new PropertyException("Error in PropertyOperator!", e); | else if (ret instanceof Enumeration) { return new EnumIterator((Enumeration) ret); } else if (ret instanceof Object[]) { return new ArrayIterator((Object[]) ret); | public Iterator findIterator(Object instance) throws PropertyException { if (iteratorMethod != null) { try { Object ret = invoke(iteratorMethod, instance, null); if (ret instanceof Iterator) { return (Iterator) ret; } else if (ret instanceof Enumeration) { return new EnumIterator((Enumeration) ret); } else if (ret instanceof Object[]) { return new ArrayIterator((Object[]) ret); } } catch (NoSuchMethodException e) { throw new PropertyException("Error in PropertyOperator!", e); } } throw new PropertyException(instance + " is not a list", null); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/289617da402a00c35bb091baf41ccd5f8d4042c2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java |
throws PropertyException, NoSuchMethodException { | throws PropertyException { | static Object invoke(Method meth, Object instance, Object[] args) throws PropertyException, NoSuchMethodException { try { Object obj = meth.invoke(instance, args); // if the method's return type is void return the VoidMacro // instance, instead of the 'null' we used to return here // otherwise, just return whatever the method returned if (obj == null && meth.getReturnType() == java.lang.Void.TYPE) return org.webmacro.engine.VoidMacro.instance; else return obj; } catch (IllegalAccessException e) { throw new PropertyException( "You don't have permission to access the requested method (" + meth + " in class " + instance.getClass() + " on object " + instance + "). Private/protected/package access " + " values cannot be accessed via property introspection.", e); } catch (IllegalArgumentException e) { throw new PropertyException( "Some kind of error occurred processing your request: this " + "indicates a failure in PropertyOperator.java that should be " + "reported: attempt to access method " + meth + " on object " + instance + " with " + args.length + " parameters " + " threw an exception: " + e, e); } catch (InvocationTargetException e) { // if this is a wrapped UndefinedVariableException, unwrap and rethrow it if (e.getTargetException() instanceof PropertyException.UndefinedVariableException) throw (PropertyException) e.getTargetException(); throw new PropertyException( "Attempt to invoke method " + meth + " on object " + instance + " of " + instance.getClass() + " raised an exception: " + e.getTargetException(), e.getTargetException()); } catch (NullPointerException e) { throw new PropertyException( "NullPointerException thrown from method " + meth + " on object " + instance + " -- most likely you have attempted " + "to use an undefined value, or a failure in that method.", e); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/289617da402a00c35bb091baf41ccd5f8d4042c2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java |
if (!Hibernate.isInitialized(obj)) { throw new IllegalStateException( "If the return object is not initialized then we can't send it."); | if (null != obj) { if (obj instanceof OMEModel) { daoUtils.clean((OMEModel) obj); } else if (obj instanceof Set) { daoUtils.clean((Set) obj); } else if (obj instanceof HashMap) { daoUtils.clean(((Map) obj).keySet()); daoUtils.clean(new HashSet(((Map) obj).values())); } else { String msg = "Instances of " + obj.getClass().getName() + " not supported."; throw new IllegalArgumentException(msg); } | Object clean(Object obj) { if (!Hibernate.isInitialized(obj)) { throw new IllegalStateException( "If the return object is not initialized then we can't send it."); } Set done = new HashSet(); hessianClean(obj, done); return obj; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/HierarchyBrowsingImpl.java/clean/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
Set done = new HashSet(); hessianClean(obj, done); | Object clean(Object obj) { if (!Hibernate.isInitialized(obj)) { throw new IllegalStateException( "If the return object is not initialized then we can't send it."); } Set done = new HashSet(); hessianClean(obj, done); return obj; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/HierarchyBrowsingImpl.java/clean/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
|
Set categories = new HashSet(); | public Set findCGCIHierarchies(final Set arg0) { // CONTRACT if (null == arg0 || arg0.size() == 0) { return new HashSet(); } List result = containerDao.findCGCIHierarchies(arg0); Set imagesAll = new HashSet(result); if (null == imagesAll || imagesAll.size() == 0) { if (log.isDebugEnabled()) { log.debug("findCGCIHierarchies() -- no results found:\n" + arg0.toString()); } return new HashSet(); } // LOGIC Set hierarchies = new HashSet(); Iterator i = imagesAll.iterator(); while (i.hasNext()) { Image img = (Image) i.next(); Set classifications = img.getClassifications(); Set categories = new HashSet(); for (Iterator c = classifications.iterator(); c.hasNext();) { Classification cla = (Classification) c.next(); if (null!=cla.getCategory()){ // TODO where else could be null with outer join categories.add(cla.getCategory()); } } if (categories == null || categories.size() < 1) { hierarchies.add(img); } else { Iterator c = categories.iterator(); while (c.hasNext()) { Category tmp = (Category) c.next(); Category2 ca = new Category2(tmp); //TODO Hack if (!(ca.getImages() instanceof HashSet)) ca.setImages(new HashSet()); ca.getImages().add(img); CategoryGroup cg = ca.getCategoryGroup(); if (cg == null) { hierarchies.add(ca); } else { if (!(cg.getCategories() instanceof HashSet)) cg.setCategories(new HashSet()); cg.getCategories().add(ca); hierarchies.add(cg); } } } } return (Set) clean(hierarchies); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/HierarchyBrowsingImpl.java/clean/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
|
for (Iterator c = classifications.iterator(); c.hasNext();) { Classification cla = (Classification) c.next(); if (null!=cla.getCategory()){ categories.add(cla.getCategory()); } } if (categories == null || categories.size() < 1) { | if (classifications == null || classifications.size() < 1) { | public Set findCGCIHierarchies(final Set arg0) { // CONTRACT if (null == arg0 || arg0.size() == 0) { return new HashSet(); } List result = containerDao.findCGCIHierarchies(arg0); Set imagesAll = new HashSet(result); if (null == imagesAll || imagesAll.size() == 0) { if (log.isDebugEnabled()) { log.debug("findCGCIHierarchies() -- no results found:\n" + arg0.toString()); } return new HashSet(); } // LOGIC Set hierarchies = new HashSet(); Iterator i = imagesAll.iterator(); while (i.hasNext()) { Image img = (Image) i.next(); Set classifications = img.getClassifications(); Set categories = new HashSet(); for (Iterator c = classifications.iterator(); c.hasNext();) { Classification cla = (Classification) c.next(); if (null!=cla.getCategory()){ // TODO where else could be null with outer join categories.add(cla.getCategory()); } } if (categories == null || categories.size() < 1) { hierarchies.add(img); } else { Iterator c = categories.iterator(); while (c.hasNext()) { Category tmp = (Category) c.next(); Category2 ca = new Category2(tmp); //TODO Hack if (!(ca.getImages() instanceof HashSet)) ca.setImages(new HashSet()); ca.getImages().add(img); CategoryGroup cg = ca.getCategoryGroup(); if (cg == null) { hierarchies.add(ca); } else { if (!(cg.getCategories() instanceof HashSet)) cg.setCategories(new HashSet()); cg.getCategories().add(ca); hierarchies.add(cg); } } } } return (Set) clean(hierarchies); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/HierarchyBrowsingImpl.java/clean/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
Iterator c = categories.iterator(); | Iterator c = classifications.iterator(); | public Set findCGCIHierarchies(final Set arg0) { // CONTRACT if (null == arg0 || arg0.size() == 0) { return new HashSet(); } List result = containerDao.findCGCIHierarchies(arg0); Set imagesAll = new HashSet(result); if (null == imagesAll || imagesAll.size() == 0) { if (log.isDebugEnabled()) { log.debug("findCGCIHierarchies() -- no results found:\n" + arg0.toString()); } return new HashSet(); } // LOGIC Set hierarchies = new HashSet(); Iterator i = imagesAll.iterator(); while (i.hasNext()) { Image img = (Image) i.next(); Set classifications = img.getClassifications(); Set categories = new HashSet(); for (Iterator c = classifications.iterator(); c.hasNext();) { Classification cla = (Classification) c.next(); if (null!=cla.getCategory()){ // TODO where else could be null with outer join categories.add(cla.getCategory()); } } if (categories == null || categories.size() < 1) { hierarchies.add(img); } else { Iterator c = categories.iterator(); while (c.hasNext()) { Category tmp = (Category) c.next(); Category2 ca = new Category2(tmp); //TODO Hack if (!(ca.getImages() instanceof HashSet)) ca.setImages(new HashSet()); ca.getImages().add(img); CategoryGroup cg = ca.getCategoryGroup(); if (cg == null) { hierarchies.add(ca); } else { if (!(cg.getCategories() instanceof HashSet)) cg.setCategories(new HashSet()); cg.getCategories().add(ca); hierarchies.add(cg); } } } } return (Set) clean(hierarchies); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/HierarchyBrowsingImpl.java/clean/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.