rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
} else if (current instanceof Date){ return new Timestamp(((Date)current).getTime()); } | public Object findTarget(Object current){ // IMMUTABLES if (null == current | current instanceof Integer | current instanceof String) // TODO can use findTarget then for these as well. { return current; } else // Special cases TODO put into doFindTarget if (current instanceof Date){ return new Timestamp(((Date)current).getTime()); // FIXME should cache these in model2pojo } Object target = model2target.get(current); if (null == target) { Class targetType = findClass(current.getClass()); if (null != targetType){ try { target = targetType.newInstance(); } catch (Exception e) { throw new RuntimeException("Internal error: could not instantiate object of type "+targetType+" while trying to map "+current,e); } model2target.put(current,target); } else { throw new RuntimeException("Internal error: could not find target class type for "+current.getClass()); } } return target; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/ModelMapper.java/buggy/components/common/src/ome/util/ModelMapper.java |
|
if (null != targetType){ | if (null != targetType){ | public Object findTarget(Object current){ // IMMUTABLES if (null == current | current instanceof Integer | current instanceof String) // TODO can use findTarget then for these as well. { return current; } else // Special cases TODO put into doFindTarget if (current instanceof Date){ return new Timestamp(((Date)current).getTime()); // FIXME should cache these in model2pojo } Object target = model2target.get(current); if (null == target) { Class targetType = findClass(current.getClass()); if (null != targetType){ try { target = targetType.newInstance(); } catch (Exception e) { throw new RuntimeException("Internal error: could not instantiate object of type "+targetType+" while trying to map "+current,e); } model2target.put(current,target); } else { throw new RuntimeException("Internal error: could not find target class type for "+current.getClass()); } } return target; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/ModelMapper.java/buggy/components/common/src/ome/util/ModelMapper.java |
throw new RuntimeException("Internal error: could not instantiate object of type "+targetType+" while trying to map "+current,e); | throw new RuntimeException("Internal error: " + "could not instantiate object of type "+targetType+ " while trying to map "+current,e); | public Object findTarget(Object current){ // IMMUTABLES if (null == current | current instanceof Integer | current instanceof String) // TODO can use findTarget then for these as well. { return current; } else // Special cases TODO put into doFindTarget if (current instanceof Date){ return new Timestamp(((Date)current).getTime()); // FIXME should cache these in model2pojo } Object target = model2target.get(current); if (null == target) { Class targetType = findClass(current.getClass()); if (null != targetType){ try { target = targetType.newInstance(); } catch (Exception e) { throw new RuntimeException("Internal error: could not instantiate object of type "+targetType+" while trying to map "+current,e); } model2target.put(current,target); } else { throw new RuntimeException("Internal error: could not find target class type for "+current.getClass()); } } return target; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/ModelMapper.java/buggy/components/common/src/ome/util/ModelMapper.java |
} else { throw new RuntimeException("Internal error: could not find target class type for "+current.getClass()); | } else { | public Object findTarget(Object current){ // IMMUTABLES if (null == current | current instanceof Integer | current instanceof String) // TODO can use findTarget then for these as well. { return current; } else // Special cases TODO put into doFindTarget if (current instanceof Date){ return new Timestamp(((Date)current).getTime()); // FIXME should cache these in model2pojo } Object target = model2target.get(current); if (null == target) { Class targetType = findClass(current.getClass()); if (null != targetType){ try { target = targetType.newInstance(); } catch (Exception e) { throw new RuntimeException("Internal error: could not instantiate object of type "+targetType+" while trying to map "+current,e); } model2target.put(current,target); } else { throw new RuntimeException("Internal error: could not find target class type for "+current.getClass()); } } return target; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/ModelMapper.java/buggy/components/common/src/ome/util/ModelMapper.java |
public Object findTarget(Object current){ // IMMUTABLES if (null == current | current instanceof Integer | current instanceof String) // TODO can use findTarget then for these as well. { return current; } else // Special cases TODO put into doFindTarget if (current instanceof Date){ return new Timestamp(((Date)current).getTime()); // FIXME should cache these in model2pojo } Object target = model2target.get(current); if (null == target) { Class targetType = findClass(current.getClass()); if (null != targetType){ try { target = targetType.newInstance(); } catch (Exception e) { throw new RuntimeException("Internal error: could not instantiate object of type "+targetType+" while trying to map "+current,e); } model2target.put(current,target); } else { throw new RuntimeException("Internal error: could not find target class type for "+current.getClass()); } } return target; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/ModelMapper.java/buggy/components/common/src/ome/util/ModelMapper.java |
||
public HTMLReport(ProjectData projectData, File outputDir, FileFinder finder) | public HTMLReport(ProjectData projectData, File outputDir, FileFinder finder, ComplexityCalculator complexity) | public HTMLReport(ProjectData projectData, File outputDir, FileFinder finder) throws Exception { this.destinationDir = outputDir; this.finder = finder; this.projectData = projectData; CopyFiles.copy(outputDir); generatePackageList(); generateSourceFileLists(); generateOverviews(); generateSourceFiles(); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/c26f5a170c752d9d1d5b884dd7eb60b982637269/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
this.complexity = complexity; | public HTMLReport(ProjectData projectData, File outputDir, FileFinder finder) throws Exception { this.destinationDir = outputDir; this.finder = finder; this.projectData = projectData; CopyFiles.copy(outputDir); generatePackageList(); generateSourceFileLists(); generateOverviews(); generateSourceFiles(); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/c26f5a170c752d9d1d5b884dd7eb60b982637269/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
|
File sourceFile = finder.findFile(sourceFileData.getName()); | File sourceFile = finder.getFileForSource(sourceFileData.getName()); | private void generateSourceFile(SourceFileData sourceFileData) throws IOException { if (!sourceFileData.containsInstrumentationInfo()) { LOGGER.info("Data file does not contain instrumentation " + "information for the file " + sourceFileData.getName() + ". Ensure this class was instrumented, and this " + "data file contains the instrumentation information."); } String filename = sourceFileData.getNormalizedName() + ".html"; File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out .println("<script type=\"text/javascript\" src=\"js/popup.js\"></script>"); out.println("</head>"); out.println("<body>"); out.print("<h5>Coverage Report - "); String classPackageName = sourceFileData.getPackageName(); if ((classPackageName != null) && classPackageName.length() > 0) { out.print(sourceFileData.getPackageName() + "."); } out.print(sourceFileData.getBaseName()); out.println("</h5>"); // Output the coverage summary for this class out.println("<p>"); out.println("<table class=\"report\">"); out.println(generateTableHeader("Classes in this File", false)); // TODO: Change this to actually show multiple classes. out.println(generateTableRowForSourceFile(sourceFileData)); out.println("</table>"); out.println("</p>"); // Output this class's source code with syntax and coverage highlighting out.println("<p>"); out .println("<table cellspacing=\"0\" cellpadding=\"0\" class=\"src\">"); BufferedReader br = null; try { File sourceFile = finder.findFile(sourceFileData.getName()); br = new BufferedReader(new FileReader(sourceFile)); String lineStr; JavaToHtml javaToHtml = new JavaToHtml(); int lineNumber = 1; while ((lineStr = br.readLine()) != null) { out.println("<tr>"); if (sourceFileData.isValidSourceLineNumber(lineNumber)) { long numberOfHits = sourceFileData .getHitCount(lineNumber); out.println(" <td class=\"numLineCover\"> " + lineNumber + "</td>"); if (numberOfHits > 0) { out .println(" <td class=\"nbHitsCovered\"> " + numberOfHits + "</td>"); out .println(" <td class=\"src\"><pre class=\"src\"> " + javaToHtml.process(lineStr) + "</pre></td>"); } else { out .println(" <td class=\"nbHitsUncovered\"> " + numberOfHits + "</td>"); out .println(" <td class=\"src\"><pre class=\"src\"><span class=\"srcUncovered\"> " + javaToHtml.process(lineStr) + "</span></pre></td>"); } } else { out.println(" <td class=\"numLine\"> " + lineNumber + "</td>"); out.println(" <td class=\"nbHits\"> </td>"); out .println(" <td class=\"src\"><pre class=\"src\"> " + javaToHtml.process(lineStr) + "</pre></td>"); } out.println("</tr>"); lineNumber++; } } finally { if (br != null) { br.close(); } } out.println("</table>"); out.println("</p>"); out.println("<div class=\"footer\">"); out .println("Reports generated by <a href=\"http://cobertura.sourceforge.net/\" target=\"_top\">Cobertura</a>."); out.println("</div>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/c26f5a170c752d9d1d5b884dd7eb60b982637269/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
double ccn = packageData.getCCN(finder); | double ccn = complexity.getCCNForPackage(packageData); | private String generateTableRowForPackage(PackageData packageData) { StringBuffer ret = new StringBuffer(); String url1 = "frame-summary-" + packageData.getName() + ".html"; String url2 = "frame-sourcefiles-" + packageData.getName() + ".html"; double lineCoverage = -1; double branchCoverage = -1; double ccn = packageData.getCCN(finder); if (packageData.getNumberOfValidLines() > 0) lineCoverage = packageData.getLineCoverageRate(); if (packageData.getNumberOfValidBranches() > 0) branchCoverage = packageData.getBranchCoverageRate(); ret.append(" <tr>"); ret.append("<td class=\"text\"><a href=\"" + url1 + "\" onClick='parent.sourceFileList.location.href=\"" + url2 + "\"'>" + generatePackageName(packageData) + "</a></td>"); ret.append("<td class=\"value\">" + packageData.getNumberOfChildren() + "</td>"); ret.append(generateTableColumnsFromData(lineCoverage, branchCoverage, ccn)); ret.append("</tr>"); return ret.toString(); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/c26f5a170c752d9d1d5b884dd7eb60b982637269/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
File file = finder.findFile(sourceFileData.getName()); if (file == null) { System.out.println("FILE IS NULL: " + sourceFileData.getName()); } double ccn = Util.getCCN(file, false); | double ccn = complexity.getCCNForSourceFile(sourceFileData); | private String generateTableRowForSourceFile(SourceFileData sourceFileData) { StringBuffer ret = new StringBuffer(); double lineCoverage = -1; double branchCoverage = -1; File file = finder.findFile(sourceFileData.getName()); if (file == null) { System.out.println("FILE IS NULL: " + sourceFileData.getName()); } double ccn = Util.getCCN(file, false); if (sourceFileData.getNumberOfValidLines() > 0) lineCoverage = sourceFileData.getLineCoverageRate(); if (sourceFileData.getNumberOfValidBranches() > 0) branchCoverage = sourceFileData.getBranchCoverageRate(); ret.append(" <tr>"); ret.append("<td class=\"text\"><a href=\"" + sourceFileData.getNormalizedName() + ".html\">" + sourceFileData.getBaseName() + "</a></td>"); ret.append(generateTableColumnsFromData(lineCoverage, branchCoverage, ccn)); ret.append("</tr>"); return ret.toString(); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/c26f5a170c752d9d1d5b884dd7eb60b982637269/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
double ccnSum = 0; int count = 0; for (Iterator it = finder.getBaseDirectories().iterator(); it.hasNext(); ) { File basedir = (File) it.next(); ccnSum += Util.getCCN(basedir.getAbsoluteFile(), true); count++; } double ccn = ccnSum / (double) count; | private String generateTableRowForTotal() { StringBuffer ret = new StringBuffer(); double lineCoverage = -1; double branchCoverage = -1; double ccnSum = 0; int count = 0; for (Iterator it = finder.getBaseDirectories().iterator(); it.hasNext(); ) { File basedir = (File) it.next(); ccnSum += Util.getCCN(basedir.getAbsoluteFile(), true); count++; } double ccn = ccnSum / (double) count; if (projectData.getNumberOfValidLines() > 0) lineCoverage = projectData.getLineCoverageRate(); if (projectData.getNumberOfValidBranches() > 0) branchCoverage = projectData.getBranchCoverageRate(); ret.append(" <tr>"); ret.append("<td class=\"text\"><b>All Packages</b></td>"); ret.append("<td class=\"value\">" + projectData.getNumberOfSourceFiles() + "</td>"); ret.append(generateTableColumnsFromData(lineCoverage, branchCoverage, ccn)); ret.append("</tr>"); return ret.toString(); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/c26f5a170c752d9d1d5b884dd7eb60b982637269/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
|
String separator = getRuntime().getGlobalVariables().get("$/").asSymbol(); if (args.length > 0) { separator = args[0].asSymbol(); | String separator = (args.length == 0) ? getRuntime().getGlobalVariables().get("$/").asSymbol() : args[0].asSymbol(); if (separator.equals(DEFAULT_RS)) { int lastCharIndex = getValue().length() - 1; char lastChar = getValue().charAt(lastCharIndex); if (lastChar=='\n') { if (lastCharIndex > 0 && getValue().charAt(lastCharIndex - 1) == '\r') { setValue(getValue().substring(0, lastCharIndex - 1)); } else { setValue(getValue().substring(0, lastCharIndex)); } } else if (lastChar=='\r') { setValue(getValue().substring(0, lastCharIndex)); } else { return getRuntime().getNil(); } return this; | public IRubyObject chomp_bang(IRubyObject[] args) { if (isEmpty()) { return getRuntime().getNil(); } String separator = getRuntime().getGlobalVariables().get("$/").asSymbol(); if (args.length > 0) { separator = args[0].asSymbol(); } if (getValue().endsWith(separator)) { setValue(getValue().substring(0, getValue().length() - separator.length())); return this; } return getRuntime().getNil(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/918507aed1bf53ad95fefa25f3be76b4503d0f79/RubyString.java/clean/src/org/jruby/RubyString.java |
if (separator.length() == 0) { boolean modified = false; while(getValue().length() > 0 && getValue().charAt(getValue().length() - 1) == '\n') { modified = true; setValue(getValue().substring(0, getValue().length() - 1)); if (getValue().length() > 0 && getValue().charAt(getValue().length() - 1) == '\r') { setValue(getValue().substring(0, getValue().length() - 1)); } } return modified ? this : getRuntime().getNil(); } | public IRubyObject chomp_bang(IRubyObject[] args) { if (isEmpty()) { return getRuntime().getNil(); } String separator = getRuntime().getGlobalVariables().get("$/").asSymbol(); if (args.length > 0) { separator = args[0].asSymbol(); } if (getValue().endsWith(separator)) { setValue(getValue().substring(0, getValue().length() - separator.length())); return this; } return getRuntime().getNil(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/918507aed1bf53ad95fefa25f3be76b4503d0f79/RubyString.java/clean/src/org/jruby/RubyString.java |
|
&& RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus()) { | && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus()) { | private void buildContactList() { XMPPConnection con = SparkManager.getConnection(); final Roster roster = con.getRoster(); roster.addRosterListener(this); for (RosterGroup group : roster.getGroups()) { ContactGroup contactGroup = addContactGroup(group.getName()); for (RosterEntry entry : group.getEntries()) { String name = entry.getName(); if (name == null) { name = entry.getUser(); } ContactItem contactItem = new ContactItem(name, entry.getUser()); contactItem.setPresence(null); if ((entry.getType() == RosterPacket.ItemType.NONE || entry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus()) { // Add to contact group. contactGroup.addContactItem(contactItem); contactGroup.setVisible(true); } else { if (offlineGroup.getContactItemByJID(entry.getUser()) == null) { offlineGroup.addContactItem(contactItem); } } } } // Add Unfiled Group // addContactGroup(unfiledGroup); for (RosterEntry entry : roster.getUnfiledEntries()) { String name = entry.getName(); if (name == null) { name = entry.getUser(); } ContactItem contactItem = new ContactItem(name, entry.getUser()); offlineGroup.addContactItem(contactItem); } unfiledGroup.setVisible(false); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/dd2c9f51cadc449a3f72355ffe47a06e4871d38d/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java |
&& RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { | && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { | private synchronized void handleEntriesUpdated(final Collection addresses) { SwingUtilities.invokeLater(new Runnable() { public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. boolean isUnfiled = true; for (RosterGroup group : rosterEntry.getGroups()) { isUnfiled = false; // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = offlineGroup.getContactItemByJID(jid); if (item == null) { item = contactGroup.getContactItemByJID(jid); } // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } else { offlineGroup.addContactItem(item); offlineGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. final Set<String> groupSet = new HashSet<String>(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for (RosterGroup g : rosterEntry.getGroups()) { groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/dd2c9f51cadc449a3f72355ffe47a06e4871d38d/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java |
&& RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { | && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { | public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. boolean isUnfiled = true; for (RosterGroup group : rosterEntry.getGroups()) { isUnfiled = false; // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = addContactGroup(group.getName()); contactGroup.setVisible(false); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = offlineGroup.getContactItemByJID(jid); if (item == null) { item = contactGroup.getContactItemByJID(jid); } // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } else { offlineGroup.addContactItem(item); offlineGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. final Set<String> groupSet = new HashSet<String>(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); for (RosterGroup g : rosterEntry.getGroups()) { groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/dd2c9f51cadc449a3f72355ffe47a06e4871d38d/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java |
private void moveToOfflineGroup(String bareJID) { | private void moveToOfflineGroup(final String bareJID) { | private void moveToOfflineGroup(String bareJID) { final Iterator groupIterator = new ArrayList(groupList).iterator(); while (groupIterator.hasNext()) { final ContactGroup group = (ContactGroup)groupIterator.next(); final ContactItem item = group.getContactItemByJID(bareJID); if (item != null) { item.showUserGoingOfflineOnline(); item.setIcon(SparkRes.getImageIcon(SparkRes.CLEAR_BALL_ICON)); group.fireContactGroupUpdated(); int numberOfMillisecondsInTheFuture = 3000; Date timeToRun = new Date(System.currentTimeMillis() + numberOfMillisecondsInTheFuture); Timer timer = new Timer(); timer.schedule(new TimerTask() { public void run() { item.setPresence(null); // Check for ContactItemHandler. group.removeContactItem(item); checkGroup(group); if (offlineGroup.getContactItemByJID(item.getFullJID()) == null) { offlineGroup.addContactItem(item); offlineGroup.fireContactGroupUpdated(); } } }, timeToRun); } } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/dd2c9f51cadc449a3f72355ffe47a06e4871d38d/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java |
Roster roster = SparkManager.getConnection().getRoster(); Presence userPresence = roster.getPresence(bareJID); if (userPresence != null) { return; } | private void moveToOfflineGroup(String bareJID) { final Iterator groupIterator = new ArrayList(groupList).iterator(); while (groupIterator.hasNext()) { final ContactGroup group = (ContactGroup)groupIterator.next(); final ContactItem item = group.getContactItemByJID(bareJID); if (item != null) { item.showUserGoingOfflineOnline(); item.setIcon(SparkRes.getImageIcon(SparkRes.CLEAR_BALL_ICON)); group.fireContactGroupUpdated(); int numberOfMillisecondsInTheFuture = 3000; Date timeToRun = new Date(System.currentTimeMillis() + numberOfMillisecondsInTheFuture); Timer timer = new Timer(); timer.schedule(new TimerTask() { public void run() { item.setPresence(null); // Check for ContactItemHandler. group.removeContactItem(item); checkGroup(group); if (offlineGroup.getContactItemByJID(item.getFullJID()) == null) { offlineGroup.addContactItem(item); offlineGroup.fireContactGroupUpdated(); } } }, timeToRun); } } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/dd2c9f51cadc449a3f72355ffe47a06e4871d38d/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java |
|
Roster roster = SparkManager.getConnection().getRoster(); Presence userPresence = roster.getPresence(bareJID); if (userPresence != null) { return; } | public void run() { item.setPresence(null); // Check for ContactItemHandler. group.removeContactItem(item); checkGroup(group); if (offlineGroup.getContactItemByJID(item.getFullJID()) == null) { offlineGroup.addContactItem(item); offlineGroup.fireContactGroupUpdated(); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/dd2c9f51cadc449a3f72355ffe47a06e4871d38d/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java |
|
&& RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus(); | && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus(); | private void updateUserPresence(Presence presence) { if (presence == null) { return; } Roster roster = SparkManager.getConnection().getRoster(); final String bareJID = StringUtils.parseBareAddress(presence.getFrom()); RosterEntry entry = roster.getEntry(bareJID); boolean isPending = entry != null && (entry.getType() == RosterPacket.ItemType.NONE || entry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus(); // If online, check to see if they are in the offline group. // If so, remove from offline group and add to all groups they // belong to. if (presence.getType() == Presence.Type.available && offlineGroup.getContactItemByJID(bareJID) != null) { changeOfflineToOnline(bareJID, entry, presence); } else if (presence.getFrom().indexOf("workgroup.") != -1) { changeOfflineToOnline(bareJID, entry, presence); } // If online, but not in offline group, update presence. else if (presence.getType() == Presence.Type.available) { final Iterator groupIterator = groupList.iterator(); while (groupIterator.hasNext()) { ContactGroup group = (ContactGroup)groupIterator.next(); ContactItem item = group.getContactItemByJID(bareJID); if (item != null) { item.setPresence(presence); group.fireContactGroupUpdated(); } } } // If not available, move to offline group. else if (presence.getType() == Presence.Type.unavailable && !isPending) { presence = roster.getPresence(bareJID); if (presence == null) { moveToOfflineGroup(bareJID); } } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/dd2c9f51cadc449a3f72355ffe47a06e4871d38d/ContactList.java/buggy/src/java/org/jivesoftware/spark/ui/ContactList.java |
public void searchContacts(String contact, JFrame parent) { | public void searchContacts(String contact, final JFrame parent) { if (parents.get(parent) == null) { parents.put(parent, parent.getGlassPane()); } final Component glassPane = (Component)parents.get(parent); parent.setGlassPane(glassPane); | public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/274dbf0ef077e2132bf5036ee54b9dbe4b819268/UserManager.java/buggy/src/java/org/jivesoftware/spark/UserManager.java |
if (window != null) { window.dispose(); } | public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/274dbf0ef077e2132bf5036ee54b9dbe4b819268/UserManager.java/buggy/src/java/org/jivesoftware/spark/UserManager.java |
|
window = new JWindow(parent); | public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/274dbf0ef077e2132bf5036ee54b9dbe4b819268/UserManager.java/buggy/src/java/org/jivesoftware/spark/UserManager.java |
|
window.setLayout(new BorderLayout()); | public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/274dbf0ef077e2132bf5036ee54b9dbe4b819268/UserManager.java/buggy/src/java/org/jivesoftware/spark/UserManager.java |
|
layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); | layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 50, 0)); | public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/274dbf0ef077e2132bf5036ee54b9dbe4b819268/UserManager.java/buggy/src/java/org/jivesoftware/spark/UserManager.java |
window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); | public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/274dbf0ef077e2132bf5036ee54b9dbe4b819268/UserManager.java/buggy/src/java/org/jivesoftware/spark/UserManager.java |
|
window.dispose(); | public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/274dbf0ef077e2132bf5036ee54b9dbe4b819268/UserManager.java/buggy/src/java/org/jivesoftware/spark/UserManager.java |
|
window.dispose(); | parent.setGlassPane(glassPane); parent.getGlassPane().setVisible(false); contactField.dispose(); | public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/274dbf0ef077e2132bf5036ee54b9dbe4b819268/UserManager.java/buggy/src/java/org/jivesoftware/spark/UserManager.java |
parent.setGlassPane(mainPanel); parent.getGlassPane().setVisible(true); contactField.focus(); mainPanel.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent mouseEvent) { parent.setGlassPane(glassPane); parent.getGlassPane().setVisible(false); contactField.dispose(); } }); parent.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent windowEvent) { parent.setGlassPane(glassPane); parent.getGlassPane().setVisible(false); contactField.dispose(); parent.removeWindowListener(this); } }); | public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/274dbf0ef077e2132bf5036ee54b9dbe4b819268/UserManager.java/buggy/src/java/org/jivesoftware/spark/UserManager.java |
|
runtime.getModule("Kernel").callMethod(runtime.getCurrentContext(),"require",runtime.newString("digest.so")); | runtime.getLoadService().require("digest.so"); | public static void createDigestMD5(IRuby runtime) { runtime.getModule("Kernel").callMethod(runtime.getCurrentContext(),"require",runtime.newString("digest.so")); RubyModule mDigest = runtime.getModule("Digest"); RubyClass cDigestBase = mDigest.getClass("Base"); RubyClass cDigest_MD5 = mDigest.defineClassUnder("MD5",cDigestBase); cDigest_MD5.setClassVar("metadata",runtime.newString("MD5")); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe11f82bc6236dc6746a228a50d4bac6d467618e/RubyDigest.java/clean/src/org/jruby/RubyDigest.java |
runtime.getModule("Kernel").callMethod(runtime.getCurrentContext(),"require",runtime.newString("digest.so")); | runtime.getLoadService().require("digest.so"); | public static void createDigestRMD160(IRuby runtime) { runtime.getModule("Kernel").callMethod(runtime.getCurrentContext(),"require",runtime.newString("digest.so")); RubyModule mDigest = runtime.getModule("Digest"); RubyClass cDigestBase = mDigest.getClass("Base"); RubyClass cDigest_RMD160 = mDigest.defineClassUnder("RMD160",cDigestBase); cDigest_RMD160.setClassVar("metadata",runtime.newString("RIPEMD160")); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe11f82bc6236dc6746a228a50d4bac6d467618e/RubyDigest.java/clean/src/org/jruby/RubyDigest.java |
runtime.getModule("Kernel").callMethod(runtime.getCurrentContext(),"require",runtime.newString("digest.so")); | runtime.getLoadService().require("digest.so"); | public static void createDigestSHA1(IRuby runtime) { runtime.getModule("Kernel").callMethod(runtime.getCurrentContext(),"require",runtime.newString("digest.so")); RubyModule mDigest = runtime.getModule("Digest"); RubyClass cDigestBase = mDigest.getClass("Base"); RubyClass cDigest_SHA1 = mDigest.defineClassUnder("SHA1",cDigestBase); cDigest_SHA1.setClassVar("metadata",runtime.newString("SHA1")); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe11f82bc6236dc6746a228a50d4bac6d467618e/RubyDigest.java/clean/src/org/jruby/RubyDigest.java |
runtime.getModule("Kernel").callMethod(runtime.getCurrentContext(),"require",runtime.newString("digest.so")); | runtime.getLoadService().require("digest.so"); | public static void createDigestSHA2(IRuby runtime) { try { MessageDigest.getInstance("SHA-256"); } catch(NoSuchAlgorithmException e) { throw runtime.newLoadError("SHA2 not supported"); } runtime.getModule("Kernel").callMethod(runtime.getCurrentContext(),"require",runtime.newString("digest.so")); RubyModule mDigest = runtime.getModule("Digest"); RubyClass cDigestBase = mDigest.getClass("Base"); RubyClass cDigest_SHA2_256 = mDigest.defineClassUnder("SHA256",cDigestBase); cDigest_SHA2_256.setClassVar("metadata",runtime.newString("SHA-256")); RubyClass cDigest_SHA2_384 = mDigest.defineClassUnder("SHA384",cDigestBase); cDigest_SHA2_384.setClassVar("metadata",runtime.newString("SHA-384")); RubyClass cDigest_SHA2_512 = mDigest.defineClassUnder("SHA512",cDigestBase); cDigest_SHA2_512.setClassVar("metadata",runtime.newString("SHA-512")); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe11f82bc6236dc6746a228a50d4bac6d467618e/RubyDigest.java/clean/src/org/jruby/RubyDigest.java |
if(factor != -1) | if (factor != -1) | public void setZoomFactor(double factor) { if(factor != -1) { if (factor > ZoomAction.MAX_ZOOM_FACTOR || factor < ZoomAction.MIN_ZOOM_FACTOR) throw new IllegalArgumentException("The zoom factor is value " + "between "+ZoomAction.MIN_ZOOM_FACTOR+" and "+ ZoomAction.MAX_ZOOM_FACTOR); } else { int width = model.getRenderedImage().getWidth(); int height = model.getRenderedImage().getHeight(); Dimension viewport = view.getCurrentViewport(); double zoomFactorX = viewport.getWidth()/width; double zoomFactorY = viewport.getHeight()/height; factor = Math.min(zoomFactorX, zoomFactorY); } model.setZoomFactor(factor); view.zoomImage(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/BrowserComponent.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/browser/BrowserComponent.java |
return match.isNil() ? match : ((RubyMatchData) match).group(n); | IRubyObject nil = match.getRuntime().getNil(); if (match.isNil()) { return nil; } RubyMatchData rmd = (RubyMatchData) match; if (n > rmd.getSize()) { return nil; } if (n < 0) { n += rmd.getSize(); if (n <= 0) { return nil; } } return rmd.group(n); | public static IRubyObject nth_match(int n, IRubyObject match) { return match.isNil() ? match : ((RubyMatchData) match).group(n); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ccaba8b36154afea86c2482886e84c7df5ddad99/RubyRegexp.java/buggy/src/org/jruby/RubyRegexp.java |
dispatcher.addLoadListener(treePanel); | public void modelChanged(HeatMapModel model) { if(model == null) { return; } this.model = model; setTitle("HeatMap: " + model.getInfoSource().getDataset().getName()); treePanel.setModel(model.getModel()); treePanel.removeListener(dispatcher); modeBar.removeListener(dispatcher); dispatcher = new HeatMapDispatcher(model,statusPanel,gradPanel); dispatcher.setCurrentMode(modeBar.getCurrentMode()); dispatcher.setCurrentScale(scaleBar.getCurrentScaleType()); treePanel.addListener(dispatcher); modeBar.addListener(dispatcher); scaleBar.addListener(dispatcher); gradPanel.setEnabled(false); revalidate(); repaint(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b50398c0db3353156748a8d1155216615e5ba5d0/HeatMapUI.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapUI.java |
|
setDatasets( new HashSet( i.eachLinkedDataset( block ))); setAllPixels( new HashSet( i.collectPixels( block ))); setAnnotations( new HashSet( i.collectAnnotations( block ))); | setDatasets( makeSet( i.sizeOfDatasetLinks(), i.eachLinkedDataset( block ))); setAllPixels( makeSet( i.sizeOfPixels(), i.collectPixels( block ))); setAnnotations( makeSet( i.sizeOfAnnotations(), i.collectAnnotations( block ))); | public void copy(IObject model, ModelMapper mapper) { if (model instanceof Image) { Image i = (Image) model; super.copy(model,mapper); // Details if (i.getDetails() != null){ Details d = i.getDetails(); this.setCreated(mapper.event2timestamp(d.getCreationEvent())); this.setInserted(mapper.event2timestamp(d.getUpdateEvent()));//TODO this.setOwner((ExperimenterData) mapper.findTarget(d.getOwner())); if ( d.getCounts() != null ) { Object annotationCount = d.getCounts().get( Image.ANNOTATIONS ); if ( annotationCount instanceof Integer ) this.setAnnotationCount( (Integer) annotationCount ); Object classificationCount = d.getCounts().get( Image.CATEGORYLINKS ); if ( classificationCount instanceof Integer ) this.setClassificationCount( (Integer) classificationCount ); } } // Fields this.setName(i.getName()); this.setDescription(i.getDescription()); this.setDefaultPixels((PixelsData)mapper.findTarget(i.getDefaultPixels())); // Collections MapperBlock block = new MapperBlock( mapper ); setDatasets( new HashSet( i.eachLinkedDataset( block ))); setAllPixels( new HashSet( i.collectPixels( block ))); setAnnotations( new HashSet( i.collectAnnotations( block ))); } else { throw new IllegalArgumentException("ImageData copies only from Image"); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9638b50efec05ce0b3d19bbef1c149c757b964aa/ImageData.java/clean/components/shoola-adapter/src/pojos/ImageData.java |
imgsAnn1 = getPercentOfCollection(allImgs, percent); imgsAnn2 = getPercentOfCollection(allImgs, percent); dsAnn1 = getPercentOfCollection(allDss, percent); dsAnn2 = getPercentOfCollection(allDss, percent); | imgsAnn1 = getImageAnnotations(); imgsAnn2 = getImageAnnotations(); dsAnn1 = getDatasetAnnotations(); dsAnn2 = getDatasetAnnotations(); | public OMEData init() { // Test data : calculated before to not change times. if (!initialized) { super.init(); imgsPDI = getPercentOfCollection(allImgs, percent); imgsCGCI = getPercentOfCollection(allImgs, percent); imgsAnn1 = getPercentOfCollection(allImgs, percent); imgsAnn2 = getPercentOfCollection(allImgs, percent); dsAnn1 = getPercentOfCollection(allDss, percent); dsAnn2 = getPercentOfCollection(allDss, percent); } return this; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fe14dc19a3cb8aef0082070000d68b42a88ac770/OMEPerformanceData.java/buggy/components/common/src/org/openmicroscopy/omero/tests/OMEPerformanceData.java |
return Collections.EMPTY_LIST; | return EMPTY_LIST; | public List childNodes() { return Collections.EMPTY_LIST; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b1293eda8454686e846e2a9837b348e2983bb423/RedoNode.java/buggy/src/org/jruby/ast/RedoNode.java |
setImages( new HashSet( d.collectFromImageLinks( block ))); setProjects( new HashSet( d.collectFromProjectLinks( block ))); setAnnotations( new HashSet( d.collectFromAnnotations( block ))); | setImages( new HashSet( d.eachLinkedImage( block ))); setProjects( new HashSet( d.eachLinkedProject( block ))); setAnnotations( new HashSet( d.collectAnnotations( block ))); | public void copy(IObject model, ModelMapper mapper) { if (model instanceof Dataset) { Dataset d = (Dataset) model; super.copy(model,mapper); // Details if (d.getDetails() != null){ Details details = d.getDetails(); this.setOwner((ExperimenterData)mapper.findTarget( details.getOwner())); if ( details.getCounts() != null ) { Object annotationCount = details.getCounts().get( Dataset.ANNOTATIONS ); if ( annotationCount instanceof Integer ) this.setAnnotationCount( (Integer) annotationCount ); } } // Fields this.setName(d.getName()); this.setDescription(d.getDescription()); // Collections MapperBlock block = new MapperBlock( mapper ); setImages( new HashSet( d.collectFromImageLinks( block ))); setProjects( new HashSet( d.collectFromProjectLinks( block ))); setAnnotations( new HashSet( d.collectFromAnnotations( block ))); } else { throw new IllegalArgumentException( "DatasetData can only copy from Dataset"); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7b5c704279f82fa929138305f70f2f5e6b462c69/DatasetData.java/clean/components/shoola-adapter/src/pojos/DatasetData.java |
return Character.toUpperCase(c) == c; | return Character.isUpperCase(c); | private boolean ISUPPER(char c) { return Character.toUpperCase(c) == c; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/234d6392b23389a9ae2098c62e66618404979d3c/RubyYaccLexer.java/clean/src/org/jruby/lexer/yacc/RubyYaccLexer.java |
System.out .println(" ***** HierarchyBrowsingTest.testFindCGCIHierarchies() *****"); Set ids = new HashSet(); ids.add(new Integer(19)); ids.add(new Integer(13)); ids.add(new Integer(11)); Set result = hb.findCGCIHierarchies(ids); | public void testFindCGCIHierarchies() { } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/8442e37c365d8ade04f3bf94b6b000049c740d2a/HierarchyBrowsingTest.java/clean/components/wars/srv/src/test/org/ome/omero/tests/HierarchyBrowsingTest.java |
|
.println("HierarchyBrowsingTest.testFindImageAnnotationsSet()"); | .println(" ***** HierarchyBrowsingTest.testFindImageAnnotationsSet()"); | public void testFindImageAnnotationsSet() { System.out .println("HierarchyBrowsingTest.testFindImageAnnotationsSet()"); Set ids = new HashSet(); ids.add(new Integer(11)); ids.add(new Integer(13)); Map map = hb.findImageAnnotations(ids); assertTrue(nonNull, map != null && map.size() != 0); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/8442e37c365d8ade04f3bf94b6b000049c740d2a/HierarchyBrowsingTest.java/clean/components/wars/srv/src/test/org/ome/omero/tests/HierarchyBrowsingTest.java |
Map map = hb.findImageAnnotations(ids,5); | Map map = hb.findImageAnnotationsForExperimenter(ids,5); | public void testFindImageAnnotationsSetint() { System.out.println(" ***** HierarchyBrowsingTest.testFindImageAnnotationsSetint()"); Set ids = new HashSet(); ids.add(new Integer(11)); ids.add(new Integer(13)); Map map = hb.findImageAnnotations(ids,5); assertTrue(nonNull, map != null && map.size() != 0); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/8442e37c365d8ade04f3bf94b6b000049c740d2a/HierarchyBrowsingTest.java/clean/components/wars/srv/src/test/org/ome/omero/tests/HierarchyBrowsingTest.java |
assertTrue(emptyColl,hb.findDatasetAnnotations(test,nonExp).size()==0); assertTrue(emptyColl,hb.findDatasetAnnotations(new HashSet(),nonExp).size()==0); | assertTrue(emptyColl,hb.findDatasetAnnotationsForExperimenter(test,nonExp).size()==0); assertTrue(emptyColl,hb.findDatasetAnnotationsForExperimenter(new HashSet(),nonExp).size()==0); | public void testNulls(){ // Each method should return a null or an empty set as appropriate //TODO hb.findCGCIHierarchies( ); Set test = new HashSet(); test.add(new Integer(0)); // Non-existence set of ids int nonExp = 0; // Non-existence experimenter ID // assertTrue(emptyColl,hb.findDatasetAnnotations(test).size()==0); assertTrue(emptyColl,hb.findDatasetAnnotations(new HashSet()).size()==0); // assertTrue(emptyColl,hb.findDatasetAnnotations(test,nonExp).size()==0); assertTrue(emptyColl,hb.findDatasetAnnotations(new HashSet(),nonExp).size()==0); // assertTrue(emptyColl,hb.findImageAnnotations(test).size()==0); assertTrue(emptyColl,hb.findImageAnnotations(new HashSet()).size()==0); // assertTrue(emptyColl,hb.findImageAnnotations(test,nonExp).size()==0); assertTrue(emptyColl,hb.findImageAnnotations(new HashSet(),nonExp).size()==0); // assertTrue(emptyColl,hb.findPDIHierarchies(test).size()==0); assertTrue(emptyColl,hb.findPDIHierarchies(new HashSet()).size()==0); // assertNull(nullObj,hb.loadCGCIHierarchy(CategoryGroupData.class, 0)); assertNull(nullObj,hb.loadCGCIHierarchy(CategoryData.class, 0)); // assertNull(nullObj,hb.loadPDIHierarchy(ProjectData.class, 0)); assertNull(nullObj,hb.loadPDIHierarchy(DatasetData.class, 0)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/8442e37c365d8ade04f3bf94b6b000049c740d2a/HierarchyBrowsingTest.java/clean/components/wars/srv/src/test/org/ome/omero/tests/HierarchyBrowsingTest.java |
assertTrue(emptyColl,hb.findImageAnnotations(test,nonExp).size()==0); assertTrue(emptyColl,hb.findImageAnnotations(new HashSet(),nonExp).size()==0); | assertTrue(emptyColl,hb.findImageAnnotationsForExperimenter(test,nonExp).size()==0); assertTrue(emptyColl,hb.findImageAnnotationsForExperimenter(new HashSet(),nonExp).size()==0); | public void testNulls(){ // Each method should return a null or an empty set as appropriate //TODO hb.findCGCIHierarchies( ); Set test = new HashSet(); test.add(new Integer(0)); // Non-existence set of ids int nonExp = 0; // Non-existence experimenter ID // assertTrue(emptyColl,hb.findDatasetAnnotations(test).size()==0); assertTrue(emptyColl,hb.findDatasetAnnotations(new HashSet()).size()==0); // assertTrue(emptyColl,hb.findDatasetAnnotations(test,nonExp).size()==0); assertTrue(emptyColl,hb.findDatasetAnnotations(new HashSet(),nonExp).size()==0); // assertTrue(emptyColl,hb.findImageAnnotations(test).size()==0); assertTrue(emptyColl,hb.findImageAnnotations(new HashSet()).size()==0); // assertTrue(emptyColl,hb.findImageAnnotations(test,nonExp).size()==0); assertTrue(emptyColl,hb.findImageAnnotations(new HashSet(),nonExp).size()==0); // assertTrue(emptyColl,hb.findPDIHierarchies(test).size()==0); assertTrue(emptyColl,hb.findPDIHierarchies(new HashSet()).size()==0); // assertNull(nullObj,hb.loadCGCIHierarchy(CategoryGroupData.class, 0)); assertNull(nullObj,hb.loadCGCIHierarchy(CategoryData.class, 0)); // assertNull(nullObj,hb.loadPDIHierarchy(ProjectData.class, 0)); assertNull(nullObj,hb.loadPDIHierarchy(DatasetData.class, 0)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/8442e37c365d8ade04f3bf94b6b000049c740d2a/HierarchyBrowsingTest.java/clean/components/wars/srv/src/test/org/ome/omero/tests/HierarchyBrowsingTest.java |
public void setRefreshedHierarchy(Map set); | public void setRefreshedHierarchy(Map set, List expandedTopNodes); | public void setRefreshedHierarchy(Map set); | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e14deebd64382fe7de32f39ea661a766a7294394/Browser.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/Browser.java |
if (lastCategoryBox != null) lastCategoryBox.setHighlighted(false); | public void setLastCategoryBox(CategoryBox box) { lastCategoryBox=box; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/cb1fb5defd26379ab79c70ff78de6749a254d163/ModulePaletteEventHandler.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/piccolo/ModulePaletteEventHandler.java |
|
super(name); | super(name); | public TestRubyHash(String name) { super(name); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/2f13ba47385b7584839c7f6f6f1abfee251cbe53/TestRubyHash.java/clean/org/jruby/test/TestRubyHash.java |
ruby = Ruby.getDefaultInstance(GNURegexpAdapter.class); eval("$h = {'foo' => 'bar'}"); | ruby = Ruby.getDefaultInstance(GNURegexpAdapter.class); eval("$h = {'foo' => 'bar'}"); | public void setUp() { ruby = Ruby.getDefaultInstance(GNURegexpAdapter.class); eval("$h = {'foo' => 'bar'}"); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/2f13ba47385b7584839c7f6f6f1abfee251cbe53/TestRubyHash.java/clean/org/jruby/test/TestRubyHash.java |
super.tearDown(); | super.tearDown(); | public void tearDown() { super.tearDown(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/2f13ba47385b7584839c7f6f6f1abfee251cbe53/TestRubyHash.java/clean/org/jruby/test/TestRubyHash.java |
result = eval("hash = {'a', 100}; p hash"); assertEquals("{\"a\"=>100}", result); result = eval("hash = Hash['b', 200]; p hash"); assertEquals("{\"b\"=>200}", result); result = eval("hash = Hash.new(); p hash['test']"); assertEquals("nil", result); result = eval("hash = Hash.new('default'); p hash['test']"); assertEquals("\"default\"", result); | result = eval("hash = {'a', 100}; p hash"); assertEquals("{\"a\"=>100}", result); result = eval("hash = Hash['b', 200]; p hash"); assertEquals("{\"b\"=>200}", result); result = eval("hash = Hash.new(); p hash['test']"); assertEquals("nil", result); result = eval("hash = Hash.new('default'); p hash['test']"); assertEquals("\"default\"", result); | public void testConstructors() { result = eval("hash = {'a', 100}; p hash"); assertEquals("{\"a\"=>100}", result); result = eval("hash = Hash['b', 200]; p hash"); assertEquals("{\"b\"=>200}", result); result = eval("hash = Hash.new(); p hash['test']"); assertEquals("nil", result); result = eval("hash = Hash.new('default'); p hash['test']"); assertEquals("\"default\"", result); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/2f13ba47385b7584839c7f6f6f1abfee251cbe53/TestRubyHash.java/clean/org/jruby/test/TestRubyHash.java |
result = eval("p $h.to_s"); assertEquals("\"foobar\"", result); result = eval("p $h.to_a"); assertEquals("[[\"foo\", \"bar\"]]", result); result = eval("p $h.to_hash"); assertEquals("{\"foo\"=>\"bar\"}", result); | result = eval("p $h.to_s"); assertEquals("\"foobar\"", result); result = eval("p $h.to_a"); assertEquals("[[\"foo\", \"bar\"]]", result); result = eval("p $h.to_hash"); assertEquals("{\"foo\"=>\"bar\"}", result); | public void testConversions() { result = eval("p $h.to_s"); assertEquals("\"foobar\"", result); result = eval("p $h.to_a"); assertEquals("[[\"foo\", \"bar\"]]", result); result = eval("p $h.to_hash"); assertEquals("{\"foo\"=>\"bar\"}", result); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/2f13ba47385b7584839c7f6f6f1abfee251cbe53/TestRubyHash.java/clean/org/jruby/test/TestRubyHash.java |
result = eval("key = 'a'; hash = {key => 'one'}; hash.store('a', 'two'); puts hash[key]"); assertEquals("two", result); result = eval("key = [1,2]; hash = {key => 'one'}; hash[[1,2]] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = :a; hash = {key => 'one'}; hash[:a] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = 1234; hash = {key => 'one'}; hash[1234] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = 12.4; hash = {key => 'one'}; hash[12.4] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = 19223372036854775807; hash = {key => 'one'}; hash[19223372036854775807] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = /a/; hash = {key => 'one'}; hash[/a/] = 'two'; puts hash[key]"); assertEquals("one", result); result = eval("key = (1..3); hash = {key => 'one'}; hash[(1..3)] = 'two'; puts hash[key]"); assertEquals("one", result); | result = eval("key = 'a'; hash = {key => 'one'}; hash.store('a', 'two'); puts hash[key]"); assertEquals("two", result); result = eval("key = [1,2]; hash = {key => 'one'}; hash[[1,2]] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = :a; hash = {key => 'one'}; hash[:a] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = 1234; hash = {key => 'one'}; hash[1234] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = 12.4; hash = {key => 'one'}; hash[12.4] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = 19223372036854775807; hash = {key => 'one'}; hash[19223372036854775807] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = /a/; hash = {key => 'one'}; hash[/a/] = 'two'; puts hash[key]"); assertEquals("one", result); result = eval("key = (1..3); hash = {key => 'one'}; hash[(1..3)] = 'two'; puts hash[key]"); assertEquals("one", result); | public void testLookups() { // value equality result = eval("key = 'a'; hash = {key => 'one'}; hash.store('a', 'two'); puts hash[key]"); assertEquals("two", result); result = eval("key = [1,2]; hash = {key => 'one'}; hash[[1,2]] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = :a; hash = {key => 'one'}; hash[:a] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = 1234; hash = {key => 'one'}; hash[1234] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = 12.4; hash = {key => 'one'}; hash[12.4] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = 19223372036854775807; hash = {key => 'one'}; hash[19223372036854775807] = 'two'; puts hash[key]"); assertEquals("two", result); // identity equality result = eval("key = /a/; hash = {key => 'one'}; hash[/a/] = 'two'; puts hash[key]"); assertEquals("one", result); result = eval("key = (1..3); hash = {key => 'one'}; hash[(1..3)] = 'two'; puts hash[key]"); assertEquals("one", result); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/2f13ba47385b7584839c7f6f6f1abfee251cbe53/TestRubyHash.java/clean/org/jruby/test/TestRubyHash.java |
assertEquals("1", eval("p $h.size")); assertEquals("1", eval("p $h.length")); assertEquals("false", eval("p $h.empty?")); assertEquals("true", eval("p Hash.new().empty?")); | assertEquals("1", eval("p $h.size")); assertEquals("1", eval("p $h.length")); assertEquals("false", eval("p $h.empty?")); assertEquals("true", eval("p Hash.new().empty?")); | public void testSizeRelated() { assertEquals("1", eval("p $h.size")); assertEquals("1", eval("p $h.length")); assertEquals("false", eval("p $h.empty?")); assertEquals("true", eval("p Hash.new().empty?")); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/2f13ba47385b7584839c7f6f6f1abfee251cbe53/TestRubyHash.java/clean/org/jruby/test/TestRubyHash.java |
assertEquals("one", result); | assertEquals("two", result); | public void testLookups() throws Exception { // value equality result = eval("key = 'a'; hash = {key => 'one'}; hash.store('a', 'two'); puts hash[key]"); assertEquals("two", result); result = eval("key = [1,2]; hash = {key => 'one'}; hash[[1,2]] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = :a; hash = {key => 'one'}; hash[:a] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = 1234; hash = {key => 'one'}; hash[1234] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = 12.4; hash = {key => 'one'}; hash[12.4] = 'two'; puts hash[key]"); assertEquals("two", result); result = eval("key = 19223372036854775807; hash = {key => 'one'}; hash[19223372036854775807] = 'two'; puts hash[key]"); assertEquals("two", result); // identity equality result = eval("key = /a/; hash = {key => 'one'}; hash[/a/] = 'two'; puts hash[key]"); assertEquals("one", result); result = eval("key = (1..3); hash = {key => 'one'}; hash[(1..3)] = 'two'; puts hash[key]"); assertEquals("one", result); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0b86f0ad945c40a2e636cf5fb1fcd554ed1de38d/TestRubyHash.java/buggy/test/org/jruby/test/TestRubyHash.java |
getClasses().putClass(name, newModule); | getClasses().putClass(name, newModule, parentModule); | public RubyModule defineModuleUnder(String name, RubyModule parentModule) { RubyModule newModule = RubyModule.newModule(this, name, parentModule); getClasses().putClass(name, newModule); return newModule; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/750e66982e97bcb72545a39ceacf6ee32a52a135/Ruby.java/clean/src/org/jruby/Ruby.java |
runtime.getLoadService().init(runtime, commandline.loadPaths()); | runtime.getLoadService().init(commandline.loadPaths()); | private static void initializeRuntime(final Ruby runtime, String filename) { IRubyObject argumentArray = runtime.newArray(JavaUtil.convertJavaArrayToRuby(runtime, commandline.scriptArguments)); runtime.setVerbose(runtime.newBoolean(commandline.verbose)); // $VERBOSE can be true, false, or nil. Any non-false-nil value will get stored as true runtime.getGlobalVariables().define("$VERBOSE", new IAccessor() { public IRubyObject getValue() { return runtime.getVerbose(); } public IRubyObject setValue(IRubyObject newValue) { if (newValue.isNil()) { runtime.setVerbose(newValue); } else { runtime.setVerbose(runtime.newBoolean(newValue != runtime.getFalse())); } return newValue; } }); runtime.getClasses().getObjectClass().setConstant("$VERBOSE", commandline.verbose ? runtime.getTrue() : runtime.getNil()); runtime.defineGlobalConstant("ARGV", argumentArray); // I guess ENV is not a hash, but should support a to_hash, though // it supposedly supports methods of a Hash? Also, I think that // RubyGlobal may need to create an empty ENV var in the case that // the runtime is not initialized by Main. Properties envs = new Properties(); runtime.defineGlobalConstant("ENV", RubyHash.newHash(runtime, envs, null)); defineGlobal(runtime, "$-p", commandline.assumePrinting); defineGlobal(runtime, "$-n", commandline.assumeLoop); defineGlobal(runtime, "$-a", commandline.sDoSplit); defineGlobal(runtime, "$-l", commandline.processLineEnds); runtime.getGlobalVariables().defineReadonly("$*", new ValueAccessor(argumentArray)); runtime.defineVariable(new RubyGlobal.StringGlobalVariable(runtime, "$0", runtime.newString(filename))); runtime.getLoadService().init(runtime, 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/61503e7396c70acb6ed9f50922ff044d1fcc4bcc/Main.java/buggy/src/org/jruby/Main.java |
if (isNil()) { return getNilSingletonClass(); } | public MetaClass getSingletonClass() { if (isNil()) { return getNilSingletonClass(); } RubyClass type = getMetaClass(); if (!type.isSingleton()) { type = makeMetaClass(getMetaClass()); } assert type instanceof MetaClass; type.setTaint(isTaint()); type.setFrozen(isFrozen()); return (MetaClass)type; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/32d84ae899fd3c367ef3800d0984b69f53209031/RubyObject.java/clean/src/org/jruby/RubyObject.java |
|
type = makeMetaClass(getMetaClass()); | type = makeMetaClass(type, getRuntime().getCurrentContext().getRubyClass()); | public MetaClass getSingletonClass() { if (isNil()) { return getNilSingletonClass(); } RubyClass type = getMetaClass(); if (!type.isSingleton()) { type = makeMetaClass(getMetaClass()); } assert type instanceof MetaClass; type.setTaint(isTaint()); type.setFrozen(isFrozen()); return (MetaClass)type; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/32d84ae899fd3c367ef3800d0984b69f53209031/RubyObject.java/clean/src/org/jruby/RubyObject.java |
type.setTaint(isTaint()); type.setFrozen(isFrozen()); | if (!isNil()) { type.setTaint(isTaint()); type.setFrozen(isFrozen()); } | public MetaClass getSingletonClass() { if (isNil()) { return getNilSingletonClass(); } RubyClass type = getMetaClass(); if (!type.isSingleton()) { type = makeMetaClass(getMetaClass()); } assert type instanceof MetaClass; type.setTaint(isTaint()); type.setFrozen(isFrozen()); return (MetaClass)type; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/32d84ae899fd3c367ef3800d0984b69f53209031/RubyObject.java/clean/src/org/jruby/RubyObject.java |
public MetaClass makeMetaClass(RubyClass type) { MetaClass metaClass = type.newSingletonClass(); setMetaClass(metaClass); | public MetaClass makeMetaClass(RubyClass type, RubyModule parentModule) { MetaClass metaClass = type.newSingletonClass(parentModule); if (!isNil()) { setMetaClass(metaClass); } | public MetaClass makeMetaClass(RubyClass type) { MetaClass metaClass = type.newSingletonClass(); setMetaClass(metaClass); metaClass.attachToObject(this); return metaClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/32d84ae899fd3c367ef3800d0984b69f53209031/RubyObject.java/clean/src/org/jruby/RubyObject.java |
suite.addTest(new TestSuite(TestRubyTime.class)); | public static Test suite() throws Throwable { TestSuite suite = new TestSuite(); suite.addTest(new TestSuite(TestRubyObject.class)); suite.addTest(new TestSuite(TestRubyNil.class)); suite.addTest(new TestSuite(TestRubyHash.class)); suite.addTest(new TestSuite(TestRubyTime.class)); suite.addTest(new TestSuite(TestRuby.class)); suite.addTest(new TestSuite(TestRequire.class)); suite.addTest(new TestSuite(TestJavaUtil.class)); suite.addTestSuite(TestJavaClass.class); suite.addTest(new TestSuite(TestKernel.class)); suite.addTest(new TestSuite(TestKernel.class)); suite.addTest(new TestSuite(TestRubyCollect.class)); suite.addTest(new TestSuite(TestObjectSpace.class)); suite.addTest(ScriptTestSuite.suite()); suite.addTest(new TestSuite(TestRubySymbol.class)); suite.addTest(JavaSupportTestSuite.suite()); suite.addTest(new TestSuite(TestIdentitySet.class)); suite.addTest(new TestSuite(TestCommandlineParser.class)); suite.addTest(new TestSuite(TestRubyException.class)); suite.addTest(new TestSuite(TestReflectionCallback.class)); suite.addTest(new TestSuite(TestRegexpTranslator.class)); //suite.addTest(new TestSuite(TestAdoptedThreading.class)); suite.addTest(new TestSuite(TestRubyArray.class)); return suite; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/70d0ac3914a10ee21018f230c9b0bbf1910d47a3/MainTestSuite.java/buggy/test/org/jruby/test/MainTestSuite.java |
|
suite.addTest(new TestSuite(TestRubyProxyFactory.class)); | suite.addTest(new TestSuite(TestBSF.class)); | public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new TestSuite(TestRubyProxyFactory.class)); return suite; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8c54b93def4895b998d669a089420d5925274ea0/JavaSupportTestSuite.java/buggy/test/org/jruby/javasupport/test/JavaSupportTestSuite.java |
setResourcePath(DEFAULT_RESOURCE_PATH); | setBaseFolderPath(DEFAULT_RESOURCE_PATH); | public ArticleListViewer() { super(); setBeanIdentifier(ARTICLE_LIST_BEAN); setResourcePath(DEFAULT_RESOURCE_PATH); } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/9dd8a7f9883fa3785baebfbed97ebf38eba1add9/ArticleListViewer.java/clean/src/java/com/idega/block/article/component/ArticleListViewer.java |
String name = constructorArgNames[i]; | Property name = new Property(constructorArgNames[i]); | private Object[] extractConstructorArgs(Map propertyValues, Class[] constructorArgTypes) { Object[] parameters = new Object[constructorArgNames.length]; for (int i = 0; i < constructorArgNames.length; i++) { String name = constructorArgNames[i]; Class type = constructorArgTypes[i]; Object value; if (propertyValues.containsKey(name)) { value = propertyValues.remove(name); if (!isInstance(type, value) && !isConvertable(type, value)) { throw new ConstructionException("Invalid and non-convertable constructor parameter type: " + "name=" + name + ", " + "index=" + i + ", " + "expected=" + Classes.getClassName(type, true) + ", " + "actual=" + Classes.getClassName(value, true)); } value = convert(type, value); } else { value = getDefaultValue(type); } parameters[i] = value; } return parameters; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/8c27c0b6aebc5d1091ad9af5270f8fdd7d5ea487/ObjectRecipe.java/buggy/xbean-reflect/src/main/java/org/apache/xbean/recipe/ObjectRecipe.java |
if (name == null) throw new NullPointerException("name is null"); Object value = properties.get(name); | Object value = properties.get(new Property(name)); | public Object getProperty(String name) { if (name == null) throw new NullPointerException("name is null"); Object value = properties.get(name); return value; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/8c27c0b6aebc5d1091ad9af5270f8fdd7d5ea487/ObjectRecipe.java/buggy/xbean-reflect/src/main/java/org/apache/xbean/recipe/ObjectRecipe.java |
String str = arg.toString().trim(); double d = 0.0; int pos = str.length(); for (int i = 0; i < pos; i++) { if ("0123456789eE+-.".indexOf(str.charAt(i)) == -1) { pos = i + 1; break; } } for (; pos > 0; pos--) { try { d = Double.parseDouble(str.substring(0, pos)); } catch (NumberFormatException ex) { continue; } break; } return new RubyFloat(runtime, d); | return str2fnum(runtime,arg,false); | public static RubyFloat str2fnum(IRuby runtime, RubyString arg) { String str = arg.toString().trim(); double d = 0.0; int pos = str.length(); for (int i = 0; i < pos; i++) { if ("0123456789eE+-.".indexOf(str.charAt(i)) == -1) { pos = i + 1; break; } } for (; pos > 0; pos--) { try { d = Double.parseDouble(str.substring(0, pos)); } catch (NumberFormatException ex) { continue; } break; } return new RubyFloat(runtime, d); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a8583bc4b548ea3f09cf86cc0ce0b77670255f40/RubyNumeric.java/buggy/src/org/jruby/RubyNumeric.java |
StringBuffer sbuf = new StringBuffer(str.toString().trim()); if (sbuf.length() == 0) { return RubyFixnum.zero(runtime); } int pos = 0; int radix = (base != 0) ? base : 10; boolean digitsFound = false; if (sbuf.charAt(pos) == '-') { pos++; } else if (sbuf.charAt(pos) == '+') { sbuf.deleteCharAt(pos); } if (pos == sbuf.length()) { return RubyFixnum.zero(runtime); } if (sbuf.charAt(pos) == '0') { sbuf.deleteCharAt(pos); if (pos == sbuf.length()) { return RubyFixnum.zero(runtime); } if (sbuf.charAt(pos) == 'x' || sbuf.charAt(pos) == 'X') { if (base == 0 || base == 16) { radix = 16; sbuf.deleteCharAt(pos); } } else if (sbuf.charAt(pos) == 'b' || sbuf.charAt(pos) == 'B') { if (base == 0 || base == 2) { radix = 2; sbuf.deleteCharAt(pos); } } else { radix = (base == 0) ? 8 : base; } } while (pos < sbuf.length()) { if (sbuf.charAt(pos) == '_') { sbuf.deleteCharAt(pos); } else if (Character.digit(sbuf.charAt(pos), radix) != -1) { digitsFound = true; pos++; } else { break; } } if (!digitsFound) { return RubyFixnum.zero(runtime); } try { long l = Long.parseLong(sbuf.substring(0, pos), radix); return runtime.newFixnum(l); } catch (NumberFormatException ex) { BigInteger bi = new BigInteger(sbuf.substring(0, pos), radix); return new RubyBignum(runtime, bi); } | return str2inum(runtime,str,base,false); | public static RubyInteger str2inum(IRuby runtime, RubyString str, int base) { StringBuffer sbuf = new StringBuffer(str.toString().trim()); if (sbuf.length() == 0) { return RubyFixnum.zero(runtime); } int pos = 0; int radix = (base != 0) ? base : 10; boolean digitsFound = false; if (sbuf.charAt(pos) == '-') { pos++; } else if (sbuf.charAt(pos) == '+') { sbuf.deleteCharAt(pos); } if (pos == sbuf.length()) { return RubyFixnum.zero(runtime); } if (sbuf.charAt(pos) == '0') { sbuf.deleteCharAt(pos); if (pos == sbuf.length()) { return RubyFixnum.zero(runtime); } if (sbuf.charAt(pos) == 'x' || sbuf.charAt(pos) == 'X') { if (base == 0 || base == 16) { radix = 16; sbuf.deleteCharAt(pos); } } else if (sbuf.charAt(pos) == 'b' || sbuf.charAt(pos) == 'B') { if (base == 0 || base == 2) { radix = 2; sbuf.deleteCharAt(pos); } } else { radix = (base == 0) ? 8 : base; } } while (pos < sbuf.length()) { if (sbuf.charAt(pos) == '_') { sbuf.deleteCharAt(pos); } else if (Character.digit(sbuf.charAt(pos), radix) != -1) { digitsFound = true; pos++; } else { break; } } if (!digitsFound) { return RubyFixnum.zero(runtime); } try { long l = Long.parseLong(sbuf.substring(0, pos), radix); return runtime.newFixnum(l); } catch (NumberFormatException ex) { BigInteger bi = new BigInteger(sbuf.substring(0, pos), radix); return new RubyBignum(runtime, bi); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a8583bc4b548ea3f09cf86cc0ce0b77670255f40/RubyNumeric.java/buggy/src/org/jruby/RubyNumeric.java |
RubyFixnum fn = (RubyFixnum) recv.funcall("<=>", other); return RubyBoolean.newBoolean(ruby, fn.getValue() >= 0); | return RubyNumeric.fix2int(recv.funcall("<=>", other)) >= 0 ? ruby.getTrue() : ruby.getFalse(); | public static RubyBoolean op_ge(Ruby ruby, RubyObject recv, RubyObject other) { RubyFixnum fn = (RubyFixnum) recv.funcall("<=>", other); return RubyBoolean.newBoolean(ruby, fn.getValue() >= 0); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/RubyComparable.java/buggy/org/jruby/RubyComparable.java |
RubyFixnum fn = (RubyFixnum) recv.funcall("<=>", other); return RubyBoolean.newBoolean(ruby, fn.getValue() > 0); | return RubyNumeric.fix2int(recv.funcall("<=>", other)) > 0 ? ruby.getTrue() : ruby.getFalse(); | public static RubyBoolean op_gt(Ruby ruby, RubyObject recv, RubyObject other) { RubyFixnum fn = (RubyFixnum) recv.funcall("<=>", other); return RubyBoolean.newBoolean(ruby, fn.getValue() > 0); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/RubyComparable.java/buggy/org/jruby/RubyComparable.java |
RubyFixnum fn = (RubyFixnum) recv.funcall("<=>", other); return RubyBoolean.newBoolean(ruby, fn.getValue() <= 0); | return RubyNumeric.fix2int(recv.funcall("<=>", other)) <= 0 ? ruby.getTrue() : ruby.getFalse(); | public static RubyBoolean op_le(Ruby ruby, RubyObject recv, RubyObject other) { RubyFixnum fn = (RubyFixnum) recv.funcall("<=>", other); return RubyBoolean.newBoolean(ruby, fn.getValue() <= 0); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/RubyComparable.java/buggy/org/jruby/RubyComparable.java |
RubyFixnum fn = (RubyFixnum) recv.funcall("<=>", other); return RubyBoolean.newBoolean(ruby, fn.getValue() < 0); | return RubyNumeric.fix2int(recv.funcall("<=>", other)) < 0 ? ruby.getTrue() : ruby.getFalse(); | public static RubyBoolean op_lt(Ruby ruby, RubyObject recv, RubyObject other) { RubyFixnum fn = (RubyFixnum) recv.funcall("<=>", other); return RubyBoolean.newBoolean(ruby, fn.getValue() < 0); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/786cea08c1dd2092a02d1254b49fbee371ace5f9/RubyComparable.java/buggy/org/jruby/RubyComparable.java |
Class widestClass = returningMethod.getReturnType(); | private Class returnedObjectType(Object javaResult, Method returningMethod) { Class narrowestClass = javaResult.getClass(); Class widestClass = returningMethod.getReturnType(); if (narrowestClass.isPrimitive()) { return narrowestClass; } if (widestClass.isPrimitive()) { return widestClass; } Asserts.assertExpression(widestClass.isAssignableFrom(narrowestClass)); if (Modifier.isPublic(narrowestClass.getModifiers())) { return narrowestClass; } if (widestClass.isInterface()) { return widestClass; } // If there is any interface on the narrowest that isn't on the widest, // then we should use that. The theory is that this should minimize information // loss. (This theory is open to discussion ;-) Iterator narrowestClassInterfaces = Arrays.asList(narrowestClass.getInterfaces()).iterator(); List widestClassInterfaces = Arrays.asList(widestClass.getInterfaces()); while (narrowestClassInterfaces.hasNext()) { Class iface = (Class) narrowestClassInterfaces.next(); if (! widestClassInterfaces.contains(iface)) { return iface; } } while (true) { narrowestClass = narrowestClass.getSuperclass(); Asserts.assertExpression(narrowestClass != null); if (Modifier.isPublic(narrowestClass.getModifiers())) { return narrowestClass; } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/092ef8d477c373203f77b7d727ecd57bebff2cb7/JavaMethod.java/clean/org/jruby/javasupport/JavaMethod.java |
|
} else if (List.class.isAssignableFrom(javaClass)) { return arg instanceof RubyArray; } else if (Map.class.isAssignableFrom(javaClass)) { return arg instanceof RubyHash; | public static boolean isCompatible(IRubyObject arg, Class javaClass) { if (arg.isNil()) { return true; } if (javaClass.isInstance(arg)) { // arg is already of the required jruby class (or subclass) return true; } if (javaClass == Object.class || javaClass == null) { return true; } else if (javaClass.isPrimitive()) { String cName = javaClass.getName(); if (cName == "boolean") { return true; } return arg instanceof RubyNumeric || arg instanceof RubyString; } else if (javaClass.isArray()) { if (!(arg instanceof RubyArray)) { return false; } Class arrayClass = javaClass.getComponentType(); for (int i = 0; i < ((RubyArray) arg).getLength(); i++) { if (!isCompatible(((RubyArray) arg).entry(i), arrayClass)) { return false; } } return true; } else if (List.class.isAssignableFrom(javaClass)) { return arg instanceof RubyArray; } else if (Map.class.isAssignableFrom(javaClass)) { return arg instanceof RubyHash; } else { return javaClass.isAssignableFrom(arg.getJavaClass()); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/05c7de156620b4e1926ea77f476287db1b42b4cc/JavaUtil.java/buggy/src/org/jruby/javasupport/JavaUtil.java |
|
dup.setRubyClass(getInternalClass()); | dup.setInternalClass(getInternalClass()); | public IRubyObject dup() { RubyModule dup = (RubyModule) rbClone(); dup.setRubyClass(getInternalClass()); // +++ jpetersen // dup.setSingleton(isSingleton()); // --- jpetersen return dup; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/RubyModule.java/buggy/org/jruby/RubyModule.java |
Ruby ruby = input.getRuby(); | Ruby ruby = input.getRuntime(); | public static RubyModule unmarshalFrom(UnmarshalStream input) throws java.io.IOException { String name = input.unmarshalString(); Ruby ruby = input.getRuby(); RubyModule result = ruby.getClasses().getClassFromPath(name); if (result == null) { throw new NameError(ruby, "uninitialized constant " + name); } return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/RubyModule.java/buggy/org/jruby/RubyModule.java |
ruby.setCBase(module); | public RubyObject setupModule(Ruby ruby, RubyModule module) { // Node node = n; String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); // TMP_PROTECT; ruby.getRubyFrame().tmpPush(); ruby.pushClass(); ruby.setRubyClass(module); ruby.setCBase(module); //CHAD ruby.getScope().push(); RubyVarmap.push(ruby); if (getTable() != null) { ruby.getScope().setLocalValues(new ArrayList(Collections.nCopies(getTable().size(), ruby.getNil()))); ruby.getScope().setLocalNames(getTable()); } else { ruby.getScope().setLocalValues(null); ruby.getScope().setLocalNames(null); } // +++ // if (ruby.getCRef() != null) { ruby.getCRef().push(module); // } else { // ruby.setCRef(new CRefNode(module, null)); // } // --- ruby.getRubyFrame().setCbase(ruby.getCRef()); try { // if (trace_func) { // call_trace_func("class", file, line, ruby_class, // ruby_frame->last_func, ruby_frame->last_class ); // } return ruby.getRubyClass().eval(getNextNode()); } finally { // if (trace_func){ // call_trace_func("end", file, line, 0, ruby_frame->last_func, ruby_frame->last_class ); // } ruby.getCRef().pop(); RubyVarmap.pop(ruby); ruby.getScope().pop(); ruby.popClass(); ruby.getRubyFrame().tmpPop(); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/ScopeNode.java/buggy/org/jruby/nodes/ScopeNode.java |
|
loadService.addAutoload(symbol.asSymbol(), new IAutoloadMethod() { | final String baseName = symbol.asSymbol(); String nm = baseName; if(recv instanceof RubyModule) { nm = ((RubyModule)recv).getName() + "::" + nm; } loadService.addAutoload(nm, new IAutoloadMethod() { public String file() { return file.toString(); } | public static IRubyObject autoload(final IRubyObject recv, IRubyObject symbol, final IRubyObject file) { final LoadService loadService = recv.getRuntime().getLoadService(); loadService.addAutoload(symbol.asSymbol(), new IAutoloadMethod() { /** * @see org.jruby.runtime.load.IAutoloadMethod#load(IRuby, String) */ public IRubyObject load(IRuby runtime, String name) { loadService.require(file.toString()); return ((RubyModule)recv).getConstant(name); } }); return recv; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/3cd87a03d9ff599871bd14f49c218d1045bca20b/RubyKernel.java/clean/src/org/jruby/RubyKernel.java |
return ((RubyModule)recv).getConstant(name); | if(recv instanceof RubyModule) { return ((RubyModule)recv).getConstant(baseName); } return runtime.getObject().getConstant(baseName); | public static IRubyObject autoload(final IRubyObject recv, IRubyObject symbol, final IRubyObject file) { final LoadService loadService = recv.getRuntime().getLoadService(); loadService.addAutoload(symbol.asSymbol(), new IAutoloadMethod() { /** * @see org.jruby.runtime.load.IAutoloadMethod#load(IRuby, String) */ public IRubyObject load(IRuby runtime, String name) { loadService.require(file.toString()); return ((RubyModule)recv).getConstant(name); } }); return recv; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/3cd87a03d9ff599871bd14f49c218d1045bca20b/RubyKernel.java/clean/src/org/jruby/RubyKernel.java |
return ((RubyModule)recv).getConstant(name); | if(recv instanceof RubyModule) { return ((RubyModule)recv).getConstant(baseName); } return runtime.getObject().getConstant(baseName); | public IRubyObject load(IRuby runtime, String name) { loadService.require(file.toString()); return ((RubyModule)recv).getConstant(name); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/3cd87a03d9ff599871bd14f49c218d1045bca20b/RubyKernel.java/clean/src/org/jruby/RubyKernel.java |
module.definePublicModuleFunction("autoload?", callbackFactory.getSingletonMethod("autoload_p", IRubyObject.class)); | public static RubyModule createKernelModule(IRuby runtime) { RubyModule module = runtime.defineModule("Kernel"); CallbackFactory callbackFactory = runtime.callbackFactory(RubyKernel.class); CallbackFactory objectCallbackFactory = runtime.callbackFactory(RubyObject.class); module.defineModuleFunction("Array", callbackFactory.getSingletonMethod("new_array", IRubyObject.class)); module.defineModuleFunction("Float", callbackFactory.getSingletonMethod("new_float", IRubyObject.class)); module.defineModuleFunction("Integer", callbackFactory.getSingletonMethod("new_integer", IRubyObject.class)); module.defineModuleFunction("String", callbackFactory.getSingletonMethod("new_string", IRubyObject.class)); module.defineModuleFunction("`", callbackFactory.getSingletonMethod("backquote", IRubyObject.class)); // TODO: Implement Kernel#abort module.defineModuleFunction("at_exit", callbackFactory.getSingletonMethod("at_exit")); module.defineModuleFunction("autoload", callbackFactory.getSingletonMethod("autoload", IRubyObject.class, IRubyObject.class)); // TODO: Implement Kernel#autoload? module.defineModuleFunction("binding", callbackFactory.getSingletonMethod("binding")); module.defineModuleFunction("block_given?", callbackFactory.getSingletonMethod("block_given")); // TODO: Implement Kernel#callcc module.defineModuleFunction("caller", callbackFactory.getOptSingletonMethod("caller")); module.defineModuleFunction("catch", callbackFactory.getSingletonMethod("rbCatch", IRubyObject.class)); module.defineModuleFunction("chomp", callbackFactory.getOptSingletonMethod("chomp")); module.defineModuleFunction("chomp!", callbackFactory.getOptSingletonMethod("chomp_bang")); module.defineModuleFunction("chop", callbackFactory.getSingletonMethod("chop")); module.defineModuleFunction("chop!", callbackFactory.getSingletonMethod("chop_bang")); module.defineModuleFunction("eval", callbackFactory.getOptSingletonMethod("eval")); module.defineModuleFunction("exit", callbackFactory.getOptSingletonMethod("exit")); module.defineModuleFunction("exit!", callbackFactory.getOptSingletonMethod("exit_bang")); module.defineModuleFunction("fail", callbackFactory.getOptSingletonMethod("raise")); // TODO: Implement Kernel#fork module.defineModuleFunction("format", callbackFactory.getOptSingletonMethod("sprintf")); module.defineModuleFunction("gets", callbackFactory.getOptSingletonMethod("gets")); module.defineModuleFunction("global_variables", callbackFactory.getSingletonMethod("global_variables")); module.defineModuleFunction("gsub", callbackFactory.getOptSingletonMethod("gsub")); module.defineModuleFunction("gsub!", callbackFactory.getOptSingletonMethod("gsub_bang")); // TODO: Add deprecation to Kernel#iterator? (maybe formal deprecation mech.) module.defineModuleFunction("iterator?", callbackFactory.getSingletonMethod("block_given")); module.defineModuleFunction("lambda", callbackFactory.getSingletonMethod("proc")); module.defineModuleFunction("load", callbackFactory.getOptSingletonMethod("load")); module.defineModuleFunction("local_variables", callbackFactory.getSingletonMethod("local_variables")); module.defineModuleFunction("loop", callbackFactory.getSingletonMethod("loop")); // Note: method_missing is documented as being in Object, but ruby appears to stick it in Kernel. module.defineModuleFunction("method_missing", callbackFactory.getOptSingletonMethod("method_missing")); module.defineModuleFunction("open", callbackFactory.getOptSingletonMethod("open")); module.defineModuleFunction("p", callbackFactory.getOptSingletonMethod("p")); module.defineModuleFunction("print", callbackFactory.getOptSingletonMethod("print")); module.defineModuleFunction("printf", callbackFactory.getOptSingletonMethod("printf")); module.defineModuleFunction("proc", callbackFactory.getSingletonMethod("proc")); // TODO: implement Kernel#putc module.defineModuleFunction("puts", callbackFactory.getOptSingletonMethod("puts")); module.defineModuleFunction("raise", callbackFactory.getOptSingletonMethod("raise")); module.defineModuleFunction("rand", callbackFactory.getOptSingletonMethod("rand")); module.defineModuleFunction("readline", callbackFactory.getOptSingletonMethod("readline")); module.defineModuleFunction("readlines", callbackFactory.getOptSingletonMethod("readlines")); module.defineModuleFunction("require", callbackFactory.getSingletonMethod("require", IRubyObject.class)); module.defineModuleFunction("scan", callbackFactory.getSingletonMethod("scan", IRubyObject.class)); module.defineModuleFunction("select", callbackFactory.getOptSingletonMethod("select")); module.defineModuleFunction("set_trace_func", callbackFactory.getSingletonMethod("set_trace_func", IRubyObject.class)); module.defineModuleFunction("sleep", callbackFactory.getSingletonMethod("sleep", IRubyObject.class)); module.defineModuleFunction("split", callbackFactory.getOptSingletonMethod("split")); module.defineModuleFunction("sprintf", callbackFactory.getOptSingletonMethod("sprintf")); module.defineModuleFunction("srand", callbackFactory.getOptSingletonMethod("srand")); module.defineModuleFunction("sub", callbackFactory.getOptSingletonMethod("sub")); module.defineModuleFunction("sub!", callbackFactory.getOptSingletonMethod("sub_bang")); // Skipping: Kernel#syscall (too system dependent) module.defineModuleFunction("system", callbackFactory.getOptSingletonMethod("system")); // TODO: Implement Kernel#exec differently? module.defineModuleFunction("exec", callbackFactory.getOptSingletonMethod("system")); // TODO: Implement Kernel#test (partial impl) module.defineModuleFunction("throw", callbackFactory.getOptSingletonMethod("rbThrow")); // TODO: Implement Kernel#trace_var module.defineModuleFunction("trap", callbackFactory.getOptSingletonMethod("trap")); // TODO: Implement Kernel#untrace_var module.defineModuleFunction("warn", callbackFactory.getSingletonMethod("warn", IRubyObject.class)); // Defined p411 Pickaxe 2nd ed. module.defineModuleFunction("singleton_method_added", callbackFactory.getSingletonMethod("singleton_method_added", IRubyObject.class)); // Object methods module.definePublicModuleFunction("==", objectCallbackFactory.getMethod("equal", IRubyObject.class)); module.defineAlias("===", "=="); module.defineAlias("eql?", "=="); module.definePublicModuleFunction("to_s", objectCallbackFactory.getMethod("to_s")); module.definePublicModuleFunction("nil?", objectCallbackFactory.getMethod("nil_p")); module.definePublicModuleFunction("to_a", callbackFactory.getSingletonMethod("to_a")); module.definePublicModuleFunction("hash", objectCallbackFactory.getMethod("hash")); module.definePublicModuleFunction("id", objectCallbackFactory.getMethod("id")); module.defineAlias("__id__", "id"); module.defineAlias("object_id", "id"); module.definePublicModuleFunction("is_a?", objectCallbackFactory.getMethod("kind_of", IRubyObject.class)); module.defineAlias("kind_of?", "is_a?"); module.definePublicModuleFunction("dup", objectCallbackFactory.getMethod("dup")); module.definePublicModuleFunction("equal?", objectCallbackFactory.getMethod("same", IRubyObject.class)); module.definePublicModuleFunction("type", objectCallbackFactory.getMethod("type_deprecated")); module.definePublicModuleFunction("class", objectCallbackFactory.getMethod("type")); module.definePublicModuleFunction("inspect", objectCallbackFactory.getMethod("inspect")); module.definePublicModuleFunction("=~", objectCallbackFactory.getMethod("match", IRubyObject.class)); module.definePublicModuleFunction("clone", objectCallbackFactory.getMethod("rbClone")); module.definePublicModuleFunction("display", objectCallbackFactory.getOptMethod("display")); module.definePublicModuleFunction("extend", objectCallbackFactory.getOptMethod("extend")); module.definePublicModuleFunction("freeze", objectCallbackFactory.getMethod("freeze")); module.definePublicModuleFunction("frozen?", objectCallbackFactory.getMethod("frozen")); module.defineModuleFunction("initialize_copy", objectCallbackFactory.getMethod("initialize_copy", IRubyObject.class)); module.definePublicModuleFunction("instance_eval", objectCallbackFactory.getOptMethod("instance_eval")); module.definePublicModuleFunction("instance_of?", objectCallbackFactory.getMethod("instance_of", IRubyObject.class)); module.definePublicModuleFunction("instance_variables", objectCallbackFactory.getMethod("instance_variables")); module.definePublicModuleFunction("instance_variable_get", objectCallbackFactory.getMethod("instance_variable_get", IRubyObject.class)); module.definePublicModuleFunction("instance_variable_set", objectCallbackFactory.getMethod("instance_variable_set", IRubyObject.class, IRubyObject.class)); module.definePublicModuleFunction("method", objectCallbackFactory.getMethod("method", IRubyObject.class)); module.definePublicModuleFunction("methods", objectCallbackFactory.getOptMethod("methods")); module.definePublicModuleFunction("private_methods", objectCallbackFactory.getMethod("private_methods")); module.definePublicModuleFunction("protected_methods", objectCallbackFactory.getMethod("protected_methods")); module.definePublicModuleFunction("public_methods", objectCallbackFactory.getOptMethod("public_methods")); module.defineModuleFunction("remove_instance_variable", objectCallbackFactory.getMethod("remove_instance_variable", IRubyObject.class)); module.definePublicModuleFunction("respond_to?", objectCallbackFactory.getOptMethod("respond_to")); module.definePublicModuleFunction("send", objectCallbackFactory.getOptMethod("send")); module.defineAlias("__send__", "send"); module.definePublicModuleFunction("singleton_methods", objectCallbackFactory.getMethod("singleton_methods")); module.definePublicModuleFunction("taint", objectCallbackFactory.getMethod("taint")); module.definePublicModuleFunction("tainted?", objectCallbackFactory.getMethod("tainted")); module.definePublicModuleFunction("untaint", objectCallbackFactory.getMethod("untaint")); return module; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/3cd87a03d9ff599871bd14f49c218d1045bca20b/RubyKernel.java/clean/src/org/jruby/RubyKernel.java |
|
{ if (null==c) { | { ds = (DataSource) applicationContext.getBean("dataSource"); if (null==c) { | protected void onSetUpInTransaction() throws Exception { if (null==c) { try { c = new DatabaseConnection(ds.getConnection()); DatabaseOperation.CLEAN_INSERT.execute(c,getData()); } catch (Exception e){ c = null; throw e; } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/59b11883b95c926d6706e6d30b4cdb898088683c/AbstractDbUnitTest.java/buggy/components/server/test/ome/server/dbtests/AbstractDbUnitTest.java |
protected void onSetUpInTransaction() throws Exception { if (null==c) { try { c = new DatabaseConnection(ds.getConnection()); DatabaseOperation.CLEAN_INSERT.execute(c,getData()); } catch (Exception e){ c = null; throw e; } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/59b11883b95c926d6706e6d30b4cdb898088683c/AbstractDbUnitTest.java/buggy/components/server/test/ome/server/dbtests/AbstractDbUnitTest.java |
||
return ACTION_ARRAY; | return super.getToolbarActions(); | public String[] getToolbarActions(){ return ACTION_ARRAY; } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/44c7553551d463f44b7cb7cf5d0a43b62412701b/ArticleItemBean.java/clean/src/java/com/idega/block/article/bean/ArticleItemBean.java |
if ((ignoreRegex != null) && (pm.matches(owner, ignoreRegex))) classData.removeLine(currentLine); | Iterator iter = ignoreRegexs.iterator(); while (iter.hasNext()) { Pattern ignoreRegex = (Pattern)iter.next(); if ((ignoreRegexs != null) && (pm.matches(owner, ignoreRegex))) { classData.removeLine(currentLine); return; } } | public void visitMethodInsn(int opcode, String owner, String name, String desc) { super.visitMethodInsn(opcode, owner, name, desc); if ((ignoreRegex != null) && (pm.matches(owner, ignoreRegex))) classData.removeLine(currentLine); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/8d76b07e3d230fcd0d3b233e7ffc80df6ca3ec82/MethodInstrumenter.java/clean/cobertura/src/net/sourceforge/cobertura/instrument/MethodInstrumenter.java |
public void addNoteTab(DisplayedNote displayedNote) { new NoteTab(tabFolder, l, displayedNote); | public NoteTab addNoteTab(DisplayedNote displayedNote) { return new NoteTab(tabFolder, l, displayedNote); | public void addNoteTab(DisplayedNote displayedNote) { new NoteTab(tabFolder, l, displayedNote); } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/a21e67d29e81a4038ecb2d55530f57396df4085c/NoteTabFolder.java/clean/trunk/src/de/berlios/koalanotes/display/NoteTabFolder.java |
text = new Text(parent, SWT.NONE); | tabItem.addDisposeListener(this); text = new Text(parent, SWT.MULTI | SWT.WRAP); | public NoteTab(final CTabFolder parent, Listener l, DisplayedNote displayedNote) { this.displayedNote = displayedNote; tabItem = new CTabItem(parent, SWT.NONE); tabItem.setText(displayedNote.getName()); tabItem.setData(this); text = new Text(parent, SWT.NONE); text.setText(displayedNote.getNote().getText()); tabItem.setControl(text); displayedNote.setTab(this); select(); l.mapEvent(tabItem, SWT.Dispose, MainController.CLOSE_TAB); } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/18ce9cf33f3e06fda4addd57f5ae5c9423a990fb/NoteTab.java/buggy/trunk/src/de/berlios/koalanotes/display/NoteTab.java |
l.mapEvent(tabItem, SWT.Dispose, MainController.CLOSE_TAB); | public NoteTab(final CTabFolder parent, Listener l, DisplayedNote displayedNote) { this.displayedNote = displayedNote; tabItem = new CTabItem(parent, SWT.NONE); tabItem.setText(displayedNote.getName()); tabItem.setData(this); text = new Text(parent, SWT.NONE); text.setText(displayedNote.getNote().getText()); tabItem.setControl(text); displayedNote.setTab(this); select(); l.mapEvent(tabItem, SWT.Dispose, MainController.CLOSE_TAB); } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/18ce9cf33f3e06fda4addd57f5ae5c9423a990fb/NoteTab.java/buggy/trunk/src/de/berlios/koalanotes/display/NoteTab.java |
|
super(parameters); | super(defs, parameters); | public PojosCGCPathsQueryDefinition(QueryParameter... parameters) { super(parameters); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f990a7d35ce265e182121d562725175896db41f4/PojosCGCPathsQueryDefinition.java/buggy/components/server/src/ome/services/query/PojosCGCPathsQueryDefinition.java |
WFTabBar tb = (WFTabBar) link.getParent().getParent().getParent().findComponent(MAIN_TASKBAR_ID); tb.setSelectedButtonId(TASK_ID_EDIT); | WFTabbedPane tb = (WFTabbedPane) link.getParent().getParent().getParent().findComponent(MAIN_TASKBAR_ID); tb.setSelectedMenuItemId(TASK_ID_EDIT); | public void processAction(ActionEvent event) { UIComponent link = event.getComponent(); String id = WFUtil.getParameter(link, "id"); WFTabBar tb = (WFTabBar) link.getParent().getParent().getParent().findComponent(MAIN_TASKBAR_ID); tb.setSelectedButtonId(TASK_ID_EDIT); ArticleBlock ab = (ArticleBlock) tb.findComponent(ArticleBlock.ARTICLE_BLOCK_ID); ab.setEditMode(); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "clear"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLocaleId", "sv"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setHeadline", "headline"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setBody", id); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setAuthor", "author"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setComment", "comment"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setDescription", "description"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setSource", "source"); if (link.getId().equals(ArticleListBean.ARTICLE_ID)) { WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setStatus", ContentItemCase.STATUS_PUBLISHED); } else { WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setStatus", ContentItemCase.STATUS_UNDER_REVIEW); } WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setMainCategoryId", new Integer(3)); ab.updateEditButtons(); } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/03557bc59a300e92911a58888cf6c73355c98f1c/ContentPerspective.java/buggy/src/java/com/idega/block/article/ContentPerspective.java |
WFTabBar tb = (WFTabBar) findComponent(MAIN_TASKBAR_ID); tb.setSelectedButtonId(TASK_ID_EDIT); | WFTabbedPane tb = (WFTabbedPane) findComponent(MAIN_TASKBAR_ID); tb.setSelectedMenuItemId(TASK_ID_EDIT); | public void setEditMode() { WFTabBar tb = (WFTabBar) findComponent(MAIN_TASKBAR_ID); tb.setSelectedButtonId(TASK_ID_EDIT); ArticleBlock ab = (ArticleBlock) tb.findComponent(ArticleBlock.ARTICLE_BLOCK_ID); ab.setEditMode(); } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/03557bc59a300e92911a58888cf6c73355c98f1c/ContentPerspective.java/buggy/src/java/com/idega/block/article/ContentPerspective.java |
ruby.getRuntime().callTraceFunction(event, file, line, self.toRubyObject(), name, type); | ruby.getRuntime().callTraceFunction(event, file, line, self, name, type); | private void callTraceFunction(String event, String file, int line, IRubyObject self, String name, IRubyObject type) { ruby.getRuntime().callTraceFunction(event, file, line, self.toRubyObject(), name, type); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
result = receiver.getInternalClass().call(receiver.toRubyObject(), iVisited.getName(), args, 0); | result = receiver.getInternalClass().call(receiver, iVisited.getName(), args, 0); | public void visitCallNode(CallNode iVisited) { Block tmpBlock = ArgsUtil.beginCallArgs(ruby); IRubyObject receiver = eval(iVisited.getReceiverNode()); IRubyObject[] args = ArgsUtil.setupArgs(ruby, this, iVisited.getArgsNode()); ArgsUtil.endCallArgs(ruby, tmpBlock); result = receiver.getInternalClass().call(receiver.toRubyObject(), iVisited.getName(), args, 0); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
if (expressions.entry(j).callMethod("===", expression.toRubyObject()).isTrue()) { | if (expressions.entry(j).callMethod("===", expression).isTrue()) { | public void visitCaseNode(CaseNode iVisited) { if (iVisited.getCaseNode() != null) { IRubyObject expression = eval(iVisited.getCaseNode()); Iterator iter = iVisited.getWhenNodes().iterator(); for (int i = 0, size = iVisited.getWhenNodes().size(); i < size; i++) { WhenNode whenNode = (WhenNode) iter.next(); ruby.setSourceLine(whenNode.getPosition().getLine()); ruby.setSourceFile(whenNode.getPosition().getFile()); if (isTrace()) { callTraceFunction( "line", ruby.getSourceFile(), ruby.getSourceLine(), self, ruby.getCurrentFrame().getLastFunc(), ruby.getCurrentFrame().getLastClass()); } RubyArray expressions = (RubyArray) eval(whenNode.getExpressionNodes()); for (int j = 0, len = expressions.getLength(); j < len; j++) { if (expressions.entry(j).callMethod("===", expression.toRubyObject()).isTrue()) { eval(whenNode); return; } } } } else { Iterator iter = iVisited.getWhenNodes().iterator(); while (iter.hasNext()) { WhenNode whenNode = (WhenNode) iter.next(); ruby.setSourceLine(whenNode.getPosition().getLine()); ruby.setSourceFile(whenNode.getPosition().getFile()); if (isTrace()) { callTraceFunction( "line", ruby.getSourceFile(), ruby.getSourceLine(), self, ruby.getCurrentFrame().getLastFunc(), ruby.getCurrentFrame().getLastClass()); } RubyArray expressions = (RubyArray) eval(whenNode.getExpressionNodes()); for (int i = 0; i < expressions.getLength(); i++) { if (expressions.entry(i).isTrue()) { eval(whenNode); return; } } } } eval(iVisited.getElseNode()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
ruby.getCBase().setClassVar(iVisited.getName(), result.toRubyObject()); | ruby.getCBase().setClassVar(iVisited.getName(), result); | public void visitClassVarAsgnNode(ClassVarAsgnNode iVisited) { eval(iVisited.getValueNode()); ruby.getCBase().setClassVar(iVisited.getName(), result.toRubyObject()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
ruby.getCBase().declareClassVar(iVisited.getName(), result.toRubyObject()); | ruby.getCBase().declareClassVar(iVisited.getName(), result); | public void visitClassVarDeclNode(ClassVarDeclNode iVisited) { if (ruby.getCBase() == null) { throw new TypeError(ruby, "no class/module to define class variable"); } eval(iVisited.getValueNode()); ruby.getCBase().declareClassVar(iVisited.getName(), result.toRubyObject()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
result = self.toRubyObject().getInternalClass().getClassVar(iVisited.getName()); | result = self.getInternalClass().getClassVar(iVisited.getName()); | public void visitClassVarNode(ClassVarNode iVisited) { if (ruby.getCBase() == null) { result = self.toRubyObject().getInternalClass().getClassVar(iVisited.getName()); } else if (!ruby.getCBase().isSingleton()) { result = ruby.getCBase().getClassVar(iVisited.getName()); } else { result = ((RubyModule) ruby.getCBase().getInstanceVariable("__attached__")).getClassVar(iVisited.getName()); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
ruby.getRubyClass().setConstant(iVisited.getName(), eval(iVisited.getValueNode()).toRubyObject()); | ruby.getRubyClass().setConstant(iVisited.getName(), eval(iVisited.getValueNode())); | public void visitConstDeclNode(ConstDeclNode iVisited) { if (ruby.getRubyClass() == null) { throw new TypeError(ruby, "no class/module to define constant"); } ruby.getRubyClass().setConstant(iVisited.getName(), eval(iVisited.getValueNode()).toRubyObject()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
result = ruby.getCurrentFrame().getNamespace().getConstant(self.toRubyObject(), iVisited.getName()); | result = ruby.getCurrentFrame().getNamespace().getConstant(self, iVisited.getName()); | public void visitConstNode(ConstNode iVisited) { result = ruby.getCurrentFrame().getNamespace().getConstant(self.toRubyObject(), iVisited.getName()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.