rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
public void xestSpeedCompareNThrough() throws IOException
public void xestSpeedCompareNThrough() throws Exception
public void xestSpeedCompareNThrough() throws IOException { final int n = 5; for (Iterator it = images.values().iterator(); it.hasNext();) { final Stats stats = new Stats(); Image i = (Image) it.next(); for (int j = 0; j < n; j++) { i.eachPlane(new PlaneCallback() { void each(Image i, int z, int c, int t, int counter) throws IOException { compare(stats,i,z,c,t); } }); } log.info(stats); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/ComparisonTest.java/buggy/components/omeio-bdb/test/ome/io/bdb/utests/ComparisonTest.java
throws IOException
throws Exception
public void xestSpeedCompareNThrough() throws IOException { final int n = 5; for (Iterator it = images.values().iterator(); it.hasNext();) { final Stats stats = new Stats(); Image i = (Image) it.next(); for (int j = 0; j < n; j++) { i.eachPlane(new PlaneCallback() { void each(Image i, int z, int c, int t, int counter) throws IOException { compare(stats,i,z,c,t); } }); } log.info(stats); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/ComparisonTest.java/buggy/components/omeio-bdb/test/ome/io/bdb/utests/ComparisonTest.java
throws IOException
throws Exception
void each(Image i, int z, int c, int t, int counter) throws IOException { compare(stats,i,z,c,t); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/ComparisonTest.java/buggy/components/omeio-bdb/test/ome/io/bdb/utests/ComparisonTest.java
public void xtestSpeedCompareOnceThrough() throws IOException
public void xtestSpeedCompareOnceThrough() throws Exception
public void xtestSpeedCompareOnceThrough() throws IOException { final Stats stats = new Stats(); for (Iterator it = images.values().iterator(); it.hasNext();) { Image i = (Image) it.next(); i.eachPlane(new PlaneCallback() { void each(Image i, int z, int c, int t, int counter) throws IOException { compare(stats,i,z,c,t); } }); } log.info(stats); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/ComparisonTest.java/buggy/components/omeio-bdb/test/ome/io/bdb/utests/ComparisonTest.java
throws IOException
throws Exception
public void xtestSpeedCompareOnceThrough() throws IOException { final Stats stats = new Stats(); for (Iterator it = images.values().iterator(); it.hasNext();) { Image i = (Image) it.next(); i.eachPlane(new PlaneCallback() { void each(Image i, int z, int c, int t, int counter) throws IOException { compare(stats,i,z,c,t); } }); } log.info(stats); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/ComparisonTest.java/buggy/components/omeio-bdb/test/ome/io/bdb/utests/ComparisonTest.java
throws IOException
throws Exception
void each(Image i, int z, int c, int t, int counter) throws IOException { compare(stats,i,z,c,t); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/ComparisonTest.java/buggy/components/omeio-bdb/test/ome/io/bdb/utests/ComparisonTest.java
void eachPlane(PlaneCallback action) throws IOException
void eachPlane(PlaneCallback action) throws Exception
void eachPlane(PlaneCallback action) throws IOException { int counter = 0; for (int z = 0; z < sz; z++) { for (int c = 0; c < sc; c++) { for (int t = 0; t < st; t++) { if (action != null) action.each(this, z, c, t, ++counter); } } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/ComparisonTest.java/buggy/components/omeio-bdb/test/ome/io/bdb/utests/ComparisonTest.java
byte[] getPlane(int z, int c, int t) throws IOException
byte[] getPlane(int z, int c, int t) throws Exception
byte[] getPlane(int z, int c, int t) throws IOException { if (z < 0 || z >= sz || c < 0 || c >= sc || t < 0 || t >= st) throw new IllegalArgumentException("Nope."); byte[] out = Gateway.getPlane(id, z, c, t); return out; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/ComparisonTest.java/buggy/components/omeio-bdb/test/ome/io/bdb/utests/ComparisonTest.java
throws IOException;
throws Exception;
abstract void each(Image i, int z, int c, int t, int counter) throws IOException;
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/ComparisonTest.java/buggy/components/omeio-bdb/test/ome/io/bdb/utests/ComparisonTest.java
void add(long b_time, long g_time)
void add(long b_time, long g_time, long n_time)
void add(long b_time, long g_time) { Long b = new Long(b_time); Long g = new Long(g_time); Double s = new Double(b.doubleValue() / g.doubleValue()); b_times.add(b); g_times.add(g); s_times.add(s); b_total += b.longValue(); g_total += g.longValue(); s_total += s.doubleValue(); s_avg.add(new Double(s_total/(double)s_times.size())); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/ComparisonTest.java/buggy/components/omeio-bdb/test/ome/io/bdb/utests/ComparisonTest.java
s2_avg.add(new Double(s2_total/(double)s2_times.size()));
void add(long b_time, long g_time) { Long b = new Long(b_time); Long g = new Long(g_time); Double s = new Double(b.doubleValue() / g.doubleValue()); b_times.add(b); g_times.add(g); s_times.add(s); b_total += b.longValue(); g_total += g.longValue(); s_total += s.doubleValue(); s_avg.add(new Double(s_total/(double)s_times.size())); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/ComparisonTest.java/buggy/components/omeio-bdb/test/ome/io/bdb/utests/ComparisonTest.java
sb.append("\tSlowdown: " + s_times.get(i));
sb.append("\tB/G: " + s_times.get(i));
public String toString() { double total=0.0; StringBuilder sb = new StringBuilder(); sb.append("\n---------------------------------\n"); for (int i = 0; i < last(); i++) { total+=((Double)s_times.get(i)).doubleValue(); sb.append(i); sb.append("\tSlowdown: " + s_times.get(i)); sb.append(" (" + s_avg.get(i) + ") "); sb.append("\tGateway:\t" + g_times.get(i)); sb.append("\tBdb:\t" + b_times.get(i)); sb.append("\n"); } sb.append("\n----------------------------------"); sb.append("\nBMin: "+Collections.min(b_times)); sb.append("\nBMax: "+Collections.max(b_times)); sb.append("\nGMin: "+Collections.min(g_times)); sb.append("\nGMax: "+Collections.max(g_times)); sb.append("\nSMin: "+Collections.min(s_times)); sb.append("\nSMax: "+Collections.max(s_times)); sb.append("\n----------------------------------"); return sb.toString(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/ComparisonTest.java/buggy/components/omeio-bdb/test/ome/io/bdb/utests/ComparisonTest.java
sb.append("\tGateway:\t" + g_times.get(i));
sb.append("\tN/G: " + s2_times.get(i)); sb.append(" (" + s2_avg.get(i) + ") "); sb.append("\tGtw:\t" + g_times.get(i));
public String toString() { double total=0.0; StringBuilder sb = new StringBuilder(); sb.append("\n---------------------------------\n"); for (int i = 0; i < last(); i++) { total+=((Double)s_times.get(i)).doubleValue(); sb.append(i); sb.append("\tSlowdown: " + s_times.get(i)); sb.append(" (" + s_avg.get(i) + ") "); sb.append("\tGateway:\t" + g_times.get(i)); sb.append("\tBdb:\t" + b_times.get(i)); sb.append("\n"); } sb.append("\n----------------------------------"); sb.append("\nBMin: "+Collections.min(b_times)); sb.append("\nBMax: "+Collections.max(b_times)); sb.append("\nGMin: "+Collections.min(g_times)); sb.append("\nGMax: "+Collections.max(g_times)); sb.append("\nSMin: "+Collections.min(s_times)); sb.append("\nSMax: "+Collections.max(s_times)); sb.append("\n----------------------------------"); return sb.toString(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/ComparisonTest.java/buggy/components/omeio-bdb/test/ome/io/bdb/utests/ComparisonTest.java
sb.append("\nS2Min: "+Collections.min(s2_times)); sb.append("\nS2Max: "+Collections.max(s2_times));
public String toString() { double total=0.0; StringBuilder sb = new StringBuilder(); sb.append("\n---------------------------------\n"); for (int i = 0; i < last(); i++) { total+=((Double)s_times.get(i)).doubleValue(); sb.append(i); sb.append("\tSlowdown: " + s_times.get(i)); sb.append(" (" + s_avg.get(i) + ") "); sb.append("\tGateway:\t" + g_times.get(i)); sb.append("\tBdb:\t" + b_times.get(i)); sb.append("\n"); } sb.append("\n----------------------------------"); sb.append("\nBMin: "+Collections.min(b_times)); sb.append("\nBMax: "+Collections.max(b_times)); sb.append("\nGMin: "+Collections.min(g_times)); sb.append("\nGMax: "+Collections.max(g_times)); sb.append("\nSMin: "+Collections.min(s_times)); sb.append("\nSMax: "+Collections.max(s_times)); sb.append("\n----------------------------------"); return sb.toString(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/ComparisonTest.java/buggy/components/omeio-bdb/test/ome/io/bdb/utests/ComparisonTest.java
add(b_running,g_running);
add(b_running,g_running,n_running);
void update(){ add(b_running,g_running); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/ComparisonTest.java/buggy/components/omeio-bdb/test/ome/io/bdb/utests/ComparisonTest.java
List<NoteTreeNode> treeNodes = dd.getTree().getSelectedNodes(); for (NoteTreeNode treeNode : treeNodes) { DisplayedNote dn = treeNode.getDisplayedNote(); if (dn.getTab() == null) { dd.getTabFolder().addNoteTab(dn); } else { dn.getTab().select(); }
List<DisplayedNote> selectedNotes = dd.getTree().getSelectedNotes(); for (DisplayedNote selectedNote : selectedNotes) { selectedNote.displayTab(dd.getTabFolder());
public void displayTab(Event e) { List<NoteTreeNode> treeNodes = dd.getTree().getSelectedNodes(); for (NoteTreeNode treeNode : treeNodes) { DisplayedNote dn = treeNode.getDisplayedNote(); if (dn.getTab() == null) { dd.getTabFolder().addNoteTab(dn); } else { dn.getTab().select(); } } }
57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/a21e67d29e81a4038ecb2d55530f57396df4085c/MainController.java/buggy/trunk/src/de/berlios/koalanotes/controllers/MainController.java
return null == date ? null : new Timestamp(date.getTime());
if (null==date){ log.debug("Null date."); return null; } return new Timestamp(date.getTime());
static public Timestamp convertDate(Date date){ return null == date ? null : new Timestamp(date.getTime()); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0dcf955580c9394058b7f3452a6050bc8c49e5a0/AdapterUtils.java/buggy/components/shoola-adapter/src/org/openmicroscopy/omero/shoolaadapter/AdapterUtils.java
roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)), selectedRow, 0);
roomsTable.getTableModel().setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)), selectedRow, 0);
private void bookmarkRoom(String serviceName, Tree serviceTree) { int selectedRow = roomsTable.getSelectedRow(); if (-1 == selectedRow) { JOptionPane.showMessageDialog(dlg, Res.getString("message.select.add.room.to.add"), Res.getString("title.group.chat"), JOptionPane.INFORMATION_MESSAGE); return; } final String roomJID = (String)roomsTable.getValueAt(selectedRow, 2) + "@" + serviceName; final String roomName = (String)roomsTable.getValueAt(selectedRow, 1); // Check to see what type of room this is. try { final RoomInfo roomInfo = MultiUserChat.getRoomInfo(SparkManager.getConnection(), roomJID); if (!roomInfo.isPersistent()) { JOptionPane.showMessageDialog(dlg, Res.getString("message.bookmark.temporary.room.error"), Res.getString("title.error"), JOptionPane.ERROR_MESSAGE); return; } } catch (Exception e) { // Do not return } JiveTreeNode rootNode = (JiveTreeNode)serviceTree.getModel().getRoot(); TreePath rootPath = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName}); boolean isBookmarked = isBookmarked(roomJID); if (!isBookmarked) { JiveTreeNode node = (JiveTreeNode)serviceTree.getLastSelectedPathComponent(); if (node == null) { TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), Conferences.getDefaultServiceName()}); node = (JiveTreeNode)path.getLastPathComponent(); } JiveTreeNode roomNode = new JiveTreeNode(roomName, false, SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)); roomNode.setAssociatedObject(roomJID); node.add(roomNode); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.nodeStructureChanged(node); serviceTree.expandPath(rootPath); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)), selectedRow, 0); addBookmarkUI(false); } else { // Remove bookmark TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName, roomName}); JiveTreeNode node = (JiveTreeNode)path.getLastPathComponent(); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.removeNodeFromParent(node); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BLANK_IMAGE)), selectedRow, 0); addBookmarkUI(true); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/a25389bf8b4c087833cb6240e8f822e849be4a88/ConferenceRooms.java/buggy/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRooms.java
roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BLANK_IMAGE)), selectedRow, 0);
roomsTable.getTableModel().setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BLANK_IMAGE)), selectedRow, 0);
private void bookmarkRoom(String serviceName, Tree serviceTree) { int selectedRow = roomsTable.getSelectedRow(); if (-1 == selectedRow) { JOptionPane.showMessageDialog(dlg, Res.getString("message.select.add.room.to.add"), Res.getString("title.group.chat"), JOptionPane.INFORMATION_MESSAGE); return; } final String roomJID = (String)roomsTable.getValueAt(selectedRow, 2) + "@" + serviceName; final String roomName = (String)roomsTable.getValueAt(selectedRow, 1); // Check to see what type of room this is. try { final RoomInfo roomInfo = MultiUserChat.getRoomInfo(SparkManager.getConnection(), roomJID); if (!roomInfo.isPersistent()) { JOptionPane.showMessageDialog(dlg, Res.getString("message.bookmark.temporary.room.error"), Res.getString("title.error"), JOptionPane.ERROR_MESSAGE); return; } } catch (Exception e) { // Do not return } JiveTreeNode rootNode = (JiveTreeNode)serviceTree.getModel().getRoot(); TreePath rootPath = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName}); boolean isBookmarked = isBookmarked(roomJID); if (!isBookmarked) { JiveTreeNode node = (JiveTreeNode)serviceTree.getLastSelectedPathComponent(); if (node == null) { TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), Conferences.getDefaultServiceName()}); node = (JiveTreeNode)path.getLastPathComponent(); } JiveTreeNode roomNode = new JiveTreeNode(roomName, false, SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)); roomNode.setAssociatedObject(roomJID); node.add(roomNode); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.nodeStructureChanged(node); serviceTree.expandPath(rootPath); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)), selectedRow, 0); addBookmarkUI(false); } else { // Remove bookmark TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName, roomName}); JiveTreeNode node = (JiveTreeNode)path.getLastPathComponent(); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.removeNodeFromParent(node); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BLANK_IMAGE)), selectedRow, 0); addBookmarkUI(true); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/a25389bf8b4c087833cb6240e8f822e849be4a88/ConferenceRooms.java/buggy/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRooms.java
public ISourcePosition getPosition(LexerSource source, ISourcePosition startPosition) {
public ISourcePosition getPosition(ISourcePosition startPosition, boolean inclusive) {
public ISourcePosition getPosition(LexerSource source, ISourcePosition startPosition) { int startLine; int startOffset; int endLine = source.getLine(); String filename = source.getFilename(); if (startPosition == null) { startLine = lastPosition.getEndLine(); startOffset = lastPosition.getEndOffset(); } else { startLine = startPosition.getEndLine(); startOffset = startPosition.getEndOffset(); } return new SourcePosition(filename, startLine, endLine, startOffset, source.getOffset()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b1293eda8454686e846e2a9837b348e2983bb423/SourcePositionFactory.java/buggy/src/org/jruby/lexer/yacc/SourcePositionFactory.java
return new SourcePosition(filename, startLine, endLine, startOffset, source.getOffset());
lastPosition = new SourcePosition(filename, startLine, endLine, startOffset, source.getOffset()); return lastPosition;
public ISourcePosition getPosition(LexerSource source, ISourcePosition startPosition) { int startLine; int startOffset; int endLine = source.getLine(); String filename = source.getFilename(); if (startPosition == null) { startLine = lastPosition.getEndLine(); startOffset = lastPosition.getEndOffset(); } else { startLine = startPosition.getEndLine(); startOffset = startPosition.getEndOffset(); } return new SourcePosition(filename, startLine, endLine, startOffset, source.getOffset()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b1293eda8454686e846e2a9837b348e2983bb423/SourcePositionFactory.java/buggy/src/org/jruby/lexer/yacc/SourcePositionFactory.java
view.statusBar.setStatusIcon("graphx/server_trying16.png",
view.statusBar.setStatusIcon("resources/graphx/server_trying16.png",
public void tryLogin(MainPanel v) { this.view = v; // Display the initial login dialog displayLoginDialog(view); view.statusBar.setStatusIcon("graphx/server_trying16.png", "Trying to connect."); try { if (!isValidLogin()) { view.statusBar.setStatusIcon("graphx/error_msg16.png", "Incorrect username/password. Server login failed, please try to " + "log in again."); JOptionPane.showMessageDialog(view, "Incorrect username/password. Server login \nfailed, please " + "try to log in again."); view.loggedIn = false; return; } } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); log.info(sw); view.statusBar.setStatusIcon("graphx/error_msg16.png", "Server connection failure. Please try to login again."); JOptionPane .showMessageDialog( view, "The application failed to login with an exception " + "\n(which is displayed on the debug window). \nYour " + "server hostname/port may be wrong, or \nthe server " + "may be offline/inaccessable.\n\nPlease try to log " + "in again."); view.loggedIn = false; return; } userPrefs.put("savedUserName", username); userPrefs.put("savedHostName", server); userPrefs.put("savedPortNo", port); view.loggedIn = true; view.statusBar.setStatusIcon("graphx/server_connect16.png", "Server connected."); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c24ebf508ce40c35b2c509bdba29698588ce1204/LoginHandler.java/buggy/components/tools/admin/src/adminTool/omero/LoginHandler.java
view.statusBar.setStatusIcon("graphx/error_msg16.png",
view.statusBar.setStatusIcon("resources/graphx/error_msg16.png",
public void tryLogin(MainPanel v) { this.view = v; // Display the initial login dialog displayLoginDialog(view); view.statusBar.setStatusIcon("graphx/server_trying16.png", "Trying to connect."); try { if (!isValidLogin()) { view.statusBar.setStatusIcon("graphx/error_msg16.png", "Incorrect username/password. Server login failed, please try to " + "log in again."); JOptionPane.showMessageDialog(view, "Incorrect username/password. Server login \nfailed, please " + "try to log in again."); view.loggedIn = false; return; } } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); log.info(sw); view.statusBar.setStatusIcon("graphx/error_msg16.png", "Server connection failure. Please try to login again."); JOptionPane .showMessageDialog( view, "The application failed to login with an exception " + "\n(which is displayed on the debug window). \nYour " + "server hostname/port may be wrong, or \nthe server " + "may be offline/inaccessable.\n\nPlease try to log " + "in again."); view.loggedIn = false; return; } userPrefs.put("savedUserName", username); userPrefs.put("savedHostName", server); userPrefs.put("savedPortNo", port); view.loggedIn = true; view.statusBar.setStatusIcon("graphx/server_connect16.png", "Server connected."); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c24ebf508ce40c35b2c509bdba29698588ce1204/LoginHandler.java/buggy/components/tools/admin/src/adminTool/omero/LoginHandler.java
view.statusBar.setStatusIcon("graphx/error_msg16.png",
view.statusBar.setStatusIcon("resources/graphx/error_msg16.png",
public void tryLogin(MainPanel v) { this.view = v; // Display the initial login dialog displayLoginDialog(view); view.statusBar.setStatusIcon("graphx/server_trying16.png", "Trying to connect."); try { if (!isValidLogin()) { view.statusBar.setStatusIcon("graphx/error_msg16.png", "Incorrect username/password. Server login failed, please try to " + "log in again."); JOptionPane.showMessageDialog(view, "Incorrect username/password. Server login \nfailed, please " + "try to log in again."); view.loggedIn = false; return; } } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); log.info(sw); view.statusBar.setStatusIcon("graphx/error_msg16.png", "Server connection failure. Please try to login again."); JOptionPane .showMessageDialog( view, "The application failed to login with an exception " + "\n(which is displayed on the debug window). \nYour " + "server hostname/port may be wrong, or \nthe server " + "may be offline/inaccessable.\n\nPlease try to log " + "in again."); view.loggedIn = false; return; } userPrefs.put("savedUserName", username); userPrefs.put("savedHostName", server); userPrefs.put("savedPortNo", port); view.loggedIn = true; view.statusBar.setStatusIcon("graphx/server_connect16.png", "Server connected."); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c24ebf508ce40c35b2c509bdba29698588ce1204/LoginHandler.java/buggy/components/tools/admin/src/adminTool/omero/LoginHandler.java
view.statusBar.setStatusIcon("graphx/server_connect16.png",
view.statusBar.setStatusIcon("resources/graphx/server_connect16.png",
public void tryLogin(MainPanel v) { this.view = v; // Display the initial login dialog displayLoginDialog(view); view.statusBar.setStatusIcon("graphx/server_trying16.png", "Trying to connect."); try { if (!isValidLogin()) { view.statusBar.setStatusIcon("graphx/error_msg16.png", "Incorrect username/password. Server login failed, please try to " + "log in again."); JOptionPane.showMessageDialog(view, "Incorrect username/password. Server login \nfailed, please " + "try to log in again."); view.loggedIn = false; return; } } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); log.info(sw); view.statusBar.setStatusIcon("graphx/error_msg16.png", "Server connection failure. Please try to login again."); JOptionPane .showMessageDialog( view, "The application failed to login with an exception " + "\n(which is displayed on the debug window). \nYour " + "server hostname/port may be wrong, or \nthe server " + "may be offline/inaccessable.\n\nPlease try to log " + "in again."); view.loggedIn = false; return; } userPrefs.put("savedUserName", username); userPrefs.put("savedHostName", server); userPrefs.put("savedPortNo", port); view.loggedIn = true; view.statusBar.setStatusIcon("graphx/server_connect16.png", "Server connected."); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c24ebf508ce40c35b2c509bdba29698588ce1204/LoginHandler.java/buggy/components/tools/admin/src/adminTool/omero/LoginHandler.java
this.nextCheck = now + checkInterval;
this.nextCheck = Clock.TIME + checkInterval;
public TimedReloadContext(CacheReloadContext reloadContext,long checkInterval) { super(); this.reloadContext = reloadContext; this.checkInterval = checkInterval; this.nextCheck = now + checkInterval; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/65c210c2e5230f99b78b769799e9e54e3fcce30a/TimedReloadContext.java/clean/webmacro/src/org/webmacro/resource/TimedReloadContext.java
if (now >= nextCheck) { nextCheck = now + checkInterval;
if (Clock.TIME >= nextCheck) { nextCheck = Clock.TIME + checkInterval;
public boolean shouldReload() { //long time = System.currentTimeMillis(); if (now >= nextCheck) { nextCheck = now + checkInterval; return reloadContext.shouldReload(); } else { return false; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/65c210c2e5230f99b78b769799e9e54e3fcce30a/TimedReloadContext.java/clean/webmacro/src/org/webmacro/resource/TimedReloadContext.java
flater = new Inflater();
flater = new Inflater(true);
public ZlibInflate(IRubyObject caller) { super(); flater = new Inflater(); collected = new StringBuffer(); runtime = caller.getRuntime(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/510a41b06f3103200e881725915b7cc1a5a10b39/ZlibInflate.java/clean/src/org/jruby/util/ZlibInflate.java
flater.end();
public void finish() { }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/510a41b06f3103200e881725915b7cc1a5a10b39/ZlibInflate.java/clean/src/org/jruby/util/ZlibInflate.java
System.err.println("[BUG] Not supported yet.");
ruby.getInterpreter().load((RubyString)arg1, false);
public static RubyObject m_require(Ruby ruby, RubyObject recv, RubyString arg1) { if (arg1.getValue().endsWith(".rb")) { // Not supported yet // ruby.getInterpreter().load((RubyString)arg1, false); System.err.println("[BUG] Not supported yet."); } else if (arg1.getValue().endsWith(".jar")) { File jarFile = new File(arg1.getValue()); if (!jarFile.exists()) { jarFile = new File(new File(ruby.getSourceFile()).getParentFile(), arg1.getValue()); if (!jarFile.exists()) { System.err.println("[BUG] Jarfile not found."); } } if (jarFile.exists()) { try { ClassLoader javaClassLoader = new URLClassLoader(new URL[] { jarFile.toURL() }, ruby.getJavaClassLoader()); ruby.setJavaClassLoader(javaClassLoader); } catch (MalformedURLException murlExcptn) { } } } return ruby.getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a6fb3288b71aaedfe3a7b5e8d1e561e0bc249dc6/RBKernel.java/clean/org/jruby/core/RBKernel.java
System.err.println("[BUG] Jarfile not found.");
System.err.println("[Error] Jarfile + \"" + jarFile.getAbsolutePath() + "\"not found.");
public static RubyObject m_require(Ruby ruby, RubyObject recv, RubyString arg1) { if (arg1.getValue().endsWith(".rb")) { // Not supported yet // ruby.getInterpreter().load((RubyString)arg1, false); System.err.println("[BUG] Not supported yet."); } else if (arg1.getValue().endsWith(".jar")) { File jarFile = new File(arg1.getValue()); if (!jarFile.exists()) { jarFile = new File(new File(ruby.getSourceFile()).getParentFile(), arg1.getValue()); if (!jarFile.exists()) { System.err.println("[BUG] Jarfile not found."); } } if (jarFile.exists()) { try { ClassLoader javaClassLoader = new URLClassLoader(new URL[] { jarFile.toURL() }, ruby.getJavaClassLoader()); ruby.setJavaClassLoader(javaClassLoader); } catch (MalformedURLException murlExcptn) { } } } return ruby.getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a6fb3288b71aaedfe3a7b5e8d1e561e0bc249dc6/RBKernel.java/clean/org/jruby/core/RBKernel.java
if ( exec != currentExecution && pressSelected == false) {
if ( exec != currentExecution) {
private void displayHint(MouseEvent e) { xLoc = e.getX(); yLoc = e.getY(); ExecutionView exec = getViewAt(xLoc,yLoc); if ( exec != currentExecution && pressSelected == false) { currentExecution = exec; MouseOverChainExecutionEvent event; ChainExecutionData execution = null; if (exec != null) execution = exec.getChainExecution(); registry.getEventBus().post( new MouseOverChainExecutionEvent(execution)); // if we didn't mouse over an event } currentHash = null; if (currentExecution == null) { currentHash = gridModel.getHashAt(xLoc,yLoc); if (currentHash == null) currentRowDecoration = gridModel.getRowDecorationAt(xLoc,yLoc); } repaint(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e2c81874e6494723db0b78637410176d2fbe60df/ExecutionsCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/executions/ui/ExecutionsCanvas.java
if (exec != null) execution = exec.getChainExecution(); registry.getEventBus().post(
if (exec != null) { execution = exec.getChainExecution(); registry.getEventBus().post(
private void displayHint(MouseEvent e) { xLoc = e.getX(); yLoc = e.getY(); ExecutionView exec = getViewAt(xLoc,yLoc); if ( exec != currentExecution && pressSelected == false) { currentExecution = exec; MouseOverChainExecutionEvent event; ChainExecutionData execution = null; if (exec != null) execution = exec.getChainExecution(); registry.getEventBus().post( new MouseOverChainExecutionEvent(execution)); // if we didn't mouse over an event } currentHash = null; if (currentExecution == null) { currentHash = gridModel.getHashAt(xLoc,yLoc); if (currentHash == null) currentRowDecoration = gridModel.getRowDecorationAt(xLoc,yLoc); } repaint(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e2c81874e6494723db0b78637410176d2fbe60df/ExecutionsCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/executions/ui/ExecutionsCanvas.java
}
private void displayHint(MouseEvent e) { xLoc = e.getX(); yLoc = e.getY(); ExecutionView exec = getViewAt(xLoc,yLoc); if ( exec != currentExecution && pressSelected == false) { currentExecution = exec; MouseOverChainExecutionEvent event; ChainExecutionData execution = null; if (exec != null) execution = exec.getChainExecution(); registry.getEventBus().post( new MouseOverChainExecutionEvent(execution)); // if we didn't mouse over an event } currentHash = null; if (currentExecution == null) { currentHash = gridModel.getHashAt(xLoc,yLoc); if (currentHash == null) currentRowDecoration = gridModel.getRowDecorationAt(xLoc,yLoc); } repaint(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e2c81874e6494723db0b78637410176d2fbe60df/ExecutionsCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/executions/ui/ExecutionsCanvas.java
System.err.println("viewing results for execution "+execData.getID());
public void handlePopup(MouseEvent e) { postPopup = true; xLoc = e.getX(); yLoc = e.getY(); ExecutionView exec = getViewAt(xLoc,yLoc); if (exec == null) return; ChainExecutionData execData = exec.getChainExecution(); System.err.println("viewing results for execution "+execData.getID()); String name = execData.getChain().getName(); // this is a hack to let me pull up spots viewer. once history view //is done, remove this. if (name.compareTo("Find and track spots") ==0) { System.err.println("viewing trajectories..."); ViewTrackSpotsEvent event = new ViewTrackSpotsEvent(execData); registry.getEventBus().post(event); } else { SelectChainExecutionEvent event = new SelectChainExecutionEvent(execData); registry.getEventBus().post(event); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e2c81874e6494723db0b78637410176d2fbe60df/ExecutionsCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/executions/ui/ExecutionsCanvas.java
System.err.println("viewing trajectories...");
public void handlePopup(MouseEvent e) { postPopup = true; xLoc = e.getX(); yLoc = e.getY(); ExecutionView exec = getViewAt(xLoc,yLoc); if (exec == null) return; ChainExecutionData execData = exec.getChainExecution(); System.err.println("viewing results for execution "+execData.getID()); String name = execData.getChain().getName(); // this is a hack to let me pull up spots viewer. once history view //is done, remove this. if (name.compareTo("Find and track spots") ==0) { System.err.println("viewing trajectories..."); ViewTrackSpotsEvent event = new ViewTrackSpotsEvent(execData); registry.getEventBus().post(event); } else { SelectChainExecutionEvent event = new SelectChainExecutionEvent(execData); registry.getEventBus().post(event); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e2c81874e6494723db0b78637410176d2fbe60df/ExecutionsCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/executions/ui/ExecutionsCanvas.java
if (currentExecution != null && pressSelected == false) {
if (currentExecution != null) {
public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D) g; if (gridModel == null) return; gridModel.drawAxes(g2); if (slider != null) { gridModel.drawSliderGuides(g2,slider.getLeftXCoord(), slider.getRightXCoord()); } drawExecutions(g2); if (currentExecution != null && pressSelected == false) { currentExecution.drawExecutionTip(g2,xLoc,yLoc); } if (currentHash != null) currentHash.drawHashTip(g2,xLoc,yLoc); if (currentRowDecoration != null) currentRowDecoration.drawFull(g2); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e2c81874e6494723db0b78637410176d2fbe60df/ExecutionsCanvas.java/clean/SRC/org/openmicroscopy/shoola/agents/executions/ui/ExecutionsCanvas.java
ICallable method = recv.getMetaClass().searchMethod("to_a"); if (method.getImplementationClass() == recv.getRuntime().getKernel()) { return recv.getRuntime().newArray(recv); }
public static IRubyObject new_array(IRubyObject recv, IRubyObject object) { ICallable method = recv.getMetaClass().searchMethod("to_a"); if (method.getImplementationClass() == recv.getRuntime().getKernel()) { return recv.getRuntime().newArray(recv); } return object.callMethod("to_a"); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/2fd86f5bd27cd13b225c606689c1845f5151e062/RubyKernel.java/clean/src/org/jruby/RubyKernel.java
if (ChainBuilderAgent.DEBUG) System.err.println("adding link end point "+x+","+y);
public void setEndCoords(float x,float y) { if (ChainBuilderAgent.DEBUG) System.err.println("adding link end point "+x+","+y); setPoint(pointCount,new Point2D.Float(x,y)); setLine(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c7682935b07a816c3d45c1f1add290cf7228f1d6/Link.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/piccolo/Link.java
if (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size());
public void setPoint(int index,Point2D pt) { if (ChainBuilderAgent.DEBUG) System.err.println("setting point # "+index+", # of points is "+points.size()); if (points.size() <= index) { points.add(index,pt); } else points.set(index,pt); updateBounds(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c7682935b07a816c3d45c1f1add290cf7228f1d6/Link.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/piccolo/Link.java
return new RubyBlock(var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev != null ? prev.cloneBlock() : null, ruby);
return new RubyBlock( var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev != null ? prev.cloneBlock() : null, ruby);
public RubyBlock cloneBlock() { return new RubyBlock(var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev != null ? prev.cloneBlock() : null, ruby); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ec719ef82be7ea6956b3d139a2ce2d236eed4568/RubyBlock.java/clean/org/jruby/runtime/RubyBlock.java
return new RubyBlock(var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev, ruby);
return new RubyBlock(var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev, ruby);
public RubyBlock getTmp() { return new RubyBlock(var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev, ruby); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ec719ef82be7ea6956b3d139a2ce2d236eed4568/RubyBlock.java/clean/org/jruby/runtime/RubyBlock.java
if (prev == null) { System.err.println("[BUG] Try to pop block from empty stack."); return; }
if (prev == null) { ruby.getRuntime().printBug("Try to pop block from empty stack."); return; }
public void pop() { if (prev == null) { System.err.println("[BUG] Try to pop block from empty stack."); return; } this.var = prev.var; this.body = prev.body; this.self = prev.self; this.frame = prev.frame; this.scope = prev.scope; this.klass = prev.klass; this.iter = prev.iter; this.vmode = prev.vmode; this.flags = prev.flags; this.dynamicVars = prev.dynamicVars; this.origThread = prev.origThread; this.prev = prev.prev; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ec719ef82be7ea6956b3d139a2ce2d236eed4568/RubyBlock.java/clean/org/jruby/runtime/RubyBlock.java
RubyBlock oldBlock = new RubyBlock(var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev, ruby);
RubyBlock oldBlock = new RubyBlock(var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev, ruby);
public void push(Node v, Node b, RubyObject newSelf) { RubyBlock oldBlock = new RubyBlock(var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev, ruby); var = v; body = b; self = newSelf; frame = ruby.getRubyFrame(); klass = ruby.getRubyClass(); frame.setFile(ruby.getSourceFile()); frame.setLine(ruby.getSourceLine()); scope = ruby.getRubyScope(); prev = oldBlock; iter = ruby.getIter().getIter(); vmode = ruby.getActMethodScope(); flags = BLOCK_D_SCOPE; dynamicVars = ruby.getDynamicVars(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ec719ef82be7ea6956b3d139a2ce2d236eed4568/RubyBlock.java/clean/org/jruby/runtime/RubyBlock.java
Accessor (String name) { _name = name; }
Accessor(String name) { _name = name; }
Accessor (String name) { _name = name; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
Object get (Object instance) throws PropertyException, NoSuchMethodException { throw new PropertyException("BUG in PropertyOperator.java!"); }
Object get(Object instance) throws PropertyException, NoSuchMethodException { throw new PropertyException("BUG in PropertyOperator.java!"); }
Object get (Object instance) throws PropertyException, NoSuchMethodException { throw new PropertyException("BUG in PropertyOperator.java!"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
final String getName () { return _name; }
final String getName() { return _name; }
final String getName () { return _name; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
boolean set (Object instance, Object value) throws PropertyException, NoSuchMethodException { throw new PropertyException("BUG in PropertyOperator.java!"); }
boolean set(Object instance, Object value) throws PropertyException, NoSuchMethodException { throw new PropertyException("BUG in PropertyOperator.java!"); }
boolean set (Object instance, Object value) throws PropertyException, NoSuchMethodException { throw new PropertyException("BUG in PropertyOperator.java!"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
public final String toString () { return "Accessor:" + _name; }
public final String toString() { return "Accessor:" + _name; }
public final String toString () { return "Accessor:" + _name; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
BinaryMethodAccessor (String name, Method m, Class[] params) throws PropertyException { super(name, m, params); }
BinaryMethodAccessor(String name, Method m, Class[] params) throws PropertyException { super(name, m, params); }
BinaryMethodAccessor (String name, Method m, Class[] params) throws PropertyException { super(name, m, params); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
final Object get (final Object instance, String prop) throws PropertyException, NoSuchMethodException { Object[] args = {prop}; return PropertyOperator.invoke(_getMethod, instance, args); }
final Object get(final Object instance, String prop) throws PropertyException, NoSuchMethodException { Object[] args = {prop}; return PropertyOperator.invoke(_getMethod, instance, args); }
final Object get (final Object instance, String prop) throws PropertyException, NoSuchMethodException { Object[] args = {prop}; return PropertyOperator.invoke(_getMethod, instance, args); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
final int numArgsGet () { return 1; }
final int numArgsGet() { return 1; }
final int numArgsGet () { return 1; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
final int numArgsSet () { return 2; }
final int numArgsSet() { return 2; }
final int numArgsSet () { return 2; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
final boolean set (final Object instance, String prop, Object value) throws PropertyException, NoSuchMethodException { Object[] args = {prop, value}; return setImpl(instance, args); }
final boolean set(final Object instance, String prop, Object value) throws PropertyException, NoSuchMethodException { Object[] args = {prop, value}; return setImpl(instance, args); }
final boolean set (final Object instance, String prop, Object value) throws PropertyException, NoSuchMethodException { Object[] args = {prop, value}; return setImpl(instance, args); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
DirectAccessor (final String name, final Method m, final Class[] params) { super(name); addMethod(m, params); }
DirectAccessor(final String name, final Method m, final Class[] params) { super(name); addMethod(m, params); }
DirectAccessor (final String name, final Method m, final Class[] params) { super(name); addMethod(m, params); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
final void addMethod (final Method m, Class[] params) { _methods.addElement(m); }
final void addMethod(final Method m, Class[] params) { _methods.addElement(m); }
final void addMethod (final Method m, Class[] params) { _methods.addElement(m); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
final Object get (Object instance, Object[] args) throws PropertyException, NoSuchMethodException { Class[] types = new Class[args.length]; for (int i = 0; i < args.length; i++) { try { types[i] = args[i].getClass(); } catch (NullPointerException e) { types[i] = null; } } for (int i = 0; i < _methods.size(); i++) { Method m = (Method) _methods.elementAt(i); Class[] sig = m.getParameterTypes(); if (IntrospectionUtils.matches(sig, types)) { return PropertyOperator.invoke(m, instance, args); } } StringBuffer arglist = new StringBuffer(); Method m = (Method) _methods.firstElement(); for (int i = 0; i < args.length; i++) { if (i > 0) { arglist.append(", "); } arglist.append((args[i] == null) ? "null" : args[i].getClass().getName()); } throw new PropertyException .NoSuchMethodWithArgumentsException(getName(), m.getDeclaringClass().getName(), arglist.toString()); }
final Object get(Object instance, Object[] args) throws PropertyException, NoSuchMethodException { Class[] types = new Class[args.length]; for (int i = 0; i < args.length; i++) { try { types[i] = args[i].getClass(); } catch (NullPointerException e) { types[i] = null; } } for (int i = 0; i < _methods.size(); i++) { Method m = (Method) _methods.elementAt(i); Class[] sig = m.getParameterTypes(); if (IntrospectionUtils.matches(sig, types)) { return PropertyOperator.invoke(m, instance, args); } } StringBuffer arglist = new StringBuffer(); Method m = (Method) _methods.firstElement(); for (int i = 0; i < args.length; i++) { if (i > 0) { arglist.append(", "); } arglist.append((args[i] == null) ? "null" : args[i].getClass().getName()); } throw new PropertyException .NoSuchMethodWithArgumentsException(getName(), m.getDeclaringClass().getName(), arglist.toString()); }
final Object get (Object instance, Object[] args) throws PropertyException, NoSuchMethodException { Class[] types = new Class[args.length]; for (int i = 0; i < args.length; i++) { try { types[i] = args[i].getClass(); } catch (NullPointerException e) { types[i] = null; } } for (int i = 0; i < _methods.size(); i++) { Method m = (Method) _methods.elementAt(i); Class[] sig = m.getParameterTypes(); if (IntrospectionUtils.matches(sig, types)) { return PropertyOperator.invoke(m, instance, args); } } // not found StringBuffer arglist = new StringBuffer(); Method m = (Method) _methods.firstElement(); for (int i = 0; i < args.length; i++) { if (i > 0) { arglist.append(", "); } arglist.append((args[i] == null) ? "null" : args[i].getClass().getName()); } throw new PropertyException .NoSuchMethodWithArgumentsException(getName(), m.getDeclaringClass().getName(), arglist.toString()); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
FieldAccessor (final Field f) { super(f.getName()); _field = f; }
FieldAccessor(final Field f) { super(f.getName()); _field = f; }
FieldAccessor (final Field f) { super(f.getName()); _field = f; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
final Object get (final Object instance) throws PropertyException { try { return _field.get(instance); } catch (Exception e) { throw new PropertyException("Unable to read field " + _field + " on object " + instance + " of " + instance.getClass(), e); } }
final Object get(final Object instance) throws PropertyException { try { return _field.get(instance); } catch (Exception e) { throw new PropertyException("Unable to read field " + _field + " on object " + instance + " of " + instance.getClass(), e); } }
final Object get (final Object instance) throws PropertyException { try { return _field.get(instance); } catch (Exception e) { throw new PropertyException("Unable to read field " + _field + " on object " + instance + " of " + instance.getClass(), e); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
final boolean set (final Object instance, final Object value) throws PropertyException { try { _field.set(instance, value); } catch (Exception e) { throw new PropertyException("Unable to write field " + _field + " on object " + instance + " of " + instance.getClass(), e); } return true; }
final boolean set(final Object instance, final Object value) throws PropertyException { try { _field.set(instance, value); } catch (Exception e) { throw new PropertyException("Unable to write field " + _field + " on object " + instance + " of " + instance.getClass(), e); } return true; }
final boolean set (final Object instance, final Object value) throws PropertyException { try { _field.set(instance, value); } catch (Exception e) { throw new PropertyException("Unable to write field " + _field + " on object " + instance + " of " + instance.getClass(), e); } return true; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
LengthAccessor () { super("length"); }
LengthAccessor() { super("length"); }
LengthAccessor () { super("length"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
final Object get (final Object instance) throws PropertyException { try { return new Integer(java.lang.reflect.Array.getLength(instance)); } catch (Exception e) { throw new PropertyException("Unable to fetch length of object " + instance + " of " + instance.getClass(), e); } }
final Object get(final Object instance) throws PropertyException { try { return new Integer(java.lang.reflect.Array.getLength(instance)); } catch (Exception e) { throw new PropertyException("Unable to fetch length of object " + instance + " of " + instance.getClass(), e); } }
final Object get (final Object instance) throws PropertyException { try { return new Integer(java.lang.reflect.Array.getLength(instance)); } catch (Exception e) { throw new PropertyException("Unable to fetch length of object " + instance + " of " + instance.getClass(), e); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
final boolean set (final Object instance, final Object value) throws PropertyException { throw new PropertyException("Cannot set length of array"); }
final boolean set(final Object instance, final Object value) throws PropertyException { throw new PropertyException("Cannot set length of array"); }
final boolean set (final Object instance, final Object value) throws PropertyException { throw new PropertyException("Cannot set length of array"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
MethodAccessor (final String name, final Method m, final Class[] params) throws PropertyException { super(name); addMethod(m, params); }
MethodAccessor(final String name, final Method m, final Class[] params) throws PropertyException { super(name); addMethod(m, params); }
MethodAccessor (final String name, final Method m, final Class[] params) throws PropertyException { super(name); addMethod(m, params); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
final void addMethod (final Method m, Class[] params) throws PropertyException { final int setArgsLength = numArgsSet(); final int getArgsLength = numArgsGet(); if (params.length == getArgsLength) { _getMethod = m; } else if (params.length == setArgsLength) { setCount++; if (_setMethods == null) { _setMethods = new Method[1]; _setParams = new Class[1]; _setPrimitiveType = new Class[1]; } else if (_setMethods.length <= setCount) { Method[] tmpMethods = new Method[(setCount + 1) * 2]; Class[] tmpParams = new Class[(setCount + 1) * 2]; Class[] tmpPrimitive = new Class[(setCount + 1) * 2]; System.arraycopy(_setMethods, 0, tmpMethods, 0, _setMethods.length); System.arraycopy(_setParams, 0, tmpParams, 0, _setParams.length); System.arraycopy(_setPrimitiveType, 0, tmpPrimitive, 0, _setParams.length); _setMethods = tmpMethods; _setParams = tmpParams; _setPrimitiveType = tmpPrimitive; } _setMethods[setCount - 1] = m; _setParams[setCount - 1] = params[setArgsLength - 1]; if (_setParams[setCount - 1].isPrimitive()) _setPrimitiveType[setCount - 1] = getWrapperClass(_setParams[setCount - 1]); } else { throw new PropertyException("PropertyOperator FAILED for method " + m + "--please report this bug!"); } }
final void addMethod(final Method m, Class[] params) throws PropertyException { final int setArgsLength = numArgsSet(); final int getArgsLength = numArgsGet(); if (params.length == getArgsLength) { _getMethod = m; } else if (params.length == setArgsLength) { setCount++; if (_setMethods == null) { _setMethods = new Method[1]; _setParams = new Class[1]; _setPrimitiveType = new Class[1]; } else if (_setMethods.length <= setCount) { Method[] tmpMethods = new Method[(setCount + 1) * 2]; Class[] tmpParams = new Class[(setCount + 1) * 2]; Class[] tmpPrimitive = new Class[(setCount + 1) * 2]; System.arraycopy(_setMethods, 0, tmpMethods, 0, _setMethods.length); System.arraycopy(_setParams, 0, tmpParams, 0, _setParams.length); System.arraycopy(_setPrimitiveType, 0, tmpPrimitive, 0, _setParams.length); _setMethods = tmpMethods; _setParams = tmpParams; _setPrimitiveType = tmpPrimitive; } _setMethods[setCount - 1] = m; _setParams[setCount - 1] = params[setArgsLength - 1]; if (_setParams[setCount - 1].isPrimitive()) _setPrimitiveType[setCount - 1] = getWrapperClass(_setParams[setCount - 1]); } else { throw new PropertyException("PropertyOperator FAILED for method " + m + "--please report this bug!"); } }
final void addMethod (final Method m, Class[] params) throws PropertyException { final int setArgsLength = numArgsSet(); final int getArgsLength = numArgsGet(); if (params.length == getArgsLength) { _getMethod = m; } else if (params.length == setArgsLength) { setCount++; if (_setMethods == null) { _setMethods = new Method[1]; _setParams = new Class[1]; _setPrimitiveType = new Class[1]; } else if (_setMethods.length <= setCount) { Method[] tmpMethods = new Method[(setCount + 1) * 2]; Class[] tmpParams = new Class[(setCount + 1) * 2]; Class[] tmpPrimitive = new Class[(setCount + 1) * 2]; System.arraycopy(_setMethods, 0, tmpMethods, 0, _setMethods.length); System.arraycopy(_setParams, 0, tmpParams, 0, _setParams.length); System.arraycopy(_setPrimitiveType, 0, tmpPrimitive, 0, _setParams.length); _setMethods = tmpMethods; _setParams = tmpParams; _setPrimitiveType = tmpPrimitive; } // record the method, and the type of the variable parameter _setMethods[setCount - 1] = m; _setParams[setCount - 1] = params[setArgsLength - 1]; if (_setParams[setCount - 1].isPrimitive()) _setPrimitiveType[setCount - 1] = getWrapperClass(_setParams[setCount - 1]); } else { throw new PropertyException("PropertyOperator FAILED for method " + m + "--please report this bug!"); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
private Class getWrapperClass (Class s) { if (s == Integer.TYPE) return Integer.class; else if (s == Boolean.TYPE) return Boolean.class; else if (s == Character.TYPE) return Character.class; else if (s == Long.TYPE) return Long.class; else if (s == Short.TYPE) return Short.class; else if (s == Double.TYPE) return Double.class; else if (s == Float.TYPE) return Float.class; else if (s == Void.TYPE) return Void.class; else if (s == Byte.TYPE) return Byte.class; else return null; }
private Class getWrapperClass(Class s) { if (s == Integer.TYPE) return Integer.class; else if (s == Boolean.TYPE) return Boolean.class; else if (s == Character.TYPE) return Character.class; else if (s == Long.TYPE) return Long.class; else if (s == Short.TYPE) return Short.class; else if (s == Double.TYPE) return Double.class; else if (s == Float.TYPE) return Float.class; else if (s == Void.TYPE) return Void.class; else if (s == Byte.TYPE) return Byte.class; else return null; }
private Class getWrapperClass (Class s) { if (s == Integer.TYPE) return Integer.class; else if (s == Boolean.TYPE) return Boolean.class; else if (s == Character.TYPE) return Character.class; else if (s == Long.TYPE) return Long.class; else if (s == Short.TYPE) return Short.class; else if (s == Double.TYPE) return Double.class; else if (s == Float.TYPE) return Float.class; else if (s == Void.TYPE) return Void.class; else if (s == Byte.TYPE) return Byte.class; else return null; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
abstract int numArgsGet ();
abstract int numArgsGet();
abstract int numArgsGet ();
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
abstract int numArgsSet ();
abstract int numArgsSet();
abstract int numArgsSet ();
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
final boolean setImpl (final Object inst, final Object[] args) throws PropertyException, NoSuchMethodException { for (int i = 0; i < setCount; i++) { Object arg = args[args.length - 1]; if (_setParams[i].isPrimitive())
final boolean setImpl(final Object inst, final Object[] args) throws PropertyException, NoSuchMethodException { for (int i = 0; i < setCount; i++) { Object arg = args[args.length - 1]; if (_setParams[i].isPrimitive()) { if (arg.getClass() == _setPrimitiveType[i])
final boolean setImpl (final Object inst, final Object[] args) throws PropertyException, NoSuchMethodException { //which method to use? check params for first match for (int i = 0; i < setCount; i++) { Object arg = args[args.length - 1]; // XXX: null values are blocked by the next line if (_setParams[i].isPrimitive()) { if (arg.getClass() == _setPrimitiveType[i]) { try { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } catch (Exception e) { // ignore exception } } } else if (arg == null || _setParams[i].isInstance(args[args.length - 1])) { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } } return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
if (arg.getClass() == _setPrimitiveType[i]) { try { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } catch (Exception e) { } }
try { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } catch (Exception e) { }
final boolean setImpl (final Object inst, final Object[] args) throws PropertyException, NoSuchMethodException { //which method to use? check params for first match for (int i = 0; i < setCount; i++) { Object arg = args[args.length - 1]; // XXX: null values are blocked by the next line if (_setParams[i].isPrimitive()) { if (arg.getClass() == _setPrimitiveType[i]) { try { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } catch (Exception e) { // ignore exception } } } else if (arg == null || _setParams[i].isInstance(args[args.length - 1])) { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } } return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
else if (arg == null || _setParams[i].isInstance(args[args.length - 1])) { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } } return false; }
} else if (arg == null || _setParams[i].isInstance(args[args.length - 1])) { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } } return false; }
final boolean setImpl (final Object inst, final Object[] args) throws PropertyException, NoSuchMethodException { //which method to use? check params for first match for (int i = 0; i < setCount; i++) { Object arg = args[args.length - 1]; // XXX: null values are blocked by the next line if (_setParams[i].isPrimitive()) { if (arg.getClass() == _setPrimitiveType[i]) { try { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } catch (Exception e) { // ignore exception } } } else if (arg == null || _setParams[i].isInstance(args[args.length - 1])) { PropertyOperator.invoke(_setMethods[i], inst, args); return true; } } return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; _cache = cache; Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers()))
public PropertyOperator(final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; _cache = cache; Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set")))
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc);
acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
} if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; acc = (Accessor) _directAccessors.get(name); if (acc != null)
else if ((plength > 0) && (params[0].isInstance("string") && (((plength == 2) && name.equals("put")) || ((plength == 1) && name.equals("get")))))
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
((DirectAccessor) acc).addMethod(meth, params);
if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
else
else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set"))))
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc);
acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put"))
} else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0)
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } }
propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE)
} else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0)
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
if (plength == 0) { propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } }
Class returnType = meth.getReturnType(); Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
} } }
public PropertyOperator (final Class target, PropertyOperatorCache cache) throws SecurityException, PropertyException { Accessor acc; // Save the cache _cache = cache; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(), acc); } } if (target.isArray()) _unaryAccessors.put("length", _lengthAccessor); // introspect methods second Vector methods = getMethods(target); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.size(); i++) { meth = ((Method) methods.elementAt(i)); if (!isMethodAllowed(meth)) continue; name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth, params); } else { acc = new DirectAccessor(name, meth, params); _directAccessors.put(name, acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if (((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set"))) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } else if ((plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (_hashAccessor != null) { _hashAccessor.addMethod(meth, params); } else { _hashAccessor = new BinaryMethodAccessor(propName, meth, params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { ((MethodAccessor) acc).addMethod(meth, params); } else { acc = new BinaryMethodAccessor(propName, meth, params); _binaryAccessors.put(propName, acc); } } } else if (name.startsWith("is") && meth.getReturnType() == java.lang.Boolean.TYPE) { if (plength == 0) { // unary accessor method propName = name.substring(2); acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { ((MethodAccessor) acc).addMethod(meth, params); } } else { acc = new UnaryMethodAccessor(propName, meth, params); _unaryAccessors.put(propName, acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { iteratorMethod = meth; } } } } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
private void addMethod (HashMap hm, Method m) { if (!isMethodAllowed(m)) return; String name = m.getName(); Object o = hm.get(name); if (o == null) { hm.put(name, m);
private void addMethod(HashMap hm, Method m) { if (!isMethodAllowed(m)) return; String name = m.getName(); Object o = hm.get(name); if (o == null) { hm.put(name, m); return; } Vector v; if (o instanceof Method) { v = new Vector(); v.addElement(o); hm.put(name, v); } else { v = (Vector) o; } Class ptypes[] = m.getParameterTypes(); for (int i = 0; i < v.size(); i++) { Class curTypes[] = ((Method) v.elementAt(i)).getParameterTypes(); int order = precedes(ptypes, curTypes); if (order < 0) { v.insertElementAt(m, i);
private void addMethod (HashMap hm, Method m) { if (!isMethodAllowed(m)) return; String name = m.getName(); Object o = hm.get(name); if (o == null) { hm.put(name, m); return; } Vector v; if (o instanceof Method) { v = new Vector(); v.addElement(o); hm.put(name, v); } else { v = (Vector) o; } Class ptypes[] = m.getParameterTypes(); for (int i = 0; i < v.size(); i++) { Class curTypes[] = ((Method) v.elementAt(i)).getParameterTypes(); int order = precedes(ptypes, curTypes); if (order < 0) { v.insertElementAt(m, i); return; } else if (order == 0) { // ignore duplicate method return; } } v.addElement(m); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
} Vector v; if (o instanceof Method) { v = new Vector(); v.addElement(o); hm.put(name, v); } else { v = (Vector) o; } Class ptypes[] = m.getParameterTypes(); for (int i = 0; i < v.size(); i++) { Class curTypes[] = ((Method) v.elementAt(i)).getParameterTypes(); int order = precedes(ptypes, curTypes); if (order < 0) { v.insertElementAt(m, i); return; } else if (order == 0) { return; } } v.addElement(m); }
} else if (order == 0) { return; } } v.addElement(m); }
private void addMethod (HashMap hm, Method m) { if (!isMethodAllowed(m)) return; String name = m.getName(); Object o = hm.get(name); if (o == null) { hm.put(name, m); return; } Vector v; if (o instanceof Method) { v = new Vector(); v.addElement(o); hm.put(name, v); } else { v = (Vector) o; } Class ptypes[] = m.getParameterTypes(); for (int i = 0; i < v.size(); i++) { Class curTypes[] = ((Method) v.elementAt(i)).getParameterTypes(); int order = precedes(ptypes, curTypes); if (order < 0) { v.insertElementAt(m, i); return; } else if (order == 0) { // ignore duplicate method return; } } v.addElement(m); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
private static final String fillInName (Object[] names, int end) { StringBuffer sb = new StringBuffer(); for (int x = 0; x < end; x++) { if (x > 0) sb.append("."); sb.append(names[x]); } return sb.toString(); }
private static final String fillInName(Object[] names, int end) { StringBuffer sb = new StringBuffer(); for (int x = 0; x < end; x++) { if (x > 0) sb.append("."); sb.append(names[x]); } return sb.toString(); }
private static final String fillInName (Object[] names, int end) { StringBuffer sb = new StringBuffer(); for (int x = 0; x < end; x++) { if (x > 0) sb.append("."); sb.append(names[x]); } return sb.toString(); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
public Iterator findIterator (Object instance) throws PropertyException { if (iteratorMethod != null) { Object ret = invoke(iteratorMethod, instance, null); if (ret instanceof Iterator) { return (Iterator) ret; } else if (ret instanceof Enumeration) { return new EnumIterator((Enumeration) ret); } else if (ret instanceof Object[]) { return new ArrayIterator((Object[]) ret); } } throw new PropertyException((instance == null ? "null" : instance.getClass().getName()) + " is not a list"); }
public Iterator findIterator(Object instance) throws PropertyException { if (iteratorMethod != null) { Object ret = invoke(iteratorMethod, instance, null); if (ret instanceof Iterator) { return (Iterator) ret; } else if (ret instanceof Enumeration) { return new EnumIterator((Enumeration) ret); } else if (ret instanceof Object[]) { return new ArrayIterator((Object[]) ret); } } throw new PropertyException((instance == null ? "null" : instance.getClass().getName()) + " is not a list"); }
public Iterator findIterator (Object instance) throws PropertyException { if (iteratorMethod != null) { Object ret = invoke(iteratorMethod, instance, null); if (ret instanceof Iterator) { return (Iterator) ret; } else if (ret instanceof Enumeration) { return new EnumIterator((Enumeration) ret); } else if (ret instanceof Object[]) { return new ArrayIterator((Object[]) ret); } } throw new PropertyException((instance == null ? "null" : instance.getClass().getName()) + " is not a list"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
private void getAllMethods (HashMap meths, Class c) throws SecurityException { if (Modifier.isPublic(c.getModifiers())) { Method m[] = c.getDeclaredMethods(); for (int i = 0; i < m.length; i++)
private void getAllMethods(HashMap meths, Class c) throws SecurityException { if (Modifier.isPublic(c.getModifiers())) { Method m[] = c.getDeclaredMethods(); for (int i = 0; i < m.length; i++) { if (Modifier.isPublic(m[i].getModifiers()))
private void getAllMethods (HashMap meths, Class c) throws SecurityException { if (Modifier.isPublic(c.getModifiers())) { Method m[] = c.getDeclaredMethods(); for (int i = 0; i < m.length; i++) { if (Modifier.isPublic(m[i].getModifiers())) { addMethod(meths, m[i]); } } } Class iface[] = c.getInterfaces(); for (int i = 0; i < iface.length; i++) { getAllMethods(meths, iface[i]); } Class sup = c.getSuperclass(); if (sup != null) { getAllMethods(meths, sup); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
if (Modifier.isPublic(m[i].getModifiers())) { addMethod(meths, m[i]); }
addMethod(meths, m[i]);
private void getAllMethods (HashMap meths, Class c) throws SecurityException { if (Modifier.isPublic(c.getModifiers())) { Method m[] = c.getDeclaredMethods(); for (int i = 0; i < m.length; i++) { if (Modifier.isPublic(m[i].getModifiers())) { addMethod(meths, m[i]); } } } Class iface[] = c.getInterfaces(); for (int i = 0; i < iface.length; i++) { getAllMethods(meths, iface[i]); } Class sup = c.getSuperclass(); if (sup != null) { getAllMethods(meths, sup); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
} Class iface[] = c.getInterfaces(); for (int i = 0; i < iface.length; i++) { getAllMethods(meths, iface[i]); } Class sup = c.getSuperclass(); if (sup != null) { getAllMethods(meths, sup); } }
} } Class iface[] = c.getInterfaces(); for (int i = 0; i < iface.length; i++) { getAllMethods(meths, iface[i]); } Class sup = c.getSuperclass(); if (sup != null) { getAllMethods(meths, sup); } }
private void getAllMethods (HashMap meths, Class c) throws SecurityException { if (Modifier.isPublic(c.getModifiers())) { Method m[] = c.getDeclaredMethods(); for (int i = 0; i < m.length; i++) { if (Modifier.isPublic(m[i].getModifiers())) { addMethod(meths, m[i]); } } } Class iface[] = c.getInterfaces(); for (int i = 0; i < iface.length; i++) { getAllMethods(meths, iface[i]); } Class sup = c.getSuperclass(); if (sup != null) { getAllMethods(meths, sup); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
private Vector getMethods (Class c) { Vector v = new Vector(); HashMap h = new HashMap(); getAllMethods(h, c); Iterator iter = h.values().iterator(); while (iter.hasNext()) { Object elem = iter.next(); if (elem instanceof Method)
private Vector getMethods(Class c) { Vector v = new Vector(); HashMap h = new HashMap(); getAllMethods(h, c); Iterator iter = h.values().iterator(); while (iter.hasNext()) { Object elem = iter.next(); if (elem instanceof Method) { v.addElement(elem); } else { Vector v1 = (Vector) elem; for (int i = 0; i < v1.size(); i++)
private Vector getMethods (Class c) { Vector v = new Vector(); HashMap h = new HashMap(); getAllMethods(h, c); Iterator iter = h.values().iterator(); while (iter.hasNext()) { Object elem = iter.next(); if (elem instanceof Method) { v.addElement(elem); } else { Vector v1 = (Vector) elem; for (int i = 0; i < v1.size(); i++) { v.addElement(v1.elementAt(i)); } } } return v; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
v.addElement(elem);
v.addElement(v1.elementAt(i));
private Vector getMethods (Class c) { Vector v = new Vector(); HashMap h = new HashMap(); getAllMethods(h, c); Iterator iter = h.values().iterator(); while (iter.hasNext()) { Object elem = iter.next(); if (elem instanceof Method) { v.addElement(elem); } else { Vector v1 = (Vector) elem; for (int i = 0; i < v1.size(); i++) { v.addElement(v1.elementAt(i)); } } } return v; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
else { Vector v1 = (Vector) elem; for (int i = 0; i < v1.size(); i++) { v.addElement(v1.elementAt(i)); } } } return v; }
} } return v; }
private Vector getMethods (Class c) { Vector v = new Vector(); HashMap h = new HashMap(); getAllMethods(h, c); Iterator iter = h.values().iterator(); while (iter.hasNext()) { Object elem = iter.next(); if (elem instanceof Method) { v.addElement(elem); } else { Vector v1 = (Vector) elem; for (int i = 0; i < v1.size(); i++) { v.addElement(v1.elementAt(i)); } } } return v; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); }
public Object getProperty(final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) {
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
nextPropValue = acc.get(instance, args); start++;
nextPropValue = acc.get(instance); start++;
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName());
acc = null;
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
} else { propName = names[start].toString(); } if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName); if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { acc = null; } } else { acc = null; } } if (acc == null) { acc = _hashAccessor;
} } if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName); if ((acc != null) && ((start + 1) <= names.length)) {
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
if (acc != null) { nextPropValue = acc.get(instance, propName); start++; }
nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2;
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
acc = null;
acc = null;
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
} if (acc == null) { if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try
catch (ClassCastException e)
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java
return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end);
acc = null;
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String propName; Object nextPropValue = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; propName = pm.getName(); acc = (Accessor) _directAccessors.get(propName); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(propName);// if ((acc != null) && ((start + 1) <= end)) if ((acc != null) && ((start + 1) <= names.length)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + propName) || isMethodRestricted(instance.getClass(), "set" + propName)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextPropValue) .getProperty(context, nextPropValue, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/67ca4e7044b0f2675e520acfb786c52497facbe2/PropertyOperatorCache.java/buggy/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java