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 |
|---|---|---|---|---|---|---|
for (int currentColIndex = 0; currentColIndex <= lastColIndex; currentColIndex++) { final Item item = (Item)row.get(currentColIndex); final GridBagConstraints gbc = item.gbc; | for (int currentColIndex = 0; currentColIndex <= lastColIndex; currentColIndex++) { final Item item = (Item)row.get(currentColIndex); final GridBagConstraints gbc = item.gbc; | private void addRow(final List row, final int currentRowIndex, final int lastRowIndex, final JPanel panel) { final int lastColIndex = row.size() - 1; for (int currentColIndex = 0; currentColIndex <= lastColIndex; currentColIndex++) { final Item item = (Item)row.get(currentColIndex); final GridBagConstraints gbc = item.gbc; if (currentRowIndex == lastRowIndex) { formatLastRow(gbc); } if (currentColIndex == lastColIndex) { formatLastColumn(gbc, currentColIndex); } panel.add(item.component, gbc); } } | 55916 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55916/c0ce5b4b7230b5d76f6d3a2b632d4c0311d16d5d/GridBagLayoutBuilder.java/buggy/src/org/springframework/richclient/util/GridBagLayoutBuilder.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
918,
22030,
12,
6385,
987,
1027,
16,
727,
509,
783,
21769,
16,
727,
509,
1142,
21769,
16,
727,
24048,
6594,
13,
288,
565,
727,
509,
1142,
914,
1016,
273,
1027,
18,
1467,
1435,
300... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
22030,
12,
6385,
987,
1027,
16,
727,
509,
783,
21769,
16,
727,
509,
1142,
21769,
16,
727,
24048,
6594,
13,
288,
565,
727,
509,
1142,
914,
1016,
273,
1027,
18,
1467,
1435,
300... |
public void shutdown() { if (VERBOSE) JobManager.verbose("Shutdown"); //$NON-NLS-1$//TODO: BOG Put in Shutdown/* IndexSelector indexSelector = new IndexSelector(new JavaWorkspaceScope(), null, false, this); IIndex[] selectedIndexes = indexSelector.getIndexes(); SimpleLookupTable knownPaths = new SimpleLookupTable(); for (int i = 0, max = selectedIndexes.length; i < max; i++) { String path = selectedIndexes[i].getIndexFile().getAbsolutePath(); knownPaths.put(path, path); } if (indexStates != null) { Object[] indexNames = indexStates.keyTable; for (int i = 0, l = indexNames.length; i < l; i++) { String key = (String) indexNames[i]; if (key != null && !knownPaths.containsKey(key)) updateIndexState(key, null); } } File indexesDirectory = new File(getJavaPluginWorkingLocation().toOSString()); if (indexesDirectory.isDirectory()) { File[] indexesFiles = indexesDirectory.listFiles(); if (indexesFiles != null) { for (int i = 0, indexesFilesLength = indexesFiles.length; i < indexesFilesLength; i++) { String fileName = indexesFiles[i].getAbsolutePath(); if (!knownPaths.containsKey(fileName) && fileName.toLowerCase().endsWith(".index")) { //$NON-NLS-1$ if (VERBOSE) JobManager.verbose("Deleting index file " + indexesFiles[i]); //$NON-NLS-1$ indexesFiles[i].delete(); } } } }*/ super.shutdown(); } | 54911 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54911/e1a20e1a7dd14dfa50b0c35dc0b369aab2f0b405/IndexManager.java/clean/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
225,
918,
225,
5731,
1435,
225,
288,
202,
202,
430,
225,
261,
21900,
13,
1082,
202,
2278,
1318,
18,
11369,
2932,
10961,
8863,
225,
4329,
3993,
17,
5106,
17,
21,
8,
759,
6241,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
225,
918,
225,
5731,
1435,
225,
288,
202,
202,
430,
225,
261,
21900,
13,
1082,
202,
2278,
1318,
18,
11369,
2932,
10961,
8863,
225,
4329,
3993,
17,
5106,
17,
21,
8,
759,
6241,
... | ||
int callerCMID = buffer[i+1]; compiledMethod = VM_CompiledMethods.getCompiledMethod(callerCMID); if (compiledMethod == null) continue; VM_Method stackFrameCaller = compiledMethod.getMethod(); int MCOffset = buffer[i+2]; VM_CompilerInfo compilerInfo = compiledMethod.getCompilerInfo(); int bytecodeIndex = -1; VM_Method caller = null; | if (caller == null) { VM.sysWrite(" ***ERROR: getMethodForMCOffset("+ MCOffset+") returned null!\n"); caller = stackFrameCaller; continue; } } break; } | void thresholdReached() { if(DEBUG) VM.sysWrite("VM_AIByEdgeOrganizer.thresholdReached(): enter and reregister.\n"); VM_AdaptiveInlining.incrementNumYieldPoints(edgeListener. getTimesUpdateCalled()); for (int i=0; i<bufferSize; i=i+3) { VM_CompiledMethod compiledMethod = null; int calleeCMID = buffer[i+0]; compiledMethod = VM_CompiledMethods.getCompiledMethod(calleeCMID); if (compiledMethod == null) continue; VM_Method callee = compiledMethod.getMethod(); if (OPT_InliningUtilities.methodShouldNotBeInlined(callee)) { if(DEBUG)VM.sysWrite(" "+callee+" should not be inlined!\n"); continue; } int callerCMID = buffer[i+1]; compiledMethod = VM_CompiledMethods.getCompiledMethod(callerCMID); if (compiledMethod == null) continue; VM_Method stackFrameCaller = compiledMethod.getMethod(); int MCOffset = buffer[i+2]; VM_CompilerInfo compilerInfo = compiledMethod.getCompilerInfo(); int bytecodeIndex = -1; VM_Method caller = null; int compilerType = compilerInfo.getCompilerType(); switch (compilerType) { case VM_CompilerInfo.TRAP: case VM_CompilerInfo.JNI: if (DEBUG) VM.sysWrite("Skipping sample with TRAP/JNI caller"); continue; case VM_CompilerInfo.BASELINE: { VM_BaselineCompilerInfo baseCompilerInfo = (VM_BaselineCompilerInfo)compilerInfo; // note: the following call expects the offset in INSTRUCTIONS! bytecodeIndex = baseCompilerInfo.findBytecodeIndexForInstruction (MCOffset>>VM.LG_INSTRUCTION_WIDTH); caller = stackFrameCaller; } break; case VM_CompilerInfo.OPT: { VM_OptCompilerInfo optCompilerInfo = (VM_OptCompilerInfo)compilerInfo; VM_OptMachineCodeMap mc_map = optCompilerInfo.getMCMap(); try { bytecodeIndex = mc_map.getBytecodeIndexForMCOffset(MCOffset); if (bytecodeIndex == -1) { // this can happen we we sample a call // to a runtimeSerivce routine. // We aren't setup to inline such methods anyways, // so skip the sample. if (DEBUG) VM.sysWrite(" *** SKIP SAMPLE "+ stackFrameCaller+"@"+compiledMethod+ " at MC offset "+MCOffset+ " calling "+callee+ " due to invalid bytecodeIndex\n"); continue; // skip sample. } } catch (java.lang.ArrayIndexOutOfBoundsException e) { VM.sysWrite(" ***ERROR: getBytecodeIndexForMCOffset("+MCOffset +") ArrayIndexOutOfBounds!\n"); e.printStackTrace(); caller = stackFrameCaller; continue; // skip sample } catch (OPT_OptimizingCompilerException e) { VM.sysWrite("***Error: SKIP SAMPLE: can't find bytecode index in OPT compiled "+ stackFrameCaller+"@"+compiledMethod+" at MC offset "+MCOffset+"!\n"); continue; // skip sample } try { caller = mc_map.getMethodForMCOffset(MCOffset); } catch (java.lang.ArrayIndexOutOfBoundsException e) { VM.sysWrite(" ***ERROR: getMethodForMCOffset(" +MCOffset+") ArrayIndexOutOfBounds!\n"); e.printStackTrace(); caller = stackFrameCaller; continue; } catch (OPT_OptimizingCompilerException e) { VM.sysWrite("***Error: SKIP SAMPLE: can't find caller in OPT compiled "+ stackFrameCaller+"@"+compiledMethod+" at MC offset " +MCOffset+"!\n"); continue; // skip sample } if (caller == null) { VM.sysWrite(" ***ERROR: getMethodForMCOffset("+ MCOffset+") returned null!\n"); caller = stackFrameCaller; continue; // skip sample } } break; } // increment the call graph edge, adding it if needed callGraph.incrementEdge(caller, bytecodeIndex, callee); } // If using an offline inline plan, don't recompute anything, and don't // notify the controller. if (!VM_Controller.options.USE_OFFLINE_INLINE_PLAN) { // force a recomputation of the current state of hot edges Vector vectorOfTriples = VM_AdaptiveInlining.recomputeHotEdges(); if(DEBUG) { VM.sysWrite("\nNew edges found:\n"); for (int i=0; i<vectorOfTriples.size(); i++) { VM_CallSiteTriple triple = (VM_CallSiteTriple) vectorOfTriples.elementAt(i); VM.sysWrite((i+1)+": "+triple.toString()+"\n"); } } VM_MethodCountSet HM_data = VM_Controller.methodSamples.collectHotMethods(VM_Controller.options.MAX_OPT_LEVEL, VM_Controller.options.AI_METHOD_HOTNESS_THRESHOLD); if (VM.LogAOSEvents) VM_AOSLogging.AIorganizerFoundHotMethods(HM_data.cmids.length); findMethodsToRecompile(vectorOfTriples, HM_data); } if(DEBUG) callGraph.dump(); // Clear listener and activate it again. edgeListener.reset(); edgeListener.activate(); if(DEBUG)VM.sysWrite("VM_AIByEdgeOrganizer.thresholdReached(): exit\n"); } | 49871 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49871/a0927957aa5be43268c9be58e90e6e411a7dc909/VM_AIByEdgeOrganizer.java/clean/rvm/src/vm/adaptive/runtimeMeasurements/organizers/VM_AIByEdgeOrganizer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
918,
5573,
23646,
1435,
288,
565,
309,
12,
9394,
13,
1377,
8251,
18,
9499,
3067,
2932,
7397,
67,
18194,
858,
6098,
6001,
304,
1824,
18,
8699,
23646,
13332,
6103,
471,
436,
13630,
8403,
82... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
918,
5573,
23646,
1435,
288,
565,
309,
12,
9394,
13,
1377,
8251,
18,
9499,
3067,
2932,
7397,
67,
18194,
858,
6098,
6001,
304,
1824,
18,
8699,
23646,
13332,
6103,
471,
436,
13630,
8403,
82... |
mockDispatcher.dispatchResult = new Boolean(false); mockDispatcher.dispatchInvocation.setExpected( new Invocation( proxy, Object.class.getMethod( "equals", new Class[]{Object.class} ), new Object[]{"not a proxy"} ) ); assertFalse( "Passes invocation of equals to dispatcher", proxy.equals("not a proxy") ); mockDispatcher.verifyExpectations(); } | mockDispatcher.dispatchResult = new Boolean(false); mockDispatcher.dispatchInvocation.setExpected(new Invocation(proxy, Object.class.getMethod("equals", new Class[]{Object.class}), new Object[]{"not a proxy"})); assertFalse("Passes invocation of equals to dispatcher", proxy.equals("not a proxy")); mockDispatcher.verifyExpectations(); } | public void testCanOverrideEqualsForProxyBySettingAStub() throws Exception { mockDispatcher.dispatchResult = new Boolean(false); mockDispatcher.dispatchInvocation.setExpected( new Invocation( proxy, Object.class.getMethod( "equals", new Class[]{Object.class} ), new Object[]{"not a proxy"} ) ); assertFalse( "Passes invocation of equals to dispatcher", proxy.equals("not a proxy") ); mockDispatcher.verifyExpectations(); } | 54028 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54028/4aaf60d8fa76687c3492c508dd98678fbbd3d935/CoreMockTest.java/clean/jmock/core/src/test/jmock/core/CoreMockTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
2568,
6618,
8867,
1290,
3886,
858,
5568,
37,
11974,
1435,
1216,
1185,
288,
3639,
5416,
6681,
18,
10739,
1253,
273,
394,
3411,
12,
5743,
1769,
7734,
5416,
6681,
18,
10739,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2568,
6618,
8867,
1290,
3886,
858,
5568,
37,
11974,
1435,
1216,
1185,
288,
3639,
5416,
6681,
18,
10739,
1253,
273,
394,
3411,
12,
5743,
1769,
7734,
5416,
6681,
18,
10739,
... |
} default: | } default: | public void sawOpcode(int seen) { assert check; /* System.out.println("Saw " + PC + ": " + OPCODE_NAMES[seen] + " " + thisOnTOS + " " + fieldOnTOS ); */ if (staticMethod && dangerousToStoreIntoField && seen == PUTSTATIC && MutableStaticFields.mutableSignature(getSigConstantOperand()) ) { bugReporter.reportBug(new BugInstance("EI_EXPOSE_STATIC_REP2", NORMAL_PRIORITY) .addClassAndMethod(this) .addField(getClassConstantOperand(), getNameConstantOperand(), getSigConstantOperand(), true) .addSourceLine(this)); } if (!staticMethod && dangerousToStoreIntoField && seen == PUTFIELD && MutableStaticFields.mutableSignature(getSigConstantOperand()) ) { bugReporter.reportBug(new BugInstance("EI_EXPOSE_REP2", NORMAL_PRIORITY) .addClassAndMethod(this) .addField(getClassConstantOperand(), getNameConstantOperand(), getSigConstantOperand(), true) .addSourceLine(this)); /* System.out.println("Store of parameter " + r +"/" + parameterCount + " into field of type " + sigConstant + " in " + betterMethodName); bugReporter.reportBug(new BugInstance("EI_EXPOSE_REP2", NORMAL_PRIORITY) .addClassAndMethod(this) .addField(betterClassConstant, nameConstant, betterSigConstant, false) .addSourceLine(this)); ` */ } dangerousToStoreIntoField = false; int reg = -1; // this value should never be seen checkStore: { switch(seen) { case ALOAD_0: reg = 0; break; case ALOAD_1: reg = 1; break; case ALOAD_2: reg = 2; break; case ALOAD_3: reg = 3; break; case ALOAD: reg = getRegisterOperand(); break; default: break checkStore; } if (reg < parameterCount) timesRead[reg]++; } if (thisOnTOS && !staticMethod) { switch(seen) { case ALOAD_1: case ALOAD_2: case ALOAD_3: case ALOAD: if (reg < parameterCount ) { //r = reg; dangerousToStoreIntoField = true; // System.out.println("Found dangerous value from parameter " + reg); } default: } } else if (staticMethod) { switch(seen) { case ALOAD_0: case ALOAD_1: case ALOAD_2: case ALOAD_3: case ALOAD: if (reg < parameterCount ) { //r = reg; dangerousToStoreIntoField = true; } default: } } if (seen == ALOAD_0 && !staticMethod) { thisOnTOS = true; fieldOnTOS = false; return; } if (thisOnTOS && seen == GETFIELD && getClassConstantOperand().equals(getClassName())) { fieldOnTOS = true; thisOnTOS = false; nameOnStack = getNameConstantOperand(); classNameOnStack = getDottedClassConstantOperand(); sigOnStack = getSigConstantOperand(); fieldIsStatic = false; // System.out.println("Saw getfield"); return; } if (seen == GETSTATIC && getClassConstantOperand().equals(getClassName())) { fieldOnTOS = true; thisOnTOS = false; nameOnStack = getNameConstantOperand(); classNameOnStack = getDottedClassConstantOperand(); sigOnStack = getSigConstantOperand(); fieldIsStatic = true; return; } thisOnTOS = false; if (check && fieldOnTOS && seen == ARETURN /* && !sigOnStack.equals("Ljava/lang/String;") && sigOnStack.indexOf("Exception") == -1 && sigOnStack.indexOf("[") >= 0 */ && nameOnStack.indexOf("EMPTY") == -1 && MutableStaticFields.mutableSignature(sigOnStack) ) { bugReporter.reportBug(new BugInstance(staticMethod ? "MS_EXPOSE_REP" : "EI_EXPOSE_REP", NORMAL_PRIORITY) .addClassAndMethod(this) .addField(classNameOnStack, nameOnStack, sigOnStack, fieldIsStatic) .addSourceLine(this)); } fieldOnTOS = false; thisOnTOS = false; } | 10715 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/10715/1d541964940eaa91b52b21469dc5b763fef1d8d1/FindReturnRef.java/buggy/findbugs/src/java/edu/umd/cs/findbugs/detect/FindReturnRef.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
19821,
22808,
12,
474,
5881,
13,
288,
202,
11231,
866,
31,
202,
20308,
202,
3163,
18,
659,
18,
8222,
2932,
55,
2219,
315,
397,
26300,
397,
6398,
315,
397,
531,
3513,
2712,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19821,
22808,
12,
474,
5881,
13,
288,
202,
11231,
866,
31,
202,
20308,
202,
3163,
18,
659,
18,
8222,
2932,
55,
2219,
315,
397,
26300,
397,
6398,
315,
397,
531,
3513,
2712,
67... |
listModel.addElement(s); | listModel.add(s); | public JComponent createOptionsPanel() { JPanel panel = new JPanel(new GridLayout(5, 1, 2, 2)); final JCheckBox local = new JCheckBox(InspectionsBundle.message("inspection.unused.symbol.option"), LOCAL_VARIABLE); final JCheckBox field = new JCheckBox(InspectionsBundle.message("inspection.unused.symbol.option1"), FIELD); final JCheckBox method = new JCheckBox(InspectionsBundle.message("inspection.unused.symbol.option2"), METHOD); final JCheckBox classes = new JCheckBox(InspectionsBundle.message("inspection.unused.symbol.option3"), CLASS); final JCheckBox parameters = new JCheckBox(InspectionsBundle.message("inspection.unused.symbol.option4"), PARAMETER); final DefaultListModel listModel = new DefaultListModel(); final JList injectionList = new JList(listModel); for (String s : INJECTION_ANNOS) { listModel.addElement(s); } injectionList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); final DefaultActionGroup actionGroup = new DefaultActionGroup(); final ReorderableListController<String> controller = ReorderableListController.create(injectionList, actionGroup); controller.addAddAction(InspectionsBundle.message("dependency.injection.add.annotation.class"), new Factory<String>() { public String create() { return Messages.showInputDialog(InspectionsBundle.message("dependency.injection.annotation.class"), InspectionsBundle.message("dependency.injection.add.annotation.class"), Messages.getQuestionIcon()); } }, true); controller.addRemoveAction(InspectionsBundle.message("dependency.injection.remove.annotation.class")); injectionList.getModel().addListDataListener(new ListDataListener() { public void intervalAdded(ListDataEvent e) { listChanged(); } private void listChanged() { INJECTION_ANNOS.clear(); for (int i = 0; i < listModel.getSize(); i++) { INJECTION_ANNOS.add((String)listModel.getElementAt(i)); } } public void intervalRemoved(ListDataEvent e) { listChanged(); } public void contentsChanged(ListDataEvent e) { listChanged(); } }); final JScrollPane listScrollPane = ScrollPaneFactory.createScrollPane(injectionList); listScrollPane.setBorder(BorderFactory.createEtchedBorder()); listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); listScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); final FontMetrics fontMetrics = injectionList.getFontMetrics(injectionList.getFont()); listScrollPane.setPreferredSize(new Dimension(0, fontMetrics.getHeight() * 5)); final JPanel listPanel = new JPanel(new BorderLayout()); listPanel.setBorder(BorderFactory.createTitledBorder(InspectionsBundle.message("dependency.injection.annotations.list"))); listPanel.add(ActionManager.getInstance().createActionToolbar(ActionPlaces.PROJECT_VIEW_TOOLBAR, actionGroup, true).getComponent(), BorderLayout.NORTH); listPanel.add(listScrollPane, BorderLayout.SOUTH); final ActionListener listener = new ActionListener() { public void actionPerformed(ActionEvent e) { LOCAL_VARIABLE = local.isSelected(); CLASS = classes.isSelected(); FIELD = field.isSelected(); PARAMETER = parameters.isSelected(); METHOD = method.isSelected(); } }; local.addActionListener(listener); field.addActionListener(listener); method.addActionListener(listener); classes.addActionListener(listener); parameters.addActionListener(listener); panel.add(local); panel.add(field); panel.add(method); panel.add(classes); panel.add(parameters); JPanel doNotExpand = new JPanel(new BorderLayout()); final JPanel north = new JPanel(new BorderLayout(2, 2)); north.add(panel, BorderLayout.NORTH); north.add(listPanel, BorderLayout.SOUTH); doNotExpand.add(north, BorderLayout.NORTH); return doNotExpand; } | 12814 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12814/29847c64f0c0afa7fa994c2356623fec44a86f8c/UnusedSymbolLocalInspection.java/clean/inspections/impl/com/intellij/codeInspection/unusedSymbol/UnusedSymbolLocalInspection.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
29058,
752,
1320,
5537,
1435,
288,
565,
24048,
6594,
273,
394,
24048,
12,
2704,
7145,
3744,
12,
25,
16,
404,
16,
576,
16,
576,
10019,
565,
727,
804,
19174,
1191,
273,
394,
804,
19... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
29058,
752,
1320,
5537,
1435,
288,
565,
24048,
6594,
273,
394,
24048,
12,
2704,
7145,
3744,
12,
25,
16,
404,
16,
576,
16,
576,
10019,
565,
727,
804,
19174,
1191,
273,
394,
804,
19... |
if (!(argNames != null && 0 <= argCount && argCount <= argNames.length)) { throw new IllegalArgumentException(); } if (!(this.argNames == null)) { throw new IllegalStateException(); } | public final void initScriptFunction(Context cx, Scriptable scope, int version, String functionName, String[] argNames, int argCount) { if (!(argNames != null && 0 <= argCount && argCount <= argNames.length)) { throw new IllegalArgumentException(); } if (!(this.argNames == null)) { // Initialization can only be done once throw new IllegalStateException(); } this.functionName = functionName; this.argNames = argNames; this.argCount = argCount; this.version = version; ScriptRuntime.setFunctionProtoAndParent(this, scope); } | 11366 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11366/993454366a57fd32ee051c61ff3a0658292d84f2/NativeFunction.java/clean/js/rhino/src/org/mozilla/javascript/NativeFunction.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
727,
918,
1208,
3651,
2083,
12,
1042,
9494,
16,
22780,
2146,
16,
29159,
509,
1177,
16,
514,
14117,
16,
29159,
514,
8526,
1501,
1557,
16,
509,
1501,
1380,
13,
565,
288,
3639,
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,
727,
918,
1208,
3651,
2083,
12,
1042,
9494,
16,
22780,
2146,
16,
29159,
509,
1177,
16,
514,
14117,
16,
29159,
514,
8526,
1501,
1557,
16,
509,
1501,
1380,
13,
565,
288,
3639,
309,
... | |
assertNotNull("Errors should be found.", ctx.getValidationError().getValue()); | assertErrorsFound(); | public void testStringToBytePrimitiveConverter() { ctx.bindValue(BeansObservables.observeValue(dataObject, "stringVal"), BeansObservables.observeValue(dataObject, "bytePrimitiveVal"), null); dataObject.setBytePrimitiveVal((byte) 110); assertEquals("byte value does not match", 110, dataObject.getBytePrimitiveVal(), .001); assertEquals("String value does not match", "110", dataObject.getStringVal()); assertNull("No errors should be found.", ctx.getValidationError().getValue()); dataObject.setStringVal("70"); assertEquals("byte value does not match", 70, dataObject.getBytePrimitiveVal(), .001); assertEquals("String value does not match", "70", dataObject.getStringVal()); assertNull("No errors should be found.", ctx.getValidationError().getValue()); dataObject.setStringVal(""); assertEquals("byte value does not match", 70, dataObject.getBytePrimitiveVal(), .001); assertEquals("String value does not match", "", dataObject.getStringVal()); assertNotNull("Errors should be found.", ctx.getValidationError().getValue()); dataObject.setStringVal(null); assertEquals("byte value does not match", 70, dataObject.getBytePrimitiveVal(), .001); assertNull("String value does not match", dataObject.getStringVal()); assertNotNull("Errors should be found.", ctx.getValidationError().getValue()); } | 58148 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58148/646de6c1228ca0820a97e225df84d75e3993e272/DefaultBindSupportFactoryBytePrimitiveTest.java/buggy/tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/internal/databinding/provisional/factories/DefaultBindSupportFactoryBytePrimitiveTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
23282,
3216,
9840,
5072,
1435,
288,
3639,
1103,
18,
4376,
620,
12,
14495,
26199,
1538,
18,
12199,
537,
620,
12,
892,
921,
16,
315,
1080,
3053,
6,
3631,
4823,
634,
26199,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
23282,
3216,
9840,
5072,
1435,
288,
3639,
1103,
18,
4376,
620,
12,
14495,
26199,
1538,
18,
12199,
537,
620,
12,
892,
921,
16,
315,
1080,
3053,
6,
3631,
4823,
634,
26199,
... |
for (int i = 0; i < innerEditors.length; i++) { EditorPane innerPane = new MultiEditorInnerPane(pane,innerEditors[i], page, editorArea.getActiveWorkbook()); initPane(innerPane,innerEditors[i]); } | public void openEditor(IEditorReference ref,boolean setVisible) { EditorPane pane = new EditorPane(ref, page, editorArea.getActiveWorkbook()); initPane(pane,ref); // Show the editor. editorArea.addEditor(pane); if(setVisible) setVisibleEditor(ref, true);} | 55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/149f8c383010f7bf11f451d758b371d301008311/EditorPresentation.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorPresentation.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
1884,
261,
474,
277,
273,
374,
31,
277,
411,
3443,
4666,
1383,
18,
2469,
31,
277,
27245,
288,
18451,
8485,
3443,
8485,
273,
394,
5991,
6946,
2857,
8485,
12,
29009,
16,
7872,
4666,
1383,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1071,
1884,
261,
474,
277,
273,
374,
31,
277,
411,
3443,
4666,
1383,
18,
2469,
31,
277,
27245,
288,
18451,
8485,
3443,
8485,
273,
394,
5991,
6946,
2857,
8485,
12,
29009,
16,
7872,
4666,
1383,
... | |
if (TRACE) System.out.println(this+": reading CEN..."); | if (TRACE) System.out.println(this +": reading CEN..."); | private void readCEN() throws java.io.IOException { if (TRACE) System.out.println(this+": reading CEN..."); // Find and seek to beginning of END header long endpos = this.findEND(); if (TRACE) System.out.println(this+": endpos="+endpos); // Read END header and check signature byte[] endbuf = new byte[ENDHDR]; RandomAccessFile raf = this.raf; raf.readFully(endbuf); if (get32(endbuf, 0) != ENDSIG) { throw new java.util.zip.ZipException("invalid END header signature"); } // Get position and length of central directory long cenpos = get32(endbuf, ENDOFF); if (TRACE) System.out.println(this+": cenpos="+cenpos); this.cenpos = cenpos; int cenlen = (int)get32(endbuf, ENDSIZ); if (TRACE) System.out.println(this+": cenlen="+cenlen); if (cenpos + cenlen != endpos) { throw new java.util.zip.ZipException("invalid END header format"); } // Get total number of entries int nent = get16(endbuf, ENDTOT); if (TRACE) System.out.println(this+": nent="+nent); if (nent * CENHDR > cenlen) { throw new java.util.zip.ZipException("invalid END header format"); } // Check number of drives if (get16(endbuf, ENDSUB) != nent) { throw new java.util.zip.ZipException("cannot have more than one drive"); } // Seek to first CEN record and read central directory raf.seek(cenpos); byte cenbuf[] = new byte[cenlen]; raf.readFully(cenbuf); // Scan entries in central directory and build lookup table. Hashtable entries = new Hashtable(nent); this.entries = entries; for (int off = 0; off < cenlen; ) { // Check CEN header signature if (get32(cenbuf, off) != CENSIG) { throw new java.util.zip.ZipException("invalid CEN header signature"); } ZipEntry e = new ZipEntry(); int entrysize = e.load(cenbuf, off, cenpos, cenlen); off += entrysize; if (TRACE) System.out.println(this+": entrysize="+entrysize+" offset="+off); // Add entry to the hash table of entries String name = e.getName(); entries.put(name, e); } if (false) { // zip files can have duplicate entries, so we disable this check. // Make sure we got the right number of entries if (entries.size() != nent) { throw new java.util.zip.ZipException("invalid CEN header format"); } } } | 3029 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3029/4d3be2211163f6df580acdb2762671e5adc18ecf/ZipFile.java/clean/joeq_native/joeq/ClassLib/Common/java/util/zip/ZipFile.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
855,
39,
1157,
1435,
1216,
2252,
18,
1594,
18,
14106,
288,
3639,
309,
261,
23827,
13,
2332,
18,
659,
18,
8222,
12,
2211,
397,
6877,
6453,
385,
1157,
7070,
1769,
3639,
368,
41... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
855,
39,
1157,
1435,
1216,
2252,
18,
1594,
18,
14106,
288,
3639,
309,
261,
23827,
13,
2332,
18,
659,
18,
8222,
12,
2211,
397,
6877,
6453,
385,
1157,
7070,
1769,
3639,
368,
41... |
tiFileSaveAs.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { saveFileAs(); }}); | tiFileSave.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { saveFile(); }}); | tiFileSaveAs.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { saveFileAs(); }}); | 9547 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/9547/4d59c127063ed31604a2153182c105bfb904cd30/Spoon.java/buggy/src/be/ibridge/kettle/spoon/Spoon.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
11374,
812,
4755,
1463,
18,
1289,
6233,
2223,
12,
2704,
12977,
4216,
1435,
288,
1071,
918,
3604,
7416,
12,
6233,
1133,
425,
13,
288,
1923,
812,
1463,
5621,
10523,
1769,
2,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
11374,
812,
4755,
1463,
18,
1289,
6233,
2223,
12,
2704,
12977,
4216,
1435,
288,
1071,
918,
3604,
7416,
12,
6233,
1133,
425,
13,
288,
1923,
812,
1463,
5621,
10523,
1769,
2,
-100,
-100,
-10... |
throws IOException, BioException { if(indexFile.exists()) { FileInputStream fis = new FileInputStream( indexFile ); try { ObjectInputStream p = new ObjectInputStream(fis); IndexedSequenceDB isd = (IndexedSequenceDB) p.readObject(); fis.close(); return isd; } catch (ClassNotFoundException cnfe) { throw new BioException(cnfe, "Couldn't load index file: " + indexFile); } } else { throw new BioException( "Couldn't open index as it doesn't exist: " + indexFile ); | throws IOException, BioException { if(indexFile.exists()) { FileInputStream fis = new FileInputStream( indexFile ); try { ObjectInputStream p = new ObjectInputStream(fis); IndexedSequenceDB isd = (IndexedSequenceDB) p.readObject(); fis.close(); return isd; } catch (ClassNotFoundException cnfe) { throw new BioException(cnfe, "Couldn't load index file: " + indexFile); } } else { throw new BioException( "Couldn't open index as it doesn't exist: " + indexFile ); } | public static IndexedSequenceDB openDB(File indexFile) throws IOException, BioException { if(indexFile.exists()) { FileInputStream fis = new FileInputStream( indexFile ); try { ObjectInputStream p = new ObjectInputStream(fis); IndexedSequenceDB isd = (IndexedSequenceDB) p.readObject(); fis.close(); return isd; } catch (ClassNotFoundException cnfe) { throw new BioException(cnfe, "Couldn't load index file: " + indexFile); } } else { throw new BioException( "Couldn't open index as it doesn't exist: " + indexFile ); } } | 50115 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50115/1a39a9c6b34759f60fb7df41f2afda5b7e780c21/IndexedSequenceDB.java/clean/src/org/biojava/bio/seq/db/IndexedSequenceDB.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
22524,
4021,
2290,
1696,
2290,
12,
812,
770,
812,
13,
225,
1216,
1860,
16,
21209,
503,
288,
565,
309,
12,
1615,
812,
18,
1808,
10756,
288,
1377,
11907,
15324,
273,
394,
11907,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
22524,
4021,
2290,
1696,
2290,
12,
812,
770,
812,
13,
225,
1216,
1860,
16,
21209,
503,
288,
565,
309,
12,
1615,
812,
18,
1808,
10756,
288,
1377,
11907,
15324,
273,
394,
11907,
... |
private GroupInfo traverseGroupDecl( Element groupDecl ) throws Exception { // General Attribute Checking int scope = isTopLevel(groupDecl)? GeneralAttrCheck.ELE_CONTEXT_GLOBAL: GeneralAttrCheck.ELE_CONTEXT_LOCAL; Hashtable attrValues = fGeneralAttrCheck.checkAttributes(groupDecl, scope); String groupName = groupDecl.getAttribute(SchemaSymbols.ATT_NAME); String ref = groupDecl.getAttribute(SchemaSymbols.ATT_REF); GroupInfo gInfo = null; Element child = checkContent( groupDecl, XUtil.getFirstChildElement(groupDecl), true ); if (!ref.equals("")) { if (isTopLevel(groupDecl)) // REVISIT: localize reportGenericSchemaError ( "A group with \"ref\" present must not have <schema> or <redefine> as its parent"); if (!groupName.equals("")) // REVISIT: localize reportGenericSchemaError ( "group " + groupName + " cannot refer to another group, but it refers to " + ref); // there should be no children for <group ref="..."> if (XUtil.getFirstChildElement(groupDecl)!=null) reportGenericSchemaError ( "A group with \"ref\" present must not have children"); String prefix = ""; String localpart = ref; int colonptr = ref.indexOf(":"); if ( colonptr > 0) { prefix = ref.substring(0,colonptr); localpart = ref.substring(colonptr+1); } int localpartIndex = fStringPool.addSymbol(localpart); String uriStr = resolvePrefixToURI(prefix); if (!uriStr.equals(fTargetNSURIString)) { gInfo = traverseGroupDeclFromAnotherSchema(localpart, uriStr); if (DEBUG_NEW_GROUP) findAndCreateElements(gInfo.contentSpecIndex,gInfo.scope); return gInfo; } try { gInfo = (GroupInfo) fGroupNameRegistry.get(uriStr + "," + localpart); if (gInfo != null) { // Ensure any LEAF elements are created at the // scope of the referencing type if (DEBUG_NEW_GROUP) findAndCreateElements(gInfo.contentSpecIndex,gInfo.scope); return gInfo; } } catch (ClassCastException c) { } // Check if we are in the middle of traversing this group (i.e. circular references) if (fCurrentGroupNameStack.search((Object)localpart) > - 1) { reportGenericSchemaError("mg-props-correct: Circular definition for group " + localpart); return null; } int contentSpecIndex = -1; Element referredGroup = getTopLevelComponentByName(SchemaSymbols.ELT_GROUP,localpart); if (referredGroup == null) { // REVISIT: Localize reportGenericSchemaError("Group " + localpart + " not found in the Schema"); //REVISIT, this should be some custom Exception //throw new RuntimeException("Group " + localpart + " not found in the Schema"); } else { gInfo = traverseGroupDecl(referredGroup); } // Now that we have a tree, ensure any LEAF elements are created at the // scope of the referencing type if (gInfo != null) { if (DEBUG_NEW_GROUP) findAndCreateElements(gInfo.contentSpecIndex,gInfo.scope); } return gInfo; } else if (groupName.equals("")) // REVISIT: Localize reportGenericSchemaError("a <group> must have a name or a ref present"); String qualifiedGroupName = fTargetNSURIString + "," + groupName; try { gInfo = (GroupInfo) fGroupNameRegistry.get(qualifiedGroupName); if (gInfo != null) { // Ensure any LEAF elements are created at the // scope of the referencing type if (DEBUG_NEW_GROUP) findAndCreateElements(gInfo.contentSpecIndex,gInfo.scope); return gInfo; } } catch (ClassCastException c) { } // if we're here then we're traversing a top-level group that we've never seen before. // Push the group name onto a stack, so that we can check for circular groups fCurrentGroupNameStack.push(groupName); // Save the scope and set the current scope to -1 int savedScope = fCurrentScope; if (DEBUG_NEW_GROUP) fCurrentScope = fScopeCount++; else fCurrentScope = -1; int index = -2; boolean illegalChild = false; String childName = (child != null) ? child.getLocalName() : ""; if (childName.equals(SchemaSymbols.ELT_ALL)) { index = traverseAll(child); } else if (childName.equals(SchemaSymbols.ELT_CHOICE)) { index = traverseChoice(child); } else if (childName.equals(SchemaSymbols.ELT_SEQUENCE)) { index = traverseSequence(child); } else if (!childName.equals("") || (child != null && XUtil.getNextSiblingElement(child) != null)) { illegalChild = true; reportSchemaError(SchemaMessageProvider.GroupContentRestricted, new Object [] { "group", childName }); } //Must have all or choice or sequence child. if (child == null) { reportGenericSchemaError("Named group must contain an 'all', 'choice' or 'sequence' child"); } else if (XUtil.getNextSiblingElement(child) != null) { illegalChild = true; reportSchemaError(SchemaMessageProvider.GroupContentRestricted, new Object [] { "group", childName }); } if ( ! illegalChild && child != null) { index = handleOccurrences(index, child, CHILD_OF_GROUP); } gInfo = new GroupInfo(); gInfo.contentSpecIndex = index; gInfo.scope = fCurrentScope; fCurrentScope = savedScope; fCurrentGroupNameStack.pop(); fGroupNameRegistry.put(qualifiedGroupName, gInfo); return gInfo; } | 6373 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6373/da45b42b94081019264a2fd9051fc5b04fc15d44/TraverseSchema.java/buggy/src/org/apache/xerces/validators/schema/TraverseSchema.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
3756,
966,
10080,
1114,
3456,
12,
3010,
1041,
3456,
262,
1216,
1185,
288,
3639,
368,
9544,
3601,
24471,
3639,
509,
2146,
273,
353,
27046,
12,
1655,
3456,
9945,
10792,
9544,
3843,
1564... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3756,
966,
10080,
1114,
3456,
12,
3010,
1041,
3456,
262,
1216,
1185,
288,
3639,
368,
9544,
3601,
24471,
3639,
509,
2146,
273,
353,
27046,
12,
1655,
3456,
9945,
10792,
9544,
3843,
1564... | ||
return this.numTilesAssigned; | return this.numTilesAssigned; | public int getNumTiles() { return this.numTilesAssigned; } | 47772 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47772/31aff989277324400ed1080dc1f4597a89d20d2b/StaticStreamGraph.java/buggy/streams/src/at/dms/kjc/spacedynamic/StaticStreamGraph.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
509,
11187,
27669,
1435,
288,
202,
2463,
333,
18,
2107,
27669,
20363,
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... | [
1,
1,
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,
377,
1071,
509,
11187,
27669,
1435,
288,
202,
2463,
333,
18,
2107,
27669,
20363,
31,
565,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
case 14: { String s = yytext(); w.write(s); if(debug) log("Matched #name: "+s); } case 59: break; case 5: { String s = yytext(); w.write(s); if(debug) log("Matched function end: "+s); } case 60: break; | public Yytoken yylex() throws java.io.IOException { int zzInput; int zzAction; // cached fields: int zzCurrentPosL; int zzMarkedPosL; int zzEndReadL = zzEndRead; char [] zzBufferL = zzBuffer; char [] zzCMapL = ZZ_CMAP; int [] zzTransL = ZZ_TRANS; int [] zzRowMapL = ZZ_ROWMAP; int [] zzAttrL = ZZ_ATTRIBUTE; while (true) { zzMarkedPosL = zzMarkedPos; zzAction = -1; zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; zzState = zzLexicalState; zzForAction: { while (true) { if (zzCurrentPosL < zzEndReadL) zzInput = zzBufferL[zzCurrentPosL++]; else if (zzAtEOF) { zzInput = YYEOF; break zzForAction; } else { // store back cached positions zzCurrentPos = zzCurrentPosL; zzMarkedPos = zzMarkedPosL; boolean eof = zzRefill(); // get translated positions and possibly new buffer zzCurrentPosL = zzCurrentPos; zzMarkedPosL = zzMarkedPos; zzBufferL = zzBuffer; zzEndReadL = zzEndRead; if (eof) { zzInput = YYEOF; break zzForAction; } else { zzInput = zzBufferL[zzCurrentPosL++]; } } int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; if (zzNext == -1) break zzForAction; zzState = zzNext; int zzAttributes = zzAttrL[zzState]; if ( (zzAttributes & 1) == 1 ) { zzAction = zzState; zzMarkedPosL = zzCurrentPosL; if ( (zzAttributes & 8) == 8 ) break zzForAction; } } } // store back cached position zzMarkedPos = zzMarkedPosL; switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { case 18: { String s = yytext(); w.write(s); if(debug) log("Matched unicode: "+s); } case 31: break; case 8: { String s = yytext(); w.write(s); if(debug) log("Matched close braces: "+s); } case 32: break; case 21: { String s = yytext(); w.write(s); if(debug) log("Matched HTML comment: "+s); } case 33: break; case 15: { String s = yytext(); w.write(s); if(debug) log("Matched ~=: "+s); } case 34: break; case 12: { String s = yytext(); if(debug) log("Matched string: "+s); if(paranoidStringCheck && s.indexOf(':') != -1) { w.write("/* Deleted disallowed string */"); log("Deleted disallowed string: "+s); } else { w.write(s); } } case 35: break; case 24: { String s = yytext(); w.write(s); if(debug) log("Matched @page: "+s); } case 36: break; case 13: { String s = yytext(); w.write(s); if(debug) log("Matched number: "+s); } case 37: break; case 1: { String s = yytext(); char c = s.charAt(0); log("Matched anything: "+yytext()+" - ignoring"); w.write("/* ignored unmatched char: "+c+" */"); // single char cannot break out of comment } case 38: break; case 6: { String s = yytext(); w.write(s); if(debug) log("Matched semicolon: "+s); } case 39: break; case 19: { String s = yytext(); if(debug) log("Got hexcolor: "+s); w.write(s); } case 40: break; case 7: { String s = yytext(); w.write(s); if(debug) log("Matched open braces: "+s); } case 41: break; case 26: { String s = yytext(); s = s.substring("@media".length()).trim(); w.write("@media "+s+" "); if(debug) log("Matched @media: "+s); } case 42: break; case 2: { String s = yytext(); w.write(s); if(debug) log("Matched ident: "+s); } case 43: break; case 23: { String s = yytext(); w.write(s); if(debug) log("Matched unicode range: "+s); } case 44: break; case 28: { String s = yytext(); w.write(s); if(debug) log("Matched @font-face: "+s); } case 45: break; case 9: { String s = yytext(); if(s.startsWith("url")) throwError("Invalid contents of url()"); w.write(s); if(debug) log("Matched function start: "+s); } case 46: break; case 17: { String s = yytext(); w.write(s); if(debug) log("Matched HTML comment: "+s); } case 47: break; case 3: { String s = yytext(); w.write(s); if(debug) log("Matched whitespace: "+s); } case 48: break; case 22: { String s = yytext(); if(debug) log("Ignoring unrecognizable url: "+s); w.write("/* Ignoring unmatchable URL */url()"); } case 49: break; case 27: { String s = yytext(); if(debug) log("Found @import: "+s); s = s.substring("@import".length()); s = s.trim(); DecodedStringThingy dst = new DecodedStringThingy(s); s = dst.data; if(debug) log("URL: "+s); s = processImportURL(s); dst.data = s; if(debug) log("Processed URL: "+s); if(dst.quote == ' ') dst.quote = '\"'; if (!(s == null || s.equals(""))) { if(debug) log("URL now: "+s); s = "@import "+dst.toString(); if(debug) log("Writing: "+s); w.write(s); } else if(debug) log("Dropped @import"); } case 50: break; case 29: { String s = yytext(); w.write(s); if(debug) log("Matched important: "+s); } case 51: break; case 20: { String s = yytext(); StringBuffer sb = new StringBuffer(s.length()); sb.append("/* "); boolean inPrefix = true; for(int i=2;i<s.length()-2;i++) { char c = s.charAt(i); if(inPrefix && Character.isWhitespace(c)) { continue; } inPrefix = false; if(Character.isDigit(c) || Character.isWhitespace(c) || Character.isLetter(c) || c == '.' || c == '_' || c == '-') { // No @, no !, etc; IE has been known to do things with comments // in CSS, and other browsers may too sb.append(c); } } while(Character.isWhitespace(sb.charAt(sb.length()-1))) sb.deleteCharAt(sb.length()-1); sb.append(" */"); w.write(sb.toString()); if(debug) log("Matched comment: "+s+" -> "+sb.toString()); } case 52: break; case 25: { // This is horrible. However it seems that there is no other way to do it with either jflex or CUP, as {URL} cannot be an unambiguous token :( String s = yytext(); if(debug) log("Recognized URL: "+s); DecodedStringThingy dst = new DecodedStringThingy(s); if(!dst.url) { throw new IllegalStateException("parsing url().. isn't a url()"); } if(dst.suffix.length() > 0) { yypushback(dst.suffix.length()); dst.suffix = ""; } s = dst.data; if(debug) log("URL now: "+s); s = processURL(s); dst.data = s; if(s == null || s.equals("")) { if(debug) log("URL invalid"); w.write("url()"); } else { s = dst.toString(); if(debug) log("Writing: "+s); w.write(s); } } case 53: break; case 11: { String s = yytext(); w.write(s); if(debug) log("Matched measurement: "+s); } case 54: break; case 16: { String s = yytext(); w.write(s); if(debug) log("Matched |=: "+s); } case 55: break; case 30: { String s = yytext(); detectedCharset = s; if(debug) log("Matched and ignoring charset: "+s); // Ignore } case 56: break; case 10: { if(postBadImportFlag) { // Ignore postBadImportFlag = false; if(debug) log("Ignoring mediums list because after bad import: "+ yytext()); } else { String s = yytext(); w.write(s); if(debug) log("Matched and passing on mediums list: "+s); } } case 57: break; case 4: { String s = yytext(); w.write(s); if(debug) log("Matched single char: "+s); } case 58: break; case 14: { String s = yytext(); w.write(s); if(debug) log("Matched #name: "+s); } case 59: break; case 5: { String s = yytext(); w.write(s); if(debug) log("Matched function end: "+s); } case 60: break; default: if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { zzAtEOF = true; return null; } else { zzScanError(ZZ_NO_MATCH); } } } } | 45341 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45341/e8996198a75deffbf4dc9e1ed08d3120115f4fa9/CSSTokenizerFilter.java/clean/src/freenet/clients/http/filter/CSSTokenizerFilter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
1624,
93,
2316,
677,
1362,
92,
1435,
1216,
2252,
18,
1594,
18,
14106,
288,
565,
509,
11273,
1210,
31,
565,
509,
11273,
1803,
31,
565,
368,
3472,
1466,
30,
565,
509,
11273,
3935,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1624,
93,
2316,
677,
1362,
92,
1435,
1216,
2252,
18,
1594,
18,
14106,
288,
565,
509,
11273,
1210,
31,
565,
509,
11273,
1803,
31,
565,
368,
3472,
1466,
30,
565,
509,
11273,
3935,
1... | |
assertTrue("Failed replace", hw1.replace('l', 'z').equals("HezzoWorzd")); | assertEquals("Failed replace", "HezzoWorzd", hw1.replace('l', 'z')); | public void test_replaceCC() { // Test for method java.lang.String java.lang.String.replace(char, char) assertTrue("Failed replace", hw1.replace('l', 'z').equals("HezzoWorzd")); } | 54769 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54769/181e940cd92dfff67639d98e991206d375a987ea/StringTest.java/buggy/modules/luni/src/test/java/tests/api/java/lang/StringTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1842,
67,
2079,
6743,
1435,
288,
202,
202,
759,
7766,
364,
707,
2252,
18,
4936,
18,
780,
2252,
18,
4936,
18,
780,
18,
2079,
12,
3001,
16,
1149,
13,
202,
202,
11231,
551... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
2079,
6743,
1435,
288,
202,
202,
759,
7766,
364,
707,
2252,
18,
4936,
18,
780,
2252,
18,
4936,
18,
780,
18,
2079,
12,
3001,
16,
1149,
13,
202,
202,
11231,
551... |
_t = __t1604; | _t = __t1605; | public final void array_subscript(AST _t) throws RecognitionException { AST array_subscript_AST_in = (_t == ASTNULL) ? null : (AST)_t; AST __t1604 = _t; AST tmp659_AST_in = (AST)_t; match(_t,Array_subscript); _t = _t.getFirstChild(); AST tmp660_AST_in = (AST)_t; match(_t,LEFTBRACE); _t = _t.getNextSibling(); expression(_t); _t = _retTree; { if (_t==null) _t=ASTNULL; switch ( _t.getType()) { case FOR: { AST tmp661_AST_in = (AST)_t; match(_t,FOR); _t = _t.getNextSibling(); expression(_t); _t = _retTree; break; } case RIGHTBRACE: { break; } default: { throw new NoViableAltException(_t); } } } AST tmp662_AST_in = (AST)_t; match(_t,RIGHTBRACE); _t = _t.getNextSibling(); _t = __t1604; _t = _t.getNextSibling(); _retTree = _t; } | 13952 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13952/865876f0e6319c071fef156818ff116c276cfdff/TreeParser01.java/buggy/trunk/org.prorefactor.core/src/org/prorefactor/treeparser01/TreeParser01.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
727,
918,
526,
67,
1717,
4263,
12,
9053,
389,
88,
13,
1216,
9539,
288,
9506,
202,
9053,
526,
67,
1717,
4263,
67,
9053,
67,
267,
273,
261,
67,
88,
422,
9183,
8560,
13,
692,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
526,
67,
1717,
4263,
12,
9053,
389,
88,
13,
1216,
9539,
288,
9506,
202,
9053,
526,
67,
1717,
4263,
67,
9053,
67,
267,
273,
261,
67,
88,
422,
9183,
8560,
13,
692,
... |
case Id_setDate: return wrap_double(realThis(thisObj, f, false). jsFunction_setDate(args)); | case Id_setDate: return wrap_double(realThis(thisObj, f, false). jsFunction_setDate(args)); | public Object execMethod (int methodId, IdFunction f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) throws JavaScriptException { switch (methodId) { case ConstructorId_UTC: return wrap_double (jsStaticFunction_UTC(args)); case ConstructorId_parse: return wrap_double (jsStaticFunction_parse(ScriptRuntime.toString(args, 0))); case Id_constructor: return jsConstructor(args, thisObj == null); case Id_toString: return realThis(thisObj, f, true). jsFunction_toString(); case Id_toTimeString: return realThis(thisObj, f, true). jsFunction_toTimeString(); case Id_toDateString: return realThis(thisObj, f, true). jsFunction_toDateString(); case Id_toLocaleString: return realThis(thisObj, f, true). jsFunction_toLocaleString(); case Id_toLocaleTimeString: return realThis(thisObj, f, true). jsFunction_toLocaleTimeString(); case Id_toLocaleDateString: return realThis(thisObj, f, true). jsFunction_toLocaleDateString(); case Id_toGMTString: case Id_toUTCString: return realThis(thisObj, f, true). jsFunction_toUTCString(); case Id_valueOf: return wrap_double(realThis(thisObj, f, true). jsFunction_valueOf()); case Id_getTime: return wrap_double(realThis(thisObj, f, true). jsFunction_getTime()); case Id_getYear: return wrap_double(realThis(thisObj, f, true). jsFunction_getYear(cx)); case Id_getFullYear: return wrap_double(realThis(thisObj, f, true). jsFunction_getFullYear()); case Id_getUTCFullYear: return wrap_double(realThis(thisObj, f, true). jsFunction_getUTCFullYear()); case Id_getMonth: return wrap_double(realThis(thisObj, f, true). jsFunction_getMonth()); case Id_getUTCMonth: return wrap_double(realThis(thisObj, f, true). jsFunction_getUTCMonth()); case Id_getDate: return wrap_double(realThis(thisObj, f, true). jsFunction_getDate()); case Id_getUTCDate: return wrap_double(realThis(thisObj, f, true). jsFunction_getUTCDate()); case Id_getDay: return wrap_double(realThis(thisObj, f, true). jsFunction_getDay()); case Id_getUTCDay: return wrap_double(realThis(thisObj, f, true). jsFunction_getUTCDay()); case Id_getHours: return wrap_double(realThis(thisObj, f, true). jsFunction_getHours()); case Id_getUTCHours: return wrap_double(realThis(thisObj, f, true). jsFunction_getUTCHours()); case Id_getMinutes: return wrap_double(realThis(thisObj, f, true). jsFunction_getMinutes()); case Id_getUTCMinutes: return wrap_double(realThis(thisObj, f, true). jsFunction_getUTCMinutes()); case Id_getSeconds: return wrap_double(realThis(thisObj, f, true). jsFunction_getSeconds()); case Id_getUTCSeconds: return wrap_double(realThis(thisObj, f, true). jsFunction_getUTCSeconds()); case Id_getMilliseconds: return wrap_double(realThis(thisObj, f, true). jsFunction_getMilliseconds()); case Id_getUTCMilliseconds: return wrap_double(realThis(thisObj, f, true). jsFunction_getUTCMilliseconds()); case Id_getTimezoneOffset: return wrap_double(realThis(thisObj, f, true). jsFunction_getTimezoneOffset()); case Id_setTime: return wrap_double(realThis(thisObj, f, true). jsFunction_setTime(ScriptRuntime.toNumber(args, 0))); case Id_setMilliseconds: return wrap_double(realThis(thisObj, f, false). jsFunction_setMilliseconds(args)); case Id_setUTCMilliseconds: return wrap_double(realThis(thisObj, f, false). jsFunction_setUTCMilliseconds(args)); case Id_setSeconds: return wrap_double(realThis(thisObj, f, false). jsFunction_setSeconds(args)); case Id_setUTCSeconds: return wrap_double(realThis(thisObj, f, false). jsFunction_setUTCSeconds(args)); case Id_setMinutes: return wrap_double(realThis(thisObj, f, false). jsFunction_setMinutes(args)); case Id_setUTCMinutes: return wrap_double(realThis(thisObj, f, false). jsFunction_setUTCMinutes(args)); case Id_setHours: return wrap_double(realThis(thisObj, f, false). jsFunction_setHours(args)); case Id_setUTCHours: return wrap_double(realThis(thisObj, f, false). jsFunction_setUTCHours(args)); case Id_setDate: return wrap_double(realThis(thisObj, f, false). jsFunction_setDate(args)); case Id_setUTCDate: return wrap_double(realThis(thisObj, f, false). jsFunction_setUTCDate(args)); case Id_setMonth: return wrap_double(realThis(thisObj, f, false). jsFunction_setMonth(args)); case Id_setUTCMonth: return wrap_double(realThis(thisObj, f, false). jsFunction_setUTCMonth(args)); case Id_setFullYear: return wrap_double(realThis(thisObj, f, false). jsFunction_setFullYear(args)); case Id_setUTCFullYear: return wrap_double(realThis(thisObj, f, false). jsFunction_setUTCFullYear(args)); case Id_setYear: return wrap_double(realThis(thisObj, f, true). jsFunction_setYear(ScriptRuntime.toNumber(args, 0))); } return super.execMethod(methodId, f, cx, scope, thisObj, args); } | 12564 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12564/3db7f50283cb2dd0859494c7e36c278004f2f6a8/NativeDate.java/buggy/src/org/mozilla/javascript/NativeDate.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1033,
1196,
1305,
3639,
261,
474,
707,
548,
16,
3124,
2083,
284,
16,
540,
1772,
9494,
16,
22780,
2146,
16,
22780,
15261,
16,
1033,
8526,
833,
13,
3639,
1216,
11905,
503,
565,
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,
1071,
1033,
1196,
1305,
3639,
261,
474,
707,
548,
16,
3124,
2083,
284,
16,
540,
1772,
9494,
16,
22780,
2146,
16,
22780,
15261,
16,
1033,
8526,
833,
13,
3639,
1216,
11905,
503,
565,
288,
... |
|| "ColoumnInfo".equalsIgnoreCase( type ) ) | || "ColoumnInfo".equalsIgnoreCase( type ) ) | protected ReportId[] parseReportId( ArrayList activeIds ) throws RemoteException { if ( activeIds == null || activeIds.size( ) <= 0 ) { return null; } java.util.Vector ids = new java.util.Vector( ); for ( int i = 0; i < activeIds.size( ); i++ ) { String id = (String) activeIds.get( i ); int firstComma = id.indexOf( ',' ); if ( id == null || firstComma == -1 ) { AxisFault fault = new AxisFault( ); fault.setFaultCode( new QName( "DocumentProcessor.parseReportId( )" ) ); //$NON-NLS-1$ fault.setFaultString( BirtResources.getMessage( ResourceConstants.ACTION_EXCEPTION_INVALID_ID_FORMAT, new String[]{id} ) ); throw fault; } int secondComma = id.indexOf( ',', firstComma + 1 ); if ( secondComma == -1 ) { secondComma = id.length( ); } String type = id.substring( firstComma + 1, secondComma ); if ( ReportIdType._Document.equalsIgnoreCase( type ) || ReportIdType._Table.equalsIgnoreCase( type ) || ReportIdType._Chart.equalsIgnoreCase( type ) || ReportIdType._Extended.equalsIgnoreCase( type ) || ReportIdType._Label.equalsIgnoreCase( type ) || ReportIdType._Group.equalsIgnoreCase( type ) || "ColoumnInfo".equalsIgnoreCase( type ) ) // TODO: emitter need to fix its name. { ReportId reportId = new ReportId( ); reportId.setId( id.substring( 0, id.indexOf( ',' ) ) ); if ( ReportIdType._Document.equalsIgnoreCase( type ) ) { reportId.setType( ReportIdType.Document ); } else if ( ReportIdType._Table.equalsIgnoreCase( type ) ) { reportId.setType( ReportIdType.Table ); } else if ( ReportIdType._Chart.equalsIgnoreCase( type ) || ReportIdType._Extended.equalsIgnoreCase( type ) ) { reportId.setType( ReportIdType.Chart ); } else if ( ReportIdType._Label.equalsIgnoreCase( type ) ) { reportId.setType( ReportIdType.Label ); } else if ( ReportIdType._Group.equalsIgnoreCase( type ) ) { reportId.setType( ReportIdType.Group ); } else if ( "ColoumnInfo".equalsIgnoreCase( type ) ) { reportId.setType( ReportIdType.ColumnInfo ); } try { reportId.setRptElementId( new Long( Long.parseLong( id .substring( secondComma + 1 ) ) ) ); } catch ( Exception e ) { reportId.setRptElementId( null ); } ids.add( reportId ); } } ReportId[] reportIds = new ReportId[ids.size( )]; for ( int i = 0; i < ids.size( ); i++ ) { reportIds[i] = (ReportId) ids.get( i ); } return reportIds; } | 12803 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12803/ef88ebb73afe5cc4540d743ddd181952658bcf20/AbstractBaseActionHandler.java/clean/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/service/actionhandler/AbstractBaseActionHandler.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
8706,
548,
8526,
1109,
4820,
548,
12,
2407,
2695,
2673,
262,
1082,
202,
15069,
18361,
202,
95,
202,
202,
430,
261,
2695,
2673,
422,
446,
747,
2695,
2673,
18,
1467,
12,
262,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8706,
548,
8526,
1109,
4820,
548,
12,
2407,
2695,
2673,
262,
1082,
202,
15069,
18361,
202,
95,
202,
202,
430,
261,
2695,
2673,
422,
446,
747,
2695,
2673,
18,
1467,
12,
262,
1... |
if (test) continue; | if (matchType == TEST) continue; | Object executeRegExp(Scriptable scopeObj, String str, int indexp[], boolean test) { NativeRegExp re = this; Context cx = Context.getCurrentContext(); RegExpImpl res = getImpl(cx); /* * Initialize a CompilerState to minimize recursive argument traffic. */ MatchState state = new MatchState(); state.anchoring = false; state.flags = re.flags; state.scope = scopeObj; char[] charArray = str.toCharArray(); int start = indexp[0]; if (start > charArray.length) start = charArray.length; int index = start; state.cpbegin = 0; state.cpend = charArray.length; state.start = start; state.skipped = 0; state.input = charArray; state.parenCount = 0; state.maybeParens = new SubString[re.parenCount]; state.parens = new SubString[re.parenCount]; // We allocate the elements of "parens" and "maybeParens" lazily in // the Java port since we don't have arenas. /* * Call the recursive matcher to do the real work. Return null on mismatch * whether testing or not. On match, return an extended Array object. */ index = matchRegExp(state, ren, index); if (index == -1) { return null; } int i = index - state.cpbegin; indexp[0] = i; int matchlen = i - (start + state.skipped); int ep = index; index -= matchlen; Object result; Scriptable obj; if (test) { /* * Testing for a match and updating cx.regExpImpl: don't allocate * an array object, do return true. */ result = Boolean.TRUE; obj = null; } else { /* * The array returned on match has element 0 bound to the matched * string, elements 1 through state.parenCount bound to the paren * matches, an index property telling the length of the left context, * and an input property referring to the input string. */ Scriptable scope = getTopLevelScope(scopeObj); result = ScriptRuntime.newObject(cx, scope, "Array", null); obj = (Scriptable) result; String matchstr = new String(charArray, index, matchlen); obj.put(0, obj, matchstr); } if (state.parenCount > re.parenCount) throw new RuntimeException(); if (state.parenCount == 0) { res.parens.setSize(0); res.lastParen = SubString.emptySubString; } else { SubString parsub = null; int num; res.parens.setSize(state.parenCount); for (num = 0; num < state.parenCount; num++) { parsub = state.parens[num]; res.parens.setElementAt(parsub, num); if (test) continue; String parstr = parsub == null ? "": parsub.toString(); obj.put(num+1, obj, parstr); } res.lastParen = parsub; } if (!test) { /* * Define the index and input properties last for better for/in loop * order (so they come after the elements). */ obj.put("index", obj, new Integer(start + state.skipped)); obj.put("input", obj, str); } if (res.lastMatch == null) { res.lastMatch = new SubString(); res.leftContext = new SubString(); res.rightContext = new SubString(); } res.lastMatch.charArray = charArray; res.lastMatch.index = index; res.lastMatch.length = matchlen; res.leftContext.charArray = charArray; if (cx.getLanguageVersion() == Context.VERSION_1_2) { /* * JS1.2 emulated Perl4.0.1.8 (patch level 36) for global regexps used * in scalar contexts, and unintentionally for the string.match "list" * psuedo-context. On "hi there bye", the following would result: * * Language while(/ /g){print("$`");} s/ /$`/g * perl4.036 "hi", "there" "hihitherehi therebye" * perl5 "hi", "hi there" "hihitherehi therebye" * js1.2 "hi", "there" "hihitheretherebye" * * Insofar as JS1.2 always defined $` as "left context from the last * match" for global regexps, it was more consistent than perl4. */ res.leftContext.index = start; res.leftContext.length = state.skipped; } else { /* * For JS1.3 and ECMAv2, emulate Perl5 exactly: * * js1.3 "hi", "hi there" "hihitherehi therebye" */ res.leftContext.index = 0; res.leftContext.length = start + state.skipped; } res.rightContext.charArray = charArray; res.rightContext.index = ep; res.rightContext.length = state.cpend - ep; return result; } | 51996 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51996/4aee7d25d756bce350cfec71216aff6e8c8bbc4b/NativeRegExp.java/clean/js/rhino/org/mozilla/javascript/regexp/NativeRegExp.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1033,
1836,
13673,
12,
3651,
429,
2146,
2675,
16,
514,
609,
16,
509,
770,
84,
63,
6487,
12900,
1250,
1842,
13,
288,
3639,
16717,
13673,
283,
273,
333,
31,
3639,
1772,
9494,
273,
1772,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1033,
1836,
13673,
12,
3651,
429,
2146,
2675,
16,
514,
609,
16,
509,
770,
84,
63,
6487,
12900,
1250,
1842,
13,
288,
3639,
16717,
13673,
283,
273,
333,
31,
3639,
1772,
9494,
273,
1772,
1... |
match(LITERAL_default); | { switch ( LA(1)) { case LITERAL_default: { match(LITERAL_default); break; } case LITERAL_xmlspace: { match(LITERAL_xmlspace); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } | public final void prolog() throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); org.exist.xquery.parser.XQueryAST prolog_AST = null; org.exist.xquery.parser.XQueryAST v_AST = null; org.exist.xquery.parser.XQueryAST nd_AST = null; org.exist.xquery.parser.XQueryAST dnd_AST = null; org.exist.xquery.parser.XQueryAST fd_AST = null; { boolean synPredMatched14 = false; if (((LA(1)==XQUERY))) { int _m14 = mark(); synPredMatched14 = true; inputState.guessing++; try { { match(XQUERY); match(VERSION); } } catch (RecognitionException pe) { synPredMatched14 = false; } rewind(_m14); inputState.guessing--; } if ( synPredMatched14 ) { version(); v_AST = (org.exist.xquery.parser.XQueryAST)returnAST; astFactory.addASTChild(currentAST, returnAST); match(SEMICOLON); } else if ((_tokenSet_1.member(LA(1)))) { } else { throw new NoViableAltException(LT(1), getFilename()); } } { _loop27: do { if ((LA(1)==LITERAL_declare||LA(1)==LITERAL_import)) { { boolean synPredMatched18 = false; if (((LA(1)==LITERAL_declare))) { int _m18 = mark(); synPredMatched18 = true; inputState.guessing++; try { { match(LITERAL_declare); match(LITERAL_namespace); } } catch (RecognitionException pe) { synPredMatched18 = false; } rewind(_m18); inputState.guessing--; } if ( synPredMatched18 ) { namespaceDecl(); nd_AST = (org.exist.xquery.parser.XQueryAST)returnAST; astFactory.addASTChild(currentAST, returnAST); } else { boolean synPredMatched20 = false; if (((LA(1)==LITERAL_declare))) { int _m20 = mark(); synPredMatched20 = true; inputState.guessing++; try { { match(LITERAL_declare); match(LITERAL_default); } } catch (RecognitionException pe) { synPredMatched20 = false; } rewind(_m20); inputState.guessing--; } if ( synPredMatched20 ) { defaultsDecl(); dnd_AST = (org.exist.xquery.parser.XQueryAST)returnAST; astFactory.addASTChild(currentAST, returnAST); } else { boolean synPredMatched22 = false; if (((LA(1)==LITERAL_declare))) { int _m22 = mark(); synPredMatched22 = true; inputState.guessing++; try { { match(LITERAL_declare); match(LITERAL_function); } } catch (RecognitionException pe) { synPredMatched22 = false; } rewind(_m22); inputState.guessing--; } if ( synPredMatched22 ) { functionDecl(); fd_AST = (org.exist.xquery.parser.XQueryAST)returnAST; astFactory.addASTChild(currentAST, returnAST); } else { boolean synPredMatched24 = false; if (((LA(1)==LITERAL_declare))) { int _m24 = mark(); synPredMatched24 = true; inputState.guessing++; try { { match(LITERAL_declare); match(LITERAL_variable); } } catch (RecognitionException pe) { synPredMatched24 = false; } rewind(_m24); inputState.guessing--; } if ( synPredMatched24 ) { varDecl(); astFactory.addASTChild(currentAST, returnAST); } else { boolean synPredMatched26 = false; if (((LA(1)==LITERAL_declare))) { int _m26 = mark(); synPredMatched26 = true; inputState.guessing++; try { { match(LITERAL_declare); match(LITERAL_xmlspace); } } catch (RecognitionException pe) { synPredMatched26 = false; } rewind(_m26); inputState.guessing--; } if ( synPredMatched26 ) { xmlSpaceDecl(); astFactory.addASTChild(currentAST, returnAST); } else if ((LA(1)==LITERAL_import)) { moduleImport(); astFactory.addASTChild(currentAST, returnAST); } else { throw new NoViableAltException(LT(1), getFilename()); } }}}} } match(SEMICOLON); } else { break _loop27; } } while (true); } prolog_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root; returnAST = prolog_AST; } | 2909 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2909/942d71ceffee004821cc1b2e75c2538951c04027/XQueryParser.java/clean/src/org/exist/xquery/parser/XQueryParser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
727,
918,
450,
1330,
1435,
1216,
9539,
16,
3155,
1228,
503,
288,
9506,
202,
2463,
9053,
273,
446,
31,
202,
202,
9053,
4154,
783,
9053,
273,
394,
9183,
4154,
5621,
202,
202,
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,
482,
727,
918,
450,
1330,
1435,
1216,
9539,
16,
3155,
1228,
503,
288,
9506,
202,
2463,
9053,
273,
446,
31,
202,
202,
9053,
4154,
783,
9053,
273,
394,
9183,
4154,
5621,
202,
202,
33... |
super( theName ); | public Style( String theName ) { super( theName ); } | 46013 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46013/d802c33711e0d111551ae23575895cd060f085b6/Style.java/buggy/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/elements/Style.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
9767,
12,
514,
326,
461,
262,
202,
95,
202,
202,
9565,
12,
326,
461,
11272,
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,
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,
225,
202,
482,
9767,
12,
514,
326,
461,
262,
202,
95,
202,
202,
9565,
12,
326,
461,
11272,
202,
97,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
if (jj_3R_67()) return true; | if (jj_3R_69()) return true; | final private boolean jj_3_9() { if (jj_3R_67()) return true; return false; } | 41673 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/41673/3e3034d7566b0047ef2bf5af2e29ce51f94a2d2e/JavaParser.java/buggy/pmd/src/net/sourceforge/pmd/ast/JavaParser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
727,
3238,
1250,
10684,
67,
23,
67,
29,
1435,
288,
565,
309,
261,
78,
78,
67,
23,
54,
67,
8148,
10756,
327,
638,
31,
565,
327,
629,
31,
225,
289,
2,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
727,
3238,
1250,
10684,
67,
23,
67,
29,
1435,
288,
565,
309,
261,
78,
78,
67,
23,
54,
67,
8148,
10756,
327,
638,
31,
565,
327,
629,
31,
225,
289,
2,
-100,
-100,
-100,
-100,
-100,
-1... |
public void synchNow(long delay) { | public void synchNow(long delay, List<TaskRepository> repositories) { | public void synchNow(long delay) { cancelAll(); addJobToQueue(new ScheduledTaskListSynchJob(delay, MylarTaskListPlugin.getTaskListManager())); startSynchJob(); } | 51989 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51989/c33ea39537ff682c417fd8d2035bbb93985b18b5/TaskListSynchronizationManager.java/buggy/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/TaskListSynchronizationManager.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
272,
2515,
8674,
12,
5748,
4624,
13,
288,
202,
202,
10996,
1595,
5621,
202,
202,
1289,
2278,
774,
3183,
12,
2704,
17286,
2174,
682,
55,
2515,
2278,
12,
10790,
16,
8005,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
272,
2515,
8674,
12,
5748,
4624,
13,
288,
202,
202,
10996,
1595,
5621,
202,
202,
1289,
2278,
774,
3183,
12,
2704,
17286,
2174,
682,
55,
2515,
2278,
12,
10790,
16,
8005,
7... |
linesChanged(startLine,lineCount - startLine); | public void contentRemoved(int startLine, int offset, int numLines, int length) { //{{{ Update line info and line context arrays if(numLines > 0) { lineCount -= numLines; System.arraycopy(lineInfo,startLine + numLines,lineInfo, startLine,lineCount - startLine); System.arraycopy(lineContext,startLine + numLines,lineContext, startLine,lineCount - startLine); } //}}} //{{{ Update remaining line start offsets for(int i = startLine; i < lineCount; i++) { setLineEndOffset(i,getLineEndOffset(i) - length); } //}}} // TODO: positions linesChanged(startLine,lineCount - startLine); } //}}} | 8690 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8690/ba1ec3297d11f3a466feef112603ac39ffe7a66f/OffsetManager.java/buggy/org/gjt/sp/jedit/buffer/OffsetManager.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
913,
10026,
12,
474,
24636,
16,
509,
1384,
16,
202,
202,
474,
818,
5763,
16,
509,
769,
13,
202,
95,
202,
202,
759,
12187,
95,
2315,
980,
1123,
471,
980,
819,
5352,
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,
918,
913,
10026,
12,
474,
24636,
16,
509,
1384,
16,
202,
202,
474,
818,
5763,
16,
509,
769,
13,
202,
95,
202,
202,
759,
12187,
95,
2315,
980,
1123,
471,
980,
819,
5352,
202,... | |
xsp = jj_scanpos; if (jj_3R_263()) jj_scanpos = xsp; | while (true) { xsp = jj_scanpos; if (jj_3R_257()) { jj_scanpos = xsp; break; } } | final private boolean jj_3R_213() { if (jj_3R_69()) return true; Token xsp; xsp = jj_scanpos; if (jj_3R_263()) jj_scanpos = xsp; return false; } | 45569 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45569/3e3034d7566b0047ef2bf5af2e29ce51f94a2d2e/JavaParser.java/clean/pmd/src/net/sourceforge/pmd/ast/JavaParser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
727,
3238,
1250,
10684,
67,
23,
54,
67,
22,
3437,
1435,
288,
565,
309,
261,
78,
78,
67,
23,
54,
67,
8148,
10756,
327,
638,
31,
565,
3155,
619,
1752,
31,
565,
619,
1752,
273,
10684,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
727,
3238,
1250,
10684,
67,
23,
54,
67,
22,
3437,
1435,
288,
565,
309,
261,
78,
78,
67,
23,
54,
67,
8148,
10756,
327,
638,
31,
565,
3155,
619,
1752,
31,
565,
619,
1752,
273,
10684,
... |
Dataflow<ResourceValueFrame, ResourceValueAnalysis<Resource>> dataflow, Resource resource); | Dataflow<ResourceValueFrame, ResourceValueAnalysis<Resource>> dataflow, Resource resource); | public abstract void inspectResult(JavaClass javaClass, MethodGen methodGen, CFG cfg, Dataflow<ResourceValueFrame, ResourceValueAnalysis<Resource>> dataflow, Resource resource); | 7352 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7352/4748a5a9b76f3dd763ee6bc7755c932a711bd6a6/ResourceTrackingDetector.java/clean/findbugs/src/java/edu/umd/cs/findbugs/ResourceTrackingDetector.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
8770,
918,
5334,
1253,
12,
5852,
797,
2252,
797,
16,
2985,
7642,
707,
7642,
16,
7577,
2776,
16,
202,
202,
751,
2426,
32,
1420,
620,
3219,
16,
2591,
620,
9418,
32,
1420,
9778,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8770,
918,
5334,
1253,
12,
5852,
797,
2252,
797,
16,
2985,
7642,
707,
7642,
16,
7577,
2776,
16,
202,
202,
751,
2426,
32,
1420,
620,
3219,
16,
2591,
620,
9418,
32,
1420,
9778,
... |
private void addRevision(File revision) { User user = revision.getServer().getUser(revision.getModifiedBy()); if ((user != null) && (user.getName().equals("BuildMaster"))) return; // Get the modification status before we check the current file out from StarTeam. Must do this as afterwards the status will always be CURRENT Modification mod = new Modification(); mod.type = getModificationType(revision); try { revision.checkout(Item.LockType.UNCHANGED, true, true, true); } catch (java.io.IOException ioe) { ioe.printStackTrace(); } /* Only get emails for users still on the system */ if (user != null) { /* Try to obtain email to add. This is only allowed if logged on user is SERVER ADMINISTRATOR */ try { emailAddresses.add(user.getServer().getAdministration().findUserAccount(user.getID()).getEmailAddress()); } catch (ServerException sx) { /* * Logged on user does not have permission to get user's email. Return the modifying user's name instead. * Then use the email.properties file to map the name to an email address outside of StarTeam */ emailAddresses.add(user.getName()); } } mod.fileName = revision.getName(); mod.folderName = revision.getParentFolder().getFolderHierarchy(); mod.modifiedTime = revision.getModifiedTime().createDate(); mod.userName = user.getName(); mod.comment = revision.getComment(); modifications.add(mod); log("File: " + mod.fileName); log("userName: " + mod.userName + " Date: " + mod.modifiedTime); if (revision.getModifiedTime().getLongValue() > mostRecent) { mostRecent = revision.getModifiedTime().getLongValue(); } } | 55334 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55334/ab9d64412236f79815cb681efc37ef7a49e1c298/StarTeamElement.java/buggy/main/src/net/sourceforge/cruisecontrol/StarTeamElement.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
527,
7939,
12,
812,
6350,
13,
288,
202,
202,
1299,
729,
273,
6350,
18,
588,
2081,
7675,
588,
1299,
12,
13057,
18,
588,
4575,
858,
10663,
3639,
309,
14015,
1355,
480,
446,
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,
377,
3238,
918,
527,
7939,
12,
812,
6350,
13,
288,
202,
202,
1299,
729,
273,
6350,
18,
588,
2081,
7675,
588,
1299,
12,
13057,
18,
588,
4575,
858,
10663,
3639,
309,
14015,
1355,
480,
446,
13,... | ||
handle.addDisposeListener(disposeLitener); | if (handle != null) { handle.addDisposeListener(disposeLitener); } | public ReportMediator getMediator( ModuleHandle handle ) { handle.addDisposeListener(disposeLitener); ReportMediator mediator = (ReportMediator) mediatorMap.get( handle ); if ( mediator == null ) { mediator = new ReportMediator( ); mediatorMap.put( handle, mediator ); } return mediator; } | 46013 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46013/b97243816b5e6a0657e44d3f9ed52189a65aaf65/SessionHandleAdapter.java/clean/UI/org.eclipse.birt.report.designer.core/src/org/eclipse/birt/report/designer/core/model/SessionHandleAdapter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
8706,
13265,
10620,
2108,
329,
10620,
12,
5924,
3259,
1640,
262,
202,
95,
202,
202,
4110,
18,
1289,
1669,
4150,
2223,
12,
2251,
4150,
23707,
708,
1769,
202,
202,
4820,
13265,
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,
482,
8706,
13265,
10620,
2108,
329,
10620,
12,
5924,
3259,
1640,
262,
202,
95,
202,
202,
4110,
18,
1289,
1669,
4150,
2223,
12,
2251,
4150,
23707,
708,
1769,
202,
202,
4820,
13265,
10... |
System.out.println("Several Curricular Courses with Code found " + mwEnrolment.getCoursecode() + " found for Degree " + mwEnrolment.getDegreecode()); curricularCoursesNotFound++; enrolmentNotWritten++; return; | System.out.println("[ERROR] Several Curricular Courses with Code found " + mwEnrolment.getCoursecode() + " found for Degree " + mwEnrolment.getDegreecode()); continue; | private static void writeEnrolments( List enrolments2Write, IStudentCurricularPlan studentCurricularPlan, MWAluno oldStudent, SuportePersistenteOJB sp) throws Exception { Iterator iterator = enrolments2Write.iterator(); while (iterator.hasNext()) { final MwEnrolment mwEnrolment = (MwEnrolment) iterator.next(); // Get the Degree Of the Student IDegreeCurricularPlan degreeCurricularPlan = getDegreeCurricularPlan(mwEnrolment.getDegreecode(), studentCurricularPlan, sp); if (degreeCurricularPlan == null) { System.out.println("Error ! Degree Curricular Plan Not Found !"); throw new Exception(); } // Get The Branch (This could be the student branch or the curricular course branch IBranch branch = getBranch(mwEnrolment.getDegreecode(), mwEnrolment.getBranchcode(), degreeCurricularPlan, sp); if (branch == null) { System.out.println("Error ! Branch Not Found !"); throw new Exception(); } // Get the Curricular Course List curricularCourses = sp.getIPersistentCurricularCourse().readbyCourseCodeAndDegreeCurricularPlan( StringUtils.trim(mwEnrolment.getCoursecode()), degreeCurricularPlan); ICurricularCourse curricularCourse = null; if (curricularCourses.size() != 1) { // if the result size is greater than 1 then check if the Branch Code match in Any if (curricularCourses.size() > 1) { System.out.println("Several Curricular Courses with Code found " + mwEnrolment.getCoursecode() + " found for Degree " + mwEnrolment.getDegreecode()); curricularCoursesNotFound++; enrolmentNotWritten++; return; } else { // size == 0 // Try to read by CourseCode Only (this will assume that all the Degree Curricular Plan name ends with "2003/2004" IPersistentCurricularCourse curricularCourseDAO = sp.getIPersistentCurricularCourse(); curricularCourses = curricularCourseDAO.readbyCourseCode(StringUtils.trim(mwEnrolment.getCoursecode())); if (curricularCourses.size() == 1) { curricularCourse = (ICurricularCourse) curricularCourses.get(0); } else if (curricularCourses.size() > 1) { if (hasDiferentDegrees(curricularCourses)) { curricularCourse = getCurricularCourseFromAnotherDegree(mwEnrolment, sp); if (curricularCourse == null) { return; } } else { curricularCourse = (ICurricularCourse) curricularCourses.get(0); } } else { ReportEnrolment.addCurricularCourseNotFound(mwEnrolment.getCoursecode(), mwEnrolment.getDegreecode().toString(), mwEnrolment.getNumber().toString()); return; } } } else // curricularCourses.size() == 1 { curricularCourse = (ICurricularCourse) curricularCourses.get(0); } // Get the Curricular Course Scope ICurricularCourseScope curricularCourseScope = getCurricularCourseScopeToEnrollIn(studentCurricularPlan, mwEnrolment, curricularCourse, branch, sp); if (curricularCourseScope == null) { return; } IEnrolment enrolment = createEnrolment(studentCurricularPlan, sp, curricularCourseScope); // Update the Corresponding Attend if it exists IFrequenta attend = updateAttend(curricularCourse, executionPeriod, enrolment, mwEnrolment, sp); if (attend == null) {// System.out.println("Student " + mwEnrolment.getNumber() + " has no Attend for " + mwEnrolment.getCoursecode() + " from Degree " + mwEnrolment.getDegreecode()); attendsNotFound++; return; } } } | 2645 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2645/9a85e9a54dda339a3e21ea73171a200451d65ea9/UpdateStudentEnrolments.java/clean/src/middleware/studentMigration/UpdateStudentEnrolments.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
760,
918,
1045,
664,
922,
1346,
12,
202,
202,
682,
14905,
1346,
22,
3067,
16,
202,
202,
45,
19943,
319,
2408,
1512,
2490,
5365,
18110,
2408,
1512,
2490,
5365,
16,
202,
202,
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,
225,
202,
1152,
760,
918,
1045,
664,
922,
1346,
12,
202,
202,
682,
14905,
1346,
22,
3067,
16,
202,
202,
45,
19943,
319,
2408,
1512,
2490,
5365,
18110,
2408,
1512,
2490,
5365,
16,
202,
202,
4... |
DeliveryBean deliveryBean = (DeliveryBean) ContextUtil.lookupBean("delivery"); if (deliveryBean.getAnonymousLogin()) return AgentFacade.getAnonymousId(); else return AgentFacade.getAgentString(); | return AgentFacade.getAgentString(); | public String getAgentString() { DeliveryBean deliveryBean = (DeliveryBean) ContextUtil.lookupBean("delivery"); if (deliveryBean.getAnonymousLogin()) return AgentFacade.getAnonymousId(); else return AgentFacade.getAgentString(); } | 2021 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2021/ba784a53fc99ed7b4856d1b33bfcdcd795674514/PersonBean.java/clean/samigo/tool/src/java/org/sakaiproject/tool/assessment/ui/bean/shared/PersonBean.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
514,
336,
3630,
780,
1435,
225,
288,
565,
17390,
3381,
7912,
3381,
273,
261,
8909,
3381,
13,
1772,
1304,
18,
8664,
3381,
2932,
15703,
8863,
565,
309,
261,
15703,
3381,
18,
588,
1879... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
336,
3630,
780,
1435,
225,
288,
565,
17390,
3381,
7912,
3381,
273,
261,
8909,
3381,
13,
1772,
1304,
18,
8664,
3381,
2932,
15703,
8863,
565,
309,
261,
15703,
3381,
18,
588,
1879... |
Class subArrayElementJavaType = javaArgType.getJavaClass().getComponentType(); boolean needsDataCopy = subArrayElementJavaType.isArray() || subArrayElementJavaType == java.lang.String.class; if (needsDataCopy) { | String convName = pointerConversionArgumentName(i); if (!needsDataCopy) { writer.print(" (*env)->ReleasePrimitiveArrayCritical(env, "); writer.print(binding.getArgumentName(i)); writer.print(", "); writer.print(convName); writer.println(", JNI_ABORT);"); } else { | protected void emitBodyVariablePostCallCleanup(PrintWriter writer) { // Release primitive arrays and temporary UTF8 strings if necessary for (int i = 0; i < binding.getNumArguments(); i++) { JavaType javaArgType = binding.getJavaArgumentType(i); if (javaArgType.isJNIEnv() || binding.isArgumentThisPointer(i)) { continue; } if (javaArgType.isArray()) { String convName = pointerConversionArgumentName(i); // Release array if (EMIT_NULL_CHECKS) { writer.print(" if ("); writer.print(binding.getArgumentName(i)); writer.println(" != NULL) {"); } // clean up the case where the array elements are of a type that needed // a data copy operation to convert from the java memory model to the // C memory model (e.g., int[][], String[], etc) // // FIXME: should factor out this whole block of code into a separate // method for clarity and maintenance purposes Class subArrayElementJavaType = javaArgType.getJavaClass().getComponentType(); boolean needsDataCopy = subArrayElementJavaType.isArray() || subArrayElementJavaType == java.lang.String.class; if (needsDataCopy) { Type cArgType = binding.getCArgumentType(i); String cArgTypeName = cArgType.getName(); if (cArgType.toString().indexOf("const") == -1) { // FIXME: handle any cleanup from treatment of non-const args, // assuming they were treated differently in // emitBodyVariablePreCallSetup() (see the similar section in that // method for details). throw new RuntimeException( "Cannot clean up copied data for ptr-to-ptr arg type \"" + cArgType + "\": support for cleaning up non-const ptr-to-ptr types not implemented."); } writer.println(" /* Clean up " + convName + "_copy */"); String arrayLenName = "_arrayLen" + convName; // free each element PointerType cArgPtrType = cArgType.asPointer(); if (cArgPtrType == null) { throw new RuntimeException( "Could not copy data for type \"" + cArgType + "\"; currently only pointer types supported."); } PointerType cArgElementType = cArgPtrType.getTargetType().asPointer(); // process each element in the array writer.println(" for (_copyIndex = 0; _copyIndex < " + arrayLenName +"; ++_copyIndex) {"); // get each array element writer.println(" /* free each element of " +convName +"_copy */"); String subArrayElementJNITypeString = jniType(subArrayElementJavaType); writer.print(" _tmpObj = ("); writer.print(subArrayElementJNITypeString); writer.print(") (*env)->GetObjectArrayElement(env, "); writer.print(binding.getArgumentName(i)); writer.println(", _copyIndex);"); if (subArrayElementJNITypeString == "jstring") { writer.print(" (*env)->ReleaseStringUTFChars(env, "); writer.print("(jstring) _tmpObj"); writer.print(", "); writer.print(convName+"_copy[_copyIndex]"); writer.println(");"); } else { // FIXME: free up stuff here if (true) throw new RuntimeException( "Cannot yet handle type \"" + cArgType.getName() + "\"; need to add support for cleaning up copied ptr-to-ptr-to-primitiveType subarrays"); } writer.println(" }"); // free the main array writer.print(" free("); writer.print(convName+"_copy"); writer.println(");"); writer.println(); } // end of cleaning up copied data writer.print(" (*env)->ReleasePrimitiveArrayCritical(env, "); writer.print(binding.getArgumentName(i)); writer.print(", "); writer.print(convName); writer.println(", JNI_ABORT);"); if (EMIT_NULL_CHECKS) { writer.println(" }"); } } else if (javaArgType.isString()) { if (EMIT_NULL_CHECKS) { writer.print(" if ("); writer.print(binding.getArgumentName(i)); writer.println(" != NULL) {"); } writer.print(" (*env)->ReleaseStringUTFChars(env, "); writer.print(binding.getArgumentName(i)); writer.print(", _UTF8"); writer.print(binding.getArgumentName(i)); writer.println(");"); if (EMIT_NULL_CHECKS) { writer.println(" }"); } } else if (javaArgType.isArrayOfCompoundTypeWrappers()) { // FIXME throw new RuntimeException("Outgoing arrays of StructAccessors not yet implemented"); } } } | 48257 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/48257/9512c9fa62ece3960472b6ab2cd6ce5244da8501/CMethodBindingEmitter.java/clean/src/net/java/games/gluegen/CMethodBindingEmitter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
918,
3626,
2250,
3092,
3349,
1477,
15007,
12,
5108,
2289,
2633,
13,
225,
288,
565,
368,
10819,
8225,
5352,
471,
6269,
6380,
28,
2064,
309,
4573,
565,
364,
261,
474,
277,
273,
374,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3626,
2250,
3092,
3349,
1477,
15007,
12,
5108,
2289,
2633,
13,
225,
288,
565,
368,
10819,
8225,
5352,
471,
6269,
6380,
28,
2064,
309,
4573,
565,
364,
261,
474,
277,
273,
374,
... |
pushFollow(FOLLOW_literal_constraint_in_constraint_expression2250); | pushFollow(FOLLOW_literal_constraint_in_constraint_expression2232); | public RestrictionDescr constraint_expression() throws RecognitionException { RestrictionDescr rd = null; Token op=null; Token bvc=null; String lc = null; String rvc = null; try { // D:\\workspace\\jboss\\jbossrules\\drools-compiler\\src\\main\\resources\\org\\drools\\lang\\DRL.g:1016:3: (op= ('=='|'>'|'>='|'<'|'<='|'!='|'contains'|'matches'|'excludes') ( ( ID )=>bvc= ID | ( enum_constraint )=>lc= enum_constraint | ( literal_constraint )=>lc= literal_constraint | rvc= retval_constraint ) ) // D:\\workspace\\jboss\\jbossrules\\drools-compiler\\src\\main\\resources\\org\\drools\\lang\\DRL.g:1016:3: op= ('=='|'>'|'>='|'<'|'<='|'!='|'contains'|'matches'|'excludes') ( ( ID )=>bvc= ID | ( enum_constraint )=>lc= enum_constraint | ( literal_constraint )=>lc= literal_constraint | rvc= retval_constraint ) { op=(Token)input.LT(1); if ( (input.LA(1)>=57 && input.LA(1)<=65) ) { input.consume(); errorRecovery=false;failed=false; } else { if (backtracking>0) {failed=true; return rd;} MismatchedSetException mse = new MismatchedSetException(null,input); recoverFromMismatchedSet(input,mse,FOLLOW_set_in_constraint_expression2144); throw mse; } // D:\\workspace\\jboss\\jbossrules\\drools-compiler\\src\\main\\resources\\org\\drools\\lang\\DRL.g:1026:3: ( ( ID )=>bvc= ID | ( enum_constraint )=>lc= enum_constraint | ( literal_constraint )=>lc= literal_constraint | rvc= retval_constraint ) int alt38=4; switch ( input.LA(1) ) { case ID: int LA38_1 = input.LA(2); if ( (LA38_1==30) ) { alt38=2; } else if ( (LA38_1==EOF||LA38_1==RIGHT_PAREN||LA38_1==33||(LA38_1>=55 && LA38_1<=56)) ) { alt38=1; } else { if (backtracking>0) {failed=true; return rd;} NoViableAltException nvae = new NoViableAltException("1026:3: ( ( ID )=>bvc= ID | ( enum_constraint )=>lc= enum_constraint | ( literal_constraint )=>lc= literal_constraint | rvc= retval_constraint )", 38, 1, input); throw nvae; } break; case INT: case BOOL: case STRING: case FLOAT: case 66: alt38=3; break; case LEFT_PAREN: alt38=4; break; default: if (backtracking>0) {failed=true; return rd;} NoViableAltException nvae = new NoViableAltException("1026:3: ( ( ID )=>bvc= ID | ( enum_constraint )=>lc= enum_constraint | ( literal_constraint )=>lc= literal_constraint | rvc= retval_constraint )", 38, 0, input); throw nvae; } switch (alt38) { case 1 : // D:\\workspace\\jboss\\jbossrules\\drools-compiler\\src\\main\\resources\\org\\drools\\lang\\DRL.g:1026:5: ( ID )=>bvc= ID { bvc=(Token)input.LT(1); match(input,ID,FOLLOW_ID_in_constraint_expression2211); if (failed) return rd; if ( backtracking==0 ) { rd = new VariableRestrictionDescr(op.getText(), bvc.getText()); } } break; case 2 : // D:\\workspace\\jboss\\jbossrules\\drools-compiler\\src\\main\\resources\\org\\drools\\lang\\DRL.g:1031:4: ( enum_constraint )=>lc= enum_constraint { pushFollow(FOLLOW_enum_constraint_in_constraint_expression2227); lc=enum_constraint(); _fsp--; if (failed) return rd; if ( backtracking==0 ) { rd = new LiteralRestrictionDescr(op.getText(), lc, true); } } break; case 3 : // D:\\workspace\\jboss\\jbossrules\\drools-compiler\\src\\main\\resources\\org\\drools\\lang\\DRL.g:1036:4: ( literal_constraint )=>lc= literal_constraint { pushFollow(FOLLOW_literal_constraint_in_constraint_expression2250); lc=literal_constraint(); _fsp--; if (failed) return rd; if ( backtracking==0 ) { rd = new LiteralRestrictionDescr(op.getText(), lc); } } break; case 4 : // D:\\workspace\\jboss\\jbossrules\\drools-compiler\\src\\main\\resources\\org\\drools\\lang\\DRL.g:1040:5: rvc= retval_constraint { pushFollow(FOLLOW_retval_constraint_in_constraint_expression2264); rvc=retval_constraint(); _fsp--; if (failed) return rd; if ( backtracking==0 ) { rd = new ReturnValueRestrictionDescr(op.getText(), rvc); } } break; } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return rd; } | 5490 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5490/afea9f80e7c11e7b76df18f232d3b5ca5ad21e72/DRLParser.java/buggy/drools-compiler/src/main/java/org/drools/lang/DRLParser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1124,
6192,
16198,
4954,
67,
8692,
1435,
1216,
9539,
288,
6647,
1124,
6192,
16198,
9437,
273,
446,
31,
3639,
3155,
1061,
33,
2011,
31,
3639,
3155,
324,
4227,
33,
2011,
31,
3639,
514... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1124,
6192,
16198,
4954,
67,
8692,
1435,
1216,
9539,
288,
6647,
1124,
6192,
16198,
9437,
273,
446,
31,
3639,
3155,
1061,
33,
2011,
31,
3639,
3155,
324,
4227,
33,
2011,
31,
3639,
514... |
if ( DesignChoiceConstants.FONT_SIZE_MEDIUM .equals( DesignerConstants.fontSizes[i][0] ) ) | if ( DesignChoiceConstants.FONT_SIZE_MEDIUM.equals( DesignerConstants.fontSizes[i][0] ) ) | private static String getSmallerFontSize( DesignElementHandle handle ) { if ( !( handle instanceof ReportItemHandle ) ) { if ( handle instanceof ModuleHandle ) { for ( int i = DesignerConstants.fontSizes.length - 1; i > 0; i-- ) { if ( DesignChoiceConstants.FONT_SIZE_MEDIUM .equals( DesignerConstants.fontSizes[i][0] ) ) { return DesignerConstants.fontSizes[i - 1][0]; } } } if ( handle instanceof GroupHandle ) { handle = handle.getContainer( ); } } Object fontSizeValue = getModelFontSize( handle ); if ( fontSizeValue instanceof DimensionValue ) { int parentSize = getFontSizeIntValue( handle.getContainer( ) ); int size = (int) CSSUtil.convertToPoint( fontSizeValue, parentSize ) - 1; size = ( size < 1 ) ? 1 : size; DimensionValue dm = new DimensionValue( size, "pt" ); //$NON-NLS-1$ return dm.toString( ); } else if ( fontSizeValue instanceof String ) { String fontSize = (String) fontSizeValue; if ( fontSize.equals( DesignChoiceConstants.FONT_SIZE_LARGER ) ) { return getLargerFontSize( handle.getContainer( ) ); } else if ( fontSize.equals( DesignChoiceConstants.FONT_SIZE_SMALLER ) ) { return getSmallerFontSize( handle.getContainer( ) ); } else { for ( int i = DesignerConstants.fontSizes.length - 1; i > 0; i-- ) { if ( fontSize.equals( DesignerConstants.fontSizes[i][0] ) ) { return DesignerConstants.fontSizes[i - 1][0]; } } return DesignerConstants.fontSizes[0][0]; } } else { return DesignChoiceConstants.FONT_SIZE_MEDIUM; } } | 46013 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46013/65c31b53af468bafee3d7b3a9d5249824989932a/DEUtil.java/buggy/UI/org.eclipse.birt.report.designer.core/src/org/eclipse/birt/report/designer/util/DEUtil.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
760,
514,
1322,
81,
454,
264,
22688,
12,
29703,
1046,
3259,
1640,
262,
202,
95,
202,
202,
430,
261,
401,
12,
1640,
1276,
8706,
1180,
3259,
262,
262,
202,
202,
95,
1082,
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,
1152,
760,
514,
1322,
81,
454,
264,
22688,
12,
29703,
1046,
3259,
1640,
262,
202,
95,
202,
202,
430,
261,
401,
12,
1640,
1276,
8706,
1180,
3259,
262,
262,
202,
202,
95,
1082,
202,
... |
return getNamespace(packageDecl.getQualifiedName()); | return RuntimeModeler.getNamespace(packageDecl.getQualifiedName()); | protected String getNamespace(PackageDeclaration packageDecl) { return getNamespace(packageDecl.getQualifiedName()); } | 9667 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/9667/307adc4c592916f6fe727a233c29b68e9a860ce4/WebServiceVisitor.java/clean/jaxws-ri/tools/wscompile/src/com/sun/tools/ws/processor/modeler/annotation/WebServiceVisitor.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
514,
11153,
12,
2261,
6094,
2181,
3456,
13,
288,
3639,
327,
2509,
1488,
264,
18,
588,
3402,
12,
5610,
3456,
18,
588,
12345,
10663,
565,
289,
2,
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,
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,
377,
4750,
514,
11153,
12,
2261,
6094,
2181,
3456,
13,
288,
3639,
327,
2509,
1488,
264,
18,
588,
3402,
12,
5610,
3456,
18,
588,
12345,
10663,
565,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
} catch (ServletException ex) { Throwable realEx = ex; if (ex.getRootCause() != null) { realEx = ex.getRootCause(); | } catch (ServletException e) { Throwable cause = e; if (e.getRootCause() != null) { cause = e.getRootCause(); | public int doEndTag() throws JspException { // Check role HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); if (role != null && !request.isUserInRole(role)) { return EVAL_PAGE; } try { if (log.isDebugEnabled()) { log.debug("insert page='" + page + "'."); } // set new context for included component. pageContext.setAttribute( ComponentConstants.COMPONENT_CONTEXT, subCompContext, PageContext.REQUEST_SCOPE); // Call controller if any if (controller != null) { controller.perform( subCompContext, (HttpServletRequest) pageContext.getRequest(), (HttpServletResponse) pageContext.getResponse(), pageContext.getServletContext()); } // include requested component. if (flush) { pageContext.getOut().flush(); } doInclude(page); } catch (IOException ex) { processException( ex, "Can't insert page '" + page + "' : " + ex.getMessage()); } catch (IllegalArgumentException ex) { // Can't resolve page uri // Do we ignore bad page uri errors ? if (!(page == null && isErrorIgnored)) { // Don't ignore bad page uri errors processException( ex, "Tag 'insert' can't insert page '" + page + "'. Check if it exists.\n" + ex.getMessage()); } } catch (ServletException ex) { Throwable realEx = ex; if (ex.getRootCause() != null) { realEx = ex.getRootCause(); } processException( realEx, "[ServletException in:" + page + "] " + realEx.getMessage() + "'"); } catch (Exception ex) { processException( ex, "[Exception in:" + page + "] " + ex.getMessage()); } finally { // restore old context // done only if currentContext not null (bug with Silverstream ?; related by Arvindra Sehmi 20010712) if (currentContext != null) { pageContext.setAttribute( ComponentConstants.COMPONENT_CONTEXT, currentContext, PageContext.REQUEST_SCOPE); } } return EVAL_PAGE; } | 54704 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54704/61c3da8774f358642fb7938ebf44c94c5d0df682/InsertTag.java/clean/src/share/org/apache/struts/taglib/tiles/InsertTag.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
1071,
509,
741,
25633,
1435,
1216,
27485,
288,
5411,
368,
2073,
2478,
5411,
9984,
590,
273,
7734,
261,
2940,
18572,
13,
21442,
18,
588,
691,
5621,
5411,
309,
261,
4615,
480,
446,
597,
401... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
540,
1071,
509,
741,
25633,
1435,
1216,
27485,
288,
5411,
368,
2073,
2478,
5411,
9984,
590,
273,
7734,
261,
2940,
18572,
13,
21442,
18,
588,
691,
5621,
5411,
309,
261,
4615,
480,
446,
597,
401... |
assertTrue("Failed to flush correctly", c == 9087589); | assertEquals("Failed to flush correctly", 9087589, c); | public void test_flush() { // Test for method void java.io.DataOutputStream.flush() try { os.writeInt(9087589); os.flush(); openDataInputStream(); int c = dis.readInt(); dis.close(); assertTrue("Failed to flush correctly", c == 9087589); } catch (IOException e) { fail("Exception during flush test : " + e.getMessage()); } } | 54769 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54769/181e940cd92dfff67639d98e991206d375a987ea/DataOutputStreamTest.java/buggy/modules/luni/src/test/java/tests/api/java/io/DataOutputStreamTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1842,
67,
11330,
1435,
288,
202,
202,
759,
7766,
364,
707,
918,
2252,
18,
1594,
18,
751,
4632,
18,
11330,
1435,
202,
202,
698,
288,
1082,
202,
538,
18,
2626,
1702,
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,
225,
202,
482,
918,
1842,
67,
11330,
1435,
288,
202,
202,
759,
7766,
364,
707,
918,
2252,
18,
1594,
18,
751,
4632,
18,
11330,
1435,
202,
202,
698,
288,
1082,
202,
538,
18,
2626,
1702,
12,
... |
ListSelectionDialog dlg = new MyListSelectionDialog( | MyListSelectionDialog dlg = new MyListSelectionDialog( | private boolean promptForSaving(List modelsToSave, final IWorkbenchWindow window, boolean canCancel, boolean stillOpenElsewhere) { // Save parts, exit the method if cancel is pressed. if (modelsToSave.size() > 0) { if (modelsToSave.size() == 1) { Saveable model = (Saveable) modelsToSave.get(0); String message = NLS .bind( stillOpenElsewhere ? WorkbenchMessages.EditorManager_saveChangesOptionallyQuestion : WorkbenchMessages.EditorManager_saveChangesQuestion, model.getName()); // Show a dialog. String[] buttons = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }; MessageDialog d = new MessageDialog(window.getShell(), WorkbenchMessages.Save_Resource, null, message, MessageDialog.QUESTION, buttons, 0); int choice = SaveableHelper.testGetAutomatedResponse(); if (SaveableHelper.testGetAutomatedResponse() == SaveableHelper.USER_RESPONSE) { choice = d.open(); } // Branch on the user choice. // The choice id is based on the order of button labels // above. switch (choice) { case ISaveablePart2.YES: // yes break; case ISaveablePart2.NO: // no modelsToSave.clear(); break; default: case ISaveablePart2.CANCEL: // cancel return true; } } else { ListSelectionDialog dlg = new MyListSelectionDialog( window.getShell(), modelsToSave, new ArrayContentProvider(), new WorkbenchPartLabelProvider(), stillOpenElsewhere ? WorkbenchMessages.EditorManager_saveResourcesOptionallyMessage : WorkbenchMessages.EditorManager_saveResourcesMessage, canCancel); dlg.setInitialSelections(modelsToSave.toArray()); dlg.setTitle(EditorManager.SAVE_RESOURCES_TITLE); // this "if" statement aids in testing. if (SaveableHelper.testGetAutomatedResponse() == SaveableHelper.USER_RESPONSE) { int result = dlg.open(); // Just return null to prevent the operation continuing if (result == IDialogConstants.CANCEL_ID) return true; modelsToSave = Arrays.asList(dlg.getResult()); } } } // Create save block. final List finalModels = modelsToSave; IRunnableWithProgress progressOp = new IRunnableWithProgress() { public void run(IProgressMonitor monitor) { IProgressMonitor monitorWrap = new EventLoopProgressMonitor( monitor); monitorWrap.beginTask("", finalModels.size()); //$NON-NLS-1$ for (Iterator i = finalModels.iterator(); i.hasNext();) { Saveable model = (Saveable) i.next(); // handle case where this model got saved as a result of // saving another if (!model.isDirty()) { monitor.worked(1); continue; } try { model.doSave(new SubProgressMonitor(monitorWrap, 1)); } catch (CoreException e) { ErrorDialog.openError(window.getShell(), WorkbenchMessages.Error, e.getMessage(), e .getStatus()); } if (monitorWrap.isCanceled()) break; } monitorWrap.done(); } }; // Do the save. if (!SaveableHelper.runProgressMonitorOperation( WorkbenchMessages.Save_All, progressOp, window)) { // cancelled return true; } return false; } | 56152 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56152/4f8101da204540185233b90988fe9650cef07939/SaveablesList.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/SaveablesList.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
1250,
6866,
1290,
24660,
12,
682,
3679,
774,
4755,
16,
1082,
202,
6385,
467,
2421,
22144,
3829,
2742,
16,
1250,
848,
6691,
16,
1250,
4859,
3678,
12427,
6051,
13,
288,
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,
1152,
1250,
6866,
1290,
24660,
12,
682,
3679,
774,
4755,
16,
1082,
202,
6385,
467,
2421,
22144,
3829,
2742,
16,
1250,
848,
6691,
16,
1250,
4859,
3678,
12427,
6051,
13,
288,
202,
202,... |
return s30; | return s32; | public DFA.State transition(IntStream input) throws RecognitionException { switch ( input.LA(1) ) { case EOL: case 15: return s51; case 22: return s41; case 23: return s30; default: NoViableAltException nvae = new NoViableAltException("", 4, 40, input); throw nvae; } } | 5490 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5490/297a1e0ef2967d8b4f7be9c022102a5a56e97489/RuleParser.java/clean/drools-compiler/src/main/java/org/drools/lang/RuleParser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
2398,
1071,
463,
2046,
18,
1119,
6007,
12,
1702,
1228,
810,
13,
1216,
9539,
288,
7734,
1620,
261,
810,
18,
2534,
12,
21,
13,
262,
288,
7734,
648,
19995,
30,
7734,
648,
4711,
30,
10792,
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,
2398,
1071,
463,
2046,
18,
1119,
6007,
12,
1702,
1228,
810,
13,
1216,
9539,
288,
7734,
1620,
261,
810,
18,
2534,
12,
21,
13,
262,
288,
7734,
648,
19995,
30,
7734,
648,
4711,
30,
10792,
327,
... |
protected void openConnection(String host, int port, Properties info, String database, String url, Driver d) throws SQLException { // Throw an exception if the user or password properties are missing // This occasionally occurs when the client uses the properties version // of getConnection(), and is a common question on the email lists if(info.getProperty("user")==null) throw new PSQLException("postgresql.con.user"); if(info.getProperty("password")==null) throw new PSQLException("postgresql.con.pass"); this_driver = d; this_url = url; PG_DATABASE = database; PG_PASSWORD = info.getProperty("password"); PG_USER = info.getProperty("user"); PG_PORT = port; PG_HOST = host; PG_STATUS = CONNECTION_BAD; // Now make the initial connection try { pg_stream = new PG_Stream(host, port); } catch (ConnectException cex) { // Added by Peter Mount <peter@retep.org.uk> // ConnectException is thrown when the connection cannot be made. // we trap this an return a more meaningful message for the end user throw new PSQLException ("postgresql.con.refused"); } catch (IOException e) { throw new PSQLException ("postgresql.con.failed",e); } // Now we need to construct and send a startup packet try { // Ver 6.3 code pg_stream.SendInteger(4+4+SM_DATABASE+SM_USER+SM_OPTIONS+SM_UNUSED+SM_TTY,4); pg_stream.SendInteger(PG_PROTOCOL_LATEST_MAJOR,2); pg_stream.SendInteger(PG_PROTOCOL_LATEST_MINOR,2); pg_stream.Send(database.getBytes(),SM_DATABASE); // This last send includes the unused fields pg_stream.Send(PG_USER.getBytes(),SM_USER+SM_OPTIONS+SM_UNUSED+SM_TTY); // now flush the startup packets to the backend pg_stream.flush(); // Now get the response from the backend, either an error message // or an authentication request int areq = -1; // must have a value here do { int beresp = pg_stream.ReceiveChar(); switch(beresp) { case 'E': // An error occured, so pass the error message to the // user. // // The most common one to be thrown here is: // "User authentication failed" // throw new SQLException(pg_stream.ReceiveString (receive_sbuf, 4096, getEncoding())); case 'R': // Get the type of request areq = pg_stream.ReceiveIntegerR(4); // Get the password salt if there is one if(areq == AUTH_REQ_CRYPT) { byte[] rst = new byte[2]; rst[0] = (byte)pg_stream.ReceiveChar(); rst[1] = (byte)pg_stream.ReceiveChar(); salt = new String(rst,0,2); DriverManager.println("Salt="+salt); } // now send the auth packet switch(areq) { case AUTH_REQ_OK: break; case AUTH_REQ_KRB4: DriverManager.println("postgresql: KRB4"); throw new PSQLException("postgresql.con.kerb4"); case AUTH_REQ_KRB5: DriverManager.println("postgresql: KRB5"); throw new PSQLException("postgresql.con.kerb5"); case AUTH_REQ_PASSWORD: DriverManager.println("postgresql: PASSWORD"); pg_stream.SendInteger(5+PG_PASSWORD.length(),4); pg_stream.Send(PG_PASSWORD.getBytes()); pg_stream.SendInteger(0,1); pg_stream.flush(); break; case AUTH_REQ_CRYPT: DriverManager.println("postgresql: CRYPT"); String crypted = UnixCrypt.crypt(salt,PG_PASSWORD); pg_stream.SendInteger(5+crypted.length(),4); pg_stream.Send(crypted.getBytes()); pg_stream.SendInteger(0,1); pg_stream.flush(); break; default: throw new PSQLException("postgresql.con.auth",new Integer(areq)); } break; default: throw new PSQLException("postgresql.con.authfail"); } } while(areq != AUTH_REQ_OK); } catch (IOException e) { throw new PSQLException("postgresql.con.failed",e); } // As of protocol version 2.0, we should now receive the cancellation key and the pid int beresp = pg_stream.ReceiveChar(); switch(beresp) { case 'K': pid = pg_stream.ReceiveInteger(4); ckey = pg_stream.ReceiveInteger(4); break; case 'E': case 'N': throw new SQLException(pg_stream.ReceiveString (receive_sbuf, 4096, getEncoding())); default: throw new PSQLException("postgresql.con.setup"); } // Expect ReadyForQuery packet beresp = pg_stream.ReceiveChar(); switch(beresp) { case 'Z': break; case 'E': case 'N': throw new SQLException(pg_stream.ReceiveString(receive_sbuf, 4096, getEncoding())); default: throw new PSQLException("postgresql.con.setup"); } // Originally we issued a SHOW DATESTYLE statement to find the databases default // datestyle. However, this caused some problems with timestamps, so in 6.5, we // went the way of ODBC, and set the connection to ISO. // // This may cause some clients to break when they assume anything other than ISO, // but then - they should be using the proper methods ;-) // // We also ask the DB for certain properties (i.e. DatabaseEncoding at this time) // firstWarning = null; java.sql.ResultSet initrset = ExecSQL("set datestyle to 'ISO'; select getdatabaseencoding()"); String dbEncoding = null; //retrieve DB properties if(initrset.next()) { //handle DatabaseEncoding dbEncoding = initrset.getString(1); //convert from the PostgreSQL name to the Java name if (dbEncoding.equals("SQL_ASCII")) { dbEncoding = "ASCII"; } else if (dbEncoding.equals("UNICODE")) { dbEncoding = "UTF8"; } else if (dbEncoding.equals("LATIN1")) { dbEncoding = "ISO8859_1"; } else if (dbEncoding.equals("LATIN2")) { dbEncoding = "ISO8859_2"; } else if (dbEncoding.equals("LATIN3")) { dbEncoding = "ISO8859_3"; } else if (dbEncoding.equals("LATIN4")) { dbEncoding = "ISO8859_4"; } else if (dbEncoding.equals("LATIN5")) { dbEncoding = "ISO8859_5"; } else if (dbEncoding.equals("LATIN6")) { dbEncoding = "ISO8859_6"; } else if (dbEncoding.equals("LATIN7")) { dbEncoding = "ISO8859_7"; } else if (dbEncoding.equals("LATIN8")) { dbEncoding = "ISO8859_8"; } else if (dbEncoding.equals("LATIN9")) { dbEncoding = "ISO8859_9"; } else if (dbEncoding.equals("EUC_JP")) { dbEncoding = "EUC_JP"; } else if (dbEncoding.equals("EUC_CN")) { dbEncoding = "EUC_CN"; } else if (dbEncoding.equals("EUC_KR")) { dbEncoding = "EUC_KR"; } else if (dbEncoding.equals("EUC_TW")) { dbEncoding = "EUC_TW"; } else if (dbEncoding.equals("KOI8")) { dbEncoding = "KOI8_R"; } else if (dbEncoding.equals("WIN")) { dbEncoding = "Cp1252"; } else { dbEncoding = null; } } //Set the encoding for this connection //Since the encoding could be specified or obtained from the DB we use the //following order: // 1. passed as a property // 2. value from DB if supported by current JVM // 3. default for JVM (leave encoding null) String passedEncoding = info.getProperty("charSet"); // could be null if (passedEncoding != null) { encoding = passedEncoding; } else { if (dbEncoding != null) { //test DB encoding try { "TEST".getBytes(dbEncoding); //no error the encoding is supported by the current JVM encoding = dbEncoding; } catch (UnsupportedEncodingException uee) { //dbEncoding is not supported by the current JVM encoding = null; } } else { encoding = null; } } // Initialise object handling initObjectTypes(); // Mark the connection as ok, and cleanup firstWarning = null; PG_STATUS = CONNECTION_OK; } | 45672 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45672/45b5d792afa60ae24d57cdceaaec0e03cf6abb2a/Connection.java/clean/src/interfaces/jdbc/org/postgresql/Connection.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
918,
24982,
12,
780,
1479,
16,
509,
1756,
16,
6183,
1123,
16,
514,
2063,
16,
514,
880,
16,
9396,
302,
13,
1216,
6483,
565,
288,
565,
368,
3743,
392,
1520,
309,
326,
729,
578,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
24982,
12,
780,
1479,
16,
509,
1756,
16,
6183,
1123,
16,
514,
2063,
16,
514,
880,
16,
9396,
302,
13,
1216,
6483,
565,
288,
565,
368,
3743,
392,
1520,
309,
326,
729,
578,
22... | ||
Symbol clazz = parser.defs.getClass(Name.fromString(name)); | Symbol clazz = parser.defs.getClass(Name.fromString(name)); | protected Type parseType() { String name = token; Symbol s = getTVar(name); nextToken(); if (s != Symbol.NONE) return s.type(); Symbol clazz = parser.defs.getClass(Name.fromString(name)); if (token.equals("[")) { Vector types = new Vector(); do { nextToken(); types.add(parseType()); } while (token.equals(",")); assert "]".equals(token); nextToken(); Type[] args = new Type[types.size()]; types.toArray(args); return Type.TypeRef(clazz.owner().thisType(), clazz, args).unalias(); } else { return clazz.typeConstructor().unalias(); } } | 55146 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55146/864e44452f82eb12036c65134f537efa4bd70e91/AttributeParser.java/buggy/sources/scalac/symtab/classfile/AttributeParser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
4750,
1412,
1109,
559,
1435,
288,
5411,
514,
508,
273,
1147,
31,
5411,
8565,
272,
273,
3181,
1537,
12,
529,
1769,
5411,
9617,
5621,
5411,
309,
261,
87,
480,
8565,
18,
9826,
13,
7734,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
540,
4750,
1412,
1109,
559,
1435,
288,
5411,
514,
508,
273,
1147,
31,
5411,
8565,
272,
273,
3181,
1537,
12,
529,
1769,
5411,
9617,
5621,
5411,
309,
261,
87,
480,
8565,
18,
9826,
13,
7734,
32... |
newnode.nodeListChanges = -1; newnode.nodeListLength = -1; newnode.kidOK = kidOK; | public Node cloneNode(boolean deep) { NodeContainer newnode = (NodeContainer) super.cloneNode(deep); if (syncChildren) { synchronizeChildren(); } // Need to break the association w/ original kids newnode.firstChild = null; newnode.lastChild = null; // Then, if deep, clone the kids too. if (deep) { for (NodeImpl child = (NodeImpl)getFirstChild(); child != null; child = (NodeImpl)child.getNextSibling()) { newnode.appendChild(child.cloneNode(true)); } } return newnode; } // cloneNode(boolean):Node | 1831 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1831/22a32aee066bf3fb5b3daf2cfdc66db40dbb887b/NodeContainer.java/buggy/src/org/apache/xerces/dom/NodeContainer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
29267,
18,
2159,
682,
7173,
273,
300,
21,
31,
29267,
18,
2159,
682,
1782,
273,
300,
21,
31,
225,
29267,
18,
79,
350,
3141,
273,
17395,
3141,
31,
565,
29267,
18,
2159,
682,
7173,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
29267,
18,
2159,
682,
7173,
273,
300,
21,
31,
29267,
18,
2159,
682,
1782,
273,
300,
21,
31,
225,
29267,
18,
79,
350,
3141,
273,
17395,
3141,
31,
565,
29267,
18,
2159,
682,
7173,
273,
... | |
log.debug("SETTING PROPERTIES: ItemFacade item<==Map itemMap"); | public void updateItem(ItemFacade item, Map itemMap) { log.debug("\n*** Updating ItemFacade item<==Map itemMap"); // type and title String title = (String) itemMap.get("title"); item.setDescription(title); // type // first, we will try to get item type from meta info // but otherwise, we will use the other two String qmd = item.getItemMetaDataByLabel("qmd_itemtype"); String itemIntrospect = (String) itemMap.get("itemIntrospect"); String itemType = calculateType(item, title, itemIntrospect, qmd); Long typeId = getType(itemType); // we use this later... log.debug("SETTING TYPE: ItemFacade item<==Map itemMap"); log.debug("============>item type id: '" + typeId + "'"); item.setTypeId(typeId); // meta data List metadataList = (List) itemMap.get("metadata"); log.debug("\n*** SETTING METADATA: ItemFacade item<==Map itemMap"); addMetadata(metadataList, item); // basic properties log.debug("SETTING PROPERTIES: ItemFacade item<==Map itemMap"); addItemProperties(item, itemMap); // feedback log.debug("\n*** SETTING FEEDBACK: ItemFacade item<==Map itemMap"); // correct, incorrect, general addFeedback(item, itemMap, typeId); // item text and answers log.debug("\n*** SETTING TEXT AND ANSWERS: ItemFacade item<==Map itemMap"); log.debug("\n*** FILL_IN_BLANK=" + TypeIfc.FILL_IN_BLANK.longValue()); log.debug("\n*** MATCHING=" + TypeIfc.MATCHING.longValue()); log.debug("\n*** TYPE=" + typeId.longValue()); if (TypeIfc.FILL_IN_BLANK.longValue() == typeId.longValue()) { addFibTextAndAnswers(item, itemMap); } else if (TypeIfc.MATCHING.longValue() == typeId.longValue()) { addMatchTextAndAnswers(item, itemMap); } else { addTextAndAnswers(item, itemMap); } } | 2021 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2021/c72445f8521bb64860acb6cdcaedb8dc27e7bd6a/ExtractionHelper.java/buggy/samigo/src/org/sakaiproject/tool/assessment/business/entity/helper/ExtractionHelper.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
1089,
1180,
12,
1180,
12467,
761,
16,
1635,
761,
863,
13,
225,
288,
565,
613,
18,
4148,
31458,
82,
14465,
27254,
1776,
4342,
12467,
761,
32,
631,
863,
761,
863,
8863,
565,
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,
282,
1071,
918,
1089,
1180,
12,
1180,
12467,
761,
16,
1635,
761,
863,
13,
225,
288,
565,
613,
18,
4148,
31458,
82,
14465,
27254,
1776,
4342,
12467,
761,
32,
631,
863,
761,
863,
8863,
565,
36... | |
public vInteger Args() { return this.Deref().Args(); } | public vInteger Args() { return Deref().Args(); } | public vInteger Args() { return this.Deref().Args(); } | 4078 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4078/5718ec67373e063580a493dcbb6445df289ef446/vIndirect.java/buggy/jcon/vIndirect.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
331,
4522,
6634,
1435,
1082,
202,
95,
327,
333,
18,
40,
822,
74,
7675,
2615,
5621,
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,
... | [
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
331,
4522,
6634,
1435,
1082,
202,
95,
327,
333,
18,
40,
822,
74,
7675,
2615,
5621,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
public String getAbsPath() { | public String getAbsPath() throws SVNException { | public String getAbsPath() { String pathSoFar = "/"; if (myParent != null) { pathSoFar = myParent.getAbsPath(); } return getNameEntry() != null ? SVNPathUtil.concatToAbs(pathSoFar, getNameEntry()) : pathSoFar; } | 2776 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2776/a16e07e043957216b8626db56f082d473a69882f/FSParentPath.java/buggy/javasvn/src/org/tmatesoft/svn/core/internal/io/fs/FSParentPath.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
4506,
2038,
743,
1435,
1216,
29537,
50,
503,
288,
3639,
514,
589,
26619,
273,
4016,
31,
3639,
309,
261,
4811,
3054,
480,
446,
13,
288,
5411,
589,
26619,
273,
3399,
3054,
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,
514,
4506,
2038,
743,
1435,
1216,
29537,
50,
503,
288,
3639,
514,
589,
26619,
273,
4016,
31,
3639,
309,
261,
4811,
3054,
480,
446,
13,
288,
5411,
589,
26619,
273,
3399,
3054,
18,
... |
}; | } | public int read() throws IOException { if (pos >= 0) { int cur = pos % BUFF_SIZE; if (cur < bar) { pos++; return buff[cur]; } if (cur != end) { buff[cur] = inStream.read(); bar = cur+1; pos++; return buff[cur]; } else { pos = -1; // can not operate anymore } } return inStream.read(); }; | 54769 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54769/725ae047c421126dd0fcfebb60f514948e7cc007/X509CertFactoryImpl.java/buggy/modules/security/src/main/java/common/org/apache/harmony/security/provider/cert/X509CertFactoryImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
1071,
509,
855,
1435,
1216,
1860,
288,
5411,
309,
261,
917,
1545,
374,
13,
288,
7734,
509,
662,
273,
949,
738,
10937,
2246,
67,
4574,
31,
7734,
309,
261,
1397,
411,
4653,
13,
288,
10792... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
540,
1071,
509,
855,
1435,
1216,
1860,
288,
5411,
309,
261,
917,
1545,
374,
13,
288,
7734,
509,
662,
273,
949,
738,
10937,
2246,
67,
4574,
31,
7734,
309,
261,
1397,
411,
4653,
13,
288,
10792... |
contextMap.put(name, obj); | registry.put(name, obj); if (obj instanceof BSFDeclaredBean) { contextMap.put(name, ((BSFDeclaredBean)obj).bean); } else { contextMap.put(name, obj); } | public void register(String name, Object obj) { contextMap.put(name, obj); } | 4173 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4173/8dfe8ba74f9a548196154ef7d8be3b78095faf91/BSFScriptContext.java/clean/genesis/modules/client/src/net/java/dev/genesis/script/bsf/BSFScriptContext.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4202,
1071,
918,
1744,
12,
780,
508,
16,
1033,
1081,
13,
288,
540,
4023,
18,
458,
12,
529,
16,
1081,
1769,
225,
309,
261,
2603,
1276,
605,
22395,
18888,
3381,
13,
288,
819,
863,
18,
458,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4202,
1071,
918,
1744,
12,
780,
508,
16,
1033,
1081,
13,
288,
540,
4023,
18,
458,
12,
529,
16,
1081,
1769,
225,
309,
261,
2603,
1276,
605,
22395,
18888,
3381,
13,
288,
819,
863,
18,
458,
1... |
result = JmsMessageUtils.getMessageForObject(src, this.getSession()); | result = JmsMessageUtils.toMessage(src, this.getSession()); | protected Message transformToMessage(Object src) throws TransformerException { try { Message result; if (src instanceof Message) { result = (Message)src; result.clearProperties(); } else { result = JmsMessageUtils.getMessageForObject(src, this.getSession()); } // set the event properties on the Message UMOEventContext ctx = RequestContext.getEventContext(); if (ctx == null) { logger.warn("There is no current event context"); return result; } this.setJmsProperties(ctx.getMessage(), result); return result; } catch (Exception e) { throw new TransformerException(this, e); } } | 28323 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/28323/61be34f43dd968ede5d261285902aa6c0672c515/AbstractJmsTransformer.java/buggy/transports/jms/src/main/java/org/mule/providers/jms/transformers/AbstractJmsTransformer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
2350,
2510,
774,
1079,
12,
921,
1705,
13,
1216,
21684,
565,
288,
3639,
775,
3639,
288,
5411,
2350,
563,
31,
5411,
309,
261,
4816,
1276,
2350,
13,
5411,
288,
7734,
563,
273,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
2350,
2510,
774,
1079,
12,
921,
1705,
13,
1216,
21684,
565,
288,
3639,
775,
3639,
288,
5411,
2350,
563,
31,
5411,
309,
261,
4816,
1276,
2350,
13,
5411,
288,
7734,
563,
273,
261,
1... |
throw new RubyNameException(getRuby(), "method '" + name + "' not defined in " + toName()); | throw new NameError(getRuby(), "method '" + name + "' not defined in " + toName()); | public void removeMethod(String name) { if (this == getRuby().getClasses().getObjectClass()) { getRuby().secure(4); } if (getRuby().getSafeLevel() >= 4 && !isTaint()) { throw new RubySecurityException(getRuby(), "Insecure: can't remove method"); } if (isFrozen()) { // rb_error_frozen("class/module"); } if (getMethods().remove(name) == null) { throw new RubyNameException(getRuby(), "method '" + name + "' not defined in " + toName()); } getRuby().getMethodCache().clearByName(name); } | 45753 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45753/8140cac1b7c2375c549787852e38fa6c52b199df/RubyModule.java/clean/org/jruby/RubyModule.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1206,
1305,
12,
780,
508,
13,
288,
3639,
309,
261,
2211,
422,
4170,
10340,
7675,
588,
4818,
7675,
588,
921,
797,
10756,
288,
5411,
4170,
10340,
7675,
8869,
12,
24,
1769,
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,
918,
1206,
1305,
12,
780,
508,
13,
288,
3639,
309,
261,
2211,
422,
4170,
10340,
7675,
588,
4818,
7675,
588,
921,
797,
10756,
288,
5411,
4170,
10340,
7675,
8869,
12,
24,
1769,
3639,
... |
InvalidObjectException(String message) { super(message); } | public InvalidObjectException(String message) { super(message); } | InvalidObjectException(String message){ super(message);} | 47947 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47947/a3f60f71365174676e1302f0b201f5772849ffd3/InvalidObjectException.java/buggy/java/io/InvalidObjectException.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
17354,
503,
12,
780,
883,
15329,
225,
2240,
12,
2150,
1769,
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,
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,
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
17354,
503,
12,
780,
883,
15329,
225,
2240,
12,
2150,
1769,
97,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
} catch (Exception x) { fXalanProperties = null; fLastModified = -1; } | } catch (Exception x) { fXalanProperties = null; fLastModified = -1; } finally { if (fis != null) { try { fis.close(); } catch (IOException exc) {} } } | static String lookUpFactoryClassName(String factoryId, String propertiesFilename, String fallbackClassName) { SecuritySupport ss = SecuritySupport.getInstance(); // Use the system property first try { String systemProp = ss.getSystemProperty(factoryId); if (systemProp != null) { debugPrintln("found system property, value=" + systemProp); return systemProp; } } catch (SecurityException se) { // Ignore and continue w/ next location } // Try to read from propertiesFilename, or // $java.home/lib/xalan.properties String factoryClassName = null; // no properties file name specified; use // $JAVA_HOME/lib/xalan.properties: if (propertiesFilename == null) { File propertiesFile = null; boolean propertiesFileExists = false; try { String javah = ss.getSystemProperty("java.home"); propertiesFilename = javah + File.separator + "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME; propertiesFile = new File(propertiesFilename); propertiesFileExists = ss.getFileExists(propertiesFile); } catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; } synchronized (ObjectFactory.class) { boolean loadProperties = false; try { // file existed last time if(fLastModified >= 0) { if(propertiesFileExists && (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) { loadProperties = true; } else { // file has stopped existing... if(!propertiesFileExists) { fLastModified = -1; fXalanProperties = null; } // else, file wasn't modified! } } else { // file has started to exist: if(propertiesFileExists) { loadProperties = true; fLastModified = ss.getLastModified(propertiesFile); } // else, nothing's changed } if(loadProperties) { // must never have attempted to read xalan.properties // before (or it's outdeated) fXalanProperties = new Properties(); FileInputStream fis = ss.getFileInputStream(propertiesFile); fXalanProperties.load(fis); fis.close(); } } catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location } } if(fXalanProperties != null) { factoryClassName = fXalanProperties.getProperty(factoryId); } } else { try { FileInputStream fis = ss.getFileInputStream(new File(propertiesFilename)); Properties props = new Properties(); props.load(fis); fis.close(); factoryClassName = props.getProperty(factoryId); } catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location } } if (factoryClassName != null) { debugPrintln("found in " + propertiesFilename + ", value=" + factoryClassName); return factoryClassName; } // Try Jar Service Provider Mechanism return findJarServiceProviderName(factoryId); } // lookUpFactoryClass(String,String):String | 2723 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2723/8715306de914fc3a40ff4ab45e0b32a46907ce9a/ObjectFactory.java/clean/src/org/apache/xml/dtm/ref/ObjectFactory.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
760,
514,
2324,
1211,
1733,
3834,
12,
780,
3272,
548,
16,
4766,
7734,
514,
1790,
5359,
16,
4766,
7734,
514,
5922,
3834,
13,
565,
288,
3639,
6036,
6289,
5202,
273,
6036,
6289,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
760,
514,
2324,
1211,
1733,
3834,
12,
780,
3272,
548,
16,
4766,
7734,
514,
1790,
5359,
16,
4766,
7734,
514,
5922,
3834,
13,
565,
288,
3639,
6036,
6289,
5202,
273,
6036,
6289,
18,
588,
1... |
if (prefix != null && prefix.length() > 0) | if (prefix != null && prefix.length() > 0) { | public void startElement( String namespaceURI, String localName, String rawName, Attributes attrs ) throws SAXException { int i; boolean preserveSpace; ElementState state; String name; String value; boolean addNSAttr = false; if (DEBUG) { System.out.println("==>startElement("+namespaceURI+","+localName+ ","+rawName+")"); } try { if (_printer == null) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN, "NoWriterSupplied", null); throw new IllegalStateException(msg); } state = getElementState(); if (isDocumentState()) { // If this is the root element handle it differently. // If the first root element in the document, serialize // the document's DOCTYPE. Space preserving defaults // to that of the output format. if (! _started) startDocument( ( localName == null || localName.length() == 0 ) ? rawName : localName ); } else { // For any other element, if first in parent, then // close parent's opening tag and use the parnet's // space preserving. if (state.empty) _printer.printText( '>' ); // Must leave CData section first if (state.inCData) { _printer.printText( "]]>" ); state.inCData = false; } // Indent this element on a new line if the first // content of the parent element or immediately // following an element or a comment if (_indenting && ! state.preserveSpace && ( state.empty || state.afterElement || state.afterComment)) _printer.breakLine(); } preserveSpace = state.preserveSpace; //We remove the namespaces from the attributes list so that they will //be in _prefixes attrs = extractNamespaces(attrs); // Do not change the current element state yet. // This only happens in endElement(). if (rawName == null || rawName.length() == 0) { if (localName == null) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN, "NoName", null); throw new SAXException(msg); } if (namespaceURI != null && ! namespaceURI.equals( "" )) { String prefix; prefix = getPrefix( namespaceURI ); if (prefix != null && prefix.length() > 0) rawName = prefix + ":" + localName; else rawName = localName; } else rawName = localName; addNSAttr = true; } _printer.printText( '<' ); _printer.printText( rawName ); _printer.indent(); // For each attribute print it's name and value as one part, // separated with a space so the element can be broken on // multiple lines. if (attrs != null) { for (i = 0 ; i < attrs.getLength() ; ++i) { _printer.printSpace(); name = attrs.getQName( i ); if (name != null && name.length() == 0) { String prefix; String attrURI; name = attrs.getLocalName( i ); attrURI = attrs.getURI( i ); if (( attrURI != null && attrURI.length() != 0 ) && ( namespaceURI == null || namespaceURI.length() == 0 || ! attrURI.equals( namespaceURI ) )) { prefix = getPrefix( attrURI ); if (prefix != null && prefix.length() > 0) name = prefix + ":" + name; } } value = attrs.getValue( i ); if (value == null) value = ""; _printer.printText( name ); _printer.printText( "=\"" ); printEscaped( value ); _printer.printText( '"' ); // If the attribute xml:space exists, determine whether // to preserve spaces in this and child nodes based on // its value. if (name.equals( "xml:space" )) { if (value.equals( "preserve" )) preserveSpace = true; else preserveSpace = _format.getPreserveSpace(); } } } if (_prefixes != null) { Enumeration keys; keys = _prefixes.keys(); while (keys.hasMoreElements()) { _printer.printSpace(); value = (String) keys.nextElement(); name = (String) _prefixes.get( value ); if (name.length() == 0) { _printer.printText( "xmlns=\"" ); printEscaped( value ); _printer.printText( '"' ); } else { _printer.printText( "xmlns:" ); _printer.printText( name ); _printer.printText( "=\"" ); printEscaped( value ); _printer.printText( '"' ); } } } // Now it's time to enter a new element state // with the tag name and space preserving. // We still do not change the curent element state. state = enterElementState( namespaceURI, localName, rawName, preserveSpace ); name = ( localName == null || localName.length() == 0 ) ? rawName : namespaceURI + "^" + localName; state.doCData = _format.isCDataElement( name ); state.unescaped = _format.isNonEscapingElement( name ); } catch (IOException except) { throw new SAXException( except ); } } | 6373 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6373/c3a4eb4927577396ea5dda8c1cd944a3ee382d8c/XMLSerializer.java/buggy/src/org/apache/xml/serialize/XMLSerializer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
13591,
12,
514,
19421,
16,
514,
11927,
16,
17311,
514,
1831,
461,
16,
9055,
3422,
262,
565,
1216,
14366,
565,
288,
3639,
509,
1850,
277,
31,
3639,
1250,
1377,
9420,
3819,
31,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
514,
19421,
16,
514,
11927,
16,
17311,
514,
1831,
461,
16,
9055,
3422,
262,
565,
1216,
14366,
565,
288,
3639,
509,
1850,
277,
31,
3639,
1250,
1377,
9420,
3819,
31,
... |
public void showSettingsDialog() { SettingsDialog dlg = new SettingsDialog(this); dlg.centerAndShow(); //<<<<<<< MainFrame.java// if (Settings.settingHasChanged(new String[]{"font.programtitle","font.programinfo","font.programtime","font.channelname","usedefaultfonts"})) {// util.ui.ProgramPanel.updateFonts();// tvbrowser.ui.programtable.ChannelPanel.fontChanged();// mProgramTableScrollPane.getProgramTable().fontChanged();// mProgramTableScrollPane.tableDataChanged();// mProgramTableScrollPane.getProgramTable().tableDataChanged();// }// if (Settings.settingHasChanged(new String[]{"lookandfeel","skinLF.themepack","skinLF.enabled"})) {// TVBrowser.updateLookAndFeel();// }// if (Settings.settingHasChanged(new String[]{"applicationskin","useapplicationskin"})) {// updateApplicationSkin();// }// if (Settings.settingHasChanged(new String[]{"table.layout"})) {// mProgramTableScrollPane.getProgramTable().setProgramTableLayout(null);// }// if (Settings.settingHasChanged( new String[] {// "timebutton.early", "timebutton.midday", "timebutton.afternoon",// "timebutton.evening",// "tablebackground.edge", "tablebackground.early",// "tablebackground.midday", "tablebackground.afternoon",// "tablebackground.evening" } ))// {// mProgramTableScrollPane.getProgramTable().updateBackground();// }// // if (Settings.settingHasChanged(new String[]{"updatebutton","preferencesbutton",// "buttontype" /*,"plugins"*/})) {// mDefaultToolBar.updateButtons();// }// // if (Settings.settingHasChanged(new String[]{"timebutton"})) {// mDateTimeToolBar.updateButtons();// }// if (Settings.settingHasChanged(new String[]{"subscribedchannels"})) {// onSubscribedChannelsChanged();// }// // if (Settings.settingHasChanged(new String[]{"programtable.endofday","programtable.startofday"})) {// mProgramTableModel.setTimeRange(Settings.getProgramTableStartOfDay(),Settings.getProgramTableEndOfDay());// }// // if (Settings.settingHasChanged(new String[]{"columnwidth"})) {// util.ui.ProgramPanel.updateColumnWidth();// mProgramTableScrollPane.setColumnWidth(Settings.getColumnWidth());// mProgramTableScrollPane.updateChannelPanel();// mProgramTableScrollPane.getProgramTable().updateLayout();// }//// if (Settings.settingHasChanged(new String[]{"programpanel.iconPlugins","programpanel.infoFields"})) {// // Force a recreation of the table content// mProgramTableModel.setDate(finderPanel.getSelectedDate(),null);// }// }// // public void onSubscribedChannelsChanged() {// ChannelList.create(); // mProgramTableModel.setChannels(ChannelList.getSubscribedChannels());// mDefaultToolBar.updateChannelChooser(); //======= Settings.handleChangedSettings();////>>>>>>> 1.30 } | 9266 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/9266/48f55971f4508f02630d666151f0e39b7b494590/MainFrame.java/buggy/tvbrowser/src/tvbrowser/ui/mainframe/MainFrame.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
6459,
4500,
2628,
6353,
1435,
95,
2628,
6353,
5761,
75,
33,
2704,
2628,
6353,
12,
2211,
1769,
5761,
75,
18,
5693,
1876,
5706,
5621,
759,
17685,
17685,
17685,
32,
6376,
3219,
18,
6290,
75... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1071,
6459,
4500,
2628,
6353,
1435,
95,
2628,
6353,
5761,
75,
33,
2704,
2628,
6353,
12,
2211,
1769,
5761,
75,
18,
5693,
1876,
5706,
5621,
759,
17685,
17685,
17685,
32,
6376,
3219,
18,
6290,
75... | ||
private DataModelPropertyDescriptor[] getEARPropertyDescriptor(int j2eeVersion){ StructureEdit mc = null; | private DataModelPropertyDescriptor[] getEARPropertyDescriptor(int j2eeVersion){ | private DataModelPropertyDescriptor[] getEARPropertyDescriptor(int j2eeVersion){ StructureEdit mc = null; ArrayList earDescriptorList = new ArrayList(); IProject[] projs = ProjectUtilities.getAllProjects(); for( int index=0; index< projs.length; index++){ IProject flexProject = projs[index]; try { if(flexProject != null) { mc = StructureEdit.getStructureEditForRead(flexProject); if( mc != null ){ WorkbenchComponent[] components = mc.getWorkbenchModules(); int earVersion = 0; for (int i = 0; i < components.length; i++) { EARArtifactEdit earArtifactEdit = null; try { WorkbenchComponent wc = components[i]; if(wc.getComponentType() != null && wc.getComponentType().getComponentTypeId().equals(IModuleConstants.JST_EAR_MODULE)) { ComponentHandle handle = ComponentHandle.create(flexProject,wc.getName()); earArtifactEdit = EARArtifactEdit.getEARArtifactEditForRead(handle); if(j2eeVersion <= earArtifactEdit.getJ2EEVersion()){ WTPPropertyDescriptor desc = new WTPPropertyDescriptor(wc.getHandle().toString(), wc.getName()); earDescriptorList.add(desc); } } } finally { if(earArtifactEdit != null) earArtifactEdit.dispose(); } } } } } finally { if(mc != null) mc.dispose(); } } DataModelPropertyDescriptor[] descriptors = new DataModelPropertyDescriptor[earDescriptorList.size()]; for (int i = 0; i < descriptors.length; i++) { WTPPropertyDescriptor desc = (WTPPropertyDescriptor)earDescriptorList.get(i); descriptors[i] = new DataModelPropertyDescriptor(desc.getPropertyDescription(), desc.getPropertyDescription()); } return descriptors; } | 8196 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8196/98a4d03759b45f225d9db5c3824d3a75c9dd52bb/J2EEComponentCreationDataModelProvider.java/buggy/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/application/internal/operations/J2EEComponentCreationDataModelProvider.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3196,
3238,
1910,
1488,
1396,
3187,
8526,
4774,
985,
1396,
3187,
12,
474,
525,
22,
1340,
1444,
15329,
202,
4697,
13348,
4666,
6108,
273,
446,
31,
1082,
2407,
6897,
3187,
682,
273,
394,
2407,
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,
3196,
3238,
1910,
1488,
1396,
3187,
8526,
4774,
985,
1396,
3187,
12,
474,
525,
22,
1340,
1444,
15329,
202,
4697,
13348,
4666,
6108,
273,
446,
31,
1082,
2407,
6897,
3187,
682,
273,
394,
2407,
5... |
oldFile.renameTo(new NormalizedFile(newNameString.getValue())); | oldFile.renameTo(new NormalizedFile(newNameString.toString())); | public IRubyObject rename(IRubyObject oldName, IRubyObject newName) { RubyString oldNameString = RubyString.stringValue(oldName); RubyString newNameString = RubyString.stringValue(newName); oldNameString.checkSafeString(); newNameString.checkSafeString(); NormalizedFile oldFile = new NormalizedFile(oldNameString.getValue()); if (!oldFile.exists()) { throw getRuntime().newErrnoENOENTError("No such file: " + oldNameString.getValue()); } oldFile.renameTo(new NormalizedFile(newNameString.getValue())); return RubyFixnum.zero(getRuntime()); } | 52337 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52337/9f2efc63a858fa0507245b207025eab027840a04/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
15908,
10340,
921,
6472,
12,
7937,
10340,
921,
22916,
16,
15908,
10340,
921,
13253,
13,
288,
377,
202,
54,
10340,
780,
22916,
780,
273,
19817,
780,
18,
1080,
620,
12,
1673,
461,
176... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6472,
12,
7937,
10340,
921,
22916,
16,
15908,
10340,
921,
13253,
13,
288,
377,
202,
54,
10340,
780,
22916,
780,
273,
19817,
780,
18,
1080,
620,
12,
1673,
461,
176... |
buf.append("<log4j:NDC>"); | buf.append("<log4j:NDC><![CDATA["); | String format(LoggingEvent event) { // Reset working buffer. If the buffer is too large, then we need a new // one in order to avoid the penalty of creating a large array. if(buf.capacity() > UPPER_LIMIT) { buf = new StringBuffer(DEFAULT_SIZE); } else { buf.setLength(0); } // We yield to the \r\n heresy. buf.append("<log4j:event category=\""); buf.append(event.categoryName); buf.append("\" timestamp=\""); buf.append(event.timeStamp); buf.append("\" priority=\""); buf.append(event.priority); buf.append("\" thread=\""); buf.append(event.getThreadName()); buf.append("\">\r\n"); buf.append("<log4j:message>"); buf.append(event.getRenderedMessage()); buf.append("</log4j:message>\r\n"); String ndc = event.getNDC(); if(ndc != null) { buf.append("<log4j:NDC>"); buf.append(ndc); buf.append("</log4j:NDC>\r\n"); } String t = event.getThrowableInformation(); if(t != null) { buf.append("<log4j:throwable>"); buf.append(t); buf.append("</log4j:throwable>\r\n"); } if(locationInfo) { LocationInfo locationInfo = event.getLocationInformation(); buf.append("<log4j:locationInfo class=\""); buf.append(locationInfo.getClassName()); buf.append("\" method=\""); buf.append(locationInfo.getMethodName()); buf.append("\" file=\""); buf.append(locationInfo.getFileName()); buf.append("\" line=\""); buf.append(locationInfo.getLineNumber()); buf.append("\"/>\r\n"); } buf.append("</log4j:event>\r\n\r\n"); return buf.toString(); } | 45952 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45952/8cd5834b33ba7aac0e4ba149c67ed9d4249b7c4f/XMLLayout.java/clean/src/java/org/apache/log4j/xml/XMLLayout.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
514,
740,
12,
7735,
1133,
871,
13,
288,
565,
368,
7151,
5960,
1613,
18,
971,
326,
1613,
353,
4885,
7876,
16,
1508,
732,
1608,
279,
394,
565,
368,
1245,
316,
1353,
358,
4543,
326,
23862,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
514,
740,
12,
7735,
1133,
871,
13,
288,
565,
368,
7151,
5960,
1613,
18,
971,
326,
1613,
353,
4885,
7876,
16,
1508,
732,
1608,
279,
394,
565,
368,
1245,
316,
1353,
358,
4543,
326,
23862,... |
addByteCode(ALOAD_CONTEXT); addByteCode(ALOAD_SCOPE); push(scriptOrFn.getRegexpString(i)); | cfw.add(ALOAD_CONTEXT); cfw.add(ALOAD_SCOPE); cfw.addPush(scriptOrFn.getRegexpString(i)); | private void generateInit(Context cx, String superClassName) { String methodName = (inFunction) ? "<init>" : "initScript"; classFile.startMethod(methodName, "(Lorg/mozilla/javascript/Scriptable;" +"Lorg/mozilla/javascript/Context;)V", ClassFileWriter.ACC_PUBLIC); final byte ALOAD_SCOPE = ByteCode.ALOAD_1; final byte ALOAD_CONTEXT = ByteCode.ALOAD_2; if (inFunction) { addByteCode(ByteCode.ALOAD_0); addSpecialInvoke(superClassName, "<init>", "()V"); addByteCode(ByteCode.ALOAD_0); addByteCode(ALOAD_SCOPE); classFile.add(ByteCode.PUTFIELD, "org/mozilla/javascript/ScriptableObject", "parent", "Lorg/mozilla/javascript/Scriptable;"); /* * Generate code to initialize functionName field with the name * of the function. */ String name = fnCurrent.getFunctionName(); if (name.length() != 0) { addByteCode(ByteCode.ALOAD_0); classFile.addLoadConstant(name); classFile.add(ByteCode.PUTFIELD, "org/mozilla/javascript/NativeFunction", "functionName", "Ljava/lang/String;"); } } /* * Generate code to initialize argNames string array with the names * of the parameters and the vars. Initialize argCount * to the number of formal parameters. */ int N = scriptOrFn.getParamAndVarCount(); if (N != 0) { push(N); addByteCode(ByteCode.ANEWARRAY, "java/lang/String"); for (int i = 0; i != N; i++) { addByteCode(ByteCode.DUP); push(i); push(scriptOrFn.getParamOrVarName(i)); addByteCode(ByteCode.AASTORE); } addByteCode(ByteCode.ALOAD_0); addByteCode(ByteCode.SWAP); classFile.add(ByteCode.PUTFIELD, "org/mozilla/javascript/NativeFunction", "argNames", "[Ljava/lang/String;"); } int parmCount = scriptOrFn.getParamCount(); if (parmCount != 0) { if (!inFunction) Context.codeBug(); addByteCode(ByteCode.ALOAD_0); push(parmCount); classFile.add(ByteCode.PUTFIELD, "org/mozilla/javascript/NativeFunction", "argCount", "S"); } // Initialize NativeFunction.version with Context's version. if (cx.getLanguageVersion() != 0) { addByteCode(ByteCode.ALOAD_0); push(cx.getLanguageVersion()); classFile.add(ByteCode.PUTFIELD, "org/mozilla/javascript/NativeFunction", "version", "S"); } // precompile all regexp literals int regexpCount = scriptOrFn.getRegexpCount(); if (regexpCount != 0) { for (int i = 0; i != regexpCount; ++i) { String fieldName = getRegexpFieldName(i); short flags = ClassFileWriter.ACC_PRIVATE; if (inFunction) { flags |= ClassFileWriter.ACC_FINAL; } classFile.addField( fieldName, "Lorg/mozilla/javascript/regexp/NativeRegExp;", flags); addByteCode(ByteCode.ALOAD_0); // load 'this' addByteCode(ByteCode.NEW, "org/mozilla/javascript/regexp/NativeRegExp"); addByteCode(ByteCode.DUP); addByteCode(ALOAD_CONTEXT); addByteCode(ALOAD_SCOPE); push(scriptOrFn.getRegexpString(i)); String regexpFlags = scriptOrFn.getRegexpFlags(i); if (regexpFlags == null) { addByteCode(ByteCode.ACONST_NULL); } else { push(regexpFlags); } push(0); addSpecialInvoke("org/mozilla/javascript/regexp/NativeRegExp", "<init>", "(Lorg/mozilla/javascript/Context;" +"Lorg/mozilla/javascript/Scriptable;" +"Ljava/lang/String;Ljava/lang/String;" +"Z" +")V"); classFile.add(ByteCode.PUTFIELD, generatedClassName, fieldName, "Lorg/mozilla/javascript/regexp/NativeRegExp;"); } } classFile.addField(MAIN_SCRIPT_FIELD, mainCodegen.generatedClassSignature, (short)0); // For top level script or function init scriptMaster to self if (isMainCodegen) { addByteCode(ByteCode.ALOAD_0); addByteCode(ByteCode.DUP); classFile.add(ByteCode.PUTFIELD, generatedClassName, MAIN_SCRIPT_FIELD, mainCodegen.generatedClassSignature); } addByteCode(ByteCode.RETURN); // 3 = this + scope + context classFile.stopMethod((short)3, null); // Add static method to return encoded source tree for decompilation // which will be called from OptFunction/OptScrript.getSourcesTree // via reflection. See NativeFunction.getSourcesTree for documentation. // Note that nested function decompilation currently depends on the // elements of the fns array being defined in source order. // (per function/script, starting from 0.) // Change Parser if changing ordering. if (mainCodegen.encodedSource != null) { // Override NativeFunction.getEncodedSourceg() with // public String getEncodedSource() // { // return main_class.getEncodedSourceImpl(START, END); // } short flags = ClassFileWriter.ACC_PUBLIC | ClassFileWriter.ACC_STATIC; String getSourceMethodStr = "getEncodedSourceImpl"; String mainImplSig = "(II)Ljava/lang/String;"; classFile.startMethod("getEncodedSource", "()Ljava/lang/Object;", ClassFileWriter.ACC_PUBLIC); push(scriptOrFn.getEncodedSourceStart()); push(scriptOrFn.getEncodedSourceEnd()); classFile.addInvoke(ByteCode.INVOKESTATIC, mainCodegen.generatedClassName, getSourceMethodStr, mainImplSig); addByteCode(ByteCode.ARETURN); // 1: this and no argument or locals classFile.stopMethod((short)1, null); if (isMainCodegen) { // generate // public static String getEncodedSourceImpl(int start, int end) // { // return ENCODED.substring(start, end); // } classFile.startMethod(getSourceMethodStr, mainImplSig, (short)flags); push(encodedSource); addByteCode(ByteCode.ILOAD_0); addByteCode(ByteCode.ILOAD_1); classFile.addInvoke(ByteCode.INVOKEVIRTUAL, "java/lang/String", "substring", "(II)Ljava/lang/String;"); addByteCode(ByteCode.ARETURN); classFile.stopMethod((short)2, null); } } } | 12376 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12376/bd2594e6ebd6d8099b587934641c8f7650d87761/Codegen.java/clean/js/rhino/src/org/mozilla/javascript/optimizer/Codegen.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
2103,
2570,
12,
1042,
9494,
16,
514,
2240,
3834,
13,
565,
288,
3639,
514,
4918,
273,
261,
267,
2083,
13,
692,
3532,
2738,
2984,
294,
225,
315,
2738,
3651,
14432,
3639,
29728,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2103,
2570,
12,
1042,
9494,
16,
514,
2240,
3834,
13,
565,
288,
3639,
514,
4918,
273,
261,
267,
2083,
13,
692,
3532,
2738,
2984,
294,
225,
315,
2738,
3651,
14432,
3639,
29728,
... |
DialogUtils.openFilteredClassesDialog(IC2DFrame.this, ic2dPanel, activeObjectFilter); | DialogUtils.openNewGlobusHostDialog((java.awt.Component) IC2DFrame.this, ic2dObject.getWorldObject(), logger); | public void actionPerformed(java.awt.event.ActionEvent e) { DialogUtils.openFilteredClassesDialog(IC2DFrame.this, ic2dPanel, activeObjectFilter); } | 58694 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58694/5e6860c26fe200ecc080f3ddc3de5b5afad88243/IC2DFrame.java/clean/src/org/objectweb/proactive/ic2d/gui/IC2DFrame.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
1071,
918,
26100,
12,
6290,
18,
2219,
88,
18,
2575,
18,
1803,
1133,
425,
13,
288,
1850,
17242,
1989,
18,
3190,
1908,
13499,
407,
2594,
6353,
12443,
6290,
18,
2219,
88,
18,
1841,
13,
268... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
540,
1071,
918,
26100,
12,
6290,
18,
2219,
88,
18,
2575,
18,
1803,
1133,
425,
13,
288,
1850,
17242,
1989,
18,
3190,
1908,
13499,
407,
2594,
6353,
12443,
6290,
18,
2219,
88,
18,
1841,
13,
268... |
runExit(); | addWindow(false); | public void actionPerformed(ActionEvent e) { runExit(); } | 6495 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6495/0afd53cb292d371c562aac7bb0e162ee2ff40bac/JRefract.java/clean/src/demos/jrefract/JRefract.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
1071,
918,
26100,
12,
1803,
1133,
425,
13,
288,
1850,
527,
3829,
12,
5743,
1769,
3639,
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,... | [
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
1071,
918,
26100,
12,
1803,
1133,
425,
13,
288,
1850,
527,
3829,
12,
5743,
1769,
3639,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
public AnyViewParameters handle() { final String actionmethod = PostDecoder.decodeAction(normalizedmap); try { // Do this FIRST in case it discovers any scopelocks required presmanager.scopeRestore(); // invoke all state-altering operations within the runnable wrapper. postwrapper.invokeRunnable(new Runnable() { public void run() { if (viewparams.flowtoken != null) { presmanager.restore(viewparams.flowtoken, viewparams.endflow != null); } Exception exception = null; try { rsvcapplier.applyValues(requestrsvc); // many errors possible here. } catch (Exception e) { exception = e; } Object newcode = handleError(actionresult, exception); exception = null; if ((newcode == null && !messages.isError()) || newcode instanceof String) { // only proceed to actually invoke action if no ARIResult already // note all this odd two-step procedure is only required to be able // to pass AES error returns and make them "appear" to be the // returns of the first action method in a Flow. try { if (actionmethod != null) { actionresult = rsvcapplier.invokeAction(actionmethod, (String) newcode); } } catch (Exception e) { exception = e; } newcode = handleError(actionresult, exception); } if (newcode != null) actionresult = newcode; // must interpret ARI INSIDE the wrapper, since it may need it // on closure. if (actionresult instanceof ARIResult) { ariresult = (ARIResult) actionresult; } else { ActionResultInterpreter ari = ariresolver .getActionResultInterpreter(); ariresult = ari.interpretActionResult(viewparams, actionresult); } } }); presmanager.scopePreserve(); flowstatemanager.inferFlowState(viewparams, ariresult); // moved inside since this may itself cause an error! String submitting = PostDecoder.decodeSubmittingControl(normalizedmap); errorstatemanager.globaltargetid = submitting; } catch (Throwable e) { // avoid masking errors from the finally block Logger.log.error("Error invoking action", e); // ThreadErrorState.addError(new TargettedMessage( // CoreMessages.GENERAL_ACTION_ERROR)); // Detect failure to fill out arires properly. if (ariresult == null || ariresult.resultingview == null || e instanceof IllegalStateException) { ariresult = new ARIResult(); ariresult.propagatebeans = ARIResult.FLOW_END; ViewParameters defaultparameters = viewparams.copyBase(); ariresult.resultingview = defaultparameters; } } finally { String errortoken = errorstatemanager.requestComplete(); if (ariresult.resultingview instanceof ViewParameters) { ((ViewParameters)ariresult.resultingview).errortoken = errortoken; } } return ariresult.resultingview; } | 45809 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45809/25c9cf2aab0f5ad28dc9664b99b6f968cfb227b5/RSFActionHandler.java/buggy/src/uk/org/ponder/rsf/processor/RSFActionHandler.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
5502,
1767,
2402,
1640,
1435,
288,
565,
727,
514,
1301,
2039,
273,
5616,
7975,
18,
3922,
1803,
12,
17762,
1458,
1769,
565,
775,
288,
1377,
368,
2256,
333,
21786,
316,
648,
518,
1015... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5502,
1767,
2402,
1640,
1435,
288,
565,
727,
514,
1301,
2039,
273,
5616,
7975,
18,
3922,
1803,
12,
17762,
1458,
1769,
565,
775,
288,
1377,
368,
2256,
333,
21786,
316,
648,
518,
1015... | ||
public static int calculateIndexFlags(DOMSourceIndexerRunner indexer, IASTName name) { int fileNum= 0; //Initialize the file number to be the file number for the file that triggerd //the indexing. Note that we should always be able to get a number for this as //the first step in the Source Indexer is to add the file being indexed to the index //which actually creates an entry for the file in the index. IndexedFile mainIndexFile = indexer.getOutput().getIndexedFile( indexer.getResourceFile().getFullPath().toString()); if (mainIndexFile != null) fileNum = mainIndexFile.getFileNumber(); String fileName = null; IASTNodeLocation[] nameLocations = name.getNodeLocations(); if (nameLocations.length > 0) { if (nameLocations[0] instanceof IASTFileLocation) { fileName = ((IASTFileLocation) nameLocations[0]).getFileName(); } } if (fileName != null) { //We are not in the file that has triggered the index. Thus, we need to find the //file number for the current file (if it has one). If the current file does not //have a file number, we need to add it to the index. IFile tempFile = CCorePlugin.getWorkspace().getRoot().getFileForLocation(new Path(fileName)); String filePath = ""; //$NON-NLS-1$ if (tempFile != null){ //File is local to workspace filePath = tempFile.getFullPath().toString(); } else{ //File is external to workspace filePath = fileName; } if (!tempFile.equals(indexer.getResourceFile())) { IndexedFile indFile = indexer.getOutput().getIndexedFile(filePath); if (indFile != null){ fileNum = indFile.getFileNumber(); } else { //Need to add file to index if (tempFile != null){ indFile = indexer.getOutput().addSecondaryIndexedFile(new IFileDocument(tempFile)); if (indFile != null) fileNum = indFile.getFileNumber(); } else { indFile = indexer.getOutput().addSecondaryExternalIndexedFile(fileName); if (indFile != null) fileNum = indFile.getFileNumber(); } } } } return fileNum; } | 54911 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54911/0861c2c64f3a8c8a9fbe0095e9e7d23b7b5e393a/IndexEncoderUtil.java/buggy/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/domsourceindexer/IndexEncoderUtil.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
1071,
760,
509,
4604,
1016,
5094,
12,
8168,
1830,
20877,
9709,
12635,
16,
467,
9053,
461,
508,
13,
288,
225,
509,
585,
2578,
33,
374,
31,
368,
7520,
326,
585,
1300,
358,
506,
326,
585,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1071,
760,
509,
4604,
1016,
5094,
12,
8168,
1830,
20877,
9709,
12635,
16,
467,
9053,
461,
508,
13,
288,
225,
509,
585,
2578,
33,
374,
31,
368,
7520,
326,
585,
1300,
358,
506,
326,
585,
... | ||
FileOutputStream fos = new FileOutputStream( out ); | FileOutputStream fos = new FileOutputStream( targetFile ); | private void copyFile( String in, String out ) throws IOException { FileInputStream fis = new FileInputStream( in ); FileOutputStream fos = new FileOutputStream( out ); byte[] buf = new byte[1024]; int i = 0; while ( ( i = fis.read( buf ) ) != -1 ) { fos.write( buf, 0, i ); } fis.close( ); fos.close( ); } | 12803 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12803/d9c026475d406cc76006703b6d255b0152b0642c/PublishTemplateWizard.java/buggy/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/wizards/PublishTemplateWizard.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
26955,
12,
514,
316,
16,
514,
596,
262,
1216,
1860,
202,
95,
202,
202,
812,
4348,
15324,
273,
394,
11907,
12,
316,
11272,
202,
202,
812,
4632,
17615,
273,
394,
12942,
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,
225,
202,
1152,
918,
26955,
12,
514,
316,
16,
514,
596,
262,
1216,
1860,
202,
95,
202,
202,
812,
4348,
15324,
273,
394,
11907,
12,
316,
11272,
202,
202,
812,
4632,
17615,
273,
394,
12942,
12... |
associationList.remove(association); | list.remove(association); | public static void removeAssociation (Association association) { associationList.remove(association); } | 10434 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/10434/2eea1f87beb40bf1d937c69562df6caeeb6a24cb/ClassWriter.java/buggy/trunk/src/verifier/ClassWriter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
1071,
760,
918,
1206,
7174,
261,
7174,
6384,
13,
225,
288,
2868,
666,
18,
4479,
12,
19358,
1769,
3639,
289,
377,
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,
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,
540,
1071,
760,
918,
1206,
7174,
261,
7174,
6384,
13,
225,
288,
2868,
666,
18,
4479,
12,
19358,
1769,
3639,
289,
377,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if ( folderId != null ){ ALFolder aln = (ALFolder)layout.get(folderId); if (aln != null && (folderId.equals(aln.getNextNodeId()) || folderId.equals(aln.getPreviousNodeId()) || folderId.equals(aln.getParentNodeId())) ){ throw new RuntimeException( "corrupted layout detected, node: "+folderId +" " + "layout:"+layout); } return aln; } return null; } | if ( folderId != null ){ ALFolder aln = (ALFolder)layout.get(folderId); if (aln != null && (folderId.equals(aln.getNextNodeId()) || folderId.equals(aln.getPreviousNodeId()) || folderId.equals(aln.getParentNodeId())) ){ throw new RuntimeException( "corrupted layout detected, node: "+folderId +" " + "layout:"+layout); } return aln; } return null; } | public ALFolder getLayoutFolder(String folderId) { if ( folderId != null ){ ALFolder aln = (ALFolder)layout.get(folderId); if (aln != null && (folderId.equals(aln.getNextNodeId()) || folderId.equals(aln.getPreviousNodeId()) || folderId.equals(aln.getParentNodeId())) ){ throw new RuntimeException( "corrupted layout detected, node: "+folderId +" " + "layout:"+layout); } return aln; } return null; } | 24959 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/24959/a70ada928fe06bf9bc2b55f2f32208ea99e82cb6/AggregatedLayout.java/buggy/source/org/jasig/portal/layout/alm/AggregatedLayout.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
7981,
3899,
17670,
3899,
12,
780,
31996,
13,
288,
202,
225,
309,
261,
31996,
480,
446,
262,
95,
1082,
225,
7981,
3899,
23266,
273,
261,
1013,
3899,
13,
6741,
18,
588,
12,
5609,
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,
282,
1071,
7981,
3899,
17670,
3899,
12,
780,
31996,
13,
288,
202,
225,
309,
261,
31996,
480,
446,
262,
95,
1082,
225,
7981,
3899,
23266,
273,
261,
1013,
3899,
13,
6741,
18,
588,
12,
5609,
54... |
fDocumentHandler.characters(fStringBuffer, null); | else { for (int i = 0; i < brackets; i++) { fStringBuffer.append(']'); } fDocumentHandler.characters(fStringBuffer, null); } | protected boolean scanCDATASection(boolean complete) throws IOException, XNIException { // call handler if (fDocumentHandler != null) { fDocumentHandler.startCDATA(null); } while (true) { fStringBuffer.clear(); if (!fEntityScanner.scanData("]]", fStringBuffer)) { if (fDocumentHandler != null && fStringBuffer.length > 0) { fDocumentHandler.characters(fStringBuffer, null); } int brackets = 2; while (fEntityScanner.skipChar(']')) { brackets++; } if (fDocumentHandler != null && brackets > 2) { fStringBuffer.clear(); for (int i = 2; i < brackets; i++) { fStringBuffer.append(']'); } fDocumentHandler.characters(fStringBuffer, null); } if (fEntityScanner.skipChar('>')) { break; } if (fDocumentHandler != null) { fStringBuffer.clear(); fStringBuffer.append("]]"); fDocumentHandler.characters(fStringBuffer, null); } } else { if (fDocumentHandler != null) { fDocumentHandler.characters(fStringBuffer, null); } int c = fEntityScanner.peekChar(); if (c != -1 && isInvalidLiteral(c)) { if (XMLChar.isHighSurrogate(c)) { fStringBuffer.clear(); scanSurrogates(fStringBuffer); if (fDocumentHandler != null) { fDocumentHandler.characters(fStringBuffer, null); } } else { reportFatalError("InvalidCharInCDSect", new Object[]{Integer.toString(c,16)}); fEntityScanner.scanChar(); } } } } fMarkupDepth--; // call handler if (fDocumentHandler != null) { fDocumentHandler.endCDATA(null); } return true; } // scanCDATASection(boolean):boolean | 46079 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46079/996accd04b1ad1bc693db284f058e2025cc39f02/XMLDocumentFragmentScannerImpl.java/buggy/src/org/apache/xerces/impl/XMLDocumentFragmentScannerImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
1250,
4135,
10160,
789,
3033,
794,
12,
6494,
3912,
13,
540,
1216,
1860,
16,
1139,
50,
45,
503,
288,
7734,
368,
745,
1838,
3639,
309,
261,
74,
2519,
1503,
480,
446,
13,
288,
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,
4750,
1250,
4135,
10160,
789,
3033,
794,
12,
6494,
3912,
13,
540,
1216,
1860,
16,
1139,
50,
45,
503,
288,
7734,
368,
745,
1838,
3639,
309,
261,
74,
2519,
1503,
480,
446,
13,
288,
5411,
... |
status = BugzillaOfflineStatus.ERROR; | return BugzillaOfflineStatus.ERROR; | public BugzillaOfflineStatus add(IBugzillaBug entry, boolean saveChosen) throws CoreException { BugzillaOfflineStatus status = BugzillaOfflineStatus.SAVED; try { // check for bug and do a compare int index = -1; if ((index = find(entry.getId())) >= 0) { IBugzillaBug oldBug = list.get(index); if (oldBug instanceof BugReport && entry instanceof BugReport) { //&& !saveChosen CompareConfiguration config = new CompareConfiguration(); config.setLeftEditable(false); config.setRightEditable(false); config.setLeftLabel("Local Bug Report"); config.setRightLabel("Remote Bug Report"); config.setLeftImage(PlatformUI.getWorkbench().getSharedImages().getImage( ISharedImages.IMG_OBJ_ELEMENT)); config.setRightImage(PlatformUI.getWorkbench().getSharedImages().getImage( ISharedImages.IMG_OBJ_ELEMENT)); final BugzillaCompareInput in = new BugzillaCompareInput(config); in.setLeft((BugReport) oldBug); in.setRight((BugReport) entry); in.setTitle("Bug #" + oldBug.getId()); try { in.run(null); // running in new job inside a job causes shell to popup // up, losing focus // PlatformUI.getWorkbench().getProgressService().run(true, // true, in); } catch (InterruptedException x) { // cancelled by user status = BugzillaOfflineStatus.ERROR; } catch (InvocationTargetException x) { BugzillaPlugin.log(x); MessageDialog.openError(null, "Compare Failed", x.getTargetException().getMessage()); status = BugzillaOfflineStatus.ERROR; } if (in.getCompareResult() == null) { status = BugzillaOfflineStatus.SAVED; } else if (oldBug.hasChanges() && saveChosen) { if (!MessageDialog .openQuestion( null, "Update Local Copy", "Local copy of Bug# " + entry.getId() + " Has Changes.\nWould you like to override local changes? Note: if you select No, your added comment will be saved with the updated bug, but all other changes will be lost.")) { ((BugReport) entry).setNewComment(((BugReport) oldBug).getNewComment()); ((BugReport) entry).setHasChanged(true); status = BugzillaOfflineStatus.SAVED_WITH_OUTGOING_CHANGES; //CONFLICT } else { ((BugReport) entry).setHasChanged(false); status = BugzillaOfflineStatus.SAVED; } } else if (oldBug.hasChanges() && !saveChosen) { ((BugReport) entry).setNewComment(((BugReport) oldBug).getNewComment()); ((BugReport) entry).setHasChanged(true); status = BugzillaOfflineStatus.SAVED_WITH_OUTGOING_CHANGES; //.CONFLICT; } else if (!saveChosen) { DiffNode node = (DiffNode) in.getCompareResult(); IDiffElement[] children = node.getChildren(); if (children.length != 0) { for (IDiffElement element : children) { if (((DiffNode) element).getKind() == Differencer.CHANGE) { status = BugzillaOfflineStatus.SAVED_WITH_INCOMMING_CHANGES; break; } } } else { status = BugzillaOfflineStatus.SAVED; // do we ever get here? } } else { status = BugzillaOfflineStatus.SAVED; } // Display.getDefault().asyncExec(new Runnable(){ // public void run() { // // CompareUI.openCompareDialog(in); // } // }); } list.remove(index); } if (entry.hasChanges() && status != BugzillaOfflineStatus.CONFLICT) { status = BugzillaOfflineStatus.SAVED_WITH_OUTGOING_CHANGES; } // add the entry to the list and write the file to disk list.add(entry); writeFile(); BugzillaPlugin.getDefault().fireOfflineStatusChanged(entry, status); } catch (Exception e) { IStatus runtimestatus = new Status(IStatus.ERROR, IBugzillaConstants.PLUGIN_ID, IStatus.OK, "failed to add of offline report", e); throw new CoreException(runtimestatus); } return status; } | 51151 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51151/4d102c7880b3b770508839e9b88f8376a3843982/OfflineReportsFile.java/clean/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/internal/OfflineReportsFile.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
16907,
15990,
23106,
1482,
527,
12,
13450,
637,
15990,
19865,
1241,
16,
1250,
1923,
782,
8918,
13,
1216,
30015,
288,
9506,
202,
19865,
15990,
23106,
1482,
1267,
273,
16907,
15990,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16907,
15990,
23106,
1482,
527,
12,
13450,
637,
15990,
19865,
1241,
16,
1250,
1923,
782,
8918,
13,
1216,
30015,
288,
9506,
202,
19865,
15990,
23106,
1482,
1267,
273,
16907,
15990,
... |
((OptFunctionNode)containingTree) .addDirectCallTarget(theFunction); | private void markDirectCall(Node containingTree, Node callNode, int argCount, String targetName) { OptFunctionNode theFunction = (OptFunctionNode)theFnClassNameList.get(targetName); if (theFunction != null) { int N = theFunction.getParamCount(); // Refuse to directCall any function with more // than 32 parameters - prevent code explosion // for wacky test cases if (N > 32) return; if (argCount == N) { callNode.putProp(Node.DIRECTCALL_PROP, theFunction); ((OptFunctionNode)containingTree) .addDirectCallTarget(theFunction); theFunction.setIsTargetOfDirectCall(); } } } | 13991 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13991/9d6bb8957ead2c95a3562b84a47b63afc8cfc761/OptTransformer.java/clean/js/rhino/src/org/mozilla/javascript/optimizer/OptTransformer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
2267,
5368,
1477,
12,
907,
4191,
2471,
16,
2029,
745,
907,
16,
27573,
509,
1501,
1380,
16,
514,
23395,
13,
565,
288,
3639,
12056,
2083,
907,
326,
2083,
10792,
273,
261,
6179,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2267,
5368,
1477,
12,
907,
4191,
2471,
16,
2029,
745,
907,
16,
27573,
509,
1501,
1380,
16,
514,
23395,
13,
565,
288,
3639,
12056,
2083,
907,
326,
2083,
10792,
273,
261,
6179,
... | |
cfw.add(ByteCode.ALOAD_1); cfw.add(ByteCode.ALOAD_0); cfw.add(ByteCode.INVOKESTATIC, "org/mozilla/javascript/ScriptRuntime", "setAdapterProto", "(Lorg/mozilla/javascript/Scriptable;" + "Ljava/lang/Object;)", "V"); | private static void generateCtor(ClassFileWriter cfw, String adapterName, String superName) { cfw.startMethod("<init>", "(Lorg/mozilla/javascript/Scriptable;)V", ClassFileWriter.ACC_PUBLIC); // Invoke base class constructor cfw.add(ByteCode.ALOAD_0); // this cfw.add(ByteCode.INVOKESPECIAL, superName, "<init>", "()", "V"); // Save parameter in instance variable "self" cfw.add(ByteCode.ALOAD_0); // this cfw.add(ByteCode.ALOAD_1); // first arg cfw.add(ByteCode.PUTFIELD, adapterName, "self", "Lorg/mozilla/javascript/Scriptable;"); // Set the prototype of the js object to be a LiveConnect // wrapper of the generated class's object cfw.add(ByteCode.ALOAD_1); // first arg cfw.add(ByteCode.ALOAD_0); // this cfw.add(ByteCode.INVOKESTATIC, "org/mozilla/javascript/ScriptRuntime", "setAdapterProto", "(Lorg/mozilla/javascript/Scriptable;" + "Ljava/lang/Object;)", "V"); cfw.add(ByteCode.RETURN); cfw.stopMethod((short)20, null); // TODO: magic number "20" } | 12564 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12564/394383a65dd802c3dde5b8a2f99b406cd7527b4f/JavaAdapter.java/clean/org/mozilla/javascript/JavaAdapter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
760,
918,
2103,
27425,
12,
797,
812,
2289,
6080,
91,
16,
514,
4516,
461,
16,
4766,
1377,
514,
2240,
461,
13,
377,
288,
3639,
6080,
91,
18,
1937,
1305,
2932,
32,
2738,
2984,
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,
3238,
760,
918,
2103,
27425,
12,
797,
812,
2289,
6080,
91,
16,
514,
4516,
461,
16,
4766,
1377,
514,
2240,
461,
13,
377,
288,
3639,
6080,
91,
18,
1937,
1305,
2932,
32,
2738,
2984,
16,
... | |
public void testBasic() throws JoranException { ListenAction listenAction = new ListenAction(); rulesMap.put(new Pattern("fire"), listenAction); TrivialConfigurator gc = new TrivialConfigurator(rulesMap); gc.setContext(context); gc.doConfigure(Constants.TEST_DIR_PREFIX + "input/joran/fire1.xml"); for(SaxEvent se: listenAction.getSeList()) { System.out.println(se); } assertEquals(5, listenAction.getSeList().size()); assertTrue(listenAction.getSeList().get(0) instanceof StartEvent); assertTrue(listenAction.getSeList().get(1) instanceof StartEvent); assertTrue(listenAction.getSeList().get(2) instanceof BodyEvent); assertTrue(listenAction.getSeList().get(3) instanceof EndEvent); } | 45777 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45777/d3806b8259a72fed9836fbf64e5ec69286d504ac/InPlayFireTest.java/buggy/logback-core/src/test/java/ch/qos/logback/core/joran/event/InPlayFireTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
6459,
3813,
8252,
1435,
15069,
46,
280,
304,
503,
95,
14750,
1803,
18085,
1803,
33,
2704,
14750,
1803,
5621,
7482,
863,
18,
458,
12,
2704,
3234,
2932,
12179,
6,
3631,
18085,
1803,
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,
1071,
6459,
3813,
8252,
1435,
15069,
46,
280,
304,
503,
95,
14750,
1803,
18085,
1803,
33,
2704,
14750,
1803,
5621,
7482,
863,
18,
458,
12,
2704,
3234,
2932,
12179,
6,
3631,
18085,
1803,
1769,
... | ||
out.print("</td><td headers=\"t1\"class=\"" + row + "RowEvenCol\">"); | out.print("<tr><td headers=\"t5\" class=\"" + row + "RowEvenCol\">"); | public int doStartTag() throws JspException { JspWriter out = pageContext.getOut(); try { out.println("<table align=\"center\" class=\"miscTable\" title=\"Community List\">"); // Write column headings out.print("<tr><th id=\"t1\" class=\"oddRowOddCol\">" + LocaleSupport.getLocalizedMessage(pageContext, "org.dspace.app.webui.jsptag.CommunityListTag.communityName") + "</th></tr>"); // Row: toggles between Odd and Even String row = "even"; for (int i = 0; i < communities.length; i++) { // name String name = communities[i].getMetadata("name"); // first and only column is 'name' out.print("</td><td headers=\"t1\"class=\"" + row + "RowEvenCol\">"); out.print("<a href=\""); HttpServletRequest hrq = (HttpServletRequest) pageContext .getRequest(); out.print(hrq.getContextPath() + "/handle/"); out.print(communities[i].getHandle()); out.print("\">"); out.print(name); out.print("</a>"); out.println("</td></tr>"); row = (row.equals("odd") ? "even" : "odd"); } out.println("</table>"); } catch (IOException ie) { throw new JspException(ie); } return SKIP_BODY; } | 47292 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47292/fe6f7d805318933105429750673b341fa824cd1e/CommunityListTag.java/clean/dspace/src/org/dspace/app/webui/jsptag/CommunityListTag.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
509,
741,
30512,
1435,
1216,
27485,
565,
288,
3639,
19300,
2289,
596,
273,
21442,
18,
588,
1182,
5621,
3639,
775,
3639,
288,
5411,
596,
18,
8222,
2932,
32,
2121,
5689,
5189,
5693,
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,
1071,
509,
741,
30512,
1435,
1216,
27485,
565,
288,
3639,
19300,
2289,
596,
273,
21442,
18,
588,
1182,
5621,
3639,
775,
3639,
288,
5411,
596,
18,
8222,
2932,
32,
2121,
5689,
5189,
5693,
2... |
public short getShort (int parameterIndex) throws SQLException { } | public short getShort(int parameterIndex) throws SQLException { return 0; } | public short getShort (int parameterIndex) throws SQLException { // XXX-Not Implemented } | 2413 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2413/0c8299478c05542a0f240973829223c7dae7e4dd/CallableStatement.java/buggy/postgresql/CallableStatement.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
3025,
13157,
261,
474,
25412,
13,
1216,
6483,
202,
95,
202,
202,
759,
11329,
17,
1248,
18788,
202,
97,
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,
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,
3025,
13157,
261,
474,
25412,
13,
1216,
6483,
202,
95,
202,
202,
759,
11329,
17,
1248,
18788,
202,
97,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
catch(BuildException e){ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1, ConverterMessages.getFormattedString("UpdateManagedProject20.8",e.getMessage()), e)); } | protected static void convertOptionRef(IToolChain toolChain, ITool tool, Element optRef, IProgressMonitor monitor) throws CoreException { if(!optRef.hasAttribute(IOption.ID)){ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1, ConverterMessages.getResourceString("UpdateManagedProject20.6"), null)); //$NON-NLS-1$ } String optId = optRef.getAttribute(IOption.ID); IConfiguration configuration = toolChain.getParent(); IOption options[] = tool.getOptions(); IOption option = null; for(int i = 0; i < options.length; i++){ IOption curOption = options[i]; IOption parent = curOption.getSuperClass(); String curOptionId = curOption.getId(); if(parent == null) continue; String parentId = parent.getId(); if(!parentId.equals(optId)) continue; option = curOption; break; } if(option == null) option = tool.getOptionById(optId); if(option == null){ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1, ConverterMessages.getFormattedString("UpdateManagedProject20.7",optId), null)); //$NON-NLS-1$ } try{ int type = option.getValueType(); switch(type){ case IOption.BOOLEAN:{ if(optRef.hasAttribute(IOption.DEFAULT_VALUE)){ Boolean bool = new Boolean(optRef.getAttribute(IOption.DEFAULT_VALUE)); configuration.setOption(tool,option,bool.booleanValue()); } break; } case IOption.ENUMERATED: case IOption.STRING:{ if(optRef.hasAttribute(IOption.DEFAULT_VALUE)) configuration.setOption(tool,option,optRef.getAttribute(IOption.DEFAULT_VALUE)); break; } case IOption.STRING_LIST: case IOption.INCLUDE_PATH: case IOption.PREPROCESSOR_SYMBOLS: case IOption.LIBRARIES: case IOption.OBJECTS:{ Vector values = new Vector(); NodeList nodes = optRef.getElementsByTagName(IOption.LIST_VALUE); for (int j = 0; j < nodes.getLength(); ++j) { Node node = nodes.item(j); if (node.getNodeType() == Node.ELEMENT_NODE) { Boolean isBuiltIn = new Boolean(((Element)node).getAttribute(IOption.LIST_ITEM_BUILTIN)); if (!isBuiltIn.booleanValue()) { values.add(((Element)node).getAttribute(IOption.LIST_ITEM_VALUE)); } } } configuration.setOption(tool,option,(String[])values.toArray(new String[values.size()])); break; } default: break; } } catch(BuildException e){ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1, ConverterMessages.getFormattedString("UpdateManagedProject20.8",e.getMessage()), e)); //$NON-NLS-1$ } } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/3abb5693741ddff673a19523648b0201bd6775e4/UpdateManagedProject20.java/clean/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
760,
918,
1765,
1895,
1957,
12,
45,
6364,
3893,
5226,
3893,
16,
467,
6364,
5226,
16,
3010,
2153,
1957,
16,
467,
5491,
7187,
6438,
13,
15106,
202,
15069,
30015,
288,
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,
760,
918,
1765,
1895,
1957,
12,
45,
6364,
3893,
5226,
3893,
16,
467,
6364,
5226,
16,
3010,
2153,
1957,
16,
467,
5491,
7187,
6438,
13,
15106,
202,
15069,
30015,
288,
202,
202,
... | |
IASTSimpleTypeSpecifier typeSpec = factory.createSimpleTypeSpecifier( compilationUnit, IASTSimpleTypeSpecifier.Type.INT, new SimpleToken( IToken.t_void, -1, EMPTY_STRING, -1 ), false, false, false, false, false, false, false, false, Collections.EMPTY_MAP ); | IASTSimpleTypeSpecifier typeSpec = factory.createSimpleTypeSpecifier( compilationUnit, IASTSimpleTypeSpecifier.Type.INT, new SimpleToken( IToken.t_int, -1, EMPTY_STRING, -1 ), false, false, false, false, false, false, false, false, Collections.EMPTY_MAP ); | private void __builtin_unsigned_long( IASTFactory factory, IASTCompilationUnit compilationUnit ) { //unsigned long DeclarationWrapper param = new DeclarationWrapper( compilationUnit, 0, 0, null, EMPTY_STRING ); try { param.setTypeSpecifier( factory.createSimpleTypeSpecifier( compilationUnit, IASTSimpleTypeSpecifier.Type.INT, new SimpleToken( IToken.t_void, -1, EMPTY_STRING, -1 ), false, true, false, true, false, false, false, false, Collections.EMPTY_MAP ) ); param.addDeclarator( new Declarator( param ) ); } catch ( ASTSemanticException e1 ) {//nothing } DeclarationWrapper sdw = new DeclarationWrapper(compilationUnit, 0, 0, null, EMPTY_STRING ); Declarator d = new Declarator(sdw); d.setIsFunction( true ); d.addParameter( param ); sdw.addDeclarator( d ); try { IASTSimpleTypeSpecifier typeSpec = factory.createSimpleTypeSpecifier( compilationUnit, IASTSimpleTypeSpecifier.Type.INT, new SimpleToken( IToken.t_void, -1, EMPTY_STRING, -1 ), false, false, false, false, false, false, false, false, Collections.EMPTY_MAP ); sdw.setTypeSpecifier( typeSpec ); } catch ( ASTSemanticException e ) { //nothing } try {//int __builtin_ffsl(unsigned int x) d.setName( new ImagedToken( IToken.tIDENTIFIER, __BUILTIN_FFSL, __BUILTIN_FFSL.length, EMPTY_STRING, 0 ) ); sdw.createASTNodes( factory ); } catch ( ASTSemanticException e2 ) { //nothing } catch ( BacktrackException e2 ) {//nothing } try {//int __builtin_clsl(unsigned int x) d.setName( new ImagedToken( IToken.tIDENTIFIER, __BUILTIN_CLZL, __BUILTIN_CLZL.length, EMPTY_STRING, 0 ) ); sdw.createASTNodes( factory ); } catch ( ASTSemanticException e2 ) {//nothing } catch ( BacktrackException e2 ) {//nothing } try {//int __builtin_ctzl(unsigned int x) d.setName( new ImagedToken( IToken.tIDENTIFIER, __BUILTIN_CTZL, __BUILTIN_CTZL.length, EMPTY_STRING, 0 ) ); sdw.createASTNodes( factory ); } catch ( ASTSemanticException e2 ) {//nothing } catch ( BacktrackException e2 ) {//nothing } try {//int __builtin_popcountl(unsigned int x) d.setName( new ImagedToken( IToken.tIDENTIFIER, __BUILTIN_POPCOUNTL, __BUILTIN_POPCOUNTL.length, EMPTY_STRING, 0 ) ); sdw.createASTNodes( factory ); } catch ( ASTSemanticException e2 ) {//nothing } catch ( BacktrackException e2 ) {//nothing } try {//int __builtin_parityl(unsigned int x) d.setName( new ImagedToken( IToken.tIDENTIFIER, __BUILTIN_PARITYL, __BUILTIN_PARITYL.length, EMPTY_STRING, 0 ) ); sdw.createASTNodes( factory ); } catch ( ASTSemanticException e2 ) {//nothing } catch ( BacktrackException e2 ) {//nothing } } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/1f751745a975ab6747e9e2bc29504c4dff2d4056/GCCASTCompleteExtension.java/clean/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/gcc/GCCASTCompleteExtension.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
1001,
24553,
67,
22297,
67,
5748,
12,
467,
9053,
1733,
3272,
16,
467,
9053,
19184,
2802,
8916,
2802,
262,
288,
3639,
368,
22297,
1525,
3639,
16110,
4302,
3611,
579,
273,
394,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
24553,
67,
22297,
67,
5748,
12,
467,
9053,
1733,
3272,
16,
467,
9053,
19184,
2802,
8916,
2802,
262,
288,
3639,
368,
22297,
1525,
3639,
16110,
4302,
3611,
579,
273,
394,
1... |
pc = pcJump; | pc = getJavaCatchPC(iCode); | static Object interpret(Context cx, Scriptable scope, Scriptable thisObj, Object[] args, double[] argsDbl, int argShift, int argCount, NativeFunction fnOrScript, InterpreterData idata) throws JavaScriptException { if (cx.interpreterSecurityDomain != idata.securityDomain) { if (argsDbl != null) { args = getArgsArray(args, argsDbl, argShift, argCount); } SecurityController sc = idata.securityController; Object savedDomain = cx.interpreterSecurityDomain; cx.interpreterSecurityDomain = idata.securityDomain; try { return sc.callWithDomain(idata.securityDomain, cx, fnOrScript, scope, thisObj, args); } finally { cx.interpreterSecurityDomain = savedDomain; } } final Object DBL_MRK = Interpreter.DBL_MRK; final Scriptable undefined = Undefined.instance; final int VAR_SHFT = 0; final int maxVars = idata.itsMaxVars; final int LOCAL_SHFT = VAR_SHFT + maxVars; final int STACK_SHFT = LOCAL_SHFT + idata.itsMaxLocals;// stack[VAR_SHFT <= i < LOCAL_SHFT]: variables// stack[LOCAL_SHFT <= i < TRY_STACK_SHFT]: used for newtemp/usetemp// stack[STACK_SHFT <= i < STACK_SHFT + idata.itsMaxStack]: stack data// sDbl[i]: if stack[i] is DBL_MRK, sDbl[i] holds the number value int maxFrameArray = idata.itsMaxFrameArray; if (maxFrameArray != STACK_SHFT + idata.itsMaxStack) Kit.codeBug(); Object[] stack = new Object[maxFrameArray]; double[] sDbl = new double[maxFrameArray]; int stackTop = STACK_SHFT - 1; int withDepth = 0; int definedArgs = fnOrScript.argCount; if (definedArgs > argCount) { definedArgs = argCount; } for (int i = 0; i != definedArgs; ++i) { Object arg = args[argShift + i]; stack[VAR_SHFT + i] = arg; if (arg == DBL_MRK) { sDbl[VAR_SHFT + i] = argsDbl[argShift + i]; } } for (int i = definedArgs; i != maxVars; ++i) { stack[VAR_SHFT + i] = undefined; } DebugFrame debuggerFrame = null; if (cx.debugger != null) { debuggerFrame = cx.debugger.getFrame(cx, idata); } if (idata.itsFunctionType != 0) { InterpretedFunction f = (InterpretedFunction)fnOrScript; if (!idata.useDynamicScope) { scope = fnOrScript.getParentScope(); } if (idata.itsCheckThis) { thisObj = ScriptRuntime.getThis(thisObj); } if (idata.itsNeedsActivation) { if (argsDbl != null) { args = getArgsArray(args, argsDbl, argShift, argCount); argShift = 0; argsDbl = null; } scope = ScriptRuntime.initVarObj(cx, scope, fnOrScript, thisObj, args); } } else { ScriptRuntime.initScript(cx, scope, fnOrScript, thisObj, idata.itsFromEvalCode); } if (idata.itsNestedFunctions != null) { if (idata.itsFunctionType != 0 && !idata.itsNeedsActivation) Kit.codeBug(); for (int i = 0; i < idata.itsNestedFunctions.length; i++) { InterpreterData fdata = idata.itsNestedFunctions[i]; if (fdata.itsFunctionType == FunctionNode.FUNCTION_STATEMENT) { createFunction(cx, scope, fdata, idata.itsFromEvalCode); } } } // Wrapped regexps for functions are stored in InterpretedFunction // but for script which should not contain references to scope // the regexps re-wrapped during each script execution Scriptable[] scriptRegExps = null; boolean useActivationVars = false; if (debuggerFrame != null) { if (argsDbl != null) { args = getArgsArray(args, argsDbl, argShift, argCount); argShift = 0; argsDbl = null; } if (idata.itsFunctionType != 0 && !idata.itsNeedsActivation) { useActivationVars = true; scope = ScriptRuntime.initVarObj(cx, scope, fnOrScript, thisObj, args); } debuggerFrame.onEnter(cx, scope, thisObj, args); } InterpreterData savedData = cx.interpreterData; cx.interpreterData = idata; Object result = undefined; // If javaException != null on exit, it will be throw instead of // normal return Throwable javaException = null; int exceptionPC = -1; byte[] iCode = idata.itsICode; int pc = 0; int pcPrevBranch = 0; final int instructionThreshold = cx.instructionThreshold; // During function call this will be set to -1 so catch can properly // adjust it int instructionCount = cx.instructionCount; // arbitrary number to add to instructionCount when calling // other functions final int INVOCATION_COST = 100; String[] strings = idata.itsStringTable; String stringReg = null; int indexReg = 0; Loop: for (;;) { int pcJump; try { int op = 0xFF & iCode[pc++]; switch (op) { // Back indent to ease imlementation reading case Icode_CATCH: { // The following code should be executed inside try/catch inside main // loop, not in the loop catch block itself to deal with exceptions // from observeInstructionCount. A special bytecode is used only to // simplify logic. if (javaException == null) Kit.codeBug(); pcJump = -1; boolean doCatch = false; int handlerOffset = getExceptionHandler(idata.itsExceptionTable, exceptionPC); if (handlerOffset >= 0) { final int SCRIPT_CAN_CATCH = 0, ONLY_FINALLY = 1, OTHER = 2; int exType; if (javaException instanceof JavaScriptException) { exType = SCRIPT_CAN_CATCH; } else if (javaException instanceof EcmaError) { // an offical ECMA error object, exType = SCRIPT_CAN_CATCH; } else if (javaException instanceof EvaluatorException) { exType = SCRIPT_CAN_CATCH; } else if (javaException instanceof RuntimeException) { exType = ONLY_FINALLY; } else { // Error instance exType = OTHER; } if (exType != OTHER) { // Do not allow for JS to interfere with Error instances // (exType == OTHER), as they can be used to terminate // long running script if (exType == SCRIPT_CAN_CATCH) { // Allow JS to catch only JavaScriptException and // EcmaError pcJump = idata.itsExceptionTable[handlerOffset + EXCEPTION_CATCH_SLOT]; if (pcJump >= 0) { // Has catch block doCatch = true; } } if (pcJump < 0) { pcJump = idata.itsExceptionTable[handlerOffset + EXCEPTION_FINALLY_SLOT]; } } } if (debuggerFrame != null && !(javaException instanceof Error)) { debuggerFrame.onExceptionThrown(cx, javaException); } if (pcJump < 0) { break Loop; } // We caught an exception // restore scope at try point int tryWithDepth = idata.itsExceptionTable[ handlerOffset + EXCEPTION_WITH_DEPTH_SLOT]; while (tryWithDepth != withDepth) { if (scope == null) Kit.codeBug(); scope = ScriptRuntime.leaveWith(scope); --withDepth; } if (doCatch) { stackTop = STACK_SHFT - 1; int exLocal = idata.itsExceptionTable[ handlerOffset + EXCEPTION_LOCAL_SLOT]; stack[LOCAL_SHFT + exLocal] = ScriptRuntime.getCatchObject( cx, scope, javaException); } else { stackTop = STACK_SHFT; // Call finally handler with javaException on stack top to // distinguish from normal invocation through GOSUB // which would contain DBL_MRK on the stack stack[stackTop] = javaException; } // clear exception javaException = null; // go to generic jump code break; } case Token.THROW: { Object value = stack[stackTop]; if (value == DBL_MRK) value = doubleWrap(sDbl[stackTop]); --stackTop; int sourceLine = getShort(iCode, pc); throw new JavaScriptException(value, idata.itsSourceFile, sourceLine); } case Token.GE : { --stackTop; Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; boolean valBln; if (rhs == DBL_MRK || lhs == DBL_MRK) { double rDbl = stack_double(stack, sDbl, stackTop + 1); double lDbl = stack_double(stack, sDbl, stackTop); valBln = (rDbl <= lDbl); } else { valBln = ScriptRuntime.cmp_LE(rhs, lhs); } stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; continue Loop; } case Token.LE : { --stackTop; Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; boolean valBln; if (rhs == DBL_MRK || lhs == DBL_MRK) { double rDbl = stack_double(stack, sDbl, stackTop + 1); double lDbl = stack_double(stack, sDbl, stackTop); valBln = (lDbl <= rDbl); } else { valBln = ScriptRuntime.cmp_LE(lhs, rhs); } stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; continue Loop; } case Token.GT : { --stackTop; Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; boolean valBln; if (rhs == DBL_MRK || lhs == DBL_MRK) { double rDbl = stack_double(stack, sDbl, stackTop + 1); double lDbl = stack_double(stack, sDbl, stackTop); valBln = (rDbl < lDbl); } else { valBln = ScriptRuntime.cmp_LT(rhs, lhs); } stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; continue Loop; } case Token.LT : { --stackTop; Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; boolean valBln; if (rhs == DBL_MRK || lhs == DBL_MRK) { double rDbl = stack_double(stack, sDbl, stackTop + 1); double lDbl = stack_double(stack, sDbl, stackTop); valBln = (lDbl < rDbl); } else { valBln = ScriptRuntime.cmp_LT(lhs, rhs); } stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; continue Loop; } case Token.IN : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); boolean valBln = ScriptRuntime.in(lhs, rhs, scope); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; continue Loop; } case Token.INSTANCEOF : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); boolean valBln = ScriptRuntime.instanceOf(lhs, rhs, scope); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; continue Loop; } case Token.EQ : { --stackTop; boolean valBln = do_eq(stack, sDbl, stackTop); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; continue Loop; } case Token.NE : { --stackTop; boolean valBln = !do_eq(stack, sDbl, stackTop); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; continue Loop; } case Token.SHEQ : { --stackTop; boolean valBln = do_sheq(stack, sDbl, stackTop); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; continue Loop; } case Token.SHNE : { --stackTop; boolean valBln = !do_sheq(stack, sDbl, stackTop); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; continue Loop; } case Token.IFNE : { boolean valBln = stack_boolean(stack, sDbl, stackTop); --stackTop; if (valBln) { pc += 2; continue Loop; } pcJump = getTarget(iCode, pc); break; } case Token.IFEQ : { boolean valBln = stack_boolean(stack, sDbl, stackTop); --stackTop; if (!valBln) { pc += 2; continue Loop; } pcJump = getTarget(iCode, pc); break; } case Icode_IFEQ_POP : { boolean valBln = stack_boolean(stack, sDbl, stackTop); --stackTop; if (!valBln) { pc += 2; continue Loop; } stack[stackTop] = null; --stackTop; pcJump = getTarget(iCode, pc); break; } case Token.GOTO : pcJump = getTarget(iCode, pc); break; case Icode_GOSUB : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = pc + 2; pcJump = getTarget(iCode, pc); break; case Icode_RETSUB : { // indexReg: local to store return address Object value = stack[LOCAL_SHFT + indexReg]; if (value != DBL_MRK) { // Invocation from exception handler, restore object to rethrow javaException = (Throwable)value; exceptionPC = pc - 1; pcJump = getJavaCatchPC(iCode); } else { // Normal return from GOSUB pcJump = (int)sDbl[LOCAL_SHFT + indexReg]; } break; } case Token.POP : stack[stackTop] = null; stackTop--; continue Loop; case Icode_DUP : stack[stackTop + 1] = stack[stackTop]; sDbl[stackTop + 1] = sDbl[stackTop]; stackTop++; continue Loop; case Icode_DUPSECOND : { stack[stackTop + 1] = stack[stackTop - 1]; sDbl[stackTop + 1] = sDbl[stackTop - 1]; stackTop++; continue Loop; } case Icode_SWAP : { Object o = stack[stackTop]; stack[stackTop] = stack[stackTop - 1]; stack[stackTop - 1] = o; double d = sDbl[stackTop]; sDbl[stackTop] = sDbl[stackTop - 1]; sDbl[stackTop - 1] = d; continue Loop; } case Token.POPV : result = stack[stackTop]; if (result == DBL_MRK) result = doubleWrap(sDbl[stackTop]); stack[stackTop] = null; --stackTop; continue Loop; case Token.RETURN : result = stack[stackTop]; if (result == DBL_MRK) result = doubleWrap(sDbl[stackTop]); --stackTop; break Loop; case Token.RETURN_POPV : break Loop; case Icode_RETUNDEF : result = undefined; break Loop; case Token.BITNOT : { int rIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = ~rIntValue; continue Loop; } case Token.BITAND : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue & rIntValue; continue Loop; } case Token.BITOR : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue | rIntValue; continue Loop; } case Token.BITXOR : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue ^ rIntValue; continue Loop; } case Token.LSH : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue << rIntValue; continue Loop; } case Token.RSH : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue >> rIntValue; continue Loop; } case Token.URSH : { int rIntValue = stack_int32(stack, sDbl, stackTop) & 0x1F; --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = ScriptRuntime.toUint32(lDbl) >>> rIntValue; continue Loop; } case Token.ADD : --stackTop; do_add(stack, sDbl, stackTop); continue Loop; case Token.SUB : { double rDbl = stack_double(stack, sDbl, stackTop); --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lDbl - rDbl; continue Loop; } case Token.NEG : { double rDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = -rDbl; continue Loop; } case Token.POS : { double rDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = rDbl; continue Loop; } case Token.MUL : { double rDbl = stack_double(stack, sDbl, stackTop); --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lDbl * rDbl; continue Loop; } case Token.DIV : { double rDbl = stack_double(stack, sDbl, stackTop); --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; // Detect the divide by zero or let Java do it ? sDbl[stackTop] = lDbl / rDbl; continue Loop; } case Token.MOD : { double rDbl = stack_double(stack, sDbl, stackTop); --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lDbl % rDbl; continue Loop; } case Token.NOT : { stack[stackTop] = stack_boolean(stack, sDbl, stackTop) ? Boolean.FALSE : Boolean.TRUE; continue Loop; } case Icode_REG_STR1: stringReg = strings[0xFF & iCode[pc]]; ++pc; continue Loop; case Icode_REG_STR2: stringReg = strings[getIndex(iCode, pc)]; pc += 2; continue Loop; case Icode_REG_STR4: stringReg = strings[getInt(iCode, pc)]; pc += 4; continue Loop; case Icode_REG_IND_C0: indexReg = 0; continue Loop; case Icode_REG_IND_C1: indexReg = 1; continue Loop; case Icode_REG_IND_C2: indexReg = 2; continue Loop; case Icode_REG_IND_C3: indexReg = 3; continue Loop; case Icode_REG_IND1: indexReg = 0xFF & iCode[pc]; ++pc; continue Loop; case Icode_REG_IND2: indexReg = getIndex(iCode, pc); pc += 2; continue Loop; case Icode_REG_IND4: indexReg = getInt(iCode, pc); pc += 4; continue Loop; case Token.BINDNAME : stack[++stackTop] = ScriptRuntime.bind(scope, stringReg); continue Loop; case Token.SETNAME : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Scriptable lhs = (Scriptable)stack[stackTop]; stack[stackTop] = ScriptRuntime.setName(lhs, rhs, scope, stringReg); continue Loop; } case Token.DELPROP : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.delete(cx, scope, lhs, rhs); continue Loop; } case Token.GETPROP : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.getProp(lhs, stringReg, scope); continue Loop; } case Token.SETPROP : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.setProp(lhs, stringReg, rhs, scope); continue Loop; } case Token.GETELEM : do_getElem(cx, stack, sDbl, stackTop, scope); --stackTop; continue Loop; case Token.SETELEM : do_setElem(cx, stack, sDbl, stackTop, scope); stackTop -= 2; continue Loop; case Icode_PROPINC : case Icode_PROPDEC : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.postIncrDecr(lhs, stringReg, scope, op == Icode_PROPINC); continue Loop; } case Icode_ELEMINC : case Icode_ELEMDEC : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.postIncrDecrElem(lhs, rhs, scope, op == Icode_ELEMINC); continue Loop; } case Token.LOCAL_SAVE : stack[LOCAL_SHFT + indexReg] = stack[stackTop]; sDbl[LOCAL_SHFT + indexReg] = sDbl[stackTop]; --stackTop; continue Loop; case Token.LOCAL_LOAD : ++stackTop; stack[stackTop] = stack[LOCAL_SHFT + indexReg]; sDbl[stackTop] = sDbl[LOCAL_SHFT + indexReg]; continue Loop; case Icode_CALLSPECIAL : { if (instructionThreshold != 0) { instructionCount += INVOCATION_COST; cx.instructionCount = instructionCount; instructionCount = -1; } // indexReg: number of arguments int callType = iCode[pc] & 0xFF; boolean isNew = (iCode[pc + 1] != 0); int sourceLine = getShort(iCode, pc + 2); stackTop -= indexReg; Object[] outArgs = getArgsArray(stack, sDbl, stackTop + 1, indexReg); Object functionThis; if (isNew) { functionThis = null; } else { functionThis = stack[stackTop]; if (functionThis == DBL_MRK) { functionThis = doubleWrap(sDbl[stackTop]); } --stackTop; } Object function = stack[stackTop]; if (function == DBL_MRK) function = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.callSpecial( cx, function, isNew, functionThis, outArgs, scope, thisObj, callType, idata.itsSourceFile, sourceLine); instructionCount = cx.instructionCount; pc += 4; continue Loop; } case Token.CALL : { if (instructionThreshold != 0) { instructionCount += INVOCATION_COST; cx.instructionCount = instructionCount; instructionCount = -1; } // indexReg: number of arguments stackTop -= indexReg; int calleeArgShft = stackTop + 1; Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; Scriptable calleeScope = scope; if (idata.itsNeedsActivation) { calleeScope = ScriptableObject.getTopLevelScope(scope); } Scriptable calleeThis; if (rhs instanceof Scriptable || rhs == null) { calleeThis = (Scriptable)rhs; } else { calleeThis = ScriptRuntime.toObject(cx, calleeScope, rhs); } if (lhs instanceof InterpretedFunction) { // Inlining of InterpretedFunction.call not to create // argument array InterpretedFunction f = (InterpretedFunction)lhs; stack[stackTop] = interpret(cx, calleeScope, calleeThis, stack, sDbl, calleeArgShft, indexReg, f, f.itsData); } else if (lhs instanceof Function) { Function f = (Function)lhs; Object[] outArgs = getArgsArray(stack, sDbl, calleeArgShft, indexReg); stack[stackTop] = f.call(cx, calleeScope, calleeThis, outArgs); } else { if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); else if (lhs == undefined) { // special code for better error message for call // to undefined lhs = stringReg; } throw ScriptRuntime.typeError1("msg.isnt.function", ScriptRuntime.toString(lhs)); } instructionCount = cx.instructionCount; continue Loop; } case Token.NEW : { if (instructionThreshold != 0) { instructionCount += INVOCATION_COST; cx.instructionCount = instructionCount; instructionCount = -1; } // indexReg: number of arguments stackTop -= indexReg; int calleeArgShft = stackTop + 1; Object lhs = stack[stackTop]; if (lhs instanceof InterpretedFunction) { // Inlining of InterpretedFunction.construct not to create // argument array InterpretedFunction f = (InterpretedFunction)lhs; Scriptable newInstance = f.createObject(cx, scope); Object callResult = interpret(cx, scope, newInstance, stack, sDbl, calleeArgShft, indexReg, f, f.itsData); if (callResult instanceof Scriptable && callResult != undefined) { stack[stackTop] = callResult; } else { stack[stackTop] = newInstance; } } else if (lhs instanceof Function) { Function f = (Function)lhs; Object[] outArgs = getArgsArray(stack, sDbl, calleeArgShft, indexReg); stack[stackTop] = f.construct(cx, scope, outArgs); } else { if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); else if (lhs == undefined) { // special code for better error message for call // to undefined lhs = stringReg; } throw ScriptRuntime.typeError1("msg.isnt.function", ScriptRuntime.toString(lhs)); } instructionCount = cx.instructionCount; continue Loop; } case Token.TYPEOF : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.typeof(lhs); continue Loop; } case Icode_TYPEOFNAME : stack[++stackTop] = ScriptRuntime.typeofName(scope, stringReg); continue Loop; case Icode_NAME_FAST_THIS : case Icode_NAME_SLOW_THIS : stackTop = do_nameAndThis(stack, stackTop, scope, stringReg, op); continue Loop; case Token.STRING : stack[++stackTop] = stringReg; continue Loop; case Icode_SHORTNUMBER : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = getShort(iCode, pc); pc += 2; continue Loop; case Icode_INTNUMBER : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = getInt(iCode, pc); pc += 4; continue Loop; case Token.NUMBER : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = idata.itsDoubleTable[indexReg]; continue Loop; case Token.NAME : stack[++stackTop] = ScriptRuntime.name(scope, stringReg); continue Loop; case Icode_NAMEINC : case Icode_NAMEDEC : stack[++stackTop] = ScriptRuntime.postIncrDecr(scope, stringReg, op == Icode_NAMEINC); continue Loop; case Token.SETVAR : if (!useActivationVars) { stack[VAR_SHFT + indexReg] = stack[stackTop]; sDbl[VAR_SHFT + indexReg] = sDbl[stackTop]; } else { Object val = stack[stackTop]; if (val == DBL_MRK) val = doubleWrap(sDbl[stackTop]); activationPut(fnOrScript, scope, indexReg, val); } continue Loop; case Token.GETVAR : ++stackTop; if (!useActivationVars) { stack[stackTop] = stack[VAR_SHFT + indexReg]; sDbl[stackTop] = sDbl[VAR_SHFT + indexReg]; } else { stack[stackTop] = activationGet(fnOrScript, scope, indexReg); } continue Loop; case Icode_VARINC : case Icode_VARDEC : ++stackTop; if (!useActivationVars) { Object val = stack[VAR_SHFT + indexReg]; stack[stackTop] = val; double d; if (val == DBL_MRK) { d = sDbl[VAR_SHFT + indexReg]; sDbl[stackTop] = d; } else { d = ScriptRuntime.toNumber(val); } stack[VAR_SHFT + indexReg] = DBL_MRK; sDbl[VAR_SHFT + indexReg] = (op == Icode_VARINC) ? d + 1.0 : d - 1.0; } else { Object val = activationGet(fnOrScript, scope, indexReg); stack[stackTop] = val; double d = ScriptRuntime.toNumber(val); val = doubleWrap((op == Icode_VARINC) ? d + 1.0 : d - 1.0); activationPut(fnOrScript, scope, indexReg, val); } continue Loop; case Token.ZERO : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = 0; continue Loop; case Token.ONE : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = 1; continue Loop; case Token.NULL : stack[++stackTop] = null; continue Loop; case Token.THIS : stack[++stackTop] = thisObj; continue Loop; case Token.THISFN : stack[++stackTop] = fnOrScript; continue Loop; case Token.FALSE : stack[++stackTop] = Boolean.FALSE; continue Loop; case Token.TRUE : stack[++stackTop] = Boolean.TRUE; continue Loop; case Token.UNDEFINED : stack[++stackTop] = Undefined.instance; continue Loop; case Token.ENTERWITH : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); --stackTop; scope = ScriptRuntime.enterWith(lhs, scope); ++withDepth; continue Loop; } case Token.LEAVEWITH : scope = ScriptRuntime.leaveWith(scope); --withDepth; continue Loop; case Token.CATCH_SCOPE : stack[stackTop] = ScriptRuntime.newCatchScope(stringReg, stack[stackTop]); continue Loop; case Token.ENUM_INIT : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); --stackTop; stack[LOCAL_SHFT + indexReg] = ScriptRuntime.enumInit(lhs, scope); continue Loop; } case Token.ENUM_NEXT : case Token.ENUM_ID : { Object val = stack[LOCAL_SHFT + indexReg]; ++stackTop; stack[stackTop] = (op == Token.ENUM_NEXT) ? (Object)ScriptRuntime.enumNext(val) : (Object)ScriptRuntime.enumId(val); continue Loop; } case Icode_PUSH_PARENT : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[++stackTop] = ScriptRuntime.getParent(lhs); continue Loop; } case Icode_GETPROTO : case Icode_GETSCOPEPARENT : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); Object val; if (op == Icode_GETPROTO) { val = ScriptRuntime.getProto(lhs, scope); } else { val = ScriptRuntime.getParent(lhs, scope); } stack[stackTop] = val; continue Loop; } case Icode_SETPROTO : case Icode_SETPARENT : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); Object val; if (op == Icode_SETPROTO) { val = ScriptRuntime.setProto(lhs, rhs, scope); } else { val = ScriptRuntime.setParent(lhs, rhs, scope); } stack[stackTop] = val; continue Loop; } case Icode_SCOPE : stack[++stackTop] = scope; continue Loop; case Icode_CLOSURE : { InterpreterData closureData = idata.itsNestedFunctions[indexReg]; stack[++stackTop] = createFunction(cx, scope, closureData, idata.itsFromEvalCode); continue Loop; } case Token.REGEXP : { Scriptable regexp; if (idata.itsFunctionType != 0) { regexp = ((InterpretedFunction)fnOrScript).itsRegExps[indexReg]; } else { if (scriptRegExps == null) { scriptRegExps = wrapRegExps(cx, scope, idata); } regexp = scriptRegExps[indexReg]; } stack[++stackTop] = regexp; continue Loop; } case Icode_LITERAL_NEW : // indexReg: number of values in the literal ++stackTop; stack[stackTop] = new Object[indexReg]; sDbl[stackTop] = 0; continue Loop; case Icode_LITERAL_SET : { Object value = stack[stackTop]; if (value == DBL_MRK) value = doubleWrap(sDbl[stackTop]); --stackTop; int i = (int)sDbl[stackTop]; ((Object[])stack[stackTop])[i] = value; sDbl[stackTop] = i + 1; continue Loop; } case Token.ARRAYLIT : case Icode_SPARE_ARRAYLIT : case Token.OBJECTLIT : { Object[] data = (Object[])stack[stackTop]; Object val; if (op == Token.OBJECTLIT) { Object[] ids = (Object[])idata.literalIds[indexReg]; val = ScriptRuntime.newObjectLiteral(ids, data, cx, scope); } else { int[] skipIndexces = null; if (op == Icode_SPARE_ARRAYLIT) { skipIndexces = (int[])idata.literalIds[indexReg]; } val = ScriptRuntime.newArrayLiteral(data, skipIndexces, cx, scope); } stack[stackTop] = val; continue Loop; } case Icode_LINE : { cx.interpreterLineIndex = pc; if (debuggerFrame != null) { int line = getShort(iCode, pc); debuggerFrame.onLineChange(cx, line); } pc += 2; continue Loop; } default : { dumpICode(idata); throw new RuntimeException("Unknown icode : "+op+" @ pc : "+(pc-1)); } } // end of interpreter switch // This should be reachable only for jump implementation if (instructionThreshold != 0) { instructionCount += pc - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } pcPrevBranch = pcJump; } pc = pcJump; continue Loop; } // end of interpreter try catch (Throwable ex) { pcJump = getJavaCatchPC(iCode); if (instructionThreshold != 0) { if (instructionCount < 0) { // throw during function call instructionCount = cx.instructionCount; } else { // throw during any other operation instructionCount += pc - pcPrevBranch; cx.instructionCount = instructionCount; } pcPrevBranch = pcJump; } javaException = ex; exceptionPC = pc - 1; pc = pcJump; continue Loop; } } // end of interpreter loop cx.interpreterData = savedData; if (debuggerFrame != null) { if (javaException != null) { debuggerFrame.onExit(cx, true, javaException); } else { debuggerFrame.onExit(cx, false, result); } } if (idata.itsNeedsActivation || debuggerFrame != null) { ScriptRuntime.popActivation(cx); } if (instructionThreshold != 0) { if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } cx.instructionCount = instructionCount; } if (javaException != null) { if (javaException instanceof JavaScriptException) { throw (JavaScriptException)javaException; } else if (javaException instanceof RuntimeException) { throw (RuntimeException)javaException; } else { // Must be instance of Error or code bug throw (Error)javaException; } } return result; } | 12564 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12564/e7cba0f3e1a79550e4e93ffe0d0be122780cb665/Interpreter.java/clean/src/org/mozilla/javascript/Interpreter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
760,
1033,
10634,
12,
1042,
9494,
16,
22780,
2146,
16,
22780,
15261,
16,
18701,
1033,
8526,
833,
16,
1645,
8526,
833,
40,
3083,
16,
18701,
509,
1501,
10544,
16,
509,
1501,
1380,
16,
18701... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
760,
1033,
10634,
12,
1042,
9494,
16,
22780,
2146,
16,
22780,
15261,
16,
18701,
1033,
8526,
833,
16,
1645,
8526,
833,
40,
3083,
16,
18701,
509,
1501,
10544,
16,
509,
1501,
1380,
16,
18701... |
"BbDdN"); | "BbDd"); | public void test_doStep_noPredicates_propertyOwner(){ // Existing scalar property testValueAndPointer("/int", new Integer(1), "/int", "BbB"); // self:: testValueAndPointer("/./int", new Integer(1), "/int", "BbB"); // Missing property testNullPointer("/foo", "/foo", "BnN"); // existingProperty/existingScalarProperty testValueAndPointer("/nestedBean/int", new Integer(1), "/nestedBean/int", "BbBbB"); // existingProperty/collectionProperty testValueAndPointer("/nestedBean/strings", bean.getNestedBean().getStrings(), "/nestedBean/strings", "BbBbC"); // existingProperty/missingProperty testNullPointer("/nestedBean/foo", "/nestedBean/foo", "BbBnN"); // map/missingProperty testNullPointer("/map/foo", "/map[@name='foo']", "BbDdN"); // Existing property by search in collection testValueAndPointer("/list/int", new Integer(1), "/list[3]/int", "BbBbB"); // Missing property by search in collection testNullPointer("/list/foo", "/list[1]/foo", "BbBnN"); // existingProperty/missingProperty/missingProperty testNullPointer("/nestedBean/foo/bar", "/nestedBean/foo/bar", "BbBnNnN"); // collection/existingProperty/missingProperty testNullPointer("/list/int/bar", "/list[3]/int/bar", "BbBbBnN"); // collectionProperty/missingProperty/missingProperty testNullPointer("/list/foo/bar", "/list[1]/foo/bar", "BbBnNnN"); // map/missingProperty/anotherStep testNullPointer("/map/foo/bar", "/map[@name='foo']/bar", "BbDdNnN"); // Existing dynamic property testValueAndPointer("/map/Key1", "Value 1", "/map[@name='Key1']", "BbDdB"); // collectionProperty testValueAndPointer("/integers", bean.getIntegers(), "/integers", "BbC"); } | 52531 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52531/430fdd01e75a5e681274aa65adeb2d9826ee45a8/SimplePathInterpreterTest.java/buggy/src/test/org/apache/commons/jxpath/ri/axes/SimplePathInterpreterTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
67,
2896,
4160,
67,
2135,
26916,
67,
4468,
5541,
1435,
95,
3639,
368,
28257,
4981,
1272,
3639,
1842,
620,
1876,
4926,
2932,
19,
474,
3113,
7734,
394,
2144,
12,
21,
3631,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
2896,
4160,
67,
2135,
26916,
67,
4468,
5541,
1435,
95,
3639,
368,
28257,
4981,
1272,
3639,
1842,
620,
1876,
4926,
2932,
19,
474,
3113,
7734,
394,
2144,
12,
21,
3631,
... |
OutputStream os = handler.handleDiffWindow(name == null ? path : name, window); | OutputStream os = handler.textDeltaChunk(name == null ? path : name, window); | public int getFileRevisions(String path, long sRevision, long eRevision, ISVNFileRevisionHandler handler) throws SVNException { Long srev = getRevisionObject(sRevision); Long erev = getRevisionObject(eRevision); int count = 0; try { openConnection(); Object[] buffer = new Object[] { "get-file-revs", getRepositoryPath(path), srev, erev }; write("(w(s(n)(n)))", buffer); authenticate(); buffer = new Object[5]; while (true) { SVNFileRevision fileRevision = null; boolean skipDelta = false; try { buffer = read("(SN(*P)(*Z)?S", buffer); if (buffer[4] != null && ((String) buffer[4]).length() == 0) { buffer[4] = null; skipDelta = true; } else { read(")", null); } count++; } catch (SVNException e) { read("x", buffer); read("[()]", buffer); return count; } String name = null; if (handler != null) { name = (String) buffer[0]; long revision = SVNReader.getLong(buffer, 1); Map properties = SVNReader.getMap(buffer, 2); Map propertiesDelta = SVNReader.getMap(buffer, 3); if (name != null) { fileRevision = new SVNFileRevision(name, revision, properties, propertiesDelta); } buffer[2] = null; buffer[3] = null; } if (handler != null && fileRevision != null) { handler.handleFileRevision(fileRevision); } if (skipDelta) { continue; } SVNDiffWindowBuilder builder = SVNDiffWindowBuilder .newInstance(); while (true) { byte[] line = (byte[]) read("?W?B", buffer)[1]; if (line == null) { // may be failure read("[]", buffer); break; } else if (line.length == 0) { // empty line, delta end. break; } builder.accept(line, 0); SVNDiffWindow window = builder.getDiffWindow(); if (window != null) { OutputStream os = handler.handleDiffWindow(name == null ? path : name, window); if (os != null) { try { os.write(builder.getInstructionsData()); } catch (IOException e) { SVNErrorManager.error(e.getMessage()); } } builder.reset(SVNDiffWindowBuilder.OFFSET); long length = window.getNewDataLength(); while (length > 0) { byte[] contents = (byte[]) myConnection.read("B", null)[0]; length -= contents.length; try { if (os != null) { os.write(contents); } } catch (IOException th) { SVNDebugLog.logInfo(th); } } try { if (os != null) { os.close(); } } catch (IOException th) { SVNDebugLog.logInfo(th); } } } handler.handleDiffWindowClosed(name == null ? path : name); } } finally { closeConnection(); } } | 2776 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2776/3992bcbf4b73953e9cef9c158a2ce17f401601ae/SVNRepositoryImpl.java/clean/javasvn/src/org/tmatesoft/svn/core/internal/io/svn/SVNRepositoryImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
509,
6034,
21208,
12,
780,
589,
16,
1525,
272,
7939,
16,
1525,
425,
7939,
16,
5411,
4437,
58,
50,
812,
7939,
1503,
1838,
13,
1216,
29537,
50,
503,
288,
3639,
3407,
272,
9083,
273,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6034,
21208,
12,
780,
589,
16,
1525,
272,
7939,
16,
1525,
425,
7939,
16,
5411,
4437,
58,
50,
812,
7939,
1503,
1838,
13,
1216,
29537,
50,
503,
288,
3639,
3407,
272,
9083,
273,... |
nodeset.add(defaultInstance.getDocument()); | nodeset.add(defaultInstance.getInstanceDocument()); | public List getBindNodeset(PipelineContext pipelineContext, ModelBind bind) { // Get a list of parents, ordered by grandfather first List parents = new ArrayList(); parents.add(bind); ModelBind parent = bind; while ((parent = parent.getParent()) != null) { parents.add(parent); } Collections.reverse(parents); // Find the final node final List nodeset = new ArrayList(); final XFormsInstance defaultInstance = getDefaultInstance(); nodeset.add(defaultInstance.getDocument()); for (Iterator i = parents.iterator(); i.hasNext();) { ModelBind current = (ModelBind) i.next(); List currentModelBindResults = new ArrayList(); for (Iterator j = nodeset.iterator(); j.hasNext();) { Node node = (Node) j.next(); // Execute XPath expresssion currentModelBindResults.addAll(defaultInstance.evaluateXPath(pipelineContext, node, current.getNodeset(), current.getNamespaceMap(), null, xformsFunctionLibrary, current.getLocationData().getSystemID())); } nodeset.addAll(currentModelBindResults); // Last iteration of i: remove all except last if (!i.hasNext()) nodeset.retainAll(currentModelBindResults); } return nodeset; } | 57229 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57229/4b56f54bf2c5f3e53836145b1b1968a0907dab29/XFormsModel.java/clean/src/java/org/orbeon/oxf/xforms/XFormsModel.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
987,
17238,
3205,
278,
12,
8798,
1042,
5873,
1042,
16,
3164,
3357,
1993,
13,
288,
3639,
368,
968,
279,
666,
434,
6298,
16,
5901,
635,
16225,
74,
4806,
1122,
3639,
987,
6298,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
987,
17238,
3205,
278,
12,
8798,
1042,
5873,
1042,
16,
3164,
3357,
1993,
13,
288,
3639,
368,
968,
279,
666,
434,
6298,
16,
5901,
635,
16225,
74,
4806,
1122,
3639,
987,
6298,
273,
... |
public KeyboardFocusManager() | public KeyboardFocusManager () | public KeyboardFocusManager() { } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ac6303b96cdaf2d4230daf25a90dd00cc4cb192d/KeyboardFocusManager.java/buggy/core/src/classpath/java/java/awt/KeyboardFocusManager.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
16535,
9233,
1318,
1832,
225,
288,
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,
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,
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,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
16535,
9233,
1318,
1832,
225,
288,
225,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
public boolean isDirectory() { return getName().endsWith("/"); | public boolean isDirectory() { return getName().endsWith( "/" ); | public boolean isDirectory() { return getName().endsWith("/"); } | 10884 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/10884/8348e0b29d34f62b8f140a99598373fb0cbf7fcb/ZipEntry.java/buggy/src/main/java/org/codehaus/plexus/archiver/zip/ZipEntry.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1250,
10126,
1435,
288,
3639,
327,
1723,
7675,
5839,
1190,
2932,
4898,
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,
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,
377,
1071,
1250,
10126,
1435,
288,
3639,
327,
1723,
7675,
5839,
1190,
2932,
4898,
1769,
565,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
public TA_RetCode CDLMORNINGDOJISTAR( int startIdx, int endIdx, double inOpen[], double inHigh[], double inLow[], double inClose[], double optInPenetration, MInteger outBegIdx, MInteger outNbElement, int outInteger[] ){ double BodyDojiPeriodTotal, BodyLongPeriodTotal, BodyShortPeriodTotal; int i, outIdx, BodyDojiTrailingIdx, BodyLongTrailingIdx, BodyShortTrailingIdx, lookbackTotal; 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( optInPenetration == (-4e+37) ) optInPenetration = 3.000000e-1; else if( (optInPenetration < 0.000000e+0) || (optInPenetration > 3.000000e+37) ) return TA_RetCode. TA_BAD_PARAM; lookbackTotal = CDLMORNINGDOJISTAR_Lookback (optInPenetration); if( startIdx < lookbackTotal ) startIdx = lookbackTotal; if( startIdx > endIdx ) { outBegIdx.value = 0 ; outNbElement.value = 0 ; return TA_RetCode. TA_SUCCESS; } BodyLongPeriodTotal = 0; BodyDojiPeriodTotal = 0; BodyShortPeriodTotal = 0; BodyLongTrailingIdx = startIdx -2 - (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].avgPeriod) ; BodyDojiTrailingIdx = startIdx -1 - (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].avgPeriod) ; BodyShortTrailingIdx = startIdx - (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].avgPeriod) ; i = BodyLongTrailingIdx; while( i < startIdx-2 ) { BodyLongPeriodTotal += ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i] - inOpen[i] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i] - inLow[i] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[i] - ( inClose[i] >= inOpen[i] ? inClose[i] : inOpen[i] ) ) + ( ( inClose[i] >= inOpen[i] ? inOpen[i] : inClose[i] ) - inLow[i] ) : 0 ) ) ) ; i++; } i = BodyDojiTrailingIdx; while( i < startIdx-1 ) { BodyDojiPeriodTotal += ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i] - inOpen[i] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i] - inLow[i] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[i] - ( inClose[i] >= inOpen[i] ? inClose[i] : inOpen[i] ) ) + ( ( inClose[i] >= inOpen[i] ? inOpen[i] : inClose[i] ) - inLow[i] ) : 0 ) ) ) ; i++; } i = BodyShortTrailingIdx; while( i < startIdx ) { BodyShortPeriodTotal += ( (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i] - inOpen[i] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i] - inLow[i] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[i] - ( inClose[i] >= inOpen[i] ? inClose[i] : inOpen[i] ) ) + ( ( inClose[i] >= inOpen[i] ? inOpen[i] : inClose[i] ) - inLow[i] ) : 0 ) ) ) ; i++; } i = startIdx; outIdx = 0; do { if( ( Math.abs ( inClose[i-2] - inOpen[i-2] ) ) > ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].factor) * ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].avgPeriod) != 0.0? BodyLongPeriodTotal / (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].avgPeriod) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i-2] - inOpen[i-2] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i-2] - inLow[i-2] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[i-2] - ( inClose[i-2] >= inOpen[i-2] ? inClose[i-2] : inOpen[i-2] ) ) + ( ( inClose[i-2] >= inOpen[i-2] ? inOpen[i-2] : inClose[i-2] ) - inLow[i-2] ) : 0 ) ) ) ) / ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? 2.0 : 1.0 ) ) && ( inClose[i-2] >= inOpen[i-2] ? 1 : -1 ) == -1 && ( Math.abs ( inClose[i-1] - inOpen[i-1] ) ) <= ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].factor) * ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].avgPeriod) != 0.0? BodyDojiPeriodTotal / (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].avgPeriod) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i-1] - inOpen[i-1] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i-1] - inLow[i-1] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[i-1] - ( inClose[i-1] >= inOpen[i-1] ? inClose[i-1] : inOpen[i-1] ) ) + ( ( inClose[i-1] >= inOpen[i-1] ? inOpen[i-1] : inClose[i-1] ) - inLow[i-1] ) : 0 ) ) ) ) / ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? 2.0 : 1.0 ) ) && ( (((inOpen[i-1]) > (inClose[i-1])) ? (inOpen[i-1]) : (inClose[i-1])) < (((inOpen[i-2]) < (inClose[i-2])) ? (inOpen[i-2]) : (inClose[i-2])) ) && ( Math.abs ( inClose[i] - inOpen[i] ) ) > ( (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].factor) * ( (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].avgPeriod) != 0.0? BodyShortPeriodTotal / (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].avgPeriod) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i] - inOpen[i] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i] - inLow[i] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[i] - ( inClose[i] >= inOpen[i] ? inClose[i] : inOpen[i] ) ) + ( ( inClose[i] >= inOpen[i] ? inOpen[i] : inClose[i] ) - inLow[i] ) : 0 ) ) ) ) / ( (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? 2.0 : 1.0 ) ) && ( inClose[i] >= inOpen[i] ? 1 : -1 ) == 1 && inClose[i] > inClose[i-2] + ( Math.abs ( inClose[i-2] - inOpen[i-2] ) ) * optInPenetration ) outInteger[outIdx++] = 100; else outInteger[outIdx++] = 0; BodyLongPeriodTotal += ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i-2] - inOpen[i-2] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i-2] - inLow[i-2] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[i-2] - ( inClose[i-2] >= inOpen[i-2] ? inClose[i-2] : inOpen[i-2] ) ) + ( ( inClose[i-2] >= inOpen[i-2] ? inOpen[i-2] : inClose[i-2] ) - inLow[i-2] ) : 0 ) ) ) - ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[BodyLongTrailingIdx] - inOpen[BodyLongTrailingIdx] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[BodyLongTrailingIdx] - inLow[BodyLongTrailingIdx] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyLong.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[BodyLongTrailingIdx] - ( inClose[BodyLongTrailingIdx] >= inOpen[BodyLongTrailingIdx] ? inClose[BodyLongTrailingIdx] : inOpen[BodyLongTrailingIdx] ) ) + ( ( inClose[BodyLongTrailingIdx] >= inOpen[BodyLongTrailingIdx] ? inOpen[BodyLongTrailingIdx] : inClose[BodyLongTrailingIdx] ) - inLow[BodyLongTrailingIdx] ) : 0 ) ) ) ; BodyDojiPeriodTotal += ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i-1] - inOpen[i-1] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i-1] - inLow[i-1] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[i-1] - ( inClose[i-1] >= inOpen[i-1] ? inClose[i-1] : inOpen[i-1] ) ) + ( ( inClose[i-1] >= inOpen[i-1] ? inOpen[i-1] : inClose[i-1] ) - inLow[i-1] ) : 0 ) ) ) - ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[BodyDojiTrailingIdx] - inOpen[BodyDojiTrailingIdx] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[BodyDojiTrailingIdx] - inLow[BodyDojiTrailingIdx] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyDoji.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[BodyDojiTrailingIdx] - ( inClose[BodyDojiTrailingIdx] >= inOpen[BodyDojiTrailingIdx] ? inClose[BodyDojiTrailingIdx] : inOpen[BodyDojiTrailingIdx] ) ) + ( ( inClose[BodyDojiTrailingIdx] >= inOpen[BodyDojiTrailingIdx] ? inOpen[BodyDojiTrailingIdx] : inClose[BodyDojiTrailingIdx] ) - inLow[BodyDojiTrailingIdx] ) : 0 ) ) ) ; BodyShortPeriodTotal += ( (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[i] - inOpen[i] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[i] - inLow[i] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[i] - ( inClose[i] >= inOpen[i] ? inClose[i] : inOpen[i] ) ) + ( ( inClose[i] >= inOpen[i] ? inOpen[i] : inClose[i] ) - inLow[i] ) : 0 ) ) ) - ( (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_RealBody ? ( Math.abs ( inClose[BodyShortTrailingIdx] - inOpen[BodyShortTrailingIdx] ) ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_HighLow ? ( inHigh[BodyShortTrailingIdx] - inLow[BodyShortTrailingIdx] ) : ( (this.candleSettings[TA_CandleSettingType.TA_BodyShort.ordinal()].rangeType) == TA_RangeType. TA_RangeType_Shadows ? ( inHigh[BodyShortTrailingIdx] - ( inClose[BodyShortTrailingIdx] >= inOpen[BodyShortTrailingIdx] ? inClose[BodyShortTrailingIdx] : inOpen[BodyShortTrailingIdx] ) ) + ( ( inClose[BodyShortTrailingIdx] >= inOpen[BodyShortTrailingIdx] ? inOpen[BodyShortTrailingIdx] : inClose[BodyShortTrailingIdx] ) - inLow[BodyShortTrailingIdx] ) : 0 ) ) ) ; i++; BodyLongTrailingIdx++; BodyDojiTrailingIdx++; BodyShortTrailingIdx++; } while( i <= endIdx ); outNbElement.value = outIdx; outBegIdx.value = startIdx; return TA_RetCode. TA_SUCCESS;} | 2365 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2365/69e0567047ad75d101e30d35826ecbb51165ba43/Core.java/buggy/ta-lib/java/src/TA/Lib/Core.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
1071,
399,
37,
67,
7055,
1085,
385,
8914,
49,
916,
15870,
3191,
46,
5511,
985,
12,
509,
27108,
16,
509,
679,
4223,
16,
1645,
316,
3678,
63,
6487,
1645,
316,
8573,
63,
6487,
1645,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1071,
399,
37,
67,
7055,
1085,
385,
8914,
49,
916,
15870,
3191,
46,
5511,
985,
12,
509,
27108,
16,
509,
679,
4223,
16,
1645,
316,
3678,
63,
6487,
1645,
316,
8573,
63,
6487,
1645,
316,
... | ||
throw new Error ("not implemented"); | return Math.max(0, -(float) bounds.getMinY()); | public float getAscent () throws NotImplementedException { throw new Error ("not implemented"); } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/53983e95556bf4b775130b06570aa2ea08d85628/ShapeGraphicAttribute.java/clean/core/src/classpath/java/java/awt/font/ShapeGraphicAttribute.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
1431,
4506,
1017,
319,
1832,
565,
1216,
10051,
503,
225,
288,
565,
327,
2361,
18,
1896,
12,
20,
16,
300,
12,
5659,
13,
4972,
18,
588,
2930,
61,
10663,
225,
289,
2,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
1431,
4506,
1017,
319,
1832,
565,
1216,
10051,
503,
225,
288,
565,
327,
2361,
18,
1896,
12,
20,
16,
300,
12,
5659,
13,
4972,
18,
588,
2930,
61,
10663,
225,
289,
2,
-100,
-100,
-... |
initialized = true; | public void initialise() throws InitialisationException { if (!locateServer && !createServer) { throw new InitialisationException(new Message(Messages.JMX_CREATE_OR_LOCATE_SHOULD_BE_SET), this); } if (mBeanServer == null && locateServer) { List l = MBeanServerFactory.findMBeanServer(null); if (l != null && l.size() > 0) { mBeanServer = (MBeanServer) l.get(0); } } if (mBeanServer == null && createServer) { mBeanServer = MBeanServerFactory.createMBeanServer(); serverCreated = true; } if (mBeanServer == null) { throw new InitialisationException(new Message(Messages.JMX_CANT_LOCATE_CREATE_SERVER), this); } if (connectorServerUrl != null) { try { JMXServiceURL url = new JMXServiceURL(connectorServerUrl); connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, mBeanServer); } catch (Exception e) { throw new InitialisationException(new Message(Messages.FAILED_TO_CREATE_X, "Jmx Connector"), e, this); } } //We need to register all the services once the server has initialised MuleManager.getInstance().registerListener(new ModelEventListener() { public void onEvent(UMOServerEvent event) { if (event.getAction() == ModelEvent.MODEL_INITIALISED) { try { registerStatisticsService(); registerMuleService(); //registerConfigurationService(); registerModelService(); registerComponentServices(); } catch (Exception e) { throw new MuleRuntimeException(new Message(Messages.X_FAILED_TO_INITIALISE, "MBeans"), e); } } } }); } | 28323 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/28323/de6b8d6a2952ee98264d7f90d7d7657b75bf5546/JmxAgent.java/clean/mule/src/java/org/mule/management/agents/JmxAgent.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
6454,
273,
638,
31,
6454,
273,
638,
31,
6454,
273,
638,
31,
6454,
273,
638,
31,
1071,
13227,
273,
638,
31,
918,
13227,
273,
638,
31,
21301,
1435,
13227,
273,
638,
31,
1216,
13227,
273,
638,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6454,
273,
638,
31,
6454,
273,
638,
31,
6454,
273,
638,
31,
6454,
273,
638,
31,
1071,
13227,
273,
638,
31,
918,
13227,
273,
638,
31,
21301,
1435,
13227,
273,
638,
31,
1216,
13227,
273,
638,
... | |
public void scenario() { FileDialog fd = new FileDialog(frame, "Select a scenario file...", FileDialog.LOAD); fd.setDirectory("data" + File.separatorChar + "scenarios"); // the filter doesn't seem to do anything in windows. oh well FilenameFilter ff = new FilenameFilter() { public boolean accept(File f, String s) { return s.endsWith(".mms"); } }; fd.setFilenameFilter(ff); fd.show(); if (fd.getFile() == null) { return; } ScenarioLoader sl = new ScenarioLoader(new File(fd.getDirectory(), fd.getFile())); Game g = null; try { g = sl.createGame(); } catch (Exception e) { new AlertDialog(frame, "Host Scenario", "Error: " + e.getMessage()).show(); return; } // get player types and colors set Player[] pa = new Player[g.getPlayersVector().size()]; g.getPlayersVector().copyInto(pa); ScenarioDialog sd = new ScenarioDialog(frame, pa); sd.show(); if (!sd.bSet) { return; } // host with the scenario. essentially copied from host() HostDialog hd = new HostDialog(frame); hd.yourNameF.setText(sd.localName); hd.show(); // verify dialog data if(hd.name == null || hd.serverPass == null || hd.port == 0) { return; } // start server server = new Server(hd.serverPass, hd.port); server.setGame(g); // apply any scenario damage sl.applyDamage(server); if (sd.localName != "") { // initialize game client = new Client(frame, hd.name); // verify connection if(!client.connect("localhost", hd.port)) { server = null; client = null; new AlertDialog(frame, "Host a Game", "Error: could not connect to local server.").show(); return; } // wait for full connection client.retrieveServerInfo(); // popup options dialog client.getGameOptionsDialog().update(client.game.getOptions()); client.getGameOptionsDialog().show(); } // setup any bots for (int x = 0; x < pa.length; x++) { if (sd.playerTypes[x] == sd.T_BOT) { Frame f = new Frame("MegaMek Bot"); Client c = BotFactory.getBot(BotFactory.TEST, f, pa[x].getName()); c.connect("localhost", hd.port); c.retrieveServerInfo(); ((BotClientWrapper)c).initialize(); //f.hide(); } } } | 4135 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4135/9f3ce3141645c545855f4acf7ea4fa44b982a77b/MegaMek.java/clean/megamek/src/megamek/MegaMek.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
10766,
1435,
288,
3639,
1387,
6353,
5194,
273,
394,
1387,
6353,
12,
3789,
16,
1171,
315,
3391,
279,
10766,
585,
7070,
16,
7734,
1387,
6353,
18,
7783,
1769,
3639,
5194,
18,
542,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10766,
1435,
288,
3639,
1387,
6353,
5194,
273,
394,
1387,
6353,
12,
3789,
16,
1171,
315,
3391,
279,
10766,
585,
7070,
16,
7734,
1387,
6353,
18,
7783,
1769,
3639,
5194,
18,
542,... | ||
else | if ( !artifact.getFile().exists() || localMetadata.newerThanFile( artifact.getFile() ) ) | public void transformForResolve( Artifact artifact, List remoteRepositories, ArtifactRepository localRepository ) throws ArtifactMetadataRetrievalException { Matcher m = SnapshotArtifactMetadata.VERSION_FILE_PATTERN.matcher( artifact.getBaseVersion() ); if ( m.matches() ) { // This corrects the base version, but ensure it is not resolved again artifact.setBaseVersion( m.group( 1 ) + "-SNAPSHOT" ); } else if ( isSnapshot( artifact ) ) { SnapshotArtifactMetadata localMetadata; try { localMetadata = SnapshotArtifactMetadata.readFromLocalRepository( artifact, localRepository ); } catch ( ArtifactPathFormatException e ) { throw new ArtifactMetadataRetrievalException( "Error reading local metadata", e ); } catch ( IOException e ) { throw new ArtifactMetadataRetrievalException( "Error reading local metadata", e ); } boolean alreadyResolved = alreadyResolved( artifact ); if ( !alreadyResolved ) { boolean checkedUpdates = false; for ( Iterator i = remoteRepositories.iterator(); i.hasNext(); ) { ArtifactRepository remoteRepository = (ArtifactRepository) i.next(); String snapshotPolicy = remoteRepository.getSnapshotPolicy(); // TODO: should be able to calculate this less often boolean checkForUpdates = false; if ( ArtifactRepository.SNAPSHOT_POLICY_ALWAYS.equals( snapshotPolicy ) ) { checkForUpdates = true; } else if ( ArtifactRepository.SNAPSHOT_POLICY_DAILY.equals( snapshotPolicy ) ) { // Note that if last modified is 0, it didn't exist, so this will be true if ( getMidnightBoundary().after( new Date( localMetadata.getLastModified() ) ) ) { checkForUpdates = true; } } else if ( snapshotPolicy.startsWith( ArtifactRepository.SNAPSHOT_POLICY_INTERVAL ) ) { String s = snapshotPolicy.substring( ArtifactRepository.SNAPSHOT_POLICY_INTERVAL.length() + 1 ); int minutes = Integer.valueOf( s ).intValue(); Calendar cal = Calendar.getInstance(); cal.add( Calendar.MINUTE, -minutes ); // Note that if last modified is 0, it didn't exist, so this will be true if ( cal.getTime().after( new Date( localMetadata.getLastModified() ) ) ) { checkForUpdates = true; } } // else assume "never" if ( checkForUpdates ) { getLogger().info( artifact.getArtifactId() + ": checking for updates from " + remoteRepository.getId() ); SnapshotArtifactMetadata remoteMetadata = SnapshotArtifactMetadata.retrieveFromRemoteRepository( artifact, remoteRepository, wagonManager ); if ( remoteMetadata.compareTo( localMetadata ) > 0 ) { artifact.setRepository( remoteRepository ); localMetadata = remoteMetadata; } checkedUpdates = true; } } if ( checkedUpdates ) { localMetadata.storeInLocalRepository( localRepository ); } resolvedArtifactCache.add( getCacheKey( artifact ) ); } // TODO: if the POM and JAR are inconsistent, this might mean that different version of each are used if ( artifact.getFile().exists() && !localMetadata.newerThanFile( artifact.getFile() ) ) { if ( !alreadyResolved ) { // Locally installed file is newer, don't use the resolved version getLogger().info( artifact.getArtifactId() + ": using locally installed snapshot" ); } } else { String version = localMetadata.constructVersion(); if ( getLogger().isInfoEnabled() ) { if ( !version.equals( artifact.getBaseVersion() ) && !alreadyResolved ) { String message = artifact.getArtifactId() + ": resolved to version " + version; if ( artifact.getRepository() != null ) { message += " from repository " + artifact.getRepository().getId(); } else { message += " from local repository"; } getLogger().info( message ); } } artifact.setVersion( version ); try { artifact.setFile( new File( localRepository.getBasedir(), localRepository.pathOf( artifact ) ) ); } catch ( ArtifactPathFormatException e ) { throw new ArtifactMetadataRetrievalException( "Error reading local metadata", e ); } } } } | 11530 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11530/4b0f51b9a19c7b03fefdf8d0f44fa5f4de663bd0/SnapshotTransformation.java/buggy/maven-artifact/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
2510,
1290,
8460,
12,
14022,
6462,
16,
987,
2632,
18429,
16,
14022,
3305,
1191,
3305,
262,
3639,
1216,
14022,
2277,
27356,
503,
565,
288,
3639,
9757,
312,
273,
10030,
7581,
2277,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2510,
1290,
8460,
12,
14022,
6462,
16,
987,
2632,
18429,
16,
14022,
3305,
1191,
3305,
262,
3639,
1216,
14022,
2277,
27356,
503,
565,
288,
3639,
9757,
312,
273,
10030,
7581,
2277,... |
public void mT48() throws RecognitionException { try { ruleNestingLevel++; int _type = T48; int _start = getCharIndex(); int _line = getLine(); int _charPosition = getCharPositionInLine(); int _channel = Token.DEFAULT_CHANNEL; // D:\\workspace\\jboss\\jbossrules\\drools-compiler\\src\\main\\resources\\org\\drools\\lang\\DRL.g:28:7: ( 'accumulate' ) // D:\\workspace\\jboss\\jbossrules\\drools-compiler\\src\\main\\resources\\org\\drools\\lang\\DRL.g:28:7: 'accumulate' { match("accumulate"); if (failed) return ; } if ( backtracking==0 ) { if ( token==null && ruleNestingLevel==1 ) { emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1); } } } finally { ruleNestingLevel--; } } | 31577 /local/tlutelli/issta_data/temp/all_java3context/java/2006_temp/2006/31577/63bc7036e62ae854cec463d59712c173f74e984c/DRLLexer.java/clean/drools-compiler/src/main/java/org/drools/lang/DRLLexer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
21115,
8875,
1435,
1216,
9539,
288,
3639,
775,
288,
5411,
1720,
50,
10100,
2355,
9904,
31,
5411,
509,
389,
723,
273,
399,
8875,
31,
5411,
509,
389,
1937,
273,
23577,
1016,
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,
918,
21115,
8875,
1435,
1216,
9539,
288,
3639,
775,
288,
5411,
1720,
50,
10100,
2355,
9904,
31,
5411,
509,
389,
723,
273,
399,
8875,
31,
5411,
509,
389,
1937,
273,
23577,
1016,
5621... | ||
}); } catch (InterruptedException e) { return; } catch (InvocationTargetException e) { MakeUIPlugin.logException(e, MakeUIPlugin.getResourceString("UpdateMakeProjectAction.exception.error"), MakeUIPlugin.getResourceString("UpdateMakeProjectAction.eception.message")); | if (project != null) { projects.add(project); } } final IProject[] projectArray = (IProject[]) projects.toArray(new IProject[projects.size()]); UpdateMakeProjectWizard wizard = new UpdateMakeProjectWizard(projectArray); WizardDialog dialog = new WizardDialog(MakeUIPlugin.getActiveWorkbenchShell(), wizard); dialog.open(); | static public void run(boolean fork, IRunnableContext context, final IProject[] projects) { try { context.run(fork, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { IWorkspaceRunnable runnable = new IWorkspaceRunnable() { public void run(IProgressMonitor monitor) throws CoreException { doProjectUpdate(monitor, projects); } }; MakeUIPlugin.getWorkspace().run(runnable, monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } catch (OperationCanceledException e) { throw new InterruptedException(e.getMessage()); } } }); } catch (InterruptedException e) { return; } catch (InvocationTargetException e) { MakeUIPlugin.logException(e, MakeUIPlugin.getResourceString("UpdateMakeProjectAction.exception.error"), MakeUIPlugin.getResourceString("UpdateMakeProjectAction.eception.message")); //$NON-NLS-1$ //$NON-NLS-2$ } } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/17464c08f4d94cc47098c0d0ca9a1f7ddc481fe8/UpdateMakeProjectAction.java/clean/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/UpdateMakeProjectAction.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
3845,
1071,
918,
1086,
12,
6494,
12515,
16,
467,
20013,
1042,
819,
16,
727,
467,
4109,
8526,
10137,
13,
288,
202,
202,
698,
288,
1082,
202,
2472,
18,
2681,
12,
23335,
16,
638,
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,
225,
202,
3845,
1071,
918,
1086,
12,
6494,
12515,
16,
467,
20013,
1042,
819,
16,
727,
467,
4109,
8526,
10137,
13,
288,
202,
202,
698,
288,
1082,
202,
2472,
18,
2681,
12,
23335,
16,
638,
16,
... |
protected void setDocumentClassName(String documentClassName) { // normalize class name if (documentClassName == null) { documentClassName = DEFAULT_DOCUMENT_CLASS_NAME; } // verify that this class exists and is of the right type try { Class _class = ObjectFactory.findProviderClass(documentClassName, ObjectFactory.findClassLoader(), true); //if (!_class.isAssignableFrom(Document.class)) { if (!Document.class.isAssignableFrom(_class)) { // REVISIT: message throw new IllegalArgumentException("PAR002 Class, \"" + documentClassName + "\", is not of type org.w3c.dom.Document.\n" + documentClassName); } } catch (ClassNotFoundException e) { // REVISIT: message throw new IllegalArgumentException("PAR003 Class, \"" + documentClassName + "\", not found.\n" + documentClassName); } // set document class name fDocumentClassName = documentClassName; if (!documentClassName.equals(DEFAULT_DOCUMENT_CLASS_NAME)) { fDeferNodeExpansion = false; } } // setDocumentClassName(String) | 4434 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4434/9d1dbf89c75cf6f564facc2b605dd9f2cf2dac4d/AbstractDOMParser.java/clean/src/org/apache/xerces/parsers/AbstractDOMParser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
918,
444,
2519,
3834,
12,
780,
1668,
3834,
13,
288,
3639,
368,
3883,
667,
508,
3639,
309,
261,
5457,
3834,
422,
446,
13,
288,
5411,
1668,
3834,
273,
3331,
67,
18450,
67,
5237,
67,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
444,
2519,
3834,
12,
780,
1668,
3834,
13,
288,
3639,
368,
3883,
667,
508,
3639,
309,
261,
5457,
3834,
422,
446,
13,
288,
5411,
1668,
3834,
273,
3331,
67,
18450,
67,
5237,
67,... | ||
if (((Comparable) this.theResult).compareTo(other.theResult) == -1) { return this; } else { return other; } | try { if (((Comparable) this.theResult).compareTo(other.getResult()) <= 0) { return this; } else { return other; } } catch (NoResultsException e) { return this; } | public Result returnTheBest(Result other) { if (((Comparable) this.theResult).compareTo(other.theResult) == -1) { return this; } else { return other; } } | 14315 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/14315/e16010995aca23bab08debf55adb3babc6937a6e/Result.java/buggy/src/org/objectweb/proactive/p2p/api/core/Result.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
3438,
327,
1986,
14173,
12,
1253,
1308,
13,
288,
3639,
309,
261,
12443,
799,
10207,
13,
333,
18,
5787,
1253,
2934,
9877,
774,
12,
3011,
18,
5787,
1253,
13,
422,
300,
21,
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,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
3438,
327,
1986,
14173,
12,
1253,
1308,
13,
288,
3639,
309,
261,
12443,
799,
10207,
13,
333,
18,
5787,
1253,
2934,
9877,
774,
12,
3011,
18,
5787,
1253,
13,
422,
300,
21,
13,
288,
... |
mkdirs(new File(src.toString()).getParent()); | mkdirs(NDFSFile.getNDFSParent(src.toString())); | public boolean addFile(UTF8 src, Block blocks[]) { waitForReady(); // Always do an implicit mkdirs for parent directory tree mkdirs(new File(src.toString()).getParent()); if (unprotectedAddFile(src, blocks)) { logEdit(OP_ADD, src, new ArrayWritable(Block.class, blocks)); return true; } else { return false; } } | 1316 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1316/6d50255deeb1396d5f91cb2195cc40e26f5354a6/FSDirectory.java/clean/src/java/org/apache/nutch/ndfs/FSDirectory.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1250,
18671,
12,
5159,
28,
1705,
16,
3914,
4398,
63,
5717,
288,
3639,
10712,
8367,
5621,
3639,
368,
14178,
741,
392,
10592,
18095,
364,
982,
1867,
2151,
3639,
18095,
12,
2908,
4931,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1250,
18671,
12,
5159,
28,
1705,
16,
3914,
4398,
63,
5717,
288,
3639,
10712,
8367,
5621,
3639,
368,
14178,
741,
392,
10592,
18095,
364,
982,
1867,
2151,
3639,
18095,
12,
2908,
4931,
... |
Proxy proxySettings = TasksUiPlugin.getDefault().getProxySettings(); | protected void submitToRepository() { if (!prepareSubmit()) { return; } updateTask(); Proxy proxySettings = TasksUiPlugin.getDefault().getProxySettings(); boolean wrap = IBugzillaConstants.BugzillaServerVersion.SERVER_218.equals(repository.getVersion()); try { final BugzillaReportSubmitForm bugzillaReportSubmitForm = BugzillaReportSubmitForm.makeNewBugPost( repository.getUrl(), repository.getUserName(), repository.getPassword(), proxySettings, repository .getCharacterEncoding(), taskData, wrap); submissionHandler.submitBugReport(bugzillaReportSubmitForm, submitJobListener, false, getCategory()); } catch (UnsupportedEncodingException e) { MessageDialog.openError(null, "Posting Error", "Ensure proper encoding selected in " + TaskRepositoriesView.NAME + "."); return; } catch (Exception e) { MylarStatusHandler.fail(e, "Posting Error. Ensure proper configuration in " + TaskRepositoriesView.NAME + ".", true); return; } } | 51989 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51989/ae6d1d8e8f64e8ff722972ae7d06a9023e6ed588/NewBugzillaTaskEditor.java/clean/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/NewBugzillaTaskEditor.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
918,
4879,
774,
3305,
1435,
288,
202,
202,
430,
16051,
9366,
11620,
10756,
288,
1082,
202,
2463,
31,
202,
202,
97,
202,
202,
2725,
2174,
5621,
202,
202,
3886,
2889,
2628,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4879,
774,
3305,
1435,
288,
202,
202,
430,
16051,
9366,
11620,
10756,
288,
1082,
202,
2463,
31,
202,
202,
97,
202,
202,
2725,
2174,
5621,
202,
202,
3886,
2889,
2628,
273,
... | |
synchronized (queueHandlerLock) { if (! isQueueHandlerStarted ) { getQueueHandler().start(); isQueueHandlerStarted = true; } else { System.err.println( "QueueHandler in " + getAgentIdentifier() + " asked to restart."); } } | synchronized (queueHandlerLock) { if (! isQueueHandlerStarted ) { getQueueHandler().start(); isQueueHandlerStarted = true; } else { System.err.println( "QueueHandler in " + getAgentIdentifier() + " asked to restart."); } } | private void startQueueHandler() { synchronized (queueHandlerLock) { if (! isQueueHandlerStarted ) { getQueueHandler().start(); isQueueHandlerStarted = true; } else { System.err.println( "QueueHandler in " + getAgentIdentifier() + " asked to restart."); } } } | 7981 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7981/58e8bb8b6b85c3ba06f165be059c1b105683d23c/SimpleAgent.java/buggy/core/src/org/cougaar/core/agent/SimpleAgent.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
918,
787,
3183,
1503,
1435,
288,
202,
22043,
261,
4000,
1503,
2531,
13,
288,
202,
225,
309,
16051,
353,
3183,
1503,
9217,
262,
288,
202,
202,
588,
3183,
1503,
7675,
1937,
5621,
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,
282,
3238,
918,
787,
3183,
1503,
1435,
288,
202,
22043,
261,
4000,
1503,
2531,
13,
288,
202,
225,
309,
16051,
353,
3183,
1503,
9217,
262,
288,
202,
202,
588,
3183,
1503,
7675,
1937,
5621,
202,... |
public void ruleAction(int ruleNumber) { if (bad_rule != 0) return; switch (ruleNumber) { // // Rule 1: identifier ::= IDENTIFIER // case 1: { if (prsStream.getKind(btParser.getToken(1)) != X10Parsersym.TK_IDENTIFIER && (Report.should_report("parser", 2))) { Report.report(2,"Parser turning keyword " + prsStream.getName(btParser.getToken(1)) + " at " + prsStream.getLine(btParser.getToken(1)) + ":" + prsStream.getColumn(btParser.getToken(1)) + " into an identifier"); } break; } // // Rule 2: PrimitiveType ::= NumericType // case 2: break; // // Rule 3: PrimitiveType ::= boolean // case 3: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Boolean())); break; } // // Rule 4: NumericType ::= IntegralType // case 4: break; // // Rule 5: NumericType ::= FloatingPointType // case 5: break; // // Rule 6: IntegralType ::= byte // case 6: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Byte())); break; } // // Rule 7: IntegralType ::= char // case 7: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Char())); break; } // // Rule 8: IntegralType ::= short // case 8: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Short())); break; } // // Rule 9: IntegralType ::= int // case 9: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Int())); break; } // // Rule 10: IntegralType ::= long // case 10: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Long())); break; } // // Rule 11: FloatingPointType ::= float // case 11: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Float())); break; } // // Rule 12: FloatingPointType ::= double // case 12: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Double())); break; } // // Rule 13: ReferenceType ::= ClassOrInterfaceType // case 13: break; // // Rule 14: ReferenceType ::= ArrayType // case 14: break; // // Rule 15: ClassType ::= TypeName // case 15: {//vj assert(btParser.getSym(2) == null); // generic not yet supported Name a = (Name) btParser.getSym(1); btParser.setSym1(a.toType()); break; } // // Rule 16: InterfaceType ::= TypeName // case 16: {//vj assert(btParser.getSym(2) == null); // generic not yet supported Name a = (Name) btParser.getSym(1); btParser.setSym1(a.toType()); break; } // // Rule 17: TypeName ::= identifier // case 17: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 18: TypeName ::= TypeName . identifier // case 18: { Name a = (Name) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); btParser.setSym1(new Name(nf, ts, pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier())); break; } // // Rule 19: ClassName ::= TypeName // case 19: break; // // Rule 20: TypeVariable ::= identifier // case 20: break; // // Rule 21: ArrayType ::= Type [ ] // case 21: { TypeNode a = (TypeNode) btParser.getSym(1); btParser.setSym1(nf.array(a, pos(), 1)); break; } // // Rule 22: TypeParameter ::= TypeVariable TypeBoundopt // case 22: bad_rule = 22; break; // // Rule 23: TypeBound ::= extends ClassOrInterfaceType AdditionalBoundListopt // case 23: bad_rule = 23; break; // // Rule 24: AdditionalBoundList ::= AdditionalBound // case 24: bad_rule = 24; break; // // Rule 25: AdditionalBoundList ::= AdditionalBoundList AdditionalBound // case 25: bad_rule = 25; break; // // Rule 26: AdditionalBound ::= & InterfaceType // case 26: bad_rule = 26; break; // // Rule 27: TypeArguments ::= < ActualTypeArgumentList > // case 27: bad_rule = 27; break; // // Rule 28: ActualTypeArgumentList ::= ActualTypeArgument // case 28: bad_rule = 28; break; // // Rule 29: ActualTypeArgumentList ::= ActualTypeArgumentList , ActualTypeArgument // case 29: bad_rule = 29; break; // // Rule 30: Wildcard ::= ? WildcardBoundsOpt // case 30: bad_rule = 30; break; // // Rule 31: WildcardBounds ::= extends ReferenceType // case 31: bad_rule = 31; break; // // Rule 32: WildcardBounds ::= super ReferenceType // case 32: bad_rule = 32; break; // // Rule 33: PackageName ::= identifier // case 33: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 34: PackageName ::= PackageName . identifier // case 34: { Name a = (Name) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); btParser.setSym1(new Name(nf, ts, pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier())); break; } // // Rule 35: ExpressionName ::= identifier // case 35: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 36: ExpressionName ::= AmbiguousName . identifier // case 36: { Name a = (Name) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); btParser.setSym1(new Name(nf, ts, pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier())); break; } // // Rule 37: MethodName ::= identifier // case 37: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 38: MethodName ::= AmbiguousName . identifier // case 38: { Name a = (Name) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); btParser.setSym1(new Name(nf, ts, pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier())); break; } // // Rule 39: PackageOrTypeName ::= identifier // case 39: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 40: PackageOrTypeName ::= PackageOrTypeName . identifier // case 40: { Name a = (Name) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); btParser.setSym1(new Name(nf, ts, pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier())); break; } // // Rule 41: AmbiguousName ::= identifier // case 41: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 42: AmbiguousName ::= AmbiguousName . identifier // case 42: { Name a = (Name) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); btParser.setSym1(new Name(nf, ts, pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier())); break; } // // Rule 43: CompilationUnit ::= PackageDeclarationopt ImportDeclarationsopt TypeDeclarationsopt // case 43: { PackageNode a = (PackageNode) btParser.getSym(1); List b = (List) btParser.getSym(2), c = (List) btParser.getSym(3); // Add import x10.lang.* by default. Name x10 = new Name(nf, ts, pos(), "x10"); Name x10Lang = new Name(nf, ts, pos(), x10, "lang"); Import x10LangImport = nf.Import(pos(btParser.getFirstToken(), btParser.getLastToken()), Import.PACKAGE, x10Lang.toString()); b.add(x10LangImport); btParser.setSym1(nf.SourceFile(pos(btParser.getFirstToken(), btParser.getLastToken()), a, b, c)); break; } // // Rule 44: ImportDeclarations ::= ImportDeclaration // case 44: { List l = new TypedList(new LinkedList(), Import.class, false); Import a = (Import) btParser.getSym(1); l.add(a); btParser.setSym1(l); break; } // // Rule 45: ImportDeclarations ::= ImportDeclarations ImportDeclaration // case 45: { List l = (TypedList) btParser.getSym(1); Import b = (Import) btParser.getSym(2); if (b != null) l.add(b); //btParser.setSym1(l); break; } // // Rule 46: TypeDeclarations ::= TypeDeclaration // case 46: { List l = new TypedList(new LinkedList(), TopLevelDecl.class, false); TopLevelDecl a = (TopLevelDecl) btParser.getSym(1); if (a != null) l.add(a); btParser.setSym1(l); break; } // // Rule 47: TypeDeclarations ::= TypeDeclarations TypeDeclaration // case 47: { List l = (TypedList) btParser.getSym(1); TopLevelDecl b = (TopLevelDecl) btParser.getSym(2); if (b != null) l.add(b); //btParser.setSym1(l); break; } // // Rule 48: PackageDeclaration ::= package PackageName ; // case 48: {//vj assert(btParser.getSym(1) == null); // generic not yet supported Name a = (Name) btParser.getSym(2); btParser.setSym1(a.toPackage()); break; } // // Rule 49: ImportDeclaration ::= SingleTypeImportDeclaration // case 49: break; // // Rule 50: ImportDeclaration ::= TypeImportOnDemandDeclaration // case 50: break; // // Rule 51: ImportDeclaration ::= SingleStaticImportDeclaration // case 51: break; // // Rule 52: ImportDeclaration ::= StaticImportOnDemandDeclaration // case 52: break; // // Rule 53: SingleTypeImportDeclaration ::= import TypeName ; // case 53: { Name a = (Name) btParser.getSym(2); btParser.setSym1(nf.Import(pos(btParser.getFirstToken(), btParser.getLastToken()), Import.CLASS, a.toString())); break; } // // Rule 54: TypeImportOnDemandDeclaration ::= import PackageOrTypeName . * ; // case 54: { Name a = (Name) btParser.getSym(2); btParser.setSym1(nf.Import(pos(btParser.getFirstToken(), btParser.getLastToken()), Import.PACKAGE, a.toString())); break; } // // Rule 55: SingleStaticImportDeclaration ::= import static TypeName . identifier ; // case 55: bad_rule = 55; break; // // Rule 56: StaticImportOnDemandDeclaration ::= import static TypeName . * ; // case 56: bad_rule = 56; break; // // Rule 57: TypeDeclaration ::= ClassDeclaration // case 57: break; // // Rule 58: TypeDeclaration ::= InterfaceDeclaration // case 58: break; // // Rule 59: TypeDeclaration ::= ; // case 59: { btParser.setSym1(null); break; } // // Rule 60: ClassDeclaration ::= NormalClassDeclaration // case 60: break; // // Rule 61: NormalClassDeclaration ::= ClassModifiersopt class identifier Superopt Interfacesopt ClassBody // case 61: { Flags a = (Flags) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3));//vj assert(btParser.getSym(4) == null); TypeNode c = (TypeNode) btParser.getSym(4); // by default extend x10.lang.Object if (c == null) { c= new Name(nf, ts, pos(), "x10.lang.Object").toType(); } List d = (List) btParser.getSym(5); ClassBody e = (ClassBody) btParser.getSym(6); btParser.setSym1(a.isValue() ? nf.ValueClassDecl(pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier(), c, d, e) : nf.ClassDecl(pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier(), c, d, e)); break; } // // Rule 62: ClassModifiers ::= ClassModifier // case 62: break; // // Rule 63: ClassModifiers ::= ClassModifiers ClassModifier // case 63: { Flags a = (Flags) btParser.getSym(1), b = (Flags) btParser.getSym(2); btParser.setSym1(a.set(b)); break; } // // Rule 64: ClassModifier ::= public // case 64: { btParser.setSym1(Flags.PUBLIC); break; } // // Rule 65: ClassModifier ::= protected // case 65: { btParser.setSym1(Flags.PROTECTED); break; } // // Rule 66: ClassModifier ::= private // case 66: { btParser.setSym1(Flags.PRIVATE); break; } // // Rule 67: ClassModifier ::= abstract // case 67: { btParser.setSym1(Flags.ABSTRACT); break; } // // Rule 68: ClassModifier ::= static // case 68: { btParser.setSym1(Flags.STATIC); break; } // // Rule 69: ClassModifier ::= final // case 69: { btParser.setSym1(Flags.FINAL); break; } // // Rule 70: ClassModifier ::= strictfp // case 70: { btParser.setSym1(Flags.STRICTFP); break; } // // Rule 71: TypeParameters ::= < TypeParameterList > // case 71: bad_rule = 71; break; // // Rule 72: TypeParameterList ::= TypeParameter // case 72: bad_rule = 72; break; // // Rule 73: TypeParameterList ::= TypeParameterList , TypeParameter // case 73: bad_rule = 73; break; // // Rule 74: Super ::= extends ClassType // case 74: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 75: Interfaces ::= implements InterfaceTypeList // case 75: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 76: InterfaceTypeList ::= InterfaceType // case 76: { List l = new TypedList(new LinkedList(), TypeNode.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 77: InterfaceTypeList ::= InterfaceTypeList , InterfaceType // case 77: { List l = (TypedList) btParser.getSym(1); l.add(btParser.getSym(2)); btParser.setSym1(l); break; } // // Rule 78: ClassBody ::= { ClassBodyDeclarationsopt } // case 78: { btParser.setSym1(nf.ClassBody(pos(btParser.getFirstToken(), btParser.getLastToken()), (List) btParser.getSym(2))); break; } // // Rule 79: ClassBodyDeclarations ::= ClassBodyDeclaration // case 79: break; // // Rule 80: ClassBodyDeclarations ::= ClassBodyDeclarations ClassBodyDeclaration // case 80: { List a = (List) btParser.getSym(1), b = (List) btParser.getSym(2); a.addAll(b); // btParser.setSym1(a); break; } // // Rule 81: ClassBodyDeclaration ::= ClassMemberDeclaration // case 81: break; // // Rule 82: ClassBodyDeclaration ::= InstanceInitializer // case 82: { List l = new TypedList(new LinkedList(), ClassMember.class, false); Block a = (Block) btParser.getSym(1); l.add(nf.Initializer(pos(), Flags.NONE, a)); btParser.setSym1(l); break; } // // Rule 83: ClassBodyDeclaration ::= StaticInitializer // case 83: { List l = new TypedList(new LinkedList(), ClassMember.class, false); Block a = (Block) btParser.getSym(1); l.add(nf.Initializer(pos(), Flags.STATIC, a)); btParser.setSym1(l); break; } // // Rule 84: ClassBodyDeclaration ::= ConstructorDeclaration // case 84: { List l = new TypedList(new LinkedList(), ClassMember.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 85: ClassMemberDeclaration ::= FieldDeclaration // case 85: break; // // Rule 86: ClassMemberDeclaration ::= MethodDeclaration // case 86: { List l = new TypedList(new LinkedList(), ClassMember.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 87: ClassMemberDeclaration ::= ClassDeclaration // case 87: { List l = new TypedList(new LinkedList(), ClassMember.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 88: ClassMemberDeclaration ::= InterfaceDeclaration // case 88: { List l = new TypedList(new LinkedList(), ClassMember.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 89: ClassMemberDeclaration ::= ; // case 89: { List l = new TypedList(new LinkedList(), ClassMember.class, false); btParser.setSym1(l); break; } // // Rule 90: FieldDeclaration ::= FieldModifiersopt Type VariableDeclarators ; // case 90: { List l = new TypedList(new LinkedList(), ClassMember.class, false); Flags a = (Flags) btParser.getSym(1); TypeNode b = (TypeNode) btParser.getSym(2); List c = (List) btParser.getSym(3); for (Iterator i = c.iterator(); i.hasNext();) { X10VarDeclarator d = (X10VarDeclarator) i.next(); if (d.hasExplodedVars()) // TODO: Report this exception correctly. throw new Error("Field Declarations may not have exploded variables." + pos()); d.setFlag(a); l.add(nf.FieldDecl(pos(btParser.getFirstToken(2), btParser.getLastToken()), d.flags, nf.array(b, pos(btParser.getFirstToken(2), btParser.getLastToken(2)), d.dims), d.name, d.init)); } btParser.setSym1(l); break; } // // Rule 91: VariableDeclarators ::= VariableDeclarator // case 91: { List l = new TypedList(new LinkedList(), X10VarDeclarator.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 92: VariableDeclarators ::= VariableDeclarators , VariableDeclarator // case 92: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(3)); // btParser.setSym1(l); break; } // // Rule 93: VariableDeclarator ::= VariableDeclaratorId // case 93: break; // // Rule 94: VariableDeclarator ::= VariableDeclaratorId = VariableInitializer // case 94: { X10VarDeclarator a = (X10VarDeclarator) btParser.getSym(1); Expr b = (Expr) btParser.getSym(3); a.init = b; // btParser.setSym1(a); break; } // // Rule 95: VariableDeclaratorId ::= identifier // case 95: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new X10VarDeclarator(pos(), a.getIdentifier())); break; } // // Rule 96: VariableDeclaratorId ::= VariableDeclaratorId [ ] // case 96: { X10VarDeclarator a = (X10VarDeclarator) btParser.getSym(1); a.dims++; // btParser.setSym1(a); break; } // // Rule 97: VariableDeclaratorId ::= identifier [ IdentifierList ] // case 97: { polyglot.lex.Identifier a = id(btParser.getToken(1)); List paramList = (List) btParser.getSym(3); btParser.setSym1(new X10VarDeclarator(pos(), a.getIdentifier(), paramList)); break; } // // Rule 98: VariableDeclaratorId ::= [ IdentifierList ] // case 98: { String name = polyglot.ext.x10.visit.X10PrettyPrinterVisitor.getId(); List paramList = (List) btParser.getSym(2); btParser.setSym1(new X10VarDeclarator(pos(), name, paramList)); break; } // // Rule 99: VariableInitializer ::= Expression // case 99: break; // // Rule 100: VariableInitializer ::= ArrayInitializer // case 100: break; // // Rule 101: FieldModifiers ::= FieldModifier // case 101: break; // // Rule 102: FieldModifiers ::= FieldModifiers FieldModifier // case 102: { Flags a = (Flags) btParser.getSym(1), b = (Flags) btParser.getSym(2); btParser.setSym1(a.set(b)); break; } // // Rule 103: FieldModifier ::= public // case 103: { btParser.setSym1(Flags.PUBLIC); break; } // // Rule 104: FieldModifier ::= protected // case 104: { btParser.setSym1(Flags.PROTECTED); break; } // // Rule 105: FieldModifier ::= private // case 105: { btParser.setSym1(Flags.PRIVATE); break; } // // Rule 106: FieldModifier ::= static // case 106: { btParser.setSym1(Flags.STATIC); break; } // // Rule 107: FieldModifier ::= final // case 107: { btParser.setSym1(Flags.FINAL); break; } // // Rule 108: FieldModifier ::= transient // case 108: { btParser.setSym1(Flags.TRANSIENT); break; } // // Rule 109: FieldModifier ::= volatile // case 109: { btParser.setSym1(Flags.VOLATILE); break; } // // Rule 110: MethodDeclaration ::= MethodHeader MethodBody // case 110: { MethodDecl a = (MethodDecl) btParser.getSym(1); List l = a.formals(); List s = new TypedList(new LinkedList(), Stmt.class, false); Block b = (Block) btParser.getSym(2); for (Iterator i = l.iterator(); i.hasNext(); ) { X10Formal d = (X10Formal) i.next(); if (d.hasExplodedVars()) s.addAll( d.explode()); } if (! s.isEmpty()) { s.addAll(b.statements()); b = b.statements(s); } Flags f = a.flags(); if (f.contains(Flags.ATOMIC)) { List ss = new TypedList(new LinkedList(), Stmt.class, false); ss.add(nf.Atomic(pos(), nf.Here(pos()), b)); b = b.statements(ss); a = a.flags(f.clear(Flags.ATOMIC)); } btParser.setSym1(a.body(b)); break; } // // Rule 111: MethodHeader ::= MethodModifiersopt ResultType MethodDeclarator Throwsopt // case 111: { Flags a = (Flags) btParser.getSym(1);//vj assert(btParser.getSym(2) == null); TypeNode b = (TypeNode) btParser.getSym(2); Object[] o = (Object []) btParser.getSym(3); Name c = (Name) o[0]; List d = (List) o[1]; Integer e = (Integer) o[2]; List f = (List) btParser.getSym(4); if (b.type() == ts.Void() && e.intValue() > 0) { // TODO: error!!! assert(false); } btParser.setSym1(nf.MethodDecl(pos(btParser.getFirstToken(2), btParser.getLastToken(3)), a, nf.array((TypeNode) b, pos(btParser.getFirstToken(2), btParser.getLastToken(2)), e.intValue()), c.toString(), d, f, null)); break; } // // Rule 112: ResultType ::= Type // case 112: break; // // Rule 113: ResultType ::= void // case 113: { btParser.setSym1(nf.CanonicalTypeNode(pos(), ts.Void())); break; } // // Rule 114: MethodDeclarator ::= identifier ( FormalParameterListopt ) // case 114: { Object[] a = new Object[3]; a[0] = new Name(nf, ts, pos(), id(btParser.getToken(1)).getIdentifier()); a[1] = btParser.getSym(3); a[2] = new Integer(0); btParser.setSym1(a); break; } // // Rule 115: MethodDeclarator ::= MethodDeclarator [ ] // case 115: { Object[] a = (Object []) btParser.getSym(1); a[2] = new Integer(((Integer) a[2]).intValue() + 1); // btParser.setSym1(a); break; } // // Rule 116: FormalParameterList ::= LastFormalParameter // case 116: { List l = new TypedList(new LinkedList(), Formal.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 117: FormalParameterList ::= FormalParameters , LastFormalParameter // case 117: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(3)); // btParser.setSym1(l); break; } // // Rule 118: FormalParameters ::= FormalParameter // case 118: { List l = new TypedList(new LinkedList(), Formal.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 119: FormalParameters ::= FormalParameters , FormalParameter // case 119: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(3)); // btParser.setSym1(l); break; } // // Rule 120: FormalParameter ::= VariableModifiersopt Type VariableDeclaratorId // case 120: { Flags f = (Flags) btParser.getSym(1); TypeNode a = (TypeNode) btParser.getSym(2); X10VarDeclarator b = (X10VarDeclarator) btParser.getSym(3); b.setFlag(f); btParser.setSym1(nf.Formal(pos(), nf.array(a, pos(btParser.getFirstToken(2), btParser.getLastToken(2)), b.dims), b)); break; } // // Rule 122: VariableModifiers ::= VariableModifiers VariableModifier // case 122: { Flags a = (Flags) btParser.getSym(1), b = (Flags) btParser.getSym(2); btParser.setSym1(a.set(b)); break; } // // Rule 123: VariableModifier ::= final // case 123: { btParser.setSym1(Flags.FINAL); break; } // // Rule 124: LastFormalParameter ::= VariableModifiersopt Type ...opt VariableDeclaratorId // case 124: { Flags f = (Flags) btParser.getSym(1); TypeNode a = (TypeNode) btParser.getSym(2); assert(btParser.getSym(3) == null); X10VarDeclarator b = (X10VarDeclarator) btParser.getSym(4); b.setFlag(f); btParser.setSym1(nf.Formal(pos(), nf.array(a, pos(btParser.getFirstToken(2), btParser.getLastToken(2)), b.dims), b)); break; } // // Rule 125: MethodModifiers ::= MethodModifier // case 125: break; // // Rule 126: MethodModifiers ::= MethodModifiers MethodModifier // case 126: { Flags a = (Flags) btParser.getSym(1), b = (Flags) btParser.getSym(2); btParser.setSym1(a.set(b)); break; } // // Rule 127: MethodModifier ::= public // case 127: { btParser.setSym1(Flags.PUBLIC); break; } // // Rule 128: MethodModifier ::= protected // case 128: { btParser.setSym1(Flags.PROTECTED); break; } // // Rule 129: MethodModifier ::= private // case 129: { btParser.setSym1(Flags.PRIVATE); break; } // // Rule 130: MethodModifier ::= abstract // case 130: { btParser.setSym1(Flags.ABSTRACT); break; } // // Rule 131: MethodModifier ::= static // case 131: { btParser.setSym1(Flags.STATIC); break; } // // Rule 132: MethodModifier ::= final // case 132: { btParser.setSym1(Flags.FINAL); break; } // // Rule 133: MethodModifier ::= synchronized // case 133: { btParser.setSym1(Flags.SYNCHRONIZED); break; } // // Rule 134: MethodModifier ::= native // case 134: { btParser.setSym1(Flags.NATIVE); break; } // // Rule 135: MethodModifier ::= strictfp // case 135: { btParser.setSym1(Flags.STRICTFP); break; } // // Rule 136: Throws ::= throws ExceptionTypeList // case 136: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 137: ExceptionTypeList ::= ExceptionType // case 137: { List l = new TypedList(new LinkedList(), TypeNode.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 138: ExceptionTypeList ::= ExceptionTypeList , ExceptionType // case 138: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(3)); // btParser.setSym1(l); break; } // // Rule 139: ExceptionType ::= ClassType // case 139: break; // // Rule 140: MethodBody ::= Block // case 140: break; // // Rule 141: MethodBody ::= ; // case 141: btParser.setSym1(null); break; // // Rule 142: InstanceInitializer ::= Block // case 142: break; // // Rule 143: StaticInitializer ::= static Block // case 143: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 144: ConstructorDeclaration ::= ConstructorModifiersopt ConstructorDeclarator Throwsopt ConstructorBody // case 144: { Flags m = (Flags) btParser.getSym(1); Object[] o = (Object []) btParser.getSym(2); Name a = (Name) o[1]; List b = (List) o[2]; List c = (List) btParser.getSym(3); Block d = (Block) btParser.getSym(4); btParser.setSym1(nf.ConstructorDecl(pos(), m, a.toString(), b, c, d)); break; } // // Rule 145: ConstructorDeclarator ::= SimpleTypeName ( FormalParameterListopt ) // case 145: {//vj assert(btParser.getSym(1) == null); Object[] a = new Object[3];//vj a[0] = btParser.getSym(1); a[1] = btParser.getSym(1); a[2] = btParser.getSym(3); btParser.setSym1(a); break; } // // Rule 146: SimpleTypeName ::= identifier // case 146: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 147: ConstructorModifiers ::= ConstructorModifier // case 147: break; // // Rule 148: ConstructorModifiers ::= ConstructorModifiers ConstructorModifier // case 148: { Flags a = (Flags) btParser.getSym(1), b = (Flags) btParser.getSym(2); btParser.setSym1(a.set(b)); break; } // // Rule 149: ConstructorModifier ::= public // case 149: { btParser.setSym1(Flags.PUBLIC); break; } // // Rule 150: ConstructorModifier ::= protected // case 150: { btParser.setSym1(Flags.PROTECTED); break; } // // Rule 151: ConstructorModifier ::= private // case 151: { btParser.setSym1(Flags.PRIVATE); break; } // // Rule 152: ConstructorBody ::= { ExplicitConstructorInvocationopt BlockStatementsopt } // case 152: { Stmt a = (Stmt) btParser.getSym(2); List l; if (a == null) l = (List) btParser.getSym(3); else { l = new TypedList(new LinkedList(), Stmt.class, false); List l2 = (List) btParser.getSym(3); l.add(a); l.addAll(l2); } btParser.setSym1(nf.Block(pos(), l)); break; } // // Rule 153: ExplicitConstructorInvocation ::= this ( ArgumentListopt ) ; // case 153: {//vj assert(btParser.getSym(1) == null); List b = (List) btParser.getSym(3); btParser.setSym1(nf.ThisCall(pos(), b)); break; } // // Rule 154: ExplicitConstructorInvocation ::= super ( ArgumentListopt ) ; // case 154: {//vj assert(btParser.getSym(1) == null); List b = (List) btParser.getSym(3); btParser.setSym1(nf.SuperCall(pos(), b)); break; } // // Rule 155: ExplicitConstructorInvocation ::= Primary . this ( ArgumentListopt ) ; // case 155: { Expr a = (Expr) btParser.getSym(1);//vj assert(btParser.getSym(2) == null); List b = (List) btParser.getSym(5); btParser.setSym1(nf.ThisCall(pos(), a, b)); break; } // // Rule 156: ExplicitConstructorInvocation ::= Primary . super ( ArgumentListopt ) ; // case 156: { Expr a = (Expr) btParser.getSym(1);//vj assert(btParser.getSym(2) == null); List b = (List) btParser.getSym(5); btParser.setSym1(nf.SuperCall(pos(), a, b)); break; } // // Rule 157: EnumDeclaration ::= ClassModifiersopt enum identifier Interfacesopt EnumBody // case 157: bad_rule = 157; break; // // Rule 158: EnumBody ::= { EnumConstantsopt ,opt EnumBodyDeclarationsopt } // case 158: bad_rule = 158; break; // // Rule 159: EnumConstants ::= EnumConstant // case 159: bad_rule = 159; break; // // Rule 160: EnumConstants ::= EnumConstants , EnumConstant // case 160: bad_rule = 160; break; // // Rule 161: EnumConstant ::= identifier Argumentsopt ClassBodyopt // case 161: bad_rule = 161; break; // // Rule 162: Arguments ::= ( ArgumentListopt ) // case 162: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 163: EnumBodyDeclarations ::= ; ClassBodyDeclarationsopt // case 163: bad_rule = 163; break; // // Rule 164: InterfaceDeclaration ::= NormalInterfaceDeclaration // case 164: break; // // Rule 165: NormalInterfaceDeclaration ::= InterfaceModifiersopt interface identifier ExtendsInterfacesopt InterfaceBody // case 165: { Flags a = (Flags) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3));//vj assert(btParser.getSym(4) == null); List c = (List) btParser.getSym(4); ClassBody d = (ClassBody) btParser.getSym(5); btParser.setSym1(nf.ClassDecl(pos(), a.Interface(), b.getIdentifier(), null, c, d)); break; } // // Rule 166: InterfaceModifiers ::= InterfaceModifier // case 166: break; // // Rule 167: InterfaceModifiers ::= InterfaceModifiers InterfaceModifier // case 167: { Flags a = (Flags) btParser.getSym(1), b = (Flags) btParser.getSym(2); btParser.setSym1(a.set(b)); break; } // // Rule 168: InterfaceModifier ::= public // case 168: { btParser.setSym1(Flags.PUBLIC); break; } // // Rule 169: InterfaceModifier ::= protected // case 169: { btParser.setSym1(Flags.PROTECTED); break; } // // Rule 170: InterfaceModifier ::= private // case 170: { btParser.setSym1(Flags.PRIVATE); break; } // // Rule 171: InterfaceModifier ::= abstract // case 171: { btParser.setSym1(Flags.ABSTRACT); break; } // // Rule 172: InterfaceModifier ::= static // case 172: { btParser.setSym1(Flags.STATIC); break; } // // Rule 173: InterfaceModifier ::= strictfp // case 173: { btParser.setSym1(Flags.STRICTFP); break; } // // Rule 174: ExtendsInterfaces ::= extends InterfaceType // case 174: { List l = new TypedList(new LinkedList(), TypeNode.class, false); l.add(btParser.getSym(2)); btParser.setSym1(l); break; } // // Rule 175: ExtendsInterfaces ::= ExtendsInterfaces , InterfaceType // case 175: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(3)); // btParser.setSym1(l); break; } // // Rule 176: InterfaceBody ::= { InterfaceMemberDeclarationsopt } // case 176: { List a = (List)btParser.getSym(2); btParser.setSym1(nf.ClassBody(pos(), a)); break; } // // Rule 177: InterfaceMemberDeclarations ::= InterfaceMemberDeclaration // case 177: break; // // Rule 178: InterfaceMemberDeclarations ::= InterfaceMemberDeclarations InterfaceMemberDeclaration // case 178: { List l = (List) btParser.getSym(1), l2 = (List) btParser.getSym(2); l.addAll(l2); // btParser.setSym1(l); break; } // // Rule 179: InterfaceMemberDeclaration ::= ConstantDeclaration // case 179: break; // // Rule 180: InterfaceMemberDeclaration ::= AbstractMethodDeclaration // case 180: { List l = new TypedList(new LinkedList(), ClassMember.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 181: InterfaceMemberDeclaration ::= ClassDeclaration // case 181: { List l = new TypedList(new LinkedList(), ClassMember.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 182: InterfaceMemberDeclaration ::= InterfaceDeclaration // case 182: { List l = new TypedList(new LinkedList(), ClassMember.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 183: InterfaceMemberDeclaration ::= ; // case 183: { btParser.setSym1(Collections.EMPTY_LIST); break; } // // Rule 184: ConstantDeclaration ::= ConstantModifiersopt Type VariableDeclarators // case 184: { List l = new TypedList(new LinkedList(), ClassMember.class, false); Flags a = (Flags) btParser.getSym(1); TypeNode b = (TypeNode) btParser.getSym(2); List c = (List) btParser.getSym(3); for (Iterator i = c.iterator(); i.hasNext();) { X10VarDeclarator d = (X10VarDeclarator) i.next(); if (d.hasExplodedVars()) // TODO: Report this exception correctly. throw new Error("Field Declarations may not have exploded variables." + pos()); l.add(nf.FieldDecl(pos(btParser.getFirstToken(2), btParser.getLastToken()), a, nf.array(b, pos(btParser.getFirstToken(2), btParser.getLastToken(2)), d.dims), d.name, d.init)); } btParser.setSym1(l); break; } // // Rule 185: ConstantModifiers ::= ConstantModifier // case 185: break; // // Rule 186: ConstantModifiers ::= ConstantModifiers ConstantModifier // case 186: { Flags a = (Flags) btParser.getSym(1), b = (Flags) btParser.getSym(2); btParser.setSym1(a.set(b)); break; } // // Rule 187: ConstantModifier ::= public // case 187: { btParser.setSym1(Flags.PUBLIC); break; } // // Rule 188: ConstantModifier ::= static // case 188: { btParser.setSym1(Flags.STATIC); break; } // // Rule 189: ConstantModifier ::= final // case 189: { btParser.setSym1(Flags.FINAL); break; } // // Rule 190: AbstractMethodDeclaration ::= AbstractMethodModifiersopt ResultType MethodDeclarator Throwsopt ; // case 190: { Flags a = (Flags) btParser.getSym(1);//vj assert(btParser.getSym(2) == null); TypeNode b = (TypeNode) btParser.getSym(2); Object[] o = (Object []) btParser.getSym(3); Name c = (Name) o[0]; List d = (List) o[1]; Integer e = (Integer) o[2]; List f = (List) btParser.getSym(4); if (b.type() == ts.Void() && e.intValue() > 0) { // TODO: error!!! assert(false); } btParser.setSym1(nf.MethodDecl(pos(btParser.getFirstToken(2), btParser.getLastToken(3)), a, nf.array((TypeNode) b, pos(btParser.getFirstToken(2), btParser.getLastToken(2)), e.intValue()), c.toString(), d, f, null)); break; } // // Rule 191: AbstractMethodModifiers ::= AbstractMethodModifier // case 191: break; // // Rule 192: AbstractMethodModifiers ::= AbstractMethodModifiers AbstractMethodModifier // case 192: { Flags a = (Flags) btParser.getSym(1), b = (Flags) btParser.getSym(2); btParser.setSym1(a.set(b)); break; } // // Rule 193: AbstractMethodModifier ::= public // case 193: { btParser.setSym1(Flags.PUBLIC); break; } // // Rule 194: AbstractMethodModifier ::= abstract // case 194: { btParser.setSym1(Flags.ABSTRACT); break; } // // Rule 195: AnnotationTypeDeclaration ::= InterfaceModifiersopt @ interface identifier AnnotationTypeBody // case 195: bad_rule = 195; break; // // Rule 196: AnnotationTypeBody ::= { AnnotationTypeElementDeclarationsopt } // case 196: bad_rule = 196; break; // // Rule 197: AnnotationTypeElementDeclarations ::= AnnotationTypeElementDeclaration // case 197: bad_rule = 197; break; // // Rule 198: AnnotationTypeElementDeclarations ::= AnnotationTypeElementDeclarations AnnotationTypeElementDeclaration // case 198: bad_rule = 198; break; // // Rule 199: AnnotationTypeElementDeclaration ::= AbstractMethodModifiersopt Type identifier ( ) DefaultValueopt ; // case 199: bad_rule = 199; break; // // Rule 200: AnnotationTypeElementDeclaration ::= ConstantDeclaration // case 200: bad_rule = 200; break; // // Rule 201: AnnotationTypeElementDeclaration ::= ClassDeclaration // case 201: bad_rule = 201; break; // // Rule 202: AnnotationTypeElementDeclaration ::= InterfaceDeclaration // case 202: bad_rule = 202; break; // // Rule 203: AnnotationTypeElementDeclaration ::= EnumDeclaration // case 203: bad_rule = 203; break; // // Rule 204: AnnotationTypeElementDeclaration ::= AnnotationTypeDeclaration // case 204: bad_rule = 204; break; // // Rule 205: AnnotationTypeElementDeclaration ::= ; // case 205: bad_rule = 205; break; // // Rule 206: DefaultValue ::= default ElementValue // case 206: bad_rule = 206; break; // // Rule 207: Annotations ::= Annotation // case 207: bad_rule = 207; break; // // Rule 208: Annotations ::= Annotations Annotation // case 208: bad_rule = 208; break; // // Rule 209: Annotation ::= NormalAnnotation // case 209: bad_rule = 209; break; // // Rule 210: Annotation ::= MarkerAnnotation // case 210: bad_rule = 210; break; // // Rule 211: Annotation ::= SingleElementAnnotation // case 211: bad_rule = 211; break; // // Rule 212: NormalAnnotation ::= @ TypeName ( ElementValuePairsopt ) // case 212: bad_rule = 212; break; // // Rule 213: ElementValuePairs ::= ElementValuePair // case 213: bad_rule = 213; break; // // Rule 214: ElementValuePairs ::= ElementValuePairs , ElementValuePair // case 214: bad_rule = 214; break; // // Rule 215: ElementValuePair ::= SimpleName = ElementValue // case 215: bad_rule = 215; break; // // Rule 216: SimpleName ::= identifier // case 216: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 217: ElementValue ::= ConditionalExpression // case 217: bad_rule = 217; break; // // Rule 218: ElementValue ::= Annotation // case 218: bad_rule = 218; break; // // Rule 219: ElementValue ::= ElementValueArrayInitializer // case 219: bad_rule = 219; break; // // Rule 220: ElementValueArrayInitializer ::= { ElementValuesopt ,opt } // case 220: bad_rule = 220; break; // // Rule 221: ElementValues ::= ElementValue // case 221: bad_rule = 221; break; // // Rule 222: ElementValues ::= ElementValues , ElementValue // case 222: bad_rule = 222; break; // // Rule 223: MarkerAnnotation ::= @ TypeName // case 223: bad_rule = 223; break; // // Rule 224: SingleElementAnnotation ::= @ TypeName ( ElementValue ) // case 224: bad_rule = 224; break; // // Rule 225: ArrayInitializer ::= { VariableInitializersopt ,opt } // case 225: { List a = (List) btParser.getSym(2); if (a == null) btParser.setSym1(nf.ArrayInit(pos())); else btParser.setSym1(nf.ArrayInit(pos(), a)); break; } // // Rule 226: VariableInitializers ::= VariableInitializer // case 226: { List l = new TypedList(new LinkedList(), Expr.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 227: VariableInitializers ::= VariableInitializers , VariableInitializer // case 227: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(3)); //btParser.setSym1(l); break; } // // Rule 228: Block ::= { BlockStatementsopt } // case 228: { List l = (List) btParser.getSym(2); btParser.setSym1(nf.Block(pos(), l)); break; } // // Rule 229: BlockStatements ::= BlockStatement // case 229: { List l = new TypedList(new LinkedList(), Stmt.class, false), l2 = (List) btParser.getSym(1); l.addAll(l2); btParser.setSym1(l); break; } // // Rule 230: BlockStatements ::= BlockStatements BlockStatement // case 230: { List l = (List) btParser.getSym(1), l2 = (List) btParser.getSym(2); l.addAll(l2); //btParser.setSym1(l); break; } // // Rule 231: BlockStatement ::= LocalVariableDeclarationStatement // case 231: break; // // Rule 232: BlockStatement ::= ClassDeclaration // case 232: { ClassDecl a = (ClassDecl) btParser.getSym(1); List l = new TypedList(new LinkedList(), Stmt.class, false); l.add(nf.LocalClassDecl(pos(), a)); btParser.setSym1(l); break; } // // Rule 233: BlockStatement ::= Statement // case 233: { List l = new TypedList(new LinkedList(), Stmt.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 234: LocalVariableDeclarationStatement ::= LocalVariableDeclaration ; // case 234: break; // // Rule 235: LocalVariableDeclaration ::= VariableModifiersopt Type VariableDeclarators // case 235: { Flags flags = (Flags) btParser.getSym(1); TypeNode a = (TypeNode) btParser.getSym(2); List b = (List) btParser.getSym(3); List l = new TypedList(new LinkedList(), LocalDecl.class, false); List s = new TypedList(new LinkedList(), Stmt.class, false); for (Iterator i = b.iterator(); i.hasNext(); ) { X10VarDeclarator d = (X10VarDeclarator) i.next(); d.setFlag( flags ); // use d.flags below and not flags, setFlag may change it. l.add(nf.LocalDecl(d.pos, d.flags, nf.array(a, pos(d), d.dims), d.name, d.init)); if (d.hasExplodedVars()) s.addAll( d.explode() ); } l.addAll(s); btParser.setSym1(l); break; } // // Rule 236: Statement ::= StatementWithoutTrailingSubstatement // case 236: break; // // Rule 237: Statement ::= LabeledStatement // case 237: break; // // Rule 238: Statement ::= IfThenStatement // case 238: break; // // Rule 239: Statement ::= IfThenElseStatement // case 239: break; // // Rule 240: Statement ::= WhileStatement // case 240: break; // // Rule 241: Statement ::= ForStatement // case 241: break; // // Rule 242: StatementWithoutTrailingSubstatement ::= Block // case 242: break; // // Rule 243: StatementWithoutTrailingSubstatement ::= EmptyStatement // case 243: break; // // Rule 244: StatementWithoutTrailingSubstatement ::= ExpressionStatement // case 244: break; // // Rule 245: StatementWithoutTrailingSubstatement ::= AssertStatement // case 245: break; // // Rule 246: StatementWithoutTrailingSubstatement ::= SwitchStatement // case 246: break; // // Rule 247: StatementWithoutTrailingSubstatement ::= DoStatement // case 247: break; // // Rule 248: StatementWithoutTrailingSubstatement ::= BreakStatement // case 248: break; // // Rule 249: StatementWithoutTrailingSubstatement ::= ContinueStatement // case 249: break; // // Rule 250: StatementWithoutTrailingSubstatement ::= ReturnStatement // case 250: break; // // Rule 251: StatementWithoutTrailingSubstatement ::= SynchronizedStatement // case 251: break; // // Rule 252: StatementWithoutTrailingSubstatement ::= ThrowStatement // case 252: break; // // Rule 253: StatementWithoutTrailingSubstatement ::= TryStatement // case 253: break; // // Rule 254: StatementNoShortIf ::= StatementWithoutTrailingSubstatement // case 254: break; // // Rule 255: StatementNoShortIf ::= LabeledStatementNoShortIf // case 255: break; // // Rule 256: StatementNoShortIf ::= IfThenElseStatementNoShortIf // case 256: break; // // Rule 257: StatementNoShortIf ::= WhileStatementNoShortIf // case 257: break; // // Rule 258: StatementNoShortIf ::= ForStatementNoShortIf // case 258: break; // // Rule 259: IfThenStatement ::= if ( Expression ) Statement // case 259: { Expr a = (Expr) btParser.getSym(3); Stmt b = (Stmt) btParser.getSym(5); btParser.setSym1(nf.If(pos(), a, b)); break; } // // Rule 260: IfThenElseStatement ::= if ( Expression ) StatementNoShortIf else Statement // case 260: { Expr a = (Expr) btParser.getSym(3); Stmt b = (Stmt) btParser.getSym(5); Stmt c = (Stmt) btParser.getSym(7); btParser.setSym1(nf.If(pos(), a, b, c)); break; } // // Rule 261: IfThenElseStatementNoShortIf ::= if ( Expression ) StatementNoShortIf else StatementNoShortIf // case 261: { Expr a = (Expr) btParser.getSym(3); Stmt b = (Stmt) btParser.getSym(5); Stmt c = (Stmt) btParser.getSym(7); btParser.setSym1(nf.If(pos(), a, b, c)); break; } // // Rule 262: EmptyStatement ::= ; // case 262: { btParser.setSym1(nf.Empty(pos())); break; } // // Rule 263: LabeledStatement ::= identifier : Statement // case 263: { polyglot.lex.Identifier a = id(btParser.getToken(1)); Stmt b = (Stmt) btParser.getSym(3); btParser.setSym1(nf.Labeled(pos(), a.getIdentifier(), b)); break; } // // Rule 264: LabeledStatementNoShortIf ::= identifier : StatementNoShortIf // case 264: { polyglot.lex.Identifier a = id(btParser.getToken(1)); Stmt b = (Stmt) btParser.getSym(3); btParser.setSym1(nf.Labeled(pos(), a.getIdentifier(), b)); break; } // // Rule 265: ExpressionStatement ::= StatementExpression ; // case 265: { Expr a = (Expr) btParser.getSym(1); btParser.setSym1(nf.Eval(pos(), a)); break; } // // Rule 266: StatementExpression ::= Assignment // case 266: break; // // Rule 267: StatementExpression ::= PreIncrementExpression // case 267: break; // // Rule 268: StatementExpression ::= PreDecrementExpression // case 268: break; // // Rule 269: StatementExpression ::= PostIncrementExpression // case 269: break; // // Rule 270: StatementExpression ::= PostDecrementExpression // case 270: break; // // Rule 271: StatementExpression ::= MethodInvocation // case 271: break; // // Rule 272: StatementExpression ::= ClassInstanceCreationExpression // case 272: break; // // Rule 273: AssertStatement ::= assert Expression ; // case 273: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Assert(pos(), a)); break; } // // Rule 274: AssertStatement ::= assert Expression : Expression ; // case 274: { Expr a = (Expr) btParser.getSym(2), b = (Expr) btParser.getSym(4); btParser.setSym1(nf.Assert(pos(), a, b)); break; } // // Rule 275: SwitchStatement ::= switch ( Expression ) SwitchBlock // case 275: { Expr a = (Expr) btParser.getSym(3); List b = (List) btParser.getSym(5); btParser.setSym1(nf.Switch(pos(), a, b)); break; } // // Rule 276: SwitchBlock ::= { SwitchBlockStatementGroupsopt SwitchLabelsopt } // case 276: { List l = (List) btParser.getSym(2), l2 = (List) btParser.getSym(3); l.addAll(l2); btParser.setSym1(l); break; } // // Rule 277: SwitchBlockStatementGroups ::= SwitchBlockStatementGroup // case 277: break; // // Rule 278: SwitchBlockStatementGroups ::= SwitchBlockStatementGroups SwitchBlockStatementGroup // case 278: { List l = (List) btParser.getSym(1), l2 = (List) btParser.getSym(2); l.addAll(l2); // btParser.setSym1(l); break; } // // Rule 279: SwitchBlockStatementGroup ::= SwitchLabels BlockStatements // case 279: { List l = new TypedList(new LinkedList(), SwitchElement.class, false); List l1 = (List) btParser.getSym(1), l2 = (List) btParser.getSym(2); l.addAll(l1); l.add(nf.SwitchBlock(pos(), l2)); btParser.setSym1(l); break; } // // Rule 280: SwitchLabels ::= SwitchLabel // case 280: { List l = new TypedList(new LinkedList(), Case.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 281: SwitchLabels ::= SwitchLabels SwitchLabel // case 281: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(2)); //btParser.setSym1(l); break; } // // Rule 282: SwitchLabel ::= case ConstantExpression : // case 282: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Case(pos(), a)); break; } // // Rule 283: SwitchLabel ::= case EnumConstant : // case 283: bad_rule = 283; break; // // Rule 284: SwitchLabel ::= default : // case 284: { btParser.setSym1(nf.Default(pos())); break; } // // Rule 285: EnumConstant ::= identifier // case 285: bad_rule = 285; break; // // Rule 286: WhileStatement ::= while ( Expression ) Statement // case 286: { Expr a = (Expr) btParser.getSym(3); Stmt b = (Stmt) btParser.getSym(5); btParser.setSym1(nf.While(pos(), a, b)); break; } // // Rule 287: WhileStatementNoShortIf ::= while ( Expression ) StatementNoShortIf // case 287: { Expr a = (Expr) btParser.getSym(3); Stmt b = (Stmt) btParser.getSym(5); btParser.setSym1(nf.While(pos(), a, b)); break; } // // Rule 288: DoStatement ::= do Statement while ( Expression ) ; // case 288: { Stmt a = (Stmt) btParser.getSym(2); Expr b = (Expr) btParser.getSym(5); btParser.setSym1(nf.Do(pos(), a, b)); break; } // // Rule 289: ForStatement ::= BasicForStatement // case 289: break; // // Rule 290: ForStatement ::= EnhancedForStatement // case 290: break; // // Rule 291: BasicForStatement ::= for ( ForInitopt ; Expressionopt ; ForUpdateopt ) Statement // case 291: { List a = (List) btParser.getSym(3); Expr b = (Expr) btParser.getSym(5); List c = (List) btParser.getSym(7); Stmt d = (Stmt) btParser.getSym(9); btParser.setSym1(nf.For(pos(), a, b, c, d)); break; } // // Rule 292: ForStatementNoShortIf ::= for ( ForInitopt ; Expressionopt ; ForUpdateopt ) StatementNoShortIf // case 292: { List a = (List) btParser.getSym(3); Expr b = (Expr) btParser.getSym(5); List c = (List) btParser.getSym(7); Stmt d = (Stmt) btParser.getSym(9); btParser.setSym1(nf.For(pos(), a, b, c, d)); break; } // // Rule 293: ForInit ::= StatementExpressionList // case 293: break; // // Rule 294: ForInit ::= LocalVariableDeclaration // case 294: { List l = new TypedList(new LinkedList(), ForInit.class, false), l2 = (List) btParser.getSym(1); l.addAll(l2); //btParser.setSym1(l); break; } // // Rule 295: ForUpdate ::= StatementExpressionList // case 295: break; // // Rule 296: StatementExpressionList ::= StatementExpression // case 296: { List l = new TypedList(new LinkedList(), Eval.class, false); Expr a = (Expr) btParser.getSym(1); l.add(nf.Eval(pos(), a)); btParser.setSym1(l); break; } // // Rule 297: StatementExpressionList ::= StatementExpressionList , StatementExpression // case 297: { List l = (List) btParser.getSym(1); Expr a = (Expr) btParser.getSym(3); l.add(nf.Eval(pos(), a)); //btParser.setSym1(l); break; } // // Rule 298: BreakStatement ::= break identifieropt ; // case 298: { Name a = (Name) btParser.getSym(2); if (a == null) btParser.setSym1(nf.Break(pos())); else btParser.setSym1(nf.Break(pos(), a.toString())); break; } // // Rule 299: ContinueStatement ::= continue identifieropt ; // case 299: { Name a = (Name) btParser.getSym(2); if (a == null) btParser.setSym1(nf.Continue(pos())); else btParser.setSym1(nf.Continue(pos(), a.toString())); break; } // // Rule 300: ReturnStatement ::= return Expressionopt ; // case 300: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Return(pos(), a)); break; } // // Rule 301: ThrowStatement ::= throw Expression ; // case 301: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Throw(pos(), a)); break; } // // Rule 302: SynchronizedStatement ::= synchronized ( Expression ) Block // case 302: { Expr a = (Expr) btParser.getSym(3); Block b = (Block) btParser.getSym(5); btParser.setSym1(nf.Synchronized(pos(), a, b)); break; } // // Rule 303: TryStatement ::= try Block Catches // case 303: { Block a = (Block) btParser.getSym(2); List b = (List) btParser.getSym(3); btParser.setSym1(nf.Try(pos(), a, b)); break; } // // Rule 304: TryStatement ::= try Block Catchesopt Finally // case 304: { Block a = (Block) btParser.getSym(2); List b = (List) btParser.getSym(3); Block c = (Block) btParser.getSym(4); btParser.setSym1(nf.Try(pos(), a, b, c)); break; } // // Rule 305: Catches ::= CatchClause // case 305: { List l = new TypedList(new LinkedList(), Catch.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 306: Catches ::= Catches CatchClause // case 306: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(2)); //btParser.setSym1(l); break; } // // Rule 307: CatchClause ::= catch ( FormalParameter ) Block // case 307: { Formal a = (Formal) btParser.getSym(3); Block b = (Block) btParser.getSym(5); btParser.setSym1(nf.Catch(pos(), a, b)); break; } // // Rule 308: Finally ::= finally Block // case 308: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 309: Primary ::= PrimaryNoNewArray // case 309: break; // // Rule 310: Primary ::= ArrayCreationExpression // case 310: break; // // Rule 311: PrimaryNoNewArray ::= Literal // case 311: break; // // Rule 312: PrimaryNoNewArray ::= Type . class // case 312: { Object o = btParser.getSym(1); if (o instanceof Name) { Name a = (Name) o; btParser.setSym1(nf.ClassLit(pos(), a.toType())); } else if (o instanceof TypeNode) { TypeNode a = (TypeNode) o; btParser.setSym1(nf.ClassLit(pos(), a)); } else if (o instanceof CanonicalTypeNode) { CanonicalTypeNode a = (CanonicalTypeNode) o; btParser.setSym1(nf.ClassLit(pos(), a)); } else assert(false); break; } // // Rule 313: PrimaryNoNewArray ::= void . class // case 313: { btParser.setSym1(nf.ClassLit(pos(), nf.CanonicalTypeNode(pos(btParser.getToken(1)), ts.Void()))); break; } // // Rule 314: PrimaryNoNewArray ::= this // case 314: { btParser.setSym1(nf.This(pos())); break; } // // Rule 315: PrimaryNoNewArray ::= ClassName . this // case 315: { Name a = (Name) btParser.getSym(1); btParser.setSym1(nf.This(pos(), a.toType())); break; } // // Rule 316: PrimaryNoNewArray ::= ( Expression ) // case 316: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 317: PrimaryNoNewArray ::= ClassInstanceCreationExpression // case 317: break; // // Rule 318: PrimaryNoNewArray ::= FieldAccess // case 318: break; // // Rule 319: PrimaryNoNewArray ::= MethodInvocation // case 319: break; // // Rule 320: PrimaryNoNewArray ::= ArrayAccess // case 320: break; // // Rule 321: Literal ::= IntegerLiteral // case 321: { polyglot.lex.IntegerLiteral a = int_lit(btParser.getToken(1)); btParser.setSym1(nf.IntLit(pos(), IntLit.INT, a.getValue().intValue())); break; } // // Rule 322: Literal ::= LongLiteral // case 322: { polyglot.lex.LongLiteral a = long_lit(btParser.getToken(1)); btParser.setSym1(nf.IntLit(pos(), IntLit.LONG, a.getValue().longValue())); break; } // // Rule 323: Literal ::= FloatingPointLiteral // case 323: { polyglot.lex.FloatLiteral a = float_lit(btParser.getToken(1)); btParser.setSym1(nf.FloatLit(pos(), FloatLit.FLOAT, a.getValue().floatValue())); break; } // // Rule 324: Literal ::= DoubleLiteral // case 324: { polyglot.lex.DoubleLiteral a = double_lit(btParser.getToken(1)); btParser.setSym1(nf.FloatLit(pos(), FloatLit.DOUBLE, a.getValue().doubleValue())); break; } // // Rule 325: Literal ::= BooleanLiteral // case 325: { polyglot.lex.BooleanLiteral a = boolean_lit(btParser.getToken(1)); btParser.setSym1(nf.BooleanLit(pos(), a.getValue().booleanValue())); break; } // // Rule 326: Literal ::= CharacterLiteral // case 326: { polyglot.lex.CharacterLiteral a = char_lit(btParser.getToken(1)); btParser.setSym1(nf.CharLit(pos(), a.getValue().charValue())); break; } // // Rule 327: Literal ::= StringLiteral // case 327: { polyglot.lex.StringLiteral a = string_lit(btParser.getToken(1)); btParser.setSym1(nf.StringLit(pos(), a.getValue())); break; } // // Rule 328: Literal ::= null // case 328: { btParser.setSym1(nf.NullLit(pos())); break; } // // Rule 329: BooleanLiteral ::= true // case 329: break; // // Rule 330: BooleanLiteral ::= false // case 330: break; // // Rule 331: ClassInstanceCreationExpression ::= new ClassOrInterfaceType ( ArgumentListopt ) ClassBodyopt // case 331: {//vj assert(btParser.getSym(2) == null); TypeNode a = (TypeNode) btParser.getSym(2);//vj assert(btParser.getSym(4) == null); List b = (List) btParser.getSym(4); ClassBody c = (ClassBody) btParser.getSym(6); if (c == null) btParser.setSym1(nf.New(pos(), a, b)); else btParser.setSym1(nf.New(pos(), a, b, c)); break; } // // Rule 332: ClassInstanceCreationExpression ::= Primary . new identifier ( ArgumentListopt ) ClassBodyopt // case 332: { Expr a = (Expr) btParser.getSym(1);//vj assert(btParser.getSym(2) == null); Name b = new Name(nf, ts, pos(), id(btParser.getToken(4)).getIdentifier());//vj assert(btParser.getSym(4) == null); List c = (List) btParser.getSym(6); ClassBody d = (ClassBody) btParser.getSym(8); if (d == null) btParser.setSym1(nf.New(pos(), a, b.toType(), c)); else btParser.setSym1(nf.New(pos(), a, b.toType(), c, d)); break; } // // Rule 333: ClassInstanceCreationExpression ::= AmbiguousName . new identifier ( ArgumentListopt ) ClassBodyopt // case 333: { Name a = (Name) btParser.getSym(1);//vj assert(btParser.getSym(4) == null); Name b = new Name(nf, ts, pos(), id(btParser.getToken(4)).getIdentifier());//vj assert(btParser.getSym(6) == null); List c = (List) btParser.getSym(6); ClassBody d = (ClassBody) btParser.getSym(8); if (d == null) btParser.setSym1(nf.New(pos(), a.toExpr(), b.toType(), c)); else btParser.setSym1(nf.New(pos(), a.toExpr(), b.toType(), c, d)); break; } // // Rule 334: ArgumentList ::= Expression // case 334: { List l = new TypedList(new LinkedList(), Expr.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 335: ArgumentList ::= ArgumentList , Expression // case 335: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(3)); //btParser.setSym1(l); break; } // // Rule 336: DimExprs ::= DimExpr // case 336: { List l = new TypedList(new LinkedList(), Expr.class, false); l.add(btParser.getSym(1)); btParser.setSym1(l); break; } // // Rule 337: DimExprs ::= DimExprs DimExpr // case 337: { List l = (List) btParser.getSym(1); l.add(btParser.getSym(2)); //btParser.setSym1(l); break; } // // Rule 338: DimExpr ::= [ Expression ] // case 338: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(a.position(pos())); break; } // // Rule 339: Dims ::= [ ] // case 339: { btParser.setSym1(new Integer(1)); break; } // // Rule 340: Dims ::= Dims [ ] // case 340: { Integer a = (Integer) btParser.getSym(1); btParser.setSym1(new Integer(a.intValue() + 1)); break; } // // Rule 341: FieldAccess ::= Primary . identifier // case 341: { Expr a = (Expr) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); btParser.setSym1(nf.Field(pos(), a, b.getIdentifier())); break; } // // Rule 342: FieldAccess ::= super . identifier // case 342: { polyglot.lex.Identifier a = id(btParser.getToken(3)); btParser.setSym1(nf.Field(pos(btParser.getLastToken()), nf.Super(pos(btParser.getFirstToken())), a.getIdentifier())); break; } // // Rule 343: FieldAccess ::= ClassName . super . identifier // case 343: { Name a = (Name) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); btParser.setSym1(nf.Field(pos(btParser.getLastToken()), nf.Super(pos(btParser.getFirstToken(3)), a.toType()), b.getIdentifier())); break; } // // Rule 344: MethodInvocation ::= MethodName ( ArgumentListopt ) // case 344: { Name a = (Name) btParser.getSym(1); List b = (List) btParser.getSym(3); btParser.setSym1(nf.Call(pos(), a.prefix == null ? null : a.prefix.toReceiver(), a.name, b)); break; } // // Rule 345: MethodInvocation ::= Primary . identifier ( ArgumentListopt ) // case 345: { Expr a = (Expr) btParser.getSym(1);//vj assert(btParser.getSym(3) == null); polyglot.lex.Identifier b = id(btParser.getToken(3)); List c = (List) btParser.getSym(5); btParser.setSym1(nf.Call(pos(), a, b.getIdentifier(), c)); break; } // // Rule 346: MethodInvocation ::= super . identifier ( ArgumentListopt ) // case 346: {//vj assert(btParser.getSym(3) == null); polyglot.lex.Identifier b = id(btParser.getToken(3)); List c = (List) btParser.getSym(5); btParser.setSym1(nf.Call(pos(), nf.Super(pos(btParser.getFirstToken())), b.getIdentifier(), c)); break; } // // Rule 347: MethodInvocation ::= ClassName . super . identifier ( ArgumentListopt ) // case 347: { Name a = (Name) btParser.getSym(1);//vj assert(btParser.getSym(5) == null); polyglot.lex.Identifier b = id(btParser.getToken(5)); List c = (List) btParser.getSym(7); btParser.setSym1(nf.Call(pos(), nf.Super(pos(btParser.getFirstToken(3)), a.toType()), b.getIdentifier(), c)); break; } // // Rule 348: PostfixExpression ::= Primary // case 348: break; // // Rule 349: PostfixExpression ::= ExpressionName // case 349: { Name a = (Name) btParser.getSym(1); btParser.setSym1(a.toExpr()); break; } // // Rule 350: PostfixExpression ::= PostIncrementExpression // case 350: break; // // Rule 351: PostfixExpression ::= PostDecrementExpression // case 351: break; // // Rule 352: PostIncrementExpression ::= PostfixExpression ++ // case 352: { Expr a = (Expr) btParser.getSym(1); btParser.setSym1(nf.Unary(pos(), a, Unary.POST_INC)); break; } // // Rule 353: PostDecrementExpression ::= PostfixExpression -- // case 353: { Expr a = (Expr) btParser.getSym(1); btParser.setSym1(nf.Unary(pos(), a, Unary.POST_DEC)); break; } // // Rule 354: UnaryExpression ::= PreIncrementExpression // case 354: break; // // Rule 355: UnaryExpression ::= PreDecrementExpression // case 355: break; // // Rule 356: UnaryExpression ::= + UnaryExpression // case 356: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Unary(pos(), Unary.POS, a)); break; } // // Rule 357: UnaryExpression ::= - UnaryExpression // case 357: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Unary(pos(), Unary.NEG, a)); break; } // // Rule 359: PreIncrementExpression ::= ++ UnaryExpression // case 359: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Unary(pos(), Unary.PRE_INC, a)); break; } // // Rule 360: PreDecrementExpression ::= -- UnaryExpression // case 360: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Unary(pos(), Unary.PRE_DEC, a)); break; } // // Rule 361: UnaryExpressionNotPlusMinus ::= PostfixExpression // case 361: break; // // Rule 362: UnaryExpressionNotPlusMinus ::= ~ UnaryExpression // case 362: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Unary(pos(), Unary.BIT_NOT, a)); break; } // // Rule 363: UnaryExpressionNotPlusMinus ::= ! UnaryExpression // case 363: { Expr a = (Expr) btParser.getSym(2); btParser.setSym1(nf.Unary(pos(), Unary.NOT, a)); break; } // // Rule 365: MultiplicativeExpression ::= UnaryExpression // case 365: break; // // Rule 366: MultiplicativeExpression ::= MultiplicativeExpression * UnaryExpression // case 366: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.MUL, b)); break; } // // Rule 367: MultiplicativeExpression ::= MultiplicativeExpression / UnaryExpression // case 367: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.DIV, b)); break; } // // Rule 368: MultiplicativeExpression ::= MultiplicativeExpression % UnaryExpression // case 368: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.MOD, b)); break; } // // Rule 369: AdditiveExpression ::= MultiplicativeExpression // case 369: break; // // Rule 370: AdditiveExpression ::= AdditiveExpression + MultiplicativeExpression // case 370: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.ADD, b)); break; } // // Rule 371: AdditiveExpression ::= AdditiveExpression - MultiplicativeExpression // case 371: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.SUB, b)); break; } // // Rule 372: ShiftExpression ::= AdditiveExpression // case 372: break; // // Rule 373: ShiftExpression ::= ShiftExpression << AdditiveExpression // case 373: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.SHL, b)); break; } // // Rule 374: ShiftExpression ::= ShiftExpression > > AdditiveExpression // case 374: { // TODO: make sure that there is no space between the ">" signs Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(4); btParser.setSym1(nf.Binary(pos(), a, Binary.SHR, b)); break; } // // Rule 375: ShiftExpression ::= ShiftExpression > > > AdditiveExpression // case 375: { // TODO: make sure that there is no space between the ">" signs Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(5); btParser.setSym1(nf.Binary(pos(), a, Binary.USHR, b)); break; } // // Rule 376: RelationalExpression ::= ShiftExpression // case 376: break; // // Rule 377: RelationalExpression ::= RelationalExpression < ShiftExpression // case 377: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.LT, b)); break; } // // Rule 378: RelationalExpression ::= RelationalExpression > ShiftExpression // case 378: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.GT, b)); break; } // // Rule 379: RelationalExpression ::= RelationalExpression <= ShiftExpression // case 379: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.LE, b)); break; } // // Rule 380: RelationalExpression ::= RelationalExpression > = ShiftExpression // case 380: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(4); btParser.setSym1(nf.Binary(pos(), a, Binary.GE, b)); break; } // // Rule 381: EqualityExpression ::= RelationalExpression // case 381: break; // // Rule 382: EqualityExpression ::= EqualityExpression == RelationalExpression // case 382: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.EQ, b)); break; } // // Rule 383: EqualityExpression ::= EqualityExpression != RelationalExpression // case 383: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.NE, b)); break; } // // Rule 384: AndExpression ::= EqualityExpression // case 384: break; // // Rule 385: AndExpression ::= AndExpression & EqualityExpression // case 385: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.BIT_AND, b)); break; } // // Rule 386: ExclusiveOrExpression ::= AndExpression // case 386: break; // // Rule 387: ExclusiveOrExpression ::= ExclusiveOrExpression ^ AndExpression // case 387: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.BIT_XOR, b)); break; } // // Rule 388: InclusiveOrExpression ::= ExclusiveOrExpression // case 388: break; // // Rule 389: InclusiveOrExpression ::= InclusiveOrExpression | ExclusiveOrExpression // case 389: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.BIT_OR, b)); break; } // // Rule 390: ConditionalAndExpression ::= InclusiveOrExpression // case 390: break; // // Rule 391: ConditionalAndExpression ::= ConditionalAndExpression && InclusiveOrExpression // case 391: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.COND_AND, b)); break; } // // Rule 392: ConditionalOrExpression ::= ConditionalAndExpression // case 392: break; // // Rule 393: ConditionalOrExpression ::= ConditionalOrExpression || ConditionalAndExpression // case 393: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3); btParser.setSym1(nf.Binary(pos(), a, Binary.COND_OR, b)); break; } // // Rule 394: ConditionalExpression ::= ConditionalOrExpression // case 394: break; // // Rule 395: ConditionalExpression ::= ConditionalOrExpression ? Expression : ConditionalExpression // case 395: { Expr a = (Expr) btParser.getSym(1), b = (Expr) btParser.getSym(3), c = (Expr) btParser.getSym(5); btParser.setSym1(nf.Conditional(pos(), a, b, c)); break; } // // Rule 396: AssignmentExpression ::= ConditionalExpression // case 396: break; // // Rule 397: AssignmentExpression ::= Assignment // case 397: break; // // Rule 398: Assignment ::= LeftHandSide AssignmentOperator AssignmentExpression // case 398: { Expr a = (Expr) btParser.getSym(1); Assign.Operator b = (Assign.Operator) btParser.getSym(2); Expr c = (Expr) btParser.getSym(3); btParser.setSym1(nf.Assign(pos(), a, b, c)); break; } // // Rule 399: LeftHandSide ::= ExpressionName // case 399: { Name a = (Name) btParser.getSym(1); btParser.setSym1(a.toExpr()); break; } // // Rule 400: LeftHandSide ::= FieldAccess // case 400: break; // // Rule 401: LeftHandSide ::= ArrayAccess // case 401: break; // // Rule 402: AssignmentOperator ::= = // case 402: { btParser.setSym1(Assign.ASSIGN); break; } // // Rule 403: AssignmentOperator ::= *= // case 403: { btParser.setSym1(Assign.MUL_ASSIGN); break; } // // Rule 404: AssignmentOperator ::= /= // case 404: { btParser.setSym1(Assign.DIV_ASSIGN); break; } // // Rule 405: AssignmentOperator ::= %= // case 405: { btParser.setSym1(Assign.MOD_ASSIGN); break; } // // Rule 406: AssignmentOperator ::= += // case 406: { btParser.setSym1(Assign.ADD_ASSIGN); break; } // // Rule 407: AssignmentOperator ::= -= // case 407: { btParser.setSym1(Assign.SUB_ASSIGN); break; } // // Rule 408: AssignmentOperator ::= <<= // case 408: { btParser.setSym1(Assign.SHL_ASSIGN); break; } // // Rule 409: AssignmentOperator ::= > > = // case 409: { // TODO: make sure that there is no space between the ">" signs btParser.setSym1(Assign.SHR_ASSIGN); break; } // // Rule 410: AssignmentOperator ::= > > > = // case 410: { // TODO: make sure that there is no space between the ">" signs btParser.setSym1(Assign.USHR_ASSIGN); break; } // // Rule 411: AssignmentOperator ::= &= // case 411: { btParser.setSym1(Assign.BIT_AND_ASSIGN); break; } // // Rule 412: AssignmentOperator ::= ^= // case 412: { btParser.setSym1(Assign.BIT_XOR_ASSIGN); break; } // // Rule 413: AssignmentOperator ::= |= // case 413: { btParser.setSym1(Assign.BIT_OR_ASSIGN); break; } // // Rule 414: Expression ::= AssignmentExpression // case 414: break; // // Rule 415: ConstantExpression ::= Expression // case 415: break; // // Rule 416: Dimsopt ::= $Empty // case 416: { btParser.setSym1(new Integer(0)); break; } // // Rule 417: Dimsopt ::= Dims // case 417: break; // // Rule 418: Catchesopt ::= $Empty // case 418: { btParser.setSym1(new TypedList(new LinkedList(), Catch.class, false)); break; } // // Rule 419: Catchesopt ::= Catches // case 419: break; // // Rule 420: identifieropt ::= $Empty // case 420: btParser.setSym1(null); break; // // Rule 421: identifieropt ::= identifier // case 421: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 422: ForUpdateopt ::= $Empty // case 422: { btParser.setSym1(new TypedList(new LinkedList(), ForUpdate.class, false)); break; } // // Rule 423: ForUpdateopt ::= ForUpdate // case 423: break; // // Rule 424: Expressionopt ::= $Empty // case 424: btParser.setSym1(null); break; // // Rule 425: Expressionopt ::= Expression // case 425: break; // // Rule 426: ForInitopt ::= $Empty // case 426: { btParser.setSym1(new TypedList(new LinkedList(), ForInit.class, false)); break; } // // Rule 427: ForInitopt ::= ForInit // case 427: break; // // Rule 428: SwitchLabelsopt ::= $Empty // case 428: { btParser.setSym1(new TypedList(new LinkedList(), Case.class, false)); break; } // // Rule 429: SwitchLabelsopt ::= SwitchLabels // case 429: break; // // Rule 430: SwitchBlockStatementGroupsopt ::= $Empty // case 430: { btParser.setSym1(new TypedList(new LinkedList(), SwitchElement.class, false)); break; } // // Rule 431: SwitchBlockStatementGroupsopt ::= SwitchBlockStatementGroups // case 431: break; // // Rule 432: VariableModifiersopt ::= $Empty // case 432: { btParser.setSym1(Flags.NONE); break; } // // Rule 433: VariableModifiersopt ::= VariableModifiers // case 433: break; // // Rule 434: VariableInitializersopt ::= $Empty // case 434: btParser.setSym1(null); break; // // Rule 435: VariableInitializersopt ::= VariableInitializers // case 435: break; // // Rule 436: ElementValuesopt ::= $Empty // case 436: btParser.setSym1(null); break; // // Rule 437: ElementValuesopt ::= ElementValues // case 437: bad_rule = 437; break; // // Rule 438: ElementValuePairsopt ::= $Empty // case 438: btParser.setSym1(null); break; // // Rule 439: ElementValuePairsopt ::= ElementValuePairs // case 439: bad_rule = 439; break; // // Rule 440: DefaultValueopt ::= $Empty // case 440: btParser.setSym1(null); break; // // Rule 441: DefaultValueopt ::= DefaultValue // case 441: break; // // Rule 442: AnnotationTypeElementDeclarationsopt ::= $Empty // case 442: btParser.setSym1(null); break; // // Rule 443: AnnotationTypeElementDeclarationsopt ::= AnnotationTypeElementDeclarations // case 443: bad_rule = 443; break; // // Rule 444: AbstractMethodModifiersopt ::= $Empty // case 444: { btParser.setSym1(Flags.NONE); break; } // // Rule 445: AbstractMethodModifiersopt ::= AbstractMethodModifiers // case 445: break; // // Rule 446: ConstantModifiersopt ::= $Empty // case 446: { btParser.setSym1(Flags.NONE); break; } // // Rule 447: ConstantModifiersopt ::= ConstantModifiers // case 447: break; // // Rule 448: InterfaceMemberDeclarationsopt ::= $Empty // case 448: { btParser.setSym1(new TypedList(new LinkedList(), ClassMember.class, false)); break; } // // Rule 449: InterfaceMemberDeclarationsopt ::= InterfaceMemberDeclarations // case 449: break; // // Rule 450: ExtendsInterfacesopt ::= $Empty // case 450: { btParser.setSym1(new TypedList(new LinkedList(), TypeNode.class, false)); break; } // // Rule 451: ExtendsInterfacesopt ::= ExtendsInterfaces // case 451: break; // // Rule 452: InterfaceModifiersopt ::= $Empty // case 452: { btParser.setSym1(Flags.NONE); break; } // // Rule 453: InterfaceModifiersopt ::= InterfaceModifiers // case 453: break; // // Rule 454: ClassBodyopt ::= $Empty // case 454: btParser.setSym1(null); break; // // Rule 455: ClassBodyopt ::= ClassBody // case 455: break; // // Rule 456: Argumentsopt ::= $Empty // case 456: btParser.setSym1(null); break; // // Rule 457: Argumentsopt ::= Arguments // case 457: bad_rule = 457; break; // // Rule 458: EnumBodyDeclarationsopt ::= $Empty // case 458: btParser.setSym1(null); break; // // Rule 459: EnumBodyDeclarationsopt ::= EnumBodyDeclarations // case 459: bad_rule = 459; break; // // Rule 460: ,opt ::= $Empty // case 460: btParser.setSym1(null); break; // // Rule 461: ,opt ::= , // case 461: break; // // Rule 462: EnumConstantsopt ::= $Empty // case 462: btParser.setSym1(null); break; // // Rule 463: EnumConstantsopt ::= EnumConstants // case 463: bad_rule = 463; break; // // Rule 464: ArgumentListopt ::= $Empty // case 464: { btParser.setSym1(new TypedList(new LinkedList(), Catch.class, false)); break; } // // Rule 465: ArgumentListopt ::= ArgumentList // case 465: break; // // Rule 466: BlockStatementsopt ::= $Empty // case 466: { btParser.setSym1(new TypedList(new LinkedList(), Stmt.class, false)); break; } // // Rule 467: BlockStatementsopt ::= BlockStatements // case 467: break; // // Rule 468: ExplicitConstructorInvocationopt ::= $Empty // case 468: btParser.setSym1(null); break; // // Rule 469: ExplicitConstructorInvocationopt ::= ExplicitConstructorInvocation // case 469: break; // // Rule 470: ConstructorModifiersopt ::= $Empty // case 470: { btParser.setSym1(Flags.NONE); break; } // // Rule 471: ConstructorModifiersopt ::= ConstructorModifiers // case 471: break; // // Rule 472: ...opt ::= $Empty // case 472: btParser.setSym1(null); break; // // Rule 473: ...opt ::= ... // case 473: break; // // Rule 474: FormalParameterListopt ::= $Empty // case 474: { btParser.setSym1(new TypedList(new LinkedList(), Formal.class, false)); break; } // // Rule 475: FormalParameterListopt ::= FormalParameterList // case 475: break; // // Rule 476: Throwsopt ::= $Empty // case 476: { btParser.setSym1(new TypedList(new LinkedList(), TypeNode.class, false)); break; } // // Rule 477: Throwsopt ::= Throws // case 477: break; // // Rule 478: MethodModifiersopt ::= $Empty // case 478: { btParser.setSym1(Flags.NONE); break; } // // Rule 479: MethodModifiersopt ::= MethodModifiers // case 479: break; // // Rule 480: FieldModifiersopt ::= $Empty // case 480: { btParser.setSym1(Flags.NONE); break; } // // Rule 481: FieldModifiersopt ::= FieldModifiers // case 481: break; // // Rule 482: ClassBodyDeclarationsopt ::= $Empty // case 482: { btParser.setSym1(new TypedList(new LinkedList(), ClassMember.class, false)); break; } // // Rule 483: ClassBodyDeclarationsopt ::= ClassBodyDeclarations // case 483: break; // // Rule 484: Interfacesopt ::= $Empty // case 484: { btParser.setSym1(new TypedList(new LinkedList(), TypeNode.class, false)); break; } // // Rule 485: Interfacesopt ::= Interfaces // case 485: break; // // Rule 486: Superopt ::= $Empty // case 486: btParser.setSym1(null); break; // // Rule 487: Superopt ::= Super // case 487: break; // // Rule 488: TypeParametersopt ::= $Empty // case 488: btParser.setSym1(null); break; // // Rule 489: TypeParametersopt ::= TypeParameters // case 489: break; // // Rule 490: ClassModifiersopt ::= $Empty // case 490: { btParser.setSym1(Flags.NONE); break; } // // Rule 491: ClassModifiersopt ::= ClassModifiers // case 491: break; // // Rule 492: Annotationsopt ::= $Empty // case 492: btParser.setSym1(null); break; // // Rule 493: Annotationsopt ::= Annotations // case 493: bad_rule = 493; break; // // Rule 494: TypeDeclarationsopt ::= $Empty // case 494: { btParser.setSym1(new TypedList(new LinkedList(), TopLevelDecl.class, false)); break; } // // Rule 495: TypeDeclarationsopt ::= TypeDeclarations // case 495: break; // // Rule 496: ImportDeclarationsopt ::= $Empty // case 496: { btParser.setSym1(new TypedList(new LinkedList(), Import.class, false)); break; } // // Rule 497: ImportDeclarationsopt ::= ImportDeclarations // case 497: break; // // Rule 498: PackageDeclarationopt ::= $Empty // case 498: btParser.setSym1(null); break; // // Rule 499: PackageDeclarationopt ::= PackageDeclaration // case 499: break; // // Rule 500: WildcardBoundsOpt ::= $Empty // case 500: btParser.setSym1(null); break; // // Rule 501: WildcardBoundsOpt ::= WildcardBounds // case 501: bad_rule = 501; break; // // Rule 502: AdditionalBoundListopt ::= $Empty // case 502: btParser.setSym1(null); break; // // Rule 503: AdditionalBoundListopt ::= AdditionalBoundList // case 503: bad_rule = 503; break; // // Rule 504: TypeBoundopt ::= $Empty // case 504: btParser.setSym1(null); break; // // Rule 505: TypeBoundopt ::= TypeBound // case 505: bad_rule = 505; break; // // Rule 506: TypeArgumentsopt ::= $Empty // case 506: btParser.setSym1(null); break; // // Rule 507: TypeArgumentsopt ::= TypeArguments // case 507: bad_rule = 507; break; // // Rule 508: Type ::= DataType PlaceTypeSpecifieropt // case 508: { // Just parse the placetype and drop it for now. break; } // // Rule 509: Type ::= nullable < Type > // case 509: { TypeNode a = (TypeNode) btParser.getSym(3); btParser.setSym1(nf.Nullable(pos(), a)); break; } // // Rule 510: Type ::= future < Type > // case 510: { TypeNode a = (TypeNode) btParser.getSym(3); btParser.setSym1(nf.Future(pos(), a)); break; } // // Rule 511: DataType ::= PrimitiveType // case 511: break; // // Rule 512: DataType ::= ClassOrInterfaceType // case 512: break; // // Rule 513: DataType ::= ArrayType // case 513: break; // // Rule 514: PlaceTypeSpecifier ::= @ PlaceType // case 514: break; // // Rule 515: PlaceType ::= place // case 515: break; // // Rule 516: PlaceType ::= activity // case 516: break; // // Rule 517: PlaceType ::= method // case 517: break; // // Rule 518: PlaceType ::= current // case 518: break; // // Rule 519: PlaceType ::= PlaceExpression // case 519: break; // // Rule 520: ClassOrInterfaceType ::= TypeName DepParametersopt // case 520: { Name a = (Name) btParser.getSym(1); TypeNode t = a.toType(); DepParameterExpr b = (DepParameterExpr) btParser.getSym(2); btParser.setSym1(b == null ? t : nf.ParametricTypeNode(pos(), t, b)); break; } // // Rule 521: DepParameters ::= ( DepParameterExpr ) // case 521: break; // // Rule 522: DepParameterExpr ::= ArgumentList WhereClauseopt // case 522: { List a = (List) btParser.getSym(1); Expr b = (Expr) btParser.getSym(2); btParser.setSym1(nf.DepParameterExpr(pos(),a,b)); break; } // // Rule 523: DepParameterExpr ::= WhereClause // case 523: { Expr b = (Expr) btParser.getSym(1); btParser.setSym1(nf.DepParameterExpr(pos(), null, b)); break; } // // Rule 524: WhereClause ::= : Expression // case 524: break; // // Rule 526: X10ArrayType ::= Type [ . ] // case 526: { TypeNode a = (TypeNode) btParser.getSym(1); TypeNode t = nf.X10ArrayTypeNode(pos(), a, false, null); btParser.setSym1(t); break; } // // Rule 527: X10ArrayType ::= Type reference [ . ] // case 527: { TypeNode a = (TypeNode) btParser.getSym(1); btParser.setSym1(nf.X10ArrayTypeNode(pos(), a, false, null)); break; } // // Rule 528: X10ArrayType ::= Type value [ . ] // case 528: { TypeNode a = (TypeNode) btParser.getSym(1); btParser.setSym1(nf.X10ArrayTypeNode(pos(), a, true, null)); break; } // // Rule 529: X10ArrayType ::= Type [ DepParameterExpr ] // case 529: { TypeNode a = (TypeNode) btParser.getSym(1); DepParameterExpr b = (DepParameterExpr) btParser.getSym(2); btParser.setSym1(nf.X10ArrayTypeNode(pos(), a, false, b)); break; } // // Rule 530: X10ArrayType ::= Type reference [ DepParameterExpr ] // case 530: { TypeNode a = (TypeNode) btParser.getSym(1); DepParameterExpr b = (DepParameterExpr) btParser.getSym(2); btParser.setSym1(nf.X10ArrayTypeNode(pos(), a, false, b)); break; } // // Rule 531: X10ArrayType ::= Type value [ DepParameterExpr ] // case 531: { TypeNode a = (TypeNode) btParser.getSym(1); DepParameterExpr b = (DepParameterExpr) btParser.getSym(2); btParser.setSym1(nf.X10ArrayTypeNode(pos(), a, true, b)); break; } // // Rule 532: ObjectKind ::= value // case 532: bad_rule = 532; break; // // Rule 533: ObjectKind ::= reference // case 533: bad_rule = 533; break; // // Rule 534: MethodModifier ::= atomic // case 534: { btParser.setSym1(Flags.ATOMIC); break; } // // Rule 535: MethodModifier ::= extern // case 535: { btParser.setSym1(Flags.NATIVE); break; } // // Rule 536: ClassDeclaration ::= ValueClassDeclaration // case 536: break; // // Rule 537: ValueClassDeclaration ::= ClassModifiersopt value identifier Superopt Interfacesopt ClassBody // case 537: { Flags a = (Flags) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); TypeNode c = (TypeNode) btParser.getSym(4); List d = (List) btParser.getSym(5); ClassBody e = (ClassBody) btParser.getSym(6); btParser.setSym1(nf.ValueClassDecl(pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier(), c, d, e)); break; } // // Rule 538: ValueClassDeclaration ::= ClassModifiersopt value class identifier Superopt Interfacesopt ClassBody // case 538: { Flags a = (Flags) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(4)); TypeNode c = (TypeNode) btParser.getSym(5); List d = (List) btParser.getSym(6); ClassBody e = (ClassBody) btParser.getSym(7); btParser.setSym1(nf.ValueClassDecl(pos(btParser.getFirstToken(), btParser.getLastToken()), a, b.getIdentifier(), c, d, e)); break; } // // Rule 539: ArrayCreationExpression ::= new ArrayBaseType Unsafeopt [ ] ArrayInitializer // case 539: { TypeNode a = (TypeNode) btParser.getSym(2); ArrayInit d = (ArrayInit) btParser.getSym(6); // btParser.setSym1(nf.ArrayConstructor(pos(), a, false, null, d)); btParser.setSym1(nf.NewArray(pos(), a, 1, d)); break; } // // Rule 540: ArrayCreationExpression ::= new ArrayBaseType Unsafeopt [ Expression ] // case 540: { TypeNode a = (TypeNode) btParser.getSym(2); boolean unsafe = (btParser.getSym(3) != null); Expr c = (Expr) btParser.getSym(5); btParser.setSym1(nf.ArrayConstructor(pos(), a, unsafe, false, c, null)); break; } // // Rule 541: ArrayCreationExpression ::= new ArrayBaseType Unsafeopt [ Expression ] Expression // case 541: { TypeNode a = (TypeNode) btParser.getSym(2); boolean unsafe = (btParser.getSym(3) != null); Expr distr = (Expr) btParser.getSym(5); Expr initializer = (Expr) btParser.getSym(7); btParser.setSym1(nf.ArrayConstructor(pos(), a, unsafe, false, distr, initializer)); break; } // // Rule 542: ArrayCreationExpression ::= new ArrayBaseType Unsafeopt [ Expression ] ( FormalParameter ) MethodBody // case 542: { TypeNode a = (TypeNode) btParser.getSym(2); boolean unsafe = (btParser.getSym(3) != null); Expr distr = (Expr) btParser.getSym(5); X10Formal f = (X10Formal) btParser.getSym(8); Block body = (Block) btParser.getSym(10); New initializer = makeInitializer( pos(btParser.getFirstToken(7), btParser.getLastToken(10)), a, f, body ); btParser.setSym1(nf.ArrayConstructor(pos(), a, unsafe, false, distr, initializer)); break; } // // Rule 543: ArrayCreationExpression ::= new ArrayBaseType value Unsafeopt [ Expression ] // case 543: { TypeNode a = (TypeNode) btParser.getSym(2); boolean unsafe = (btParser.getSym(3) != null); Expr c = (Expr) btParser.getSym(6); btParser.setSym1(nf.ArrayConstructor(pos(), a, unsafe, true, c, null)); break; } // // Rule 544: ArrayCreationExpression ::= new ArrayBaseType value Unsafeopt [ Expression ] Expression // case 544: { TypeNode a = (TypeNode) btParser.getSym(2); boolean unsafe = (btParser.getSym(4) != null); Expr c = (Expr) btParser.getSym(6); Expr d = (Expr) btParser.getSym(8); btParser.setSym1(nf.ArrayConstructor(pos(), a, unsafe, true, c, d)); break; } // // Rule 545: X10ArrayInitializer ::= Expression // case 545: break; // Sigh this is not trivial to do just yet :-( // // Rule 546: X10ArrayInitializer ::= ( FormalParameter ) MethodBody // case 546: bad_rule = 546; break; // // Rule 547: ArrayBaseType ::= PrimitiveType // case 547: break; // // Rule 548: ArrayBaseType ::= ClassOrInterfaceType // case 548: break; // // Rule 549: ArrayAccess ::= ExpressionName [ ArgumentList ] // case 549: { Name e = (Name) btParser.getSym(1); List b = (List) btParser.getSym(3); if (b.size() == 1) btParser.setSym1(nf.X10ArrayAccess1(pos(), e.toExpr(), (Expr) b.get(0))); else btParser.setSym1(nf.X10ArrayAccess(pos(), e.toExpr(), b)); break; } // // Rule 550: ArrayAccess ::= PrimaryNoNewArray [ ArgumentList ] // case 550: { Expr a = (Expr) btParser.getSym(1); List b = (List) btParser.getSym(3); if (b.size() == 1) btParser.setSym1(nf.X10ArrayAccess1(pos(), a, (Expr) b.get(0))); else btParser.setSym1(nf.X10ArrayAccess(pos(), a, b)); break; } // // Rule 551: Statement ::= NowStatement // case 551: break; // // Rule 552: Statement ::= ClockedStatement // case 552: break; // // Rule 553: Statement ::= AsyncStatement // case 553: break; // // Rule 554: Statement ::= AtomicStatement // case 554: break; // // Rule 555: Statement ::= WhenStatement // case 555: break; // // Rule 556: Statement ::= ForEachStatement // case 556: break; // // Rule 557: Statement ::= AtEachStatement // case 557: break; // // Rule 558: Statement ::= FinishStatement // case 558: break; // // Rule 559: StatementWithoutTrailingSubstatement ::= NextStatement // case 559: break; // // Rule 560: StatementWithoutTrailingSubstatement ::= AwaitStatement // case 560: break; // // Rule 561: StatementNoShortIf ::= NowStatementNoShortIf // case 561: break; // // Rule 562: StatementNoShortIf ::= ClockedStatementNoShortIf // case 562: break; // // Rule 563: StatementNoShortIf ::= AsyncStatementNoShortIf // case 563: break; // // Rule 564: StatementNoShortIf ::= AtomicStatementNoShortIf // case 564: break; // // Rule 565: StatementNoShortIf ::= WhenStatementNoShortIf // case 565: break; // // Rule 566: StatementNoShortIf ::= ForEachStatementNoShortIf // case 566: break; // // Rule 567: StatementNoShortIf ::= AtEachStatementNoShortIf // case 567: break; // // Rule 568: StatementNoShortIf ::= FinishStatementNoShortIf // case 568: break; // // Rule 569: NowStatement ::= now ( Clock ) Statement // case 569: { Name a = (Name) btParser.getSym(3); Stmt b = (Stmt) btParser.getSym(5); btParser.setSym1(nf.Now(pos(), a.toExpr(), b)); break; } // // Rule 570: ClockedStatement ::= clocked ( ClockList ) Statement // case 570: { List a = (List) btParser.getSym(3); Block b = (Block) btParser.getSym(5); btParser.setSym1(nf.Clocked(pos(), a, b)); break; } // // Rule 571: AsyncStatement ::= async PlaceExpressionSingleListopt Statement // case 571: { Expr e = (Expr) btParser.getSym(2); Stmt b = (Stmt) btParser.getSym(3); btParser.setSym1(nf.Async(pos(), (e == null ? nf.Here(pos(btParser.getFirstToken())) : e), b)); break; } // // Rule 572: AtomicStatement ::= atomic PlaceExpressionSingleListopt Statement // case 572: { Expr e = (Expr) btParser.getSym(2); Stmt b = (Stmt) btParser.getSym(3); btParser.setSym1(nf.Atomic(pos(), (e == null ? nf.Here(pos(btParser.getFirstToken())) : e), b)); break; } // // Rule 573: WhenStatement ::= when ( Expression ) Statement // case 573: { Expr e = (Expr) btParser.getSym(3); Stmt s = (Stmt) btParser.getSym(5); btParser.setSym1(nf.When(pos(), e,s)); break; } // // Rule 574: WhenStatement ::= WhenStatement or ( Expression ) Statement // case 574: { When w = (When) btParser.getSym(1); Expr e = (Expr) btParser.getSym(4); Stmt s = (Stmt) btParser.getSym(6); When.Branch wb = nf.WhenBranch(pos(btParser.getFirstToken(2), btParser.getLastToken(6)), e, s); w.add(wb); btParser.setSym1(w); break; } // // Rule 575: ForEachStatement ::= foreach ( FormalParameter : Expression ) Statement // case 575: { X10Formal f = (X10Formal) btParser.getSym(3); Formal ff = f.flags(f.flags().Final()); // make it final Expr e = (Expr) btParser.getSym(5); Stmt s = (Stmt) btParser.getSym(7); X10Loop x = nf.ForEach(pos(), ff, e, f.hasExplodedVars() ? nf.Block(pos(), f.explode(s)) : s); btParser.setSym1(x); break; } // // Rule 576: AtEachStatement ::= ateach ( FormalParameter : Expression ) Statement // case 576: { X10Formal f = (X10Formal) btParser.getSym(3); Formal ff = f.flags(f.flags().Final()); // make it final Expr e = (Expr) btParser.getSym(5); Stmt s = (Stmt) btParser.getSym(7); X10Loop x = nf.AtEach(pos(), ff, e, f.hasExplodedVars() ? nf.Block(pos(), f.explode(s)) : s); btParser.setSym1(x); break; } // // Rule 577: EnhancedForStatement ::= for ( FormalParameter : Expression ) Statement // case 577: { X10Formal f = (X10Formal) btParser.getSym(3); Formal ff = f.flags(f.flags().Final()); // make it final Expr e = (Expr) btParser.getSym(5); Stmt s = (Stmt) btParser.getSym(7); X10Loop x = nf.ForLoop(pos(), ff, e, f.hasExplodedVars() ? nf.Block(pos(), f.explode(s)) : s); btParser.setSym1(x); break; } // // Rule 578: FinishStatement ::= finish Statement // case 578: { Stmt b = (Stmt) btParser.getSym(2); btParser.setSym1(nf.Finish(pos(), b)); break; } // // Rule 579: NowStatementNoShortIf ::= now ( Clock ) StatementNoShortIf // case 579: { Name a = (Name) btParser.getSym(3); Stmt b = (Stmt) btParser.getSym(5); btParser.setSym1(nf.Now(pos(), a.toExpr(), b)); break; } // // Rule 580: ClockedStatementNoShortIf ::= clocked ( ClockList ) StatementNoShortIf // case 580: { List a = (List) btParser.getSym(3); Stmt b = (Stmt) btParser.getSym(5); btParser.setSym1(nf.Clocked(pos(), a, b)); break; } // // Rule 581: AsyncStatementNoShortIf ::= async PlaceExpressionSingleListopt StatementNoShortIf // case 581: { Expr e = (Expr) btParser.getSym(2); Stmt b = (Stmt) btParser.getSym(3); btParser.setSym1(nf.Async(pos(), (e == null ? nf.Here(pos(btParser.getFirstToken())) : e), b)); break; } // // Rule 582: AtomicStatementNoShortIf ::= atomic StatementNoShortIf // case 582: { Expr e = (Expr) btParser.getSym(2); Stmt b = (Stmt) btParser.getSym(3); btParser.setSym1(nf.Atomic(pos(), (e == null ? nf.Here(pos(btParser.getFirstToken())) : e), b)); break; } // // Rule 583: WhenStatementNoShortIf ::= when ( Expression ) StatementNoShortIf // case 583: { Expr e = (Expr) btParser.getSym(3); Stmt s = (Stmt) btParser.getSym(5); btParser.setSym1(nf.When(pos(), e,s)); break; } // // Rule 584: WhenStatementNoShortIf ::= WhenStatement or ( Expression ) StatementNoShortIf // case 584: { When w = (When) btParser.getSym(1); Expr e = (Expr) btParser.getSym(4); Stmt s = (Stmt) btParser.getSym(6); When.Branch wb = nf.WhenBranch(pos(btParser.getFirstToken(2), btParser.getLastToken(6)), e, s); w.add(wb); btParser.setSym1(w); break; } // // Rule 585: ForEachStatementNoShortIf ::= foreach ( FormalParameter : Expression ) StatementNoShortIf // case 585: { X10Formal f = (X10Formal) btParser.getSym(3); Formal ff = f.flags(f.flags().Final()); // make it final Expr e = (Expr) btParser.getSym(5); Stmt s = (Stmt) btParser.getSym(7); X10Loop x = nf.ForEach(pos(), ff, e, f.hasExplodedVars() ? nf.Block(pos(), f.explode(s)) : s); btParser.setSym1(x); break; } // // Rule 586: AtEachStatementNoShortIf ::= ateach ( FormalParameter : Expression ) StatementNoShortIf // case 586: { X10Formal f = (X10Formal) btParser.getSym(3); Formal ff = f.flags(f.flags().Final()); // make it final Expr e = (Expr) btParser.getSym(5); Stmt s = (Stmt) btParser.getSym(7); X10Loop x = nf.AtEach(pos(), ff, e, f.hasExplodedVars() ? nf.Block(pos(), f.explode(s)) : s); btParser.setSym1(x); break; } // // Rule 587: EnhancedForStatementNoShortIf ::= for ( FormalParameter : Expression ) StatementNoShortIf // case 587: { X10Formal f = (X10Formal) btParser.getSym(3); Formal ff = f.flags(f.flags().Final()); // make it final Expr e = (Expr) btParser.getSym(5); Stmt s = (Stmt) btParser.getSym(7); X10Loop x = nf.ForLoop(pos(), ff, e, f.hasExplodedVars() ? nf.Block(pos(), f.explode(s)) : s); btParser.setSym1(x); break; } // // Rule 588: FinishStatementNoShortIf ::= finish StatementNoShortIf // case 588: { Stmt b = (Stmt) btParser.getSym(2); btParser.setSym1(nf.Finish(pos(), b)); break; } // // Rule 589: PlaceExpressionSingleList ::= ( PlaceExpression ) // case 589: { btParser.setSym1(btParser.getSym(2)); break; } // // Rule 590: PlaceExpression ::= here // case 590: { btParser.setSym1(nf.Here(pos(btParser.getFirstToken()))); break; } // // Rule 591: PlaceExpression ::= this // case 591: { btParser.setSym1(nf.Field(pos(btParser.getFirstToken()), nf.This(pos(btParser.getFirstToken())), "place")); break; } // // Rule 592: PlaceExpression ::= Expression // case 592: break; // // Rule 593: PlaceExpression ::= ArrayAccess // case 593: bad_rule = 593; break; // // Rule 594: NextStatement ::= next ; // case 594: { btParser.setSym1(nf.Next(pos())); break; } // // Rule 595: AwaitStatement ::= await Expression ; // case 595: { Expr e = (Expr) btParser.getSym(2); btParser.setSym1(nf.Await(pos(), e)); break; } // // Rule 596: ClockList ::= Clock // case 596: { Name c = (Name) btParser.getSym(1); List l = new TypedList(new LinkedList(), Expr.class, false); l.add(c.toExpr()); btParser.setSym1(l); break; } // // Rule 597: ClockList ::= ClockList , Clock // case 597: { List l = (List) btParser.getSym(1); Name c = (Name) btParser.getSym(3); l.add(c.toExpr()); // btParser.setSym1(l); break; } // // Rule 598: Clock ::= identifier // case 598: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } // // Rule 599: CastExpression ::= ( Type ) UnaryExpressionNotPlusMinus // case 599: { TypeNode a = (TypeNode) btParser.getSym(2); Expr b = (Expr) btParser.getSym(4); btParser.setSym1(nf.Cast(pos(), a, b)); break; } // // Rule 600: MethodInvocation ::= Primary -> identifier ( ArgumentListopt ) // case 600: { Expr a = (Expr) btParser.getSym(1); polyglot.lex.Identifier b = id(btParser.getToken(3)); List c = (List) btParser.getSym(5); btParser.setSym1(nf.RemoteCall(pos(), a, b.getIdentifier(), c)); break; } // // Rule 601: RelationalExpression ::= RelationalExpression instanceof Type // case 601: { Expr a = (Expr) btParser.getSym(1); TypeNode b = (TypeNode) btParser.getSym(3); btParser.setSym1(nf.Instanceof(pos(), a, b)); break; } // // Rule 602: ExpressionName ::= here // case 602: { btParser.setSym1(new Name(nf, ts, pos(), "here"){ public Expr toExpr() { return ((X10NodeFactory) nf).Here(pos); } }); break; } // // Rule 603: IdentifierList ::= IdentifierList , identifier // case 603: { List l = (List) btParser.getSym(1); polyglot.lex.Identifier a = id(btParser.getToken(3)); l.add(new Name(nf, ts, pos(), a.getIdentifier())); btParser.setSym1(l); break; } // // Rule 604: IdentifierList ::= identifier // case 604: { polyglot.lex.Identifier a = id(btParser.getToken(1)); List l = new TypedList(new LinkedList(), Name.class, false); l.add(new Name(nf, ts, pos(), a.getIdentifier())); btParser.setSym1(l); break; } // // Rule 605: Primary ::= FutureExpression // case 605: break; // // Rule 606: Primary ::= [ ArgumentList ] // case 606: { Name x10 = new Name(nf, ts, pos(), "x10"); Name x10Lang = new Name(nf, ts, pos(), x10, "lang"); Name x10LangRegion = new Name(nf, ts, pos(), x10Lang, "region"); Name x10LangRegionFactory = new Name(nf, ts, pos(), x10LangRegion, "factory"); Name x10LangRegionFactoryRegion = new Name(nf, ts, pos(), x10LangRegionFactory, "region"); Name x10LangPoint = new Name(nf, ts, pos(), x10Lang, "point"); Name x10LangPointFactory = new Name(nf, ts, pos(), x10LangPoint, "factory"); Name x10LangPointFactoryPoint = new Name(nf, ts, pos(), x10LangPointFactory, "point"); List a = (List) btParser.getSym(2); Tuple tuple = nf.Tuple(pos(), x10LangPointFactoryPoint, x10LangRegionFactoryRegion, a); btParser.setSym1(tuple); break; } // // Rule 607: AssignmentExpression ::= Expression -> Expression // case 607: { Expr a = (Expr) btParser.getSym(1); Expr b = (Expr) btParser.getSym(3); //System.out.println("Distribution:" + a + "|" + b + "|"); // x10.lang.region.factory.region( ArgumentList ) // Construct the MethodName Name x10 = new Name(nf, ts, pos(), "x10"); Name x10Lang = new Name(nf, ts, pos(), x10, "lang"); Name x10LangDistribution = new Name(nf, ts, pos(), x10Lang, "distribution"); Name x10LangDistributionFactory = new Name(nf, ts, pos(), x10LangDistribution, "factory"); Name x10LangDistributionFactoryConstant = new Name(nf, ts, pos(), x10LangDistributionFactory, "constant"); List l = new TypedList(new LinkedList(), Expr.class, false); l.add(a); l.add(b); Call call = nf.Call(pos(), x10LangDistributionFactoryConstant.prefix.toReceiver(), "constant", l); btParser.setSym1(call); break; } // // Rule 608: Primary ::= Expression : Expression // case 608: { Expr a = (Expr) btParser.getSym(1); Expr b = (Expr) btParser.getSym(3); Name x10 = new Name(nf, ts, pos(), "x10"); Name x10Lang = new Name(nf, ts, pos(), x10, "lang"); Name x10LangRegion = new Name(nf, ts, pos(), x10Lang, "region"); Name x10LangRegionFactory = new Name(nf, ts, pos(), x10LangRegion, "factory"); Name x10LangRegionFactoryRegion = new Name(nf, ts, pos(), x10LangRegionFactory, "region"); List l = new TypedList(new LinkedList(), Expr.class, false); l.add(a); l.add(b); Call regionCall = nf.Call( pos(), x10LangRegionFactoryRegion.prefix.toReceiver(), "region", l ); btParser.setSym1(regionCall); break; } // // Rule 609: FutureExpression ::= future PlaceExpressionSingleListopt { Expression } // case 609: { Expr e1 = (Expr) btParser.getSym(2), e2 = (Expr) btParser.getSym(4); btParser.setSym1(nf.Future(pos(), (e1 == null ? nf.Here(pos(btParser.getFirstToken())) : e1), e2)); break; } // // Rule 610: FieldModifier ::= mutable // case 610: { btParser.setSym1(Flags.MUTABLE); break; } // // Rule 611: FieldModifier ::= const // case 611: { btParser.setSym1(Flags.PUBLIC.set(Flags.STATIC).set(Flags.FINAL)); break; } // // Rule 612: FunExpression ::= fun Type ( FormalParameterListopt ) { Expression } // case 612: bad_rule = 612; break; // // Rule 613: MethodInvocation ::= MethodName ( ArgumentListopt ) ( ArgumentListopt ) // case 613: bad_rule = 613; break; // // Rule 614: MethodInvocation ::= Primary . identifier ( ArgumentListopt ) ( ArgumentListopt ) // case 614: bad_rule = 614; break; // // Rule 615: MethodInvocation ::= super . identifier ( ArgumentListopt ) ( ArgumentListopt ) // case 615: bad_rule = 615; break; // // Rule 616: MethodInvocation ::= ClassName . super . identifier ( ArgumentListopt ) ( ArgumentListopt ) // case 616: bad_rule = 616; break; // // Rule 617: MethodInvocation ::= TypeName . identifier ( ArgumentListopt ) ( ArgumentListopt ) // case 617: bad_rule = 617; break; // // Rule 618: ClassInstanceCreationExpression ::= new ClassOrInterfaceType ( ArgumentListopt ) ( ArgumentListopt ) ClassBodyopt // case 618: bad_rule = 618; break; // // Rule 619: ClassInstanceCreationExpression ::= Primary . new identifier ( ArgumentListopt ) ( ArgumentListopt ) ClassBodyopt // case 619: bad_rule = 619; break; // // Rule 620: ClassInstanceCreationExpression ::= AmbiguousName . new identifier ( ArgumentListopt ) ( ArgumentListopt ) ClassBodyopt // case 620: bad_rule = 620; break; // // Rule 621: PlaceTypeSpecifieropt ::= $Empty // case 621: btParser.setSym1(null); break; // // Rule 622: PlaceTypeSpecifieropt ::= PlaceTypeSpecifier // case 622: break; // // Rule 623: DepParametersopt ::= $Empty // case 623: btParser.setSym1(null); break; // // Rule 624: DepParametersopt ::= DepParameters // case 624: break; // // Rule 625: WhereClauseopt ::= $Empty // case 625: btParser.setSym1(null); break; // // Rule 626: WhereClauseopt ::= WhereClause // case 626: break; // // Rule 627: ObjectKindopt ::= $Empty // case 627: btParser.setSym1(null); break; // // Rule 628: ObjectKindopt ::= ObjectKind // case 628: break; // // Rule 629: ArrayInitializeropt ::= $Empty // case 629: btParser.setSym1(null); break; // // Rule 630: ArrayInitializeropt ::= ArrayInitializer // case 630: break; // // Rule 631: PlaceExpressionSingleListopt ::= $Empty // case 631: btParser.setSym1(null); break; // // Rule 632: PlaceExpressionSingleListopt ::= PlaceExpressionSingleList // case 632: break; // // Rule 633: ArgumentListopt ::= $Empty // case 633: btParser.setSym1(null); break; // // Rule 634: ArgumentListopt ::= ArgumentList // case 634: break; // // Rule 635: DepParametersopt ::= $Empty // case 635: btParser.setSym1(null); break; // // Rule 636: DepParametersopt ::= DepParameters // case 636: break; // // Rule 637: Unsafeopt ::= $Empty // case 637: btParser.setSym1(null); break; // // Rule 638: Unsafeopt ::= unsafe // case 638: { btParser.setSym1(nf.Here(pos(btParser.getFirstToken(1)))); break; } // // Rule 639: ParamIdopt ::= $Empty // case 639: btParser.setSym1(null); break; // // Rule 640: ParamIdopt ::= identifier // case 640: { polyglot.lex.Identifier a = id(btParser.getToken(1)); btParser.setSym1(new Name(nf, ts, pos(), a.getIdentifier())); break; } default: break; } return; } | 1769 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1769/4b2801ac2ab00275efc7eb5f3257db525f56ab9d/X10Parser.java/clean/x10.compiler/src/x10/parser/X10Parser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1720,
1803,
12,
474,
1720,
1854,
13,
565,
288,
3639,
309,
261,
8759,
67,
5345,
480,
374,
13,
5411,
327,
31,
3639,
1620,
261,
5345,
1854,
13,
3639,
288,
2398,
368,
5411,
368,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1720,
1803,
12,
474,
1720,
1854,
13,
565,
288,
3639,
309,
261,
8759,
67,
5345,
480,
374,
13,
5411,
327,
31,
3639,
1620,
261,
5345,
1854,
13,
3639,
288,
2398,
368,
5411,
368,
... | ||
Location loc = f.getLocation(); | Location loc = f.getLocation(); | protected void renderBead(final Graphics2D g2, final Feature f, final SequenceRenderContext context) { Location loc = f.getLocation(); int min = loc.getMin(); int max = loc.getMax(); int dif = max - min; if (context.getDirection() == context.HORIZONTAL) { double posXW = context.sequenceToGraphics(min); double posYN = beadDisplacement; double width = Math.max(((double) (dif + 1)) * context.getScale(), 1.0); double height = Math.min(beadDepth, width / 2.0); // If the bead height occupies less than the full height // of the renderer, move it down so that it is central if (height < beadDepth) posYN += ((beadDepth - height) / 2.0); rect.setRect(posXW, posYN, Math.floor(width), Math.floor(height)); } else { double posXW = beadDisplacement; double posYN = context.sequenceToGraphics(min); double height = Math.max(((double) dif + 1) * context.getScale(), 1.0); double width = Math.min(beadDepth, height / 2.0); if (width < beadDepth) posXW += ((beadDepth - width) / 2.0); rect.setRect(posXW, posYN, Math.floor(width), Math.floor(height)); } g2.setPaint(beadFill); g2.fill(rect); g2.setStroke(beadStroke); g2.setPaint(beadOutline); g2.draw(rect); } | 50397 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50397/3d7c8d7f908007358765695ed6c9864bda72f0ea/RectangularBeadRenderer.java/buggy/src/org/biojava/bio/gui/sequence/RectangularBeadRenderer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
918,
1743,
38,
684,
12,
6385,
16830,
22,
40,
5411,
314,
22,
16,
9506,
1377,
727,
7881,
9079,
284,
16,
9506,
1377,
727,
8370,
3420,
1042,
819,
13,
565,
288,
202,
2735,
1515,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1743,
38,
684,
12,
6385,
16830,
22,
40,
5411,
314,
22,
16,
9506,
1377,
727,
7881,
9079,
284,
16,
9506,
1377,
727,
8370,
3420,
1042,
819,
13,
565,
288,
202,
2735,
1515,
273,
... |
} | } | public synchronized Vector publishProject(CmsRequestContext context, CmsProject onlineProject, boolean backupEnabled, int backupTagId, I_CmsReport report, Hashtable exportpoints, CmsResource directPublishResource, int maxVersions) throws CmsException { CmsExportPointDriver discAccess = null; CmsFolder currentFolder = null; CmsFile currentFile = null; CmsResource currentFileHeader = null; CmsLock currentLock = null; CmsFolder newFolder = null; CmsFile newFile = null; CmsFile onlineFile = null; List offlineFolders = null; List offlineFiles = null; List deletedFolders = (List) new ArrayList(); Vector changedResources = new Vector(); String currentExportKey = null; String currentResourceName = null; long publishDate = System.currentTimeMillis(); Iterator i = null; boolean publishCurrentResource = false; List projectResources = null; Map properties = null; CmsFolder onlineFolder = null; Map sortedFolderMap = null; List sortedFolderList = null; CmsResource delOnlineFolder = null; byte[] contents = null; int publishHistoryId = nextPublishVersionId(); int m, n; try { discAccess = new CmsExportPointDriver(exportpoints); if (backupEnabled) { // write an entry in the publish project log m_driverManager.backupProject(context, context.currentProject(), backupTagId, publishDate); } // read the project resources of the project that gets published projectResources = m_driverManager.readProjectResources(context, context.currentProject()); // read all changed/new/deleted folders offlineFolders = m_driverManager.getVfsDriver().readFolders(context.currentProject().getId()); // ensure that the folders appear in the correct (DFS) tree order // sort out folders that will not be published sortedFolderMap = (Map) new HashMap(); i = offlineFolders.iterator(); while (i.hasNext()) { publishCurrentResource = false; currentFolder = (CmsFolder) i.next(); currentResourceName = m_driverManager.readPath(context, currentFolder, true); currentFolder.setFullResourceName(currentResourceName); currentLock = m_driverManager.getLock(context, currentResourceName); // the resource must have either a new/deleted state in the link or a new/delete state in the resource record publishCurrentResource = currentFolder.getState() > I_CmsConstants.C_STATE_UNCHANGED; if (context.currentProject().getType() == I_CmsConstants.C_PROJECT_TYPE_DIRECT_PUBLISH && directPublishResource != null) { // the resource must be a sub resource of the direct-publish-resource in case of a "direct publish" publishCurrentResource = publishCurrentResource && currentResourceName.startsWith(directPublishResource.getFullResourceName()); } else { // the resource must have a changed state and must be changed in the project that is currently published publishCurrentResource = publishCurrentResource && currentFolder.getProjectId() == context.currentProject().getId(); // the resource must be in one of the paths defined for the project publishCurrentResource = publishCurrentResource && CmsProject.isInsideProject(projectResources, currentFolder); } // the resource must be unlocked publishCurrentResource = publishCurrentResource && currentLock.isNullLock(); if (publishCurrentResource) { sortedFolderMap.put(currentResourceName, currentFolder); } } sortedFolderList = (List) new ArrayList(sortedFolderMap.keySet()); Collections.sort(sortedFolderList); offlineFolders.clear(); offlineFolders = null; m = 1; n = sortedFolderList.size(); i = sortedFolderList.iterator(); if (n > 0) { report.println(report.key("report.publish_folders_begin"), I_CmsReport.C_FORMAT_HEADLINE); } while (i.hasNext()) { currentResourceName = (String) i.next(); currentFolder = (CmsFolder) sortedFolderMap.get(currentResourceName); currentExportKey = checkExport(currentResourceName, exportpoints); if (currentFolder.getState() == I_CmsConstants.C_STATE_DELETED) { // C_STATE_DELETE deletedFolders.add(currentFolder); changedResources.addElement(currentResourceName); } else if (currentFolder.getState() == I_CmsConstants.C_STATE_NEW) { // I_CmsConstants.C_STATE_NEW report.print("( " + (m++) + " / " + n + " ) " + report.key("report.publishing.folder"), I_CmsReport.C_FORMAT_NOTE); report.println(context.removeSiteRoot(currentResourceName)); changedResources.addElement(currentResourceName); // export to filesystem if necessary if (currentExportKey != null) { discAccess.createFolder(currentResourceName, currentExportKey); } // create the new folder in the online project try { newFolder = (CmsFolder) currentFolder.clone(); newFolder.setState(I_CmsConstants.C_STATE_UNCHANGED); newFolder.setFullResourceName(currentResourceName); m_driverManager.getVfsDriver().createFolder(context.currentUser(), onlineProject, newFolder, newFolder.getParentId(), newFolder.getResourceName()); } catch (CmsException e) { if (e.getType() == CmsException.C_FILE_EXISTS) { try { onlineFolder = m_driverManager.getVfsDriver().readFolder(onlineProject.getId(), newFolder.getId()); onlineFolder.setFullResourceName(currentResourceName); } catch (CmsException exc) { throw exc; } m_driverManager.getVfsDriver().publishResource(onlineFolder, currentFolder); } else { throw e; } } // copy the access control entries of the folder m_driverManager.getUserDriver().publishAccessControlEntries(context.currentProject(), onlineProject, currentFolder.getResourceAceId(), newFolder.getResourceAceId()); // copy properties try { properties = m_driverManager.getVfsDriver().readProperties(context.currentProject().getId(), currentFolder, currentFolder.getType()); m_driverManager.getVfsDriver().writeProperties(properties, onlineProject.getId(), newFolder, newFolder.getType()); } catch (CmsException exc) { if (OpenCms.isLogging(I_CmsLogChannels.C_OPENCMS_INFO)) { OpenCms.log(I_CmsLogChannels.C_OPENCMS_INFO, "[" + this.getClass().getName() + "] error publishing, copy properties for " + newFolder.toString() + " Message= " + exc.getMessage()); } } if (backupEnabled) { // backup the offline resource and its properties m_driverManager.getBackupDriver().writeBackupResource(context.currentUser(), context.currentProject(), currentFolder, properties, backupTagId, publishDate, maxVersions); } writePublishHistory(context.currentProject(), publishHistoryId, backupTagId, currentResourceName, currentFolder); if (currentFolder.getState() != I_CmsConstants.C_STATE_UNCHANGED) { // set the state of current folder in the offline project to unchanged currentFolder.setState(I_CmsConstants.C_STATE_UNCHANGED); m_driverManager.getVfsDriver().updateResourceState(context.currentProject(), currentFolder, CmsDriverManager.C_UPDATE_ALL); } } else if (currentFolder.getState() == I_CmsConstants.C_STATE_CHANGED) { // I_CmsConstants.C_STATE_CHANGED report.print("( " + (m++) + " / " + n + " ) " + report.key("report.publishing.folder"), I_CmsReport.C_FORMAT_NOTE); report.println(context.removeSiteRoot(currentResourceName)); changedResources.addElement(currentResourceName); try { onlineFolder = m_driverManager.getVfsDriver().readFolder(onlineProject.getId(), currentFolder.getId()); onlineFolder.setFullResourceName(currentResourceName); } catch (CmsException exc) { // if folder does not exist online if (exc.getType() == CmsException.C_NOT_FOUND) { // create the new folder onlineFolder = m_driverManager.getVfsDriver().createFolder(context.currentUser(), onlineProject, currentFolder, currentFolder.getParentId(), currentFolder.getResourceName()); onlineFolder.setState(I_CmsConstants.C_STATE_UNCHANGED); onlineFolder.setFullResourceName(currentResourceName); m_driverManager.getVfsDriver().updateResourceState(context.currentProject(), onlineFolder, CmsDriverManager.C_UPDATE_ALL); } else { throw exc; } } // export to filesystem if necessary if (currentExportKey != null) { discAccess.createFolder(currentResourceName, currentExportKey); } m_driverManager.getVfsDriver().publishResource(onlineFolder, currentFolder); // copy the access control entries of the folder m_driverManager.getUserDriver().publishAccessControlEntries(context.currentProject(), onlineProject, currentFolder.getResourceAceId(), onlineFolder.getResourceAceId()); // copy properties try { m_driverManager.getVfsDriver().deleteAllProperties(onlineProject.getId(), onlineFolder); properties = m_driverManager.getVfsDriver().readProperties(context.currentProject().getId(), currentFolder, currentFolder.getType()); m_driverManager.getVfsDriver().writeProperties(properties, onlineProject.getId(), onlineFolder, currentFolder.getType()); } catch (CmsException exc) { if (OpenCms.isLogging(I_CmsLogChannels.C_OPENCMS_INFO)) { OpenCms.log(I_CmsLogChannels.C_OPENCMS_INFO, "[" + this.getClass().getName() + "] error publishing, deleting properties for " + onlineFolder.toString() + " Message= " + exc.getMessage()); } } if (backupEnabled) { // backup the offline resource m_driverManager.getBackupDriver().writeBackupResource(context.currentUser(), context.currentProject(), currentFolder, properties, backupTagId, publishDate, maxVersions); } writePublishHistory(context.currentProject(), publishHistoryId, backupTagId, currentResourceName, currentFolder); if (currentFolder.getState() != I_CmsConstants.C_STATE_UNCHANGED) { // set the state of current folder in the offline project to unchanged currentFolder.setState(I_CmsConstants.C_STATE_UNCHANGED); m_driverManager.getVfsDriver().updateResourceState(context.currentProject(), currentFolder, CmsDriverManager.C_UPDATE_ALL); } } m_driverManager.getVfsDriver().resetProjectId(context.currentProject(), currentFolder); OpenCms.fireCmsEvent(new CmsEvent(new CmsObject(), I_CmsEventListener.EVENT_RESOURCE_MODIFIED, Collections.singletonMap("resource", currentFolder))); i.remove(); properties = null; currentFolder = null; newFolder = null; onlineFolder = null; } if (n > 0) { report.println(report.key("report.publish_folders_end"), I_CmsReport.C_FORMAT_HEADLINE); } if (sortedFolderList != null) { sortedFolderList.clear(); sortedFolderList = null; } if (sortedFolderMap != null) { sortedFolderMap.clear(); sortedFolderMap = null; } /////////////////////////////////////////////////////////////////////////////////////// // now read all changed/new/deleted files offlineFiles = m_driverManager.getVfsDriver().readFiles(context.currentProject().getId()); // sort out files that will not be published i = offlineFiles.iterator(); while (i.hasNext()) { publishCurrentResource = false; currentFileHeader = (CmsResource) i.next(); currentResourceName = m_driverManager.readPath(context, currentFileHeader, true); currentFileHeader.setFullResourceName(currentResourceName); currentLock = m_driverManager.getLock(context, currentResourceName); switch (currentFileHeader.getState()) { // the current resource is deleted case I_CmsConstants.C_STATE_DELETED : // it is published, if it was changed to deleted in the current project String delProject=m_driverManager.getVfsDriver().readProperty(I_CmsConstants.C_PROPERTY_INTERNAL, context.currentProject().getId(), currentFileHeader, currentFileHeader.getType()); if (delProject!=null && delProject.equals(""+context.currentProject().getId())) { publishCurrentResource = true; } else { publishCurrentResource = false; } break; // the current resource is new case I_CmsConstants.C_STATE_NEW : // it is published, if it was created in the current project // or if it is a new sibling of another resource that is currently not changed in any project publishCurrentResource = currentFileHeader.getProjectId() == context.currentProject().getId() || currentFileHeader.getProjectId() == 0; break; // the current resource is changed case I_CmsConstants.C_STATE_CHANGED : // it is published, if it was changed in the current project publishCurrentResource = currentFileHeader.getProjectId() == context.currentProject().getId(); break; // the current resource is unchanged case I_CmsConstants.C_STATE_UNCHANGED : default : // so it is not published publishCurrentResource = false; break; } if (context.currentProject().getType() == I_CmsConstants.C_PROJECT_TYPE_DIRECT_PUBLISH && directPublishResource != null) { // the resource must be a sub resource of the direct-publish-resource in case of a "direct publish" publishCurrentResource = publishCurrentResource && currentResourceName.startsWith(directPublishResource.getFullResourceName()); } else { // the resource must be in one of the paths defined for the project publishCurrentResource = publishCurrentResource && CmsProject.isInsideProject(projectResources, currentFileHeader); } // do not publish resource that are locked publishCurrentResource = publishCurrentResource && currentLock.isNullLock(); // handle temporary files immediately here coz they aren't "published" anyway if (currentLock.isNullLock()) { // remove any possible temporary files for this resource m_driverManager.getVfsDriver().removeTemporaryFile(currentFileHeader); } if (currentFileHeader.getResourceName().startsWith(I_CmsConstants.C_TEMP_PREFIX)) { // trash the current resource if it is a temporary file m_driverManager.getVfsDriver().deleteAllProperties(context.currentProject().getId(), currentFileHeader); m_driverManager.getVfsDriver().removeFile(context.currentProject(), currentFileHeader); } if (!publishCurrentResource) { i.remove(); } } m = 1; n = offlineFiles.size(); i = offlineFiles.iterator(); if (n > 0) { report.println(report.key("report.publish_files_begin"), I_CmsReport.C_FORMAT_HEADLINE); } while (i.hasNext()) { currentFileHeader = (CmsResource) i.next(); currentResourceName = currentFileHeader.getFullResourceName(); currentFile = m_driverManager.getVfsDriver().readFile(context.currentProject().getId(), true, currentFileHeader.getId()); currentFile.setFullResourceName(currentResourceName); currentExportKey = checkExport(currentResourceName, exportpoints); /* * Only use getState() of the currentFileHeader to determine if a resource has * to be published or not! * * In case a resource has siblings, after a sibling is published the structure * and resource states are reset to UNCHANGED -> the state of the corresponding * currentFileHeader is still NEW,DELETED or CHANGED, but the state of currentFile * is UNCHANGED because currentFile is read AFTER siblings already got published. * Thus, using currentFile.getState() will inevitably result in unpublished resources! */ if (currentFileHeader.getState() == I_CmsConstants.C_STATE_DELETED) { // C_STATE_DELETE report.print("( " + (m++) + " / " + n + " ) " + report.key("report.deleting.file"), I_CmsReport.C_FORMAT_NOTE); report.println(context.removeSiteRoot(currentResourceName)); changedResources.addElement(currentResourceName); if (currentExportKey != null) { try { discAccess.removeResource(currentResourceName, currentExportKey); } catch (Exception ex) { // noop } } onlineFile = m_driverManager.readFileInProject(context, onlineProject.getId(), currentFile.getId(), false); onlineFile.setFullResourceName(currentResourceName); if (currentFile.isLabeled() && !m_driverManager.hasLabeledLinks(context, context.currentProject(), currentFile)) { // update the resource flags to "unlabel" the siblings for the offline resource int flags = currentFile.getFlags(); flags &= ~I_CmsConstants.C_RESOURCEFLAG_LABELLINK; currentFile.setFlags(flags); } if (onlineFile.isLabeled() && !m_driverManager.hasLabeledLinks(context, onlineProject, onlineFile)) { // update the resource flags to "unlabel" the siblings for the online resource int flags = onlineFile.getFlags(); flags &= ~I_CmsConstants.C_RESOURCEFLAG_LABELLINK; onlineFile.setFlags(flags); } if (backupEnabled) { properties = m_driverManager.getVfsDriver().readProperties(context.currentProject().getId(), currentFile, currentFile.getType()); m_driverManager.getBackupDriver().writeBackupResource(context.currentUser(), context.currentProject(), currentFile, properties, backupTagId, publishDate, maxVersions); } writePublishHistory(context.currentProject(), publishHistoryId, backupTagId, currentResourceName, currentFile); try { m_driverManager.getVfsDriver().deleteAllProperties(onlineProject.getId(), onlineFile); m_driverManager.getVfsDriver().deleteAllProperties(context.currentProject().getId(), currentFile); } catch (CmsException exc) { if (OpenCms.isLogging(I_CmsLogChannels.C_OPENCMS_INFO)) { OpenCms.log(I_CmsLogChannels.C_OPENCMS_INFO, "[" + this.getClass().getName() + "] error publishing, deleting properties for " + onlineFile.toString() + " Message= " + exc.getMessage()); } } try { m_driverManager.getVfsDriver().removeFile(onlineProject, onlineFile); m_driverManager.getVfsDriver().removeFile(context.currentProject(), currentFile); } catch (CmsException exc) { if (OpenCms.isLogging(I_CmsLogChannels.C_OPENCMS_INFO)) { OpenCms.log(I_CmsLogChannels.C_OPENCMS_INFO, "[" + this.getClass().getName() + "] error publishing, deleting resource for " + onlineFile.toString() + " Message= " + exc.getMessage()); } } try { m_driverManager.getUserDriver().removeAllAccessControlEntries(onlineProject, onlineFile.getResourceAceId()); m_driverManager.getUserDriver().removeAllAccessControlEntries(context.currentProject(), currentFile.getResourceAceId()); } catch (CmsException exc) { if (OpenCms.isLogging(I_CmsLogChannels.C_OPENCMS_INFO)) { OpenCms.log(I_CmsLogChannels.C_OPENCMS_INFO, "[" + this.getClass().getName() + "] error publishing, deleting resource for " + onlineFile.toString() + " Message= " + exc.getMessage()); } } } else if (currentFileHeader.getState() == I_CmsConstants.C_STATE_CHANGED) { // C_STATE_CHANGED report.print("( " + (m++) + " / " + n + " ) " + report.key("report.publishing.file"), I_CmsReport.C_FORMAT_NOTE); report.println(context.removeSiteRoot(currentResourceName)); changedResources.addElement(currentResourceName); // export to filesystem if necessary if (currentExportKey != null) { // Encoding project: Make sure files are written in the right encoding contents = currentFile.getContents(); String encoding = m_driverManager.getVfsDriver().readProperty(I_CmsConstants.C_PROPERTY_CONTENT_ENCODING, context.currentProject().getId(), currentFile, currentFile.getType()); if (encoding != null) { // Only files that have the encodig property set will be encoded, // the other files will be ignored. So images etc. are not touched. try { contents = (new String(contents, encoding)).getBytes(); } catch (UnsupportedEncodingException uex) { // contents will keep original value } } discAccess.writeFile(currentResourceName, currentExportKey, contents); } try { onlineFile = m_driverManager.getVfsDriver().readFile(onlineProject.getId(), false, currentFile.getId()); onlineFile.setFullResourceName(currentResourceName); } catch (CmsException exc) { if (exc.getType() == CmsException.C_NOT_FOUND) { // create a new File currentFile.setState(I_CmsConstants.C_STATE_UNCHANGED); onlineFile = m_driverManager.getVfsDriver().createFile(onlineProject, currentFile, context.currentUser().getId(), currentFile.getParentId(), currentFile.getResourceName()); } } m_driverManager.getVfsDriver().publishResource(onlineFile, currentFile); // copy properties try { m_driverManager.getVfsDriver().deleteAllProperties(onlineProject.getId(), onlineFile); properties = m_driverManager.getVfsDriver().readProperties(context.currentProject().getId(), currentFile, currentFile.getType()); m_driverManager.getVfsDriver().writeProperties(properties, onlineProject.getId(), onlineFile, currentFile.getType()); } catch (CmsException exc) { if (OpenCms.isLogging(I_CmsLogChannels.C_OPENCMS_INFO)) { OpenCms.log(I_CmsLogChannels.C_OPENCMS_INFO, "[" + this.getClass().getName() + "] error publishing, deleting properties for " + onlineFile.toString() + " Message= " + exc.getMessage()); } } // copy access control entries m_driverManager.getUserDriver().publishAccessControlEntries(context.currentProject(), onlineProject, currentFile.getResourceAceId(), onlineFile.getResourceAceId()); if (backupEnabled) { // backup the offline resource m_driverManager.getBackupDriver().writeBackupResource(context.currentUser(), context.currentProject(), currentFile, properties, backupTagId, publishDate, maxVersions); } writePublishHistory(context.currentProject(), publishHistoryId, backupTagId, currentResourceName, currentFile); if (currentFileHeader.getState() != I_CmsConstants.C_STATE_UNCHANGED) { // set the file state to unchanged currentFile.setState(I_CmsConstants.C_STATE_UNCHANGED); m_driverManager.getVfsDriver().updateResourceState(context.currentProject(), currentFile, CmsDriverManager.C_UPDATE_ALL); } m_driverManager.getVfsDriver().resetProjectId(context.currentProject(), currentFile); } else if (currentFileHeader.getState() == I_CmsConstants.C_STATE_NEW) { // C_STATE_NEW report.print("( " + (m++) + " / " + n + " ) " + report.key("report.publishing.file"), I_CmsReport.C_FORMAT_NOTE); report.println(context.removeSiteRoot(currentResourceName)); changedResources.addElement(currentResourceName); // export to filesystem if necessary if (currentExportKey != null) { // Encoding project: Make sure files are written in the right encoding contents = currentFile.getContents(); String encoding = m_driverManager.getVfsDriver().readProperty(I_CmsConstants.C_PROPERTY_CONTENT_ENCODING, context.currentProject().getId(), currentFile, currentFile.getType()); if (encoding != null) { // Only files that have the encodig property set will be encoded, // the other files will be ignored. So images etc. are not touched. try { contents = (new String(contents, encoding)).getBytes(); } catch (UnsupportedEncodingException uex) { // contents will keep original value } } discAccess.writeFile(currentResourceName, currentExportKey, contents); } // create the new file try { newFile = (CmsFile) currentFile.clone(); newFile.setState(I_CmsConstants.C_STATE_UNCHANGED); newFile.setFullResourceName(currentResourceName); m_driverManager.getVfsDriver().createFile(onlineProject, newFile, context.currentUser().getId(), newFile.getParentId(), newFile.getResourceName()); } catch (CmsException e) { if (e.getType() == CmsException.C_FILE_EXISTS) { try { onlineFile = m_driverManager.getVfsDriver().readFile(onlineProject.getId(), false, currentFile.getId()); onlineFile.setFullResourceName(currentResourceName); } catch (CmsException exc) { throw exc; } m_driverManager.getVfsDriver().publishResource(onlineFile, currentFile); } else { throw e; } } // copy properties try { properties = m_driverManager.getVfsDriver().readProperties(context.currentProject().getId(), currentFile, currentFile.getType()); m_driverManager.getVfsDriver().writeProperties(properties, onlineProject.getId(), newFile, newFile.getType()); } catch (CmsException exc) { if (OpenCms.isLogging(I_CmsLogChannels.C_OPENCMS_INFO)) { OpenCms.log(I_CmsLogChannels.C_OPENCMS_INFO, "[" + this.getClass().getName() + "] error publishing, copy properties for " + newFile.toString() + " Message= " + exc.getMessage()); } } // copy access control entries m_driverManager.getUserDriver().publishAccessControlEntries(context.currentProject(), onlineProject, currentFile.getResourceAceId(), newFile.getResourceAceId()); if (backupEnabled) { // backup the offline resource m_driverManager.getBackupDriver().writeBackupResource(context.currentUser(), context.currentProject(), currentFile, properties, backupTagId, publishDate, maxVersions); } writePublishHistory(context.currentProject(), publishHistoryId, backupTagId, currentResourceName, currentFile); if (currentFileHeader.getState() != I_CmsConstants.C_STATE_UNCHANGED) { // set the file state to unchanged currentFile.setState(I_CmsConstants.C_STATE_UNCHANGED); m_driverManager.getVfsDriver().updateResourceState(context.currentProject(), currentFile, CmsDriverManager.C_UPDATE_ALL); } m_driverManager.getVfsDriver().resetProjectId(context.currentProject(), currentFile); } OpenCms.fireCmsEvent(new CmsEvent(new CmsObject(), I_CmsEventListener.EVENT_RESOURCE_MODIFIED, Collections.singletonMap("resource", currentFile))); i.remove(); properties = null; currentFile = null; currentFileHeader = null; newFile = null; onlineFile = null; contents = null; } if (n > 0) { report.println(report.key("report.publish_files_end"), I_CmsReport.C_FORMAT_HEADLINE); } if (offlineFiles != null) { offlineFiles.clear(); offlineFiles = null; } //////////////////////////////////////////////////////////////////////////////////////// // now delete the "deleted" folders if (deletedFolders.isEmpty()) { return changedResources; } // ensure that the folders appear in the correct (DFS) tree order sortedFolderMap = (Map) new HashMap(); i = deletedFolders.iterator(); while (i.hasNext()) { currentFolder = (CmsFolder) i.next(); currentResourceName = currentFolder.getFullResourceName(); sortedFolderMap.put(currentResourceName, currentFolder); } sortedFolderList = (List) new ArrayList(sortedFolderMap.keySet()); Collections.sort(sortedFolderList); // reverse the order of the folder to delete them in a bottom-up order Collections.reverse(sortedFolderList); if (deletedFolders != null) { deletedFolders.clear(); deletedFolders = null; } m = 1; n = sortedFolderList.size(); i = sortedFolderList.iterator(); if (n > 0) { report.println(report.key("report.publish_delete_folders_begin"), I_CmsReport.C_FORMAT_HEADLINE); } while (i.hasNext()) { currentResourceName = (String) i.next(); currentFolder = (CmsFolder) sortedFolderMap.get(currentResourceName); currentExportKey = checkExport(currentResourceName, exportpoints); report.print("( " + (m++) + " / " + n + " ) " + report.key("report.deleting.folder"), I_CmsReport.C_FORMAT_NOTE); report.println(context.removeSiteRoot(currentResourceName)); if (currentExportKey != null) { discAccess.removeResource(currentResourceName, currentExportKey); } if (backupEnabled) { properties = m_driverManager.getVfsDriver().readProperties(context.currentProject().getId(), currentFolder, currentFolder.getType()); // backup the offline resource m_driverManager.getBackupDriver().writeBackupResource(context.currentUser(), context.currentProject(), currentFolder, properties, backupTagId, publishDate, maxVersions); } delOnlineFolder = m_driverManager.readFolder(context, currentFolder.getId(), true); delOnlineFolder.setFullResourceName(currentResourceName); try { m_driverManager.getVfsDriver().deleteAllProperties(onlineProject.getId(), delOnlineFolder); m_driverManager.getVfsDriver().deleteAllProperties(context.currentProject().getId(), currentFolder); } catch (CmsException exc) { if (OpenCms.isLogging(I_CmsLogChannels.C_OPENCMS_INFO)) { OpenCms.log(I_CmsLogChannels.C_OPENCMS_INFO, "[" + this.getClass().getName() + "] error publishing, deleting properties for " + currentFolder.toString() + " Message= " + exc.getMessage()); } } m_driverManager.getVfsDriver().removeFolder(onlineProject, currentFolder); m_driverManager.getVfsDriver().removeFolder(context.currentProject(), currentFolder); // delete both online and offline access control entries applied to this folder m_driverManager.getUserDriver().removeAllAccessControlEntries(onlineProject, delOnlineFolder.getResourceAceId()); m_driverManager.getUserDriver().removeAllAccessControlEntries(context.currentProject(), currentFolder.getResourceAceId()); OpenCms.fireCmsEvent(new CmsEvent(new CmsObject(), I_CmsEventListener.EVENT_RESOURCE_MODIFIED, Collections.singletonMap("resource", currentFolder))); i.remove(); currentFolder = null; delOnlineFolder = null; } if (n > 0) { report.println(report.key("report.publish_delete_folders_end"), I_CmsReport.C_FORMAT_HEADLINE); } if (sortedFolderList != null) { sortedFolderList.clear(); sortedFolderList = null; } if (sortedFolderMap != null) { sortedFolderMap.clear(); sortedFolderMap = null; } } catch (CmsException e) { // these are dummy catch blocks to have a finally block for clearing // allocated resources. thus the exceptions are just logged and // immediately thrown to the upper app. layer. if (OpenCms.isLogging(I_CmsLogChannels.C_OPENCMS_CRITICAL)) { OpenCms.log(I_CmsLogChannels.C_OPENCMS_CRITICAL, "[" + this.getClass().getName() + ".publishProject] " + e.getMessage()); } throw e; } catch (OutOfMemoryError o) { if (OpenCms.isLogging(I_CmsLogChannels.C_OPENCMS_CRITICAL)) { OpenCms.log(I_CmsLogChannels.C_OPENCMS_CRITICAL, "[" + this.getClass().getName() + ".publishProject] out of memory error!"); } // clear all caches to reclaim memory OpenCms.fireCmsEvent(new CmsEvent(new CmsObject(), I_CmsEventListener.EVENT_CLEAR_CACHES, new HashMap(), false)); // force a complete object finalization and garbage collection System.runFinalization(); Runtime.getRuntime().runFinalization(); System.gc(); Runtime.getRuntime().gc(); throw o; } finally { if (sortedFolderList != null) { sortedFolderList.clear(); sortedFolderList = null; } if (sortedFolderMap != null) { sortedFolderMap.clear(); sortedFolderMap = null; } if (deletedFolders != null) { deletedFolders.clear(); deletedFolders = null; } if (offlineFiles != null) { offlineFiles.clear(); offlineFiles = null; } properties = null; currentFile = null; currentFileHeader = null; newFile = null; onlineFile = null; currentFolder = null; newFolder = null; onlineFolder = null; discAccess = null; delOnlineFolder = null; currentExportKey = null; contents = null; } return changedResources; } | 8585 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8585/d8608fec2baa999d66e14e04cc11363ba207f04a/CmsProjectDriver.java/buggy/src/org/opencms/db/generic/CmsProjectDriver.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
3852,
5589,
3808,
4109,
12,
4747,
21426,
819,
16,
2149,
4109,
12365,
4109,
16,
1250,
5114,
1526,
16,
509,
5114,
1805,
548,
16,
467,
67,
25702,
2605,
16,
18559,
3359,
4139,
16,
7630,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3852,
5589,
3808,
4109,
12,
4747,
21426,
819,
16,
2149,
4109,
12365,
4109,
16,
1250,
5114,
1526,
16,
509,
5114,
1805,
548,
16,
467,
67,
25702,
2605,
16,
18559,
3359,
4139,
16,
7630,... |
String attrPrefix = null; if (attr.getLocalName() == null) throw new SAXException("[NamespaceNormalizingDOMStreamer] Encountered an attribute '"+attrName+"' without a local name, on node '"+nodeName+"'. This DOM streamer does not support DOM 1 attributes."); | String assignedAttrPrefix = null; | protected void startNode(Node node) throws SAXException { switch (node.getNodeType()) { case Node.COMMENT_NODE: { if (lexicalHandler != null) { String data = ((Comment) node).getData(); lexicalHandler.comment(data.toCharArray(), 0, data.length()); } } break; case Node.DOCUMENT_FRAGMENT_NODE: // ??; break; case Node.DOCUMENT_NODE: break; case Node.ELEMENT_NODE: NamedNodeMap atts = node.getAttributes(); int nAttrs = atts.getLength(); // create a list of localy declared namespace prefixes currentElementInfo = new NamespaceNormalizingDOMStreamer.ElementInfo(currentElementInfo); for (int i = 0; i < nAttrs; i++) { Node attr = atts.item(i); String attrName = attr.getNodeName(); if (attrName.equals("xmlns") || attrName.startsWith("xmlns:")) { int index; String prefix = (index = attrName.indexOf(":")) < 0 ? "" : attrName.substring(index + 1); currentElementInfo.put(prefix, attr.getNodeValue()); } } String namespaceURI = node.getNamespaceURI(); String prefix = node.getPrefix(); String localName = node.getLocalName(); String nodeName = node.getNodeName(); // SAX 1 node name, for debugging if (localName == null) throw new SAXException("[NamespaceNormalizingDOMStreamer] Encountered a DOM Element '"+nodeName+"' without a localName. DOM Level 1 trees are not supported by this DOMStreamer."); if (namespaceURI != null) { // no prefix means: make this the default namespace if (prefix == null) prefix = ""; // check that is declared String uri = currentElementInfo.findNamespaceURI(prefix); if (uri != null && uri.equals(namespaceURI)) { // System.out.println("namespace is declared"); // prefix is declared correctly, do nothing } else if (uri != null) { // System.out.println("prefix is declared with other namespace, overwriting it"); // prefix exists but is bound to another namespace, overwrite it currentElementInfo.put(prefix, namespaceURI); } else { // System.out.println("prefix is not yet declared, declaring it now"); currentElementInfo.put(prefix, namespaceURI); } } else { // element has no namespace // check if there is a default namespace, if so undeclare it String uri = currentElementInfo.findNamespaceURI(""); if (uri != null && !uri.equals("")) { // System.out.println("undeclaring default namespace"); currentElementInfo.put("", ""); } } // SAX uses empty string to denote no namespace, while DOM uses null. if (namespaceURI == null) namespaceURI = ""; String qName; if (prefix != null && prefix.length() > 0) qName = prefix + ":" + localName; else qName = localName; // make the attributes AttributesImpl newAttrs = new AttributesImpl(); for (int i = 0; i < nAttrs; i++) { Node attr = atts.item(i); String attrName = attr.getNodeName(); String attrPrefix = null; if (attr.getLocalName() == null) throw new SAXException("[NamespaceNormalizingDOMStreamer] Encountered an attribute '"+attrName+"' without a local name, on node '"+nodeName+"'. This DOM streamer does not support DOM 1 attributes."); // only do non-namespace attributes if (!(attrName.equals("xmlns") || attrName.startsWith("xmlns:"))) { if (attr.getNamespaceURI() != null) { String declaredUri = currentElementInfo.findNamespaceURI(attr.getPrefix()); // if the prefix is null, or the prefix has not been declared, or conflicts with an in-scope binding if (declaredUri == null || !declaredUri.equals(attr.getNamespaceURI())) { String availablePrefix = currentElementInfo.findPrefix(attr.getNamespaceURI()); if (availablePrefix != null) attrPrefix = availablePrefix; else { if (attr.getPrefix() != null && declaredUri == null) { // prefix is not null and is not yet declared: declare it attrPrefix = attr.getPrefix(); currentElementInfo.put(attrPrefix, attr.getNamespaceURI()); } else { // attribute has no prefix (which is not allowed for namespaced attributes) or // the prefix is already bound to something else: generate a new prefix newPrefixCounter++; attrPrefix = "NS" + newPrefixCounter; currentElementInfo.put(attrPrefix, attr.getNamespaceURI()); } } } else { attrPrefix = attr.getPrefix(); } } String attrNamespaceURI = attr.getNamespaceURI() != null ? attr.getNamespaceURI() : ""; String attrQName; if (attrPrefix != null) attrQName = attrPrefix + ":" + attr.getLocalName(); else attrQName = attr.getLocalName(); newAttrs.addAttribute(attrNamespaceURI, attr.getLocalName(), attrQName, "CDATA", attr.getNodeValue()); } } // add local namespace declaration and fire startPrefixMapping events if (currentElementInfo.namespaceDeclarations != null && currentElementInfo.namespaceDeclarations.size() > 0) { Iterator localNsDeclIt = currentElementInfo.namespaceDeclarations.entrySet().iterator(); while (localNsDeclIt.hasNext()) { Map.Entry entry = (Map.Entry) localNsDeclIt.next(); String pr = (String) entry.getKey(); String ns = (String) entry.getValue(); String pr1 = pr.equals("") ? "xmlns" : pr; String qn = pr.equals("") ? "xmlns" : "xmlns:" + pr; newAttrs.addAttribute("", pr1, qn, "CDATA", ns); // System.out.println("starting prefix mapping for prefix " + pr + " for " + ns); contentHandler.startPrefixMapping(pr, ns); } } contentHandler.startElement(namespaceURI, localName, qName, newAttrs); currentElementInfo.localName = localName; currentElementInfo.namespaceURI = namespaceURI; currentElementInfo.qName = qName; break; case Node.PROCESSING_INSTRUCTION_NODE: { ProcessingInstruction pi = (ProcessingInstruction) node; contentHandler.processingInstruction(pi.getNodeName(), pi.getData()); } break; case Node.CDATA_SECTION_NODE: { if (lexicalHandler != null) lexicalHandler.startCDATA(); dispatchChars(node); if (lexicalHandler != null) lexicalHandler.endCDATA(); } break; case Node.TEXT_NODE: { dispatchChars(node); } break; case Node.ENTITY_REFERENCE_NODE: { EntityReference eref = (EntityReference) node; if (lexicalHandler != null) { lexicalHandler.startEntity(eref.getNodeName()); } else { // warning("Can not output entity to a pure SAX ContentHandler"); } } break; default : } } | 46428 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46428/edc18a0ad05bf3612a251ffae128935e73886b5c/DOMStreamer.java/buggy/src/java/org/apache/cocoon/xml/dom/DOMStreamer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
4750,
918,
25467,
12,
907,
756,
13,
1216,
14366,
288,
5411,
1620,
261,
2159,
18,
588,
15101,
10756,
288,
7734,
648,
2029,
18,
12200,
67,
8744,
30,
10792,
288,
13491,
309,
261,
4149,
1706,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
540,
4750,
918,
25467,
12,
907,
756,
13,
1216,
14366,
288,
5411,
1620,
261,
2159,
18,
588,
15101,
10756,
288,
7734,
648,
2029,
18,
12200,
67,
8744,
30,
10792,
288,
13491,
309,
261,
4149,
1706,... |
protected void firePropertyChange(String property, Object oldValue, Object newValue) { Class listenerClass = java.beans.PropertyChangeListener.class; Object[] listenerList = listeners.getListeners(listenerClass); for(int i = 0; i < listenerList.length; i++) { PropertyChangeListener l = (PropertyChangeListener)listenerList[i]; l.propertyChange(new PropertyChangeEvent( this, property, oldValue, newValue)); } | void firePropertyChange(String property, Object oldValue, Object newValue) { Object[] array = listeners; if (array != null) { firePropertyChangeImpl(array, property, oldValue, newValue); } | protected void firePropertyChange(String property, Object oldValue, Object newValue) { Class listenerClass = java.beans.PropertyChangeListener.class; Object[] listenerList = listeners.getListeners(listenerClass); for(int i = 0; i < listenerList.length; i++) { PropertyChangeListener l = (PropertyChangeListener)listenerList[i]; l.propertyChange(new PropertyChangeEvent( this, property, oldValue, newValue)); } } | 19000 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/19000/81ae8747740fe18459d2015164e4c0e8b6ed5dbb/Context.java/clean/src/org/mozilla/javascript/Context.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
918,
4452,
1396,
3043,
12,
780,
1272,
16,
1033,
11144,
16,
4766,
1377,
1033,
6129,
13,
288,
5411,
1659,
2991,
797,
273,
2252,
18,
2196,
634,
18,
1396,
15744,
18,
1106,
31,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
918,
4452,
1396,
3043,
12,
780,
1272,
16,
1033,
11144,
16,
4766,
1377,
1033,
6129,
13,
288,
5411,
1659,
2991,
797,
273,
2252,
18,
2196,
634,
18,
1396,
15744,
18,
1106,
31,
5411,
1... |
List nodes = preferenceManager .getElements(PreferenceManager.POST_ORDER); for (Iterator i = nodes.iterator(); i.hasNext();) { IPreferenceNode node = (IPreferenceNode) i.next(); if (node.getId().equals(nodeId)) return node; } return null; } | List nodes = preferenceManager .getElements(PreferenceManager.POST_ORDER); for (Iterator i = nodes.iterator(); i.hasNext();) { IPreferenceNode node = (IPreferenceNode) i.next(); if (node.getId().equals(nodeId)) return node; } return null; } | protected IPreferenceNode findNodeMatching(String nodeId) { List nodes = preferenceManager .getElements(PreferenceManager.POST_ORDER); for (Iterator i = nodes.iterator(); i.hasNext();) { IPreferenceNode node = (IPreferenceNode) i.next(); if (node.getId().equals(nodeId)) return node; } return null; } | 55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/d6d458c4d729d92f70d2e5d4166fe0c3ff50c883/PreferenceDialog.java/clean/bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
467,
9624,
907,
1104,
907,
9517,
12,
780,
11507,
13,
288,
3639,
987,
2199,
273,
11555,
1318,
7734,
263,
588,
3471,
12,
9624,
1318,
18,
3798,
67,
7954,
1769,
3639,
364,
261,
3198,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
467,
9624,
907,
1104,
907,
9517,
12,
780,
11507,
13,
288,
3639,
987,
2199,
273,
11555,
1318,
7734,
263,
588,
3471,
12,
9624,
1318,
18,
3798,
67,
7954,
1769,
3639,
364,
261,
3198,
... |
typeAndRun('\t'); | type('\t'); | public void testExitOnTab() throws BadLocationException, JavaModelException, CoreException { use14(); setCaret(BODY_OFFSET); type('('); type('('); type('('); type('('); typeAndRun('\t'); assertEquals("(((())))", fDocument.get(BODY_OFFSET, 8)); assertEquals(BODY_OFFSET + 5, getCaret()); LinkedModeModel model= LinkedModeModel.getModel(fDocument, BODY_OFFSET + 5); assertNotNull(model); assertTrue(model.isNested()); typeAndRun('\t'); typeAndRun('\t'); assertEquals("(((())))", fDocument.get(BODY_OFFSET, 8)); assertEquals(BODY_OFFSET + 7, getCaret()); model= LinkedModeModel.getModel(fDocument, BODY_OFFSET + 7); assertNotNull(model); assertFalse(model.isNested()); typeAndRun('\t'); assertEquals("(((())))", fDocument.get(BODY_OFFSET, 8)); assertEquals(BODY_OFFSET + 8, getCaret()); assertFalse(LinkedModeModel.hasInstalledModel(fDocument)); } | 9698 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/9698/376240f96b8d520e0b161b6f94801361283f351a/BracketInserterTest.java/clean/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/BracketInserterTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1842,
6767,
1398,
5661,
1435,
1216,
6107,
2735,
503,
16,
5110,
1488,
503,
16,
30015,
288,
202,
202,
1202,
3461,
5621,
202,
202,
542,
39,
20731,
12,
16691,
67,
11271,
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,
918,
1842,
6767,
1398,
5661,
1435,
1216,
6107,
2735,
503,
16,
5110,
1488,
503,
16,
30015,
288,
202,
202,
1202,
3461,
5621,
202,
202,
542,
39,
20731,
12,
16691,
67,
11271,
1769,
... |
public PipedInputStream() { buffer = new byte[PIPE_SIZE]; } | PipedInputStream() { return; } | public PipedInputStream() { buffer = new byte[PIPE_SIZE]; } | 45163 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45163/8d285042d388a7105e3b50a5f438a5cd5ecdb499/PipedInputStream.java/buggy/libjava/java/io/PipedInputStream.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
29305,
329,
4348,
1435,
225,
288,
565,
1613,
273,
394,
1160,
63,
27602,
67,
4574,
15533,
225,
289,
2,
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,
282,
1071,
29305,
329,
4348,
1435,
225,
288,
565,
1613,
273,
394,
1160,
63,
27602,
67,
4574,
15533,
225,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
Variant variant = new Variant(true); auto.setProperty(RegisterAsBrowser, variant); variant.dispose(); | public Browser(Composite parent, int style) { super(parent, style &~ SWT.BORDER); info = Browser.DOCHOSTUIFLAG_THEME; if ((style & SWT.BORDER) == 0) info |= Browser.DOCHOSTUIFLAG_NO3DOUTERBORDER; frame = new OleFrame(this, SWT.NONE); try { site = new WebSite(frame, SWT.NONE, "Shell.Explorer"); //$NON-NLS-1$ } catch (SWTException e) { dispose(); SWT.error(SWT.ERROR_NO_HANDLES); } site.doVerb(OLE.OLEIVERB_INPLACEACTIVATE); auto = new OleAutomation(site); Listener listener = new Listener() { public void handleEvent(Event e) { switch (e.type) { case SWT.Dispose: { if (auto != null) auto.dispose(); auto = null; break; } case SWT.Resize: { frame.setBounds(getClientArea()); break; } case SWT.KeyDown: case SWT.KeyUp: { notifyListeners(e.type, e); break; } } } }; addListener(SWT.Dispose, listener); addListener(SWT.Resize, listener); site.addListener(SWT.KeyDown, listener); site.addListener(SWT.KeyUp, listener); OleListener oleListener = new OleListener() { public void handleEvent(OleEvent event) { switch (event.type) { case BeforeNavigate2: { Variant varResult = event.arguments[1]; String url = varResult.getString(); LocationEvent newEvent = new LocationEvent(Browser.this); newEvent.display = getDisplay(); newEvent.widget = Browser.this; newEvent.location = url; newEvent.doit = true; for (int i = 0; i < locationListeners.length; i++) locationListeners[i].changing(newEvent); Variant cancel = event.arguments[6]; if (cancel != null) { int pCancel = cancel.getByRef(); COM.MoveMemory(pCancel, new short[]{newEvent.doit ? COM.VARIANT_FALSE : COM.VARIANT_TRUE}, 2); } break; } case CommandStateChange: { boolean enabled = false; Variant varResult = event.arguments[0]; int command = varResult.getInt(); varResult = event.arguments[1]; enabled = varResult.getBoolean(); switch (command) { case CSC_NAVIGATEBACK : back = enabled; break; case CSC_NAVIGATEFORWARD : forward = enabled; break; } break; } case DocumentComplete: { Variant varResult = event.arguments[0]; IDispatch dispatch = varResult.getDispatch(); varResult = event.arguments[1]; String url = varResult.getString(); if (html != null && url.equals(ABOUT_BLANK)) { Runnable runnable = new Runnable () { public void run() { if (isDisposed() || html == null) return; int charCount = html.length(); char[] chars = new char[charCount]; html.getChars(0, charCount, chars, 0); html = null; int byteCount = OS.WideCharToMultiByte(OS.CP_UTF8, 0, chars, charCount, null, 0, null, null); /* * Note. Internet Explorer appears to treat the data loaded with * nsIPersistStreamInit.Load as if it were encoded using the default * local charset. There does not seem to be an API to set the * desired charset explicitely in this case. The fix is to * prepend the UTF-8 Byte Order Mark signature to the data. */ byte[] UTF8BOM = {(byte)0xEF, (byte)0xBB, (byte)0xBF}; int hGlobal = OS.GlobalAlloc(OS.GMEM_FIXED, UTF8BOM.length + byteCount); if (hGlobal != 0) { OS.MoveMemory(hGlobal, UTF8BOM, UTF8BOM.length); OS.WideCharToMultiByte(OS.CP_UTF8, 0, chars, charCount, hGlobal + UTF8BOM.length, byteCount, null, null); int[] ppstm = new int[1]; /* * Note. CreateStreamOnHGlobal is called with the flag fDeleteOnRelease. * If the call succeeds the buffer hGlobal is freed automatically * when the IStream object is released. If the call fails, free the buffer * hGlobal. */ if (OS.CreateStreamOnHGlobal(hGlobal, true, ppstm) == OS.S_OK) { int[] rgdispid = auto.getIDsOfNames(new String[] {"Document"}); //$NON-NLS-1$ Variant pVarResult = auto.getProperty(rgdispid[0]); IDispatch dispatchDocument = pVarResult.getDispatch(); int[] ppvObject = new int[1]; int result = dispatchDocument.QueryInterface(COM.IIDIPersistStreamInit, ppvObject); if (result == OS.S_OK) { IPersistStreamInit persistStreamInit = new IPersistStreamInit(ppvObject[0]); if (persistStreamInit.InitNew() == OS.S_OK) { persistStreamInit.Load(ppstm[0]); } persistStreamInit.Release(); } pVarResult.dispose(); /* * This code is intentionally commented. The IDispatch obtained from a Variant * did not increase the reference count for the enclosed interface. */ //dispatchDocument.Release(); IUnknown stream = new IUnknown(ppstm[0]); stream.Release(); } else { OS.GlobalFree(hGlobal); } } } }; if (delaySetText) { delaySetText = false; getDisplay().asyncExec(runnable); } else { runnable.run(); } } else { Variant variant = new Variant(auto); IDispatch top = variant.getDispatch(); LocationEvent locationEvent = new LocationEvent(Browser.this); locationEvent.display = getDisplay(); locationEvent.widget = Browser.this; locationEvent.location = url; locationEvent.top = top.getAddress() == dispatch.getAddress(); for (int i = 0; i < locationListeners.length; i++) locationListeners[i].changed(locationEvent); /* * This code is intentionally commented. A Variant constructed from an * OleAutomation object does not increase its reference count. The IDispatch * obtained from this Variant did not increase the reference count for the * OleAutomation instance either. */ //top.Release(); //variant.dispose(); /* * Note. The completion of the page loading is detected as * described in the MSDN article "Determine when a page is * done loading in WebBrowser Control". */ if (globalDispatch != 0 && dispatch.getAddress() == globalDispatch) { /* final document complete */ globalDispatch = 0; ProgressEvent progressEvent = new ProgressEvent(Browser.this); progressEvent.display = getDisplay(); progressEvent.widget = Browser.this; for (int i = 0; i < progressListeners.length; i++) progressListeners[i].completed(progressEvent); } } /* * This code is intentionally commented. This IDispatch was received * as an argument from the OleEvent and it will be disposed along with * the other arguments. */ //dispatch.Release(); break; } case NavigateComplete2: { Variant varResult = event.arguments[0]; IDispatch dispatch = varResult.getDispatch(); if (globalDispatch == 0) globalDispatch = dispatch.getAddress(); break; } case NewWindow2: { Variant cancel = event.arguments[1]; int pCancel = cancel.getByRef(); WindowEvent newEvent = new WindowEvent(Browser.this); newEvent.display = getDisplay(); newEvent.widget = Browser.this; newEvent.required = false; for (int i = 0; i < openWindowListeners.length; i++) openWindowListeners[i].open(newEvent); Browser browser = newEvent.browser; boolean doit = browser != null && !browser.isDisposed(); if (doit) { Variant variant = new Variant(browser.auto); IDispatch iDispatch = variant.getDispatch(); Variant ppDisp = event.arguments[0]; int byref = ppDisp.getByRef(); if (byref != 0) COM.MoveMemory(byref, new int[] {iDispatch.getAddress()}, 4); /* * This code is intentionally commented. A Variant constructed from an * OleAutomation object does not increase its reference count. The IDispatch * obtained from this Variant did not increase the reference count for the * OleAutomation instance either. */ //variant.dispose(); //iDispatch.Release(); } if (newEvent.required) { COM.MoveMemory(pCancel, new short[]{doit ? COM.VARIANT_FALSE : COM.VARIANT_TRUE}, 2); } break; } case OnMenuBar: { Variant arg0 = event.arguments[0]; menuBar = arg0.getBoolean(); break; } case OnStatusBar: { Variant arg0 = event.arguments[0]; statusBar = arg0.getBoolean(); break; } case OnToolBar: { Variant arg0 = event.arguments[0]; toolBar = arg0.getBoolean(); /* * Feature in Internet Explorer. OnToolBar FALSE is emitted * when both tool bar, address bar and menu bar must not be visible. * OnToolBar TRUE is emitted when either of tool bar, address bar * or menu bar is visible. */ if (!toolBar) { addressBar = false; menuBar = false; } break; } case OnVisible: { Variant arg1 = event.arguments[0]; boolean visible = arg1.getBoolean(); WindowEvent newEvent = new WindowEvent(Browser.this); newEvent.display = getDisplay(); newEvent.widget = Browser.this; if (visible) { if (addressBar) { /* * Bug in Internet Explorer. There is no distinct notification for * the address bar. If neither address, menu or tool bars are visible, * OnToolBar FALSE is emitted. For some reason, querying the value of * AddressBar in this case returns true even though it should not be * set visible. The workaround is to only query the value of AddressBar * when OnToolBar FALSE has not been emitted. */ int[] rgdispid = auto.getIDsOfNames(new String[] { "AddressBar" }); //$NON-NLS-1$ Variant pVarResult = auto.getProperty(rgdispid[0]); if (pVarResult != null && pVarResult.getType() == OLE.VT_BOOL) addressBar = pVarResult.getBoolean(); } newEvent.addressBar = addressBar; newEvent.menuBar = menuBar; newEvent.statusBar = statusBar; newEvent.toolBar = toolBar; newEvent.location = location; newEvent.size = size; for (int i = 0; i < visibilityWindowListeners.length; i++) { visibilityWindowListeners[i].show(newEvent); } location = null; size = null; } else { for (int i = 0; i < visibilityWindowListeners.length; i++) visibilityWindowListeners[i].hide(newEvent); } break; } case ProgressChange: { Variant arg1 = event.arguments[0]; int nProgress = arg1.getType() != OLE.VT_I4 ? 0 : arg1.getInt(); // may be -1 Variant arg2 = event.arguments[1]; int nProgressMax = arg2.getType() != OLE.VT_I4 ? 0 : arg2.getInt(); ProgressEvent newEvent = new ProgressEvent(Browser.this); newEvent.display = getDisplay(); newEvent.widget = Browser.this; newEvent.current = nProgress; newEvent.total = nProgressMax; if (nProgress != -1) { for (int i = 0; i < progressListeners.length; i++) progressListeners[i].changed(newEvent); } break; } case StatusTextChange: { Variant arg1 = event.arguments[0]; if (arg1.getType() == OLE.VT_BSTR) { String text = arg1.getString(); StatusTextEvent newEvent = new StatusTextEvent(Browser.this); newEvent.display = getDisplay(); newEvent.widget = Browser.this; newEvent.text = text; for (int i = 0; i < statusTextListeners.length; i++) statusTextListeners[i].changed(newEvent); } break; } case TitleChange: { Variant arg1 = event.arguments[0]; if (arg1.getType() == OLE.VT_BSTR) { String title = arg1.getString(); TitleEvent newEvent = new TitleEvent(Browser.this); newEvent.display = getDisplay(); newEvent.widget = Browser.this; newEvent.title = title; for (int i = 0; i < titleListeners.length; i++) titleListeners[i].changed(newEvent); } break; } case WindowClosing: { WindowEvent newEvent = new WindowEvent(Browser.this); newEvent.display = getDisplay(); newEvent.widget = Browser.this; for (int i = 0; i < closeWindowListeners.length; i++) closeWindowListeners[i].close(newEvent); Variant cancel = event.arguments[1]; int pCancel = cancel.getByRef(); COM.MoveMemory(pCancel, new short[]{COM.VARIANT_FALSE}, 2); dispose(); break; } case WindowSetHeight: { if (size == null) size = new Point(0, 0); Variant arg1 = event.arguments[0]; size.y = arg1.getInt(); break; } case WindowSetLeft: { if (location == null) location = new Point(0, 0); Variant arg1 = event.arguments[0]; location.x = arg1.getInt(); break; } case WindowSetTop: { if (location == null) location = new Point(0, 0); Variant arg1 = event.arguments[0]; location.y = arg1.getInt(); break; } case WindowSetWidth: { if (size == null) size = new Point(0, 0); Variant arg1 = event.arguments[0]; size.x = arg1.getInt(); break; } } /* * Dispose all arguments passed in the OleEvent. This must be * done to properly release any IDispatch reference that was * automatically addRef'ed when constructing the OleEvent. */ Variant[] arguments = event.arguments; for (int i = 0; i < arguments.length; i++) arguments[i].dispose(); } }; site.addEventListener(BeforeNavigate2, oleListener); site.addEventListener(CommandStateChange, oleListener); site.addEventListener(DocumentComplete, oleListener); site.addEventListener(NavigateComplete2, oleListener); site.addEventListener(NewWindow2, oleListener); site.addEventListener(OnMenuBar, oleListener); site.addEventListener(OnStatusBar, oleListener); site.addEventListener(OnToolBar, oleListener); site.addEventListener(OnVisible, oleListener); site.addEventListener(ProgressChange, oleListener); site.addEventListener(StatusTextChange, oleListener); site.addEventListener(TitleChange, oleListener); site.addEventListener(WindowClosing, oleListener); site.addEventListener(WindowSetHeight, oleListener); site.addEventListener(WindowSetLeft, oleListener); site.addEventListener(WindowSetTop, oleListener); site.addEventListener(WindowSetWidth, oleListener); //Variant variant = new Variant(true); //auto.setProperty(RegisterAsBrowser, variant); //variant.dispose(); Variant variant = new Variant(false); int[] rgdispid = auto.getIDsOfNames(new String[] {"RegisterAsDropTarget"}); //$NON-NLS-1$ if (rgdispid != null) auto.setProperty(rgdispid[0], variant); variant.dispose();} | 12413 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12413/40db15170a2341925dc6e99e6110c2cce7e031e1/Browser.java/buggy/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Browser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
15408,
12,
9400,
982,
16,
509,
2154,
13,
288,
202,
9565,
12,
2938,
16,
2154,
473,
98,
348,
8588,
18,
38,
7954,
1769,
202,
1376,
273,
15408,
18,
3191,
1792,
4005,
5370,
9651,
67,
24644,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1071,
15408,
12,
9400,
982,
16,
509,
2154,
13,
288,
202,
9565,
12,
2938,
16,
2154,
473,
98,
348,
8588,
18,
38,
7954,
1769,
202,
1376,
273,
15408,
18,
3191,
1792,
4005,
5370,
9651,
67,
24644,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.