rem stringlengths 1 53.3k | add stringlengths 0 80.5k | context stringlengths 6 326k | meta stringlengths 141 403 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
return false; | return true; | public boolean startInWriteAction() { return false; } | 56598 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56598/afd5f7448422b5b1094b6d3b0febed868497f331/CreateConstructorParameterFromFieldFix.java/buggy/codeInsight/impl/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorParameterFromFieldFix.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
1250,
787,
382,
3067,
1803,
1435,
288,
565,
327,
638,
31,
225,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
1250,
787,
382,
3067,
1803,
1435,
288,
565,
327,
638,
31,
225,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
NoItemsMatchException, CannotDisseminateFormatException | NoItemsMatchException, CannotDisseminateFormatException, BadArgumentException | public Map listIdentifiers(String from, String until, String set, String metadataPrefix) throws OAIInternalServerError, NoSetHierarchyException, NoItemsMatchException, CannotDisseminateFormatException { log.info(LogManager.getHeader(null, "oai_request", "verb=listIdentifiers,from=" + (from == null ? "null" : from) + ",until=" + (until == null ? "null" : until) + ",set=" + (set == null ? "null" : set) + ",metadataPrefix=" + (metadataPrefix == null ? "null" : metadataPrefix))); // We can produce oai_dc and simple DC for all items, so just return IDs Context context = null; // Lists to put results in List headers = new LinkedList(); List identifiers = new LinkedList(); try { context = new Context(); // Get the relevant OAIItemInfo objects to make headers DSpaceObject scope = resolveSet(context, set); List itemInfos = Harvest.harvest(context, scope, from, until, 0, 0, // Everything for now false, true, true); // No Item objects, but we need to know containers and withdrawn items if (itemInfos.size() == 0) { log.info(LogManager.getHeader(null, "oai_error", "no_items_match")); throw new NoItemsMatchException(); } // Build up lists of headers and identifiers Iterator i = itemInfos.iterator(); while (i.hasNext()) { HarvestedItemInfo itemInfo = (HarvestedItemInfo) i.next(); String[] header = getRecordFactory().createHeader(itemInfo); headers.add(header[0]); identifiers.add(header[1]); } } catch (SQLException se) { // Log the error log.warn(LogManager.getHeader(context, "database_error", ""), se); throw new OAIInternalServerError(se.toString()); } finally { if (context != null) { context.abort(); } } // Put results in form needed to return Map results = new HashMap(); results.put("headers", headers.iterator()); results.put("identifiers", identifiers.iterator()); return results; } | 47214 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47214/564aa767ae3958fb227322d346195962712ce24e/DSpaceOAICatalog.java/buggy/dspace/src/org/dspace/app/oai/DSpaceOAICatalog.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1635,
666,
12745,
12,
780,
628,
16,
514,
3180,
16,
514,
444,
16,
514,
1982,
2244,
13,
3639,
1216,
531,
18194,
12371,
16,
2631,
694,
12074,
503,
16,
5411,
2631,
3126,
2060,
503,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1635,
666,
12745,
12,
780,
628,
16,
514,
3180,
16,
514,
444,
16,
514,
1982,
2244,
13,
3639,
1216,
531,
18194,
12371,
16,
2631,
694,
12074,
503,
16,
5411,
2631,
3126,
2060,
503,
16... |
siteGroups.add(0, createSelect("", "<none>")); | public List getGroups() { List siteGroups = getSiteGroups(); siteGroups.add(0, createSelect("", "<none>")); return siteGroups; } | 48996 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/48996/490247fad03bfc8ec44c9213efbe2a86e60bac09/AudienceTool.java/buggy/common/tool-lib/src/java/org/theospi/portfolio/security/tool/AudienceTool.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
565,
1071,
987,
22708,
1435,
288,
1377,
987,
2834,
3621,
273,
11021,
3621,
5621,
6647,
327,
2834,
3621,
31,
282,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
565,
1071,
987,
22708,
1435,
288,
1377,
987,
2834,
3621,
273,
11021,
3621,
5621,
6647,
327,
2834,
3621,
31,
282,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
EventListenerList list = (EventListenerList) listenerMap.get(element); return list == null ? NULL_ARRAY : list.getListeners(key); } | EventListenerList list = (EventListenerList) _listenerMap.get(element); return list == null ? NULL_ARRAY : list.getListeners(key); } | public MElementListener[] getListeners(Class element, EventKey key) { EventListenerList list = (EventListenerList) listenerMap.get(element); return list == null ? NULL_ARRAY : list.getListeners(key); } | 7166 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7166/1ebb17ac06205415cc8d51f57abdfb1e5ec54d76/UmlModelEventPump.java/clean/src_new/org/argouml/model/uml/UmlModelEventPump.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
490,
1046,
2223,
8526,
336,
5583,
12,
797,
930,
16,
2587,
653,
498,
13,
288,
202,
202,
7375,
682,
666,
273,
261,
7375,
682,
13,
2991,
863,
18,
588,
12,
2956,
1769,
202,
202,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
490,
1046,
2223,
8526,
336,
5583,
12,
797,
930,
16,
2587,
653,
498,
13,
288,
202,
202,
7375,
682,
666,
273,
261,
7375,
682,
13,
2991,
863,
18,
588,
12,
2956,
1769,
202,
202,... |
return myFile.isModified(); | return FileDocumentManager.getInstance().isFileModified(myFile); | private boolean isModifiedImpl(){ return myFile.isModified(); } | 17306 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/17306/b6f949bd73cd0bf50707caab02f05f8c3532dd8b/TextEditorComponent.java/buggy/source/com/intellij/openapi/fileEditor/impl/text/TextEditorComponent.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
1250,
22502,
2828,
1435,
95,
565,
327,
1387,
2519,
1318,
18,
588,
1442,
7675,
291,
812,
4575,
12,
4811,
812,
1769,
225,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
1250,
22502,
2828,
1435,
95,
565,
327,
1387,
2519,
1318,
18,
588,
1442,
7675,
291,
812,
4575,
12,
4811,
812,
1769,
225,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
FileDialog dialog = new FileDialog( shell ); dialog.setText( "Select Corefile" ); String initPath = null; try { initPath = project.getPersistentProperty(new QualifiedName(LaunchUIPlugin.getUniqueIdentifier(), "SavePath")); | ElementListSelectionDialog dialog = new ElementListSelectionDialog( shell, new LabelProvider() { public String getText(Object element) { IProcessInfo info = (IProcessInfo)element; return info.getPid() + " " + info.getName(); } } ); dialog.setTitle( "Select Process" ); dialog.setMessage("Select a Process to attach debugger to:"); IProcessList plist = CCorePlugin.getDefault().getProcessList(); if ( plist == null ) { MessageDialog.openError(shell, "CDT Launch Error", "Current platform does not support listing processes"); return; | public void run() { FileDialog dialog = new FileDialog( shell ); dialog.setText( "Select Corefile" ); String initPath = null; try { initPath = project.getPersistentProperty(new QualifiedName(LaunchUIPlugin.getUniqueIdentifier(), "SavePath")); } catch (CoreException e) { } if ( initPath == null || initPath.equals("") ) { initPath = project.getLocation().toString(); } dialog.setFilterPath( initPath ); res[0] = dialog.open(); } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/947c51293218290d96985fc1dc6aec760ecb46e6/LocalCLaunchConfigurationDelegate.java/clean/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1875,
202,
482,
918,
1086,
1435,
288,
9506,
202,
812,
6353,
6176,
273,
394,
1387,
6353,
12,
5972,
11272,
9506,
202,
12730,
18,
542,
1528,
12,
315,
3391,
4586,
768,
6,
11272,
25083,
202,
780,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1875,
202,
482,
918,
1086,
1435,
288,
9506,
202,
812,
6353,
6176,
273,
394,
1387,
6353,
12,
5972,
11272,
9506,
202,
12730,
18,
542,
1528,
12,
315,
3391,
4586,
768,
6,
11272,
25083,
202,
780,
... |
colModel.setLeadSelectionIndex(colLead); } | colModel.setLeadSelectionIndex(colLead); } | public void actionPerformed (ActionEvent e) { ListSelectionModel rowModel = table.getSelectionModel(); ListSelectionModel colModel = table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; if (e.getActionCommand().equals("selectPreviousRowExtendSelection")) { rowModel.setLeadSelectionIndex(Math.max(rowLead - 1, 0)); colModel.setLeadSelectionIndex(colLead); } else if (e.getActionCommand().equals("selectLastColumn")) { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(colMax, colMax); } else if (e.getActionCommand().equals("startEditing")) { if (table.isCellEditable(rowLead, colLead)) table.editCellAt(rowLead,colLead); } else if (e.getActionCommand().equals("selectFirstRowExtendSelection")) { rowModel.setLeadSelectionIndex(0); colModel.setLeadSelectionIndex(colLead); } else if (e.getActionCommand().equals("selectFirstColumn")) { rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } else if (e.getActionCommand().equals("selectFirstColumnExtendSelection")) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else if (e.getActionCommand().equals("selectLastRow")) { rowModel.setSelectionInterval(rowMax,rowMax); colModel.setSelectionInterval(colLead, colLead); } else if (e.getActionCommand().equals("selectNextRowExtendSelection")) { rowModel.setLeadSelectionIndex(Math.min(rowLead + 1, rowMax)); colModel.setLeadSelectionIndex(colLead); } else if (e.getActionCommand().equals("selectFirstRow")) { rowModel.setSelectionInterval(0,0); colModel.setSelectionInterval(colLead, colLead); } else if (e.getActionCommand().equals("selectNextColumnExtendSelection")) { colModel.setLeadSelectionIndex(Math.min(colLead + 1, colMax)); rowModel.setLeadSelectionIndex(rowLead); } else if (e.getActionCommand().equals("selectLastColumnExtendSelection")) { colModel.setLeadSelectionIndex(colMax); rowModel.setLeadSelectionIndex(rowLead); } else if (e.getActionCommand().equals("selectPreviousColumnExtendSelection")) { colModel.setLeadSelectionIndex(Math.max(colLead - 1, 0)); rowModel.setLeadSelectionIndex(rowLead); } else if (e.getActionCommand().equals("selectNextRow")) { rowModel.setSelectionInterval(Math.min(rowLead + 1, rowMax), Math.min(rowLead + 1, rowMax)); colModel.setSelectionInterval(colLead,colLead); } else if (e.getActionCommand().equals("scrollUpExtendSelection")) { int target; if (rowLead == getFirstVisibleRowIndex()) target = Math.max (0, rowLead - (getLastVisibleRowIndex() - getFirstVisibleRowIndex() + 1)); else target = getFirstVisibleRowIndex(); rowModel.setLeadSelectionIndex(target); colModel.setLeadSelectionIndex(colLead); } else if (e.getActionCommand().equals("selectPreviousRow")) { rowModel.setSelectionInterval(Math.max(rowLead - 1, 0), Math.max(rowLead - 1, 0)); colModel.setSelectionInterval(colLead,colLead); } else if (e.getActionCommand().equals("scrollRightChangeSelection")) { int target; if (colLead == getLastVisibleColumnIndex()) target = Math.min (colMax, colLead + (getLastVisibleColumnIndex() - getFirstVisibleColumnIndex() + 1)); else target = getLastVisibleColumnIndex(); colModel.setSelectionInterval(target, target); rowModel.setSelectionInterval(rowLead, rowLead); } else if (e.getActionCommand().equals("selectPreviousColumn")) { rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); } else if (e.getActionCommand().equals("scrollLeftChangeSelection")) { int target; if (colLead == getFirstVisibleColumnIndex()) target = Math.max (0, colLead - (getLastVisibleColumnIndex() - getFirstVisibleColumnIndex() + 1)); else target = getFirstVisibleColumnIndex(); colModel.setSelectionInterval(target, target); rowModel.setSelectionInterval(rowLead, rowLead); } else if (e.getActionCommand().equals("clearSelection")) { table.clearSelection(); } else if (e.getActionCommand().equals("cancel")) { // FIXME: implement other parts of "cancel" like undo-ing last // selection. Right now it just calls editingCancelled if // we're currently editing. if (table.isEditing()) table.editingCanceled(new ChangeEvent("cancel")); } else if (e.getActionCommand().equals("selectNextRowCell") || e.getActionCommand().equals("selectPreviousRowCell") || e.getActionCommand().equals("selectNextColumnCell") || e.getActionCommand().equals("selectPreviousColumnCell")) { // If nothing is selected, select the first cell in the table if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } // multRowsSelected and multColsSelected tell us if multiple rows or // columns are selected, respectively boolean multRowsSelected, multColsSelected; multRowsSelected = table.getSelectedRowCount() > 1 && table.getRowSelectionAllowed(); multColsSelected = table.getSelectedColumnCount() > 1 && table.getColumnSelectionAllowed(); // If there is just one selection, select the next cell, and wrap // when you get to the edges of the table. if (!multColsSelected && !multRowsSelected) { if (e.getActionCommand().indexOf("Column") != -1) advanceSingleSelection(colModel, colMax, rowModel, rowMax, (e.getActionCommand().equals ("selectPreviousColumnCell"))); else advanceSingleSelection(rowModel, rowMax, colModel, colMax, (e.getActionCommand().equals ("selectPreviousRowCell"))); return; } // rowMinSelected and rowMaxSelected are the minimum and maximum // values respectively of selected cells in the row selection model // Similarly for colMinSelected and colMaxSelected. int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; int rowMinSelected = table.getRowSelectionAllowed() ? rowModel.getMinSelectionIndex() : 0; int colMaxSelected = table.getColumnSelectionAllowed() ? colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; // If there are multiple rows and columns selected, select the next // cell and wrap at the edges of the selection. if (e.getActionCommand().indexOf("Column") != -1) advanceMultipleSelection(colModel, colMinSelected, colMaxSelected, rowModel, rowMinSelected, rowMaxSelected, (e.getActionCommand().equals ("selectPreviousColumnCell")), true); else advanceMultipleSelection(rowModel, rowMinSelected, rowMaxSelected, colModel, colMinSelected, colMaxSelected, (e.getActionCommand().equals ("selectPreviousRowCell")), false); } else if (e.getActionCommand().equals("selectNextColumn")) { rowModel.setSelectionInterval(rowLead,rowLead); colModel.setSelectionInterval(Math.min(colLead + 1, colMax), Math.min(colLead + 1, colMax)); } else if (e.getActionCommand().equals("scrollLeftExtendSelection")) { int target; if (colLead == getFirstVisibleColumnIndex()) target = Math.max (0, colLead - (getLastVisibleColumnIndex() - getFirstVisibleColumnIndex() + 1)); else target = getFirstVisibleColumnIndex(); colModel.setLeadSelectionIndex(target); rowModel.setLeadSelectionIndex(rowLead); } else if (e.getActionCommand().equals("scrollDownChangeSelection")) { int target; if (rowLead == getLastVisibleRowIndex()) target = Math.min (rowMax, rowLead + (getLastVisibleRowIndex() - getFirstVisibleRowIndex() + 1)); else target = getLastVisibleRowIndex(); rowModel.setSelectionInterval(target, target); colModel.setSelectionInterval(colLead, colLead); } else if (e.getActionCommand().equals("scrollRightExtendSelection")) { int target; if (colLead == getLastVisibleColumnIndex()) target = Math.min (colMax, colLead + (getLastVisibleColumnIndex() - getFirstVisibleColumnIndex() + 1)); else target = getLastVisibleColumnIndex(); colModel.setLeadSelectionIndex(target); rowModel.setLeadSelectionIndex(rowLead); } else if (e.getActionCommand().equals("selectAll")) { table.selectAll(); } else if (e.getActionCommand().equals("selectLastRowExtendSelection")) { rowModel.setLeadSelectionIndex(rowMax); colModel.setLeadSelectionIndex(colLead); } else if (e.getActionCommand().equals("scrollDownExtendSelection")) { int target; if (rowLead == getLastVisibleRowIndex()) target = Math.min (rowMax, rowLead + (getLastVisibleRowIndex() - getFirstVisibleRowIndex() + 1)); else target = getLastVisibleRowIndex(); rowModel.setLeadSelectionIndex(target); colModel.setLeadSelectionIndex(colLead); } else if (e.getActionCommand().equals("scrollUpChangeSelection")) { int target; if (rowLead == getFirstVisibleRowIndex()) target = Math.max (0, rowLead - (getLastVisibleRowIndex() - getFirstVisibleRowIndex() + 1)); else target = getFirstVisibleRowIndex(); rowModel.setSelectionInterval(target, target); colModel.setSelectionInterval(colLead, colLead); } else { // If we're here that means we bound this TableAction class // to a keyboard input but we either want to ignore that input // or we just haven't implemented its action yet. } if (table.isEditing() && e.getActionCommand() != "startEditing") table.editingCanceled(new ChangeEvent("update")); table.repaint(); table.scrollRectToVisible (table.getCellRect(rowModel.getLeadSelectionIndex(), colModel.getLeadSelectionIndex(), false)); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/BasicTableUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicTableUI.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
26100,
261,
1803,
1133,
425,
13,
5411,
288,
1377,
987,
6233,
1488,
1027,
1488,
273,
1014,
18,
588,
6233,
1488,
5621,
1377,
987,
6233,
1488,
645,
1488,
273,
1014,
18,
588,
1494,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
26100,
261,
1803,
1133,
425,
13,
5411,
288,
1377,
987,
6233,
1488,
1027,
1488,
273,
1014,
18,
588,
6233,
1488,
5621,
1377,
987,
6233,
1488,
645,
1488,
273,
1014,
18,
588,
1494,... |
} else { final Object[] ret = new Object[1]; final CoreException[] exc = new CoreException[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { ret[0] = element.createExecutableExtension(classAttribute); } catch (CoreException e) { exc[0] = e; } | } final Object[] ret = new Object[1]; final CoreException[] exc = new CoreException[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { ret[0] = element.createExecutableExtension(classAttribute); } catch (CoreException e) { exc[0] = e; | public static Object createExtension(final IConfigurationElement element, final String classAttribute) throws CoreException { try { // If plugin has been loaded create extension. // Otherwise, show busy cursor then create extension. if(BundleUtility.isActivated(element.getDeclaringExtension().getNamespace())) { return element.createExecutableExtension(classAttribute); } else { final Object[] ret = new Object[1]; final CoreException[] exc = new CoreException[1]; BusyIndicator.showWhile(null, new Runnable() { public void run() { try { ret[0] = element.createExecutableExtension(classAttribute); } catch (CoreException e) { exc[0] = e; } } }); if (exc[0] != null) throw exc[0]; else return ret[0]; } } catch (CoreException core) { throw core; } catch (Exception e) { throw new CoreException( new Status( IStatus.ERROR, PI_WORKBENCH, IStatus.ERROR, WorkbenchMessages.getString("WorkbenchPlugin.extension"), //$NON-NLS-1$ e)); } } | 58148 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58148/0694eccfbe031ada7c90d8bdca8e6184aa3b5b2c/WorkbenchPlugin.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
760,
1033,
752,
3625,
12,
6385,
467,
1750,
1046,
930,
16,
727,
514,
667,
1499,
13,
1216,
30015,
288,
202,
202,
698,
288,
1082,
202,
759,
971,
1909,
711,
2118,
4203,
752,
2710,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
760,
1033,
752,
3625,
12,
6385,
467,
1750,
1046,
930,
16,
727,
514,
667,
1499,
13,
1216,
30015,
288,
202,
202,
698,
288,
1082,
202,
759,
971,
1909,
711,
2118,
4203,
752,
2710,... |
if (!validateCopy(parentShell, project, newName, getModelProviderIds())) return; | if (!validateCopy(parentShell, project, newName, getModelProviderIds())) { return; } | public void copyProject(IProject project) { errorStatus = null; //Get the project name and location in a two element list ProjectLocationSelectionDialog dialog = new ProjectLocationSelectionDialog( parentShell, project); dialog.setTitle(IDEWorkbenchMessages.CopyProjectOperation_copyProject); if (dialog.open() != Window.OK) return; Object[] destinationPaths = dialog.getResult(); if (destinationPaths == null) return; String newName = (String) destinationPaths[0]; IPath newLocation = new Path((String) destinationPaths[1]); if (!validateCopy(parentShell, project, newName, getModelProviderIds())) return; boolean completed = performProjectCopy(project, newName, newLocation); if (!completed) // ie.- canceled return; // not appropriate to show errors // If errors occurred, open an Error dialog if (errorStatus != null) { ErrorDialog.openError(parentShell, IDEWorkbenchMessages.CopyProjectOperation_copyFailedTitle, null, errorStatus); errorStatus = null; } } | 58148 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58148/e38d295ea613cf9f08aadb93a84a33d2e91abc5f/CopyProjectOperation.java/buggy/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/CopyProjectOperation.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1610,
4109,
12,
45,
4109,
1984,
13,
288,
3639,
555,
1482,
273,
446,
31,
3639,
368,
967,
326,
1984,
508,
471,
2117,
316,
279,
2795,
930,
666,
3639,
5420,
2735,
6233,
6353,
617... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1610,
4109,
12,
45,
4109,
1984,
13,
288,
3639,
555,
1482,
273,
446,
31,
3639,
368,
967,
326,
1984,
508,
471,
2117,
316,
279,
2795,
930,
666,
3639,
5420,
2735,
6233,
6353,
617... |
public Power(Expression left, Expression right) { super(left, right); } | public Power( Expression left, Expression right ) { super(left, right); } | public Power(Expression left, Expression right) { super(left, right); } | 57371 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57371/4aaf60d8fa76687c3492c508dd98678fbbd3d935/Power.java/buggy/jmock/examples/calculator/src/org/jmock/examples/calculator/expression/Power.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
23783,
12,
2300,
2002,
16,
5371,
2145,
13,
288,
3639,
2240,
12,
4482,
16,
2145,
1769,
565,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
23783,
12,
2300,
2002,
16,
5371,
2145,
13,
288,
3639,
2240,
12,
4482,
16,
2145,
1769,
565,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ps = PropertySetManager.getInstance("ejb3", args); | public void setUp() throws Exception { HashMap args = new HashMap(); args.put("entityName", "testejb3"); args.put("entityId", new Long(3)); EntityManager em = factory.createEntityManager(); em.getTransaction().begin(); args.put("manager", em); //ps = PropertySetManager.getInstance("ejb3", args); } | 22724 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/22724/9f7872a898d3e0739787066b943402ee80cd6572/EJBPropertySetTest.java/clean/src/test/com/opensymphony/module/propertyset/ejb3/EJBPropertySetTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4250,
273,
4276,
694,
1318,
18,
588,
1442,
2932,
73,
10649,
23,
3113,
833,
1769,
4250,
273,
4276,
694,
1318,
18,
588,
1442,
2932,
73,
10649,
23,
3113,
833,
1769,
4250,
273,
4276,
694,
1318,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4250,
273,
4276,
694,
1318,
18,
588,
1442,
2932,
73,
10649,
23,
3113,
833,
1769,
4250,
273,
4276,
694,
1318,
18,
588,
1442,
2932,
73,
10649,
23,
3113,
833,
1769,
4250,
273,
4276,
694,
1318,
... | |
AST tmp351_AST_in = (AST)_t; | AST tmp350_AST_in = (AST)_t; | public final void procedurestate(AST _t) throws RecognitionException { AST procedurestate_AST_in = (_t == ASTNULL) ? null : (AST)_t; AST p = null; AST __t164 = _t; p = _t==ASTNULL ? null :(AST)_t; match(_t,PROCEDURE); _t = _t.getFirstChild(); if ( inputState.guessing==0 ) { tpSupport.procedure(p); } AST tmp343_AST_in = (AST)_t; match(_t,ID); _t = _t.getNextSibling(); { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case EXTERNAL: { AST __t166 = _t; AST tmp344_AST_in = (AST)_t; match(_t,EXTERNAL); _t = _t.getFirstChild(); constant(_t); _t = _retTree; if ( inputState.guessing==0 ) { tpSupport.procedureExternal(); } { _loop169: do { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case CDECL_KW: { AST tmp345_AST_in = (AST)_t; match(_t,CDECL_KW); _t = _t.getNextSibling(); break; } case PASCAL_KW: { AST tmp346_AST_in = (AST)_t; match(_t,PASCAL_KW); _t = _t.getNextSibling(); break; } case STDCALL_KW: { AST tmp347_AST_in = (AST)_t; match(_t,STDCALL_KW); _t = _t.getNextSibling(); break; } case ORDINAL: { AST __t168 = _t; AST tmp348_AST_in = (AST)_t; match(_t,ORDINAL); _t = _t.getFirstChild(); expression(_t); _t = _retTree; _t = __t168; _t = _t.getNextSibling(); break; } case PERSISTENT: { AST tmp349_AST_in = (AST)_t; match(_t,PERSISTENT); _t = _t.getNextSibling(); break; } default: { break _loop169; } } } while (true); } _t = __t166; _t = _t.getNextSibling(); break; } case PRIVATE: { AST tmp350_AST_in = (AST)_t; match(_t,PRIVATE); _t = _t.getNextSibling(); break; } case IN_KW: { AST tmp351_AST_in = (AST)_t; match(_t,IN_KW); _t = _t.getNextSibling(); AST tmp352_AST_in = (AST)_t; match(_t,SUPER); _t = _t.getNextSibling(); break; } case PERIOD: case LEXCOLON: { break; } default: { throw new NoViableAltException(_t); } } } block_colon(_t); _t = _retTree; code_block(_t); _t = _retTree; { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case EOF: { AST tmp353_AST_in = (AST)_t; match(_t,Token.EOF_TYPE); _t = _t.getNextSibling(); break; } case END: { AST __t171 = _t; AST tmp354_AST_in = (AST)_t; match(_t,END); _t = _t.getFirstChild(); { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case PROCEDURE: { AST tmp355_AST_in = (AST)_t; match(_t,PROCEDURE); _t = _t.getNextSibling(); break; } case 3: { break; } default: { throw new NoViableAltException(_t); } } } _t = __t171; _t = _t.getNextSibling(); state_end(_t); _t = _retTree; break; } default: { throw new NoViableAltException(_t); } } } if ( inputState.guessing==0 ) { tpSupport.procedureEnd(); } _t = __t164; _t = _t.getNextSibling(); _retTree = _t; } | 13952 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13952/daa15e07422d3491bbbb4d0060450c81983332a4/TreeParser03.java/clean/trunk/org.prorefactor.core/src/org/prorefactor/treeparser03/TreeParser03.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
727,
918,
12131,
2019,
12,
9053,
389,
88,
13,
1216,
9539,
288,
9506,
202,
9053,
12131,
2019,
67,
9053,
67,
267,
273,
261,
67,
88,
422,
9183,
8560,
13,
692,
446,
294,
261,
90... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
727,
918,
12131,
2019,
12,
9053,
389,
88,
13,
1216,
9539,
288,
9506,
202,
9053,
12131,
2019,
67,
9053,
67,
267,
273,
261,
67,
88,
422,
9183,
8560,
13,
692,
446,
294,
261,
90... |
if (++i <length) { | if (++i < length) { | protected void printEscaped( String source ) throws IOException { int length = source.length(); for ( int i = 0 ; i < length ; ++i ) { int ch = source.charAt(i); if (!XMLChar.isValid(ch)) { if (++i <length) { surrogates(ch, source.charAt(i)); } else { fatalError("The character '"+(char)ch+"' is an invalid XML character"); } continue; } printXMLChar(ch, false); } } | 4434 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4434/54f4239946b55ff27db7627ac6740aff4949f966/XMLSerializer.java/clean/src/org/apache/xml/serialize/XMLSerializer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
918,
1172,
17208,
12,
514,
1084,
262,
1216,
1860,
288,
3639,
509,
769,
273,
1084,
18,
2469,
5621,
3639,
364,
261,
509,
277,
273,
374,
274,
277,
411,
769,
274,
965,
77,
262,
288,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
918,
1172,
17208,
12,
514,
1084,
262,
1216,
1860,
288,
3639,
509,
769,
273,
1084,
18,
2469,
5621,
3639,
364,
261,
509,
277,
273,
374,
274,
277,
411,
769,
274,
965,
77,
262,
288,
... |
return encode(cx, str, methodId == Id_encodeURI); | return encode(str, methodId == Id_encodeURI); | public Object execMethod(IdFunction f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) { if (f.hasTag(FTAG)) { int methodId = f.methodId(); switch (methodId) { case Id_decodeURI: case Id_decodeURIComponent: { String str = ScriptRuntime.toString(args, 0); return decode(cx, str, methodId == Id_decodeURI); } case Id_encodeURI: case Id_encodeURIComponent: { String str = ScriptRuntime.toString(args, 0); return encode(cx, str, methodId == Id_encodeURI); } case Id_escape: return js_escape(cx, args); case Id_eval: return js_eval(cx, scope, args); case Id_isFinite: { if (args.length < 1) return Boolean.FALSE; double d = ScriptRuntime.toNumber(args[0]); return (d != d || d == Double.POSITIVE_INFINITY || d == Double.NEGATIVE_INFINITY) ? Boolean.FALSE : Boolean.TRUE; } case Id_isNaN: { // The global method isNaN, as per ECMA-262 15.1.2.6. if (args.length < 1) return Boolean.TRUE; double d = ScriptRuntime.toNumber(args[0]); return (d != d) ? Boolean.TRUE : Boolean.FALSE; } case Id_parseFloat: return js_parseFloat(cx, args); case Id_parseInt: return js_parseInt(cx, args); case Id_unescape: return js_unescape(cx, args); case Id_uneval: { Object value = (args.length != 0) ? args[0] : Undefined.instance; return ScriptRuntime.uneval(cx, scope, value); } case Id_new_CommonError: // The implementation of all the ECMA error constructors // (SyntaxError, TypeError, etc.) return NativeError.make(cx, scope, f, args); } } throw f.unknown(); } | 51996 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51996/4ad826a35e76cb27011d7ce32f9515c2d80a93c0/NativeGlobal.java/clean/js/rhino/src/org/mozilla/javascript/NativeGlobal.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1033,
1196,
1305,
12,
548,
2083,
284,
16,
1772,
9494,
16,
22780,
2146,
16,
11794,
22780,
15261,
16,
1033,
8526,
833,
13,
565,
288,
3639,
309,
261,
74,
18,
5332,
1805,
12,
4464,
17... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1033,
1196,
1305,
12,
548,
2083,
284,
16,
1772,
9494,
16,
22780,
2146,
16,
11794,
22780,
15261,
16,
1033,
8526,
833,
13,
565,
288,
3639,
309,
261,
74,
18,
5332,
1805,
12,
4464,
17... |
getParentPage().setBackgroundColor("#FFFFFF"); | getParentPage().setBackgroundColor("#FFFFFF"); | public void main(IWContext iwc) throws Exception { add(IWDeveloper.getTitleTable(this.getClass())); getParentPage().setBackgroundColor("#FFFFFF"); Form form = new Form(); form.maintainParameter(IWDeveloper.actionParameter); add(form); Table table = new Table(); table.setAlignment(3, 1, "right"); form.add(table); SubmitButton ib_pages = new SubmitButton(PARAM_IB_PAGES,"Clear all preloaded Builder Pages"); SubmitButton lookup = new SubmitButton(PARAM_LOOKUP,"Clear all Lookup Cache"); SubmitButton ido_bean = new SubmitButton(PARAM_IDO_BEAN,"Clear all IDO Bean Cache"); SubmitButton ido_query = new SubmitButton(PARAM_IDO_QUERY,"Clear all IDO Query Cache"); table.add(ib_pages, 3, 1); table.add(lookup, 3, 2); table.add(ido_bean, 3, 3); table.add(ido_query, 3, 4); processBusiness(iwc); } | 11362 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11362/3ca1d274c003725a3259e54bc06f6d9925e3fd23/Caches.java/clean/src/java/com/idega/development/presentation/Caches.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
2774,
12,
45,
59,
1042,
25522,
71,
13,
1216,
1185,
202,
95,
202,
202,
1289,
12,
45,
59,
28145,
18,
588,
4247,
1388,
12,
2211,
18,
588,
797,
1435,
10019,
1377,
5089,
196... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
2774,
12,
45,
59,
1042,
25522,
71,
13,
1216,
1185,
202,
95,
202,
202,
1289,
12,
45,
59,
28145,
18,
588,
4247,
1388,
12,
2211,
18,
588,
797,
1435,
10019,
1377,
5089,
196... |
}catch(InterruptedException ie){ | } catch (InterruptedException ie) { | public void run() { while (!killed) { String name= null; String file= null; if (batchList.size() >= 2) { synchronized (batchList) { name= (String)batchList.remove(0); file= (String)batchList.remove(0); } ISoundBuffer buffer= null; if (file.endsWith(".wav")) { System.out.println("Loading " + file + " as " + name); buffer= new LWJGLWaveBuffer(); buffer.load(file); } if (file.endsWith(".mp3")) { System.out.println("Loading " + file + " as " + name); buffer= new LWJGLMP3Buffer(); buffer.load(file); } AL.alBufferData( buffer.getBufferNumber(), buffer.getChannels(), buffer.getBufferData(), buffer.getBufferData().capacity(), buffer.getSampleRate()); if (AL.alGetError() != AL.AL_NO_ERROR) { System.err.println("Error generating audio buffer"); } SoundEffect effect= new SoundEffect(buffer.getBufferNumber(), ISound.SOUND_TYPE_EFFECT); EffectRepository rep=EffectRepository.getRepository(); synchronized(rep){ rep.bind(name, effect); } buffer.release(); } try{ Thread.sleep(waitTime); }catch(InterruptedException ie){ } } } | 19503 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/19503/b97988259f6fb4270071d99b9d20356fa546a79a/OnDemandSoundLoader.java/buggy/src/com/jme/sound/utils/OnDemandSoundLoader.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1086,
1435,
288,
202,
202,
17523,
16051,
79,
13148,
13,
288,
1082,
202,
780,
508,
33,
446,
31,
1082,
202,
780,
585,
33,
446,
31,
1082,
202,
430,
261,
5303,
682,
18,
146... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1086,
1435,
288,
202,
202,
17523,
16051,
79,
13148,
13,
288,
1082,
202,
780,
508,
33,
446,
31,
1082,
202,
780,
585,
33,
446,
31,
1082,
202,
430,
261,
5303,
682,
18,
146... |
tmm.setFlags(messageRow.getMessageFlags().getFlagsObject(), true); } | tmm.setFlags(messageRow.getMessageFlags().getFlagsObject(), true); } | public static TorqueMimeMessage createMessage(MessageRow messageRow, Log log) throws TorqueException, MessagingException { TorqueMimeMessage tmm=new TorqueMimeMessage(); List headers=messageRow.getMessageHeaders(new Criteria().addAscendingOrderByColumn(MessageHeaderPeer.LINE_NUMBER)); tmm.content=((MessageBody)messageRow.getMessageBodys().get(0)).getBody(); tmm.size=messageRow.getSize(); String messageIdName=null; String messageIdValue=null; for (Iterator iter = headers.iterator(); iter.hasNext();) { MessageHeader header = (MessageHeader) iter.next(); if ("message-id".equals(header.getField().toLowerCase())) { messageIdName=header.getField(); messageIdValue=header.getValue(); } else { tmm.addHeader(header.getField(),header.getValue()); } } // null-safe flags setup MessageFlags messageFlags=messageRow.getMessageFlags(); if (messageFlags != null) { tmm.setFlags(messageRow.getMessageFlags().getFlagsObject(), true); } // save and reset the message-id tmm.saveChanges(); if (messageIdName!=null) { tmm.setHeader(messageIdName,messageIdValue); } return tmm; } | 47102 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47102/13904ab6daa0ed83ea319a401a618ed457000604/TorqueMimeMessage.java/buggy/sandbox/imap-integration/src/java/org/apache/james/mailboxmanager/torque/TorqueMimeMessage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
23763,
1857,
13320,
1079,
23836,
12,
1079,
1999,
883,
1999,
16,
1827,
613,
13,
1216,
23763,
1857,
503,
16,
23794,
503,
288,
7734,
23763,
1857,
13320,
1079,
6118,
81,
33,
2704,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
23763,
1857,
13320,
1079,
23836,
12,
1079,
1999,
883,
1999,
16,
1827,
613,
13,
1216,
23763,
1857,
503,
16,
23794,
503,
288,
7734,
23763,
1857,
13320,
1079,
6118,
81,
33,
2704,
... |
typeSymbol = ((IContainerSymbol)typeSymbol).lookup( current.getImage()); | typeSymbol = ((IContainerSymbol)typeSymbol).lookup( image ); | public IASTSimpleTypeSpecifier createSimpleTypeSpecifier( IASTScope scope, Type kind, ITokenDuple typeName, boolean isShort, boolean isLong, boolean isSigned, boolean isUnsigned, boolean isTypename, boolean isComplex, boolean isImaginary) throws ASTSemanticException { TypeInfo.eType type = null; if( kind == IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME ) type = TypeInfo.t_type; else if( kind == IASTSimpleTypeSpecifier.Type.BOOL ) type = TypeInfo.t_bool; else if( kind == IASTSimpleTypeSpecifier.Type.CHAR ) type = TypeInfo.t_char; else if( kind == IASTSimpleTypeSpecifier.Type.DOUBLE ||kind == IASTSimpleTypeSpecifier.Type.FLOAT ) type = TypeInfo.t_double; else if( kind == IASTSimpleTypeSpecifier.Type.INT ) type = TypeInfo.t_int; else if( kind == IASTSimpleTypeSpecifier.Type.VOID ) type = TypeInfo.t_void; else if( kind == IASTSimpleTypeSpecifier.Type.WCHAR_T) type = TypeInfo.t_wchar_t; else if( kind == IASTSimpleTypeSpecifier.Type._BOOL ) type = TypeInfo.t__Bool; List references = new ArrayList(); ISymbol s = pst.newSymbol( "", type ); //$NON-NLS-1$ if( kind == IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME ) { // lookup the duple Iterator i = typeName.iterator(); IToken first = typeName.getFirstToken(); ISymbol typeSymbol = getScopeToSearchUpon( scope, first, i ); while( i.hasNext() ) { IToken current = (IToken)i.next(); if( current.getType() == IToken.tCOLONCOLON ) continue; try { if( current != typeName.getLastToken() ) typeSymbol = ((IContainerSymbol)typeSymbol).lookupNestedNameSpecifier( current.getImage()); else typeSymbol = ((IContainerSymbol)typeSymbol).lookup( current.getImage()); if( typeSymbol != null ) addReference( references, createReference( typeSymbol, current.getImage(), current.getOffset() )); else handleProblem( IProblem.SEMANTIC_NAME_NOT_FOUND, current.getImage() ); } catch (ParserSymbolTableException e) { handleProblem( e.createProblemID(), current.getImage() ); } } s.setTypeSymbol( typeSymbol ); } s.getTypeInfo().setBit( isLong, TypeInfo.isLong ); s.getTypeInfo().setBit( isShort, TypeInfo.isShort); s.getTypeInfo().setBit( isUnsigned, TypeInfo.isUnsigned ); s.getTypeInfo().setBit( isComplex, TypeInfo.isComplex ); s.getTypeInfo().setBit( isImaginary, TypeInfo.isImaginary ); s.getTypeInfo().setBit( isSigned, TypeInfo.isSigned ); return new ASTSimpleTypeSpecifier( s, false, typeName.toString(), references ); } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/51131345dbaa12f210adc03b3ad05a951d937464/CompleteParseASTFactory.java/clean/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
467,
9053,
5784,
559,
21416,
752,
5784,
559,
21416,
12,
3639,
467,
9053,
3876,
2146,
16,
3639,
1412,
3846,
16,
3639,
467,
1345,
40,
2268,
8173,
16,
3639,
1250,
353,
4897,
16,
3639,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
467,
9053,
5784,
559,
21416,
752,
5784,
559,
21416,
12,
3639,
467,
9053,
3876,
2146,
16,
3639,
1412,
3846,
16,
3639,
467,
1345,
40,
2268,
8173,
16,
3639,
1250,
353,
4897,
16,
3639,
... |
return TA_RetCode.TA_SUCCESS; } | tempReal = (tempReal*constDiff)+constMax; tempReal *= tempReal; prevKAMA = ((inReal[today++]-prevKAMA)*tempReal) + prevKAMA; while( today <= startIdx ) { tempReal = inReal[today]; tempReal2 = inReal[trailingIdx++]; periodROC = tempReal-tempReal2; sumROC1 -= Math.abs (trailingValue-tempReal2); sumROC1 += Math.abs (tempReal-inReal[today-1]); trailingValue = tempReal2; if( (sumROC1 <= periodROC) || (((-0.00000001)<sumROC1)&&(sumROC1<0.00000001)) ) tempReal = 1.0; else tempReal = Math.abs (periodROC/sumROC1); tempReal = (tempReal*constDiff)+constMax; tempReal *= tempReal; prevKAMA = ((inReal[today++]-prevKAMA)*tempReal) + prevKAMA; } outReal[0] = prevKAMA; outIdx = 1; outBegIdx.value = today-1; while( today <= endIdx ) { tempReal = inReal[today]; tempReal2 = inReal[trailingIdx++]; periodROC = tempReal-tempReal2; sumROC1 -= Math.abs (trailingValue-tempReal2); sumROC1 += Math.abs (tempReal-inReal[today-1]); trailingValue = tempReal2; if( (sumROC1 <= periodROC) || (((-0.00000001)<sumROC1)&&(sumROC1<0.00000001)) ) tempReal = 1.0; else tempReal = Math.abs (periodROC / sumROC1); tempReal = (tempReal*constDiff)+constMax; tempReal *= tempReal; prevKAMA = ((inReal[today++]-prevKAMA)*tempReal) + prevKAMA; outReal[outIdx++] = prevKAMA; } outNbElement.value = outIdx; return TA_RetCode. TA_SUCCESS; } | public TA_RetCode KAMA(int startIdx, int endIdx, double inReal[], int optInTimePeriod, MInteger outBegIdx, MInteger outNbElement, double outReal[]) { final double constMax = 2.0 / (30.0 + 1.0); final double constDiff = 2.0 / (2.0 + 1.0) - constMax; double tempReal, tempReal2; double sumROC1, periodROC, prevKAMA; int i, today, outIdx, lookbackTotal; int trailingIdx; double trailingValue; if (startIdx < 0) return TA_RetCode.TA_OUT_OF_RANGE_START_INDEX; if ((endIdx < 0) || (endIdx < startIdx)) return TA_RetCode.TA_OUT_OF_RANGE_END_INDEX; if ((int) optInTimePeriod == (Integer.MIN_VALUE )) optInTimePeriod = 30; else if (((int) optInTimePeriod < 2) || ((int) optInTimePeriod > 100000)) return TA_RetCode.TA_BAD_PARAM; outBegIdx.value = 0; outNbElement.value = 0; lookbackTotal = optInTimePeriod + (this.unstablePeriod[TA_FuncUnstId.TA_FUNC_UNST_KAMA .ordinal()]); if (startIdx < lookbackTotal) startIdx = lookbackTotal; if (startIdx > endIdx) { outBegIdx.value = 0; outNbElement.value = 0; return TA_RetCode.TA_SUCCESS; } sumROC1 = 0.0; today = startIdx - lookbackTotal; trailingIdx = today; i = optInTimePeriod; while (i-- > 0) { tempReal = inReal[today++]; tempReal -= inReal[today]; sumROC1 += Math.abs(tempReal); } prevKAMA = inReal[today - 1]; tempReal = inReal[today]; tempReal2 = inReal[trailingIdx++]; periodROC = tempReal - tempReal2; trailingValue = tempReal2; if ((sumROC1 <= periodROC) || (((-0.00000001) < sumROC1) && (sumROC1 < 0.00000001))) tempReal = 1.0; else tempReal = Math.abs(periodROC / sumROC1); tempReal = (tempReal * constDiff) + constMax; tempReal *= tempReal; prevKAMA = ((inReal[today++] - prevKAMA) * tempReal) + prevKAMA; while (today <= startIdx) { tempReal = inReal[today]; tempReal2 = inReal[trailingIdx++]; periodROC = tempReal - tempReal2; sumROC1 -= Math.abs(trailingValue - tempReal2); sumROC1 += Math.abs(tempReal - inReal[today - 1]); trailingValue = tempReal2; if ((sumROC1 <= periodROC) || (((-0.00000001) < sumROC1) && (sumROC1 < 0.00000001))) tempReal = 1.0; else tempReal = Math.abs(periodROC / sumROC1); tempReal = (tempReal * constDiff) + constMax; tempReal *= tempReal; prevKAMA = ((inReal[today++] - prevKAMA) * tempReal) + prevKAMA; } outReal[0] = prevKAMA; outIdx = 1; outBegIdx.value = today - 1; while (today <= endIdx) { tempReal = inReal[today]; tempReal2 = inReal[trailingIdx++]; periodROC = tempReal - tempReal2; sumROC1 -= Math.abs(trailingValue - tempReal2); sumROC1 += Math.abs(tempReal - inReal[today - 1]); trailingValue = tempReal2; if ((sumROC1 <= periodROC) || (((-0.00000001) < sumROC1) && (sumROC1 < 0.00000001))) tempReal = 1.0; else tempReal = Math.abs(periodROC / sumROC1); tempReal = (tempReal * constDiff) + constMax; tempReal *= tempReal; prevKAMA = ((inReal[today++] - prevKAMA) * tempReal) + prevKAMA; outReal[outIdx++] = prevKAMA; } outNbElement.value = outIdx; return TA_RetCode.TA_SUCCESS; } | 7231 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7231/5df8081f2a7211016256c0f481213a987e02947a/Core.java/clean/ta-lib/java/src/TA/Lib/Core.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
399,
37,
67,
7055,
1085,
1475,
2192,
37,
12,
474,
27108,
16,
509,
679,
4223,
16,
1645,
316,
6955,
63,
6487,
1082,
202,
474,
2153,
382,
26540,
16,
490,
4522,
596,
24059,
4223,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
399,
37,
67,
7055,
1085,
1475,
2192,
37,
12,
474,
27108,
16,
509,
679,
4223,
16,
1645,
316,
6955,
63,
6487,
1082,
202,
474,
2153,
382,
26540,
16,
490,
4522,
596,
24059,
4223,
... |
Transliterator toHTML = BagFormatter.toHTML; | Transliterator toHTML = TransliteratorUtilities.toHTML; | public static void main(String[] args) throws SAXException, IOException { startTime = System.currentTimeMillis(); UOption.parseArgs(args, options); Factory cldrFactory = CLDRFile.Factory.make(options[SOURCEDIR].value, options[MATCH].value); Set alllocales = cldrFactory.getAvailable(); String[] postFix = new String[]{""}; // gather all information // TODO tweek for value-laden attributes for (Iterator it = alllocales.iterator(); it.hasNext();) { String localeID = (String) it.next(); System.out.println("Loading: " + localeID); CLDRFile cldrFile = cldrFactory.make(localeID, localeID.equals("root")); for (Iterator it2 = cldrFile.iterator(); it2.hasNext();) { String path = (String) it2.next(); String cleanPath = fixPath(path, postFix); String fullPath = cldrFile.getFullXPath(path); String value = getValue(cldrFile, path, fullPath); if (fullPath.indexOf("[@draft=") >= 0) postFix[0] = "*"; Map value_locales = (Map) path_value_locales.get(cleanPath); if (value_locales == null ) path_value_locales.put(cleanPath, value_locales = new TreeMap(standardCollation)); Set locales = (Set) value_locales.get(value); if (locales == null) value_locales.put(value, locales = new TreeSet()); locales.add(localeID + postFix[0]); } } String oldMain = ""; PrintWriter out = null; System.out.println("Getting types"); String[] partial = {""}; Set types = new TreeSet(); for (Iterator it = path_value_locales.keySet().iterator(); it.hasNext();) { String path = (String)it.next(); String main = getFileName(path, partial); if (!main.equals(oldMain)) { oldMain = main; types.add(main); } } System.out.println("Printing files"); Utility.registerExtraTransliterators(); Transliterator toLatin = Transliterator.getInstance("any-latin"); Transliterator toHTML = BagFormatter.toHTML; UnicodeSet BIDI_R = new UnicodeSet("[[:Bidi_Class=R:][:Bidi_Class=AL:]]"); for (Iterator it = path_value_locales.keySet().iterator(); it.hasNext();) { String path = (String)it.next(); String main = getFileName(path, partial); if (!main.equals(oldMain)) { oldMain = main; out = start(out, main, types); } out.println("<tr><th colSpan='2' class='path'>" + toHTML.transliterate(partial[0]) + "</th><tr>"); Map value_locales = (Map) path_value_locales.get(path); for (Iterator it2 = value_locales.keySet().iterator(); it2.hasNext();) { String value = (String)it2.next(); String outValue = toHTML.transliterate(value); String transValue = toLatin.transliterate(value); if (!transValue.equals(value)) { outValue = "<span title='" + toHTML.transliterate(transValue) + "'>" + outValue + "</span>"; } String valueClass = " class='value'"; if (BIDI_R.containsSome(value)) { valueClass = " class='rtl_value'"; } out.println("<tr><th" + valueClass + ">" + outValue + "</th><td>"); Set locales = (Set) value_locales.get(value); boolean first = true; for (Iterator it3 = locales.iterator(); it3.hasNext();) { String locale = (String)it3.next(); if (first) first = false; else out.print(" "); if (locale.endsWith("*")) { locale = locale.substring(0,locale.length()-1); out.print("<i>\u00B7" + locale + "\u00B7</i>"); } else { out.print("\u00B7" + locale + "\u00B7"); } } out.println("</td><tr>"); } } finish(out); System.out.println("Done in " + new RuleBasedNumberFormat(new ULocale("en"), RuleBasedNumberFormat.DURATION) .format((System.currentTimeMillis()-startTime)/1000.0)); } | 27800 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/27800/52bcdfe5e692bb7a87e851b40f1fe803956a7b14/GenerateSidewaysView.java/buggy/tools/java/org/unicode/cldr/tool/GenerateSidewaysView.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
918,
2774,
12,
780,
8526,
833,
13,
1216,
14366,
16,
1860,
288,
565,
202,
377,
202,
1937,
950,
273,
2332,
18,
2972,
28512,
5621,
3639,
587,
1895,
18,
2670,
2615,
12,
1968,
16,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
918,
2774,
12,
780,
8526,
833,
13,
1216,
14366,
16,
1860,
288,
565,
202,
377,
202,
1937,
950,
273,
2332,
18,
2972,
28512,
5621,
3639,
587,
1895,
18,
2670,
2615,
12,
1968,
16,... |
suite.addTest(new FormatterRegressionTests("test569")); | suite.addTest(new FormatterRegressionTests("test571")); | public static Test suite() { if (true) { TestSuite suite = new TestSuite("All formatter tests (org.eclipse.jdt.core.tests.formatter)"); suite.addTest(new Suite(FormatterRegressionTests.class)); suite.addTest(CommentsTestSuite.suite()); return suite; } junit.framework.TestSuite suite = new Suite(FormatterRegressionTests.class.getName()); suite.addTest(new FormatterRegressionTests("test569")); //$NON-NLS-1$ return suite; } | 10698 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/10698/be2396778954f7686c95a2d45b5130702d13bfe1/FormatterRegressionTests.java/buggy/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
760,
7766,
11371,
1435,
288,
202,
202,
430,
261,
3767,
13,
288,
1082,
202,
4709,
13587,
11371,
273,
394,
7766,
13587,
2932,
1595,
4453,
7434,
261,
3341,
18,
20416,
18,
78,
7510,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
760,
7766,
11371,
1435,
288,
202,
202,
430,
261,
3767,
13,
288,
1082,
202,
4709,
13587,
11371,
273,
394,
7766,
13587,
2932,
1595,
4453,
7434,
261,
3341,
18,
20416,
18,
78,
7510,... |
} } else if (getAromaticCarbonsCount(ac, atoms[i]) < 2 && getAromaticNitrogensCount(ac, atoms[i]) > 1) { | } } else if (getAromaticNitrogensCount(ac, atoms[i]) >= 1) { | public DescriptorValue calculate(AtomContainer ac) throws CDKException { RingSet rs = (new AllRingsFinder()).findAllRings(ac); HueckelAromaticityDetector.detectAromaticity(ac, rs, true); double xlogP = 0; org.openscience.cdk.interfaces.Atom[] atoms = ac.getAtoms(); String symbol = ""; int bondCount = 0; int hsCount = 0; double maxBondOrder = 0; for (int i = 0; i < atoms.length; i++) { symbol = atoms[i].getSymbol(); bondCount = ac.getBondCount(atoms[i]); hsCount = getHydrogenCount(ac, atoms[i]); maxBondOrder = ac.getMaximumBondOrder(atoms[i]); if (symbol.equals("C")) { if (bondCount == 2) { // C sp if (hsCount >= 1) { xlogP += 0.209; // // System.out...println("XLOGP: 1"); } else { if (maxBondOrder == 2.0) { xlogP += 2.073; // // System.out...println("XLOGP: 2"); } else if (maxBondOrder == 3.0) { xlogP += 0.33; // // System.out...println("XLOGP: 3"); } } } if (bondCount == 3) { // C sp2 if (atoms[i].getFlag(CDKConstants.ISAROMATIC)) { if (getAromaticCarbonsCount(ac, atoms[i]) == 2) { if (hsCount == 0) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { xlogP += 0.296; // // System.out...println("XLOGP: 4"); } else { xlogP -= 0.151; // // System.out...println("XLOGP: 5"); } } else { xlogP += 0.337; // // System.out...println("XLOGP: 6"); } } else if (getAromaticCarbonsCount(ac, atoms[i]) < 2 && getAromaticNitrogensCount(ac, atoms[i]) > 1) { if (hsCount == 0) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { xlogP += 0.174; // // System.out...println("XLOGP: 7"); } else { xlogP += 0.366; // // System.out...println("XLOGP: 8"); } } else if (getHydrogenCount(ac, atoms[i]) == 1) { xlogP += 0.126; // // System.out...println("XLOGP: 9"); } } } else { if (hsCount == 0) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP += 0.05; // // System.out...println("XLOGP: 10"); } else { xlogP += 0.013; // // System.out...println("XLOGP: 11"); } } if (getNitrogenOrOxygenCount(ac, atoms[i]) == 1) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP -= 0.03; // // System.out...println("XLOGP: 12"); } else { xlogP -= 0.027; // // System.out...println("XLOGP: 13"); } } if (getNitrogenOrOxygenCount(ac, atoms[i]) == 2) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP += 0.005; // // System.out...println("XLOGP: 14"); } else { xlogP -= 0.315; // // System.out...println("XLOGP: 15"); } } } if (hsCount == 1) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP += 0.466; // // System.out...println("XLOGP: 16"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP += 0.136; // // System.out...println("XLOGP: 17"); } } else { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP += 0.001; // // System.out...println("XLOGP: 18"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP -= 0.31; // // System.out...println("XLOGP: 19"); } } } if (hsCount == 2) { xlogP += 0.42; // // System.out...println("XLOGP: 20"); } } if (getIfCarbonIsHydrophobic(ac, atoms[i]) >= 0) { xlogP += 0.211; // // System.out...println("XLOGP: 21"); } } if (bondCount == 4) { // C sp3 if (getIfCarbonIsHydrophobic(ac, atoms[i]) >= 0) { xlogP += 0.211; // // System.out...println("XLOGP: 22"); } if (hsCount == 0) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP -= 0.006; // // System.out...println("XLOGP: 23"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP -= 0.57; // // System.out...println("XLOGP: 24"); } if (getPiSystemsCount(ac, atoms[i]) >= 2) { xlogP -= 0.317; // // System.out...println("XLOGP: 25"); } } else { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP -= 0.316; // // System.out...println("XLOGP: 26"); } else { xlogP -= 0.723; // // System.out...println("XLOGP: 27"); } } } if (hsCount == 1) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP += 0.127; // // System.out...println("XLOGP: 28"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP -= 0.243; // // System.out...println("XLOGP: 29"); } if (getPiSystemsCount(ac, atoms[i]) >= 2) { xlogP -= 0.499; // // System.out...println("XLOGP: 30"); } } else { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP -= 0.205; // // System.out...println("XLOGP: 31"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP -= 0.305; // // System.out...println("XLOGP: 32"); } if (getPiSystemsCount(ac, atoms[i]) >= 2) { xlogP -= 0.709; // // System.out...println("XLOGP: 33"); } } } if (hsCount == 2) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP += 0.358; // // System.out...println("XLOGP: 34"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP -= 0.008; // // System.out...println("XLOGP: 35"); } if (getPiSystemsCount(ac, atoms[i]) == 2) { xlogP -= 0.185; // // System.out...println("XLOGP: 36"); } } else { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP += 0.137; // // System.out...println("XLOGP: 37"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP -= 0.303; // // System.out...println("XLOGP: 38"); } if (getPiSystemsCount(ac, atoms[i]) == 2) { xlogP -= 0.815; // // System.out...println("XLOGP: 39"); } } } if (hsCount > 2) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP += 0.528; // // System.out...println("XLOGP: 40"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP += 0.267; // // System.out...println("XLOGP: 41"); } } if (getNitrogenOrOxygenCount(ac, atoms[i]) == 1) { xlogP -= 0.032; // // System.out...println("XLOGP: 42"); } } } } if (symbol.equals("N")) { if (ac.getBondOrderSum(atoms[i]) == 5.0) { xlogP += 1.178; // // System.out...println("XLOGP: 43"); } // NO2 else { if (getPresenceOfCarbonil(ac, atoms[i]) == 1) { // amidic nitrogen if (hsCount == 0) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { xlogP += 0.078; // // System.out...println("XLOGP: 44"); } if (getNitrogenOrOxygenCount(ac, atoms[i]) == 1) { xlogP -= 0.118; // // System.out...println("XLOGP: 45"); } } if (hsCount == 1) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { xlogP -= 0.096; // // System.out...println("XLOGP: 46"); } else { xlogP -= 0.044; // // System.out...println("XLOGP: 47"); } } if (hsCount == 2) { xlogP -= 0.646; // // System.out...println("XLOGP: 48"); } } else { if (bondCount == 1) { // -C#N if (getCarbonsCount(ac, atoms[i]) == 1) { xlogP -= 0.566; // // System.out...println("XLOGP: 49"); } } if (bondCount == 2) { // N sp2 if (atoms[i].getFlag(CDKConstants.ISAROMATIC)) { xlogP -= 0.493; // // System.out...println("XLOGP: 50"); } else { if (getDoubleBondedCarbonsCount(ac, atoms[i]) == 0) { if (getDoubleBondedNitrogenCount(ac, atoms[i]) == 0) { if (getDoubleBondedOxygenCount(ac, atoms[i]) == 1) { xlogP += 0.427; // // System.out...println("XLOGP: 51"); } } if (getDoubleBondedNitrogenCount(ac, atoms[i]) == 1) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { xlogP += 0.536; // // System.out...println("XLOGP: 52"); } if (getNitrogenOrOxygenCount(ac, atoms[i]) == 1) { xlogP -= 0.597; // // System.out...println("XLOGP: 53"); } } } if (getDoubleBondedCarbonsCount(ac, atoms[i]) == 1) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP += 0.007; // // System.out...println("XLOGP: 54"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP -= 0.275; // // System.out...println("XLOGP: 55"); } } if (getNitrogenOrOxygenCount(ac, atoms[i]) == 1) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP += 0.366; // // System.out...println("XLOGP: 56"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP += 0.251; // // System.out...println("XLOGP: 57"); } } } } } if (bondCount == 3) { // N sp3 if (hsCount == 0) { if (rs.contains(atoms[i])) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { xlogP += 0.881; // // System.out...println("XLOGP: 58"); } else { xlogP -= 0.01; // // System.out...println("XLOGP: 59"); } } else { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP += 0.159; // // System.out...println("XLOGP: 60"); } if (getPiSystemsCount(ac, atoms[i]) > 0) { xlogP += 0.761; // // System.out...println("XLOGP: 61"); } } else { xlogP -= 0.239; } } } if (hsCount == 1) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { if (atoms[i].getFlag(CDKConstants.ISAROMATIC)) { xlogP += 0.545; // // System.out...println("XLOGP: 62"); } // like pyrrole else { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP -= 0.112; // // System.out...println("XLOGP: 63"); } if (getPiSystemsCount(ac, atoms[i]) > 0) { xlogP += 0.166; // // System.out...println("XLOGP: 64"); } } } else { if (rs.contains(atoms[i])) { xlogP += 0.153; // // System.out...println("XLOGP: 65"); } else { xlogP += 0.324; // // System.out...println("XLOGP: 66"); } } } if (hsCount == 2) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP -= 0.534; // // System.out...println("XLOGP: 66"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP -= 0.329; // // System.out...println("XLOGP: 67"); } } else { xlogP -= 1.082; // // System.out...println("XLOGP: 68"); } } } } } } if (symbol.equals("O")) { if (bondCount == 1) { xlogP -= 0.399; // // System.out...println("XLOGP: 69"); } if (bondCount == 2) { if (hsCount == 0) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP += 0.084; // // System.out...println("XLOGP: 70"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP += 0.435; // // System.out...println("XLOGP: 71"); } } if (getNitrogenOrOxygenCount(ac, atoms[i]) == 1) { xlogP += 0.105; // // System.out...println("XLOGP: 72"); } } else { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 0) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP -= 0.467; // // System.out...println("XLOGP: 73"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP += 0.082; // // System.out...println("XLOGP: 74"); } } if (getNitrogenOrOxygenCount(ac, atoms[i]) == 1) { xlogP -= 0.522; // // System.out...println("XLOGP: 75"); } } } } if (symbol.equals("S")) { if (bondCount == 1) { xlogP -= 0.148; // // System.out...println("XLOGP: 76"); } if (bondCount == 2) { if (hsCount == 0) { xlogP += 0.255; // // System.out...println("XLOGP: 77"); } else { xlogP += 0.419; // // System.out...println("XLOGP: 78"); } } if (bondCount == 3) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 1) { xlogP -= 1.375; // // System.out...println("XLOGP: 79"); } } if (bondCount == 4) { if (getNitrogenOrOxygenCount(ac, atoms[i]) == 2) { xlogP -= 0.168; // // System.out...println("XLOGP: 80"); } } } if (symbol.equals("P")) { if (getDoubleBondedSulfurCount(ac, atoms[i]) == 1) { xlogP += 1.253; // // System.out...println("XLOGP: 81"); } if (getDoubleBondedOxygenCount(ac, atoms[i]) == 1) { xlogP -= 0.477; // // System.out...println("XLOGP: 82"); } } if (symbol.equals("F")) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP += 0.375; // // System.out...println("XLOGP: 84"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP += 0.202; // // System.out...println("XLOGP: 85"); } } if (symbol.equals("Cl")) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP += 0.512; // // System.out...println("XLOGP: 86"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP += 0.663; // // System.out...println("XLOGP: 87"); } } if (symbol.equals("Br")) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP += 0.85; // // System.out...println("XLOGP: 88"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP += 0.839; // // System.out...println("XLOGP: 89"); } } if (symbol.equals("I")) { if (getPiSystemsCount(ac, atoms[i]) == 0) { xlogP += 1.05; // // System.out...println("XLOGP: 90"); } if (getPiSystemsCount(ac, atoms[i]) == 1) { xlogP += 1.109; // // System.out...println("XLOGP: 91"); } } if (getAlogenCount(ac, atoms[i]) >= 2) { xlogP += 0.137; // // System.out...println("XLOGP: 92"); } // more than 2 alogens on the same atom if (getPresenceOfCarbonil(ac, atoms[i]) == 2) {// sp2 oxygen 1-5 pair if(!rs.contains(atoms[i])) { xlogP += 0.580; } } } Descriptor acc = new HBondAcceptorCountDescriptor(); Object[] paramsAcc = {new Boolean(false)}; acc.setParameters(paramsAcc); Descriptor don = new HBondDonorCountDescriptor(); Object[] paramsDon = {new Boolean(false)}; don.setParameters(paramsDon); int acceptors = ((IntegerResult) acc.calculate(ac).getValue()).intValue(); int donors = ((IntegerResult) don.calculate(ac).getValue()).intValue(); if (donors > 0 && acceptors > 0) { xlogP += 0.429; // internal H-bonds } SmilesParser sp = new SmilesParser(); AtomContainer paba = sp.parseSmiles("CS(=O)(=O)c1ccc(N)cc1"); // p-amino sulphonic acid if (UniversalIsomorphismTester.isSubgraph((org.openscience.cdk.AtomContainer)ac, paba)) { xlogP -= 0.501; } AtomContainer aminoacid = sp.parseSmiles("NC=O"); // alpha amino acid if (UniversalIsomorphismTester.isSubgraph((org.openscience.cdk.AtomContainer)ac, aminoacid)) { xlogP -= 2.166; } AtomContainer salicilic = sp.parseSmiles("O=C(O)c1ccccc1O"); // salicylic acid if (UniversalIsomorphismTester.isSubgraph((org.openscience.cdk.AtomContainer)ac, salicilic)) { xlogP += 0.554; } AtomContainer orthopair = sp.parseSmiles("OCCO"); // ortho oxygen pair if (UniversalIsomorphismTester.isSubgraph((org.openscience.cdk.AtomContainer)ac, orthopair)) { xlogP -= 0.268; } return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(xlogP)); } | 1306 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1306/11cd872c3dbcc51a117ad375706e7a5334b88daa/XLogPDescriptor.java/clean/src/org/openscience/cdk/qsar/XLogPDescriptor.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
12823,
620,
4604,
12,
3641,
2170,
1721,
13,
1216,
24570,
288,
202,
202,
10369,
694,
3597,
273,
261,
2704,
4826,
54,
899,
8441,
1435,
2934,
4720,
1595,
54,
899,
12,
1077,
1769,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
12823,
620,
4604,
12,
3641,
2170,
1721,
13,
1216,
24570,
288,
202,
202,
10369,
694,
3597,
273,
261,
2704,
4826,
54,
899,
8441,
1435,
2934,
4720,
1595,
54,
899,
12,
1077,
1769,
... |
if (list.item(i) instanceof Element) frag.appendChild(list.item(i)); | if ((list.item(i) instanceof Text && !"".equals(list.item(i).getNodeValue())) || list.item(i) instanceof Element) { node = list.item(i); break; } | public void setSourceProperty(SourceProperty sourceproperty) throws SourceException { try { Document doc = sourceproperty.getValue().getOwnerDocument(); DocumentFragment frag = doc.createDocumentFragment(); NodeList list = sourceproperty.getValue().getChildNodes(); for (int i=0; i<list.getLength(); i++) { if (list.item(i) instanceof Element) frag.appendChild(list.item(i)); } Properties format = new Properties(); format.put(OutputKeys.METHOD, "xml"); format.put(OutputKeys.OMIT_XML_DECLARATION, "yes"); String prop = XMLUtils.serializeNode(frag, format); this.resource.proppatchMethod( new PropertyName(sourceproperty.getNamespace(),sourceproperty.getName()), prop, true); } catch (Exception e) { throw new SourceException("Could not set property ", e); } } | 46428 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46428/6d849e013b39dc37e8754a7f2031e59e57a62f52/WebDAVSource.java/clean/src/blocks/webdav/java/org/apache/cocoon/components/source/impl/WebDAVSource.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
18913,
1396,
12,
1830,
1396,
1084,
4468,
13,
565,
1216,
4998,
503,
288,
3639,
775,
288,
5411,
4319,
997,
273,
1084,
4468,
18,
24805,
7675,
588,
5541,
2519,
5621,
5411,
4319,
74... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
18913,
1396,
12,
1830,
1396,
1084,
4468,
13,
565,
1216,
4998,
503,
288,
3639,
775,
288,
5411,
4319,
997,
273,
1084,
4468,
18,
24805,
7675,
588,
5541,
2519,
5621,
5411,
4319,
74... |
String frame = m.getFrame(decompiledLine - currentDecompiledLine); | String [] frame = m.getFrame(decompiledLine - currentDecompiledLine, showQualifiedNames); | public String getFrame(final int decompiledLine) { int currentDecompiledLine = 0; for (int i = 0; i < text.size(); ++i) { Object o = text.get(i); if (o instanceof DecompiledMethod) { DecompiledMethod m = (DecompiledMethod) o; String frame = m.getFrame(decompiledLine - currentDecompiledLine); if (frame != null) { return frame; } currentDecompiledLine += m.getLineCount(); } else { currentDecompiledLine++; } } return null; } | 2697 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2697/2c9b996368b513b6c1e6c580c79e8d1aa8fd140e/DecompiledClass.java/buggy/eclipse/plugin/src/de/loskutov/bco/asm/DecompiledClass.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
25396,
12,
6385,
509,
443,
19397,
1670,
13,
288,
3639,
509,
783,
17731,
84,
1411,
1670,
273,
374,
31,
3639,
364,
261,
474,
277,
273,
374,
31,
277,
411,
977,
18,
1467,
5621,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
25396,
12,
6385,
509,
443,
19397,
1670,
13,
288,
3639,
509,
783,
17731,
84,
1411,
1670,
273,
374,
31,
3639,
364,
261,
474,
277,
273,
374,
31,
277,
411,
977,
18,
1467,
5621,
... |
return sbuf.toString(); | return sbuf.toString(); | public String toString() { StringBuffer sbuf = new StringBuffer(); Enumeration e = lengths.elements(); while (e.hasMoreElements()) { if (sbuf.length()>0) { sbuf.append('+'); } sbuf.append(e.nextElement().toString()); } return sbuf.toString(); } | 5268 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5268/392781f30969e4da0b510da16b96099a320089ba/MixedLength.java/buggy/src/org/apache/fop/datatypes/MixedLength.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
1762,
1435,
288,
3639,
6674,
2393,
696,
273,
394,
6674,
5621,
202,
21847,
425,
273,
10917,
18,
6274,
5621,
202,
17523,
261,
73,
18,
5332,
7417,
3471,
10756,
288,
202,
565,
309,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
1762,
1435,
288,
3639,
6674,
2393,
696,
273,
394,
6674,
5621,
202,
21847,
425,
273,
10917,
18,
6274,
5621,
202,
17523,
261,
73,
18,
5332,
7417,
3471,
10756,
288,
202,
565,
309,... |
return RubyFixnum.newFixnum(runtime, totalWritten); | return getRuntime().newFixnum(totalWritten); | public IRubyObject write(IRubyObject obj) { checkWriteable(); try { int totalWritten = handler.write(obj.toString()); return RubyFixnum.newFixnum(runtime, totalWritten); } catch (IOError e) { return RubyFixnum.zero(runtime); } catch (ErrnoError e) { return RubyFixnum.zero(runtime); } } | 47984 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47984/870e1da9b41bfdbae259e1fc5f18fc8b76686998/RubyIO.java/clean/src/org/jruby/RubyIO.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
15908,
10340,
921,
1045,
12,
7937,
10340,
921,
1081,
13,
288,
3639,
866,
3067,
429,
5621,
3639,
775,
288,
5411,
509,
2078,
12643,
273,
1838,
18,
2626,
12,
2603,
18,
10492,
10663,
54... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
15908,
10340,
921,
1045,
12,
7937,
10340,
921,
1081,
13,
288,
3639,
866,
3067,
429,
5621,
3639,
775,
288,
5411,
509,
2078,
12643,
273,
1838,
18,
2626,
12,
2603,
18,
10492,
10663,
54... |
private void switchDataSet( String datasetName ) throws ChartException | private int switchDataSet( String datasetName ) throws ChartException | private void switchDataSet( String datasetName ) throws ChartException { if ( getDataServiceProvider( ).getBoundDataSet( ) != null && getDataServiceProvider( ).getBoundDataSet( ) .equals( datasetName ) ) { return; } try { bCancel = Window.OK; String oldDataSetName = getDataServiceProvider( ).getBoundDataSet( ); getDataServiceProvider( ).beforeTransaction( ); // Clear old dataset and preview data getDataServiceProvider( ).setDataSet( datasetName ); tablePreview.clearContents( ); // Popup data binding if ( getDataServiceProvider( ).getBoundDataSet( ) != null || getDataServiceProvider( ).getReportDataSet( ) != null ) { bCancel = getDataServiceProvider( ).invoke( IDataServiceProvider.COMMAND_EDIT_BINDING ); } if ( bCancel == Window.CANCEL ) { getDataServiceProvider( ).afterTransaction( ); datasetName = oldDataSetName; } // Try to get report data set if ( datasetName == null ) { datasetName = getDataServiceProvider( ).getReportDataSet( ); } if ( datasetName != null ) { switchDataTable( ); } else { tablePreview.createDummyTable( ); } tablePreview.layout( ); } catch ( Throwable t ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.DATA_BINDING, t ); } DataDefinitionTextManager.getInstance( ).refreshAll( ); doLivePreview( ); } | 12803 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12803/f22856fad0fdeea0d938039071c0ce6da2b23e4f/TaskSelectData.java/buggy/chart/org.eclipse.birt.chart.ui.extension/src/org/eclipse/birt/chart/ui/swt/wizard/TaskSelectData.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
1620,
13676,
12,
514,
3709,
461,
262,
1216,
14804,
503,
202,
95,
202,
202,
430,
261,
4303,
16300,
12,
262,
18,
588,
3499,
13676,
12,
262,
480,
446,
9506,
202,
10,
10,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
1620,
13676,
12,
514,
3709,
461,
262,
1216,
14804,
503,
202,
95,
202,
202,
430,
261,
4303,
16300,
12,
262,
18,
588,
3499,
13676,
12,
262,
480,
446,
9506,
202,
10,
10,
... |
return latest_date_time != null; | return data_manager.latest_date_time() != null; | public boolean ready_for_request() { // latest_date_time != null iff send_data_request has // been successfully called. return latest_date_time != null; } | 13245 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13245/b391edecc87899db4a9099fc02028eb0e819ce15/Chart.java/buggy/src/clients/mas_gui/Chart.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1250,
5695,
67,
1884,
67,
2293,
1435,
288,
202,
202,
759,
4891,
67,
712,
67,
957,
480,
446,
21437,
1366,
67,
892,
67,
2293,
711,
202,
202,
759,
2118,
4985,
2566,
18,
202,
20... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1250,
5695,
67,
1884,
67,
2293,
1435,
288,
202,
202,
759,
4891,
67,
712,
67,
957,
480,
446,
21437,
1366,
67,
892,
67,
2293,
711,
202,
202,
759,
2118,
4985,
2566,
18,
202,
20... |
throw je; | state.setCurrentException(je); | public void execute(EvaluationState state, InstructionContext ctx) { // now used as an interpreter event JumpException je = new JumpException(JumpException.JumpType.RedoJump); je.setSecondaryData(ctx); throw je; } | 1060 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1060/ed5fe768829dd43ebf13861d9031b19571d6e898/EvaluateVisitor.java/buggy/src/org/jruby/evaluator/EvaluateVisitor.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1377,
202,
482,
918,
1836,
12,
13468,
1119,
919,
16,
24605,
1042,
1103,
13,
288,
5411,
368,
2037,
1399,
487,
392,
16048,
871,
5411,
804,
2801,
503,
30356,
273,
394,
804,
2801,
503,
12,
26743,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1377,
202,
482,
918,
1836,
12,
13468,
1119,
919,
16,
24605,
1042,
1103,
13,
288,
5411,
368,
2037,
1399,
487,
392,
16048,
871,
5411,
804,
2801,
503,
30356,
273,
394,
804,
2801,
503,
12,
26743,
... |
bWasCancelled = true; | bWasCancelled = false; | public void widgetSelected(SelectionEvent e) { if (e.getSource().equals(cbCyclic)) { gCurrent.setCyclic(cbCyclic.getSelection()); } else if (e.getSource().equals(btnAccept)) { bWasCancelled = true; shell.dispose(); } else if (e.getSource().equals(btnCancel)) { gCurrent = gBackup; shell.dispose(); } } | 12803 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12803/82edcc17a5f7fd43b8e0179a398bcd092111db6d/GradientEditorDialog.java/buggy/chart/org.eclipse.birt.chart.ui.extension/src/org/eclipse/birt/chart/ui/swt/composites/GradientEditorDialog.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
3604,
7416,
12,
6233,
1133,
425,
13,
565,
288,
3639,
309,
261,
73,
18,
588,
1830,
7675,
14963,
12,
7358,
17992,
18964,
3719,
3639,
288,
5411,
314,
3935,
18,
542,
17992,
18964,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
3604,
7416,
12,
6233,
1133,
425,
13,
565,
288,
3639,
309,
261,
73,
18,
588,
1830,
7675,
14963,
12,
7358,
17992,
18964,
3719,
3639,
288,
5411,
314,
3935,
18,
542,
17992,
18964,
... |
if (debug) System.out.println("calling OpenlabReader.initFile(" + id + ")"); | if (debug) debug("initFile(" + id + ")"); | protected void initFile(String id) throws FormatException, IOException { if (debug) System.out.println("calling OpenlabReader.initFile(" + id + ")"); super.initFile(id); in = new RandomAccessStream(getMappedId(id)); in.skipBytes(4); byte[] b = new byte[4]; in.read(b); String s = new String(b); if (!s.equals("impr")) throw new FormatException("Invalid LIFF file."); version = DataTools.read4SignedBytes(in, false); if (version != 2 && version != 5) { throw new FormatException("Invalid version : " + version); } // skip the layer count and ID seed in.skipBytes(4); // read offset to first plane int offset = DataTools.read4SignedBytes(in, false); in.seek(offset); layerInfoList = new Vector[2]; for (int i=0; i<layerInfoList.length; i++) layerInfoList[i] = new Vector(); xCal = yCal = zCal = (float) 0.0; // scan through the file, and read image information while (in.getFilePointer() < in.length()) { long nextTag, startPos; subTag = tag = 0; try { startPos = in.getFilePointer(); nextTag = readTagHeader(); } catch (Exception e) { if (in.getFilePointer() >= in.length()) break; else throw new FormatException(e.getMessage()); } try { if (tag == 67 || tag == 68 || fmt.equals("PICT") || fmt.equals("RAWi")) { LayerInfo info = new LayerInfo(); info.layerStart = (int) startPos; info.zPosition = -1; info.wavelength = -1; in.skipBytes(24); int volumeType = DataTools.read2SignedBytes(in, false); if (volumeType == MAC_1_BIT || volumeType == MAC_256_GREYS || volumeType == MAC_256_COLORS || (volumeType >= MAC_24_BIT && volumeType <= GREY_16_BIT)) { in.skipBytes(16); b = new byte[128]; in.read(b); info.layerName = new String(b); if (!info.layerName.trim().equals("Original Image")) { info.timestamp = DataTools.read8SignedBytes(in, false); layerInfoList[0].add(info); } } } else if (tag == 69) { in.skipBytes(4); int units = DataTools.read2SignedBytes(in, false); in.skipBytes(12); xCal = Float.intBitsToFloat(DataTools.read4SignedBytes(in, false)); yCal = Float.intBitsToFloat(DataTools.read4SignedBytes(in, false)); } else if (tag == 72 || fmt.equals("USER")) { char aChar = (char) in.read(); StringBuffer sb = new StringBuffer(); while (aChar != 0) { sb = sb.append(aChar); aChar = (char) in.read(); } String className = sb.toString(); if (className.equals("CVariableList")) { aChar = (char) in.read(); if (aChar == 1) { int numVars = DataTools.read2SignedBytes(in, false); while (numVars > 0) { aChar = (char) in.read(); sb = new StringBuffer(); while (aChar != 0) { sb = sb.append(aChar); aChar = (char) in.read(); } //in.read(); String varName = ""; String varStringValue = ""; double varNumValue = 0.0; className = sb.toString(); int derivedClassVersion = in.read(); if (derivedClassVersion != 1) { throw new FormatException("Invalid revision."); } if (className.equals("CStringVariable")) { int strSize = DataTools.read4SignedBytes(in, false); b = new byte[strSize]; in.read(b); varStringValue = new String(b); varNumValue = Float.parseFloat(varStringValue); in.skipBytes(1); } else if (className.equals("CFloatVariable")) { varNumValue = Double.longBitsToDouble( DataTools.read8SignedBytes(in, false)); varStringValue = "" + varNumValue; } int baseClassVersion = in.read(); if (baseClassVersion == 1 || baseClassVersion == 2) { int strSize = DataTools.read4SignedBytes(in, false); b = new byte[strSize]; in.read(b); varName = new String(b); in.skipBytes(baseClassVersion == 1 ? 3 : 2); } else { throw new FormatException("Invalid revision."); } metadata.put(varName, varStringValue); numVars--; } } } } in.seek(nextTag); } catch (Exception e) { in.seek(nextTag); } } Vector tmp = new Vector(); for (int i=0; i<layerInfoList[0].size(); i++) { tmp.add(layerInfoList[0].get(i)); } width = new int[1]; height = new int[1]; channelCount = new int[2]; numImages = new int[2]; numImages[0] = tmp.size(); // determine if we have a multi-series file int oldChannels = openBytes(id, 0).length / (width[0] * height[0] * 3); int oldWidth = width[0]; int oldSize = 0; for (int i=0; i<tmp.size(); i++) { LayerInfo layer = (LayerInfo) tmp.get(i); in.seek(layer.layerStart); long nextTag = readTagHeader(); if (fmt.equals("PICT")) { in.skipBytes(298); // check if this is really a PICT image in.skipBytes(8); int w = DataTools.read2SignedBytes(in, false); int newSize = (int) (nextTag - in.getFilePointer()); if ((w == oldWidth) && ((i % 4) == 3) && (newSize != oldSize)) { layerInfoList[1].add(tmp.get(i)); layerInfoList[0].remove(tmp.get(i)); } else oldSize = newSize; } else { in.skipBytes(24); int type = DataTools.read2SignedBytes(in, false); if (type == MAC_24_BIT) { layerInfoList[1].add(tmp.get(i)); layerInfoList[0].remove(tmp.get(i)); } } } if (layerInfoList[1].size() == 0 || layerInfoList[0].size() == 0) { channelCount = new int[1]; channelCount[0] = layerInfoList[1].size() == 0 ? 1 : 3; if (channelCount[0] == 1 && oldChannels == 1) channelCount[0] = 3; int oldImages = numImages[0]; numImages = new int[1]; numImages[0] = oldImages; } else { numImages[0] = layerInfoList[0].size(); numImages[1] = layerInfoList[1].size(); channelCount[0] = 1; channelCount[1] = 3; int oldW = width[0]; int oldH = height[0]; width = new int[2]; height = new int[2]; width[0] = oldW; width[1] = oldW; height[0] = oldH; height[1] = oldH; } numSeries = numImages.length; int[] bpp = new int[numSeries]; int oldSeries = getSeries(currentId); for (int i=0; i<bpp.length; i++) { setSeries(currentId, i); bpp[i] = openBytes(id, 0).length / (width[i] * height[i]); } setSeries(currentId, oldSeries); if (bytesPerPixel == 3) bytesPerPixel = 1; if (bytesPerPixel == 0) bytesPerPixel++; // finish populating metadata hashtable metadata.put("Version", new Integer(version)); metadata.put("Number of Series", new Integer(numSeries)); for (int i=0; i<numSeries; i++) { metadata.put("Width (Series " + i + ")", new Integer(width[i])); metadata.put("Height (Series " + i + ")", new Integer(height[i])); metadata.put("Bit depth (Series " + i + ")", new Integer(bpp[i] * 8)); metadata.put("Number of channels (Series " + i + ")", new Integer(channelCount[i])); metadata.put("Number of images (Series " + i + ")", new Integer(numImages[i])); } sizeX = width; sizeY = height; sizeZ = numImages; sizeC = channelCount; sizeT = new int[numSeries]; pixelType = new int[numSeries]; currentOrder = new String[numSeries]; orderCertain = new boolean[numSeries]; Arrays.fill(orderCertain, true); // populate MetadataStore MetadataStore store = getMetadataStore(id); for (int i=0; i<numSeries; i++) { sizeT[i] += 1; currentOrder[i] = isRGB(id) ? "XYCZT" : "XYZCT"; try { if (i != 0) { if (bpp[i] == bpp[0]) bpp[i] = bpp[i + 1]; } } catch (ArrayIndexOutOfBoundsException a) { } switch (bpp[i]) { case 1: pixelType[i] = FormatReader.INT8; break; case 2: pixelType[i] = FormatReader.UINT16; break; case 3: pixelType[i] = FormatReader.UINT8; break; case 4: pixelType[i] = FormatReader.INT32; break; case 6: pixelType[i] = FormatReader.INT16; break; } store.setImage("Series " + i, null, null, new Integer(i)); store.setPixels( new Integer(width[i]), new Integer(height[i]), new Integer(numImages[i]), new Integer(channelCount[i]), new Integer(1), new Integer(pixelType[i]), new Boolean(!isLittleEndian(id)), getDimensionOrder(id), new Integer(i)); store.setDimensions(new Float(xCal), new Float(yCal), new Float(zCal), null, null, new Integer(i)); } } | 11426 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11426/2c680a5618955854e02d652bc68024b9a011950a/OpenlabReader.java/clean/loci/formats/in/OpenlabReader.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
918,
1208,
812,
12,
780,
612,
13,
1216,
4077,
503,
16,
1860,
288,
565,
309,
261,
4148,
13,
1198,
2932,
2738,
812,
2932,
397,
612,
397,
7310,
1769,
565,
2240,
18,
2738,
812,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
918,
1208,
812,
12,
780,
612,
13,
1216,
4077,
503,
16,
1860,
288,
565,
309,
261,
4148,
13,
1198,
2932,
2738,
812,
2932,
397,
612,
397,
7310,
1769,
565,
2240,
18,
2738,
812,
12,
... |
new Parameter("java/lang/Object", "delegate")}; | new Parameter("java.lang.Object", "delegate")}; | protected ClassNode createClosureClass(ClosureExpression expression) { ClassNode owner = classNode; if (owner instanceof InnerClassNode) { owner = owner.getOuterClass(); } String outerClassName = owner.getName(); String name = outerClassName + "$" + context.getNextInnerClassIdx(); Parameter[] parameters = expression.getParameters(); InnerClassNode answer = new InnerClassNode(owner, name, ACC_PUBLIC, "groovy/lang/Closure"); answer.addMethod("doCall", ACC_PUBLIC, "java/lang/Object", parameters, expression.getCode()); FieldNode field = answer.addField("__outerInstance", ACC_PRIVATE, outerClassName, null); // lets make the constructor BlockStatement block = new BlockStatement(); block.addStatement( new ExpressionStatement( new MethodCallExpression( new VariableExpression("super"), "<init>", new VariableExpression("outerInstance")))); block.addStatement( new ExpressionStatement( new BinaryExpression( new FieldExpression(field), Token.equal(-1, -1), new VariableExpression("outerInstance")))); Parameter[] contructorParams = new Parameter[] { new Parameter(outerClassName, "outerInstance"), new Parameter("java/lang/Object", "delegate")}; answer.addConstructor(ACC_PUBLIC, contructorParams, block); return answer; } | 6462 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6462/764ab7a732a72c0585966fcbb62c2b30466738c9/ClassGenerator.java/clean/src/main/org/codehaus/groovy/classgen/ClassGenerator.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
19769,
752,
10573,
797,
12,
10573,
2300,
2652,
13,
288,
3639,
19769,
3410,
273,
25822,
31,
3639,
309,
261,
8443,
1276,
19494,
797,
907,
13,
288,
5411,
3410,
273,
3410,
18,
588,
1504... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
19769,
752,
10573,
797,
12,
10573,
2300,
2652,
13,
288,
3639,
19769,
3410,
273,
25822,
31,
3639,
309,
261,
8443,
1276,
19494,
797,
907,
13,
288,
5411,
3410,
273,
3410,
18,
588,
1504... |
return lex_p != lex_pend && c == lex_curline.charAt(lex_p); | return source.isNext((char) c); | private boolean peek(int c) { return lex_p != lex_pend && c == lex_curline.charAt(lex_p); } | 45298 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45298/d31a76ee29d5978a9bec41e3ac9134cee024bcab/DefaultRubyScanner.java/buggy/org/jruby/parser/DefaultRubyScanner.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
1250,
8032,
12,
474,
276,
13,
288,
540,
327,
1084,
18,
291,
2134,
12443,
3001,
13,
276,
1769,
565,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
1250,
8032,
12,
474,
276,
13,
288,
540,
327,
1084,
18,
291,
2134,
12443,
3001,
13,
276,
1769,
565,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
checkItem(items.item(0), title, author, pubDate, description, "http: | checkItem(items.item(0), title, author, pubDate, description, "http: | public void testOneNewPage() throws Exception { NodeList items = getReportedItems("|MyNewPage|me|" + date + "|"); assertEquals(1, items.getLength()); String title = "MyNewPage"; String author = "me"; String pubDate = rfcDate; String description = "me:" + rfcDate; checkItem(items.item(0), title, author, pubDate, description, "http://localhost/MyNewPage"); } | 53022 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53022/59b5c516aa1e48abf081d18257e2b7c16b352512/RssResponderTest.java/buggy/src/fitnesse/responders/RssResponderTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
3335,
1908,
1964,
1435,
1216,
1185,
565,
288,
3639,
16781,
1516,
273,
5561,
1798,
3126,
2932,
96,
12062,
1908,
1964,
96,
3501,
22317,
397,
1509,
397,
11747,
8863,
3639,
181... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
3335,
1908,
1964,
1435,
1216,
1185,
565,
288,
3639,
16781,
1516,
273,
5561,
1798,
3126,
2932,
96,
12062,
1908,
1964,
96,
3501,
22317,
397,
1509,
397,
11747,
8863,
3639,
181... |
public void cleanupPointers() { } | public void cleanupPointers() { } | public void cleanupPointers() { } //- implements VM_GCMapIterator | 49871 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49871/c9c261ed512532b69878bcdbbedd8afe69adc0b5/VM_JNIGCMapIterator.java/buggy/rvm/src/vm/arch/intel/jni/VM_JNIGCMapIterator.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
6686,
27452,
1435,
288,
225,
289,
368,
17,
4792,
8251,
67,
15396,
863,
3198,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
6686,
27452,
1435,
288,
225,
289,
368,
17,
4792,
8251,
67,
15396,
863,
3198,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
assertEquals("expected target 'MyBar.aj' but target " + link.getName(), "MyBar.aj",link.getName()); | assertEquals("expected target 'MyBar.class' but target " + link.getName(), "MyBar.class",link.getName()); | public void testAspectPathRelWhenNotFillingInModel_pr141730() { World.createInjarHierarchy = false; try { runTest("ensure aspectpath injar relationships are correct when not filling in model"); // expecting: // sourceOfRelationship main in MyFoo.java // relationship advised by // target MyBar.aj // // and // // sourceOfRelationship MyBar.aj // relationship advises // target main in MyFoo.java IHierarchy top = AsmManager.getDefault().getHierarchy(); IRelationshipMap asmRelMap = AsmManager.getDefault().getRelationshipMap(); assertEquals("expected two sources of relationships but only found " + asmRelMap.getEntries().size(),2,asmRelMap.getEntries().size()); for (Iterator iter = asmRelMap.getEntries().iterator(); iter.hasNext();) { String sourceOfRelationship = (String) iter.next(); IProgramElement ipe = top.findElementForHandle(sourceOfRelationship); List relationships = asmRelMap.get(ipe); if (ipe.getName().equals("MyBar.aj")) { assertEquals("expected MyBar.aj to have one relationships but found " + relationships.size(),1,relationships.size()); Relationship rel = (Relationship)relationships.get(0); assertEquals("expected relationship to be 'advises' but was " + rel.getName(), "advises", rel.getName()); List targets = rel.getTargets(); assertEquals("expected one target but found " + targets.size(),1,targets.size()); IProgramElement link = top.findElementForHandle((String)targets.get(0)); assertEquals("expected target 'method-call(void foo.MyFoo.main())' but target " + link.getName(), "method-call(void foo.MyFoo.main())",link.getName()); String fileName = link.getSourceLocation().getSourceFile().toString(); assertTrue("expected 'main' to be in class MyFoo.java but found it " + "in " + fileName,fileName.indexOf("MyFoo.java") != -1); } else if (ipe.getName().equals("method-call(void foo.MyFoo.main())")) { String fileName = ipe.getSourceLocation().getSourceFile().toString(); assertTrue("expected 'method-call(void foo.MyFoo.main())' to be in " + "class MyFoo.java but found it in" + fileName,fileName.indexOf("MyFoo.java") != -1); assertEquals("expected 'method-call(void foo.MyFoo.main())' " + "to have one relationships but found " + relationships.size(),1,relationships.size()); Relationship rel = (Relationship)relationships.get(0); assertEquals("expected relationship to be 'advised by' but was " + rel.getName(), "advised by", rel.getName()); List targets = rel.getTargets(); assertEquals("expected one target but found " + targets.size(),1,targets.size()); IProgramElement link = top.findElementForHandle((String)targets.get(0)); assertEquals("expected target 'MyBar.aj' but target " + link.getName(), "MyBar.aj",link.getName()); } else { fail("unexpected element " + ipe.getName() + " in the relationship map"); } } } finally { World.createInjarHierarchy = true; } } | 53148 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53148/9b03811333687b7a41baa1b9c9ff84344df86bbc/Ajc152Tests.java/clean/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
1842,
17468,
743,
1971,
9434,
1248,
42,
5789,
382,
1488,
67,
683,
3461,
4033,
5082,
1435,
288,
202,
225,
21820,
18,
2640,
382,
11930,
12074,
273,
629,
31,
202,
225,
775,
288,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
1842,
17468,
743,
1971,
9434,
1248,
42,
5789,
382,
1488,
67,
683,
3461,
4033,
5082,
1435,
288,
202,
225,
21820,
18,
2640,
382,
11930,
12074,
273,
629,
31,
202,
225,
775,
288,
... |
return (InetAddress)impl.getOption(SocketOptions.SO_BINDADDR); | return (InetAddress)impl.getOption(SocketOptions.SO_BINDADDR); | public InetAddress getLocalAddress() { // FIXME: JCL p. 510 says this should call checkConnect. But what // string should be used as the hostname? Maybe this is just a side // effect of calling InetAddress.getLocalHost. // // And is getOption with SO_BINDADDR the right way to get the address? // Doesn't seem to be since this method doesn't throw a SocketException // and SO_BINADDR can throw one. // // Also see RETURNS section in JCL p. 510 about returning any local // addr "if the current execution context is not allowed to connect to // the network interface that is actually bound to this datagram socket." // How is that done? via InetAddress.getLocalHost? But that throws // an UnknownHostException and this method doesn't. // // if (s != null) // s.checkConnect("localhost", -1); try { return (InetAddress)impl.getOption(SocketOptions.SO_BINDADDR); } catch (SocketException ex) { } try { return InetAddress.getLocalHost(); } catch (UnknownHostException ex) { // FIXME: This should never happen, so how can we avoid this construct? return null; } } | 56365 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56365/bcf934a726f09b909edaefea311bbb71e1745e81/DatagramSocket.java/buggy/libjava/java/net/DatagramSocket.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
14218,
6993,
1887,
1435,
225,
288,
565,
368,
9852,
30,
804,
5017,
293,
18,
1381,
2163,
20185,
333,
1410,
745,
866,
5215,
18,
225,
12484,
4121,
565,
368,
533,
1410,
506,
1399,
487,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
14218,
6993,
1887,
1435,
225,
288,
565,
368,
9852,
30,
804,
5017,
293,
18,
1381,
2163,
20185,
333,
1410,
745,
866,
5215,
18,
225,
12484,
4121,
565,
368,
533,
1410,
506,
1399,
487,
... |
expandViewer(filteredViewer, STORE_EXPANDED_CATEGORIES_ID); if (unfilteredViewer != null) expandViewer(unfilteredViewer, STORE_EXPANDED_CATEGORIES_ID); | boolean showAll = settings.getBoolean(SHOW_ALL_ENABLED); showAllCheck.setSelection(showAll); contentProvider.setFiltering(!showAll); String[] expandedCategoryPaths = settings.getArray(STORE_EXPANDED_CATEGORIES_ID); if (expandedCategoryPaths == null || expandedCategoryPaths.length == 0) return; List categoriesToExpand = new ArrayList(expandedCategoryPaths.length); for (int i = 0; i < expandedCategoryPaths.length; i++) { WizardCollectionElement category = wizardCategories.findChildCollection( new Path(expandedCategoryPaths[i])); if (category != null) categoriesToExpand.add(category); } if (!categoriesToExpand.isEmpty()) viewer.setExpandedElements(categoriesToExpand.toArray()); | protected void expandPreviouslyExpandedCategories() { expandViewer(filteredViewer, STORE_EXPANDED_CATEGORIES_ID); if (unfilteredViewer != null) expandViewer(unfilteredViewer, STORE_EXPANDED_CATEGORIES_ID); } | 56152 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56152/cdc590064230a8543dcd910f93596ce961da1d7e/NewWizardNewPage.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardNewPage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
918,
4542,
8351,
715,
17957,
10487,
1435,
288,
202,
202,
12320,
18415,
12,
12071,
18415,
16,
29656,
67,
16109,
1258,
7660,
67,
13000,
17562,
8805,
67,
734,
1769,
1082,
202,
430,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
918,
4542,
8351,
715,
17957,
10487,
1435,
288,
202,
202,
12320,
18415,
12,
12071,
18415,
16,
29656,
67,
16109,
1258,
7660,
67,
13000,
17562,
8805,
67,
734,
1769,
1082,
202,
430,
... |
node.nodeUpdater = new NodeUpdater(node , sc.getBoolean("autoupdate"), new FreenetURI(sc.getString("URI")), new FreenetURI(sc.getString("revocationURI"))); | node.nodeUpdater = new NodeUpdater(node , false, new FreenetURI(NodeUpdater.UPDATE_URI), new FreenetURI(NodeUpdater.REVOCATION_URI)); | public void set(boolean val) throws InvalidConfigValueException { synchronized (node) { if(val == get()) return; if(val){ try{ SubConfig sc = nodeConfig.get("node.updater"); if(node.nodeUpdater != null) node.nodeUpdater.kill(); node.nodeUpdater = new NodeUpdater(node , sc.getBoolean("autoupdate"), new FreenetURI(sc.getString("URI")), new FreenetURI(sc.getString("revocationURI"))); Logger.normal(this, "Starting up the node updater"); }catch (Exception e){ Logger.error(this, "unable to start the node updater up "+e); e.printStackTrace(); throw new InvalidConfigValueException("Unable to enable the Node Updater "+e); } }else{ node.nodeUpdater.kill(); Logger.normal(this, "Shutting down the node updater"); } } } | 50653 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50653/076b0867c113941335061363716c84e84918007c/UpdaterEnabledCallback.java/buggy/src/freenet/node/updater/UpdaterEnabledCallback.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
444,
12,
6494,
1244,
13,
1216,
1962,
809,
9738,
288,
202,
202,
22043,
261,
2159,
13,
288,
1082,
202,
430,
12,
1125,
422,
336,
10756,
327,
31,
1082,
202,
430,
12,
1125,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
444,
12,
6494,
1244,
13,
1216,
1962,
809,
9738,
288,
202,
202,
22043,
261,
2159,
13,
288,
1082,
202,
430,
12,
1125,
422,
336,
10756,
327,
31,
1082,
202,
430,
12,
1125,
... |
System.out.println("Got oid "+rs.getInt(1)); | public void displayImage(String name) { try { System.out.println("Selecting oid for "+name); ResultSet rs = stat.executeQuery("select imgoid from images where imgname='"+name+"'"); if(rs!=null) { // Even though there should only be one image, we still have to // cycle through the ResultSet while(rs.next()) { System.out.println("Got oid "+rs.getInt(1)); canvas.setImage(canvas.getToolkit().createImage(rs.getBytes(1))); System.out.println("Import complete"); label.setText(currentImage = name); } } rs.close(); } catch(SQLException ex) { label.setText(ex.toString()); } } | 45534 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45534/02faee5eaa0ed93364446f5c186fa6904899dca6/ImageViewer.java/clean/src/interfaces/jdbc/example/ImageViewer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
2562,
2040,
12,
780,
508,
13,
225,
288,
565,
775,
288,
1377,
2332,
18,
659,
18,
8222,
2932,
3391,
310,
7764,
364,
13773,
529,
1769,
1377,
10842,
3597,
273,
610,
18,
8837,
113... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
2562,
2040,
12,
780,
508,
13,
225,
288,
565,
775,
288,
1377,
2332,
18,
659,
18,
8222,
2932,
3391,
310,
7764,
364,
13773,
529,
1769,
1377,
10842,
3597,
273,
610,
18,
8837,
113... | |
ELTableTag.class, null, "setExport")); | ELTableTag.class, null, "setExport")); | public PropertyDescriptor[] getPropertyDescriptors() { List proplist = new ArrayList(); try { proplist.add(new PropertyDescriptor("cellpadding", //$NON-NLS-1$ ELTableTag.class, null, "setCellpadding")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("cellspacing", //$NON-NLS-1$ ELTableTag.class, null, "setCellspacing")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("class", //$NON-NLS-1$ ELTableTag.class, null, "setClass")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("decorator", //$NON-NLS-1$ ELTableTag.class, null, "setDecorator")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("defaultorder", //$NON-NLS-1$ ELTableTag.class, null, "setDefaultorder")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("defaultsort", //$NON-NLS-1$ ELTableTag.class, null, "setDefaultsort")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("export", //$NON-NLS-1$ ELTableTag.class, null, "setExport")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("frame", //$NON-NLS-1$ ELTableTag.class, null, "setFrame")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("length", //$NON-NLS-1$ ELTableTag.class, null, "setLength")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("name", //$NON-NLS-1$ ELTableTag.class, null, "setName")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("offset", //$NON-NLS-1$ ELTableTag.class, null, "setOffset")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("pagesize", //$NON-NLS-1$ ELTableTag.class, null, "setPagesize")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("partialList", //$NON-NLS-1$ ELTableTag.class, null, "setPartialList")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("requestURI", //$NON-NLS-1$ ELTableTag.class, null, "setRequestURI")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("requestURIcontext", //$NON-NLS-1$ ELTableTag.class, null, "setRequestURIcontext")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("rules", //$NON-NLS-1$ ELTableTag.class, null, "setRules")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("size", //$NON-NLS-1$ ELTableTag.class, null, "setSize")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("sort", //$NON-NLS-1$ ELTableTag.class, null, "setSort")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("style", //$NON-NLS-1$ ELTableTag.class, null, "setStyle")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("summary", //$NON-NLS-1$ ELTableTag.class, null, "setSummary")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("excludedParams", //$NON-NLS-1$ ELTableTag.class, null, "setExcludedParams")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("id", //$NON-NLS-1$ ELTableTag.class, null, "setUid")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("uid", //$NON-NLS-1$ ELTableTag.class, null, "setUid")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("htmlId", //$NON-NLS-1$ ELTableTag.class, null, "setHtmlId")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("varTotals", //$NON-NLS-1$ TableTag.class, null, "setVarTotals")); //$NON-NLS-1$ // deprecated attributes (not supporting expressions) proplist.add(new PropertyDescriptor("width", //$NON-NLS-1$ TableTag.class, null, "setWidth")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("styleClass", //$NON-NLS-1$ ELTableTag.class, null, "setClass")); //$NON-NLS-1$ } catch (IntrospectionException ex) { throw new RuntimeException("You got an introspection exception - maybe defining a property that is not" + " defined in the ElTableTag?: " + ex.getMessage(), ex); } PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()]; return ((PropertyDescriptor[]) proplist.toArray(result)); } | 10316 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/10316/a68c17afdfb7cb08fd50d001fb8260e045a3c5cd/ELTableTagBeanInfo.java/clean/displaytag/src/main/java/org/displaytag/tags/el/ELTableTagBeanInfo.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
26761,
8526,
3911,
12705,
1435,
565,
288,
3639,
987,
450,
17842,
273,
394,
2407,
5621,
3639,
775,
3639,
288,
5411,
450,
17842,
18,
1289,
12,
2704,
26761,
2932,
3855,
9598,
3113,
4329,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
26761,
8526,
3911,
12705,
1435,
565,
288,
3639,
987,
450,
17842,
273,
394,
2407,
5621,
3639,
775,
3639,
288,
5411,
450,
17842,
18,
1289,
12,
2704,
26761,
2932,
3855,
9598,
3113,
4329,... |
int pos = line.indexOf(BND); | int pos = line.indexOf(BND_STR); | public static String readAll(BufferedReader br, StringBuffer xml, StringBuffer acl, StringBuffer type) throws IOException { //For the Control of sintaxis String host = null; //boolean foundMime = false; boolean foundBoundary = false; boolean findContentType = false; String boundary = null; //String line = null; String typeConnection = null; //Reset the Buffers // NL: Not supported on PJava /* if(xml.length()>0) xml.delete(0,xml.length()); if(acl.length()>0) acl.delete(0,acl.length()); if(connection.length()>0) connection.delete(0,connection.length()); */ //try { String line; while(BLK.equals(line=br.readLine())); // skip empty lines if(line==null) throw new IOException(); StringTokenizer st = new StringTokenizer(line); try { if(!(st.nextToken()).equalsIgnoreCase(POST) ) { logger.log(Logger.WARNING,"Malformed POST"); type.append(CLOSE); return ERROR; } st.nextToken(); // Consumme a token if(!(st.nextToken().toUpperCase().startsWith("HTTP/1."))) { logger.log(Logger.WARNING,"Malformed HTTP/1.1 "); type.append(CLOSE); return ERROR; } } catch(NoSuchElementException nsee) { logger.log(Logger.WARNING,"Malformed start line !: "+line); type.append(CLOSE); return ERROR; } //Process rest of header while (!(line=br.readLine()).equals(BLK)) { if (line.startsWith(HOST)) { host = processLine(line); //De momento solo controlamos que este } /* // NL do not test MIME version for interoperability with other MTP if (line.toLowerCase().startsWith(MIME.toLowerCase())) { foundMime = true; } */ if (line.toLowerCase().startsWith(CONN.toLowerCase())) { typeConnection= processLine(line); } if (line.toLowerCase().startsWith(CONTENT.toLowerCase())) { //Process the left part if (!(processLine(line).toLowerCase().startsWith(MM))) { logger.log(Logger.WARNING,"MULTIPART/MIXED"); type.append(CLOSE); return ERROR; } //Process the right part int pos = line.indexOf(BND); if (pos == -1) { // Boundary on next line line=br.readLine(); if ((pos = line.indexOf(BND)) == -1) { // Bounday not found logger.log(Logger.WARNING,"MIME boundary not found"); type.append(CLOSE); return ERROR; } } line = line.substring(pos+BND.length()); pos = line.indexOf("\"")+1; boundary = DL+line.substring(pos,line.indexOf("\"",pos)); foundBoundary = true; } }//end while //if( !foundBoundary || !foundMime) { if(!foundBoundary) { logger.log(Logger.WARNING,"Mime header error"); type.append(CLOSE); return ERROR; } if (typeConnection == null) { type.append(KA); //Default Connection } else { type.append(typeConnection); //Connection of request } //jump to first "--Boundary" while((line=br.readLine()).equals(BLK)); // skip empty lines do { if (line.startsWith(boundary)) { break; } } while(!(line=br.readLine()).equals(BLK)); while((line=br.readLine()).equals(BLK)); // skip empty lines // Skip content-type do { if(line.toLowerCase().startsWith(CONTENT.toLowerCase())) { break; } } while(!(line=br.readLine()).equals(BLK)); //Capture the XML part //Capture the message envelope while(!(line=br.readLine()).equals(boundary)) { if (! line.equals(BLK)) { xml.append(line); } } //Capture the ACL part //JMP to ACLMessage while((line=br.readLine()).equals(BLK)); // skip empty lines // Skip content-type do { if(line.toLowerCase().startsWith(CONTENT.toLowerCase())) { break; } } while(!(line=br.readLine()).equals(BLK)); //Create last boundary for capture the ACLMessage boundary = boundary+DL; //Capture the acl part. // skip blank lines while((line=br.readLine()).equals(BLK)); // handle first line separately if (!line.equals(boundary)) { acl.append(line); } // then handle following lines and append a separator while(!(line=br.readLine()).equals(boundary)) { if (! line.equals(BLK)) { acl.append(" ").append(line); } } return OK; /* } catch(NullPointerException npe) { // readLine returns null <--> EOF System.out.println("null pointer in readAll"); //npe.printStackTrace(); type.append(CLOSE); return ERROR; } */ } | 5505 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5505/4596fdc09bf47df374e15fc0f9ef4b9837aa589d/HTTPIO.java/buggy/src/jade/mtp/http/HTTPIO.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
514,
31267,
12,
17947,
2514,
5186,
16,
6674,
2025,
16,
6674,
7895,
16,
6674,
618,
13,
377,
1216,
1860,
288,
3639,
368,
1290,
326,
8888,
434,
272,
474,
4890,
1377,
514,
225,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
514,
31267,
12,
17947,
2514,
5186,
16,
6674,
2025,
16,
6674,
7895,
16,
6674,
618,
13,
377,
1216,
1860,
288,
3639,
368,
1290,
326,
8888,
434,
272,
474,
4890,
1377,
514,
225,
1... |
return jjMoveStringLiteralDfa6_0(active0, 0x10000000000L); | return jjMoveStringLiteralDfa6_0(active0, 0x20000000000L); | private final int jjMoveStringLiteralDfa5_0(long old0, long active0){ if (((active0 &= old0)) == 0L) return jjStartNfa_0(3, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(4, active0); return 5; } switch(curChar) { case 100: return jjMoveStringLiteralDfa6_0(active0, 0x10000000000L); case 102: if ((active0 & 0x40000000000L) != 0L) return jjStartNfaWithStates_0(5, 42, 18); break; default : break; } return jjStartNfa_0(4, active0);} | 9291 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/9291/b827d0bf89e728dc8324fc63c2ad3662c9d19cd3/ParserTokenManager.java/buggy/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3238,
727,
509,
10684,
7607,
28565,
40,
507,
25,
67,
20,
12,
5748,
1592,
20,
16,
1525,
2695,
20,
15329,
282,
309,
261,
12443,
3535,
20,
12058,
1592,
20,
3719,
422,
374,
48,
13,
1377,
327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3238,
727,
509,
10684,
7607,
28565,
40,
507,
25,
67,
20,
12,
5748,
1592,
20,
16,
1525,
2695,
20,
15329,
282,
309,
261,
12443,
3535,
20,
12058,
1592,
20,
3719,
422,
374,
48,
13,
1377,
327,
... |
logger.severe(ZoneTableFields.AREATYPE + | logger.fatal(ZoneTableFields.AREATYPE + | private void getZoneRelatedData(TableDataSet zoneTable) { int k; int parkRateFieldPosition = zoneTable.getColumnPosition(ZoneTableFields.PARKRATE); if (parkRateFieldPosition <= 0) { logger.severe(ZoneTableFields.PARKRATE + " was not a field in the zoneData TableDataSet."); System.exit(1); } parkRate = new float[zoneTable.getRowCount() + 1]; for (int i = 1; i <= zoneTable.getRowCount(); i++) parkRate[i] = zoneTable.getValueAt(i, parkRateFieldPosition); int urbtypeFieldPosition = zoneTable.getColumnPosition(ZoneTableFields.URBTYPE); if (urbtypeFieldPosition <= 0) { logger.severe(ZoneTableFields.URBTYPE + " was not a field in the zoneData TableDataSet."); System.exit(1); } k = 1; float uType; urbType = new float[(3 * zoneTable.getRowCount()) + 1]; for (int i = 1; i <= zoneTable.getRowCount(); i++) { uType = zoneTable.getValueAt(i, urbtypeFieldPosition); for (int j = 1; j <= 3; j++) { urbType[k] = uType; k++; } } int cbdatypeFieldPosition = zoneTable.getColumnPosition(ZoneTableFields.CBDATYPE); if (cbdatypeFieldPosition <= 0) { logger.severe(ZoneTableFields.CBDATYPE + " was not a field in the zoneData TableDataSet."); System.exit(1); } k = 1; float aType; cbdatype = new float[(3 * zoneTable.getRowCount()) + 1]; for (int i = 1; i <= zoneTable.getRowCount(); i++) { aType = zoneTable.getValueAt(i, cbdatypeFieldPosition); for (int j = 1; j <= 3; j++) { cbdatype[k] = aType; k++; } } int parktotFieldPosition = zoneTable.getColumnPosition(ZoneTableFields.PARKTOT); if (parktotFieldPosition <= 0) { logger.severe(ZoneTableFields.PARKTOT + " was not a field in the zoneData TableDataSet."); System.exit(1); } k = 1; float ptot; parktot = new float[(3 * zoneTable.getRowCount()) + 1]; for (int i = 1; i <= zoneTable.getRowCount(); i++) { ptot = zoneTable.getValueAt(i, parktotFieldPosition); for (int j = 1; j <= 3; j++) { parktot[k] = ptot; k++; } } int parklngFieldPosition = zoneTable.getColumnPosition(ZoneTableFields.PARKLNG); if (parklngFieldPosition <= 0) { logger.severe(ZoneTableFields.PARKLNG + " was not a field in the zoneData TableDataSet."); System.exit(1); } k = 1; float plng; parklng = new float[(3 * zoneTable.getRowCount()) + 1]; for (int i = 1; i <= zoneTable.getRowCount(); i++) { plng = zoneTable.getValueAt(i, parklngFieldPosition); for (int j = 1; j <= 3; j++) { parklng[k] = plng; k++; } } int propfreeFieldPosition = zoneTable.getColumnPosition(ZoneTableFields.PROPFREE); if (propfreeFieldPosition <= 0) { logger.severe(ZoneTableFields.PROPFREE + " was not a field in the zoneData TableDataSet."); System.exit(1); } k = 1; float pfree; propfree = new float[(3 * zoneTable.getRowCount()) + 1]; for (int i = 1; i <= zoneTable.getRowCount(); i++) { pfree = zoneTable.getValueAt(i, propfreeFieldPosition); for (int j = 1; j <= 3; j++) { propfree[k] = pfree; k++; } } int parkrateFieldPosition = zoneTable.getColumnPosition(ZoneTableFields.PARKRATE); if (parkrateFieldPosition <= 0) { logger.severe(ZoneTableFields.PARKRATE + " was not a field in the zoneData TableDataSet."); System.exit(1); } k = 1; float prate; parkrate = new float[(3 * zoneTable.getRowCount()) + 1]; for (int i = 1; i <= zoneTable.getRowCount(); i++) { prate = zoneTable.getValueAt(i, parkrateFieldPosition); for (int j = 1; j <= 3; j++) { parkrate[k] = prate; k++; } } int areatypeFieldPosition = zoneTable.getColumnPosition(ZoneTableFields.AREATYPE); if (areatypeFieldPosition <= 0) { logger.severe(ZoneTableFields.AREATYPE + " was not a field in the zoneData TableDataSet."); System.exit(1); } zonalAreaType = new float[zoneTable.getRowCount() + 1]; for (int i = 1; i <= zoneTable.getRowCount(); i++) { zonalAreaType[i] = zoneTable.getValueAt(i, areatypeFieldPosition); } int nonw_au_op_FieldPosition = zoneTable.getColumnPosition(ZoneTableFields.NONWORKAUOP); if (nonw_au_op_FieldPosition <= 0) { logger.severe(ZoneTableFields.NONWORKAUOP + " was not a field in the zoneData TableDataSet."); System.exit(1); } zonal_nonw_au_op = new float[zoneTable.getRowCount() + 1]; for (int i = 1; i <= zoneTable.getRowCount(); i++) { zonal_nonw_au_op[i] = zoneTable.getValueAt(i, nonw_au_op_FieldPosition); } int zonal_nonw_walk_FieldPosition = zoneTable.getColumnPosition(ZoneTableFields.NONWORKWALK); if (zonal_nonw_walk_FieldPosition <= 0) { logger.severe(ZoneTableFields.NONWORKWALK + " was not a field in the zoneData TableDataSet."); System.exit(1); } zonal_nonw_walk = new float[zoneTable.getRowCount() + 1]; for (int i = 1; i <= zoneTable.getRowCount(); i++) { zonal_nonw_walk[i] = zoneTable.getValueAt(i, zonal_nonw_walk_FieldPosition); } int countyFieldPosition = zoneTable.getColumnPosition(ZoneTableFields.COUNTY); if (countyFieldPosition <= 0) { logger.severe(ZoneTableFields.COUNTY + " was not a field in the zoneData TableDataSet."); System.exit(1); } k = 1; float co; cnty = new float[(3 * zoneTable.getRowCount()) + 1]; for (int i = 1; i <= zoneTable.getRowCount(); i++) { co = zoneTable.getValueAt(i, countyFieldPosition); for (int j = 1; j <= 3; j++) { cnty[k] = co; k++; } } int ringsPosition = zoneTable.getColumnPosition(ZoneTableFields.RINGS); if (ringsPosition <= 0) { logger.severe(ZoneTableFields.RINGS + " was not a field in the zoneData TableDataSet."); System.exit(1); } k = 1; float r; rings = new float[(3 * zoneTable.getRowCount()) + 1]; for (int i = 1; i <= zoneTable.getRowCount(); i++) { r = zoneTable.getValueAt(i, ringsPosition); for (int j = 1; j <= 3; j++) { rings[k] = r; k++; } } int suprdistPosition = zoneTable.getColumnPosition(ZoneTableFields.SUPRDIST); if (suprdistPosition <= 0) { logger.severe(ZoneTableFields.SUPRDIST + " was not a field in the zoneData TableDataSet."); System.exit(1); } k = 1; float sup; suprdist = new float[(3 * zoneTable.getRowCount()) + 1]; for (int i = 1; i <= zoneTable.getRowCount(); i++) { sup = zoneTable.getValueAt(i, suprdistPosition); for (int j = 1; j <= 3; j++) { suprdist[k] = sup; k++; } } int schdistFieldPosition = zoneTable.getColumnPosition(ZoneTableFields.SCHDIST); if (schdistFieldPosition <= 0) { logger.severe(ZoneTableFields.SCHDIST + " was not a field in the zoneData TableDataSet."); System.exit(1); } k = 1; float sd; schdist = new float[(3 * zoneTable.getRowCount()) + 1]; for (int i = 1; i <= zoneTable.getRowCount(); i++) { sd = zoneTable.getValueAt(i, schdistFieldPosition); for (int j = 1; j <= 3; j++) { schdist[k] = sd; k++; } } // get file names from properties file String walkAccessFile = (String) propertyMap.get("WalkAccess.file"); int taz; float waShrt; float waLong; float[] shrtArray = new float[zoneTable.getRowCount() + 1]; float[] longArray = new float[zoneTable.getRowCount() + 1]; walkPctArray = new float[3][zoneTable.getRowCount() + 1]; Arrays.fill(walkPctArray[0], 1.0f); Arrays.fill(walkPctArray[1], 0.0f); Arrays.fill(walkPctArray[2], 0.0f); if (walkAccessFile != null) { try { CSVFileReader reader = new CSVFileReader(); reader.setDelimSet( " ,\t\n\r\f\""); TableDataSet wa = reader.readFile(new File(walkAccessFile)); int tazPosition = wa.getColumnPosition("TAZ"); if (tazPosition <= 0) { logger.severe( "TAZ was not a field in the walk access TableDataSet built from " + walkAccessFile + "."); System.exit(1); } int shrtPosition = wa.getColumnPosition("SHRT"); if (shrtPosition <= 0) { logger.severe( "SHRT was not a field in the walk access TableDataSet built from " + walkAccessFile + "."); System.exit(1); } int longPosition = wa.getColumnPosition("LONG"); if (longPosition <= 0) { logger.severe( "LONG was not a field in the walk access TableDataSet built from " + walkAccessFile + "."); System.exit(1); } for (int j = 1; j <= wa.getRowCount(); j++) { taz = (int) wa.getValueAt(j, tazPosition); shrtArray[taz] = wa.getValueAt(j, shrtPosition); longArray[taz] = wa.getValueAt(j, longPosition); walkPctArray[1][taz] = shrtArray[taz]; walkPctArray[2][taz] = longArray[taz]; walkPctArray[0][taz] = (float) (1.0 - (shrtArray[taz] + longArray[taz])); } } catch (IOException e) { e.printStackTrace(); System.exit(1); } } else { logger.severe( "no walk access zonal data file was named in properties file."); System.exit(1); } // set 0/1 values for zone doesn't/does have short walk access for all dc alternatives k = 1; zonalShortAccess = new float[(3 * zoneTable.getRowCount()) + 1]; for (int i = 1; i <= zoneTable.getRowCount(); i++) { for (int j = 1; j <= 3; j++) { zonalShortAccess[k] = (shrtArray[i] > 0.0) ? 1 : 0; k++; } } // calculate attractions for use in size variable calculations calculateAttractions(zoneTable); } | 1120 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1120/ca343a527cdff81450c6dae2017cdd7596546cc4/ZonalDataManager.java/clean/src/java/com/pb/morpc/models/ZonalDataManager.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
30680,
8017,
751,
12,
1388,
13676,
4157,
1388,
13,
288,
3639,
509,
417,
31,
3639,
509,
779,
79,
4727,
974,
2555,
273,
4157,
1388,
18,
588,
1494,
2555,
12,
4226,
1388,
2314,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
30680,
8017,
751,
12,
1388,
13676,
4157,
1388,
13,
288,
3639,
509,
417,
31,
3639,
509,
779,
79,
4727,
974,
2555,
273,
4157,
1388,
18,
588,
1494,
2555,
12,
4226,
1388,
2314,
1... |
if (txt == null) result = false; | protected boolean checkState() { boolean result = false; if (emptyStringAllowed) result = true; if (textField == null) result = false; String txt = textField.getText(); if (txt == null) result = false; result = (txt.trim().length() > 0) || emptyStringAllowed; // call hook for subclasses result = result && doCheckState(); if (result) clearErrorMessage(); else showErrorMessage(errorMessage); return result; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/27496bae6c5eef81cce6920f43a9bed7f85f2ac8/StringFieldEditor.java/clean/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/StringFieldEditor.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
1250,
13632,
1435,
288,
3639,
1250,
563,
273,
629,
31,
3639,
309,
261,
5531,
780,
5042,
13,
5411,
563,
273,
638,
31,
3639,
309,
261,
955,
974,
422,
446,
13,
5411,
563,
273,
629,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
1250,
13632,
1435,
288,
3639,
1250,
563,
273,
629,
31,
3639,
309,
261,
5531,
780,
5042,
13,
5411,
563,
273,
638,
31,
3639,
309,
261,
955,
974,
422,
446,
13,
5411,
563,
273,
629,
... | |
if (e == -1) { if (decimal == chars.length - 2 && chars[chars.length-1] == '0') { return new String(chars, 0, chars.length - 2); | if (base != 10) { /* Monkey see, Rhino do */ if (d < 0) return "-" + Long.toString( ((long)-d) & 0xFFFFFFFFL, base); else return Long.toString( ((long)d) & 0xFFFFFFFFL, base); } else { final int MIN_NO_EXP = -6; final int MAX_NO_EXP = 20; String s = Double.toString(d); char[] chars = s.toCharArray(); int decimal = -1; int e = -1; boolean negative = false; boolean negativeExponent = false; for (int i=0; i < chars.length; i++) { switch (chars[i]) { case '-': if (e == -1) negative = true; else negativeExponent = true; break; case '.': decimal = i; break; case 'E': e = i; break; } | public static String numberToString(double d) { if (d != d) return "NaN"; if (d == Double.POSITIVE_INFINITY) return "Infinity"; if (d == Double.NEGATIVE_INFINITY) return "-Infinity"; if (d == 0.0) return "0"; // Okay, this is gross. But Java doesn't seem to have any number // formatting routines exposed. // So we let Java format it and then selectively reformat it using // string operations to get the appropriate bounds on exponential // representation as well as little things like case of 'e' and // always including the sign of the exponent. // OPT: format from the floating point number directly. final int MIN_NO_EXP = -6; final int MAX_NO_EXP = 20; String s = Double.toString(d); char[] chars = s.toCharArray(); int decimal = -1; int e = -1; boolean negative = false; boolean negativeExponent = false; for (int i=0; i < chars.length; i++) { switch (chars[i]) { case '-': if (e == -1) negative = true; else negativeExponent = true; break; case '.': decimal = i; break; case 'E': e = i; break; } } if (e == -1) { if (decimal == chars.length - 2 && chars[chars.length-1] == '0') { // Format 1.0 as "1", not "1.0" return new String(chars, 0, chars.length - 2); } return s; } int exponent = Integer.parseInt(new String(chars, e+1, chars.length - e - 1)); StringBuffer sb = new StringBuffer(); boolean singleDigit = decimal + 2 == e && chars[decimal+1] == '0'; if (exponent < MIN_NO_EXP || exponent > MAX_NO_EXP) { int len = singleDigit ? 1 : e; if (negative) { sb.append('-'); sb.append(chars, 1, len); } else { sb.append(chars, 0, len); } sb.append('e'); sb.append(exponent < 0 ? '-' : '+'); int expStart = e + (exponent < 0 ? 2 : 1); sb.append(chars, expStart, chars.length - expStart); return sb.toString(); } if (negative) sb.append('-'); if (exponent < 0) { sb.append("0."); for (int i=exponent+1; i < 0; i++) sb.append('0'); } sb.append(chars[decimal - 1]); int fractionalLength = 0; if (!singleDigit) { fractionalLength = e - decimal - 1; if (exponent > 0 && exponent < fractionalLength) { sb.append(chars, decimal + 1, exponent); sb.append('.'); sb.append(chars, decimal + exponent + 1, fractionalLength - exponent); } else { sb.append(chars, decimal + 1, fractionalLength); } } if (exponent > 0) { for (int i = fractionalLength; i < exponent; i++) sb.append('0'); } return sb.toString(); } | 7555 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7555/4bf675b98aeb91f7b1aa93aa6af7bc7944745bed/ScriptRuntime.java/clean/js/rhino/org/mozilla/javascript/ScriptRuntime.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
514,
1300,
5808,
12,
9056,
302,
13,
288,
3639,
309,
261,
72,
480,
302,
13,
5411,
327,
315,
21172,
14432,
3639,
309,
261,
72,
422,
3698,
18,
7057,
16325,
67,
17716,
13,
5411,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
514,
1300,
5808,
12,
9056,
302,
13,
288,
3639,
309,
261,
72,
480,
302,
13,
5411,
327,
315,
21172,
14432,
3639,
309,
261,
72,
422,
3698,
18,
7057,
16325,
67,
17716,
13,
5411,
... |
String actualPage = hrq.getContextPath() + JSPManager.getLocalJSP(page); | String actualPage = hrq.getContextPath() + page; | public int doAfterBody() throws JspException { /* * The output is the following, with PAGE and TEXT replaced appropriately: * * <SCRIPT TYPE="text/javascript"> * <!-- * document.write('<A HREF="#" onClick="var popupwin = window.open(\'PAGE\',\'dspacepopup\',\'height=600,width=550,resizable,scrollbars\');popupwin.focus();return false;">TEXT<\/a>'); * // --> * </SCRIPT> * <NOSCRIPT> * <a href="PAGE" target="dspacepopup">TEXT</a>. * </NOSCRIPT> * * The script writes a Javascripted link which opens the popup window 600x550, * or brings it to the front if it's already open. If Javascript is not * available, plain HTML link in the NOSCRIPT element is used. */ BodyContent bc = getBodyContent(); String linkText = bc.getString(); bc.clearBody(); HttpServletRequest hrq = (HttpServletRequest) pageContext.getRequest(); String actualPage = hrq.getContextPath() + JSPManager.getLocalJSP(page); String html = "<SCRIPT TYPE=\"text/javascript\">\n" + "<!-- Javascript starts here\n" + "document.write('<A HREF=\"#\" onClick=\"var popupwin = window.open(\\'" + actualPage + "\\',\\'dspacepopup\\',\\'height=600,width=550,resizable,scrollbars\\');popupwin.focus();return false;\">" + linkText + "<\\/a>');\n" + "// -->\n" + "</SCRIPT><NOSCRIPT><A HREF=\"" + actualPage + "\" TARGET=\"dspacepopup\">" + linkText + "</A></NOSCRIPT>"; try { getPreviousOut().print(html); } catch (IOException ie) { throw new JspException(ie); } return SKIP_BODY; } | 25205 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/25205/1b48943aebc5bc04c66710438589dc0210ba2eee/PopupTag.java/clean/dspace/src/org/dspace/app/webui/jsptag/PopupTag.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
509,
741,
4436,
2250,
1435,
3639,
1216,
27485,
565,
288,
3639,
1748,
540,
380,
1021,
876,
353,
326,
3751,
16,
598,
11549,
471,
9204,
8089,
21419,
30,
540,
380,
1850,
380,
411,
10885... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
509,
741,
4436,
2250,
1435,
3639,
1216,
27485,
565,
288,
3639,
1748,
540,
380,
1021,
876,
353,
326,
3751,
16,
598,
11549,
471,
9204,
8089,
21419,
30,
540,
380,
1850,
380,
411,
10885... |
} catch ( Exception except ) { } | } catch ( Exception except ) { } | private static void initialize() { InputStream is = null; BufferedReader reader = null; int index; String name; String value; int code; String line; // Make sure not to initialize twice. if ( _byName != null ) return; try { _byName = new Hashtable(); _byChar = new Hashtable(); is = HTMLdtd.class.getResourceAsStream( ENTITIES_RESOURCE ); if ( is == null ) throw new RuntimeException( "SER003 The resource [" + ENTITIES_RESOURCE + "] could not be found.\n" + ENTITIES_RESOURCE); reader = new BufferedReader( new InputStreamReader( is ) ); line = reader.readLine(); while ( line != null ) { if ( line.length() == 0 || line.charAt( 0 ) == '#' ) { line = reader.readLine(); continue; } index = line.indexOf( ' ' ); if ( index > 1 ) { name = line.substring( 0, index ); ++index; if ( index < line.length() ) { value = line.substring( index ); index = value.indexOf( ' ' ); if ( index > 0 ) value = value.substring( 0, index ); code = Integer.parseInt( value ); defineEntity( name, (char) code ); } } line = reader.readLine(); } is.close(); } catch ( Exception except ) { throw new RuntimeException( "SER003 The resource [" + ENTITIES_RESOURCE + "] could not load: " + except.toString() + "\n" + ENTITIES_RESOURCE + "\t" + except.toString()); } finally { if ( is != null ) { try { is.close(); } catch ( Exception except ) { } } } } | 1831 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1831/af047e33ee4283cd437ffa6760ccff3d3d2bf9ea/HTMLdtd.java/clean/src/org/apache/xml/serialize/HTMLdtd.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
760,
918,
4046,
1435,
565,
288,
3639,
5037,
377,
353,
273,
446,
31,
3639,
10633,
225,
2949,
273,
446,
31,
3639,
509,
2398,
770,
31,
3639,
514,
1850,
508,
31,
3639,
514,
1850,
460,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
760,
918,
4046,
1435,
565,
288,
3639,
5037,
377,
353,
273,
446,
31,
3639,
10633,
225,
2949,
273,
446,
31,
3639,
509,
2398,
770,
31,
3639,
514,
1850,
508,
31,
3639,
514,
1850,
460,... |
{ close(); } | { close(); } | public void finalize() throws Throwable { close(); } | 49504 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49504/e25c93c7eb4a9a1a50b771cc33448b9d3519f403/Connection.java/buggy/src/interfaces/jdbc/org/postgresql/Connection.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
12409,
1435,
1216,
4206,
202,
95,
202,
202,
4412,
5621,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
12409,
1435,
1216,
4206,
202,
95,
202,
202,
4412,
5621,
202,
97,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
displayFilters(filters); | if (!filterCombo.isDisposed()) { displayFilters(filters); } | protected IStatus run(final IProgressMonitor monitor) { try { JiraServer jiraServer = JiraServerFacade.getDefault().getJiraServer(repository); filters = jiraServer.getNamedFilters(); monitor.worked(1); monitor.done(); Display.getDefault().asyncExec(new Runnable() { public void run() { displayFilters(filters); } }); } catch (Exception e) { JiraServerFacade.handleConnectionException(e); return Status.CANCEL_STATUS; } return Status.OK_STATUS; } | 51151 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51151/2f4cf6dc42a5f81233995947bdd83d03e000192d/JiraQueryWizardPage.java/clean/org.eclipse.mylyn.jira.ui/src/org/eclipse/mylyn/internal/jira/ui/wizards/JiraQueryWizardPage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1875,
202,
1117,
467,
1482,
1086,
12,
6385,
467,
5491,
7187,
6438,
13,
288,
9506,
202,
698,
288,
6862,
202,
46,
11547,
2081,
525,
11547,
2081,
273,
804,
11547,
2081,
12467,
18,
588,
1868,
7675... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1875,
202,
1117,
467,
1482,
1086,
12,
6385,
467,
5491,
7187,
6438,
13,
288,
9506,
202,
698,
288,
6862,
202,
46,
11547,
2081,
525,
11547,
2081,
273,
804,
11547,
2081,
12467,
18,
588,
1868,
7675... |
IResource currentResource = getCurrentResource(); if (currentResource == null || !currentResource.exists()) { | IResource currentResource = getCurrentResource(); if (currentResource == null || !currentResource.exists()) { | protected boolean updateSelection(IStructuredSelection selection) { disposeTextWidget(); if (selection.size() > 1) { return false; } if (!super.updateSelection(selection)) { return false; } IResource currentResource = getCurrentResource(); if (currentResource == null || !currentResource.exists()) { return false; } return true; } | 55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/53cada7d6d0463cdcb3aed320ea380f4aae64087/RenameResourceAction.java/clean/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/RenameResourceAction.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
1250,
1089,
6233,
12,
45,
30733,
6233,
4421,
13,
288,
3639,
15825,
1528,
4609,
5621,
3639,
309,
261,
10705,
18,
1467,
1435,
405,
404,
13,
288,
1082,
202,
2463,
629,
31,
202,
202,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
1250,
1089,
6233,
12,
45,
30733,
6233,
4421,
13,
288,
3639,
15825,
1528,
4609,
5621,
3639,
309,
261,
10705,
18,
1467,
1435,
405,
404,
13,
288,
1082,
202,
2463,
629,
31,
202,
202,
... |
public short getPC() | short getPC() | public short getPC() { return itsPC; } | 13991 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13991/59fedca6b17819e313ac22545d4a0c523cfdf08c/Label.java/buggy/js/rhino/src/org/mozilla/javascript/Label.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3025,
1689,
39,
1435,
565,
288,
3639,
327,
2097,
3513,
31,
565,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3025,
1689,
39,
1435,
565,
288,
3639,
327,
2097,
3513,
31,
565,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
{ lexicalHandler.endCDATA (); } | { lexicalHandler.endCDATA(); } | void endCDATA () throws SAXException { lexicalHandler.endCDATA (); } | 13625 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13625/7fb7568e63c3fe14af521de4699cb37898923ca7/SAXDriver.java/buggy/libjava/gnu/xml/aelfred2/SAXDriver.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
918,
679,
18375,
1832,
565,
1216,
14366,
565,
288,
202,
4149,
1706,
1503,
18,
409,
18375,
261,
1769,
565,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
918,
679,
18375,
1832,
565,
1216,
14366,
565,
288,
202,
4149,
1706,
1503,
18,
409,
18375,
261,
1769,
565,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
(os.startsWith("sunos") && cpu.equals("x86"))|| (os.startsWith("mac os") && cpu.equals("ppc")) | (os.startsWith("sunos") && cpu.equals("x86")) || (os.startsWith("mac os") && cpu.equals("ppc")) || (os.startsWith("freebsd") && cpu.equals("i386")) | public static StructLayout createForCurrentPlatform() { String os = System.getProperty("os.name").toLowerCase(); String cpu = System.getProperty("os.arch").toLowerCase(); if ((os.startsWith("windows") && cpu.equals("x86")) || (os.startsWith("linux") && cpu.equals("i386")) || (os.startsWith("linux") && cpu.equals("amd64")) || (os.startsWith("sunos") && cpu.equals("sparc")) || (os.startsWith("sunos") && cpu.equals("x86"))|| (os.startsWith("mac os") && cpu.equals("ppc")) ) { // FIXME: make struct alignment configurable? May need to change // packing rules on a per-type basis? return new StructLayout(0, 8); } else { // FIXME: add more ports throw new RuntimeException("Please port StructLayout to your OS (" + os + ") and CPU (" + cpu + ")"); } } | 46690 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46690/b4396b83e120bf2defc5598ba95fe02992805b3f/StructLayout.java/clean/src/net/java/games/gluegen/StructLayout.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
7362,
3744,
752,
1290,
3935,
8201,
1435,
288,
565,
514,
1140,
273,
2332,
18,
588,
1396,
2932,
538,
18,
529,
20387,
869,
5630,
5621,
565,
514,
8326,
273,
2332,
18,
588,
1396,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
7362,
3744,
752,
1290,
3935,
8201,
1435,
288,
565,
514,
1140,
273,
2332,
18,
588,
1396,
2932,
538,
18,
529,
20387,
869,
5630,
5621,
565,
514,
8326,
273,
2332,
18,
588,
1396,
... |
for (int i = 0; i < STANDARD_POLICY_DATABASE.length; ++i) { String[] tuple = STANDARD_POLICY_DATABASE[i]; | for (String[] tuple : STANDARD_POLICY_DATABASE) { | static PolicyDatabase getDatabase() { PolicyDatabase database = policyDatabaseLocal.get(); if (database == null) { database = new PolicyDatabase(); for (int i = 0; i < STANDARD_POLICY_DATABASE.length; ++i) { String[] tuple = STANDARD_POLICY_DATABASE[i]; database.add(new PolicyDatabaseEntry(tuple[0], tuple[1], tuple[2])); } // TODO: should add policies set by @CheckReturnValue annotations policyDatabaseLocal.set(database); } return database; } | 10715 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/10715/0a90d09d10d1b86a115beba3e78b25e18a12d9c9/MethodReturnCheck.java/buggy/findbugs/src/java/edu/umd/cs/findbugs/detect/MethodReturnCheck.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
3845,
7436,
4254,
11263,
1435,
288,
202,
202,
2582,
4254,
2063,
273,
3329,
4254,
2042,
18,
588,
5621,
202,
202,
430,
261,
6231,
422,
446,
13,
288,
1082,
202,
6231,
273,
394,
7436,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
3845,
7436,
4254,
11263,
1435,
288,
202,
202,
2582,
4254,
2063,
273,
3329,
4254,
2042,
18,
588,
5621,
202,
202,
430,
261,
6231,
422,
446,
13,
288,
1082,
202,
6231,
273,
394,
7436,
... |
Object data[]; ArrayList list; | Object[] data; java.util.AbstractList list; | protected HashMap constructSystemDict() { HashMap systemDict = new HashMap(); // newpath systemDict.put("newpath", new PACommand() { public void execute(PAContext context) throws PainterException {// if(DebugExecution)System.out.println(""); context.pencil.newpath(); } }); // moveto systemDict.put("moveto", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(2); context.pencil.moveto(data[0], data[1]); } }); // rmoveto systemDict.put("rmoveto", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(2); context.pencil.rmoveto(data[0], data[1]); } }); // lineto systemDict.put("lineto", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(2); context.pencil.lineto(data[0], data[1]); } }); // rlineto systemDict.put("rlineto", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(2); context.pencil.rlineto(data[0], data[1]); } }); // arc systemDict.put("arc", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(5); context.pencil.arc(data[0], data[1], data[2], data[3], data[4]); } }); // arcn systemDict.put("arcn", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(5); context.pencil.arcn(data[0], data[1], data[2], data[3], data[4]); } }); // curveto systemDict.put("curveto", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(6); context.pencil.curveto(data[0], data[1], data[2], data[3], data[4], data[5]); } }); // rcurveto systemDict.put("rcurveto", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(6); context.pencil.rcurveto(data[0], data[1], data[2], data[3], data[4], data[5]); } }); // closepath systemDict.put("closepath", new PACommand() { public void execute(PAContext context) throws PainterException { context.pencil.closepath(); } }); // gsave systemDict.put("gsave", new PACommand() { public void execute(PAContext context) throws PainterException { context.pencil.gsave(); } }); // grestore systemDict.put("grestore", new PACommand() { public void execute(PAContext context) throws PainterException { context.pencil.grestore(); } }); // translate systemDict.put("translate", new PACommand() { public void execute(PAContext context) throws PainterException { if (context.peekOperand() instanceof Number) { double data[]; AffineTransform at = new AffineTransform(); AffineTransform ctm = context.pencil.graphics.getTransform(); data = context.popNumberOperands(2); at.translate(data[0], data[1]); ctm.concatenate(at); context.pencil.graphics.setTransform(ctm); } else { Object data[]; data = context.popOperands(3); if (! (data[0] instanceof Number)) { throw new PainterException("translate: wrong arguments"); } if (! (data[1] instanceof Number)) { throw new PainterException("translate: wrong arguments"); } if (! (data[2] instanceof ArrayList)) { throw new PainterException("translate: wrong arguments"); } ArrayList array = (ArrayList) data[2]; if (! (array.size() == 6)) { throw new PainterException("translate: wrong arguments"); } AffineTransform at = new AffineTransform(); at.translate( ( (Number) data[0]).doubleValue(), ( (Number) data[1]).doubleValue()); double[] entries = new double[6]; at.getMatrix(entries); for (int i = 0; i < 6; i++) { array.set(i, new Double(entries[i])); } context.operands.push(array); } } }); // rotate systemDict.put("rotate", new PACommand() { public void execute(PAContext context) throws PainterException { if (context.peekOperand() instanceof Number) { double data[]; AffineTransform at = new AffineTransform(); AffineTransform ctm = context.pencil.graphics.getTransform(); data = context.popNumberOperands(1); at.rotate(data[0] * Math.PI / 180.0d); ctm.concatenate(at); context.pencil.graphics.setTransform(ctm); } else { Object data[]; AffineTransform at = new AffineTransform(); data = context.popOperands(2); if (! (data[0] instanceof Number)) { throw new PainterException("rotate: wrong arguments"); } if (! (data[1] instanceof ArrayList)) { throw new PainterException("rotate: wrong arguments"); } ArrayList array = (ArrayList) data[1]; if (! (array.size() == 6)) { throw new PainterException("rotate: wrong arguments"); } at.rotate( ( (Number) data[0]).doubleValue()); double[] entries = new double[6]; at.getMatrix(entries); for (int i = 0; i < 6; i++) { array.set(i, new Double(entries[i])); } context.operands.push(array); } } }); // scale systemDict.put("scale", new PACommand() { public void execute(PAContext context) throws PainterException { if (context.peekOperand() instanceof Number) { double data[]; AffineTransform at = new AffineTransform(); AffineTransform ctm = context.pencil.graphics.getTransform(); data = context.popNumberOperands(2); at.scale(data[0], data[1]); ctm.concatenate(at); context.pencil.graphics.setTransform(ctm); } else { Object data[]; data = context.popOperands(3); if (! (data[0] instanceof Number)) { throw new PainterException("scale: wrong arguments"); } if (! (data[1] instanceof Number)) { throw new PainterException("scale: wrong arguments"); } if (! (data[2] instanceof ArrayList)) { throw new PainterException("scale: wrong arguments"); } ArrayList array = (ArrayList) data[2]; double[] entries = new double[6]; if (! (array.size() == 6)) { throw new PainterException("scale: wrong arguments"); } entries[0] = ( (Number) data[0]).doubleValue(); entries[1] = 0.0d; entries[2] = 0.0d; entries[3] = ( (Number) data[1]).doubleValue(); entries[4] = 0.0d; entries[5] = 0.0d; for (int i = 0; i < 6; i++) { array.set(i, new Double(entries[i])); } context.operands.push(array); } } }); // stroke systemDict.put("stroke", new PACommand() { public void execute(PAContext context) throws PainterException { context.pencil.stroke(); } }); // fill systemDict.put("fill", new PACommand() { public void execute(PAContext context) throws PainterException { context.pencil.fill(); } }); // eofill systemDict.put("eofill", new PACommand() { public void execute(PAContext context) throws PainterException { context.pencil.eofill(); } }); // show systemDict.put("show", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(1); if (! (data[0] instanceof String)) { throw new PainterException("show: wrong arguments"); } context.pencil.show( (String) data[0]); } }); // stringwidth systemDict.put("stringwidth", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; float[] result; Font font; data = context.popOperands(1); if (! (data[0] instanceof String)) { throw new PainterException("stringwidth: wrong arguments"); } font = context.pencil.graphics.getFont(); Rectangle2D rect = font.getStringBounds( (String) data[0], context.pencil.graphics. getFontRenderContext()); context.operands.push(new Float(rect.getWidth())); context.operands.push(new Float(rect.getHeight())); } }); // showpage systemDict.put("showpage", new PACommand() { public void execute(PAContext context) throws PainterException { context.pencil.showpage(); } }); // findfont systemDict.put("findfont", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; PAToken patoken; data = context.popOperands(1); if (! (data[0] instanceof PAToken)) { throw new PainterException("findfont: wrong arguments"); } patoken = (PAToken) data[0]; if (! (patoken.type == PAToken.KEY)) { throw new PainterException("findfont: wrong arguments"); } context.operands.push(context.pencil.findFont( (String) patoken.value)); } }); // scalefont systemDict.put("scalefont", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(2); if (! (data[0] instanceof Font)) { throw new PainterException("scalefont: wrong arguments"); } if (! (data[1] instanceof Number)) { throw new PainterException("scalefont: wrong arguments"); } context.operands.push( ( (Font) data[0]).deriveFont( ( (Number) data[1]). floatValue())); } }); // setfont systemDict.put("setfont", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(1); if (! (data[0] instanceof Font)) { throw new PainterException("setfont: wrong arguments"); } context.pencil.graphics.setFont( (Font) data[0]); } }); // def systemDict.put("def", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; PAToken patoken; data = context.popOperands(2); if (! (data[0] instanceof PAToken)) { throw new PainterException("def: wrong arguments"); } patoken = (PAToken) data[0]; if (! (patoken.type == PAToken.KEY)) { throw new PainterException("def: wrong arguments"); } try { ( (HashMap) context.dictionaries.peek()).put(patoken.value, data[1]); } catch (EmptyStackException e) { throw new PainterException(e.toString()); } } }); // bind systemDict.put("bind", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; PAToken patoken; data = context.popOperands(1); if (! (data[0] instanceof PAToken)) { throw new PainterException("bind: wrong arguments"); } patoken = (PAToken) data[0]; if (! (patoken.type == PAToken.PROCEDURE)) { throw new PainterException("bind: wrong arguments"); } context.engine.bindProcedure(patoken); context.operands.push(patoken); } }); // mul systemDict.put("mul", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(2); context.operands.push(new Double(data[0] * data[1])); } }); // div systemDict.put("div", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(2); context.operands.push(new Double(data[0] / data[1])); } }); // mod systemDict.put("mod", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(2); int a, b, m; a = (int) data[0]; b = (int) data[1]; m = a % b; context.operands.push(new Integer(m)); } }); // add systemDict.put("add", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(2); context.operands.push(new Double(data[0] + data[1])); } }); // neg systemDict.put("neg", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(1); context.operands.push(new Double( -data[0])); } }); // ceiling systemDict.put("ceiling", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(1); context.operands.push(new Double(Math.ceil(data[0]))); } }); // sub systemDict.put("sub", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(2); context.operands.push(new Double(data[0] - data[1])); } }); // atan systemDict.put("atan", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(2); context.operands.push(new Double(Math.atan2(data[0], data[1]))); } }); // sin systemDict.put("sin", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(1); context.operands.push(new Double(Math.sin(data[0] * Math.PI / 180.0))); } }); // cos systemDict.put("cos", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(1); context.operands.push(new Double(Math.cos(data[0] * Math.PI / 180.0))); } }); // sqrt systemDict.put("sqrt", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(1); context.operands.push(new Double(Math.sqrt(data[0]))); } }); // ln systemDict.put("log", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(1); context.operands.push(new Double(Math.log(data[0]))); } }); // exch systemDict.put("exch", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(2); context.operands.push(data[1]); context.operands.push(data[0]); } }); // dup systemDict.put("dup", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(1); context.operands.push(data[0]); context.operands.push(data[0]); } }); // roll systemDict.put("roll", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; Object rollData[]; data = context.popOperands(2); if (! (data[0] instanceof Number)) { throw new PainterException("roll: wrong arguments"); } if (! (data[1] instanceof Number)) { throw new PainterException("roll: wrong arguments"); } int numberOfElements, numberOfPositions, i; numberOfElements = ( (Number) data[0]).intValue(); numberOfPositions = ( (Number) data[1]).intValue(); if (numberOfPositions == 0 || numberOfElements <= 0) { return; } rollData = context.popOperands(numberOfElements); if (numberOfPositions < 0) { numberOfPositions = -numberOfPositions; numberOfPositions = numberOfPositions % numberOfElements; // downward roll for (i = numberOfPositions; i < numberOfElements; i++) { context.operands.push(rollData[i]); } for (i = 0; i < numberOfPositions; i++) { context.operands.push(rollData[i]); } } else { numberOfPositions = numberOfPositions % numberOfElements; // upward roll for (i = numberOfElements - numberOfPositions; i < numberOfElements; i++) { context.operands.push(rollData[i]); } for (i = 0; i < numberOfElements - numberOfPositions; i++) { context.operands.push(rollData[i]); } } } }); // pop systemDict.put("pop", new PACommand() { public void execute(PAContext context) throws PainterException { context.popOperands(1); } }); // index systemDict.put("index", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(1); if (! (data[0] instanceof Number)) { throw new PainterException("index: wrong arguments"); } int index = ( (Number) data[0]).intValue(); try { context.operands.push(context.operands.elementAt(index)); } catch (ArrayIndexOutOfBoundsException e) { throw new PainterException(e.toString()); } } }); // mark systemDict.put("mark", new PACommand() { public void execute(PAContext context) throws PainterException { context.operands.push(new PAToken(null, PAToken.MARK)); } }); // cleartomark systemDict.put("cleartomark", new PACommand() { public void execute(PAContext context) throws PainterException { Object data; boolean finished = false; while (!finished) { try { data = context.operands.pop(); if (data instanceof PAToken) { if ( ( (PAToken) data).type == PAToken.MARK) { finished = true; } } } catch (EmptyStackException e) { throw new PainterException(e.toString()); } } } }); // copy systemDict.put("copy", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(2); // decide if it's a simple copy or a composite object copy if ( (data[0] instanceof PAToken) && (data[1] instanceof PAToken)) { // composite object copy if ( ( (PAToken) data[0]).type == ( (PAToken) data[1]).type) { // our tokens are immutable so a copy is easy context.operands.push(data[0]); context.operands.push(data[0]); } else { throw new PainterException( "copy operation failed because composite objects on stack are not of same type"); } } else { // restore first arg, we're not interested in it in this simple case context.operands.push(data[0]); if (data[1] instanceof Number) { int index = ( (Number) data[1]).intValue(); int i, n; n = context.operands.size(); Object[] copyData = new Object[index]; for (i = n - index; i < n; i++) { try { copyData[i - n + index] = context.operands.elementAt(i); } catch (ArrayIndexOutOfBoundsException e) { throw new PainterException(e.toString()); } } for (i = 0; i < index; i++) { context.operands.push(copyData[i]); } } else { throw new PainterException("I expect a number on stack, dude"); } } } }); // setgray systemDict.put("setgray", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(1); context.pencil.graphics.setPaint(new Color( (float) data[0], (float) data[0], (float) data[0])); } }); // setrgbcolor systemDict.put("setrgbcolor", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(3); float[] fv = new float[3]; fv[0] = (float) Math.max(Math.min(data[0], 1.0d), 0.0d); fv[1] = (float) Math.max(Math.min(data[1], 1.0d), 0.0d); fv[2] = (float) Math.max(Math.min(data[2], 1.0d), 0.0d); context.pencil.graphics.setPaint(new Color(fv[0], fv[1], fv[2])); } }); // PENDING(uweh): color stuff still shaky // sethsbcolor systemDict.put("sethsbcolor", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(3); float[] fv = new float[3]; fv[0] = (float) Math.max(Math.min(data[0], 1.0d), 0.0d); fv[1] = (float) Math.max(Math.min(data[1], 1.0d), 0.0d); fv[2] = (float) Math.max(Math.min(data[2], 1.0d), 0.0d); context.pencil.graphics.setPaint(new Color(fv[0], fv[1], fv[2])); } }); // PENDING(uweh): I have to convert these puppies myself to rgb ? // setcmykcolor systemDict.put("setcmykcolor", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; int rd, gr, bl; data = context.popNumberOperands(4); float[] fv = new float[4]; fv[0] = (float) data[0]; fv[1] = (float) data[1]; fv[2] = (float) data[2]; fv[3] = (float) data[3]; rd = (int) (255 * Math.max(0, 1 - fv[0] - fv[3])); gr = (int) (255 * Math.max(0, 1 - fv[1] - fv[3])); bl = (int) (255 * Math.max(0, 1 - fv[2] - fv[3])); context.pencil.graphics.setPaint(new Color(rd, gr, bl)); } }); // setlinewidth systemDict.put("setlinewidth", new PACommand() { private double minLineWidth(double w, AffineTransform at) { double matrix[] = new double[4]; at.getMatrix(matrix); double scale = matrix[0] * matrix[3] - matrix[1] * matrix[2]; double minlw = .25 / Math.sqrt(Math.abs(scale)); if (w < minlw) { w = minlw; } return w; } public void execute(PAContext context) throws PainterException { double data[]; BasicStroke newStroke; Stroke oldStroke = context.pencil.graphics.getStroke(); data = context.popNumberOperands(1); data[0] = this.minLineWidth(data[0], context.pencil.graphics.getTransform()); if (oldStroke instanceof BasicStroke) { newStroke = new BasicStroke( (float) data[0], ( (BasicStroke) oldStroke).getEndCap(), ( (BasicStroke) oldStroke).getLineJoin(), ( (BasicStroke) oldStroke).getMiterLimit(), ( (BasicStroke) oldStroke).getDashArray(), ( (BasicStroke) oldStroke).getDashPhase()); } else { newStroke = new BasicStroke( (float) data[0], BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND); } context.pencil.graphics.setStroke(newStroke); } }); // setlinecap systemDict.put("setlinecap", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; BasicStroke newStroke; Stroke oldStroke = context.pencil.graphics.getStroke(); data = context.popNumberOperands(1); if (oldStroke instanceof BasicStroke) { newStroke = new BasicStroke( ( (BasicStroke) oldStroke).getLineWidth(), (int) data[0], ( (BasicStroke) oldStroke).getLineJoin(), ( (BasicStroke) oldStroke).getMiterLimit(), ( (BasicStroke) oldStroke).getDashArray(), ( (BasicStroke) oldStroke).getDashPhase()); } else { newStroke = new BasicStroke(1.0f, (int) data[0], BasicStroke.JOIN_ROUND); } context.pencil.graphics.setStroke(newStroke); } }); // setmiterlimit systemDict.put("setmiterlimit", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; BasicStroke newStroke; Stroke oldStroke = context.pencil.graphics.getStroke(); data = context.popNumberOperands(1); if (oldStroke instanceof BasicStroke) { newStroke = new BasicStroke( ( (BasicStroke) oldStroke).getLineWidth(), ( (BasicStroke) oldStroke).getEndCap(), ( (BasicStroke) oldStroke).getLineJoin(), (float) data[0], ( (BasicStroke) oldStroke).getDashArray(), ( (BasicStroke) oldStroke).getDashPhase()); } else { newStroke = new BasicStroke(1.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, (float) data[0]); } context.pencil.graphics.setStroke(newStroke); } }); // setdash systemDict.put("setdash", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; BasicStroke newStroke; Stroke oldStroke = context.pencil.graphics.getStroke(); data = context.popOperands(2); if (! (data[0] instanceof ArrayList)) { throw new PainterException("setdash: wrong arguments"); } if (! (data[1] instanceof Number)) { throw new PainterException("setdash: wrong arguments"); } ArrayList list = (ArrayList) data[0]; if (list.size() == 0) { return; } float[] dashpattern = new float[list.size()]; for (int i = 0; i < dashpattern.length; i++) { dashpattern[i] = ( (Number) list.get(i)).floatValue(); } float dashoffset = ( (Number) data[1]).floatValue(); if (oldStroke instanceof BasicStroke) { newStroke = new BasicStroke( ( (BasicStroke) oldStroke).getLineWidth(), ( (BasicStroke) oldStroke).getEndCap(), ( (BasicStroke) oldStroke).getLineJoin(), ( (BasicStroke) oldStroke).getMiterLimit(), dashpattern, dashoffset); } else { newStroke = new BasicStroke(1.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f, dashpattern, dashoffset); } context.pencil.graphics.setStroke(newStroke); } }); // setlinejoin systemDict.put("setlinejoin", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; BasicStroke newStroke; Stroke oldStroke = context.pencil.graphics.getStroke(); data = context.popNumberOperands(1); if (oldStroke instanceof BasicStroke) { newStroke = new BasicStroke( ( (BasicStroke) oldStroke).getLineWidth(), ( (BasicStroke) oldStroke).getEndCap(), (int) data[0], ( (BasicStroke) oldStroke).getMiterLimit(), ( (BasicStroke) oldStroke).getDashArray(), ( (BasicStroke) oldStroke).getDashPhase()); } else { newStroke = new BasicStroke(1.0f, BasicStroke.CAP_ROUND, (int) data[0]); } context.pencil.graphics.setStroke(newStroke); } }); // dumpstack systemDict.put("dumpstack", new PACommand() { public void execute(PAContext context) throws PainterException { Enumeration enumx = context.operands.elements(); System.out.println("-------------Stack--------------"); while (enumx.hasMoreElements()) { System.out.println(enumx.nextElement()); } System.out.println("--------------------------------"); } }); // for systemDict.put("for", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; PAToken patoken; data = context.popOperands(4); if (! (data[3] instanceof PAToken)) { throw new PainterException("for: wrong arguments"); } if (! (data[0] instanceof Number)) { throw new PainterException("for: wrong arguments"); } if (! (data[1] instanceof Number)) { throw new PainterException("for: wrong arguments"); } if (! (data[2] instanceof Number)) { throw new PainterException("for: wrong arguments"); } patoken = (PAToken) data[3]; if (! (patoken.type == PAToken.PROCEDURE)) { throw new PainterException("for: wrong arguments"); } int i0, i1, i2; i0 = ( (Number) data[0]).intValue(); i1 = ( (Number) data[1]).intValue(); i2 = ( (Number) data[2]).intValue(); if (i1 > 0) { for (int i = i0; i <= i2; i += i1) { context.operands.push(new Integer(i)); context.engine.process(patoken); } } else { for (int i = i0; i >= i2; i -= i1) { context.operands.push(new Integer(i)); context.engine.process(patoken); } } } }); // repeat systemDict.put("repeat", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; PAToken patoken; data = context.popOperands(2); if (! (data[1] instanceof PAToken)) { throw new PainterException("repeat: wrong arguments"); } if (! (data[0] instanceof Number)) { throw new PainterException("repeat: wrong arguments"); } patoken = (PAToken) data[1]; if (! (patoken.type == PAToken.PROCEDURE)) { throw new PainterException("repeat: wrong arguments"); } int n = ( (Number) data[0]).intValue(); for (int i = 0; i < n; i++) { context.engine.process(patoken); } } }); // true systemDict.put("true", new PACommand() { public void execute(PAContext context) throws PainterException { context.operands.push(new Boolean(true)); } }); // false systemDict.put("false", new PACommand() { public void execute(PAContext context) throws PainterException { context.operands.push(new Boolean(false)); } }); // lt systemDict.put("lt", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(2); if (! (data[0] instanceof Number) && ! (data[0] instanceof String)) { throw new PainterException("lt: wrong arguments"); } if (data[0] instanceof Number) { if (! (data[1] instanceof Number)) { throw new PainterException("lt: wrong arguments"); } double d0, d1; d0 = ( (Number) data[0]).doubleValue(); d1 = ( (Number) data[1]).doubleValue(); if (d0 < d1) { context.operands.push(new Boolean(true)); } else { context.operands.push(new Boolean(false)); } } else { if (! (data[1] instanceof String)) { throw new PainterException("lt: wrong arguments"); } String s0, s1; s0 = (String) data[0]; s1 = (String) data[1]; if (s0.compareTo(s1) < 0) { context.operands.push(new Boolean(true)); } else { context.operands.push(new Boolean(false)); } } } }); // gt systemDict.put("gt", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(2); if (! (data[0] instanceof Number) && ! (data[0] instanceof String)) { throw new PainterException("gt: wrong arguments"); } if (data[0] instanceof Number) { if (! (data[1] instanceof Number)) { throw new PainterException("gt: wrong arguments"); } double d0, d1; d0 = ( (Number) data[0]).doubleValue(); d1 = ( (Number) data[1]).doubleValue(); if (d0 > d1) { context.operands.push(new Boolean(true)); } else { context.operands.push(new Boolean(false)); } } else { if (! (data[1] instanceof String)) { throw new PainterException("gt: wrong arguments"); } String s0, s1; s0 = (String) data[0]; s1 = (String) data[1]; if (s0.compareTo(s1) > 0) { context.operands.push(new Boolean(true)); } else { context.operands.push(new Boolean(false)); } } } }); // ge systemDict.put("ge", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(2); if (! (data[0] instanceof Number) && ! (data[0] instanceof String)) { throw new PainterException("ge: wrong arguments"); } if (data[0] instanceof Number) { if (! (data[1] instanceof Number)) { throw new PainterException("ge: wrong arguments"); } double d0, d1; d0 = ( (Number) data[0]).doubleValue(); d1 = ( (Number) data[1]).doubleValue(); if (d0 >= d1) { context.operands.push(new Boolean(true)); } else { context.operands.push(new Boolean(false)); } } else { if (! (data[1] instanceof String)) { throw new PainterException("ge: wrong arguments"); } String s0, s1; s0 = (String) data[0]; s1 = (String) data[1]; if (s0.compareTo(s1) >= 0) { context.operands.push(new Boolean(true)); } else { context.operands.push(new Boolean(false)); } } } }); // ne systemDict.put("ne", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(2); if (! (data[0] instanceof Number) && ! (data[0] instanceof String)) { throw new PainterException("ne: wrong arguments"); } if (data[0] instanceof Number) { if (! (data[1] instanceof Number)) { throw new PainterException("ne: wrong arguments"); } double d0, d1; d0 = ( (Number) data[0]).doubleValue(); d1 = ( (Number) data[1]).doubleValue(); if (d0 != d1) { context.operands.push(new Boolean(true)); } else { context.operands.push(new Boolean(false)); } } else { if (! (data[1] instanceof String)) { throw new PainterException("ne: wrong arguments"); } String s0, s1; s0 = (String) data[0]; s1 = (String) data[1]; if (s0.equals(s1)) { context.operands.push(new Boolean(false)); } else { context.operands.push(new Boolean(true)); } } } }); // eq systemDict.put("eq", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(2); if (! (data[0] instanceof Number) && ! (data[0] instanceof String)) { throw new PainterException("eq: wrong arguments"); } if (data[0] instanceof Number) { if (! (data[1] instanceof Number)) { throw new PainterException("eq: wrong arguments"); } double d0, d1; d0 = ( (Number) data[0]).doubleValue(); d1 = ( (Number) data[1]).doubleValue(); if (d0 == d1) { context.operands.push(new Boolean(true)); } else { context.operands.push(new Boolean(false)); } } else { if (! (data[1] instanceof String)) { throw new PainterException("eq: wrong arguments"); } String s0, s1; s0 = (String) data[0]; s1 = (String) data[1]; if (s0.compareTo(s1) == 0) { context.operands.push(new Boolean(true)); } else { context.operands.push(new Boolean(false)); } } } }); // if systemDict.put("if", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; PAToken patoken; data = context.popOperands(2); if (! (data[0] instanceof Boolean)) { throw new PainterException("if: wrong arguments"); } if (! (data[1] instanceof PAToken)) { throw new PainterException("if: wrong arguments"); } patoken = (PAToken) data[1]; if (! (patoken.type == PAToken.PROCEDURE)) { throw new PainterException("if: wrong arguments"); } if ( ( (Boolean) data[0]).booleanValue()) { context.engine.process(patoken); } } }); // ifelse systemDict.put("ifelse", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; PAToken patoken1, patoken2; data = context.popOperands(3); if (! (data[0] instanceof Boolean)) { throw new PainterException("ifelse: wrong arguments"); } if (! (data[1] instanceof PAToken)) { throw new PainterException("ifelse: wrong arguments"); } if (! (data[2] instanceof PAToken)) { throw new PainterException("ifelse: wrong arguments"); } patoken1 = (PAToken) data[1]; patoken2 = (PAToken) data[2]; if (! (patoken1.type == PAToken.PROCEDURE)) { throw new PainterException("ifelse: wrong arguments"); } if (! (patoken2.type == PAToken.PROCEDURE)) { throw new PainterException("ifelse: wrong arguments"); } if ( ( (Boolean) data[0]).booleanValue()) { context.engine.process(patoken1); } else { context.engine.process(patoken2); } } }); // dict systemDict.put("dict", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(1); context.operands.push(new HashMap((int)data[0])); } }); // userdict systemDict.put("userdict", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(1); context.operands.push(new HashMap((int)data[0])); } }); // put systemDict.put("put", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; PAToken patoken; data = context.popOperands(3); if (! (data[0] instanceof HashMap)) { throw new PainterException("put: wrong arguments"); } if (! (data[1] instanceof PAToken)) { throw new PainterException("put: wrong arguments"); } patoken = (PAToken) data[1]; if (! (patoken.type == PAToken.KEY)) { throw new PainterException("put: wrong arguments"); } ( (HashMap) data[0]).put(patoken.value, data[2]); } }); // get systemDict.put("get", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; PAToken patoken; data = context.popOperands(2); if (! (data[0] instanceof HashMap) && ! (data[0] instanceof ArrayList)) { throw new PainterException("get: wrong arguments"); } if (data[0] instanceof HashMap) { if (! (data[1] instanceof PAToken)) { throw new PainterException("get: wrong arguments"); } patoken = (PAToken) data[1]; if (! (patoken.type == PAToken.KEY)) { throw new PainterException("get: wrong arguments"); } context.operands.push( ( (HashMap) data[0]).get(patoken.value)); } else if (data[0] instanceof ArrayList) { if (! (data[1] instanceof Number)) { throw new PainterException("get: wrong arguments"); } context.operands.push( ( (ArrayList) data[0]).get( ( (Number) data[1]). intValue())); } } }); // getinterval systemDict.put("getinterval", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; PAToken patoken; data = context.popOperands(3); if (! (data[0] instanceof HashMap) && ! (data[0] instanceof ArrayList)) { throw new PainterException("getinterval: wrong arguments"); } if (data[0] instanceof HashMap) { if (! (data[1] instanceof PAToken)) { throw new PainterException("getinterval: wrong arguments"); } patoken = (PAToken) data[1]; if (! (patoken.type == PAToken.KEY)) { throw new PainterException("getinterval: wrong arguments"); } if (! (data[2] instanceof Number)) { throw new PainterException("getinterval: wrong arguments"); } HashMap target=new HashMap(); context.operands.push( ( (HashMap) data[0]).get(patoken.value)); } else if (data[0] instanceof ArrayList) { if (! (data[1] instanceof Number)) { throw new PainterException("getinterval: wrong arguments"); } if (! (data[2] instanceof Number)) { throw new PainterException("getinterval: wrong arguments"); } ArrayList source=( (ArrayList) data[0]); int from=( (Number) data[1]).intValue(); int to=from+( (Number) data[2]).intValue(); ArrayList target=new ArrayList(source.subList(from,to)); context.operands.push( target); } } }); // load systemDict.put("load", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; PAToken patoken; data = context.popOperands(1); if (! (data[0] instanceof PAToken)) { throw new PainterException("load: wrong arguments"); } patoken = (PAToken) data[0]; if (! (patoken.type == PAToken.KEY)) { throw new PainterException("load: wrong arguments"); } context.operands.push(context.findIdentifier(patoken.value)); } }); // length systemDict.put("length", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; PAToken patoken; int size = 0; data = context.popOperands(1); if (data[0] instanceof PAToken) { patoken = (PAToken) data[0]; if (! (patoken.type == PAToken.KEY)) { throw new PainterException("length: wrong arguments"); } size = ( (String) patoken.value).length(); } else if (data[0] instanceof HashMap) { size = ( (HashMap) data[0]).size(); } else if (data[0] instanceof ArrayList) { size = ( (ArrayList) data[0]).size(); } else if (data[0] instanceof String) { size = ( (String) data[0]).length(); } else { throw new PainterException("length: wrong arguments"); } context.operands.push(new Integer(size)); } }); // begin systemDict.put("begin", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(1); if (! (data[0] instanceof HashMap)) { throw new PainterException("begin: wrong arguments"); } context.dictionaries.push(data[0]); } }); // end systemDict.put("end", new PACommand() { public void execute(PAContext context) throws PainterException { try { context.dictionaries.pop(); } catch (EmptyStackException e) { throw new PainterException("Dictionary stack is empty"); } } }); // undef systemDict.put("undef", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; PAToken patoken; data = context.popOperands(2); if (! (data[0] instanceof HashMap)) { throw new PainterException("undef: wrong arguments"); } if (! (data[1] instanceof PAToken)) { throw new PainterException("undef: wrong arguments"); } patoken = (PAToken) data[1]; if (! (patoken.type == PAToken.KEY)) { throw new PainterException("undef: wrong arguments"); } // we don't do an actual undef because we don't care } }); // known systemDict.put("known", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[], foundObject; PAToken patoken; data = context.popOperands(1); if (! (data[0] instanceof PAToken)) { throw new PainterException("known: wrong arguments"); } patoken = (PAToken) data[0]; if (! (patoken.type == PAToken.KEY)) { throw new PainterException("known: wrong arguments"); } foundObject = context.findIdentifier(patoken.value); if (foundObject != null) { context.operands.push(new Boolean(true)); } else { context.operands.push(new Boolean(false)); } } }); // where systemDict.put("where", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[], foundObject; PAToken patoken; data = context.popOperands(1); if (! (data[0] instanceof PAToken)) { throw new PainterException("where: wrong arguments"); } patoken = (PAToken) data[0]; if (! (patoken.type == PAToken.KEY)) { throw new PainterException("where: wrong arguments"); } foundObject = context.findDictionary(patoken.value); if (foundObject != null) { context.operands.push(foundObject); context.operands.push(new Boolean(true)); } else { context.operands.push(new Boolean(false)); } } }); // aload systemDict.put("aload", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; ArrayList list; data = context.popOperands(1); if (! (data[0] instanceof ArrayList)) { throw new PainterException("aload: wrong arguments"); } list = (ArrayList) data[0]; Iterator iterator = list.iterator(); while (iterator.hasNext()) { context.operands.push(iterator.next()); } context.operands.push(data[0]); } }); // forall systemDict.put("forall", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; ArrayList list; PAToken patoken; data = context.popOperands(2); if (! (data[0] instanceof ArrayList)) { throw new PainterException("forall: wrong arguments"); } if (! (data[1] instanceof PAToken)) { throw new PainterException("forall: wrong arguments"); } patoken = (PAToken) data[1]; if (! (patoken.type == PAToken.PROCEDURE)) { throw new PainterException("forall: wrong arguments"); } list = (ArrayList) data[0]; Iterator iterator = list.iterator(); while (iterator.hasNext()) { context.operands.push(iterator.next()); context.engine.process(patoken); } } }); // currentflat PENDING(uweh):placeholder for now systemDict.put("currentflat", new PACommand() { public void execute(PAContext context) throws PainterException { if(!PAContext.IgnoreUnknownCommands) context.operands.push(new Double(1.0f));// PdfGraphics2D pdfg2d=(PdfGraphics2D)context.pencil.graphics;//PdfContentByte cb=pdfg2d.getContent();//; } }); // setflat PENDING(uweh):placeholder for now systemDict.put("setflat", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(1); } }); // round systemDict.put("round", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(1); context.operands.push(new Long(Math.round(data[0]))); } }); // abs systemDict.put("abs", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(1); context.operands.push(new Double(Math.abs(data[0]))); } }); // transform systemDict.put("transform", new PACommand() { public void execute(PAContext context) throws PainterException { if (context.peekOperand() instanceof Number) { double data[]; double[] transformedData = new double[2]; data = context.popNumberOperands(2); AffineTransform at = context.pencil.graphics.getTransform(); at.transform(data, 0, transformedData, 0, 1); context.operands.push(new Double(transformedData[0])); context.operands.push(new Double(transformedData[1])); } else { Object data[]; data = context.popOperands(3); if (! (data[0] instanceof Number)) { throw new PainterException("transform: wrong arguments"); } if (! (data[1] instanceof Number)) { throw new PainterException("transform: wrong arguments"); } if (! (data[2] instanceof ArrayList)) { throw new PainterException("transform: wrong arguments"); } ArrayList array = (ArrayList) data[2]; double[] entries = new double[6]; if (! (array.size() == 6)) { throw new PainterException("transform: wrong arguments"); } for (int i = 0; i < 6; i++) { entries[i] = ( (Number) array.get(i)).doubleValue(); } AffineTransform at = new AffineTransform(entries); double numberdata[] = new double[2]; numberdata[0] = ( (Number) data[0]).doubleValue(); numberdata[1] = ( (Number) data[1]).doubleValue(); double[] transformedData = new double[2]; at.transform(numberdata, 0, transformedData, 0, 1); context.operands.push(new Double(transformedData[0])); context.operands.push(new Double(transformedData[1])); } } }); // itransform systemDict.put("itransform", new PACommand() { public void execute(PAContext context) throws PainterException { if (context.peekOperand() instanceof Number) { double data[]; double[] transformedData = new double[2]; data = context.popNumberOperands(2); AffineTransform at = context.pencil.graphics.getTransform(); try { at.inverseTransform(data, 0, transformedData, 0, 1); } catch (NoninvertibleTransformException e) { throw new PainterException(e.toString()); } context.operands.push(new Double(transformedData[0])); context.operands.push(new Double(transformedData[1])); } else { Object data[]; data = context.popOperands(3); if (! (data[0] instanceof Number)) { throw new PainterException("itransform: wrong arguments"); } if (! (data[1] instanceof Number)) { throw new PainterException("itransform: wrong arguments"); } if (! (data[2] instanceof ArrayList)) { throw new PainterException("itransform: wrong arguments"); } ArrayList array = (ArrayList) data[2]; double[] entries = new double[6]; if (! (array.size() == 6)) { throw new PainterException("itransform: wrong arguments"); } for (int i = 0; i < 6; i++) { entries[i] = ( (Number) array.get(i)).doubleValue(); } AffineTransform at = new AffineTransform(entries); double numberdata[] = new double[2]; numberdata[0] = ( (Number) data[0]).doubleValue(); numberdata[1] = ( (Number) data[0]).doubleValue(); double[] transformedData = new double[2]; try { at.inverseTransform(numberdata, 0, transformedData, 0, 1); } catch (NoninvertibleTransformException e) { throw new PainterException(e.toString()); } context.operands.push(new Double(transformedData[0])); context.operands.push(new Double(transformedData[1])); } } }); // currentpoint // PENDING(uweh): what about CTM, same thing when you construct path // this is different than ps, might not work in a few instances systemDict.put("currentpoint", new PACommand() { public void execute(PAContext context) throws PainterException { Point2D currentPoint = context.pencil.state.path.getCurrentPoint(); context.operands.push(new Double(currentPoint.getX())); context.operands.push(new Double(currentPoint.getY())); } }); // clippath systemDict.put("clippath", new PACommand() { public void execute(PAContext context) throws PainterException { context.pencil.clippath(); } }); // matrix systemDict.put("matrix", new PACommand() { public void execute(PAContext context) throws PainterException { ArrayList identityMatrix = new ArrayList(6); identityMatrix.add(new Double(1.0d)); identityMatrix.add(new Double(0.0d)); identityMatrix.add(new Double(0.0d)); identityMatrix.add(new Double(1.0d)); identityMatrix.add(new Double(0.0d)); identityMatrix.add(new Double(0.0d)); context.operands.push(identityMatrix); } }); // concatmatrix systemDict.put("concatmatrix", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(3); if (! (data[0] instanceof ArrayList)) { throw new PainterException("concatmatrix: wrong arguments"); } if (! (data[1] instanceof ArrayList)) { throw new PainterException("concatmatrix: wrong arguments"); } if (! (data[2] instanceof ArrayList)) { throw new PainterException("concatmatrix: wrong arguments"); } ArrayList arrayOne, arrayTwo, arrayThree; AffineTransform atOne, atTwo; arrayOne = (ArrayList) data[0]; arrayTwo = (ArrayList) data[1]; arrayThree = (ArrayList) data[2]; double[] entries = new double[6]; if (! (arrayOne.size() == 6)) { throw new PainterException("concatmatrix: wrong arguments"); } if (! (arrayTwo.size() == 6)) { throw new PainterException("concatmatrix: wrong arguments"); } if (! (arrayThree.size() == 6)) { throw new PainterException("concatmatrix: wrong arguments"); } for (int i = 0; i < 6; i++) { entries[i] = ( (Number) arrayOne.get(i)).doubleValue(); } atOne = new AffineTransform(entries); for (int i = 0; i < 6; i++) { entries[i] = ( (Number) arrayTwo.get(i)).doubleValue(); } atTwo = new AffineTransform(entries); atOne.concatenate(atTwo); atOne.getMatrix(entries); for (int i = 0; i < 6; i++) { arrayThree.set(i, new Double(entries[i])); } context.operands.push(arrayThree); } }); // pathbbox systemDict.put("pathbbox", new PACommand() { public void execute(PAContext context) throws PainterException { Rectangle2D pathBounds = context.pencil.state.path.getBounds2D(); context.operands.push(new Double(pathBounds.getMinX())); context.operands.push(new Double(pathBounds.getMinY())); context.operands.push(new Double(pathBounds.getMaxX())); context.operands.push(new Double(pathBounds.getMaxY())); } }); // initmatrix systemDict.put("initmatrix", new PACommand() { public void execute(PAContext context) throws PainterException { if(!PAContext.IgnoreUnknownCommands) throw new UnsupportedOperationException("initmatrix"); } }); // initclipsystemDict.put("initclip", new PACommand() { public void execute(PAContext context) throws PainterException { if(!PAContext.IgnoreUnknownCommands) throw new UnsupportedOperationException("initclip"); }}); // truncate systemDict.put("truncate", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; double truncated; data = context.popNumberOperands(1); if (data[0] < 0) { truncated = Math.ceil(data[0]); } else { truncated = Math.floor(data[0]); } context.operands.push(new Double(truncated)); } }); // rand systemDict.put("rand", new PACommand() { public void execute(PAContext context) throws PainterException {// context.operands.push(new Integer(randomNumberGenerator.nextInt(231))); context.operands.push(new Integer(Math.abs(randomNumberGenerator.nextInt((1<<31)-1))));// Math.abs(random.nextInt()) } }); // srand systemDict.put("srand", new PACommand() { public void execute(PAContext context) throws PainterException { double data[]; data = context.popNumberOperands(1); randomNumberGenerator = new Random(Math.round(data[0])); } }); // version systemDict.put("version", new PACommand() { public void execute(PAContext context) throws PainterException { context.operands.push("2016"); } }); // cvi systemDict.put("cvi", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(1); if (! (data[0] instanceof Number) && ! (data[0] instanceof String)) { throw new PainterException("cvi: wrong arguments"); } if (data[0] instanceof Number) { int d; d = ( (Number) data[0]).intValue(); context.operands.push(new Integer(d)); } else { String s; s = (String) data[0]; context.operands.push(new Integer(s)); } } }); // cvr systemDict.put("cvr", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(1); if (! (data[0] instanceof Number) && ! (data[0] instanceof String)) { throw new PainterException("cvr: wrong arguments"); } if (data[0] instanceof Number) { int d; d = ( (Number) data[0]).intValue(); context.operands.push(new Double(d)); } else { String s; s = (String) data[0]; context.operands.push(new Double(s)); } } }); // usertime systemDict.put("usertime", new PACommand() { public void execute(PAContext context) throws PainterException { context.operands.push(new Long(System.currentTimeMillis())); } });// save systemDict.put("save", new PACommand() { public void execute(PAContext context) throws PainterException { PdfGraphics2D pdfg2d=(PdfGraphics2D)context.pencil.graphics; PdfContentByte cb=pdfg2d.getContent(); cb.saveState(); context.operands.push(new Long(System.currentTimeMillis()));// context.pencil.gsave(); // Wrong! but at the moment not there..// if(!PAContext.IgnoreUnknownCommands)// throw new UnsupportedOperationException("save"); } });// restore systemDict.put("restore", new PACommand() { public void execute(PAContext context) throws PainterException {// context.pencil.grestore(); // Wrong! but at the moment not there.. PdfGraphics2D pdfg2d=(PdfGraphics2D)context.pencil.graphics; PdfContentByte cb=pdfg2d.getContent(); cb.restoreState(); Object data[];data = context.popOperands(1);// if(!PAContext.IgnoreUnknownCommands)// throw new UnsupportedOperationException("restore"); } });// clear systemDict.put("clear", new PACommand() { public void execute(PAContext context) throws PainterException { if(!PAContext.IgnoreUnknownCommands) throw new UnsupportedOperationException("clear"); } }); // readonly systemDict.put("readonly", new PACommand() { public void execute(PAContext context) throws PainterException {// if(!PAContext.IgnoreUnknownCommands)// throw new UnsupportedOperationException("readonly"); } });// currentfile systemDict.put("currentfile", new PACommand() { public void execute(PAContext context) throws PainterException { if(!PAContext.IgnoreUnknownCommands) throw new UnsupportedOperationException("currentfile"); } }); // filter systemDict.put("filter", new PACommand() { public void execute(PAContext context) throws PainterException { if(!PAContext.IgnoreUnknownCommands) throw new UnsupportedOperationException("filter"); } }); // string systemDict.put("string", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(1); if (! (data[0] instanceof Number) ) { throw new PainterException("string: wrong arguments"); } int d; d = ( (Number) data[0]).intValue(); context.operands.push(new String()); }}); // null systemDict.put("null", new PACommand() { public void execute(PAContext context) throws PainterException { context.operands.push(null); }}); // currentscreen systemDict.put("currentscreen", new PACommand() { public void execute(PAContext context) throws PainterException { if (!PAContext.IgnoreUnknownCommands) throw new UnsupportedOperationException("systemdict"); else { context.operands.push(new Double(60)); context.operands.push(new Double(0)); context.operands.push(new Double(0)); } }});// // systemdict// systemDict.put("systemdict", new PACommand() {// public void execute(PAContext context) throws PainterException {// if(!PAContext.IgnoreUnknownCommands)// throw new UnsupportedOperationException("systemdict");// }//});// // statusdict// systemDict.put("statusdict", new PACommand() {// public void execute(PAContext context) throws PainterException {// if(!PAContext.IgnoreUnknownCommands)// throw new UnsupportedOperationException("statusdict");// }//});// cleardictstack systemDict.put("cleardictstack", new PACommand() { public void execute(PAContext context) throws PainterException { if(!PAContext.IgnoreUnknownCommands) throw new UnsupportedOperationException("cleardictstack"); } }); // charpath systemDict.put("charpath", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; data = context.popOperands(2); if (! (data[0] instanceof String)) { throw new PainterException("charpath: wrong arguments"); } if (! (data[1] instanceof Boolean)) { throw new PainterException("charpath: wrong arguments"); } context.pencil.charpath( (String) data[0], ( (Boolean) data[1]).booleanValue()); } }); // PENDING(uweh): we only support procedure right now and always push false on the stack // stopped systemDict.put("stopped", new PACommand() { public void execute(PAContext context) throws PainterException { Object data[]; PAToken patoken; data = context.popOperands(1); if (! (data[0] instanceof PAToken)) { throw new PainterException("stopped: wrong arguments"); } patoken = (PAToken) data[0]; if (! (patoken.type == PAToken.PROCEDURE)) { throw new PainterException("stopped: wrong arguments"); } context.engine.process(patoken); context.operands.push(new Boolean(false)); } }); systemDict.put("systemdict",systemDict); return systemDict; } | 4174 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4174/f1bf50c651cb7c4f69dfb32ac954ac18bacdb38c/PAContext.java/clean/src/com/lowagie/text/pdf/codec/postscript/PAContext.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
4317,
4872,
3163,
5014,
1435,
288,
565,
4317,
2619,
5014,
273,
394,
4317,
5621,
565,
368,
25094,
565,
2619,
5014,
18,
458,
2932,
2704,
803,
3113,
394,
15662,
2189,
1435,
288,
1377,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
4317,
4872,
3163,
5014,
1435,
288,
565,
4317,
2619,
5014,
273,
394,
4317,
5621,
565,
368,
25094,
565,
2619,
5014,
18,
458,
2932,
2704,
803,
3113,
394,
15662,
2189,
1435,
288,
1377,
... |
String attrUri = attrUriIndex != -1 | String attrUri = attrUriIndex != -1 && namespaces | public void startElement(int elementType, XMLAttrList attrList, int attrListIndex) throws Exception { // parameters String name = fStringPool.toString(elementType); AttributeList attrs = attrList.getAttributeList(attrListIndex); // perform callback if (DEBUG_CALLBACKS) { String atts = attrs.getLength() > 0 ? "" : " "; for (int i = 0; i < attrs.getLength(); i++) { atts += " " + attrs.getName(i) + "='" + attrs.getValue(i) + "'"; } System.err.println("startElement(" + name + "," + atts + ")"); } if (fDocumentHandler != null) { fDocumentHandler.startElement(name, attrs); } if (fContentHandler != null) { int uriIndex = fStringPool.getURIForQName(elementType); String uri = uriIndex != -1 ? fStringPool.toString(uriIndex) : ""; int localIndex = fStringPool.getLocalPartForQName(elementType); String local = localIndex != -1 ? fStringPool.toString(localIndex) : ""; String raw = name; fAttributes.clear(); for (int attrIndex = attrList.getFirstAttr(attrListIndex); attrIndex != -1; attrIndex = attrList.getNextAttr(attrIndex)) { int attrNameIndex = attrList.getAttrName(attrIndex); int attrUriIndex = fStringPool.getURIForQName(attrNameIndex); String attrUri = attrUriIndex != -1 ? fStringPool.toString(attrUriIndex) : ""; int attrLocalIndex = fStringPool.getLocalPartForQName(attrNameIndex); String attrLocal = attrLocalIndex != -1 ? fStringPool.toString(attrLocalIndex) : ""; String attrRaw = fStringPool.toString(attrNameIndex); String attrType = fStringPool.toString(attrList.getAttType(attrIndex)); String attrValue = fStringPool.toString(attrList.getAttValue(attrIndex)); int attrPrefix = fStringPool.getPrefixForQName(attrNameIndex); if (getNamespacePrefixes() || (!getNamespacePrefixes() && attrPrefix != fStringPool.addSymbol("xmlns") && attrLocalIndex != fStringPool.addSymbol("xmlns") )) fAttributes.addAttribute(attrUri, attrLocal, attrRaw, attrType, attrValue); } fContentHandler.startElement(uri, local, raw, fAttributes); } // free attribute list attrList.releaseAttrList(attrListIndex); } // startElement(int,int) | 4434 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4434/3e70054e9651128ce312f1bd3ff0141acc90e6e8/SAXParser.java/buggy/src/org/apache/xerces/parsers/SAXParser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
13591,
12,
474,
21427,
16,
3167,
3843,
682,
1604,
682,
16,
509,
1604,
682,
1016,
13,
3639,
1216,
1185,
288,
3639,
368,
1472,
3639,
514,
508,
273,
284,
780,
2864,
18,
10492,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
13591,
12,
474,
21427,
16,
3167,
3843,
682,
1604,
682,
16,
509,
1604,
682,
1016,
13,
3639,
1216,
1185,
288,
3639,
368,
1472,
3639,
514,
508,
273,
284,
780,
2864,
18,
10492,
1... |
color.setChoiceSet( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.COLOR_PROP ) ); | color.setChoiceSet( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.COLOR_PROP ) ); | protected Control createContents( Composite parent ) { GridData gdata; GridLayout glayout; createTitleArea( parent ); Composite composite = new Composite( parent, 0 ); glayout = new GridLayout( ); glayout.marginHeight = 0; glayout.marginWidth = 0; glayout.verticalSpacing = 0; composite.setLayout( glayout ); composite.setLayoutData( new GridData( GridData.FILL_BOTH ) ); applyDialogFont( composite ); initializeDialogUnits( composite ); Composite innerParent = (Composite) createDialogArea( composite ); createButtonBar( composite ); Label lb = new Label( innerParent, SWT.NONE ); lb.setText( Messages .getString( "HighlightRuleBuilderDialog.text.Condition" ) ); //$NON-NLS-1$ Composite condition = new Composite( innerParent, SWT.NONE ); condition.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); glayout = new GridLayout( 5, false ); condition.setLayout( glayout ); expression = new Combo( condition, SWT.NONE ); gdata = new GridData( ); gdata.widthHint = 100; expression.setLayoutData( gdata ); fillExpression( expression ); expression.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { if ( expression.getText( ).equals( VALUE_OF_THIS_DATA_ITEM ) && designHandle instanceof DataItemHandle ) { expression .setText( DEUtil .getColumnExpression( ( (DataItemHandle) designHandle ) .getResultSetColumn( ) ) ); } updateButtons( ); } } ); expression.addModifyListener( new ModifyListener( ) { public void modifyText( ModifyEvent e ) { updateButtons( ); } } ); Button expBuilder = new Button( condition, SWT.PUSH ); expBuilder.setText( "..." ); //$NON-NLS-1$ gdata = new GridData( ); gdata.heightHint = 20; gdata.widthHint = 20; expBuilder.setLayoutData( gdata ); expBuilder.setToolTipText( Messages .getString( "HighlightRuleBuilderDialog.tooltip.ExpBuilder" ) ); //$NON-NLS-1$ expBuilder.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { editValue( expression ); } } ); operator = new Combo( condition, SWT.READ_ONLY ); for ( int i = 0; i < OPERATOR.length; i++ ) { operator.add( OPERATOR[i][0] ); } operator.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { String value = getValueForOperator( operator.getText( ) ); int vv = determineValueVisible( value ); if ( vv == 0 ) { value1.setVisible( false ); value2.setVisible( false ); valBuilder1.setVisible( false ); valBuilder2.setVisible( false ); andLable.setVisible( false ); } else if ( vv == 1 ) { value1.setVisible( true ); valBuilder1.setVisible( true ); value2.setVisible( false ); valBuilder2.setVisible( false ); andLable.setVisible( false ); } else if ( vv == 2 ) { value1.setVisible( true ); value2.setVisible( true ); valBuilder1.setVisible( true ); valBuilder2.setVisible( true ); andLable.setVisible( true ); } updateButtons( ); } } ); value1 = createText( condition ); value1.addModifyListener( new ModifyListener( ) { public void modifyText( ModifyEvent e ) { updateButtons( ); } } ); valBuilder1 = new Button( condition, SWT.PUSH ); valBuilder1.setText( "..." ); //$NON-NLS-1$ gdata = new GridData( ); gdata.heightHint = 20; gdata.widthHint = 20; valBuilder1.setLayoutData( gdata ); valBuilder1.setToolTipText( Messages .getString( "HighlightRuleBuilderDialog.tooltip.ExpBuilder" ) ); //$NON-NLS-1$ valBuilder1.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { editValue( value1 ); } } ); createDummy( condition, 3 ); andLable = new Label( condition, SWT.NONE ); andLable.setText( Messages .getString( "HighlightRuleBuilderDialog.text.AND" ) ); //$NON-NLS-1$ andLable.setVisible( false ); createDummy( condition, 1 ); createDummy( condition, 3 ); value2 = createText( condition ); value2.addModifyListener( new ModifyListener( ) { public void modifyText( ModifyEvent e ) { updateButtons( ); } } ); value2.setVisible( false ); valBuilder2 = new Button( condition, SWT.PUSH ); valBuilder2.setText( "..." ); //$NON-NLS-1$ gdata = new GridData( ); gdata.heightHint = 20; gdata.widthHint = 20; valBuilder2.setLayoutData( gdata ); valBuilder2.setToolTipText( Messages .getString( "HighlightRuleBuilderDialog.tooltip.ExpBuilder" ) ); //$NON-NLS-1$ valBuilder2.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { editValue( value2 ); } } ); valBuilder2.setVisible( false ); if ( operator.getItemCount( ) > 0 ) { operator.select( 0 ); } lb = new Label( innerParent, SWT.NONE ); lb.setText( Messages .getString( "HighlightRuleBuilderDialog.text.Format" ) ); //$NON-NLS-1$ Composite format = new Composite( innerParent, SWT.NONE ); format.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); glayout = new GridLayout( 7, false ); format.setLayout( glayout ); lb = new Label( format, 0 ); lb .setText( Messages .getString( "HighlightRuleBuilderDialog.text.Font" ) ); //$NON-NLS-1$ lb = new Label( format, 0 ); lb .setText( Messages .getString( "HighlightRuleBuilderDialog.text.Size" ) ); //$NON-NLS-1$ lb = new Label( format, 0 ); lb.setText( Messages .getString( "HighlightRuleBuilderDialog.text.Color" ) ); //$NON-NLS-1$ createDummy( format, 4 ); font = new Combo( format, SWT.READ_ONLY ); gdata = new GridData( ); gdata.widthHint = 100; font.setLayoutData( gdata ); IChoiceSet fontSet = ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.FONT_FAMILY_PROP ); font.setData( fontSet ); font.setItems( ChoiceSetFactory.getDisplayNamefromChoiceSet( fontSet, new AlphabeticallyComparator( ) ) ); if ( SYSTEM_FONT_LIST != null && SYSTEM_FONT_LIST.length > 0 ) { for ( int i = 0; i < SYSTEM_FONT_LIST.length; i++ ) { font.add( SYSTEM_FONT_LIST[i] ); } } font.add( DEFAULT_CHOICE, 0 ); font.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { updatePreview( ); } } ); if ( font.getItemCount( ) > 0 ) { font.select( 0 ); } size = new FontSizeBuilder( format, SWT.None ); if ( designHandle != null ) { size.setDefaultUnit( designHandle.getPropertyHandle( StyleHandle.FONT_SIZE_PROP ).getDefaultUnit( ) ); } gdata = new GridData( ); gdata.widthHint = 120; size.setLayoutData( gdata ); size.setFontSizeValue( null ); size.addListener( SWT.Modify, new Listener( ) { public void handleEvent( Event event ) { updatePreview( ); } } ); color = new ColorBuilder( format, 0 ); gdata = new GridData( ); gdata.widthHint = 50; color.setLayoutData( gdata ); color.setChoiceSet( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.COLOR_PROP ) ); color.setRGB( null ); color.addListener( SWT.Modify, new Listener( ) { public void handleEvent( Event event ) { previewLabel.setForeground( ColorManager.getColor( color .getRGB( ) ) ); previewLabel.redraw( ); } } ); Composite fstyle = new Composite( format, 0 ); gdata = new GridData( ); gdata.horizontalSpan = 4; fstyle.setLayoutData( gdata ); fstyle.setLayout( new GridLayout( 4, false ) ); bold = createToggleButton( fstyle ); bold.setImage( ReportPlatformUIImages .getImage( AttributeConstant.FONT_WIDTH ) ); bold.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { isBoldChanged = true; updatePreview( ); } } ); bold.setToolTipText(Messages .getString("HighlightRuleBuilderDialog.tooltip.Bold")); italic = createToggleButton( fstyle ); italic.setImage( ReportPlatformUIImages .getImage( AttributeConstant.FONT_STYLE ) ); italic.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { isItalicChanged = true; updatePreview( ); } } ); italic.setToolTipText(Messages .getString("HighlightRuleBuilderDialog.tooltip.Italic")); underline = createToggleButton( fstyle ); underline.setImage( ReportPlatformUIImages .getImage( AttributeConstant.TEXT_UNDERLINE ) ); underline.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { isUnderlineChanged = true; previewLabel.setUnderline( underline.getSelection( ) ); previewLabel.redraw( ); } } ); underline.setToolTipText(Messages .getString("HighlightRuleBuilderDialog.tooltip.Underline")); linethrough = createToggleButton( fstyle ); linethrough.setImage( ReportPlatformUIImages .getImage( AttributeConstant.TEXT_LINE_THROUGH ) ); linethrough.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { isLinethroughChanged = true; previewLabel.setLinethrough( linethrough.getSelection( ) ); previewLabel.redraw( ); } } ); linethrough .setToolTipText(Messages .getString("HighlightRuleBuilderDialog.tooltip.Text_Line_Through")); Composite back = new Composite( innerParent, SWT.NONE ); back.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); glayout = new GridLayout( 1, false ); back.setLayout( glayout ); lb = new Label( back, 0 ); lb .setText( Messages .getString( "HighlightRuleBuilderDialog.text.BackgroundColor" ) ); //$NON-NLS-1$ backColor = new ColorBuilder( back, 0 ); gdata = new GridData( ); gdata.widthHint = 50; backColor.setLayoutData( gdata ); backColor.setChoiceSet( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.BACKGROUND_COLOR_PROP ) ); backColor.setRGB( null ); backColor.addListener( SWT.Modify, new Listener( ) { public void handleEvent( Event event ) { previewLabel.setBackground( ColorManager.getColor( backColor .getRGB( ) ) ); previewLabel.redraw( ); } } ); Composite preview = new Composite( innerParent, SWT.NONE ); glayout = new GridLayout( ); preview.setLayout( glayout ); gdata = new GridData( GridData.FILL_BOTH ); preview.setLayoutData( gdata ); lb = new Label( preview, SWT.NONE ); lb.setText( Messages .getString( "HighlightRuleBuilderDialog.text.Preview" ) ); //$NON-NLS-1$ Composite previewPane = new Composite( preview, SWT.BORDER ); glayout = new GridLayout( ); glayout.marginWidth = 0; glayout.marginHeight = 0; previewPane.setLayout( glayout ); gdata = new GridData( GridData.FILL_BOTH ); gdata.heightHint = 60; previewPane.setLayoutData( gdata ); previewLabel = new PreviewLabel( previewPane, 0 ); previewLabel.setText( Messages .getString( "HighlightRuleBuilderDialog.text.PreviewContent" ) ); //$NON-NLS-1$ gdata = new GridData( GridData.FILL_BOTH ); previewLabel.setLayoutData( gdata ); updatePreview( ); lb = new Label( innerParent, SWT.SEPARATOR | SWT.HORIZONTAL ); lb.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); syncViewProperties( ); updatePreview( ); updateButtons( ); return composite; } | 46013 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46013/1cbdabafb0e6f5e8a50eeb05f5cc3d2a2fff1551/HighlightRuleBuilder.java/clean/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/HighlightRuleBuilder.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
8888,
752,
6323,
12,
14728,
982,
262,
202,
95,
202,
202,
6313,
751,
314,
892,
31,
202,
202,
6313,
3744,
5118,
2012,
31,
202,
202,
2640,
4247,
5484,
12,
982,
11272,
202,
202,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
8888,
752,
6323,
12,
14728,
982,
262,
202,
95,
202,
202,
6313,
751,
314,
892,
31,
202,
202,
6313,
3744,
5118,
2012,
31,
202,
202,
2640,
4247,
5484,
12,
982,
11272,
202,
202,
... |
{ if (fields == null) throw new PSQLException("postgresql.con.tuple"); Object tuple = pg_stream.ReceiveTuple(fields.length, isBinary); if (isBinary) binaryCursor = true; if (maxRows == 0 || tuples.size() < maxRows) tuples.addElement(tuple); } | { if (fields == null) throw new PSQLException("postgresql.con.tuple"); Object tuple = pg_stream.ReceiveTuple(fields.length, isBinary); if (isBinary) binaryCursor = true; if (maxRows == 0 || tuples.size() < maxRows) tuples.addElement(tuple); } | private void receiveTuple(boolean isBinary) throws SQLException { if (fields == null) throw new PSQLException("postgresql.con.tuple"); Object tuple = pg_stream.ReceiveTuple(fields.length, isBinary); if (isBinary) binaryCursor = true; if (maxRows == 0 || tuples.size() < maxRows) tuples.addElement(tuple); } | 46409 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46409/ef7d7910745cf2812007668138eaaf0a8e1d8d99/QueryExecutor.java/buggy/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
6798,
9038,
12,
6494,
353,
5905,
13,
1216,
6483,
202,
95,
202,
202,
430,
261,
2821,
422,
446,
13,
1082,
202,
12849,
394,
453,
23116,
2932,
2767,
24330,
18,
591,
18,
8052... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
6798,
9038,
12,
6494,
353,
5905,
13,
1216,
6483,
202,
95,
202,
202,
430,
261,
2821,
422,
446,
13,
1082,
202,
12849,
394,
453,
23116,
2932,
2767,
24330,
18,
591,
18,
8052... |
else if (pixels instanceof short[]) { short[] s = (short[]) pixels; if (s.length > w*h) { short[] tmp = s; s = new short[w*h]; System.arraycopy(tmp, 0, s, 0, s.length); } | else { if (stackO == null) stackO = new ImageStack(w, h); ip = new ColorProcessor(w, h); byte[][] pix = new byte[c][w*h]; if (r.isInterleaved(id)) { for (int k=0; k<bytes.length; k+=c) { for (int l=0; l<c; l++) { pix[l][k / 3] = bytes[k + l]; } } } else { for (int k=0; k<c; k++) { System.arraycopy(bytes, 0, pix[k], 0, pix[k].length); System.arraycopy(bytes, pix[k].length, pix[k], 0, pix[k].length); System.arraycopy(bytes, 2*pix[k].length, pix[k], 0, pix[k].length); } } ((ColorProcessor) ip).setRGB(pix[0], pix[1], pix.length >= 3 ? pix[2] : new byte[w*h]); stackO.addSlice(imageName + ":" + (j + 1), ip); } } else if (pixels instanceof short[]) { short[] s = (short[]) pixels; if (s.length > w*h*c) { short[] tmp = s; s = new short[w*h*c]; System.arraycopy(tmp, 0, s, 0, s.length); } if (c == 1) { | public void run(String arg) { boolean quiet = arg != null && !arg.equals(""); String options = Macro.getOptions(); // -- Step 1: get filename to open -- String id = null; // try to get filename from argument if (quiet) id = arg; if (id == null) { // try to get filename from macro options if (options != null) { String open = Macro.getValue(options, "open", null); if (open != null) id = open; } } // if necessary, prompt the user for the filename OpenDialog od = new OpenDialog("Open", id); String directory = od.getDirectory(); String fileName = od.getFileName(); if (fileName == null) { plugin.canceled = true; return; } id = directory + fileName; // if no valid filename, give up if (id == null || !new File(id).exists()) { if (!quiet) { IJ.error("LOCI Bio-Formats", "The specified file " + (id == null ? "" : ("(" + id + ") ")) + "does not exist."); } return; } // -- Step 2: identify file -- IJ.showStatus("Identifying " + fileName); // determine whether we can handle this file ImageReader reader = new ImageReader(); IFormatReader r = null; try { r = reader.getReader(id); } catch (Exception exc) { exc.printStackTrace(); IJ.showStatus(""); if (!quiet) { String msg = exc.getMessage(); IJ.error("LOCI Bio-Formats", "Sorry, there was a problem " + "reading the file" + (msg == null ? "." : (":\n" + msg))); } return; } // -- Step 3: get parameter values -- IJ.showStatus(""); final String mergeString = "Merge channels to RGB"; final String ignoreString = "Ignore color lookup table"; final String colorizeString = "Colorize channels"; final String splitString = "Open each channel in its own window"; final String metadataString = "Display associated metadata"; final String stitchString = "Stitch files with similar names"; final String rangeString = "Specify range for each series"; // load preferences from IJ_Prefs.txt boolean mergeChannels = Prefs.get("bioformats.mergeChannels", false); boolean ignoreTables = Prefs.get("bioformats.ignoreTable", false); boolean colorize = Prefs.get("bioformats.colorize", false); boolean splitWindows = Prefs.get("bioformats.splitWindows", true); boolean showMetadata = Prefs.get("bioformats.showMetadata", false); boolean stitchFiles = Prefs.get("bioformats.stitchFiles", false); boolean specifyRanges = Prefs.get("bioformats.specifyRanges", false); // prompt for parameters, if necessary GenericDialog pd = new GenericDialog("LOCI Bio-Formats Import Options"); pd.addCheckbox(mergeString, mergeChannels); pd.addCheckbox(ignoreString, ignoreTables); pd.addCheckbox(colorizeString, colorize); pd.addCheckbox(splitString, splitWindows); pd.addCheckbox(metadataString, showMetadata); pd.addCheckbox(stitchString, stitchFiles); pd.addCheckbox(rangeString, specifyRanges); pd.showDialog(); if (pd.wasCanceled()) { plugin.canceled = true; return; } mergeChannels = pd.getNextBoolean(); ignoreTables = pd.getNextBoolean(); colorize = pd.getNextBoolean(); splitWindows = pd.getNextBoolean(); showMetadata = pd.getNextBoolean(); stitchFiles = pd.getNextBoolean(); specifyRanges = pd.getNextBoolean(); // -- Step 4: open file -- IJ.showStatus("Analyzing " + fileName); try { boolean doRGBMerge = false; // -- Step 4a: do some preparatory work -- if (mergeChannels) r = new ChannelMerger(r); else r = new ChannelSeparator(r); if (stitchFiles) r = new FileStitcher(r); r.setColorTableIgnored(ignoreTables); // store OME metadata into OME-XML structure, if available OMEXMLMetadataStore store = new OMEXMLMetadataStore(); store.createRoot(); r.setMetadataStore(store); int seriesCount = r.getSeriesCount(id); boolean[] series = new boolean[seriesCount]; series[0] = true;// store = (OMEXMLMetadataStore) r.getMetadataStore(id); // build descriptive string and range for each series String[] seriesStrings = new String[seriesCount]; int[] num = new int[seriesCount]; int[] begin = new int[seriesCount]; int[] end = new int[seriesCount]; int[] step = new int[seriesCount]; for (int i=0; i<seriesCount; i++) { r.setSeries(id, i); num[i] = r.getImageCount(id); StringBuffer sb = new StringBuffer(); sb.append("Series_"); sb.append(i + 1); sb.append(" - "); String name = store.getImageName(new Integer(i)); if (name != null && name.length() > 0) { sb.append(name); sb.append(": "); } sb.append(r.getSizeX(id)); sb.append(" x "); sb.append(r.getSizeY(id)); sb.append("; "); sb.append(num[i]); sb.append(" planes"); if (r.isOrderCertain(id)) { sb.append(" ("); boolean first = true; int sizeC = r.getSizeC(id); int sizeZ = r.getSizeZ(id); int sizeT = r.getSizeT(id); if (sizeC > 1) { sb.append(sizeC); sb.append("C"); first = false; } if (sizeZ > 1) { if (!first) sb.append(" x "); sb.append(sizeZ); sb.append("Z"); first = false; } if (sizeT > 1) { if (!first) sb.append(" x "); sb.append(sizeT); sb.append("T"); first = false; } sb.append(")"); } seriesStrings[i] = sb.toString(); begin[i] = 0; end[i] = num[i] - 1; step[i] = 1; } // -- Step 4a: prompt for the series to open, if necessary -- if (seriesCount > 1) { IJ.showStatus(""); GenericDialog sd = new GenericDialog("LOCI Bio-Formats Series Options"); for (int i=0; i<seriesCount; i++) { sd.addCheckbox(seriesStrings[i], series[i]); } addScrollBars(sd); sd.showDialog(); if (sd.wasCanceled()) { plugin.canceled = true; return; } for (int i=0; i<seriesCount; i++) series[i] = sd.getNextBoolean(); } // -- Step 4b: prompt for the range of planes to import, if necessary -- if (specifyRanges) { boolean needRange = false; for (int i=0; i<seriesCount; i++) { if (series[i] && num[i] > 1) needRange = true; } if (needRange) { IJ.showStatus(""); GenericDialog rd = new GenericDialog("LOCI Bio-Formats Range Options"); for (int i=0; i<seriesCount; i++) { if (!series[i]) continue; rd.addMessage(seriesStrings[i].replaceAll("_", " ")); String s = "_" + (i + 1); rd.addNumericField("Begin" + s, begin[i] + 1, 0); rd.addNumericField("End" + s, end[i] + 1, 0); rd.addNumericField("Step" + s, step[i], 0); } addScrollBars(rd); rd.showDialog(); if (rd.wasCanceled()) { plugin.canceled = true; return; } for (int i=0; i<seriesCount; i++) { if (!series[i]) continue; begin[i] = (int) rd.getNextNumber() - 1; end[i] = (int) rd.getNextNumber() - 1; step[i] = (int) rd.getNextNumber(); if (begin[i] < 0) begin[i] = 0; if (begin[i] >= num[i]) begin[i] = num[i] - 1; if (end[i] < begin[i]) end[i] = begin[i]; if (end[i] >= num[i]) end[i] = num[i] - 1; if (step[i] < 1) step[i] = 1; } } } // -- Step 4c: display metadata, when appropriate -- if (showMetadata) { IJ.showStatus("Populating metadata"); // display standard metadata in a table in its own window Hashtable meta = r.getMetadata(id); meta.put("\tSizeX", new Integer(r.getSizeX(id))); meta.put("\tSizeY", new Integer(r.getSizeY(id))); meta.put("\tSizeZ", new Integer(r.getSizeZ(id))); meta.put("\tSizeT", new Integer(r.getSizeT(id))); meta.put("\tSizeC", new Integer(r.getSizeC(id))); meta.put("\tIsRGB", new Boolean(r.isRGB(id))); meta.put("\tPixelType", FormatReader.getPixelTypeString(r.getPixelType(id))); meta.put("\tLittleEndian", new Boolean(r.isLittleEndian(id))); meta.put("\tDimensionOrder", r.getDimensionOrder(id)); meta.put("\tIsInterleaved", new Boolean(r.isInterleaved(id))); MetadataPane mp = new MetadataPane(meta); JFrame frame = new JFrame(id + " Metadata"); frame.setContentPane(mp); frame.pack(); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); WindowManager.addWindow(frame); } // -- Step 4d: read pixel data -- IJ.showStatus("Reading " + fileName); for (int i=0; i<seriesCount; i++) { if (!series[i]) continue; r.setSeries(id, i); String name = store.getImageName(new Integer(i)); String imageName = fileName; if (name != null && name.length() > 0) imageName += " - " + name; int total = (end[i] - begin[i]) / step[i] + 1; // dump OME-XML to ImageJ's description field, if available FileInfo fi = new FileInfo(); fi.description = store.dumpXML(); long startTime = System.currentTimeMillis(); long time = startTime; ImageStack stackB = null, stackS = null, stackF = null, stackO = null; int channels = r.getSizeC(id); int sizeZ = r.getSizeZ(id); int sizeT = r.getSizeT(id); if (specifyRanges && num[i] > 1) { // reset sizeZ and sizeT if we aren't opening the entire series sizeZ = begin[i]; sizeT = end[i]; // CTR: huh? this makes no sense /* if (channels > 1) { channels = r.getIndex(id, 0, 1, 0) - r.getIndex(id, 0, 0, 0); } */ } int q = 0; for (int j=begin[i]; j<=end[i]; j+=step[i]) { // limit message update rate long clock = System.currentTimeMillis(); if (clock - time >= 100) { IJ.showStatus("Reading " + (seriesCount > 1 ? "series " + (i + 1) + ", " : "") + "plane " + (j + 1) + "/" + (end[i] + 1)); time = clock; } IJ.showProgress((double) q++ / total); byte[] b = r.openBytes(id, j); int w = r.getSizeX(id); int h = r.getSizeY(id); int c = r.isRGB(id) ? r.getSizeC(id) : 1; int type = r.getPixelType(id); // construct image processor and add to stack ImageProcessor ip = null; int bpp = 0; switch (type) { case FormatReader.INT8: case FormatReader.UINT8: bpp = 1; break; case FormatReader.INT16: case FormatReader.UINT16: bpp = 2; break; case FormatReader.INT32: case FormatReader.UINT32: case FormatReader.FLOAT: bpp = 4; break; case FormatReader.DOUBLE: bpp = 8; break; } if (b.length != w * h * c * bpp) { BufferedImage bi = r.openImage(id, j); b = ImageTools.padImage(b, r.isInterleaved(id), c, bi.getWidth()*bpp, w, h); } Object pixels = DataTools.makeDataArray(b, bpp, type == FormatReader.FLOAT || type == FormatReader.DOUBLE, r.isLittleEndian(id)); if (c == 1) { if (pixels instanceof byte[]) { byte[] bytes = (byte[]) pixels; if (bytes.length > w*h) { byte[] tmp = bytes; bytes = new byte[w*h]; System.arraycopy(tmp, 0, bytes, 0, bytes.length); } ip = new ByteProcessor(w, h, bytes, null); if (stackB == null) stackB = new ImageStack(w, h); stackB.addSlice(imageName + ":" + (j + 1), ip); } else if (pixels instanceof short[]) { short[] s = (short[]) pixels; if (s.length > w*h) { short[] tmp = s; s = new short[w*h]; System.arraycopy(tmp, 0, s, 0, s.length); } ip = new ShortProcessor(w, h, s, null); if (stackS == null) stackS = new ImageStack(w, h); stackS.addSlice(imageName + ":" + (j + 1), ip); } else if (pixels instanceof int[]) { int[] ints = (int[]) pixels; if (ints.length > w*h) { int[] tmp = ints; ints = new int[w*h]; System.arraycopy(tmp, 0, ints, 0, ints.length); } ip = new FloatProcessor(w, h, ints); if (stackF == null) stackF = new ImageStack(w, h); stackF.addSlice(imageName + ":" + (j + 1), ip); } else if (pixels instanceof float[]) { float[] f = (float[]) pixels; if (f.length > w*h) { float[] tmp = f; f = new float[w*h]; System.arraycopy(tmp, 0, f, 0, f.length); } ip = new FloatProcessor(w, h, f, null); if (stackF == null) stackF = new ImageStack(w, h); if (stackB != null) { ip = ip.convertToByte(true); stackB.addSlice(imageName + ":" + (j + 1), ip); stackF = null; } else if (stackS != null) { ip = ip.convertToShort(true); stackS.addSlice(imageName + ":" + (j + 1), ip); stackF = null; } else stackF.addSlice(imageName + ":" + (j + 1), ip); } else if (pixels instanceof double[]) { double[] d = (double[]) pixels; if (d.length > w*h) { double[] tmp = d; d = new double[w*h]; System.arraycopy(tmp, 0, d, 0, d.length); } ip = new FloatProcessor(w, h, d); if (stackF == null) stackF = new ImageStack(w, h); stackF.addSlice(imageName + ":" + (j + 1), ip); } } if (ip == null) { ip = new ColorProcessor(w, h, ImageTools.make24Bits(pixels, w, h, r.isInterleaved(id))); if (stackO == null) stackO = new ImageStack(w, h); stackO.addSlice(imageName + ":" + (j + 1), ip); } } IJ.showStatus("Creating image"); IJ.showProgress(1); ImagePlus imp = null; if (stackB != null) { if (!mergeChannels && splitWindows) { slice(stackB, id, sizeZ, channels, sizeT, fi, r, specifyRanges, colorize); } else imp = new ImagePlus(imageName, stackB); } if (stackS != null) { if (!mergeChannels && splitWindows) { slice(stackS, id, sizeZ, channels, sizeT, fi, r, specifyRanges, colorize); } else imp = new ImagePlus(imageName, stackS); } if (stackF != null) { if (!mergeChannels && splitWindows) { slice(stackF, id, sizeZ, channels, sizeT, fi, r, specifyRanges, colorize); } else imp = new ImagePlus(imageName, stackF); } if (stackO != null) { if (!mergeChannels && splitWindows) { slice(stackO, id, sizeZ, channels, sizeT, fi, r, specifyRanges, colorize); } else imp = new ImagePlus(imageName, stackO); } if (imp != null) { // retrieve the spatial calibration information, if available double xcal = Double.NaN, ycal = Double.NaN, zcal = Double.NaN; Integer ii = new Integer(i); Float xf = store.getPixelSizeX(ii); if (xf != null) xcal = xf.floatValue(); Float yf = store.getPixelSizeY(ii); if (yf != null) ycal = yf.floatValue(); Float zf = store.getPixelSizeZ(ii); if (zf != null) zcal = zf.floatValue(); if (xcal != Double.NaN || ycal != Double.NaN || zcal != Double.NaN) { Calibration c = new Calibration(); if (xcal == xcal) { c.pixelWidth = xcal; c.setUnit("micron"); } if (ycal == ycal) { c.pixelHeight = ycal; c.setUnit("micron"); } if (zcal == zcal) { c.pixelDepth = zcal; c.setUnit("micron"); } imp.setCalibration(c); } imp.setFileInfo(fi); int c = r.getSizeC(id); r.close(); if (doRGBMerge) { ImageStack is = imp.getImageStack(); int w = is.getWidth(), h = is.getHeight(); ImageStack newStack = new ImageStack(w, h); ImageProcessor[] procs = new ImageProcessor[c]; for (int k=0; k<is.getSize(); k+=c) { for (int j=0; j<c; j++) { procs[j] = is.getProcessor(k + j + 1); procs[j] = procs[j].convertToByte(true); } byte[] red = new byte[w * h]; byte[] green = new byte[w * h]; byte[] blue = new byte[w * h]; red = (byte[]) procs[0].getPixels(); if (c > 1) green = (byte[]) procs[1].getPixels(); if (c > 2) blue = (byte[]) procs[2].getPixels(); ColorProcessor color = new ColorProcessor(w, h); color.setRGB(red, green, blue); newStack.addSlice(is.getSliceLabel(k + 1), color); } imp.setStack(imp.getTitle(), newStack); } imp.show(); } long endTime = System.currentTimeMillis(); double elapsed = (endTime - startTime) / 1000.0; if (num[i] == 1) { IJ.showStatus("LOCI Bio-Formats: " + elapsed + " seconds"); } else { long average = (endTime - startTime) / num[i]; IJ.showStatus("LOCI Bio-Formats: " + elapsed + " seconds (" + average + " ms per plane)"); } } r.close(); plugin.success = true; // save parameter values to IJ_Prefs.txt Prefs.set("bioformats.mergeChannels", mergeChannels); Prefs.set("bioformats.ignoreTables", ignoreTables); Prefs.set("bioformats.colorize", colorize); Prefs.set("bioformats.splitWindows", splitWindows); Prefs.set("bioformats.showMetadata", showMetadata); Prefs.set("bioformats.stitchFiles", stitchFiles); Prefs.set("bioformats.specifyRanges", specifyRanges); } catch (Exception exc) { exc.printStackTrace(); IJ.showStatus(""); if (!quiet) { String msg = exc.getMessage(); IJ.error("LOCI Bio-Formats", "Sorry, there was a problem " + "reading the data" + (msg == null ? "." : (":\n" + msg))); } } } | 46826 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46826/e206452be43c8e5f32e884d183e79d865fed25ca/Importer.java/buggy/loci/plugins/Importer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
1086,
12,
780,
1501,
13,
288,
565,
1250,
10902,
273,
1501,
480,
446,
597,
401,
3175,
18,
14963,
2932,
8863,
565,
514,
702,
273,
31203,
18,
588,
1320,
5621,
565,
368,
1493,
86... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
1086,
12,
780,
1501,
13,
288,
565,
1250,
10902,
273,
1501,
480,
446,
597,
401,
3175,
18,
14963,
2932,
8863,
565,
514,
702,
273,
31203,
18,
588,
1320,
5621,
565,
368,
1493,
86... |
if (_state==STATE_EOF_CONTENT) | if (_state==STATE_CONTENT_PACKET_EOF) | public long parseNext() throws IOException { long totalFilled=-1; if (_buffer==null) { _buffer=_buffers.getBuffer(Ajp13Packet.MAX_PACKET_SIZE); _ajpRequestPacket.setBuffer(_buffer); } if (_state==STATE_END) throw new IllegalStateException("STATE_END"); int length=_buffer.length(); if (length==0) { int filled=-1; if (_buffer.markIndex()==0&&_buffer.putIndex()==_buffer.capacity()) throw new IOException("FULL"); if (_endp!=null&&filled<=0) { if (_buffer.space()==0) throw new IOException("FULL"); try { if (totalFilled<0) totalFilled=0; filled=_endp.fill(_buffer); if (filled>0) totalFilled+=filled; } catch (IOException ioe) { Log.debug(ioe); reset(true); throw (ioe instanceof EofException)?ioe:new EofException(ioe); } } if (filled<0) { if (_state==STATE_EOF_CONTENT) { _state=STATE_END; return totalFilled; } else { reset(true); throw new EofException(); } } length=_buffer.length(); } // Parse Header while (_state<STATE_END&&length-->0) { _ajpRequestPacket.next(); switch (_state) { case STATE_START: if (_ajpRequestPacket.parsedInt()) { int _magic=_ajpRequestPacket.getInt(); if (_magic!=Ajp13RequestHeaders.MAGIC) { throw new IOException("Bad AJP13 rcv packet: "+"0x"+Integer.toHexString(_magic)+" expected "+"0x" +Integer.toHexString(Ajp13RequestHeaders.MAGIC)+" "+this); } _state=STATE_PACKET_LENGTH; } break; case STATE_PACKET_LENGTH: if (_ajpRequestPacket.parsedInt()) { int packetLength=_ajpRequestPacket.getInt(); if (packetLength>Ajp13Packet.MAX_PACKET_SIZE) throw new IOException("AJP13 packet ("+packetLength+"bytes) too large for buffer"); _state=STATE_PACKET_TYPE; } break; case STATE_PACKET_TYPE: byte packetType=_ajpRequestPacket.getByte(); switch (packetType) { case Ajp13Packet.FORWARD_REQUEST_ORDINAL: _handler.startForwardRequest(); _state=STATE_REQUEST_METHOD; break; case Ajp13Packet.SHUTDOWN_ORDINAL: // Log.warn("AJP13 SHUTDOWN not supported!"); // break; case Ajp13Packet.CPING_REQUEST_ORDINAL: // handler.cpingRequest(); // break; default: // XXX Throw an Exception here?? Close connection! Log.warn("AJP13 message type ({}) not supported/regonised as a "+"container request",Integer.toString(packetType)); } break; case STATE_REQUEST_METHOD: _handler.parsedMethod(_ajpRequestPacket.getMethod()); _state=STATE_REQUEST_PROTOCOL; break; case STATE_REQUEST_PROTOCOL: if (_ajpRequestPacket.parsedString()) { _handler.parsedProtocol(_ajpRequestPacket.getString()); _state=STATE_REQUEST_URI; } break; case STATE_REQUEST_URI: if (_ajpRequestPacket.parsedString()) { _handler.parsedUri(_ajpRequestPacket.getString()); _state=STATE_REQUEST_REMOTE_ADDR; } break; case STATE_REQUEST_REMOTE_ADDR: if (_ajpRequestPacket.parsedString()) { _handler.parsedRemoteAddr(_ajpRequestPacket.getString()); _state=STATE_REQUEST_REMOTE_HOST; } break; case STATE_REQUEST_REMOTE_HOST: if (_ajpRequestPacket.parsedString()) { _handler.parsedRemoteHost(_ajpRequestPacket.getString()); _state=STATE_REQUEST_SERVER_NAME; } break; case STATE_REQUEST_SERVER_NAME: if (_ajpRequestPacket.parsedString()) { _handler.parsedServerName(_ajpRequestPacket.getString()); _state=STATE_REQUEST_SERVER_PORT; } break; case STATE_REQUEST_SERVER_PORT: if (_ajpRequestPacket.parsedInt()) { _handler.parsedServerPort(_ajpRequestPacket.getInt()); _state=STATE_REQUEST_SSL_SECURE; } break; case STATE_REQUEST_SSL_SECURE: _handler.parsedSslSecure(_ajpRequestPacket.getBool()); _state=STATE_REQUEST_HEADERS; break; case STATE_REQUEST_HEADERS: if (_ajpRequestPacket.parsedHeaderCount()) { _state=_ajpRequestPacket.parsedHeaders()?STATE_REQUEST_ATTR:STATE_REQUEST_HEADER_NAME; } break; case STATE_REQUEST_HEADER_NAME: if (_ajpRequestPacket.parsedHeaderName()) { _state=STATE_REQUEST_HEADER_VALUE; } break; case STATE_REQUEST_HEADER_VALUE: if (_ajpRequestPacket.parsedString()) { _handler.parsedHeader(_ajpRequestPacket.getHeaderName(),_ajpRequestPacket.getString()); _state=_ajpRequestPacket.parsedHeaders()?STATE_REQUEST_ATTR:STATE_REQUEST_HEADER_NAME; } break; case STATE_REQUEST_ATTR: if ((0xFF&_ajpRequestPacket.parsedAttributeType())!=0xFF) { _state=STATE_REQUEST_ATTR_VALUE; } else { _state=STATE_END; } break; case STATE_REQUEST_ATTR_VALUE: if (_ajpRequestPacket.parsedString()) { _state=STATE_REQUEST_ATTR; switch (_ajpRequestPacket.getAttributeType()) { // XXX How does this plug into the web containers // authentication? case Ajp13RequestHeaders.REMOTE_USER_ATTR: case Ajp13RequestHeaders.AUTH_TYPE_ATTR: break; case Ajp13RequestHeaders.QUERY_STRING_ATTR: _handler.parsedQueryString(_ajpRequestPacket.getString()); break; case Ajp13RequestHeaders.JVM_ROUTE_ATTR: // XXX Using old Jetty 5 key, should change! // Note used in // org.mortbay.jetty.servlet.HashSessionIdManager _handler.parsedRequestAttribute("org.mortbay.http.ajp.JVMRoute",_ajpRequestPacket.getString()); break; case Ajp13RequestHeaders.SSL_CERT_ATTR: _handler.parsedRequestAttribute("javax.servlet.request.cipher_suite",_ajpRequestPacket.getString()); break; case Ajp13RequestHeaders.SSL_CIPHER_ATTR: // XXX Implement! Investigate // SslSocketConnector.customize() break; case Ajp13RequestHeaders.SSL_SESSION_ATTR: _handler.parsedRequestAttribute("javax.servlet.request.ssl_session",_ajpRequestPacket.getString()); break; case Ajp13RequestHeaders.REQUEST_ATTR: _state=STATE_REQUEST_ATTR_VALUE2; break; // New Jk API? // Check if experimental or can they assumed to be // supported case Ajp13RequestHeaders.SSL_KEYSIZE_ATTR: _handler.parsedRequestAttribute("javax.servlet.request.key_size",_ajpRequestPacket.getString()); break; // Used to lock down jk requests with a secreate // key. case Ajp13RequestHeaders.SECRET_ATTR: // XXX Investigate safest way to deal with // this... // should this tie into shutdown packet? break; case Ajp13RequestHeaders.STORED_METHOD_ATTR: // XXX Confirm this should really overide // previously parsed method? // _handler.parsedMethod(Ajp13PacketMethods.CACHE.get(_ajpRequestPacket.getString())); break; // Legacy codes, simply ignore case Ajp13RequestHeaders.CONTEXT_ATTR: case Ajp13RequestHeaders.SERVLET_PATH_ATTR: default: Log.warn("Unsupported Ajp13 Request Attribute {}:{}",new Byte(_ajpRequestPacket.getAttributeType()),_ajpRequestPacket .getString()); break; } _state=STATE_REQUEST_ATTR; } break; case STATE_REQUEST_ATTR_VALUE2: if (_ajpRequestPacket.parsedString()) { _handler.parsedRequestAttribute(_ajpRequestPacket.getAttributeKey(),_ajpRequestPacket.getString()); _state=STATE_REQUEST_ATTR; } break; default: throw new IllegalStateException("State not regonised {"+_state+"}"); } } // ajp header is complete handle the request here _handler.headerComplete(); return totalFilled; } | 13242 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13242/193de5b32d8185ac51c98b2bd93cf2bf81927970/Ajp13Parser.java/buggy/trunk/extras/ajp/src/main/java/org/mortbay/jetty/ajp/Ajp13Parser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1525,
1109,
2134,
1435,
1216,
1860,
565,
288,
3639,
1525,
2078,
29754,
29711,
21,
31,
3639,
309,
261,
67,
4106,
631,
2011,
13,
3639,
288,
5411,
389,
4106,
33,
67,
28101,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1525,
1109,
2134,
1435,
1216,
1860,
565,
288,
3639,
1525,
2078,
29754,
29711,
21,
31,
3639,
309,
261,
67,
4106,
631,
2011,
13,
3639,
288,
5411,
389,
4106,
33,
67,
28101,
18,
588,
... |
"XML node is not an Element or Text node. Only Elements and Text nodes are currently supported. Node class: " | "XML node is not an Element or Text node. Only Elements and " + "Text nodes are currently supported. Node class: " | protected Object getJavaScriptElementFromXmlNode(Node xmlNode, HtmlPage page) { if ( xmlNode == null ) { return null; } if ( ( xmlNode instanceof Element ) == false && ( xmlNode instanceof Text ) == false ) { if( xmlNode instanceof HTMLDocumentImpl == false ) { throw new IllegalStateException( "XML node is not an Element or Text node. Only Elements and Text nodes are currently supported. Node class: " + xmlNode.getClass() ); } return null; } final HtmlElement htmlElement = page.getHtmlElement( xmlNode ); final Object jsElement = getScriptableFor( htmlElement ); return jsElement; } | 3508 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3508/dd08378a7beeec7e434505b75cbb90e156be6e65/HTMLElement.java/clean/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host/HTMLElement.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
1033,
336,
16634,
1046,
1265,
4432,
907,
12,
907,
2025,
907,
16,
3639,
5430,
1964,
1363,
13,
288,
3639,
309,
261,
2025,
907,
422,
446,
262,
288,
5411,
327,
446,
31,
3639,
289,
363... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
1033,
336,
16634,
1046,
1265,
4432,
907,
12,
907,
2025,
907,
16,
3639,
5430,
1964,
1363,
13,
288,
3639,
309,
261,
2025,
907,
422,
446,
262,
288,
5411,
327,
446,
31,
3639,
289,
363... |
whatToMove = new LineRange(document.getLineNumber(lineRangeMarker.getStartOffset()), | toMove = new LineRange(document.getLineNumber(lineRangeMarker.getStartOffset()), | protected void beforeMove(final Editor editor) { super.beforeMove(editor); if (statementToSurroundWithCodeBlock != null) { try { final Document document = PsiDocumentManager.getInstance(statementToSurroundWithCodeBlock.getProject()).getDocument(statementToSurroundWithCodeBlock.getContainingFile()); final int startOffset = document.getLineStartOffset(whatToMove.startLine); final int endOffset = document.getLineEndOffset(whatToMove.endLine); final RangeMarker lineRangeMarker = document.createRangeMarker(startOffset, endOffset); final PsiElementFactory factory = statementToSurroundWithCodeBlock.getManager().getElementFactory(); PsiCodeBlock codeBlock = factory.createCodeBlock(); codeBlock.add(statementToSurroundWithCodeBlock); final PsiBlockStatement blockStatement = (PsiBlockStatement)factory.createStatementFromText("{}", statementToSurroundWithCodeBlock); blockStatement.getCodeBlock().replace(codeBlock); PsiBlockStatement newStatement = (PsiBlockStatement)statementToSurroundWithCodeBlock.replace(blockStatement); newStatement = CodeInsightUtil.forcePsiPostprocessAndRestoreElement(newStatement); whatToMove = new LineRange(document.getLineNumber(lineRangeMarker.getStartOffset()), document.getLineNumber(lineRangeMarker.getEndOffset())); PsiCodeBlock newCodeBlock = newStatement.getCodeBlock(); insertOffset = myIsDown ? newCodeBlock.getFirstBodyElement().getTextRange().getEndOffset() : newCodeBlock.getRBrace().getTextRange().getStartOffset(); } catch (IncorrectOperationException e) { LOG.error(e); } } } | 12814 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12814/02c2f546504510bdbd05916539ae0061487b89de/StatementMover.java/buggy/source/com/intellij/openapi/editor/actions/moveUpDown/StatementMover.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
918,
1865,
7607,
12,
6385,
18451,
4858,
13,
288,
565,
2240,
18,
5771,
7607,
12,
9177,
1769,
565,
309,
261,
11516,
774,
7719,
2260,
23973,
1768,
480,
446,
13,
288,
1377,
775,
288,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
918,
1865,
7607,
12,
6385,
18451,
4858,
13,
288,
565,
2240,
18,
5771,
7607,
12,
9177,
1769,
565,
309,
261,
11516,
774,
7719,
2260,
23973,
1768,
480,
446,
13,
288,
1377,
775,
288,
... |
if( (ae instanceof Protomech) && (2 == ((Protomech)ae).getCritsHit(Protomech.LOC_HEAD)) ) { mods.addModifier ( ToHitData.IMPOSSIBLE, "No long range attacks with destroyed head sensors." ); | if ((ae instanceof Protomech) && (2 == ((Protomech) ae) .getCritsHit(Protomech.LOC_HEAD))) { mods .addModifier(ToHitData.IMPOSSIBLE, "No long range attacks with destroyed head sensors."); | public static ToHitData getRangeMods(IGame game, Entity ae, int weaponId, Targetable target) { Mounted weapon = ae.getEquipment(weaponId); WeaponType wtype = (WeaponType)weapon.getType(); int[] weaponRanges = wtype.getRanges(); boolean isAttackerInfantry = (ae instanceof Infantry); boolean isWeaponInfantry = wtype.hasFlag(WeaponType.F_INFANTRY); boolean isLRMInfantry = isWeaponInfantry && wtype.getAmmoType() == AmmoType.T_LRM; boolean isIndirect = ((wtype.getAmmoType() == AmmoType.T_LRM) || (wtype.getAmmoType() == AmmoType.T_LRM_TORPEDO)) && weapon.curMode().equals("Indirect"); boolean useExtremeRange = game.getOptions().booleanOption("maxtech_range"); ToHitData mods = new ToHitData(); // modify the ranges for ATM missile systems based on the ammo selected // TODO: this is not the right place to hardcode these if (wtype.getAmmoType() == AmmoType.T_ATM) { AmmoType atype = (AmmoType)weapon.getLinked().getType(); if ((atype.getAmmoType() == AmmoType.T_ATM) && atype.getMunitionType() == AmmoType.M_EXTENDED_RANGE) { weaponRanges = new int[] {4, 9, 18, 27, 36}; } else if ((atype.getAmmoType() == AmmoType.T_ATM) && atype.getMunitionType() == AmmoType.M_HIGH_EXPLOSIVE) { weaponRanges = new int[] {0, 3, 6, 9, 12}; } } // // modifiy the ranges for PPCs when field inhibitors are turned off // TODO: See above, it should be coded elsewhere... // if (wtype.getName().equals("Particle Cannon")) { if (game.getOptions().booleanOption("maxtech_ppc_inhibitors")) { if (weapon.curMode().equals("Field Inhibitor OFF")) { weaponRanges[0] = 0; } } } //is water involved? IHex attHex = game.getBoard().getHex(ae.getPosition()); IHex targHex = game.getBoard().getHex(target.getPosition()); int targEl; if (target == null) { targEl = game.getBoard().getHex(target.getPosition()).floor(); } else { targEl = target.absHeight(); } if (ae.getLocationStatus(weapon.getLocation()) == ILocationExposureStatus.WET) { weaponRanges = wtype.getWRanges(); //HACK on ranges: for those without underwater range, // long == medium; iteration in rangeBracket() allows this if (weaponRanges[RangeType.RANGE_SHORT] == 0) { return new ToHitData(ToHitData.IMPOSSIBLE, "Weapon cannot fire underwater."); } if (!(targHex.containsTerrain(Terrains.WATER)) || targHex.surface() <= target.getElevation()) { //target on land or over water return new ToHitData(ToHitData.IMPOSSIBLE, "Weapon underwater, but not target."); } } else if (targHex.containsTerrain(Terrains.WATER) && ((targEl + targHex.terrainLevel(Terrains.WATER)) <= 0)) { return new ToHitData(ToHitData.IMPOSSIBLE, "Target underwater, but not weapon."); } else if (wtype.getAmmoType() == AmmoType.T_LRM_TORPEDO || wtype.getAmmoType() == AmmoType.T_SRM_TORPEDO) { // Torpedos only fire underwater. return new ToHitData(ToHitData.IMPOSSIBLE, "Weapon can only fire underwater."); } // determine base distance & range bracket int distance = effectiveDistance(game, ae, target); int range = RangeType.rangeBracket(distance, weaponRanges, useExtremeRange); // short circuit if at zero range or out of range if (range == RangeType.RANGE_OUT) { return new ToHitData(ToHitData.AUTOMATIC_FAIL, "Target out of range"); } if (distance == 0 && !isAttackerInfantry) { return new ToHitData(ToHitData.AUTOMATIC_FAIL, "Only infantry shoot at zero range"); } // find any c3 spotters that could help Entity c3spotter = findC3Spotter(game, ae, target); if (isIndirect) { c3spotter = ae; // no c3 when using indirect fire } int c3dist = effectiveDistance(game, c3spotter, target); int c3range = RangeType.rangeBracket(c3dist, weaponRanges, useExtremeRange); // determine which range we're using int usingRange = Math.min(range, c3range); String targSysType = ""; // Get the targetting system type string ready, if necessary if ((ae.getTargSysType() == MiscType.T_TARGSYS_LONGRANGE) && (ae.getTargSysType() == MiscType.T_TARGSYS_SHORTRANGE)){ targSysType = " (w/"+MiscType.getTargetSysName(ae.getTargSysType())+")"; } // add range modifier if (usingRange == range) { // no c3 adjustment if ((range == RangeType.RANGE_SHORT) && (ae.getShortRangeModifier() != 0)) { mods.addModifier(ae.getShortRangeModifier(), "short range"+targSysType); } else if (range == RangeType.RANGE_MEDIUM) { // Right now, the range-mod affecting targetting systems DON'T affect medium range, so we won't add that here ever. mods.addModifier(ae.getMediumRangeModifier(), "medium range"); } else if (range == RangeType.RANGE_LONG) { // Protos that loose head sensors can't shoot long range. if( (ae instanceof Protomech) && (2 == ((Protomech)ae).getCritsHit(Protomech.LOC_HEAD)) ) { mods.addModifier ( ToHitData.IMPOSSIBLE, "No long range attacks with destroyed head sensors." ); } else { mods.addModifier(ae.getLongRangeModifier(), "long range"+targSysType); } } else if (range == RangeType.RANGE_EXTREME) { // Protos that loose head sensors can't shoot extreme range. if( (ae instanceof Protomech) && (2 == ((Protomech)ae).getCritsHit(Protomech.LOC_HEAD)) ) { mods.addModifier ( ToHitData.IMPOSSIBLE, "No extreme range attacks with destroyed head sensors." ); } else { mods.addModifier(ae.getExtremeRangeModifier(), "extreme range"+targSysType); } } } else { // report c3 adjustment if (c3range == RangeType.RANGE_SHORT) { mods.addModifier(ae.getShortRangeModifier(), "short range due to C3 spotter"+targSysType); } else if (c3range == RangeType.RANGE_MEDIUM) { mods.addModifier(ae.getMediumRangeModifier(), "medium range due to C3 spotter"+targSysType); } else if (c3range == RangeType.RANGE_LONG) { mods.addModifier(ae.getLongRangeModifier(), "long range due to C3 spotter"+targSysType); } } // add infantry LRM maximum range penalty if (isLRMInfantry && distance == weaponRanges[RangeType.RANGE_LONG]) { mods.addModifier(1, "infantry LRM maximum range"); } // add infantry zero-range modifier // TODO: this is not the right place to hardcode these if (isWeaponInfantry && distance == 0) { // Infantry platoons attacking with infantry weapons can attack // in the same hex with a base of 2, except for flamers and // SRMs, which have a base of 3 and LRMs, which suffer badly. if (wtype.hasFlag(WeaponType.F_FLAMER)) { mods.addModifier(-1, "infantry flamer assault"); } else if (wtype.getAmmoType() == AmmoType.T_SRM ) { mods.addModifier(-1, "infantry SRM assault"); } else if (wtype.getAmmoType() != AmmoType.T_LRM) { mods.addModifier(-2, "infantry assault"); } } // add minimum range modifier int minRange = weaponRanges[RangeType.RANGE_MINIMUM]; if (minRange > 0 && distance <= minRange) { int minPenalty = (minRange - distance) + 1; // Infantry LRMs suffer double minimum range penalties. if (isLRMInfantry) { mods.addModifier(minPenalty * 2, "infantry LRM minimum range"); } else { mods.addModifier(minPenalty, "minimum range"); } } // add any target stealth modifier if ((target instanceof Entity) && ((Entity)target).isStealthActive()) { mods.append(((Entity)target).getStealthModifier(usingRange)); } return mods; } | 4135 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4135/d57cd4104a4f13769e5b9e811ccdf0a82ff9a305/Compute.java/buggy/megamek/src/megamek/common/Compute.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
2974,
13616,
751,
22373,
1739,
87,
12,
3047,
339,
7920,
16,
3887,
14221,
16,
509,
732,
28629,
548,
16,
5916,
429,
1018,
13,
288,
3639,
13076,
329,
732,
28629,
273,
14221,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
2974,
13616,
751,
22373,
1739,
87,
12,
3047,
339,
7920,
16,
3887,
14221,
16,
509,
732,
28629,
548,
16,
5916,
429,
1018,
13,
288,
3639,
13076,
329,
732,
28629,
273,
14221,
18,
... |
public static void expand(Rectangle rect, int left, int right, int top, int bottom) { rect.x -= left; rect.width = Math.max(0, rect.width + left + right); rect.y -= top; rect.height = Math.max(0, rect.height + top + bottom); | public static void expand(Rectangle rect, Rectangle differenceRect) { rect.x += differenceRect.x; rect.y += differenceRect.y; rect.height = Math.max(0, rect.height + differenceRect.height); rect.width = Math.max(0, rect.width + differenceRect.width); | public static void expand(Rectangle rect, int left, int right, int top, int bottom) { rect.x -= left; rect.width = Math.max(0, rect.width + left + right); rect.y -= top; rect.height = Math.max(0, rect.height + top + bottom); } | 58148 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58148/2251d3779406f4044b4c8c079789c3559ba90ea5/Geometry.java/buggy/bundles/org.eclipse.jface/src/org/eclipse/jface/util/Geometry.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
918,
4542,
12,
19463,
4917,
16,
509,
2002,
16,
509,
2145,
16,
509,
1760,
16,
509,
5469,
13,
288,
3639,
4917,
18,
92,
3947,
2002,
31,
3639,
4917,
18,
2819,
273,
2361,
18,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
918,
4542,
12,
19463,
4917,
16,
509,
2002,
16,
509,
2145,
16,
509,
1760,
16,
509,
5469,
13,
288,
3639,
4917,
18,
92,
3947,
2002,
31,
3639,
4917,
18,
2819,
273,
2361,
18,
18... |
return newBignum(ruby, BigInteger.valueOf(value)); } | return newBignum(ruby, BigInteger.valueOf(value)); } | public static RubyBignum newBignum(Ruby ruby, long value) { return newBignum(ruby, BigInteger.valueOf(value)); } | 48072 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/48072/1cc89bd397c0f049e6fa3045916fd6d9a3cdada8/RubyBignum.java/clean/org/jruby/RubyBignum.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
19817,
38,
724,
379,
394,
38,
724,
379,
12,
54,
10340,
22155,
16,
1525,
460,
13,
288,
3639,
327,
394,
38,
724,
379,
12,
27768,
16,
10246,
18,
1132,
951,
12,
1132,
10019,
56... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
19817,
38,
724,
379,
394,
38,
724,
379,
12,
54,
10340,
22155,
16,
1525,
460,
13,
288,
3639,
327,
394,
38,
724,
379,
12,
27768,
16,
10246,
18,
1132,
951,
12,
1132,
10019,
56... |
Bucket bucket = bf.makeBucket(len); | Bucket bucket; try { bucket = createBucket(bf, len, server); } catch (IOException e) { Logger.error(this, "Bucket error: "+e, e); throw new MessageInvalidException(ProtocolErrorMessage.INTERNAL_ERROR, e.toString(), getIdentifier()); } | public void readFrom(InputStream is, BucketFactory bf) throws IOException { long len = dataLength(); if(len < 0) throw new IllegalArgumentException("Invalid length: "+len); if(len == 0) return; Bucket bucket = bf.makeBucket(len); BucketTools.copyFrom(bucket, is, len); this.bucket = bucket; } | 48807 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/48807/c3bd1101bcadc7c347643a2d0afd01491a0565ce/DataCarryingMessage.java/clean/src/freenet/node/fcp/DataCarryingMessage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
20876,
12,
4348,
353,
16,
7408,
1733,
16222,
13,
1216,
1860,
288,
202,
202,
5748,
562,
273,
27972,
5621,
202,
202,
430,
12,
1897,
411,
374,
13,
1082,
202,
12849,
394,
275... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
20876,
12,
4348,
353,
16,
7408,
1733,
16222,
13,
1216,
1860,
288,
202,
202,
5748,
562,
273,
27972,
5621,
202,
202,
430,
12,
1897,
411,
374,
13,
1082,
202,
12849,
394,
275... |
return methodSet; | return new HashSet<Method>(methodSet); | Set<Method> getMethodSet(String memberName) { Set<Method> methodSet = fullNameToMethods.get(memberName); if (methodSet == null) { methodSet = nameToMethods.get(memberName); } if (methodSet == null) { methodSet = new HashSet<Method>(); } return methodSet; } | 13291 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13291/7f6789ee6482dc5dae5b794d76b48b0c0ae0dca0/ParentToMethods.java/clean/src/org/jedit/ruby/cache/ParentToMethods.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1000,
32,
1305,
34,
6272,
694,
12,
780,
3140,
461,
13,
288,
3639,
1000,
32,
1305,
34,
707,
694,
273,
12424,
774,
4712,
18,
588,
12,
5990,
461,
1769,
3639,
309,
261,
2039,
694,
422,
44... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1000,
32,
1305,
34,
6272,
694,
12,
780,
3140,
461,
13,
288,
3639,
1000,
32,
1305,
34,
707,
694,
273,
12424,
774,
4712,
18,
588,
12,
5990,
461,
1769,
3639,
309,
261,
2039,
694,
422,
44... |
Molecule mol = model.getSetOfMolecules().getMolecule(0); assertNotNull(mol); assertEquals(mol.getAtomCount(), 24); assertEquals(mol.getBondCount(), 28); assertTrue(!GeometryTools.has3DCoordinates(mol)); assertTrue(GeometryTools.has2DCoordinates(mol)); } else { logger.error("The CMLReader was not tested with a CML file."); logger.error("Due to missing file: " + filename); fail("Missing file: " + filename); } | Molecule mol = model.getSetOfMolecules().getMolecule(0); assertNotNull(mol); assertEquals(mol.getAtomCount(), 24); assertEquals(mol.getBondCount(), 28); assertTrue(!GeometryTools.has3DCoordinates(mol)); assertTrue(GeometryTools.has2DCoordinates(mol)); | public void testCuran() { String filename = "data/cmltest/curan.xml"; logger.info("Testing: " + filename); try { File f = new File(filename); if (f.canRead()) { // read the file CMLReader reader = new CMLReader(new FileReader(f)); ChemFile chemFile = (ChemFile)reader.read((ChemObject)new ChemFile()); // test the resulting ChemFile content assertNotNull(chemFile); assertEquals(chemFile.getChemSequenceCount(), 1); ChemSequence seq = chemFile.getChemSequence(0); assertNotNull(seq); assertEquals(seq.getChemModelCount(), 1); ChemModel model = seq.getChemModel(0); assertNotNull(model); assertEquals(model.getSetOfMolecules().getMoleculeCount(), 1); // test the molecule Molecule mol = model.getSetOfMolecules().getMolecule(0); assertNotNull(mol); assertEquals(mol.getAtomCount(), 24); assertEquals(mol.getBondCount(), 28); assertTrue(!GeometryTools.has3DCoordinates(mol)); assertTrue(GeometryTools.has2DCoordinates(mol)); } else { logger.error("The CMLReader was not tested with a CML file."); logger.error("Due to missing file: " + filename); fail("Missing file: " + filename); } } catch (Exception e) { fail(e.toString()); } } | 46046 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46046/2c7c43d2f4308010328c092f9e157e53e6cab8b2/JumboTest.java/buggy/src/org/openscience/cdk/test/io/cml/JumboTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
2408,
304,
1435,
288,
3639,
514,
1544,
273,
315,
892,
19,
71,
781,
3813,
19,
1397,
304,
18,
2902,
14432,
3639,
1194,
18,
1376,
2932,
22218,
30,
315,
397,
1544,
1769,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
2408,
304,
1435,
288,
3639,
514,
1544,
273,
315,
892,
19,
71,
781,
3813,
19,
1397,
304,
18,
2902,
14432,
3639,
1194,
18,
1376,
2932,
22218,
30,
315,
397,
1544,
1769,
36... |
throw new MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Could not parse DataLength: "+e.toString(), identifier); | throw new MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Could not parse DataLength: "+e.toString(), identifier, global); | public DirectDirPutFile(SimpleFieldSet subset, String identifier, BucketFactory bf) throws MessageInvalidException { super(subset, identifier); String s = subset.get("DataLength"); if(s == null) throw new MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "UploadFrom=direct requires a DataLength for "+name, identifier); try { length = Long.parseLong(s); } catch (NumberFormatException e) { throw new MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Could not parse DataLength: "+e.toString(), identifier); } try { data = bf.makeBucket(length); } catch (IOException e) { throw new MessageInvalidException(ProtocolErrorMessage.INTERNAL_ERROR, "Internal error: could not allocate temp bucket: "+e.toString(), identifier); } } | 49933 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49933/bbb3c23ec38ea1c7abb48040a17f5fc7932248bc/DirectDirPutFile.java/buggy/src/freenet/node/fcp/DirectDirPutFile.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
9908,
1621,
6426,
812,
12,
5784,
974,
694,
7931,
16,
514,
2756,
16,
7408,
1733,
16222,
13,
1216,
2350,
1941,
503,
288,
202,
202,
9565,
12,
15657,
16,
2756,
1769,
202,
202,
780... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
9908,
1621,
6426,
812,
12,
5784,
974,
694,
7931,
16,
514,
2756,
16,
7408,
1733,
16222,
13,
1216,
2350,
1941,
503,
288,
202,
202,
9565,
12,
15657,
16,
2756,
1769,
202,
202,
780... |
else if (args[i].equalsIgnoreCase("-u") || args[i].equalsIgnoreCase("--ultra-wideband")) { | else if (args[i].equalsIgnoreCase("-u") || args[i].equalsIgnoreCase("-uwb") || args[i].equalsIgnoreCase("--ultra-wideband")) { | public static void main(String[] args) throws IOException { // make sure we have command args if (args.length < 2) { if (args.length==1 && (args[0].equalsIgnoreCase("-v") || args[0].equalsIgnoreCase("--version"))) { version(); return; } usage(); return; } String infile = args[args.length-2]; String outfile = args[args.length-1]; for (int i=0; i<args.length-2; i++) { if (args[i].equalsIgnoreCase("-h") || args[i].equalsIgnoreCase("--help")) { usage(); return; } else if (args[i].equalsIgnoreCase("-v") || args[i].equalsIgnoreCase("--version")) { version(); return; } else if (args[i].equalsIgnoreCase("--raw")) { wav = false; } else if (args[i].equalsIgnoreCase("-n") || args[i].equalsIgnoreCase("--narrowband")) { mode = 0; } else if (args[i].equalsIgnoreCase("-w") || args[i].equalsIgnoreCase("--wideband")) { mode = 1; } else if (args[i].equalsIgnoreCase("-u") || args[i].equalsIgnoreCase("--ultra-wideband")) { mode = 2; } else if (args[i].equalsIgnoreCase("-q") || args[i].equalsIgnoreCase("--quality")) { try { vbr_quality = Float.parseFloat(args[++i]); quality = (int) vbr_quality; } catch (NumberFormatException e) { usage(); return; } } else if (args[i].equalsIgnoreCase("--complexity")) { try { complexity = Integer.parseInt(args[++i]); } catch (NumberFormatException e) { usage(); return; } } else if (args[i].equalsIgnoreCase("--bitrate")) { try { bitrate = Integer.parseInt(args[++i]); } catch (NumberFormatException e) { usage(); return; } } else if (args[i].equalsIgnoreCase("--vbr")) { vbr = true; } else if (args[i].equalsIgnoreCase("--vad")) { vad = true; } else if (args[i].equalsIgnoreCase("--dtx")) { dtx = true; } else if (args[i].equalsIgnoreCase("--nframes")) { try { nframes = Integer.parseInt(args[++i]); } catch (NumberFormatException e) { usage(); return; } } else if (args[i].equalsIgnoreCase("--rate")) { try { sampleRate = Integer.parseInt(args[++i]); } catch (NumberFormatException e) { usage(); return; } } else if (args[i].equalsIgnoreCase("--stereo")) { channels = 2; } else { usage(); return; } } if (sampleRate < 0) { switch(mode){ case 0: sampleRate = 8000; break; case 1: sampleRate = 16000; break; case 2: sampleRate = 32000; break; } } // encode to Speex encode(infile, outfile); } | 6221 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6221/55eb35151f5fcff336e27c126b46f489b309cc24/JSpeexEnc.java/buggy/main/trunk/src/JSpeexEnc.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
918,
2774,
12,
780,
8526,
833,
13,
565,
1216,
1860,
225,
288,
565,
368,
1221,
3071,
732,
1240,
1296,
833,
565,
309,
261,
1968,
18,
2469,
411,
576,
13,
288,
1377,
309,
261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
918,
2774,
12,
780,
8526,
833,
13,
565,
1216,
1860,
225,
288,
565,
368,
1221,
3071,
732,
1240,
1296,
833,
565,
309,
261,
1968,
18,
2469,
411,
576,
13,
288,
1377,
309,
261,
... |
newReport.clearAttributes(); | public static void setupNewBugAttributes(TaskRepository repository, NewBugzillaReport newReport) { newReport.clearAttributes(); AbstractRepositoryReportAttribute a = new BugzillaReportAttribute(BugzillaReportElement.PRODUCT); List<String> optionValues = BugzillaPlugin.getDefault().getProductConfiguration(repository).getProducts(); for (String option : optionValues) { a.addOptionValue(option, option); } a.setValue(newReport.getProduct()); newReport.addAttribute(BugzillaReportElement.PRODUCT, a); // attributes.put(a.getName(), a); a = new BugzillaReportAttribute(BugzillaReportElement.BUG_STATUS); optionValues = BugzillaPlugin.getDefault().getProductConfiguration(repository).getStatusValues(); for (String option : optionValues) { a.addOptionValue(option, option); } a.setValue(BUG_STATUS_NEW); newReport.addAttribute(BugzillaReportElement.BUG_STATUS, a); // attributes.put(a.getName(), a); a = new BugzillaReportAttribute(BugzillaReportElement.VERSION); optionValues = BugzillaPlugin.getDefault().getProductConfiguration(repository).getVersions( newReport.getProduct()); for (String option : optionValues) { a.addOptionValue(option, option); } if (optionValues != null && optionValues.size() > 0) { a.setValue(optionValues.get(optionValues.size() - 1)); } newReport.addAttribute(BugzillaReportElement.VERSION, a); // attributes.put(a.getName(), a); a = new BugzillaReportAttribute(BugzillaReportElement.COMPONENT); optionValues = BugzillaPlugin.getDefault().getProductConfiguration(repository).getComponents( newReport.getProduct()); for (String option : optionValues) { a.addOptionValue(option, option); } newReport.addAttribute(BugzillaReportElement.COMPONENT, a); a = new BugzillaReportAttribute(BugzillaReportElement.REP_PLATFORM); optionValues = BugzillaPlugin.getDefault().getProductConfiguration(repository).getPlatforms(); for (String option : optionValues) { a.addOptionValue(option, option); } newReport.addAttribute(BugzillaReportElement.REP_PLATFORM, a); // attributes.put(a.getName(), a); a = new BugzillaReportAttribute(BugzillaReportElement.OP_SYS); optionValues = BugzillaPlugin.getDefault().getProductConfiguration(repository).getOSs(); for (String option : optionValues) { a.addOptionValue(option, option); } newReport.addAttribute(BugzillaReportElement.OP_SYS, a); // attributes.put(a.getName(), a); a = new BugzillaReportAttribute(BugzillaReportElement.PRIORITY); optionValues = BugzillaPlugin.getDefault().getProductConfiguration(repository).getPriorities(); for (String option : optionValues) { a.addOptionValue(option, option); } a.setValue(optionValues.get((optionValues.size() / 2))); newReport.addAttribute(BugzillaReportElement.PRIORITY, a); // attributes.put(a.getName(), a); a = new BugzillaReportAttribute(BugzillaReportElement.BUG_SEVERITY); optionValues = BugzillaPlugin.getDefault().getProductConfiguration(repository).getSeverities(); for (String option : optionValues) { a.addOptionValue(option, option); } a.setValue(optionValues.get((optionValues.size() / 2))); newReport.addAttribute(BugzillaReportElement.BUG_SEVERITY, a); // attributes.put(a.getName(), a); // a = new // BugzillaReportAttribute(BugzillaReportElement.TARGET_MILESTONE); // optionValues = // BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getTargetMilestones( // newReport.getProduct()); // for (String option : optionValues) { // a.addOptionValue(option, option); // } // if(optionValues.size() > 0) { // // new bug posts will fail if target_milestone element is included // // and there are no milestones on the server // newReport.addAttribute(BugzillaReportElement.TARGET_MILESTONE, a); // } a = new BugzillaReportAttribute(BugzillaReportElement.ASSIGNED_TO); a.setValue(""); newReport.addAttribute(BugzillaReportElement.ASSIGNED_TO, a); // attributes.put(a.getName(), a); a = new BugzillaReportAttribute(BugzillaReportElement.BUG_FILE_LOC); a.setValue("http://"); a.setHidden(false); newReport.addAttribute(BugzillaReportElement.BUG_FILE_LOC, a); // attributes.put(a.getName(), a); // newReport.attributes = attributes; } | 51151 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51151/bd9ab3a29c773cac8e20028f6d24e407b568a2c2/BugzillaRepositoryUtil.java/buggy/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryUtil.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
760,
918,
3875,
1908,
19865,
2498,
12,
2174,
3305,
3352,
16,
1166,
19865,
15990,
4820,
394,
4820,
13,
288,
202,
202,
2704,
4820,
18,
8507,
2498,
5621,
202,
202,
7469,
3305,
4820... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
760,
918,
3875,
1908,
19865,
2498,
12,
2174,
3305,
3352,
16,
1166,
19865,
15990,
4820,
394,
4820,
13,
288,
202,
202,
2704,
4820,
18,
8507,
2498,
5621,
202,
202,
7469,
3305,
4820... | |
else if ( rowNum > getMaximum() + 1 ) { | } else if ( rowNum > getMaximum() + 1 ) { | public void fireRowAdded(int rowNum) { final Object item = readItem(rowNum); if ( rowNum >= 0 && rowNum <= getMaximum() + 1 ) // expected; n rows numbered 0 to n - 1 setMaximum(getMaximum() + 1); else if ( rowNum > getMaximum() + 1 ) { setMaximum(rowNum); OutputHandler.out("GC:fRA Warning: adding row " + rowNum + " beyond known max " + getMaximum()); } else if ( rowNum < 0 ) { OutputHandler.out("GC:fRA Error: Serious oddity: got negative row " + rowNum); return; } if (rowNum >= getValue() && rowNum < getValue() + getVisibleAmount()) { // if visible final int screenIndex = rowNum - getValue(); Runnable addRowRunnable = new Runnable() { public void run() { LozengeRow lr = makeLozengeRow(item); LozengeRow rl = makeLabelRow(item); myLozengePanel.insert(screenIndex, lr); myLabelPanel.insert(screenIndex, rl); } }; SwingQueue.invokeLater(addRowRunnable); } SwingQueue.invokeLater(fixScroller); } | 11319 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11319/4e8951565c3a4c3ec28852963de70b93e6d7880a/GanttChart.java/clean/datagrabber/src/org/cougaar/mlm/ui/newtpfdd/gui/component/GanttChart.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
4452,
1999,
8602,
12,
474,
1027,
2578,
13,
225,
288,
565,
727,
1033,
761,
273,
855,
1180,
12,
492,
2578,
1769,
565,
309,
261,
1027,
2578,
1545,
374,
597,
1027,
2578,
1648,
25... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
4452,
1999,
8602,
12,
474,
1027,
2578,
13,
225,
288,
565,
727,
1033,
761,
273,
855,
1180,
12,
492,
2578,
1769,
565,
309,
261,
1027,
2578,
1545,
374,
597,
1027,
2578,
1648,
25... |
/* if(Debug.SCROLL_VERIFY) | if(Debug.SCROLL_VERIFY) | public void transactionComplete(Buffer buffer) { if(textArea.getDisplayManager() != DisplayManager.this) { delayedUpdate = false; return; } if(delayedUpdate) doDelayedUpdate(); textArea._finishCaretUpdate(); delayedUpdate = false; //{{{ Debug code /* if(Debug.SCROLL_VERIFY) { int scrollLineCount = 0; int line = delayedUpdateStart; if(!isLineVisible(line)) line = getNextVisibleLine(line); System.err.println(delayedUpdateStart + ":" + delayedUpdateEnd + ":" + textArea.getLineCount()); while(line != -1 && line <= delayedUpdateEnd) { scrollLineCount += getScreenLineCount(line); line = getNextVisibleLine(line); } if(scrollLineCount != getScrollLineCount()) { throw new InternalError(scrollLineCount + " != " + getScrollLineCount()); } } */ //}}} } //}}} | 6564 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6564/d179f1bb449c1e8544a803d67a9960e3361d5ce8/DisplayManager.java/clean/org/gjt/sp/jedit/textarea/DisplayManager.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3196,
202,
482,
918,
2492,
6322,
12,
1892,
1613,
13,
202,
202,
95,
1082,
202,
430,
12,
955,
5484,
18,
588,
4236,
1318,
1435,
480,
9311,
1318,
18,
2211,
13,
1082,
202,
95,
9506,
202,
10790,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3196,
202,
482,
918,
2492,
6322,
12,
1892,
1613,
13,
202,
202,
95,
1082,
202,
430,
12,
955,
5484,
18,
588,
4236,
1318,
1435,
480,
9311,
1318,
18,
2211,
13,
1082,
202,
95,
9506,
202,
10790,
... |
Object clasrole = Model.getCollaborationsFactory().buildClassifierRole( getHomeModel()); Model.getCollaborationsHelper().addInstance(clasrole, node); | getNodes().add( node); | public void addNode(Object node) { if (canAddNode(node)) { Object clasrole = Model.getCollaborationsFactory().buildClassifierRole( getHomeModel()); Model.getCollaborationsHelper().addInstance(clasrole, node); fireNodeAdded(node); } } | 7166 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7166/14c1a90832901151373e2eb7e45cc1d41b38acca/SequenceDiagramGraphModel.java/buggy/src_new/org/argouml/uml/diagram/sequence/SequenceDiagramGraphModel.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
23063,
12,
921,
756,
13,
288,
3639,
309,
261,
4169,
986,
907,
12,
2159,
3719,
288,
5411,
1033,
23268,
4615,
273,
7734,
3164,
18,
588,
22894,
280,
1012,
1733,
7675,
3510,
13860,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
23063,
12,
921,
756,
13,
288,
3639,
309,
261,
4169,
986,
907,
12,
2159,
3719,
288,
5411,
1033,
23268,
4615,
273,
7734,
3164,
18,
588,
22894,
280,
1012,
1733,
7675,
3510,
13860,... |
protected void fireStartedEvent(BufferedImage bi) { | protected void fireStartedEvent(BufferedImage bi) throws InterruptedException { | protected void fireStartedEvent(BufferedImage bi) { final Object[] dll = listeners.toArray(); if (dll.length > 0) { final GVTTreeRendererEvent ev = new GVTTreeRendererEvent(this, bi); if (EventQueue.isDispatchThread()) { for (int i = 0; i < dll.length; i++) { ((GVTTreeRendererListener)dll[i]).gvtRenderingStarted(ev); } } else { EventQueue.invokeLater(new Runnable() { public void run() { for (int i = 0; i < dll.length; i++) { ((GVTTreeRendererListener)dll[i]).gvtRenderingStarted(ev); } } }); } } } | 45946 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45946/3e3f50a23a526a85e8762698405cba8d5ed632a8/GVTTreeRenderer.java/buggy/sources/org/apache/batik/swing/gvt/GVTTreeRenderer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
918,
4452,
9217,
1133,
12,
17947,
2040,
10054,
13,
1216,
7558,
288,
3639,
727,
1033,
8526,
302,
2906,
273,
4679,
18,
31447,
5621,
3639,
309,
261,
27670,
18,
2469,
405,
374,
13,
288,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
918,
4452,
9217,
1133,
12,
17947,
2040,
10054,
13,
1216,
7558,
288,
3639,
727,
1033,
8526,
302,
2906,
273,
4679,
18,
31447,
5621,
3639,
309,
261,
27670,
18,
2469,
405,
374,
13,
288,... |
private FSDirectory getParentDirectoryEntry(String file) throws IOException{ if(file==null){ return null; } final FSEntry dirEntry = getEntry(getParentPath(file)); if (dirEntry == null) { return null; } if (!dirEntry.isDirectory()) { return null; } return dirEntry.getDirectory(); } | private FSDirectory getParentDirectoryEntry(String file) throws IOException { if (file == null) { return null; } final FSEntry dirEntry = getEntry(getParentPath(file)); if (dirEntry == null) { return null; } if (!dirEntry.isDirectory()) { return null; } return dirEntry.getDirectory(); } | private FSDirectory getParentDirectoryEntry(String file) throws IOException{ if(file==null){ return null; } final FSEntry dirEntry = getEntry(getParentPath(file)); if (dirEntry == null) { return null; } if (!dirEntry.isDirectory()) { return null; } return dirEntry.getDirectory(); } | 50763 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50763/a8360c0112d9f3686ff1ffe02f6e00dd67c206bf/FileSystemAPIImpl.java/buggy/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
225,
9247,
2853,
5089,
2853,
1622,
12,
780,
585,
13,
1216,
1860,
95,
202,
202,
430,
12,
768,
631,
2011,
15329,
1082,
202,
2463,
446,
31,
202,
202,
97,
202,
202,
6385,
9247,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
225,
9247,
2853,
5089,
2853,
1622,
12,
780,
585,
13,
1216,
1860,
95,
202,
202,
430,
12,
768,
631,
2011,
15329,
1082,
202,
2463,
446,
31,
202,
202,
97,
202,
202,
6385,
9247,
... |
stringBuffer.append(TEXT_141); | stringBuffer.append(TEXT_108); | public String generate(Object argument) { final StringBuffer stringBuffer = new StringBuffer(); final GenCommonBase genElement = (GenCommonBase) ((Object[]) argument)[0];final GenNodeLabel genLabel = (GenNodeLabel) genElement;final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];GenNode genHost = genLabel.getNode();GenClass underlyingMetaClass = genHost.getDomainMetaClass();GenDiagram genDiagram = genLabel.getDiagram();LabelModelFacet labelModelFacet = genLabel.getModelFacet();final boolean isReadOnly = genLabel.isReadOnly(); stringBuffer.append(TEXT_1); String copyrightText = genDiagram.getEditorGen().getCopyrightText();if (copyrightText != null && copyrightText.trim().length() > 0) { stringBuffer.append(TEXT_2); stringBuffer.append(copyrightText.replaceAll("\n", "\n * ")); stringBuffer.append(TEXT_3); } stringBuffer.append(TEXT_4); stringBuffer.append(TEXT_5); class FeatureGetAccessorHelper { /** * @param containerName the name of the container * @param feature the feature whose value is in interest * @param containerMetaClass the <code>GenClass</code> of the container, or <code>null</code>, if the container is declared as an <code>EObject</code>. * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the <code>EClass</code> this feature belongs to is an external interface). */ public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) { if (feature.getGenClass().isExternalInterface()) { boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface(); if (needsCastToResultType) { stringBuffer.append(TEXT_6); stringBuffer.append(importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_7); } if (needsCastToEObject) { stringBuffer.append(TEXT_8); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_9); } stringBuffer.append(containerName); if (needsCastToEObject) { stringBuffer.append(TEXT_10); } stringBuffer.append(TEXT_11); stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_12); stringBuffer.append(feature.getFeatureAccessorName()); stringBuffer.append(TEXT_13); if (needsCastToResultType) { stringBuffer.append(TEXT_14); } } else { boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface(); if (needsCastToFeatureGenType) { stringBuffer.append(TEXT_15); stringBuffer.append(importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_16); } stringBuffer.append(containerName); if (needsCastToFeatureGenType) { stringBuffer.append(TEXT_17); } stringBuffer.append(TEXT_18); stringBuffer.append(feature.getGetAccessor()); stringBuffer.append(TEXT_19); } }}final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper(); stringBuffer.append(TEXT_20); importManager.emitPackageStatement(stringBuffer); stringBuffer.append(TEXT_21); importManager.addImport("org.eclipse.gef.EditPart");importManager.addImport("org.eclipse.gef.EditPolicy");importManager.addImport("org.eclipse.gmf.runtime.notation.View");importManager.markImportLocation(stringBuffer); stringBuffer.append(TEXT_22); stringBuffer.append(genLabel.getEditPartClassName()); stringBuffer.append(TEXT_23); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart")); stringBuffer.append(TEXT_24); {GenCommonBase genCommonBase = genLabel; stringBuffer.append(TEXT_25); stringBuffer.append(TEXT_26); stringBuffer.append(genCommonBase.getVisualID()); stringBuffer.append(TEXT_27); } stringBuffer.append(TEXT_28); if (!isReadOnly) { stringBuffer.append(TEXT_29); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); stringBuffer.append(TEXT_30); } stringBuffer.append(TEXT_31); stringBuffer.append(genLabel.getEditPartClassName()); stringBuffer.append(TEXT_32); final String primaryView = "getUpdatableParent().getDiagramNode()"; final String resolvedSemanticElement = "resolveSemanticElement()"; if (!isReadOnly) { String editPatternCode = "EDIT_PATTERN"; //declared in labelText.javajetinc, used in directEditCommand.jetinc. stringBuffer.append(TEXT_33); stringBuffer.append(TEXT_34); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); stringBuffer.append(TEXT_35); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy")); stringBuffer.append(TEXT_36); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); stringBuffer.append(TEXT_37); stringBuffer.append(TEXT_38); stringBuffer.append(TEXT_39); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); stringBuffer.append(TEXT_40); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); stringBuffer.append(TEXT_41); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_42); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); stringBuffer.append(TEXT_43); stringBuffer.append(editPatternCode); stringBuffer.append(TEXT_44); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_45); stringBuffer.append(importManager.getImportedName("java.text.ParseException")); stringBuffer.append(TEXT_46); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_47); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_48); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_49); stringBuffer.append(primaryView); stringBuffer.append(TEXT_50); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature(); stringBuffer.append(TEXT_51); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_52); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_53); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); stringBuffer.append(TEXT_54); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_55); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_56); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_57); stringBuffer.append(resolvedSemanticElement); stringBuffer.append(TEXT_58); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_59); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_60); stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_61); stringBuffer.append(featureToSet.getFeatureAccessorName()); stringBuffer.append(TEXT_62); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.ParserUtil")); stringBuffer.append(TEXT_63); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); stringBuffer.append(TEXT_64); if (ecoreFeature.isMany()) { stringBuffer.append(TEXT_65); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_66); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_67); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); stringBuffer.append(TEXT_68); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); stringBuffer.append(TEXT_69); stringBuffer.append(featureToSet.getAccessorName()); stringBuffer.append(TEXT_70); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_71); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); stringBuffer.append(TEXT_72); } else { stringBuffer.append(TEXT_73); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_74); } stringBuffer.append(TEXT_75); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures(); stringBuffer.append(TEXT_76); stringBuffer.append(metaFeatures.size()); stringBuffer.append(TEXT_77); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_78); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_79); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); stringBuffer.append(TEXT_80); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_81); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_82); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_83); stringBuffer.append(resolvedSemanticElement); stringBuffer.append(TEXT_84); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_85); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_86); boolean haveDeclaredValues = false; for(int i = 0; i < metaFeatures.size(); i++) { GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i); EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature(); stringBuffer.append(TEXT_87); if (i == 0) { stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_88); } stringBuffer.append(TEXT_89); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_90); stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_91); stringBuffer.append(nextFeatureToSet.getFeatureAccessorName()); stringBuffer.append(TEXT_92); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.ParserUtil")); stringBuffer.append(TEXT_93); stringBuffer.append(i); stringBuffer.append(TEXT_94); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); stringBuffer.append(TEXT_95); if (nextEcoreFeature.isMany()) { stringBuffer.append(TEXT_96); if (!haveDeclaredValues) { haveDeclaredValues = true; stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); stringBuffer.append(TEXT_97); } stringBuffer.append(TEXT_98); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); stringBuffer.append(TEXT_99); stringBuffer.append(nextFeatureToSet.getAccessorName()); stringBuffer.append(TEXT_100); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_101); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); stringBuffer.append(TEXT_102); } else { stringBuffer.append(TEXT_103); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_104); } } stringBuffer.append(TEXT_105); } stringBuffer.append(TEXT_106); } stringBuffer.append(TEXT_107); if (!isReadOnly) { stringBuffer.append(TEXT_108); stringBuffer.append(TEXT_109); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); stringBuffer.append(TEXT_110); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); stringBuffer.append(TEXT_111); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); stringBuffer.append(TEXT_112); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); stringBuffer.append(TEXT_113); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor")); stringBuffer.append(TEXT_114); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator")); stringBuffer.append(TEXT_115); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor")); stringBuffer.append(TEXT_116); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); stringBuffer.append(TEXT_117); } stringBuffer.append(TEXT_118); stringBuffer.append(TEXT_119); /*genFeature.getObjectType() throws NPE on primitive types. This is a workaround. */HashMap primitiveTypeToWrapperClassName = new HashMap();primitiveTypeToWrapperClassName.put(Boolean.TYPE, "Boolean");primitiveTypeToWrapperClassName.put(Byte.TYPE, "Byte");primitiveTypeToWrapperClassName.put(Character.TYPE, "Character");primitiveTypeToWrapperClassName.put(Double.TYPE, "Double");primitiveTypeToWrapperClassName.put(Float.TYPE, "Float");primitiveTypeToWrapperClassName.put(Integer.TYPE, "Integer");primitiveTypeToWrapperClassName.put(Long.TYPE, "Long");primitiveTypeToWrapperClassName.put(Short.TYPE, "Short");String viewPattern = null;String editPattern = null;if (labelModelFacet instanceof FeatureLabelModelFacet) { FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet; viewPattern = featureLabelModelFacet.getViewPattern(); if (viewPattern == null || viewPattern.length() == 0) { viewPattern = "{0}"; } editPattern = featureLabelModelFacet.getEditPattern(); if (editPattern == null || editPattern.length() == 0) { editPattern = "{0}"; }} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; viewPattern = compositeFeatureLabelModelFacet.getViewPattern(); if (viewPattern == null || viewPattern.length() == 0) { StringBuffer patternBuffer = new StringBuffer(); for(int i = 0; i < compositeFeatureLabelModelFacet.getMetaFeatures().size(); i++) { patternBuffer.append("{").append(i).append("} "); } viewPattern = patternBuffer.toString().trim(); } editPattern = compositeFeatureLabelModelFacet.getEditPattern(); if (editPattern == null || editPattern.length() == 0) { StringBuffer patternBuffer = new StringBuffer(); for(int i = 0; i < compositeFeatureLabelModelFacet.getMetaFeatures().size(); i++) { patternBuffer.append("{").append(i).append("} "); } editPattern = patternBuffer.toString().trim(); }} stringBuffer.append(TEXT_120); stringBuffer.append(viewPattern); stringBuffer.append(TEXT_121); stringBuffer.append(editPattern); stringBuffer.append(TEXT_122); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_123); stringBuffer.append(resolvedSemanticElement); stringBuffer.append(TEXT_124); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_125); stringBuffer.append(resolvedSemanticElement); stringBuffer.append(TEXT_126); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_127); if (labelModelFacet instanceof FeatureLabelModelFacet) { FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet; GenFeature feature = featureLabelModelFacet.getMetaFeature(); if (!feature.isPrimitiveType()) { stringBuffer.append(TEXT_128); myFeatureGetAccessorHelper.appendFeatureValueGetter("element", feature, underlyingMetaClass, false); stringBuffer.append(TEXT_129); } stringBuffer.append(TEXT_130); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); stringBuffer.append(TEXT_131); if (feature.isPrimitiveType()) { stringBuffer.append(TEXT_132); stringBuffer.append(primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass())); stringBuffer.append(TEXT_133); } myFeatureGetAccessorHelper.appendFeatureValueGetter("element", feature, underlyingMetaClass, false); if (feature.isPrimitiveType()) { stringBuffer.append(TEXT_134); } stringBuffer.append(TEXT_135); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; stringBuffer.append(TEXT_136); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); stringBuffer.append(TEXT_137); for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { GenFeature next = (GenFeature) it.next(); if (next.isPrimitiveType()) { stringBuffer.append(TEXT_138); stringBuffer.append(primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass())); stringBuffer.append(TEXT_139); } myFeatureGetAccessorHelper.appendFeatureValueGetter("element", next, underlyingMetaClass, false); if (next.isPrimitiveType()) { stringBuffer.append(TEXT_140); } if (it.hasNext()) { stringBuffer.append(TEXT_141); } } stringBuffer.append(TEXT_142); } else { stringBuffer.append(TEXT_143); } stringBuffer.append(TEXT_144); stringBuffer.append(TEXT_145); boolean isFixedFontSetInFigure;{ StyleAttributes styleAttributes = (genElement.getViewmap() == null) ? null : (StyleAttributes)genElement.getViewmap().find(StyleAttributes.class); isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont();} stringBuffer.append(TEXT_146); if (!isFixedFontSetInFigure) { stringBuffer.append(TEXT_147); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_148); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_149); stringBuffer.append(primaryView); stringBuffer.append(TEXT_150); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_151); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); stringBuffer.append(TEXT_152); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_153); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_154); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_155); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); stringBuffer.append(TEXT_156); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); stringBuffer.append(TEXT_157); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); stringBuffer.append(TEXT_158); } stringBuffer.append(TEXT_159); if (!isFixedFontSetInFigure) { stringBuffer.append(TEXT_160); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); stringBuffer.append(TEXT_161); } stringBuffer.append(TEXT_162); stringBuffer.append(TEXT_163); stringBuffer.append(TEXT_164); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_165); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_166); stringBuffer.append(primaryView); stringBuffer.append(TEXT_167); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_168); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_169); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_170); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_171); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_172); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image")); stringBuffer.append(TEXT_173); if (genLabel.isElementIcon()) { stringBuffer.append(TEXT_174); stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_175); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.resource.ImageDescriptor")); stringBuffer.append(TEXT_176); stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); stringBuffer.append(TEXT_177); } stringBuffer.append(TEXT_178); stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_179); stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_180); stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_181); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_182); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_183); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_184); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_185); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_186); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_187); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_188); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_189); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_190); if (labelModelFacet instanceof FeatureLabelModelFacet) { FeatureLabelModelFacet compositeFeatureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet; for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { GenFeature next = (GenFeature) it.next(); stringBuffer.append(TEXT_191); stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_192); stringBuffer.append(next.getFeatureAccessorName()); stringBuffer.append(TEXT_193); }} stringBuffer.append(TEXT_194); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_195); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_196); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_197); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_198); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_199); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_200); if (labelModelFacet instanceof FeatureLabelModelFacet) { FeatureLabelModelFacet compositeFeatureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet; for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { GenFeature next = (GenFeature) it.next(); stringBuffer.append(TEXT_201); stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_202); stringBuffer.append(next.getFeatureAccessorName()); stringBuffer.append(TEXT_203); }} stringBuffer.append(TEXT_204); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); stringBuffer.append(TEXT_205); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); stringBuffer.append(TEXT_206); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); stringBuffer.append(TEXT_207); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); stringBuffer.append(TEXT_208); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); stringBuffer.append(TEXT_209); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); stringBuffer.append(TEXT_210); final Viewmap viewmap = genLabel.getViewmap(); stringBuffer.append(TEXT_211); final String figureQualifiedClassName;if (viewmap instanceof ParentAssignedViewmap) { ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap; figureQualifiedClassName = parentAssignedViewmap.getFigureQualifiedClassName() == null ? "org.eclipse.draw2d.IFigure" : parentAssignedViewmap.getFigureQualifiedClassName();} else if (viewmap instanceof FigureViewmap) { String figureQualifiedClassNameCandidate = ((FigureViewmap) viewmap).getFigureQualifiedClassName(); if (figureQualifiedClassNameCandidate == null || figureQualifiedClassNameCandidate.trim().length() == 0) { figureQualifiedClassName = "org.eclipse.draw2d.Label"; } else { figureQualifiedClassName = figureQualifiedClassNameCandidate; }} else if (viewmap instanceof SnippetViewmap) { figureQualifiedClassName = "org.eclipse.draw2d.IFigure";} else if (viewmap instanceof InnerClassViewmap) { figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName();} else { figureQualifiedClassName = "org.eclipse.draw2d.IFigure";}final String figureImportedName;if (viewmap instanceof InnerClassViewmap) { figureImportedName = figureQualifiedClassName; //do not import inner class} else { figureImportedName = importManager.getImportedName(figureQualifiedClassName);}if (viewmap instanceof ParentAssignedViewmap) { final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap; stringBuffer.append(TEXT_212); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_213); stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName())); stringBuffer.append(TEXT_214); } else { stringBuffer.append(TEXT_215); stringBuffer.append(figureImportedName); stringBuffer.append(TEXT_216); if (viewmap instanceof FigureViewmap) { stringBuffer.append(TEXT_217); stringBuffer.append(figureImportedName); stringBuffer.append(TEXT_218); } // instanceof FigureViewmap else if (viewmap instanceof SnippetViewmap) { stringBuffer.append(TEXT_219); stringBuffer.append(((SnippetViewmap) viewmap).getBody()); stringBuffer.append(TEXT_220); } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter else if (viewmap instanceof InnerClassViewmap) { stringBuffer.append(TEXT_221); stringBuffer.append(figureImportedName); stringBuffer.append(TEXT_222); } stringBuffer.append(TEXT_223); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_224); stringBuffer.append(figureImportedName); stringBuffer.append(TEXT_225); if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) { stringBuffer.append(TEXT_226); } else { stringBuffer.append(TEXT_227); } stringBuffer.append(TEXT_228); } /*not parent-assigned*/ stringBuffer.append(TEXT_229); if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) { stringBuffer.append(TEXT_230); } stringBuffer.append(TEXT_231); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); stringBuffer.append(TEXT_232); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); stringBuffer.append(TEXT_233); String labelSetterName = "setLabel"; // same assumption in NodeEditPartString labelFigureClassName = "org.eclipse.draw2d.IFigure";if (viewmap instanceof ParentAssignedViewmap) { ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap; if (parentAssignedViewmap.getSetterName() != null) { labelSetterName = parentAssignedViewmap.getSetterName(); } if (parentAssignedViewmap.getFigureQualifiedClassName() != null) { labelFigureClassName = parentAssignedViewmap.getFigureQualifiedClassName(); }} // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned? stringBuffer.append(TEXT_234); stringBuffer.append(labelSetterName); stringBuffer.append(TEXT_235); stringBuffer.append(importManager.getImportedName(labelFigureClassName)); stringBuffer.append(TEXT_236); if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) { stringBuffer.append(TEXT_237); } else { stringBuffer.append(TEXT_238); } stringBuffer.append(TEXT_239); if (viewmap instanceof InnerClassViewmap) { String classBody = ((InnerClassViewmap) viewmap).getClassBody(); stringBuffer.append(TEXT_240); stringBuffer.append(classBody); stringBuffer.append(TEXT_241); if (classBody.indexOf("DPtoLP") != -1) { stringBuffer.append(TEXT_242); } } stringBuffer.append(TEXT_243); importManager.emitSortedImports(); stringBuffer.append(TEXT_244); return stringBuffer.toString(); } | 7409 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7409/de70953cec74fbba0ed0cfbed37c36c0b594b3db/NodeLabelEditPartGenerator.java/clean/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
514,
2103,
12,
921,
1237,
13,
225,
288,
565,
727,
6674,
533,
1892,
273,
394,
6674,
5621,
565,
727,
10938,
6517,
2171,
3157,
1046,
273,
261,
7642,
6517,
2171,
13,
14015,
921,
63,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
514,
2103,
12,
921,
1237,
13,
225,
288,
565,
727,
6674,
533,
1892,
273,
394,
6674,
5621,
565,
727,
10938,
6517,
2171,
3157,
1046,
273,
261,
7642,
6517,
2171,
13,
14015,
921,
63,
5... |
return "main"; | return MAIN_PG; | public String processPvtMsgCancel() { LOG.debug("processPvtMsgCancel()"); return "main"; } | 2021 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2021/31f059d4c004601241a992d38669d08dc47f709b/PrivateMessagesTool.java/buggy/msgcntr/messageforums-app/src/java/org/sakaiproject/tool/messageforums/PrivateMessagesTool.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
514,
1207,
27615,
3332,
6691,
1435,
288,
565,
2018,
18,
4148,
2932,
2567,
27615,
3332,
6691,
1435,
8863,
565,
327,
22299,
67,
18679,
31,
4202,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
514,
1207,
27615,
3332,
6691,
1435,
288,
565,
2018,
18,
4148,
2932,
2567,
27615,
3332,
6691,
1435,
8863,
565,
327,
22299,
67,
18679,
31,
4202,
289,
2,
-100,
-100,
-100,
-100,
-100,
... |
focusCleared = comp == null; if ( comp != null ) { for ( Container p = comp.getParent(); p != null; p = p.getParent() ) { if ( p instanceof JInternalFrame ) { setFocusOwner( p ); } } } | public void setFocusOwner( Component comp ) { focusCleared = comp == null; if ( comp != null ) { for ( Container p = comp.getParent(); p != null; p = p.getParent() ) { if ( p instanceof JInternalFrame ) { setFocusOwner( p ); } } } if ( comp == null || comp.isFocusable() ) { awtWindow.setFocusableWindowState( true ); Component oldFocusOwner = getFocusOwner(); if ( comp == desktop ) { comp = null; } if ( oldFocusOwner != comp ) { if ( oldFocusOwner != null ) { dispatchEvent( oldFocusOwner, new FocusEvent( oldFocusOwner, FocusEvent.FOCUS_LOST, false, comp ) ); } if ( comp != null ) { dispatchEvent( comp, new FocusEvent( comp, FocusEvent.FOCUS_GAINED, false, oldFocusOwner ) ); } else { if ( getFocusOwner() != null ) { KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner(); } } } awtWindow.setFocusableWindowState( false ); } } | 19503 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/19503/d7a71566653b180308884b6c944cdf4b7f426016/JMEDesktop.java/clean/src/com/jmex/awt/swingui/JMEDesktop.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
31480,
5541,
12,
5435,
1161,
262,
288,
3639,
7155,
4756,
2258,
273,
1161,
422,
446,
31,
3639,
309,
261,
1161,
480,
446,
262,
288,
5411,
364,
261,
4039,
293,
273,
1161,
18,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
31480,
5541,
12,
5435,
1161,
262,
288,
3639,
7155,
4756,
2258,
273,
1161,
422,
446,
31,
3639,
309,
261,
1161,
480,
446,
262,
288,
5411,
364,
261,
4039,
293,
273,
1161,
18,
58... | |
loop50: | loop51: | public PatternDescr fact_expression(String id) throws RecognitionException { PatternDescr pd; PatternDescr fe = null; PatternDescr f = null; pd = null; boolean multi = false; try { // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:812:17: ( '(' opt_eol fe= fact_expression[id] opt_eol ')' | f= fact opt_eol ( ('or'|'||') opt_eol f= fact )* ) int alt51=2; int LA51_0 = input.LA(1); if ( LA51_0==23 ) { alt51=1; } else if ( LA51_0==ID ) { alt51=2; } else { NoViableAltException nvae = new NoViableAltException("807:2: fact_expression[String id] returns [PatternDescr pd] : ( \'(\' opt_eol fe= fact_expression[id] opt_eol \')\' | f= fact opt_eol ( (\'or\'|\'||\') opt_eol f= fact )* );", 51, 0, input); throw nvae; } switch (alt51) { case 1 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:812:17: '(' opt_eol fe= fact_expression[id] opt_eol ')' { match(input,23,FOLLOW_23_in_fact_expression1991); following.push(FOLLOW_opt_eol_in_fact_expression1993); opt_eol(); following.pop(); following.push(FOLLOW_fact_expression_in_fact_expression1997); fe=fact_expression(id); following.pop(); following.push(FOLLOW_opt_eol_in_fact_expression1999); opt_eol(); following.pop(); match(input,25,FOLLOW_25_in_fact_expression2001); pd=fe; } break; case 2 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:813:17: f= fact opt_eol ( ('or'|'||') opt_eol f= fact )* { following.push(FOLLOW_fact_in_fact_expression2012); f=fact(); following.pop(); following.push(FOLLOW_opt_eol_in_fact_expression2014); opt_eol(); following.pop(); ((ColumnDescr)f).setIdentifier( id ); pd = f; // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:818:17: ( ('or'|'||') opt_eol f= fact )* loop50: do { int alt50=2; int LA50_0 = input.LA(1); if ( (LA50_0>=44 && LA50_0<=45) ) { alt50=1; } switch (alt50) { case 1 : // /home/michael/projects/jboss-rules/drools-compiler/src/main/resources/org/drools/lang/drl.g:818:25: ('or'|'||') opt_eol f= fact { if ( (input.LA(1)>=44 && input.LA(1)<=45) ) { input.consume(); errorRecovery=false; } else { MismatchedSetException mse = new MismatchedSetException(null,input); recoverFromMismatchedSet(input,mse,FOLLOW_set_in_fact_expression2027); throw mse; } following.push(FOLLOW_opt_eol_in_fact_expression2032); opt_eol(); following.pop(); if ( ! multi ) { PatternDescr first = pd; pd = new OrDescr(); ((OrDescr)pd).addDescr( first ); multi=true; } following.push(FOLLOW_fact_in_fact_expression2046); f=fact(); following.pop(); ((ColumnDescr)f).setIdentifier( id ); ((OrDescr)pd).addDescr( f ); } break; default : break loop50; } } while (true); } break; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return pd; } | 31577 /local/tlutelli/issta_data/temp/all_java3context/java/2006_temp/2006/31577/12c8feffd968f958100f654d836fa3c2ee21ded8/RuleParser.java/buggy/drools-compiler/src/main/java/org/drools/lang/RuleParser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
6830,
16198,
5410,
67,
8692,
12,
780,
612,
13,
1216,
9539,
288,
6647,
6830,
16198,
4863,
31,
3639,
6830,
16198,
1656,
273,
446,
31,
3639,
6830,
16198,
284,
273,
446,
31,
1850,
202,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
6830,
16198,
5410,
67,
8692,
12,
780,
612,
13,
1216,
9539,
288,
6647,
6830,
16198,
4863,
31,
3639,
6830,
16198,
1656,
273,
446,
31,
3639,
6830,
16198,
284,
273,
446,
31,
1850,
202,
... |
final String desiredResult = "Axis #0:" + nl + "{}" + nl + "Axis #1:" + nl + "{[Store].[All Stores]}" + nl + "Axis #2:" + nl + "{[Measures].[Store Sales]}" + nl + "{[Measures].[A]}" + nl + "Row #0: 565,238.13" + nl + "Row #1: 319,494,143,605.90" + nl; runQueryCheckResult("WITH MEMBER [Measures].[A] AS" + nl + " '([Measures].[Store Sales] * [Measures].[Store Sales])'" + nl + "SELECT {[Store]} ON COLUMNS," + nl + " {[Measures].[Store Sales], [Measures].[A]} ON ROWS" + nl + "FROM Sales", | final String desiredResult = wrap(new String[] { "Axis #0:", "{}", "Axis #1:", "{[Store].[All Stores]}", "Axis #2:", "{[Measures].[Store Sales]}", "{[Measures].[A]}", "Row #0: 565,238.13", "Row #1: 319,494,143,605.90" + nl}); assertQueryReturns( wrap(new String[] { "WITH MEMBER [Measures].[A] AS", " '([Measures].[Store Sales] * [Measures].[Store Sales])'", "SELECT {[Store]} ON COLUMNS,", " {[Measures].[Store Sales], [Measures].[A]} ON ROWS", "FROM Sales"}), | public void testMultiplyBug774807() { final String desiredResult = "Axis #0:" + nl + "{}" + nl + "Axis #1:" + nl + "{[Store].[All Stores]}" + nl + "Axis #2:" + nl + "{[Measures].[Store Sales]}" + nl + "{[Measures].[A]}" + nl + "Row #0: 565,238.13" + nl + "Row #1: 319,494,143,605.90" + nl; runQueryCheckResult("WITH MEMBER [Measures].[A] AS" + nl + " '([Measures].[Store Sales] * [Measures].[Store Sales])'" + nl + "SELECT {[Store]} ON COLUMNS," + nl + " {[Measures].[Store Sales], [Measures].[A]} ON ROWS" + nl + "FROM Sales", desiredResult); // as above, no parentheses runQueryCheckResult("WITH MEMBER [Measures].[A] AS" + nl + " '[Measures].[Store Sales] * [Measures].[Store Sales]'" + nl + "SELECT {[Store]} ON COLUMNS," + nl + " {[Measures].[Store Sales], [Measures].[A]} ON ROWS" + nl + "FROM Sales", desiredResult); // as above, plus 0 runQueryCheckResult("WITH MEMBER [Measures].[A] AS" + nl + " '[Measures].[Store Sales] * [Measures].[Store Sales] + 0'" + nl + "SELECT {[Store]} ON COLUMNS," + nl + " {[Measures].[Store Sales], [Measures].[A]} ON ROWS" + nl + "FROM Sales", desiredResult); } | 4891 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4891/3041f930b5fc4bf6aa3339845b828801c1d8b366/FunctionTest.java/clean/testsrc/main/mondrian/olap/fun/FunctionTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
26040,
19865,
4700,
24,
3672,
27,
1435,
288,
3639,
727,
514,
6049,
1253,
273,
315,
6558,
468,
20,
2773,
397,
7741,
397,
7734,
13034,
397,
7741,
397,
7734,
315,
6558,
468,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
26040,
19865,
4700,
24,
3672,
27,
1435,
288,
3639,
727,
514,
6049,
1253,
273,
315,
6558,
468,
20,
2773,
397,
7741,
397,
7734,
13034,
397,
7741,
397,
7734,
315,
6558,
468,... |
final int rowsToAdd = 8; final String theString = "abcdefghijklmnopqrstuvwxyz"; int count = 0; for (int i = 1; i <= rowsToAdd; i++) { pStmt.setInt(1, i); pStmt.setString(2, theString.substring(0, i)); | final int rowsToAdd = 8; final String theString = "abcdefghijklmnopqrstuvwxyz"; int count = 0; for (int i = 1; i <= rowsToAdd; i++) { pStmt.setInt(1, i); pStmt.setString(2, theString.substring(0, i)); | public void testPreparedStatement0008() throws Exception { Connection cx = getConnection(); dropTable("#t0008"); Statement stmt = cx.createStatement(); stmt.executeUpdate("create table #t0008 " + " (i integer not null, " + " s char(10) not null) "); PreparedStatement pStmt = cx.prepareStatement( "insert into #t0008 values (?, ?)"); final int rowsToAdd = 8; final String theString = "abcdefghijklmnopqrstuvwxyz"; int count = 0; for (int i = 1; i <= rowsToAdd; i++) { pStmt.setInt(1, i); pStmt.setString(2, theString.substring(0, i)); count += pStmt.executeUpdate(); } assertTrue(count == rowsToAdd); ResultSet rs = stmt.executeQuery("select s, i from #t0008"); assertNotNull(rs); count = 0; while (rs.next()) { count++; assertTrue(rs.getString(1).trim().length() == rs.getInt(2)); } assertTrue(count == rowsToAdd); } | 2029 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2029/7df6dc0065b654cd4e2b156461e0394d01dd13aa/TimestampTest.java/buggy/src.old/test/freetds/TimestampTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1842,
29325,
3784,
28,
1435,
1216,
1185,
202,
95,
202,
202,
1952,
9494,
273,
6742,
5621,
202,
202,
7285,
1388,
2932,
7,
88,
3784,
28,
8863,
202,
202,
3406,
3480,
273,
949... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1842,
29325,
3784,
28,
1435,
1216,
1185,
202,
95,
202,
202,
1952,
9494,
273,
6742,
5621,
202,
202,
7285,
1388,
2932,
7,
88,
3784,
28,
8863,
202,
202,
3406,
3480,
273,
949... |
if (this.next != null) { throw new SecurityException("Cannot set next twice"); } | if (this.next != null) { throw new SecurityException( "Cannot set next twice"); } | final void setNext(VmCompiledCode next) { if (this.next != null) { throw new SecurityException("Cannot set next twice"); } this.next = next; } | 50763 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50763/50e31eccd50a204db22831206646c58f95c4cc44/VmCompiledCode.java/clean/core/src/core/org/jnode/vm/classmgr/VmCompiledCode.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
727,
918,
27674,
12,
22143,
20733,
1085,
1024,
13,
288,
3639,
309,
261,
2211,
18,
4285,
480,
446,
13,
288,
5411,
604,
394,
17780,
2932,
4515,
444,
1024,
13605,
8863,
3639,
289,
3639,
333,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
727,
918,
27674,
12,
22143,
20733,
1085,
1024,
13,
288,
3639,
309,
261,
2211,
18,
4285,
480,
446,
13,
288,
5411,
604,
394,
17780,
2932,
4515,
444,
1024,
13605,
8863,
3639,
289,
3639,
333,... |
CachedUrl url = sau.makeCachedUrl(sau.getAuCachedUrlSet(), file); | CachedUrl url = sau.makeCachedUrl(file); | private void checkUrlContent(String path, int fileNum, int depth, int branchNum, boolean isAbnormal, boolean isDamaged) throws IOException { String file = SimulatedArchivalUnit.SIMULATED_URL_ROOT + path; CachedUrl url = sau.makeCachedUrl(sau.getAuCachedUrlSet(), file); String content = getUrlContent(url); String expectedContent; if (path.endsWith(".html")) { String fn = path.substring(path.lastIndexOf("/") + 1); expectedContent = SimulatedContentGenerator.getHtmlFileContent(fn, fileNum, depth, branchNum, isAbnormal); } else { expectedContent = SimulatedContentGenerator.getFileContent( fileNum, depth, branchNum, isAbnormal); } if (isDamaged) { assertNotEquals(expectedContent, content); } else { assertEquals(expectedContent, content); } } | 8150 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8150/1daae17bba467f29e3575dfd082f58a6511a6679/FuncSimulatedContent.java/clean/test/src/org/lockss/plugin/simulated/FuncSimulatedContent.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
918,
866,
1489,
1350,
12,
780,
589,
16,
509,
585,
2578,
16,
509,
3598,
16,
1171,
9079,
509,
3803,
2578,
16,
1250,
353,
5895,
6130,
16,
1171,
9079,
1250,
353,
40,
301,
11349,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
918,
866,
1489,
1350,
12,
780,
589,
16,
509,
585,
2578,
16,
509,
3598,
16,
1171,
9079,
509,
3803,
2578,
16,
1250,
353,
5895,
6130,
16,
1171,
9079,
1250,
353,
40,
301,
11349,
13,
... |
this.lang = lang; } | this.lang = lang; } | public void setLang(ParserLanguage lang) { this.lang = lang; } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/b811a0479b1c2c7ce6e95c22d0b6d0585297b95e/DOMAST.java/buggy/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMAST.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
444,
7275,
12,
2678,
3779,
3303,
13,
288,
202,
202,
2211,
18,
4936,
273,
3303,
31,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
444,
7275,
12,
2678,
3779,
3303,
13,
288,
202,
202,
2211,
18,
4936,
273,
3303,
31,
202,
97,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
String[] oldList = dataSetChooser.getItems( ); | String[] oldList = dataSetChooser.getItems( ); | private void refreshDataSets( ) { String selectedDataSetName = dataSetChooser.getText( ); String[] oldList = dataSetChooser.getItems( ); String[] newList = ChoiceSetFactory.getDataSets( ); if ( oldList.length != newList.length ) { dataSetChooser.setItems( newList ); if ( StringUtil.isBlank( selectedDataSetName ) ) { dataSetChooser.select( 0 ); refreshColumns( false ); } else { dataSetChooser.setText( selectedDataSetName ); } } } | 15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/77d7b99c1db9fcaef19117ebec1de4e05da3230c/ParameterDialog.java/clean/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/ParameterDialog.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
4460,
751,
2785,
12,
262,
202,
95,
202,
202,
780,
3170,
751,
11924,
273,
14837,
17324,
18,
588,
1528,
12,
11272,
202,
202,
780,
8526,
1592,
682,
273,
14837,
17324,
18,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
4460,
751,
2785,
12,
262,
202,
95,
202,
202,
780,
3170,
751,
11924,
273,
14837,
17324,
18,
588,
1528,
12,
11272,
202,
202,
780,
8526,
1592,
682,
273,
14837,
17324,
18,
5... |
if(getClassdiagramNode(i).getFigure().getOwner() == m) | if (getClassdiagramNode(i).getFigure().getOwner() == m) | private ClassdiagramNode getClassdiagramNode4owner(Object m) { for(int i=0; i < _layoutedClassNodes.size(); i++) { if (_layoutedClassNodes.elementAt(i) instanceof ClassdiagramNode) if(getClassdiagramNode(i).getFigure().getOwner() == m) return getClassdiagramNode(i); } return null; } | 7166 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7166/ca3bcb5d6dd283c4553bcbfe50b108dc5d499768/ClassdiagramLayouter.java/clean/src_new/org/argouml/uml/diagram/static_structure/layout/ClassdiagramLayouter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
1659,
12264,
1940,
907,
2900,
12264,
1940,
907,
24,
8443,
12,
921,
312,
13,
288,
3639,
364,
12,
474,
277,
33,
20,
31,
277,
411,
389,
6741,
329,
797,
3205,
18,
1467,
5621,
277,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
1659,
12264,
1940,
907,
2900,
12264,
1940,
907,
24,
8443,
12,
921,
312,
13,
288,
3639,
364,
12,
474,
277,
33,
20,
31,
277,
411,
389,
6741,
329,
797,
3205,
18,
1467,
5621,
277,
2... |
Class.forName(shortName); shortNameIsAClass = true; | Class.forName(packageName); packageNameIsAClass = true; | createClassNameShort(Class sourceClass) { if (className.indexOf('.') == -1) return className; if (sourceClass.getPackage() != null && sourceClass.getPackage().getName() != null) return className.substring(sourceClass.getPackage().getName().length() + 1); // We have to do this trickery to make sure inner classes have their whole name (I think?) String shortName = className; boolean shortNameIsAClass = true; int lastPeriod = shortName.indexOf('.'); while (shortNameIsAClass && lastPeriod != -1) { shortName = shortName.substring(0, lastPeriod); lastPeriod = shortName.lastIndexOf('.'); try { Class.forName(shortName); shortNameIsAClass = true; } catch (Throwable e) { shortNameIsAClass = false; } } return shortName; } | 7796 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7796/5979b7373ab067990338a0d357c901d7663ad8a6/SimpleLogger.java/clean/src/org/grlea/log/SimpleLogger.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
565,
752,
3834,
4897,
12,
797,
24500,
13,
282,
288,
1377,
309,
261,
12434,
18,
31806,
2668,
1093,
13,
422,
300,
21,
13,
540,
327,
2658,
31,
1377,
309,
261,
3168,
797,
18,
588,
2261,
1435,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
565,
752,
3834,
4897,
12,
797,
24500,
13,
282,
288,
1377,
309,
261,
12434,
18,
31806,
2668,
1093,
13,
422,
300,
21,
13,
540,
327,
2658,
31,
1377,
309,
261,
3168,
797,
18,
588,
2261,
1435,
... |
SWDownloadCandidate candidate = (SWDownloadCandidate)iterator.next(); | public void rateDownloadScopeList( RatedDownloadScopeList ratedScopeList) { long oldestConnectTime = System.currentTimeMillis() - BAD_CANDIDATE_STATUS_TIMEOUT; synchronized( candidatesLock ) { Iterator iterator = goodCandidatesList.iterator(); while( iterator.hasNext() ) { SWDownloadCandidate candidate = (SWDownloadCandidate)iterator.next(); if ( candidate.getLastConnectionTime() == 0 || candidate.getLastConnectionTime() < oldestConnectTime ) { continue; } DownloadScopeList availableScopeList = candidate.getAvailableScopeList(); if ( availableScopeList == null ) { availableScopeList = new DownloadScopeList(); availableScopeList.add( new DownloadScope( 0, fileSize - 1) ); } ratedScopeList.rateDownloadScopeList( availableScopeList, candidate.getSpeed() ); } } } | 52996 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52996/5f5e8532b72a060eacff935799b91c9157882425/SWDownloadFile.java/buggy/src/phex/download/swarming/SWDownloadFile.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
4993,
7109,
3876,
682,
12,
534,
690,
7109,
3876,
682,
436,
690,
3876,
682,
13,
565,
288,
3639,
1525,
17067,
5215,
950,
273,
2332,
18,
2972,
28512,
1435,
300,
16467,
67,
39,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
4993,
7109,
3876,
682,
12,
534,
690,
7109,
3876,
682,
436,
690,
3876,
682,
13,
565,
288,
3639,
1525,
17067,
5215,
950,
273,
2332,
18,
2972,
28512,
1435,
300,
16467,
67,
39,
4... | |
return super.getPermissions(cs); } | PermissionCollection permissions = super.getPermissions(cs); Enumeration enum = permissions.elements(); while (enum.hasMoreElements()) { Main.debug(this + " Permission: " + enum.nextElement()); } | protected PermissionCollection getPermissions(CodeSource cs) { Main.debug(dbgID + " getPermissions(" + cs + ")"); return super.getPermissions(cs); } | 45545 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45545/397ccd4b913f7bee55cbf0bc78c6405a5b64556e/KJASAppletClassLoader.java/clean/khtml/java/org/kde/kjas/server/KJASAppletClassLoader.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
8509,
2532,
25021,
12,
1085,
1830,
2873,
13,
288,
3639,
12740,
18,
4148,
12,
1966,
75,
734,
397,
315,
25021,
2932,
397,
2873,
397,
7310,
1769,
3639,
327,
2240,
18,
588,
6521,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
8509,
2532,
25021,
12,
1085,
1830,
2873,
13,
288,
3639,
12740,
18,
4148,
12,
1966,
75,
734,
397,
315,
25021,
2932,
397,
2873,
397,
7310,
1769,
3639,
327,
2240,
18,
588,
6521,
12,
... |
if (additionalEntries == 0) { | if (toAdd == 0) { | private void computeDisplay() { final int level = constr.level; final int[] displayCode = constr.displayCode; ScalaClassType[] parents = getParents(); display = new ScalaClassType[level + 1][]; ScalaClassType[][] superClassDisplay = constr.inheritsFromJavaClass ? EMPTY_DISPLAY : parents[0].getDisplay(); for (int l = 0, dci = 0; l <= level; ++l) { int additionalEntries = displayCode[dci++]; ScalaClassType[] initialRow; if (l < superClassDisplay.length) initialRow = superClassDisplay[l]; else if (l == level) initialRow = new ScalaClassType[] { this }; else initialRow = EMPTY_DISPLAY_ROW; if (additionalEntries == 0) { display[l] = initialRow; } else { int superLen = initialRow.length; ScalaClassType[] newRow = new ScalaClassType[superLen + additionalEntries]; System.arraycopy(initialRow, 0, newRow, 0, superLen); for (int i = 0; i < additionalEntries; ++i) { int p = displayCode[dci++]; int o = displayCode[dci++]; newRow[superLen + i] = parents[p].getDisplay()[l][o]; } display[l] = newRow; } } } | 48012 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/48012/3620f945d10ebb12213163dbfeef9eb547ae201b/ScalaClassType.java/clean/sources/scala/runtime/types/ScalaClassType.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
3671,
4236,
1435,
288,
3639,
727,
509,
1801,
273,
14472,
18,
2815,
31,
3639,
727,
509,
8526,
2562,
1085,
273,
14472,
18,
5417,
1085,
31,
3639,
348,
771,
69,
18328,
8526,
6298,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
3671,
4236,
1435,
288,
3639,
727,
509,
1801,
273,
14472,
18,
2815,
31,
3639,
727,
509,
8526,
2562,
1085,
273,
14472,
18,
5417,
1085,
31,
3639,
348,
771,
69,
18328,
8526,
6298,
... |
if (planes.getChar(end -1) != '-') | if (planes.getChar(end - 1) != '-') | private void rightAdjustField(char fill) { int end = endOfField(false); // get the ending position of the first // non blank character in field // get the number of characters to the right int count = screenFields.getCurrentField().endPos() - end; // subtract 1 from count for signed numeric - note for later if (screenFields.getCurrentField().isSignedNumeric()) { if (planes.getChar(end -1) != '-') count--; } int pos = screenFields.getCurrentField().startPos(); while (count-- >= 0) { shiftRight(pos); planes.setChar(pos,fill); setDirty(pos); } } | 4212 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4212/caf3d80f5859ebce4d72dbe0ddd1d32b417462c4/Screen5250.java/clean/src/org/tn5250j/framework/tn5250/Screen5250.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
2145,
10952,
974,
12,
3001,
3636,
13,
288,
202,
202,
474,
679,
273,
20706,
974,
12,
5743,
1769,
368,
336,
326,
11463,
1754,
434,
326,
1122,
202,
202,
759,
1661,
7052,
33... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
2145,
10952,
974,
12,
3001,
3636,
13,
288,
202,
202,
474,
679,
273,
20706,
974,
12,
5743,
1769,
368,
336,
326,
11463,
1754,
434,
326,
1122,
202,
202,
759,
1661,
7052,
33... |
boolean stopProcessing = false; if (descriptor.getResponseRouter() != null) { stopProcessing = descriptor.getResponseRouter().isStopProcessing(); } else { stopProcessing = event.isStopFurtherProcessing(); } | boolean stopProcessing = !descriptor.getOutboundRouter().hasEndpoints(); | public Object onCall(UMOEvent event) throws UMOException { Object result = null; try { // Check for method override Object methodOverride = event.removeProperty(MuleProperties.MULE_METHOD_PROPERTY); Method method = null; if (methodOverride instanceof Method) { method = (Method) methodOverride; } else if (methodOverride != null) { method = ClassHelper.getMethod(methodOverride.toString(), component.getClass()); } // Invoke method result = entryPoint.invoke(component, RequestContext.getEventContext(), method); UMOMessage resultMessage = null; if (result == null && entryPoint.isVoid()) { resultMessage = new MuleMessage(event.getTransformedMessage(), event.getProperties()); } else if (result != null) { if (result instanceof UMOMessage) { resultMessage = (UMOMessage) result; } else { resultMessage = new MuleMessage(result, event.getProperties()); } } boolean stopProcessing = false; if (descriptor.getResponseRouter() != null) { stopProcessing = descriptor.getResponseRouter().isStopProcessing(); } else { stopProcessing = event.isStopFurtherProcessing(); } // Need to find a cleaner solution for handling response messages // Right now routing is split between here a nd the proxy if (descriptor.getResponseRouter() != null) { if (event.isSynchronous() && !stopProcessing) { // we need to do the outbound first but we dispatch // aynshonously as // we are waiting for a response on another resource stopProcessing = true; descriptor.getOutboundRouter().route(resultMessage, event.getSession(), false); } logger.debug("Waiting for response router message"); result = descriptor.getResponseRouter().getResponse(resultMessage); if (stopProcessing) { logger.debug("Setting stop oubound processing according to response router"); RequestContext.getEvent().setStopFurtherProcessing(true); } return result; } else { return resultMessage; } } catch (Exception e) { throw new MessagingException(new Message(Messages.FAILED_TO_INVOKE_X, "UMO Component: " + descriptor.getName()), event.getMessage(), e); } } | 28323 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/28323/7b2165aa81ea2fae21c28a03d938216064694de7/DefaultLifecycleAdapter.java/buggy/src/java/org/mule/impl/DefaultLifecycleAdapter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1033,
603,
1477,
12,
2799,
51,
1133,
871,
13,
1216,
587,
5980,
503,
565,
288,
3639,
1033,
563,
273,
446,
31,
3639,
775,
288,
5411,
368,
2073,
364,
707,
3849,
5411,
1033,
707,
6618... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1033,
603,
1477,
12,
2799,
51,
1133,
871,
13,
1216,
587,
5980,
503,
565,
288,
3639,
1033,
563,
273,
446,
31,
3639,
775,
288,
5411,
368,
2073,
364,
707,
3849,
5411,
1033,
707,
6618... |
throw new SqlException(agent_.logWriter_, e, "Encoding is unsupported for conversion to TIME"); | throw new SqlException(agent_.logWriter_, new MessageId(SQLState.UNSUPPORTED_ENCODING), "TIMESTAMP", "java.sql.Time", e); | private final java.sql.Time getTimeFromTIMESTAMP(int column) throws SqlException { try { return org.apache.derby.client.am.DateTime.timestampBytesToTime(dataBuffer_, columnDataPosition_[column - 1], recyclableTime_, charsetName_[column -1]); } catch (UnsupportedEncodingException e) { throw new SqlException(agent_.logWriter_, e, "Encoding is unsupported for conversion to TIME"); } } | 56322 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56322/3d650b1cb0e7096b3c8b3a076a5ded716f7e1c4a/Cursor.java/clean/java/client/org/apache/derby/client/am/Cursor.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
727,
2252,
18,
4669,
18,
950,
6135,
1265,
17201,
12,
474,
1057,
13,
1216,
8855,
503,
288,
3639,
775,
288,
5411,
327,
2358,
18,
19211,
18,
765,
1637,
18,
2625,
18,
301,
18,
5096,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
727,
2252,
18,
4669,
18,
950,
6135,
1265,
17201,
12,
474,
1057,
13,
1216,
8855,
503,
288,
3639,
775,
288,
5411,
327,
2358,
18,
19211,
18,
765,
1637,
18,
2625,
18,
301,
18,
5096,
... |
{ return false; } | { return false; } | public boolean supportsOuterJoins() throws SQLException { return false; } | 45454 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45454/6a061da272f04e1463864065f87f1f3fd61d6162/DatabaseMetaData.java/clean/src/interfaces/jdbc/postgresql/DatabaseMetaData.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1250,
6146,
15040,
21108,
1435,
1216,
6483,
202,
95,
202,
202,
2463,
629,
31,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1250,
6146,
15040,
21108,
1435,
1216,
6483,
202,
95,
202,
202,
2463,
629,
31,
202,
97,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
super(parameters); | public MarkupInheritanceExtension_4(final PageParameters parameters) { super(parameters); add(new Label("label3", "extension label")); } | 46434 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46434/0fdf3c0295a9652408915ea02c10f339dc24347f/MarkupInheritanceExtension_4.java/buggy/wicket/src/test/wicket/markup/MarkupInheritanceExtension_4.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
26420,
28255,
3625,
67,
24,
12,
6385,
3460,
2402,
1472,
13,
225,
202,
95,
202,
565,
2240,
12,
3977,
1769,
202,
377,
202,
565,
527,
12,
2704,
5287,
2932,
1925,
23,
3113,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
26420,
28255,
3625,
67,
24,
12,
6385,
3460,
2402,
1472,
13,
225,
202,
95,
202,
565,
2240,
12,
3977,
1769,
202,
377,
202,
565,
527,
12,
2704,
5287,
2932,
1925,
23,
3113,
315,
... | |
if (parentElement instanceof Document) { xsdComp = xsdSchema; xsdModelAdapterFactory.adapt(xsdComp, xsdModelAdapterFactory); | if (parentElement instanceof IDOMModel) { IDOMDocument domDoc = ((IDOMModel) parentElement).getDocument(); if (domDoc != null) { XSDModelAdapter modelAdapter = (XSDModelAdapter) domDoc.getExistingAdapter(XSDModelAdapter.class); /* * ISSUE: Didn't want to go through initializing * schema if it does not already exist, so just * attempted to get existing adapter. If doesn't * exist, just don't bother working. */ if (modelAdapter != null) xsdComp = modelAdapter.getSchema(); if (xsdComp != null) { xsdModelAdapterFactory.adapt(xsdComp, xsdModelAdapterFactory); | public Object[] getChildren(Object parentElement) { XSDConcreteComponent xsdComp = null; List list = null; if (parentElement instanceof Document) { xsdComp = xsdSchema; xsdModelAdapterFactory.adapt(xsdComp, xsdModelAdapterFactory); list = new ArrayList(); list.add(xsdComp); return list.toArray(); } else if (parentElement instanceof XSDConcreteComponent) { xsdComp = (XSDConcreteComponent)parentElement; list = new ArrayList(); } else if (parentElement instanceof ITreeItemContentProvider) { return ((ITreeItemContentProvider)parentElement).getChildren(parentElement).toArray(); } else if (parentElement instanceof ITreeContentProvider) { return ((ITreeContentProvider)parentElement).getChildren(parentElement); } if (xsdComp != null) { XSDAbstractAdapter a = (XSDAbstractAdapter)xsdModelAdapterFactory.adapt(xsdComp, xsdModelAdapterFactory); if (xsdComp instanceof XSDElementDeclaration || xsdComp instanceof XSDModelGroup || xsdComp instanceof XSDWildcard) { xsdModelAdapterFactory.adapt(((XSDParticleContent)xsdComp).getContainer(), xsdModelAdapterFactory); } if (a != null) { Object [] obj = a.getChildren(xsdComp); if (obj != null) { list = Arrays.asList(obj); } } } list = list != null ? list : Collections.EMPTY_LIST; return list.toArray(); } | 13989 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13989/64de6da717851c7df521a5645f367316a8c3bb3a/XSDContentProvider.java/clean/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/provider/XSDContentProvider.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
1033,
8526,
10268,
12,
921,
30363,
13,
225,
288,
565,
26462,
25845,
1841,
14802,
2945,
273,
446,
31,
565,
987,
666,
273,
446,
31,
565,
309,
261,
2938,
1046,
1276,
4319,
13,
565,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
1033,
8526,
10268,
12,
921,
30363,
13,
225,
288,
565,
26462,
25845,
1841,
14802,
2945,
273,
446,
31,
565,
987,
666,
273,
446,
31,
565,
309,
261,
2938,
1046,
1276,
4319,
13,
565,
2... |
copyCursor) { if (copyCursor.atEnd()){ return; } else if (offset == 0) { return; } else if (offset == copyCursor.current().getSize()){ copyCursor.remove(); } else if (copyCursor.current().isGap()){ copyCursor.current().shrink(offset); } else if (copyCursor.current().isMultipleCharBrace()){ if (offset != 1) throw new IllegalArgumentException("Offset incorrect"); else{ String type = copyCursor.current().getType(); String second = type.substring(1,2); copyCursor.current().setType(second); } } else { throw new IllegalArgumentException("Cannot clip left."); } } | copyCursor) { if (copyCursor.atEnd()) { return; } else if (offset == 0) { return; } else if (offset == copyCursor.current().getSize()) { copyCursor.remove(); } else if (copyCursor.current().isGap()) { copyCursor.current().shrink(offset); } else if (copyCursor.current().isMultipleCharBrace()) { if (offset != 1) { throw new IllegalArgumentException("Offset incorrect"); } else { String type = copyCursor.current().getType(); String second = type.substring(1,2); copyCursor.current().setType(second); } } else { throw new IllegalArgumentException("Cannot clip left."); } } | private void _clipRight(int offset, ModelList<ReducedToken>.Iterator copyCursor) { if (copyCursor.atEnd()){ return; } else if (offset == 0) { return; } else if (offset == copyCursor.current().getSize()){ copyCursor.remove(); } else if (copyCursor.current().isGap()){ copyCursor.current().shrink(offset); } else if (copyCursor.current().isMultipleCharBrace()){ if (offset != 1) throw new IllegalArgumentException("Offset incorrect"); else{ String type = copyCursor.current().getType(); String second = type.substring(1,2); copyCursor.current().setType(second); } } else { throw new IllegalArgumentException("Cannot clip left."); } } | 11192 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11192/0d5978f95b9d81515ff8908c4d2b74c1df5a1255/ReducedModelComment.java/clean/drjava/src/edu/rice/cs/drjava/ReducedModelComment.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
389,
14161,
4726,
12,
474,
1384,
16,
3164,
682,
32,
16911,
3263,
1345,
18652,
3198,
6862,
6862,
6862,
202,
3530,
6688,
13,
202,
202,
95,
1082,
202,
430,
261,
3530,
6688,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
389,
14161,
4726,
12,
474,
1384,
16,
3164,
682,
32,
16911,
3263,
1345,
18652,
3198,
6862,
6862,
6862,
202,
3530,
6688,
13,
202,
202,
95,
1082,
202,
430,
261,
3530,
6688,
... |
transformer.applyTemplateToNode(this, null, sourceNode); | ElemTemplate matchTemplate = transformer.getMatchedTemplate(); transformer.applyTemplateToNode(this, matchTemplate, sourceNode); | public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.currentTemplateRuleIsNull()) { transformer.getMsgMgr().error(this, XSLTErrorResources.ER_NO_APPLY_IMPORT_IN_FOR_EACH); //"xsl:apply-imports not allowed in a xsl:for-each"); } if (TransformerImpl.S_DEBUG) transformer.getTraceManager().fireTraceEvent(this); int sourceNode = transformer.getXPathContext().getCurrentNode(); if (DTM.NULL != sourceNode) { // This will have to change to current template, (which will have // to be the top of a current template stack). transformer.applyTemplateToNode(this, null, sourceNode); } else // if(null == sourceNode) { transformer.getMsgMgr().error(this, XSLTErrorResources.ER_NULL_SOURCENODE_APPLYIMPORTS); //"sourceNode is null in xsl:apply-imports!"); } if (TransformerImpl.S_DEBUG) transformer.getTraceManager().fireTraceEndEvent(this); } | 46591 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46591/d0b15fbfeed1e7ca475523cfb19f12c921b2e921/ElemApplyImport.java/clean/src/org/apache/xalan/templates/ElemApplyImport.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
1836,
12,
1850,
11519,
2828,
8360,
13,
5411,
1216,
21684,
225,
288,
565,
309,
261,
21523,
18,
2972,
2283,
2175,
2520,
2041,
10756,
565,
288,
1377,
8360,
18,
588,
3332,
9455,
76... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
1836,
12,
1850,
11519,
2828,
8360,
13,
5411,
1216,
21684,
225,
288,
565,
309,
261,
21523,
18,
2972,
2283,
2175,
2520,
2041,
10756,
565,
288,
1377,
8360,
18,
588,
3332,
9455,
76... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.