rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
RuleSet r = new RuleSet(); | RuleSetWrapper r = new RuleSetWrapper(); | public void testNestedRuleset() { PMDTask task = new PMDTask(); RuleSet r = new RuleSet(); r.addText("rulesets/basic.xml"); task.addRuleset(r); r.addText("rulesets/design.xml"); task.addRuleset(r); Formatter f = new Formatter(); task.addFormatter(f); //TODO try { task.execute(); } catch (BuildException be) { //fail(be.toString()); } } | 41673 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/41673/9d035416e27e0e751e95aa6762f8046ce19c18be/PMDTaskTest.java/buggy/pmd/regress/test/net/sourceforge/pmd/ant/PMDTaskTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
8649,
4478,
278,
1435,
288,
3639,
453,
6188,
2174,
1562,
273,
394,
453,
6188,
2174,
5621,
3639,
6781,
694,
3611,
436,
273,
394,
6781,
694,
3611,
5621,
3639,
436,
18,
1289... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8649,
4478,
278,
1435,
288,
3639,
453,
6188,
2174,
1562,
273,
394,
453,
6188,
2174,
5621,
3639,
6781,
694,
3611,
436,
273,
394,
6781,
694,
3611,
5621,
3639,
436,
18,
1289... |
else | else { | protected void createLinkTarget() { if (linkedResourceGroup != null) { String linkTarget = linkedResourceGroup.getLinkTarget(); linkTargetPath = new Path(linkTarget); } else linkTargetPath = null;} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/1103255e57999ed4cac752c08031d695a1e83226/WizardNewFileCreationPage.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/WizardNewFileCreationPage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4750,
918,
752,
2098,
2326,
1435,
288,
202,
430,
261,
17738,
18860,
480,
446,
13,
288,
202,
202,
780,
1692,
2326,
273,
8459,
18860,
18,
588,
2098,
2326,
5621,
202,
202,
1232,
2326,
743,
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4750,
918,
752,
2098,
2326,
1435,
288,
202,
430,
261,
17738,
18860,
480,
446,
13,
288,
202,
202,
780,
1692,
2326,
273,
8459,
18860,
18,
588,
2098,
2326,
5621,
202,
202,
1232,
2326,
743,
273,
... |
item = tree.getItem(index); | updateItem(tree.getItem(index), element); | public void replace(Object parent, int index, Object element) { Widget item; if(parent.equals(getInput())) { item = tree.getItem(index); } else { TreeItem parentItem = (TreeItem) findItem(parent); item = parentItem.getItem(index); } updateItem(item, element); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/5c5335d54b997d8fa81bd201af9f644316877cbd/TreeViewer.java/clean/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeViewer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1453,
12,
921,
982,
16,
509,
770,
16,
1033,
930,
13,
288,
202,
202,
4609,
761,
31,
202,
202,
430,
12,
2938,
18,
14963,
12,
588,
1210,
1435,
3719,
288,
1082,
202,
1726,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1453,
12,
921,
982,
16,
509,
770,
16,
1033,
930,
13,
288,
202,
202,
4609,
761,
31,
202,
202,
430,
12,
2938,
18,
14963,
12,
588,
1210,
1435,
3719,
288,
1082,
202,
1726,
... |
JExpression narg1 = doPromote(args[0], new JDoubleLiteral(null, 0.0)); double darg1 = narg1.doubleValue(); | if (ident.equals("max")) { JExpression narg1 = doPromote(args[0], new JDoubleLiteral(null, 0.0)); | public Object visitMethodCallExpression(JMethodCallExpression self, JExpression prefix, String ident, JExpression[] args) { prefix.accept(this); for (int i = 0; i < args.length; i++) { if (args[i] != null) { JExpression newArg = (JExpression)args[i].accept(this); if (write && newArg != args[i]) args[i] = newArg; } } // Look for known idempotent functions. if (args.length == 1 && args[0].isConstant()) { if (ident.equals("sin") || ident.equals("cos") || ident.equals("log") || ident.equals("exp") || ident.equals("atan") || ident.equals("sqrt") || ident.equals("floor") || ident.equals("ceil")) { JExpression narg = doPromote(args[0], new JDoubleLiteral(null, 0.0)); double darg = narg.doubleValue(); if (ident.equals("sin")) { return new JDoubleLiteral(self.getTokenReference(), Math.sin(darg)); } if (ident.equals("cos")) return new JDoubleLiteral(self.getTokenReference(), Math.cos(darg)); if (ident.equals("log")) return new JDoubleLiteral(self.getTokenReference(), Math.log(darg)); if (ident.equals("exp")) return new JDoubleLiteral(self.getTokenReference(), Math.exp(darg)); if (ident.equals("atan")) return new JDoubleLiteral(self.getTokenReference(), Math.atan(darg)); if (ident.equals("sqrt")) return new JDoubleLiteral(self.getTokenReference(), Math.sqrt(darg)); if (ident.equals("floor")) return new JDoubleLiteral(self.getTokenReference(), Math.floor(darg)); if (ident.equals("ceil")) return new JDoubleLiteral(self.getTokenReference(), Math.ceil(darg)); } } // RMR { look for known functions with 2 args if (args.length == 2 && args[0].isConstant() && args[1].isConstant()) { JExpression narg1 = doPromote(args[0], new JDoubleLiteral(null, 0.0)); double darg1 = narg1.doubleValue(); JExpression narg2 = doPromote(args[1], new JDoubleLiteral(null, 0.0)); double darg2 = narg2.doubleValue(); // RMR { if (ident.equals("max")) return new JDoubleLiteral(self.getTokenReference(), Math.max(darg1, darg2)); // } RMR } // } RMR return self; } | 5955 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5955/bd7dfdf2d5da95d28edef690501bc338632b0088/Propagator.java/clean/streams/src/at/dms/kjc/sir/lowering/Propagator.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1033,
3757,
12592,
2300,
12,
46,
12592,
2300,
365,
16,
4766,
5411,
804,
2300,
1633,
16,
4766,
5411,
514,
3390,
16,
4766,
5411,
804,
2300,
8526,
833,
13,
565,
288,
3639,
1633,
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,
1033,
3757,
12592,
2300,
12,
46,
12592,
2300,
365,
16,
4766,
5411,
804,
2300,
1633,
16,
4766,
5411,
514,
3390,
16,
4766,
5411,
804,
2300,
8526,
833,
13,
565,
288,
3639,
1633,
18,
... |
.add(host, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) | .add(host, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) | private void initComponents() { buttonGroup1 = new javax.swing.ButtonGroup(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); host = new javax.swing.JTextField(); password = new javax.swing.JPasswordField(); next = new javax.swing.JButton(); imageHere = new javax.swing.JPanel(); createNew = new javax.swing.JRadioButton(); connectExisting = new javax.swing.JRadioButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jLabel1.setText(L10n.getString("HostPort")); jLabel2.setText(L10n.getString("Password")); host.setText("localhost:1099"); next.setText("Next"); imageHere.setBackground(new java.awt.Color(0, 0, 0)); org.jdesktop.layout.GroupLayout imageHereLayout = new org.jdesktop.layout.GroupLayout(imageHere); imageHere.setLayout(imageHereLayout); imageHereLayout.setHorizontalGroup( imageHereLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 397, Short.MAX_VALUE) ); imageHereLayout.setVerticalGroup( imageHereLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 198, Short.MAX_VALUE) ); buttonGroup1.add(createNew); createNew.setSelected(true); createNew.setText("Create and start a new server"); createNew.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); createNew.setMargin(new java.awt.Insets(0, 0, 0, 0)); buttonGroup1.add(connectExisting); connectExisting.setText("Connect to a running server"); connectExisting.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); connectExisting.setMargin(new java.awt.Insets(0, 0, 0, 0)); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(imageHere, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(createNew) .add(connectExisting) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jLabel1) .add(jLabel2)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(host, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE) .add(password, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE))) .add(org.jdesktop.layout.GroupLayout.TRAILING, next)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(imageHere, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(createNew) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(connectExisting) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel1) .add(host, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jLabel2) .add(password, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(next) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents | 57211 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57211/e58895a8af69faac60cbce6f60c0c83258a4d425/ServerLoginView.java/clean/trunk/src/net/sf/plantlore/server/manager/ServerLoginView.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
1208,
7171,
1435,
288,
3639,
3568,
1114,
21,
273,
394,
6863,
18,
5328,
310,
18,
3616,
1114,
5621,
3639,
26538,
21,
273,
394,
6863,
18,
5328,
310,
18,
46,
2224,
5621,
3639,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1208,
7171,
1435,
288,
3639,
3568,
1114,
21,
273,
394,
6863,
18,
5328,
310,
18,
3616,
1114,
5621,
3639,
26538,
21,
273,
394,
6863,
18,
5328,
310,
18,
46,
2224,
5621,
3639,
26... |
final Document staticStateDocument = TransformerUtils.saxStoreToDom4jDocument(staticStateSAXStore); containingDocument[0] = XFormsServer.createXFormsContainingDocument(pipelineContext, initialXFormsState, null, staticStateDocument); | containingDocument[0] = XFormsServer.createXFormsContainingDocument(pipelineContext, initialXFormsState, null, xformsEngineStaticState); | private void createCacheContainingDocument(PipelineContext pipelineContext, SAXStore staticStateSAXStore, XFormsContainingDocument[] containingDocument, XFormsServer.XFormsState[] xformsState) { // This is the state after XForms initialization boolean[] requireClientSubmission = new boolean[1]; { final XFormsServer.XFormsState initialXFormsState = new XFormsServer.XFormsState(XFormsUtils.encodeXML(pipelineContext, staticStateSAXStore, XFormsUtils.getEncryptionKey()), ""); // TODO FIXME TEMP XXX final Document staticStateDocument = TransformerUtils.saxStoreToDom4jDocument(staticStateSAXStore); containingDocument[0] = XFormsServer.createXFormsContainingDocument(pipelineContext, initialXFormsState, null, staticStateDocument); final Document dynamicStateDocument = XFormsServer.createDynamicStateDocument(containingDocument[0], requireClientSubmission); xformsState[0] = new XFormsServer.XFormsState(initialXFormsState.getStaticState(), XFormsUtils.encodeXML(pipelineContext, dynamicStateDocument)); } // Cache document if requested and possible { if (XFormsUtils.isCacheDocument()) { if (!requireClientSubmission[0]) { // NOTE: We check on requireClientSubmission because the event is encoded // in the dynamic state. But if we stored the event separately, then we // could still cache the containing document. XFormsServerDocumentCache.instance().add(pipelineContext, xformsState[0], containingDocument[0]); } else { // Since we cannot cache the result, we have to get the object out of its current pool final ObjectPool objectPool = containingDocument[0].getSourceObjectPool(); if (objectPool != null) { logger.debug("XForms - containing document cache: discarding non-cacheable document from pool."); try { objectPool.invalidateObject(containingDocument); containingDocument[0].setSourceObjectPool(null); } catch (Exception e1) { throw new OXFException(e1); } } } } } } | 10097 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/10097/cafe4dda86b47106037a77d4bc918e0a8fca5ac1/XFormsToXHTML.java/clean/src/java/org/orbeon/oxf/xforms/processor/XFormsToXHTML.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
752,
1649,
24344,
2519,
12,
8798,
1042,
5873,
1042,
16,
10168,
2257,
760,
1119,
55,
2501,
2257,
16,
4766,
9079,
1139,
18529,
24344,
2519,
8526,
4191,
2519,
16,
1139,
18529,
2081,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
752,
1649,
24344,
2519,
12,
8798,
1042,
5873,
1042,
16,
10168,
2257,
760,
1119,
55,
2501,
2257,
16,
4766,
9079,
1139,
18529,
24344,
2519,
8526,
4191,
2519,
16,
1139,
18529,
2081,... |
return (ChangeListener[]) changeListenerList.getListenerList(); | return (ChangeListener[]) listenerList.getListeners(ChangeListener.class); | public ChangeListener[] getChangeListeners() { return (ChangeListener[]) changeListenerList.getListenerList(); } | 5916 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5916/14511e3ad21013e92c6399b2bd2ec09a8263e33a/JProgressBar.java/clean/libjava/javax/swing/JProgressBar.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
7576,
2223,
8526,
336,
3043,
5583,
1435,
225,
288,
565,
327,
261,
15744,
63,
5717,
2991,
682,
18,
588,
5583,
12,
15744,
18,
1106,
1769,
225,
289,
282,
2,
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,
0,
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,
7576,
2223,
8526,
336,
3043,
5583,
1435,
225,
288,
565,
327,
261,
15744,
63,
5717,
2991,
682,
18,
588,
5583,
12,
15744,
18,
1106,
1769,
225,
289,
282,
2,
-100,
-100,
-100,
-100,
-... |
nullString = literal(); | private String getRoot() { Token t = getFirstToken(); /* * we need to see if this reference is escaped. if so * we will clean off the leading \'s and let the * regular behavior determine if we should output this * as \$foo or $foo later on in render(). Lazyness.. */ escaped = false; if ( t.image.startsWith("\\")) { /* * count the escapes : even # -> not escaped, odd -> escaped */ int i = 0; int len = t.image.length(); while( i < len && t.image.charAt(i) == '\\' ) i++; if ( (i % 2) != 0 ) escaped = true; if (i > 0) prefix = t.image.substring(0, i / 2 ); t.image = t.image.substring(i); } /* * geirm : changed Parser.jjt to handle the $foo! bug * and the tree structure changed. Leaving this stuff here * for a little while in case something bad happens. :) * following line was -> if (t.image.equals("$!")) */ if (t.image.startsWith("$!")) { referenceType = QUIET_REFERENCE; nullString = ""; /* * geirm : Parser.jjt change. was -> if (t.next.image.equals("{")) */ if (t.image.startsWith("$!{")) { /* * ex : $!{provider.Title} */ /* * geirm : Parser.jjt change. Was -> return t.next.next.image; */ return t.next.image; } else { /* * ex : $!provider.Title */ /* * geirm : Parser.jjt change. Was -> return t.next.image; */ return t.image.substring(2); } } else if (t.image.equals("${")) { /* * ex : ${provider.Title} */ referenceType = FORMAL_REFERENCE; nullString = literal(); return t.next.image; } else { /* * ex : $provider.Title */ referenceType = NORMAL_REFERENCE; nullString = literal(); return t.image.substring(1); } } | 55820 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55820/5a07a0aadb47c27cb18829fb08a350235bfbbe47/ASTReference.java/buggy/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
514,
7656,
1435,
565,
288,
3639,
3155,
268,
273,
7521,
1345,
5621,
1171,
1748,
540,
380,
225,
732,
1608,
358,
2621,
309,
333,
2114,
353,
8345,
18,
225,
309,
1427,
540,
380,
225,
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,
377,
3238,
514,
7656,
1435,
565,
288,
3639,
3155,
268,
273,
7521,
1345,
5621,
1171,
1748,
540,
380,
225,
732,
1608,
358,
2621,
309,
333,
2114,
353,
8345,
18,
225,
309,
1427,
540,
380,
225,
7... | |
public void testCreateAndDeleteResources() throws Throwable { CmsObject cms = getCmsObject(); String filename = "/dummy1.txt"; CmsProject offlineProject = cms.getRequestContext().currentProject(); int counter = 5; try { // switch to the default site in the offline project cms.getRequestContext().saveSiteRoot(); cms.getRequestContext().setSiteRoot("/sites/default/"); cms.getRequestContext().setCurrentProject(offlineProject); for (int i = 1; i <= counter; i++) { // create a plain text file String contentStr = "content version " + i; cms.createResource(filename, CmsResourceTypePlain.getStaticTypeId(), contentStr.getBytes(), null); cms.unlockResource(filename); cms.publishResource(filename); // delete the resource again cms.lockResource(filename); cms.deleteResource(filename, CmsResource.DELETE_PRESERVE_SIBLINGS); cms.unlockResource(filename); cms.publishResource(filename); } // re-create the resource to be able to read all versions from the history // assert that we have the expected number of versions in the history cms.createResource(filename, CmsResourceTypePlain.getStaticTypeId(), null, null); List backupResources = cms.readAllBackupFileHeaders(filename); assertEquals(counter, backupResources.size()); for (int i = 0; i < counter; i++) { // the list of backup resources contains at index 0 the // resource with the highest version and tag ID int version = counter - i; String contentStr = "content version " + version; // assert that the backup resource has the correct version CmsBackupResource backupResource = (CmsBackupResource)backupResources.get(i); assertEquals(version, backupResource.getVersionId()); cms.restoreResourceBackup(filename, backupResource.getTagId()); CmsFile file = cms.readFile(filename); // assert that the content and version fit together String restoredContent = getContentString(cms, file.getContents()); assertEquals(contentStr, restoredContent); } } finally { cms.getRequestContext().restoreSiteRoot(); } } | 51784 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51784/572462ada63960ef434e13598d27e4784aa20d6d/TestBackup.java/buggy/test/org/opencms/file/TestBackup.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
1684,
1876,
2613,
3805,
1435,
1216,
4206,
288,
7734,
14371,
6166,
273,
28287,
5621,
3639,
514,
1544,
273,
2206,
21050,
21,
18,
5830,
14432,
3639,
2149,
4109,
13493,
4109,
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,
918,
1842,
1684,
1876,
2613,
3805,
1435,
1216,
4206,
288,
7734,
14371,
6166,
273,
28287,
5621,
3639,
514,
1544,
273,
2206,
21050,
21,
18,
5830,
14432,
3639,
2149,
4109,
13493,
4109,
2... | ||
invalidateLine(bracketLine); | invalidateLineRange(bracketLine,caretLine); else invalidateLine(caretLine); | public void focusGained(FocusEvent evt) { invalidateLine(caretLine); if(bracketLine != -1) invalidateLine(bracketLine); // repaint the gutter so that the border color // reflects the focus state view.updateGutterBorders(); } //}}} | 8690 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8690/16fbd6a2398f65435904d2bd0e80999fad2a4797/JEditTextArea.java/buggy/org/gjt/sp/jedit/textarea/JEditTextArea.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3196,
202,
482,
918,
7155,
43,
8707,
12,
9233,
1133,
6324,
13,
202,
202,
95,
1082,
202,
5387,
340,
1670,
12,
71,
20731,
1670,
1769,
1082,
202,
430,
12,
21025,
1670,
480,
300,
21,
13,
9506,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3196,
202,
482,
918,
7155,
43,
8707,
12,
9233,
1133,
6324,
13,
202,
202,
95,
1082,
202,
5387,
340,
1670,
12,
71,
20731,
1670,
1769,
1082,
202,
430,
12,
21025,
1670,
480,
300,
21,
13,
9506,
... |
public boolean inTransaction() { return mc.getGDSHelper().inTransaction(); | public boolean inTransaction() throws SQLException { try { return getGDSHelper().inTransaction(); } catch(GDSException ex) { throw new FBSQLException(ex); } | public boolean inTransaction() { return mc.getGDSHelper().inTransaction(); } | 6960 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6960/5d46258a2a3c3cd051056285672e933dc21aa885/AbstractConnection.java/buggy/src/main/org/firebirdsql/jdbc/AbstractConnection.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1250,
316,
3342,
1435,
288,
3639,
327,
6108,
18,
588,
43,
3948,
2276,
7675,
267,
3342,
5621,
565,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1250,
316,
3342,
1435,
288,
3639,
327,
6108,
18,
588,
43,
3948,
2276,
7675,
267,
3342,
5621,
565,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
data.heightHint = SIZING_LISTS_HEIGHT; | boolean needsHint = DialogUtil.inRegularFontMode(parent); if (needsHint) { data.heightHint = SIZING_LISTS_HEIGHT; } | protected Control createControl(Composite parent) { Font wizardFont = parent.getFont(); // top level group Composite outerContainer = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 2; outerContainer.setLayout(layout); outerContainer.setFont(wizardFont); outerContainer.setLayoutData( new GridData( GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL)); // category tree pane...create SWT tree directly to // get single selection mode instead of multi selection. Tree tree = new Tree( outerContainer, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); categoryTreeViewer = new TreeViewer(tree); GridData data = new GridData(GridData.FILL_BOTH); data.widthHint = SIZING_LISTS_WIDTH; data.heightHint = SIZING_LISTS_HEIGHT; categoryTreeViewer.getTree().setLayoutData(data); categoryTreeViewer.setContentProvider(new WorkbenchContentProvider()); categoryTreeViewer.setLabelProvider(new WorkbenchLabelProvider()); categoryTreeViewer.setSorter(NewWizardCollectionSorter.INSTANCE); categoryTreeViewer.addSelectionChangedListener(this); if (wizardCategories.getParent(wizardCategories) == null) categoryTreeViewer.setInput(wizardCategories); else categoryTreeViewer.setInput(new RootElementProxy(wizardCategories)); tree.setFont(wizardFont); // wizard actions pane...create SWT table directly to // get single selection mode instead of multi selection. Table table = new Table( outerContainer, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); wizardSelectionViewer = new TableViewer(table); data = new GridData(GridData.FILL_BOTH); data.widthHint = SIZING_LISTS_WIDTH; data.heightHint = SIZING_LISTS_HEIGHT; wizardSelectionViewer.getTable().setLayoutData(data); wizardSelectionViewer.setContentProvider(getWizardProvider()); wizardSelectionViewer.setLabelProvider(new WorkbenchLabelProvider()); wizardSelectionViewer.addSelectionChangedListener(this); wizardSelectionViewer.addDoubleClickListener(this); table.setFont(wizardFont); restoreWidgetValues(); if (!categoryTreeViewer.getSelection().isEmpty()) // we only set focus if a selection was restored categoryTreeViewer.getTree().setFocus(); return outerContainer; } | 58148 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58148/9b6cd65894eb061e37985ec5dff90c12cca3acbf/NewWizardNewPage.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardNewPage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
8888,
752,
3367,
12,
9400,
982,
13,
288,
202,
202,
5711,
24204,
5711,
273,
982,
18,
588,
5711,
5621,
202,
202,
759,
1760,
1801,
1041,
202,
202,
9400,
6390,
2170,
273,
394,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
8888,
752,
3367,
12,
9400,
982,
13,
288,
202,
202,
5711,
24204,
5711,
273,
982,
18,
588,
5711,
5621,
202,
202,
759,
1760,
1801,
1041,
202,
202,
9400,
6390,
2170,
273,
394,
14... |
asm.emitCALL_RegIdx(JTOC, S0, asm.BYTE, 0); | asm.emitCALL_RegIdx(JTOC, S0, asm.BYTE, NO_SLOT); | protected final void emit_unresolved_invokestatic(VM_MethodReference methodRef) { emitDynamicLinkingSequence(S0, methodRef, true); genParameterRegisterLoad(methodRef, false); asm.emitCALL_RegIdx(JTOC, S0, asm.BYTE, 0); genResultRegisterUnload(methodRef); } | 5245 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5245/c19269673fcdd14e39a92c30e8ccef4cb7ce0402/VM_Compiler.java/clean/rvm/src/vm/arch/intel/compilers/baseline/VM_Compiler.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
727,
918,
3626,
67,
318,
11792,
67,
5768,
601,
395,
2126,
12,
7397,
67,
1305,
2404,
707,
1957,
13,
288,
565,
3626,
9791,
2098,
310,
4021,
12,
55,
20,
16,
707,
1957,
16,
638,
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,
282,
4750,
727,
918,
3626,
67,
318,
11792,
67,
5768,
601,
395,
2126,
12,
7397,
67,
1305,
2404,
707,
1957,
13,
288,
565,
3626,
9791,
2098,
310,
4021,
12,
55,
20,
16,
707,
1957,
16,
638,
176... |
fEditButton.setText(TemplateMessages.getString("TemplatePreferencePage.edit")); | protected Control createContents(Composite ancestor) { Composite parent= new Composite(ancestor, SWT.NONE); GridLayout layout= new GridLayout(); layout.numColumns= 2; layout.marginHeight= 0; layout.marginWidth= 0; parent.setLayout(layout); Table table= new Table(parent, SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION); GridData data= new GridData(GridData.FILL_BOTH); data.widthHint= convertWidthInCharsToPixels(80); data.heightHint= convertHeightInCharsToPixels(10); table.setLayoutData(data); table.setHeaderVisible(true); table.setLinesVisible(true); TableLayout tableLayout= new TableLayout(); table.setLayout(tableLayout); TableColumn column1= new TableColumn(table, SWT.NONE); column1.setText(TemplateMessages.getString("TemplatePreferencePage.column.name")); //$NON-NLS-1$ TableColumn column2= new TableColumn(table, SWT.NONE); column2.setText(TemplateMessages.getString("TemplatePreferencePage.column.context")); //$NON-NLS-1$ TableColumn column3= new TableColumn(table, SWT.NONE); column3.setText(TemplateMessages.getString("TemplatePreferencePage.column.description")); //$NON-NLS-1$ tableLayout.addColumnData(new ColumnWeightData(30)); tableLayout.addColumnData(new ColumnWeightData(20)); tableLayout.addColumnData(new ColumnWeightData(70)); fTableViewer= new CheckboxTableViewer(table); fTableViewer.setLabelProvider(new TemplateLabelProvider()); fTableViewer.setContentProvider(new TemplateContentProvider()); fTableViewer.setSorter(new ViewerSorter() { public int compare(Viewer viewer, Object object1, Object object2) { if ((object1 instanceof Template) && (object2 instanceof Template)) { Template left= (Template) object1; Template right= (Template) object2; int result= left.getName().compareToIgnoreCase(right.getName()); if (result != 0) return result; return left.getDescription().compareToIgnoreCase(right.getDescription()); } return super.compare(viewer, object1, object2); } public boolean isSorterProperty(Object element, String property) { return true; } }); fTableViewer.addDoubleClickListener(new IDoubleClickListener() { public void doubleClick(DoubleClickEvent e) { edit(); } }); fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent e) { selectionChanged1(); } }); fTableViewer.addCheckStateListener(new ICheckStateListener() { public void checkStateChanged(CheckStateChangedEvent event) { Template template= (Template) event.getElement(); template.setEnabled(event.getChecked()); } }); Composite buttons= new Composite(parent, SWT.NULL); buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); layout= new GridLayout(); layout.marginHeight= 0; layout.marginWidth= 0; buttons.setLayout(layout); fAddButton= new Button(buttons, SWT.PUSH); fAddButton.setLayoutData(getButtonGridData(fAddButton)); fAddButton.setText(TemplateMessages.getString("TemplatePreferencePage.new")); //$NON-NLS-1$ fAddButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { add(); } }); fEditButton= new Button(buttons, SWT.PUSH); fEditButton.setLayoutData(getButtonGridData(fEditButton)); fEditButton.setText(TemplateMessages.getString("TemplatePreferencePage.edit")); //$NON-NLS-1$ fEditButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { edit(); } }); fRemoveButton= new Button(buttons, SWT.PUSH); fRemoveButton.setLayoutData(getButtonGridData(fRemoveButton)); fRemoveButton.setText(TemplateMessages.getString("TemplatePreferencePage.remove")); //$NON-NLS-1$ fRemoveButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { remove(); } }); createSpacer(buttons); fImportButton= new Button(buttons, SWT.PUSH); fImportButton.setLayoutData(getButtonGridData(fImportButton)); fImportButton.setText(TemplateMessages.getString("TemplatePreferencePage.import")); //$NON-NLS-1$ fImportButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { import_(); } }); fExportButton= new Button(buttons, SWT.PUSH); fExportButton.setLayoutData(getButtonGridData(fExportButton)); fExportButton.setText(TemplateMessages.getString("TemplatePreferencePage.export")); //$NON-NLS-1$ fExportButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { export(); } }); fExportAllButton= new Button(buttons, SWT.PUSH); fExportAllButton.setLayoutData(getButtonGridData(fExportAllButton)); fExportAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.export.all")); //$NON-NLS-1$ fExportAllButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { exportAll(); } }); createSpacer(buttons); fEnableAllButton= new Button(buttons, SWT.PUSH); fEnableAllButton.setLayoutData(getButtonGridData(fEnableAllButton)); fEnableAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.enable.all")); //$NON-NLS-1$ fEnableAllButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { enableAll(true); } }); fDisableAllButton= new Button(buttons, SWT.PUSH); fDisableAllButton.setLayoutData(getButtonGridData(fDisableAllButton)); fDisableAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.disable.all")); //$NON-NLS-1$ fDisableAllButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { enableAll(false); } }); fPatternViewer= createViewer(parent); createSpacer(parent); //fFormatButton= new Button(parent, SWT.CHECK); //fFormatButton.setText(TemplateMessages.getString("TemplatePreferencePage.use.code.formatter")); //$NON-NLS-1$ fTableViewer.setInput(fTemplates); fTableViewer.setAllChecked(false); fTableViewer.setCheckedElements(getEnabledTemplates()); //IPreferenceStore prefs= CUIPlugin.getDefault().getPreferenceStore(); //fFormatButton.setSelection(prefs.getBoolean(PREF_FORMAT_TEMPLATES)); updateButtons(); WorkbenchHelp.setHelp(parent, ICHelpContextIds.TEMPLATE_PREFERENCE_PAGE); return parent; } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/61da74a2d0638408150239361ae346d3bda966ee/TemplatePreferencePage.java/buggy/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TemplatePreferencePage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
8888,
752,
6323,
12,
9400,
9731,
13,
288,
1082,
202,
9400,
982,
33,
394,
14728,
12,
28798,
16,
348,
8588,
18,
9826,
1769,
202,
202,
6313,
3744,
3511,
33,
394,
7145,
3744,
562... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
8888,
752,
6323,
12,
9400,
9731,
13,
288,
1082,
202,
9400,
982,
33,
394,
14728,
12,
28798,
16,
348,
8588,
18,
9826,
1769,
202,
202,
6313,
3744,
3511,
33,
394,
7145,
3744,
562... | |
private static String getAgentString() { String agentName = NutchConf.get().get("http.agent.name"); String agentVersion = NutchConf.get().get("http.agent.version"); String agentDesc = NutchConf.get().get("http.agent.description"); String agentURL = NutchConf.get().get("http.agent.url"); String agentEmail = NutchConf.get().get("http.agent.email"); | private static String getAgentString(String agentName, String agentVersion, String agentDesc, String agentURL, String agentEmail) { | private static String getAgentString() { String agentName = NutchConf.get().get("http.agent.name"); String agentVersion = NutchConf.get().get("http.agent.version"); String agentDesc = NutchConf.get().get("http.agent.description"); String agentURL = NutchConf.get().get("http.agent.url"); String agentEmail = NutchConf.get().get("http.agent.email"); if ( (agentName == null) || (agentName.trim().length() == 0) ) LOGGER.severe("No User-Agent string set (http.agent.name)!"); StringBuffer buf= new StringBuffer(); buf.append(agentName); if (agentVersion != null) { buf.append("/"); buf.append(agentVersion); } if ( ((agentDesc != null) && (agentDesc.length() != 0)) || ((agentEmail != null) && (agentEmail.length() != 0)) || ((agentURL != null) && (agentURL.length() != 0)) ) { buf.append(" ("); if ((agentDesc != null) && (agentDesc.length() != 0)) { buf.append(agentDesc); if ( (agentURL != null) || (agentEmail != null) ) buf.append("; "); } if ((agentURL != null) && (agentURL.length() != 0)) { buf.append(agentURL); if (agentEmail != null) buf.append("; "); } if ((agentEmail != null) && (agentEmail.length() != 0)) buf.append(agentEmail); buf.append(")"); } return buf.toString(); } | 46828 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46828/329ff64e9d7295aff108f85e9a8103f5e5f8f398/HttpBase.java/buggy/src/plugin/lib-http/src/java/org/apache/nutch/protocol/http/api/HttpBase.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
760,
514,
336,
3630,
780,
1435,
288,
3639,
514,
4040,
461,
273,
423,
322,
343,
3976,
18,
588,
7675,
588,
2932,
2505,
18,
5629,
18,
529,
8863,
565,
514,
4040,
1444,
273,
423,
322,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
760,
514,
336,
3630,
780,
1435,
288,
3639,
514,
4040,
461,
273,
423,
322,
343,
3976,
18,
588,
7675,
588,
2932,
2505,
18,
5629,
18,
529,
8863,
565,
514,
4040,
1444,
273,
423,
322,
... |
setWebsiteSpecificSearch(checkForWebsite(request)); RollerRequest rreq = RollerRequest.getRollerRequest(request); SearchOperation search = new SearchOperation(RollerFactory.getRoller().getIndexManager()); search.setTerm(request.getParameter("q")); setTerm(request.getParameter("q")); | WebsiteData website = null; if (isWebsiteSpecificSearch()) { website = rreq.getWebsite(); search.setWebsiteHandle(rreq.getWebsite().getHandle()); } | public SearchResultsPageModel( String titleKey, HttpServletRequest request, HttpServletResponse response, ActionMapping mapping) throws RollerException, IOException { super(titleKey, request, response, mapping); setWebsiteSpecificSearch(checkForWebsite(request)); RollerRequest rreq = RollerRequest.getRollerRequest(request); SearchOperation search = new SearchOperation(RollerFactory.getRoller().getIndexManager()); search.setTerm(request.getParameter("q")); setTerm(request.getParameter("q")); WebsiteData website = null; if (isWebsiteSpecificSearch()) { website = rreq.getWebsite(); search.setWebsiteHandle(rreq.getWebsite().getHandle()); } if (StringUtils.isNotEmpty(request.getParameter("c"))) { search.setCategory(request.getParameter("c")); } // execute search executeSearch(RollerFactory.getRoller(), search); if (search.getResultsCount() == -1) { // this means there has been a parsing (or IO) error setErrorMessage(bundle.getString("error.searchProblem")); } else { // Convert the Hits into WeblogEntryData instances. Hits hits = search.getResults(); setResults(convertHitsToEntries(rreq, website, hits)); setOffset((Integer)request.getAttribute("offset")); setLimit((Integer)request.getAttribute("limit")); if (request.getAttribute("categories") != null) { Set cats = (Set)request.getAttribute("categories"); if (cats.size() > 0) { setCategories(cats); } } } setHits(new Integer(search.getResultsCount())); } | 46431 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46431/08116640cb09294f60a51d400e8e1f652f554065/SearchResultsPageModel.java/buggy/src/org/roller/presentation/search/SearchResultsPageModel.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
5167,
3447,
1964,
1488,
12,
3639,
514,
2077,
653,
16,
3639,
9984,
590,
16,
3639,
12446,
766,
16,
3639,
4382,
3233,
2874,
13,
1216,
11714,
749,
503,
16,
1860,
288,
7734,
2240,
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,
377,
1071,
5167,
3447,
1964,
1488,
12,
3639,
514,
2077,
653,
16,
3639,
9984,
590,
16,
3639,
12446,
766,
16,
3639,
4382,
3233,
2874,
13,
1216,
11714,
749,
503,
16,
1860,
288,
7734,
2240,
12,
... |
lexState = LexState.EXPR_END; StringBuffer number = new StringBuffer(); if (c == '-') { number.append(c); c = support.read(); } else if (c == '+') { c = support.read(); } char nondigit = '\0'; if (c == '0') { int startLen = number.length(); switch ((c = support.read())) { case 'x' : case 'X' : c = support.read(); if (isHexDigit(c)) { for (;; c = support.read()){ if (c == '_') { if (nondigit != '\0') { break; } else { nondigit = c; } } else if (isHexDigit(c)) { nondigit = '\0'; number.append(c); } else { break; } } } support.unread(); if (number.length() == startLen) { errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("number_without_hex_digits")); } else if (nondigit != '\0') { errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("trailing_uc")); } yaccValue = getInteger(number.toString(), 16); return Token.tINTEGER; case 'b' : case 'B' : c = support.read(); if (c == '0' || c == '1') { for (;; c = support.read()){ if (c == '_') { if (nondigit != '\0') { break; } else { nondigit = c; } } else if (c == '0' || c == '1') { nondigit = '\0'; number.append(c); } else { break; } } } support.unread(); if (number.length() == startLen) { errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("number_without_bin_digits")); } else if (nondigit != '\0') { errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("trailing_uc")); } yaccValue = getInteger(number.toString(), 2); return Token.tINTEGER; case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '_' : for (;; c = support.read()){ if (c == '_') { if (nondigit != '\0') { break; } else { nondigit = c; } } else if (c >= '0' && c <= '7') { nondigit = '\0'; number.append(c); } else { break; } } if (number.length() > startLen) { support.unread(); if (nondigit != '\0') { errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("trailing_uc")); } yaccValue = getInteger(number.toString(), 8); return Token.tINTEGER; } case '8' : case '9' : errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("illegal_octal_digit")); break; case '.' : case 'e' : case 'E' : number.append('0'); break; default : support.unread(); yaccValue = new Long(0); return Token.tINTEGER; } } boolean seen_point = false; boolean seen_e = false; for (;; c = support.read()) { switch (c) { case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : nondigit = '\0'; number.append(c); break; case '.' : if (nondigit != '\0') { support.unread(); errorHandler.handleError(IErrors.SYNTAX_ERROR, support.getPosition(), Messages.getString("trailing_uc")); } else if (seen_point || seen_e) { support.unread(); return getNumberToken(number.toString(), true, nondigit); } else { if (!Character.isDigit(c = support.read())) { support.unread(2); if (support.getLastRead() == '_') { } else { yaccValue = getInteger(number.toString(), 10); return Token.tINTEGER; } } else { number.append('.'); number.append(c); seen_point = true; nondigit = '\0'; } } break; case 'e' : case 'E' : if (nondigit != '\0') { support.unread(); errorHandler.handleError(IErrors.SYNTAX_ERROR, support.getPosition(), Messages.getString("trailing_uc")); return 0; } else if (seen_e) { support.unread(); return getNumberToken(number.toString(), true, nondigit); } else { number.append(c); seen_e = true; nondigit = c; c = support.read(); if (c == '-' || c == '+') { number.append(c); nondigit = c; } else { support.unread(); } } break; case '_' : if (nondigit != '\0') { errorHandler.handleError(IErrors.SYNTAX_ERROR, support.getPosition(), Messages.getString("trailing_uc")); return 0; } nondigit = c; break; default : support.unread(); return getNumberToken(number.toString(), seen_e || seen_point, nondigit); } } } | lexState = LexState.EXPR_END; StringBuffer number = new StringBuffer(); if (c == '-') { number.append(c); c = support.read(); } else if (c == '+') { c = support.read(); } char nondigit = '\0'; if (c == '0') { int startLen = number.length(); switch ((c = support.read())) { case 'x' : case 'X' : c = support.read(); if (isHexDigit(c)) { for (;; c = support.read()) { if (c == '_') { if (nondigit != '\0') { break; } else { nondigit = c; } } else if (isHexDigit(c)) { nondigit = '\0'; number.append(c); } else { break; } } } support.unread(); if (number.length() == startLen) { errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("number_without_hex_digits")); } else if (nondigit != '\0') { errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("trailing_uc")); } yaccValue = getInteger(number.toString(), 16); return Token.tINTEGER; case 'b' : case 'B' : c = support.read(); if (c == '0' || c == '1') { for (;; c = support.read()) { if (c == '_') { if (nondigit != '\0') { break; } else { nondigit = c; } } else if (c == '0' || c == '1') { nondigit = '\0'; number.append(c); } else { break; } } } support.unread(); if (number.length() == startLen) { errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("number_without_bin_digits")); } else if (nondigit != '\0') { errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("trailing_uc")); } yaccValue = getInteger(number.toString(), 2); return Token.tINTEGER; case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '_' : for (;; c = support.read()) { if (c == '_') { if (nondigit != '\0') { break; } else { nondigit = c; } } else if (c >= '0' && c <= '7') { nondigit = '\0'; number.append(c); } else { break; } } if (number.length() > startLen) { support.unread(); if (nondigit != '\0') { errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("trailing_uc")); } yaccValue = getInteger(number.toString(), 8); return Token.tINTEGER; } case '8' : case '9' : errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("illegal_octal_digit")); break; case '.' : case 'e' : case 'E' : number.append('0'); break; default : support.unread(); yaccValue = new Long(0); return Token.tINTEGER; } } boolean seen_point = false; boolean seen_e = false; for (;; c = support.read()) { switch (c) { case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : nondigit = '\0'; number.append(c); break; case '.' : if (nondigit != '\0') { support.unread(); errorHandler.handleError(IErrors.SYNTAX_ERROR, support.getPosition(), Messages.getString("trailing_uc")); } else if (seen_point || seen_e) { support.unread(); return getNumberToken(number.toString(), true, nondigit); } else { if (!Character.isDigit(c = support.read())) { support.unread(2); if (support.getLastRead() == '_') { } else { yaccValue = getInteger(number.toString(), 10); return Token.tINTEGER; } } else { number.append('.'); number.append(c); seen_point = true; nondigit = '\0'; } } break; case 'e' : case 'E' : if (nondigit != '\0') { support.unread(); errorHandler.handleError(IErrors.SYNTAX_ERROR, support.getPosition(), Messages.getString("trailing_uc")); return 0; } else if (seen_e) { support.unread(); return getNumberToken(number.toString(), true, nondigit); } else { number.append(c); seen_e = true; nondigit = c; c = support.read(); if (c == '-' || c == '+') { number.append(c); nondigit = c; } else { support.unread(); } } break; case '_' : if (nondigit != '\0') { errorHandler.handleError(IErrors.SYNTAX_ERROR, support.getPosition(), Messages.getString("trailing_uc")); return 0; } nondigit = c; break; default : support.unread(); return getNumberToken(number.toString(), seen_e || seen_point, nondigit); } } } | private int parseNumber(char c) { lexState = LexState.EXPR_END; StringBuffer number = new StringBuffer(); if (c == '-') { number.append(c); c = support.read(); } else if (c == '+') { c = support.read(); } char nondigit = '\0'; if (c == '0') { int startLen = number.length(); switch ((c = support.read())) { case 'x' : case 'X' : // hexadecimal c = support.read(); if (isHexDigit(c)) { for (;; c = support.read()){ if (c == '_') { if (nondigit != '\0') { break; } else { nondigit = c; } } else if (isHexDigit(c)) { nondigit = '\0'; number.append(c); } else { break; } } } support.unread(); if (number.length() == startLen) { errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("number_without_hex_digits")); //$NON-NLS-1$ } else if (nondigit != '\0') { errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("trailing_uc")); //$NON-NLS-1$ // return decode_num(c, is_float, seen_uc, true); } yaccValue = getInteger(number.toString(), 16); return Token.tINTEGER; case 'b' : case 'B' : // binary c = support.read(); if (c == '0' || c == '1') { for (;; c = support.read()){ if (c == '_') { if (nondigit != '\0') { break; } else { nondigit = c; } } else if (c == '0' || c == '1') { nondigit = '\0'; number.append(c); } else { break; } } } support.unread(); if (number.length() == startLen) { errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("number_without_bin_digits")); //$NON-NLS-1$ } else if (nondigit != '\0') { errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("trailing_uc")); //$NON-NLS-1$ // return decode_num(c, is_float, seen_uc, true); } yaccValue = getInteger(number.toString(), 2); return Token.tINTEGER; case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '_' : // octal for (;; c = support.read()){ if (c == '_') { if (nondigit != '\0') { break; } else { nondigit = c; } } else if (c >= '0' && c <= '7') { nondigit = '\0'; number.append(c); } else { break; } } if (number.length() > startLen) { support.unread(); if (nondigit != '\0') { errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("trailing_uc")); //$NON-NLS-1$ } yaccValue = getInteger(number.toString(), 8); return Token.tINTEGER; } case '8' : case '9' : errorHandler.handleError(IErrors.SYNTAX_ERROR, Messages.getString("illegal_octal_digit")); //$NON-NLS-1$ break; case '.' : case 'e' : case 'E' : number.append('0'); break; default : support.unread(); yaccValue = new Long(0); return Token.tINTEGER; } } boolean seen_point = false; boolean seen_e = false; for (;; c = support.read()) { switch (c) { case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : nondigit = '\0'; number.append(c); break; case '.' : if (nondigit != '\0') { support.unread(); errorHandler.handleError(IErrors.SYNTAX_ERROR, support.getPosition(), Messages.getString("trailing_uc")); //$NON-NLS-1$ } else if (seen_point || seen_e) { support.unread(); return getNumberToken(number.toString(), true, nondigit); } else { if (!Character.isDigit(c = support.read())) { support.unread(2); if (support.getLastRead() == '_') { } else { yaccValue = getInteger(number.toString(), 10); return Token.tINTEGER; } } else { number.append('.'); number.append(c); seen_point = true; nondigit = '\0'; } } break; case 'e' : case 'E' : if (nondigit != '\0') { support.unread(); errorHandler.handleError(IErrors.SYNTAX_ERROR, support.getPosition(), Messages.getString("trailing_uc")); //$NON-NLS-1$ return 0; } else if (seen_e) { support.unread(); return getNumberToken(number.toString(), true, nondigit); } else { number.append(c); seen_e = true; nondigit = c; c = support.read(); if (c == '-' || c == '+') { number.append(c); nondigit = c; } else { support.unread(); } } break; case '_' : // '_' in number just ignored if (nondigit != '\0') { errorHandler.handleError(IErrors.SYNTAX_ERROR, support.getPosition(), Messages.getString("trailing_uc")); //$NON-NLS-1$ return 0; } nondigit = c; break; default : support.unread(); return getNumberToken(number.toString(), seen_e || seen_point, nondigit); } } } | 47134 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47134/af104711597d4d5b2089320e2517b95b8df14492/RubyYaccLexer.java/clean/org/jruby/lexer/yacc/RubyYaccLexer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3196,
202,
1152,
509,
1109,
1854,
12,
3001,
276,
13,
288,
1082,
202,
4149,
1119,
273,
15123,
1119,
18,
2294,
8025,
67,
4415,
31,
1082,
202,
780,
1892,
1300,
273,
394,
6674,
5621,
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,
3196,
202,
1152,
509,
1109,
1854,
12,
3001,
276,
13,
288,
1082,
202,
4149,
1119,
273,
15123,
1119,
18,
2294,
8025,
67,
4415,
31,
1082,
202,
780,
1892,
1300,
273,
394,
6674,
5621,
1082,
202,
... |
ctx.logManager().getLog(Packet.class).error("Signature failed on " + toString(), new Exception("moo")); | Log l = ctx.logManager().getLog(Packet.class); l.error("Signature failed on " + toString(), new Exception("moo")); if (false) { l.error(Base64.encode(buffer, 0, size)); l.error("Signature: " + Base64.encode(_optionSignature.getData())); } | public boolean verifySignature(I2PAppContext ctx, Destination from, byte buffer[]) { if (!isFlagSet(FLAG_SIGNATURE_INCLUDED)) return false; if (_optionSignature == null) return false; int size = writtenSize(); if (buffer == null) buffer = new byte[size]; int written = writePacket(buffer, 0, false); if (written != size) { ctx.logManager().getLog(Packet.class).error("Written " + written + " size " + size + " for " + toString(), new Exception("moo")); return false; } boolean ok = ctx.dsa().verifySignature(_optionSignature, buffer, 0, size, from.getSigningPublicKey()); if (!ok) { ctx.logManager().getLog(Packet.class).error("Signature failed on " + toString(), new Exception("moo")); } return ok; } | 45677 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45677/900420719ee2a88d69d78ef9add09f2cb910daf4/Packet.java/buggy/apps/streaming/java/src/net/i2p/client/streaming/Packet.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1250,
3929,
5374,
12,
45,
22,
52,
3371,
1042,
1103,
16,
10691,
628,
16,
1160,
1613,
63,
5717,
288,
3639,
309,
16051,
291,
4678,
694,
12,
9651,
67,
26587,
67,
706,
11686,
7660,
371... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3929,
5374,
12,
45,
22,
52,
3371,
1042,
1103,
16,
10691,
628,
16,
1160,
1613,
63,
5717,
288,
3639,
309,
16051,
291,
4678,
694,
12,
9651,
67,
26587,
67,
706,
11686,
7660,
371... |
this.nutchConf.setObject(parserId, p); | this.conf.setObject(parserId, p); | public Parser getParserById(String parserId) throws ParserNotFound { // first check the cache if (this.nutchConf.getObject(parserId) != null) { return (Parser) this.nutchConf.getObject(parserId); } else { // get the list of registered parsing extensions // then find the right one by Id Extension[] extensions = this.extensionPoint.getExtensions(); Extension parserExt = getExtensionById(extensions, parserId); if (parserExt == null) { throw new ParserNotFound("No Parser Found for parserId: " + parserId + "!"); } else { // instantiate the Parser try { Parser p = null; p = (Parser) parserExt.getExtensionInstance(); this.nutchConf.setObject(parserId, p); return p; } catch (PluginRuntimeException e) { LOG.warning("ParserFactory:PluginRuntimeException when " + "initializing parser plugin " + parserExt.getDescriptor().getPluginId() + " instance in getParserById"); throw new ParserNotFound("No Parser Found for parserId: " + parserId + "!"); } } } } | 1316 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1316/25437bc825d50715dcc9a289a1b4c8fbbc6aced1/ParserFactory.java/buggy/src/java/org/apache/nutch/parse/ParserFactory.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
6783,
20804,
5132,
12,
780,
2082,
548,
13,
1216,
6783,
2768,
288,
565,
368,
1122,
866,
326,
1247,
565,
309,
261,
2211,
18,
82,
322,
343,
3976,
18,
588,
921,
12,
4288,
548,
13,
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,
282,
1071,
6783,
20804,
5132,
12,
780,
2082,
548,
13,
1216,
6783,
2768,
288,
565,
368,
1122,
866,
326,
1247,
565,
309,
261,
2211,
18,
82,
322,
343,
3976,
18,
588,
921,
12,
4288,
548,
13,
4... |
if (isFrozen()) { clone.setFrozen(true); } | clone.setFrozen(isFrozen()); | public IRubyObject rbClone() { IRubyObject clone = getMetaClass().getRealClass().allocate(); clone.setMetaClass(getMetaClass().getSingletonClassClone()); clone.setFrozen(false); clone.initCopy(this); if (isFrozen()) { clone.setFrozen(true); } return clone; } | 45298 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45298/49aa6e52e2393f8c17a3c126aed59b8fd08b68aa/RubyObject.java/buggy/src/org/jruby/RubyObject.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
15908,
10340,
921,
7138,
10930,
1435,
288,
3639,
15908,
10340,
921,
3236,
273,
11312,
797,
7675,
588,
6955,
797,
7675,
16247,
5621,
3639,
3236,
18,
542,
2781,
797,
12,
588,
2781,
797,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7138,
10930,
1435,
288,
3639,
15908,
10340,
921,
3236,
273,
11312,
797,
7675,
588,
6955,
797,
7675,
16247,
5621,
3639,
3236,
18,
542,
2781,
797,
12,
588,
2781,
797,... |
public static void main(String[] args) throws SQLException, ClassNotFoundException { String[] URLs = databases; // allow to run offline tests... if (args.length == 1 && args[0].equalsIgnoreCase("offline")) { System.out.println("Performing only offline tests"); URLs = new String[0]; } else if (args.length!=0) { System.err.println("usage: java [offline]"); System.exit(1); } Connection[] conns; conns = new Connection[URLs.length]; for (int i = 0; i < URLs.length; i++) { System.out.println("Creating JDBC connection to " + URLs[i]); conns[i] = connect(URLs[i]); } System.out.println("Performing tests..."); System.out.println("***"); for (int i = 0; i < testset.length; i++) { test(testset[i], conns); test(testsridset[i], conns); } System.out.print("cleaning up..."); for (int i = 0; i < conns.length; i++) { conns[i].close(); } System.out.println("Finished."); } | 4075 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4075/72a7da4b99c0ff8ba9960636cb67049b1b1c4695/TestParser.java/buggy/jdbc2/src/examples/TestParser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
3845,
6459,
5254,
12,
780,
8526,
1968,
13,
15069,
23116,
16,
797,
3990,
95,
780,
8526,
15749,
33,
3404,
19684,
31,
759,
5965,
13039,
318,
792,
2242,
23864,
25563,
2777,
430,
12,
1968,
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,
1071,
3845,
6459,
5254,
12,
780,
8526,
1968,
13,
15069,
23116,
16,
797,
3990,
95,
780,
8526,
15749,
33,
3404,
19684,
31,
759,
5965,
13039,
318,
792,
2242,
23864,
25563,
2777,
430,
12,
1968,
18... | ||
if (++updateCounter >= getUpdateMessagesCount()) { fireMessageLoadedEvent(MessageLoadedEvent.MESSAGES_LOADED, getLoadedMessageCount(), messages.size()); updateCounter = 0; } loadedMessageCount++; } | public void loadWaitingMessages() { Vector messages = retrieveLoadQueue(); int numMessages = messages.size(); MessageProxy mp; int updateCounter = 0; if (numMessages > 0) { MessageLoadedListener display = getFolderInfo().getFolderDisplayUI(); if (display != null) this.addMessageLoadedListener(display); fireMessageLoadedEvent(MessageLoadedEvent.LOADING_STARTING, getLoadedMessageCount(), messages.size()); int fetchBatchSize = 50; try { fetchBatchSize = Integer.parseInt(Pooka.getProperty("Pooka.fetchBatchSize", "50")); } catch (NumberFormatException nfe) { } FetchProfile fetchProfile = getFolderInfo().getFetchProfile(); for(int i=numMessages-1; i >= 0; i--) { synchronized(folderInfo.getFolderThread().getRunLock()) { mp=(MessageProxy)messages.elementAt(i); if (! mp.getMessageInfo().hasBeenFetched()) { try { int fetchCount = 0; Vector fetchVector = new Vector(); for (int j = i; fetchCount < fetchBatchSize && j >= 0; j--) { MessageInfo fetchInfo = ((MessageProxy) messages.elementAt(j)).getMessageInfo(); if (! fetchInfo.hasBeenFetched()) { fetchVector.add(fetchInfo); fetchInfo.setFetched(true); } } MessageInfo[] toFetch = new MessageInfo[fetchVector.size()]; toFetch = (MessageInfo[]) fetchVector.toArray(toFetch); getFolderInfo().fetch(toFetch, fetchProfile); } catch(MessagingException me) { System.out.println("caught error while fetching for folder " + getFolderInfo().getFolderID() + ": " + me); me.printStackTrace(); } } try { if (! mp.isLoaded()) mp.loadTableInfo(); if (mp.needsRefresh()) mp.refreshMessage(); else if (! mp.matchedFilters()) { mp.matchFilters(); } } catch (Exception e) { e.printStackTrace(); } } if (++updateCounter >= getUpdateMessagesCount()) { fireMessageLoadedEvent(MessageLoadedEvent.MESSAGES_LOADED, getLoadedMessageCount(), messages.size()); updateCounter = 0; } loadedMessageCount++; } if (updateCounter > 0) fireMessageLoadedEvent(MessageLoadedEvent.MESSAGES_LOADED, getLoadedMessageCount(), messages.size()); fireMessageLoadedEvent(MessageLoadedEvent.LOADING_COMPLETE, getLoadedMessageCount(), messages.size()); if (display != null) removeMessageLoadedListener(display); } } | 967 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/967/df401949e48839e35c1856b44a238b14d606b9a2/LoadMessageThread.java/buggy/net/suberic/pooka/thread/LoadMessageThread.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
1262,
15946,
5058,
1435,
288,
3639,
5589,
2743,
273,
4614,
2563,
3183,
5621,
565,
509,
818,
5058,
273,
2743,
18,
1467,
5621,
565,
2350,
3886,
6749,
31,
3639,
509,
1089,
4789,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
1262,
15946,
5058,
1435,
288,
3639,
5589,
2743,
273,
4614,
2563,
3183,
5621,
565,
509,
818,
5058,
273,
2743,
18,
1467,
5621,
565,
2350,
3886,
6749,
31,
3639,
509,
1089,
4789,
2... | |
results = compare(retEnv, tempPath); assertTrue(results); | compareXML(retEnv, tempPath); | public void testR2GCEchoIntergerArray() throws AxisFault { url = "http://easysoap.sourceforge.net/cgi-bin/interopserver"; soapAction = "http://soapinterop.org/"; util = new GroupcIntegerArrayUtil(); retEnv = SunRound2Client.sendMsg(util, url, soapAction); tempPath = resFilePath + "ESGroupcIntegerArrayRes.xml"; results = compare(retEnv, tempPath); assertTrue(results); } | 49300 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49300/adabba9fc5cefa2d978a1abe4543c86a61d36cbd/ESRound2InteropTest.java/buggy/modules/integration/itest/test/interop/whitemesa/round2/ESRound2InteropTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
54,
22,
43,
1441,
2599,
2465,
693,
1076,
1435,
1216,
15509,
7083,
288,
3639,
880,
273,
315,
2505,
2207,
73,
345,
1900,
83,
438,
18,
3168,
1884,
908,
18,
2758,
19,
19062... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
54,
22,
43,
1441,
2599,
2465,
693,
1076,
1435,
1216,
15509,
7083,
288,
3639,
880,
273,
315,
2505,
2207,
73,
345,
1900,
83,
438,
18,
3168,
1884,
908,
18,
2758,
19,
19062... |
else if (gradeOption.equals("return")) | sEdit.setReturned(true); sEdit.setTimeReturned(TimeService.newTime()); sEdit.setHonorPledgeFlag(Boolean.FALSE.booleanValue()); } if (state.getAttribute(GRADE_SUBMISSION_ALLOW_RESUBMIT) != null && ((Boolean)state.getAttribute(GRADE_SUBMISSION_ALLOW_RESUBMIT)).booleanValue()) { sEdit.getPropertiesEdit().addProperty(GRADE_SUBMISSION_ALLOW_RESUBMIT, Boolean.TRUE.toString()); state.removeAttribute(GRADE_SUBMISSION_ALLOW_RESUBMIT); } else { sEdit.getPropertiesEdit().removeProperty(GRADE_SUBMISSION_ALLOW_RESUBMIT); } String feedbackCommentString = StringUtil .trimToNull((String) state.getAttribute(GRADE_SUBMISSION_FEEDBACK_COMMENT)); if (feedbackCommentString != null) { sEdit.setFeedbackComment(feedbackCommentString); } String feedbackTextString = (String) state.getAttribute(GRADE_SUBMISSION_FEEDBACK_TEXT); if (feedbackTextString != null) { sEdit.setFeedbackText(feedbackTextString); } List v = (List) state.getAttribute(GRADE_SUBMISSION_FEEDBACK_ATTACHMENT); if (v != null) { sEdit.clearFeedbackAttachments(); for (int i = 0; i < v.size(); i++) | private void grade_submission_option(RunData data, String gradeOption) { SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid()); ParameterParser params = data.getParameters(); boolean withGrade = state.getAttribute(WITH_GRADES) != null ? ((Boolean) state.getAttribute(WITH_GRADES)).booleanValue() : false; if (params.getString("allowResubmit") != null) { state.setAttribute(GRADE_SUBMISSION_ALLOW_RESUBMIT, Boolean.TRUE); } else { state.setAttribute(GRADE_SUBMISSION_ALLOW_RESUBMIT, Boolean.FALSE); } boolean checkForFormattingErrors = false; // so that grading isn't held up by formatting errors String feedbackComment = processFormattedTextFromBrowser(state, params.getCleanString(GRADE_SUBMISSION_FEEDBACK_COMMENT), checkForFormattingErrors); if (feedbackComment != null) { state.setAttribute(GRADE_SUBMISSION_FEEDBACK_COMMENT, feedbackComment); } String feedbackText = processAssignmentFeedbackFromBrowser(state, params.getCleanString(GRADE_SUBMISSION_FEEDBACK_TEXT)); if (feedbackText != null) { state.setAttribute(GRADE_SUBMISSION_FEEDBACK_TEXT, feedbackText); } state.setAttribute(GRADE_SUBMISSION_FEEDBACK_ATTACHMENT, state.getAttribute(ATTACHMENTS)); String g = params.getCleanString(GRADE_SUBMISSION_GRADE); if (g != null) { state.setAttribute(GRADE_SUBMISSION_GRADE, g); } String sId = (String) state.getAttribute(GRADE_SUBMISSION_SUBMISSION_ID); try { // for points grading, one have to enter number as the points String grade = (String) state.getAttribute(GRADE_SUBMISSION_GRADE); Assignment a = AssignmentService.getSubmission(sId).getAssignment(); int typeOfGrade = a.getContent().getTypeOfGrade(); if (withGrade) { // do grade validation only for Assignment with Grade tool if (typeOfGrade == 3) { if ((grade.length() == 0)) { if (gradeOption.equals("release")) { // in case of releasing grade, user must specify a grade addAlert(state, rb.getString("plespethe2")); } } else { // the preview grade process might already scaled up the grade by 10 if (!((String) state.getAttribute(STATE_MODE)).equals(MODE_INSTRUCTOR_PREVIEW_GRADE_SUBMISSION)) { validPointGrade(state, grade); state.setAttribute(GRADE_SUBMISSION_GRADE, grade); if (state.getAttribute(STATE_MESSAGE) == null) { grade = scalePointGrade(state, grade); } } if (state.getAttribute(STATE_MESSAGE) == null) { int maxGrade = a.getContent().getMaxGradePoint(); try { if (Integer.parseInt(grade) > maxGrade) { addAlert(state, rb.getString("grad2")); } } catch (NumberFormatException e) { alertInvalidPoint(state, grade); } } } } // if ungraded and grade type is not "ungraded" type if ((grade == null || grade.equals("ungraded")) && (typeOfGrade != 1) && gradeOption.equals("release")) { addAlert(state, rb.getString("plespethe2")); } } if (state.getAttribute(STATE_MESSAGE) == null) { state.setAttribute(GRADE_SUBMISSION_GRADE, grade); AssignmentSubmissionEdit sEdit = AssignmentService.editSubmission(sId); if (!withGrade) { // no grade input needed for the without-grade version of assignment tool sEdit.setGraded(true); if (gradeOption.equals("return") || gradeOption.equals("release")) { sEdit.setGradeReleased(true); } } else if (grade == null) { sEdit.setGrade(""); sEdit.setGraded(false); sEdit.setGradeReleased(false); } else { if (typeOfGrade == 1) { sEdit.setGrade("no grade"); sEdit.setGraded(true); } else { if (!grade.equals("")) { if (typeOfGrade == 3) { sEdit.setGrade(grade); } else { sEdit.setGrade(grade); } sEdit.setGraded(true); } } } if (gradeOption.equals("release")) { sEdit.setGradeReleased(true); sEdit.setGraded(true); // clear the returned flag sEdit.setReturned(false); sEdit.setTimeReturned(null); } else if (gradeOption.equals("return")) { if (StringUtil.trimToNull(grade) != null) { sEdit.setGradeReleased(true); sEdit.setGraded(true); } sEdit.setReturned(true); sEdit.setTimeReturned(TimeService.newTime()); sEdit.setHonorPledgeFlag(Boolean.FALSE.booleanValue()); } if (state.getAttribute(GRADE_SUBMISSION_ALLOW_RESUBMIT) != null && ((Boolean)state.getAttribute(GRADE_SUBMISSION_ALLOW_RESUBMIT)).booleanValue()) { sEdit.getPropertiesEdit().addProperty(GRADE_SUBMISSION_ALLOW_RESUBMIT, Boolean.TRUE.toString()); state.removeAttribute(GRADE_SUBMISSION_ALLOW_RESUBMIT); } else { sEdit.getPropertiesEdit().removeProperty(GRADE_SUBMISSION_ALLOW_RESUBMIT); } // the instructor comment String feedbackCommentString = StringUtil .trimToNull((String) state.getAttribute(GRADE_SUBMISSION_FEEDBACK_COMMENT)); if (feedbackCommentString != null) { sEdit.setFeedbackComment(feedbackCommentString); } // the instructor inline feedback String feedbackTextString = (String) state.getAttribute(GRADE_SUBMISSION_FEEDBACK_TEXT); if (feedbackTextString != null) { sEdit.setFeedbackText(feedbackTextString); } List v = (List) state.getAttribute(GRADE_SUBMISSION_FEEDBACK_ATTACHMENT); if (v != null) { // clear the old attachments first sEdit.clearFeedbackAttachments(); for (int i = 0; i < v.size(); i++) { sEdit.addFeedbackAttachment((Reference) v.get(i)); } } String sReference = sEdit.getReference(); AssignmentService.commitEdit(sEdit); // update grades in gradebook String aReference = a.getReference(); String associateGradebookAssignment = StringUtil.trimToNull(a.getProperties().getProperty(NEW_ASSIGNMENT_ASSOCIATE_GRADEBOOK_ASSIGNMENT)); if (gradeOption.equals("release") || gradeOption.equals("return")) { // update grade in gradebook integrateGradebook(state, aReference, associateGradebookAssignment, null, null, null, -1, null, sReference, "update"); } else { // remove grade from gradebook integrateGradebook(state, aReference, associateGradebookAssignment, null, null, null, -1, null, sReference, "remove"); } } // if } catch (IdUnusedException e) { } catch (PermissionException e) { } catch (InUseException e) { addAlert(state, rb.getString("somelsis") + " " + rb.getString("submiss")); } // try if (state.getAttribute(STATE_MESSAGE) == null) { state.setAttribute(STATE_MODE, MODE_INSTRUCTOR_GRADE_ASSIGNMENT); state.setAttribute(ATTACHMENTS, EntityManager.newReferenceList()); } } // grade_submission_option | 54270 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54270/dacf6c2580450a41c84641d9af397ec3bb323f66/AssignmentAction.java/clean/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
7324,
67,
12684,
67,
3482,
12,
1997,
751,
501,
16,
514,
7324,
1895,
13,
202,
95,
202,
202,
2157,
1119,
919,
273,
14015,
46,
2413,
5868,
1997,
751,
13,
501,
2934,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
7324,
67,
12684,
67,
3482,
12,
1997,
751,
501,
16,
514,
7324,
1895,
13,
202,
95,
202,
202,
2157,
1119,
919,
273,
14015,
46,
2413,
5868,
1997,
751,
13,
501,
2934,
588,
... |
Graphics g = getGraphics(); | Graphics g = PlotPanel.this.getGraphics(); | public PlotPanel() { setBackground(Color.black); m_InstanceInfoText.setFont(new Font("Monospaced", Font.PLAIN,12)); m_InstanceInfoText.setEditable(false); m_createShape = false; m_shapes = null;//// m_shapePoints = null; m_newMousePos = new Dimension(); m_drawnPoints = new int[getWidth()][getHeight()]; addMouseListener(new MouseAdapter() { /////// public void mousePressed(MouseEvent e) { if ((e.getModifiers() & e.BUTTON1_MASK) == e.BUTTON1_MASK) { // if (m_sIndex == 0) { //do nothing it will get dealt to in the clicked method } else if (m_sIndex == 1) { m_createShape = true; m_shapePoints = new FastVector(5); m_shapePoints.addElement(new Double(m_sIndex)); m_shapePoints.addElement(new Double(e.getX())); m_shapePoints.addElement(new Double(e.getY())); m_shapePoints.addElement(new Double(e.getX())); m_shapePoints.addElement(new Double(e.getY())); Graphics g = getGraphics(); g.setColor(Color.black); g.setXORMode(Color.white); g.drawRect(((Double)m_shapePoints.elementAt(1)).intValue(), ((Double)m_shapePoints.elementAt(2)).intValue(), ((Double)m_shapePoints.elementAt(3)).intValue() - ((Double)m_shapePoints.elementAt(1)).intValue(), ((Double)m_shapePoints.elementAt(4)).intValue() - ((Double)m_shapePoints.elementAt(2)).intValue()); g.dispose(); } //System.out.println("clicked"); } //System.out.println("clicked"); } ////// public void mouseClicked(MouseEvent e) { if ((m_sIndex == 2 || m_sIndex == 3) && (m_createShape || (e.getModifiers() & e.BUTTON1_MASK) == e.BUTTON1_MASK)) { if (m_createShape) { //then it has been started already. Graphics g = getGraphics(); g.setColor(Color.black); g.setXORMode(Color.white); if ((e.getModifiers() & e.BUTTON1_MASK) == e.BUTTON1_MASK) { m_shapePoints.addElement(new Double(convertToAttribX(e.getX()))); m_shapePoints.addElement(new Double(convertToAttribY(e.getY()))); m_newMousePos.width = e.getX(); m_newMousePos.height = e.getY(); g.drawLine((int)Math.ceil (convertToPanelX (((Double)m_shapePoints. elementAt(m_shapePoints.size() - 2)). doubleValue())), (int)Math.ceil (convertToPanelY (((Double)m_shapePoints. elementAt(m_shapePoints.size() - 1)). doubleValue())), m_newMousePos.width, m_newMousePos.height); } else if (m_sIndex == 3) { //then extend the lines to infinity //(100000 or so should be enough). //the area is selected by where the user right clicks //the mouse button m_createShape = false; if (m_shapePoints.size() >= 5) { double cx = Math.ceil (convertToPanelX (((Double)m_shapePoints.elementAt (m_shapePoints.size() - 4)).doubleValue())); double cx2 = Math.ceil (convertToPanelX (((Double)m_shapePoints.elementAt (m_shapePoints.size() - 2)).doubleValue())) - cx; cx2 *= 50000; double cy = Math.ceil (convertToPanelY(((Double)m_shapePoints.elementAt (m_shapePoints.size() - 3)). doubleValue())); double cy2 = Math.ceil (convertToPanelY(((Double)m_shapePoints.elementAt (m_shapePoints.size() - 1)). doubleValue())) - cy; cy2 *= 50000; double cxa = Math.ceil(convertToPanelX (((Double)m_shapePoints. elementAt(3)). doubleValue())); double cxa2 = Math.ceil(convertToPanelX (((Double)m_shapePoints. elementAt(1)). doubleValue())) - cxa; cxa2 *= 50000; double cya = Math.ceil (convertToPanelY (((Double)m_shapePoints.elementAt(4)). doubleValue())); double cya2 = Math.ceil (convertToPanelY (((Double)m_shapePoints.elementAt(2)). doubleValue())) - cya; cya2 *= 50000; m_shapePoints.setElementAt (new Double(convertToAttribX(cxa2 + cxa)), 1); m_shapePoints.setElementAt (new Double(convertToAttribY(cy2 + cy)), m_shapePoints.size() - 1); m_shapePoints.setElementAt (new Double(convertToAttribX(cx2 + cx)), m_shapePoints.size() - 2); m_shapePoints.setElementAt (new Double(convertToAttribY(cya2 + cya)), 2); //determine how infinity line should be built cy = Double.POSITIVE_INFINITY; cy2 = Double.NEGATIVE_INFINITY; if (((Double)m_shapePoints.elementAt(1)). doubleValue() > ((Double)m_shapePoints.elementAt(3)). doubleValue()) { if (((Double)m_shapePoints.elementAt(2)). doubleValue() == ((Double)m_shapePoints.elementAt(4)). doubleValue()) { cy = ((Double)m_shapePoints.elementAt(2)). doubleValue(); } } if (((Double)m_shapePoints.elementAt (m_shapePoints.size() - 2)).doubleValue() > ((Double)m_shapePoints.elementAt (m_shapePoints.size() - 4)).doubleValue()) { if (((Double)m_shapePoints.elementAt (m_shapePoints.size() - 3)). doubleValue() == ((Double)m_shapePoints.elementAt (m_shapePoints.size() - 1)).doubleValue()) { cy2 = ((Double)m_shapePoints.lastElement()). doubleValue(); } } m_shapePoints.addElement(new Double(cy)); m_shapePoints.addElement(new Double(cy2)); if (!inPolyline(m_shapePoints, convertToAttribX (e.getX()), convertToAttribY(e.getY()))) { Double tmp = (Double)m_shapePoints. elementAt(m_shapePoints.size() - 2); m_shapePoints.setElementAt (m_shapePoints.lastElement(), m_shapePoints.size() - 2); m_shapePoints.setElementAt (tmp, m_shapePoints.size() - 1); } if (m_shapes == null) { m_shapes = new FastVector(4); } m_shapes.addElement(m_shapePoints); m_submit.setText("Submit"); m_submit.setActionCommand("Submit"); m_submit.setEnabled(true); } m_shapePoints = null; repaint(); } else { //then close the shape m_createShape = false; if (m_shapePoints.size() >= 7) { m_shapePoints.addElement(m_shapePoints.elementAt(1)); m_shapePoints.addElement(m_shapePoints.elementAt(2)); if (m_shapes == null) { m_shapes = new FastVector(4); } m_shapes.addElement(m_shapePoints); m_submit.setText("Submit"); m_submit.setActionCommand("Submit"); m_submit.setEnabled(true); } m_shapePoints = null; repaint(); } g.dispose(); //repaint(); } else if ((e.getModifiers() & e.BUTTON1_MASK) == e.BUTTON1_MASK) { //then this is the first point m_createShape = true; m_shapePoints = new FastVector(17); m_shapePoints.addElement(new Double(m_sIndex)); m_shapePoints.addElement(new Double(convertToAttribX(e.getX()))); //the new point m_shapePoints.addElement(new Double(convertToAttribY(e.getY()))); m_newMousePos.width = e.getX(); //the temp mouse point m_newMousePos.height = e.getY(); Graphics g = getGraphics(); g.setColor(Color.black); g.setXORMode(Color.white); g.drawLine((int)Math.ceil (convertToPanelX(((Double)m_shapePoints. elementAt(1)).doubleValue())), (int)Math.ceil (convertToPanelY(((Double)m_shapePoints. elementAt(2)).doubleValue())), m_newMousePos.width, m_newMousePos.height); g.dispose(); } } else { if ((e.getModifiers() & InputEvent.BUTTON1_MASK) == InputEvent.BUTTON1_MASK) { searchPoints(e.getX(),e.getY(), false); } else { searchPoints(e.getX(), e.getY(), true); } } } ///////// public void mouseReleased(MouseEvent e) { //System.out.println("rel"); if (m_createShape) { if (((Double)m_shapePoints.elementAt(0)).intValue() == 1) { m_createShape = false; Graphics g = getGraphics(); g.setColor(Color.black); g.setXORMode(Color.white); g.drawRect(((Double)m_shapePoints.elementAt(1)). intValue(), ((Double)m_shapePoints.elementAt(2)).intValue(), ((Double)m_shapePoints.elementAt(3)).intValue() - ((Double)m_shapePoints.elementAt(1)).intValue(), ((Double)m_shapePoints.elementAt(4)).intValue() - ((Double)m_shapePoints.elementAt(2)).intValue()); g.dispose(); if (checkPoints(((Double)m_shapePoints.elementAt(1)). doubleValue(), ((Double)m_shapePoints.elementAt(2)). doubleValue()) && checkPoints(((Double)m_shapePoints.elementAt(3)). doubleValue(), ((Double)m_shapePoints.elementAt(4)). doubleValue())) { //then the points all land on the screen //now do special check for the rectangle if (((Double)m_shapePoints.elementAt(1)).doubleValue() < ((Double)m_shapePoints.elementAt(3)).doubleValue() && ((Double)m_shapePoints.elementAt(2)).doubleValue() < ((Double)m_shapePoints.elementAt(4)).doubleValue()) { //then the rectangle is valid if (m_shapes == null) { m_shapes = new FastVector(2); } m_shapePoints.setElementAt(new Double(convertToAttribX(((Double)m_shapePoints. elementAt(1)). doubleValue())), 1); m_shapePoints.setElementAt(new Double(convertToAttribY(((Double)m_shapePoints. elementAt(2)). doubleValue())), 2); m_shapePoints.setElementAt(new Double(convertToAttribX(((Double)m_shapePoints. elementAt(3)). doubleValue())), 3); m_shapePoints.setElementAt(new Double(convertToAttribY(((Double)m_shapePoints. elementAt(4)). doubleValue())), 4); m_shapes.addElement(m_shapePoints); m_submit.setText("Submit"); m_submit.setActionCommand("Submit"); m_submit.setEnabled(true); repaint(); } } m_shapePoints = null; } } } }); addMouseMotionListener(new MouseMotionAdapter() { public void mouseDragged(MouseEvent e) { //check if the user is dragging a box if (m_createShape) { if (((Double)m_shapePoints.elementAt(0)).intValue() == 1) { Graphics g = getGraphics(); g.setColor(Color.black); g.setXORMode(Color.white); g.drawRect(((Double)m_shapePoints.elementAt(1)).intValue(), ((Double)m_shapePoints.elementAt(2)).intValue(), ((Double)m_shapePoints.elementAt(3)).intValue() - ((Double)m_shapePoints.elementAt(1)).intValue(), ((Double)m_shapePoints.elementAt(4)).intValue() - ((Double)m_shapePoints.elementAt(2)).intValue()); m_shapePoints.setElementAt(new Double(e.getX()), 3); m_shapePoints.setElementAt(new Double(e.getY()), 4); g.drawRect(((Double)m_shapePoints.elementAt(1)).intValue(), ((Double)m_shapePoints.elementAt(2)).intValue(), ((Double)m_shapePoints.elementAt(3)).intValue() - ((Double)m_shapePoints.elementAt(1)).intValue(), ((Double)m_shapePoints.elementAt(4)).intValue() - ((Double)m_shapePoints.elementAt(2)).intValue()); g.dispose(); } } } public void mouseMoved(MouseEvent e) { if (m_createShape) { if (((Double)m_shapePoints.elementAt(0)).intValue() == 2 || ((Double)m_shapePoints.elementAt(0)).intValue() == 3) { Graphics g = getGraphics(); g.setColor(Color.black); g.setXORMode(Color.white); g.drawLine((int)Math.ceil(convertToPanelX (((Double)m_shapePoints.elementAt (m_shapePoints.size() - 2)). doubleValue())), (int)Math.ceil(convertToPanelY (((Double)m_shapePoints.elementAt (m_shapePoints.size() - 1)). doubleValue())), m_newMousePos.width, m_newMousePos.height); m_newMousePos.width = e.getX(); m_newMousePos.height = e.getY(); g.drawLine((int)Math.ceil(convertToPanelX (((Double)m_shapePoints.elementAt (m_shapePoints.size() - 2)). doubleValue())), (int)Math.ceil(convertToPanelY (((Double)m_shapePoints.elementAt (m_shapePoints.size() - 1)). doubleValue())), m_newMousePos.width, m_newMousePos.height); g.dispose(); } } } }); m_submit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("Submit")) { if (m_splitListener != null && m_shapes != null) { //then send the split to the listener Instances sub_set1 = new Instances(m_plotInstances, 500); Instances sub_set2 = new Instances(m_plotInstances, 500); if (m_plotInstances != null) { for (int noa = 0 ; noa < m_plotInstances.numInstances(); noa++) { if (!m_plotInstances.instance(noa).isMissing(m_xIndex) && !m_plotInstances.instance(noa).isMissing(m_yIndex)){ if (inSplit(m_plotInstances.instance(noa))) { sub_set1.add(m_plotInstances.instance(noa)); } else { sub_set2.add(m_plotInstances.instance(noa)); } } } FastVector tmp = m_shapes; cancelShapes(); m_splitListener.userDataEvent(new VisualizePanelEvent(tmp, sub_set1, sub_set2, m_xIndex, m_yIndex)); } } else if (m_shapes != null && m_plotInstances != null) { Instances sub_set1 = new Instances(m_plotInstances, 500); int count = 0; for (int noa = 0 ; noa < m_plotInstances.numInstances(); noa++) { if (inSplit(m_plotInstances.instance(noa))) { sub_set1.add(m_plotInstances.instance(noa)); count++; } } double [] nPreds = null; int x = m_xIndex; int y = m_yIndex; //boolean p = m_predsNumeric; if (m_origInstances == null) { //this sets these instances as the instances //to go back to. m_origInstances = m_plotInstances; } if (m_origPreds == null && m_preds != null) { m_origPreds = m_preds; } if (m_preds != null && count > 0) { nPreds = new double[m_origInstances.numInstances()]; count = 0; for (int noa = 0; noa < m_plotInstances.numInstances(); noa++) { if (inSplit(m_plotInstances.instance(noa))) { //System.out.println(m_preds[noa]); nPreds[count] = m_preds[noa]; count++; } } } cancelShapes(); VisualizePanel.this.setInstances(sub_set1); if (m_preds != null) { VisualizePanel.this.setPredictions(nPreds); //VisualizePanel.this.setPredictionsNumeric(p); } try { VisualizePanel.this.setXIndex(x); VisualizePanel.this.setYIndex(y); } catch(Exception er) { System.out.println("Error : " + er); // System.out.println("Part of user input so had to" + // " catch here"); } } } else if (e.getActionCommand().equals("Reset")) { int x = m_xIndex; int y = m_yIndex; //boolean p = m_predsNumeric; VisualizePanel.this.setInstances(m_origInstances); if (m_origPreds != null) { VisualizePanel.this.setPredictions(m_origPreds); //VisualizePanel.this.setPredictionsNumeric(p); } try { VisualizePanel.this.setXIndex(x); VisualizePanel.this.setYIndex(y); } catch(Exception er) { System.out.println("Error : " + er); } } } }); m_cancel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelShapes(); repaint(); } }); //////////// } | 4179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4179/92c461ef37c8d7aa7f9ff51988eede7ee5e2a72a/VisualizePanel.java/clean/trunk/weka/gui/explorer/VisualizePanel.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
15211,
5537,
1435,
288,
1377,
31217,
12,
2957,
18,
11223,
1769,
1377,
312,
67,
1442,
966,
1528,
18,
542,
5711,
12,
2704,
10063,
2932,
11415,
538,
909,
72,
3113,
10063,
18,
26549,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
15211,
5537,
1435,
288,
1377,
31217,
12,
2957,
18,
11223,
1769,
1377,
312,
67,
1442,
966,
1528,
18,
542,
5711,
12,
2704,
10063,
2932,
11415,
538,
909,
72,
3113,
10063,
18,
26549,
16... |
case Token.NAMEINC : case Token.NAMEDEC : | case Icode_NAMEINC : case Icode_NAMEDEC : | private static void dumpICode(InterpreterData idata) { if (Token.printICode) { try { int iCodeLength = idata.itsICodeTop; byte iCode[] = idata.itsICode; String[] strings = idata.itsStringTable; out = new PrintWriter(new FileOutputStream("icode.txt", true)); out.println("ICode dump, for " + idata.itsName + ", length = " + iCodeLength); out.println("MaxStack = " + idata.itsMaxStack); for (int pc = 0; pc < iCodeLength; ) { out.flush(); out.print(" [" + pc + "] "); int token = iCode[pc] & 0xff; String tname = icodeToName(token); int old_pc = pc; ++pc; int icodeLength = icodeTokenLength(token); switch (token) { default: if (icodeLength != 1) Context.codeBug(); out.println(tname); break; case Icode_GOSUB : case Token.GOTO : case Token.IFEQ : case Token.IFNE : { int newPC = getTarget(iCode, pc); out.println(tname + " " + newPC); pc += 2; break; } case Icode_RETSUB : case Token.ENUMINIT : case Token.ENUMNEXT : case Token.VARINC : case Token.VARDEC : case Token.GETVAR : case Token.SETVAR : case Token.NEWTEMP : case Token.USETEMP : { int slot = (iCode[pc] & 0xFF); out.println(tname + " " + slot); pc++; break; } case Icode_CALLSPECIAL : { int callType = iCode[pc] & 0xFF; boolean isNew = (iCode[pc + 1] != 0); int line = getShort(iCode, pc+2); int count = getIndex(iCode, pc + 4); out.println(tname + " " + callType + " " + isNew + " " + count + " " + line); pc += 8; break; } case Token.REGEXP : { int i = getIndex(iCode, pc); Object regexp = idata.itsRegExpLiterals[i]; out.println(tname + " " + regexp); pc += 2; break; } case Token.CLOSURE : { int i = getIndex(iCode, pc); InterpreterData data2 = idata.itsNestedFunctions[i]; out.println(tname + " " + data2); pc += 2; break; } case Token.NEW : case Token.CALL : { int count = getIndex(iCode, pc + 2); String name = strings[getIndex(iCode, pc)]; out.println(tname + " " + count + " \"" + name + '"'); pc += 4; break; } case Icode_SHORTNUMBER : { int value = getShort(iCode, pc); out.println(tname + " " + value); pc += 2; break; } case Icode_INTNUMBER : { int value = getInt(iCode, pc); out.println(tname + " " + value); pc += 4; break; } case Token.NUMBER : { int index = getIndex(iCode, pc); double value = idata.itsDoubleTable[index]; out.println(tname + " " + value); pc += 2; break; } case Token.TYPEOFNAME : case Token.GETBASE : case Token.BINDNAME : case Token.SETNAME : case Token.NAME : case Token.NAMEINC : case Token.NAMEDEC : case Token.STRING : { String str = strings[getIndex(iCode, pc)]; out.println(tname + " \"" + str + '"'); pc += 2; break; } case Icode_LINE : { int line = getShort(iCode, pc); out.println(tname + " : " + line); pc += 2; break; } } if (old_pc + icodeLength != pc) Context.codeBug(); } int[] table = idata.itsExceptionTable; if (table != null) { out.println("Exception handlers: " +table.length / EXCEPTION_SLOT_SIZE); for (int i = 0; i != table.length; i += EXCEPTION_SLOT_SIZE) { int tryStart = table[i + EXCEPTION_TRY_START_SLOT]; int tryEnd = table[i + EXCEPTION_TRY_END_SLOT]; int catchStart = table[i + EXCEPTION_CATCH_SLOT]; int finallyStart = table[i + EXCEPTION_FINALLY_SLOT]; int withDepth = table[i + EXCEPTION_WITH_DEPTH_SLOT]; out.println(" "+tryStart+"\t "+tryEnd+"\t " +catchStart+"\t "+finallyStart +"\t "+withDepth); } } out.close(); } catch (IOException x) {} } } | 11366 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11366/faf2a30c39fc508f2635416a94f9662c4ae41ad3/Interpreter.java/clean/js/rhino/src/org/mozilla/javascript/Interpreter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
760,
918,
4657,
45,
1085,
12,
30010,
751,
612,
396,
13,
288,
3639,
309,
261,
1345,
18,
1188,
45,
1085,
13,
288,
5411,
775,
288,
7734,
509,
277,
1085,
1782,
273,
612,
396,
18,
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,
377,
3238,
760,
918,
4657,
45,
1085,
12,
30010,
751,
612,
396,
13,
288,
3639,
309,
261,
1345,
18,
1188,
45,
1085,
13,
288,
5411,
775,
288,
7734,
509,
277,
1085,
1782,
273,
612,
396,
18,
12... |
public static void BuildFileTree(String tree) { String TmpDir = ""; File newPath = new File(""); //System.out.println(tree); StringTokenizer st = new StringTokenizer(tree, "\\", true); for (int i = st.countTokens(); i > 0; i--) { TmpDir = TmpDir + st.nextToken(); if (i % 2 != 0) { System.out.println(TmpDir); newPath = new File(TmpDir); newPath.mkdir(); } } } | 12287 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12287/bb039543ea2ce619e64830b6eeae038a2faeac68/FileCopy.java/clean/wandux/src/pfe/migration/client/pre/app/tools/FileCopy.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
3845,
6459,
3116,
812,
2471,
12,
780,
3413,
13,
202,
95,
202,
202,
780,
9161,
1621,
1546,
14432,
202,
202,
25579,
275,
359,
743,
33,
2704,
812,
2932,
8863,
202,
202,
759,
3163... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3845,
6459,
3116,
812,
2471,
12,
780,
3413,
13,
202,
95,
202,
202,
780,
9161,
1621,
1546,
14432,
202,
202,
25579,
275,
359,
743,
33,
2704,
812,
2932,
8863,
202,
202,
759,
3163... | ||
Enumeration enumeration = finishedTaskSubs.getAddedList(); while (enumeration.hasMoreElements()) { Disposition disp = (Disposition) enumeration.nextElement(); Task t = disp.getTask(); Workflow wf = t.getWorkflow(); Constraint c = wf.getNextPendingConstraint(); if (logging.isDebugEnabled()) { logging.debug("Next constraint:" + c); } | Enumeration enumeration = finishedTaskSubs.getAddedList(); while (enumeration.hasMoreElements()) { Disposition disp = (Disposition) enumeration.nextElement(); Task t = disp.getTask(); Workflow wf = t.getWorkflow(); Constraint c = wf.getNextPendingConstraint(); if (logging.isDebugEnabled()) { logging.debug("Next constraint:" + c); } | private void checkForFinishedTasks() { Enumeration enumeration = finishedTaskSubs.getAddedList(); while (enumeration.hasMoreElements()) { Disposition disp = (Disposition) enumeration.nextElement(); Task t = disp.getTask(); Workflow wf = t.getWorkflow(); Constraint c = wf.getNextPendingConstraint(); if (logging.isDebugEnabled()) { logging.debug("Next constraint:" + c); } if (c != null) { Task nexttask = c.getConstrainedTask(); if (nexttask.getPlanElement() != null) { getBlackboardService().publishRemove(nexttask.getWorkflow() .getParentTask()); } else { getBlackboardService().publishAdd(nexttask); } } } } | 13211 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13211/a04a8ce69ed2fce0cc0ad267758456a1e6cc451e/MnrCompromisePlugin.java/clean/securemonitoring/src/org/cougaar/core/security/monitoring/plugin/MnrCompromisePlugin.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
13855,
10577,
6685,
1435,
288,
3639,
13864,
16836,
273,
6708,
2174,
26123,
18,
588,
8602,
682,
5621,
3639,
1323,
261,
7924,
7067,
18,
5332,
7417,
3471,
10756,
288,
5411,
3035,
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,
377,
3238,
918,
13855,
10577,
6685,
1435,
288,
3639,
13864,
16836,
273,
6708,
2174,
26123,
18,
588,
8602,
682,
5621,
3639,
1323,
261,
7924,
7067,
18,
5332,
7417,
3471,
10756,
288,
5411,
3035,
32... |
PrintStream ps = new PrintStream(res.getOutputStream()); e.printStackTrace(ps); | log.debug("Error getting CA certificates: ", e); | public void doGet(HttpServletRequest req, HttpServletResponse res) throws java.io.IOException, ServletException { log.debug(">doGet()"); String command; // Keep this for logging. String remoteAddr = req.getRemoteAddr(); Admin administrator = new Admin(Admin.TYPE_PUBLIC_WEB_USER, remoteAddr); String issuerdn = null; if(req.getParameter(ISSUER_PROPERTY) != null){ issuerdn = java.net.URLDecoder.decode(req.getParameter(ISSUER_PROPERTY),"UTF-8"); } int caid = 0; if(req.getParameter(CAID_PROPERTY) != null){ caid = Integer.parseInt(req.getParameter(CAID_PROPERTY)); } command = req.getParameter(COMMAND_PROPERTY_NAME); if (command == null) command = ""; if (command.equalsIgnoreCase(COMMAND_CRL) && issuerdn != null) { try { ICertificateStoreSessionLocal store = storehome.create(); byte[] crl = store.getLastCRL(administrator, issuerdn); X509CRL x509crl = CertTools.getCRLfromByteArray(crl); String dn = CertTools.getIssuerDN(x509crl); String moz = req.getParameter(MOZILLA_PROPERTY); if ((moz == null) || !moz.equalsIgnoreCase("y")) { String filename = CertTools.getPartFromDN(dn,"CN")+".crl"; res.setHeader("Content-disposition", "attachment; filename=" + filename); } res.setContentType("application/x-x509-crl"); res.setContentLength(crl.length); res.getOutputStream().write(crl); log.debug("Sent latest CRL to client at " + remoteAddr); } catch (Exception e) { PrintStream ps = new PrintStream(res.getOutputStream()); res.sendError(HttpServletResponse.SC_NOT_FOUND, "Error getting latest CRL."); e.printStackTrace(ps); log.debug("Error sending latest CRL to " + remoteAddr); log.debug(e); return; } } else if (command.equalsIgnoreCase(COMMAND_CERT) || command.equalsIgnoreCase(COMMAND_LISTCERT)) { String dn = req.getParameter(SUBJECT_PROPERTY); if (dn == null) { res.sendError(HttpServletResponse.SC_BAD_REQUEST, "Usage command=lastcert/listcert?subject=<subjectdn>."); log.debug("Bad request, no 'subject' arg to 'lastcert' or 'listcert' command."); return; } try { log.debug("Looking for certificates for '"+dn+"'."); ICertificateStoreSessionLocal store = storehome.create(); Collection certcoll = store.findCertificatesBySubject(administrator, dn); Object[] certs = certcoll.toArray(); int latestcertno = -1; if (command.equalsIgnoreCase(COMMAND_CERT)) { long maxdate = 0; for (int i=0;i<certs.length;i++) { if (i == 0) { maxdate = ((X509Certificate)certs[i]).getNotBefore().getTime(); latestcertno = 0; } else if ( ((X509Certificate)certs[i]).getNotBefore().getTime() > maxdate ) { maxdate = ((X509Certificate)certs[i]).getNotBefore().getTime(); latestcertno = i; } } if (latestcertno > -1) { byte[] cert = ((X509Certificate)certs[latestcertno]).getEncoded(); String filename = CertTools.getPartFromDN(dn,"CN")+".cer"; res.setHeader("Content-disposition", "attachment; filename=" + filename); res.setContentType("application/octet-stream"); res.setContentLength(cert.length); res.getOutputStream().write(cert); log.debug("Sent latest certificate for '"+dn+"' to client at " + remoteAddr); } else { res.sendError(HttpServletResponse.SC_NOT_FOUND, "No certificate found for requested subject '"+dn+"'."); log.debug("No certificate found for '"+dn+"'."); } } if (command.equalsIgnoreCase(COMMAND_LISTCERT)) { res.setContentType("text/html"); PrintWriter pout = new PrintWriter(res.getOutputStream()); printHtmlHeader("Certificates for "+dn, pout); for (int i=0;i<certs.length;i++) { Date notBefore = ((X509Certificate)certs[i]).getNotBefore(); Date notAfter = ((X509Certificate)certs[i]).getNotAfter(); String subject = CertTools.getSubjectDN((X509Certificate)certs[i]); String issuer = CertTools.getIssuerDN((X509Certificate)certs[i]); BigInteger serno = ((X509Certificate)certs[i]).getSerialNumber(); pout.println("<pre>Subject:"+subject); pout.println("Issuer:"+issuer); pout.println("NotBefore:"+notBefore.toString()); pout.println("NotAfter:"+notAfter.toString()); pout.println("Serial number:"+serno.toString()); pout.println("</pre>"); pout.println("<a href=\"certdist?cmd=revoked&issuer="+issuer+"&serno="+serno.toString()+"\">Check if certificate is revoked</a>"); pout.println("<hr>"); } if (certs.length == 0) { pout.println("No certificates exists for '"+dn+"'."); } printHtmlFooter(pout); pout.close(); } } catch (Exception e) { PrintStream ps = new PrintStream(res.getOutputStream()); e.printStackTrace(ps); res.sendError(HttpServletResponse.SC_NOT_FOUND, "Error getting certificates."); log.debug("Error getting certificates for '"+dn+"' for "+remoteAddr); log.debug(e); return; } } else if ((command.equalsIgnoreCase(COMMAND_NSCACERT) || command.equalsIgnoreCase(COMMAND_IECACERT) || command.equalsIgnoreCase(COMMAND_CACERT)) && ( issuerdn != null || caid != 0)) { String lev = req.getParameter(LEVEL_PROPERTY); int level = 0; boolean pkcs7 = false; if (lev != null) level = Integer.parseInt(lev); else pkcs7 = true; // CA is level 0, next over root level 1 etc etc, -1 returns chain as PKCS7 try { ISignSessionLocal ss = signhome.create(); Certificate[] chain = null; if(caid != 0) chain = (Certificate[]) ss.getCertificateChain(administrator, caid).toArray(new Certificate[0]); else chain = (Certificate[]) ss.getCertificateChain(administrator, issuerdn.hashCode()).toArray(new Certificate[0]); // chain.length-1 is last cert in chain (root CA) if (chain.length < level) { PrintStream ps = new PrintStream(res.getOutputStream()); ps.println("No CA certificate of level "+level+" exist."); log.debug("No CA certificate of level "+level+" exist."); return; } X509Certificate cacert = (X509Certificate)chain[level]; String filename=CertTools.getPartFromDN(CertTools.getSubjectDN(cacert), "CN"); if (filename == null) filename = "ca"; byte[] enccert = null; if (pkcs7) enccert = ss.createPKCS7(administrator, cacert, true); else enccert = cacert.getEncoded(); if (command.equalsIgnoreCase(COMMAND_NSCACERT)) { res.setContentType("application/x-x509-ca-cert"); res.setContentLength(enccert.length); res.getOutputStream().write(enccert); log.debug("Sent CA cert to NS client, len="+enccert.length+"."); } else if (command.equalsIgnoreCase(COMMAND_IECACERT)) { if (pkcs7) res.setHeader("Content-disposition", "attachment; filename="+filename+".p7c"); else res.setHeader("Content-disposition", "attachment; filename="+filename+".crt"); res.setContentType("application/octet-stream"); res.setContentLength(enccert.length); res.getOutputStream().write(enccert); log.debug("Sent CA cert to IE client, len="+enccert.length+"."); } else if (command.equalsIgnoreCase(COMMAND_CACERT)) { byte[] b64cert = Base64.encode(enccert); String out; if (pkcs7) out = "-----BEGIN PKCS7-----\n"; else out = "-----BEGIN CERTIFICATE-----\n"; out += new String(b64cert); if (pkcs7) out += "\n-----END PKCS7-----\n"; else out += "\n-----END CERTIFICATE-----\n"; res.setHeader("Content-disposition", "attachment; filename="+filename+".pem"); res.setContentType("application/octet-stream"); res.setContentLength(out.length()); res.getOutputStream().write(out.getBytes()); log.debug("Sent CA cert to client, len="+out.length()+"."); } else { res.setContentType("text/plain"); res.getOutputStream().println("Commands="+COMMAND_NSCACERT+" || "+COMMAND_IECACERT+" || "+COMMAND_CACERT); return; } } catch (Exception e) { PrintStream ps = new PrintStream(res.getOutputStream()); e.printStackTrace(ps); res.sendError(HttpServletResponse.SC_NOT_FOUND, "Error getting CA certificates."); log.debug("Error getting CA certificates."); log.debug(e); return; } } else if ((command.equalsIgnoreCase(COMMAND_NSOCSPCERT) || command.equalsIgnoreCase(COMMAND_IEOCSPCERT) || command.equalsIgnoreCase(COMMAND_OCSPCERT)) && ( issuerdn != null || caid != 0)) { try { ICAAdminSessionLocal casession = cahome.create(); CAInfo cainfo = null; if(caid != 0) { cainfo = casession.getCAInfo(administrator, caid); } else { int id = issuerdn.hashCode(); cainfo = casession.getCAInfo(administrator, id); } X509Certificate ocspcert = null; Iterator iter = cainfo.getExtendedCAServiceInfos().iterator(); while(iter.hasNext()){ ExtendedCAServiceInfo next = (ExtendedCAServiceInfo) iter.next(); if(next instanceof OCSPCAServiceInfo){ if(((OCSPCAServiceInfo) next).getOCSPSignerCertificatePath() != null) ocspcert = (X509Certificate) ((OCSPCAServiceInfo) next).getOCSPSignerCertificatePath().get(0); } } // If no cert, send back a NOT_FOUND response if (ocspcert == null) { res.sendError(HttpServletResponse.SC_NOT_FOUND, "No OCSP certificate found for CA."); return; } String filename=CertTools.getPartFromDN(CertTools.getSubjectDN(ocspcert), "CN"); if (filename == null) filename = "ocsp"; byte[] enccert = null; enccert = ocspcert.getEncoded(); if (command.equalsIgnoreCase(COMMAND_NSOCSPCERT)) { res.setContentType("application/x-x509-ca-cert"); res.setContentLength(enccert.length); res.getOutputStream().write(enccert); log.debug("Sent OCSP cert to NS client, len="+enccert.length+"."); } else if (command.equalsIgnoreCase(COMMAND_IEOCSPCERT)) { res.setHeader("Content-disposition", "attachment; filename="+filename+".crt"); res.setContentType("application/octet-stream"); res.setContentLength(enccert.length); res.getOutputStream().write(enccert); log.debug("Sent OCSP cert to IE client, len="+enccert.length+"."); } else if (command.equalsIgnoreCase(COMMAND_OCSPCERT)) { byte[] b64cert = Base64.encode(enccert); String out; out = "-----BEGIN CERTIFICATE-----\n"; out += new String(b64cert); out += "\n-----END CERTIFICATE-----\n"; res.setHeader("Content-disposition", "attachment; filename="+filename+".pem"); res.setContentType("application/octet-stream"); res.setContentLength(out.length()); res.getOutputStream().write(out.getBytes()); log.debug("Sent OCSP cert to client, len="+out.length()+"."); } else { res.setContentType("text/plain"); res.getOutputStream().println("Commands="+COMMAND_NSCACERT+" || "+COMMAND_IECACERT+" || "+COMMAND_CACERT); return; } } catch (Exception e) { PrintStream ps = new PrintStream(res.getOutputStream()); e.printStackTrace(ps); res.sendError(HttpServletResponse.SC_NOT_FOUND, "Error getting OCSP certificate for CA."); log.debug("Error getting OCSP certificate for CA."); log.debug(e); return; } } else if (command.equalsIgnoreCase(COMMAND_REVOKED)) { String dn = req.getParameter(ISSUER_PROPERTY); if (dn == null) { res.sendError(HttpServletResponse.SC_BAD_REQUEST, "Usage command=revoked?issuer=<issuerdn>&serno=<serialnumber>."); log.debug("Bad request, no 'issuer' arg to 'revoked' command."); return; } String serno = req.getParameter(SERNO_PROPERTY); if (serno == null) { res.sendError(HttpServletResponse.SC_BAD_REQUEST, "Usage command=revoked?issuer=<issuerdn>&serno=<serialnumber>."); log.debug("Bad request, no 'serno' arg to 'revoked' command."); return; } log.debug("Looking for certificate for '"+dn+"' and serno='"+serno+"'."); try { ICertificateStoreSessionLocal store = storehome.create(); RevokedCertInfo revinfo = store.isRevoked(administrator, dn, new BigInteger(serno)); PrintWriter pout = new PrintWriter(res.getOutputStream()); res.setContentType("text/html"); printHtmlHeader("Check revocation", pout); if (revinfo != null) { if (revinfo.getReason() == RevokedCertInfo.NOT_REVOKED) { pout.println("<h1>NOT REVOKED</h1>"); pout.println("Certificate with issuer '"+dn+"' and serial number '"+serno+"' is NOT revoked."); } else { pout.println("<h1>REVOKED</h1>"); pout.println("Certificate with issuer '"+dn+"' and serial number '"+serno+"' is revoked."); pout.println("RevocationDate is '"+revinfo.getRevocationDate()+"' and reason '"+revinfo.getReason()+"'."); } } else { pout.println("<h1>CERTIFICATE DOES NOT EXIST</h1>"); pout.println("Certificate with issuer '"+dn+"' and serial number '"+serno+"' does not exist."); } printHtmlFooter(pout); pout.close(); } catch (Exception e) { PrintStream ps = new PrintStream(res.getOutputStream()); e.printStackTrace(ps); res.sendError(HttpServletResponse.SC_NOT_FOUND, "Error checking revocation."); log.debug("Error checking revocation for '"+dn+"' with serno '"+serno+"'."); log.debug(e); return; } } else { res.setContentType("text/plain"); res.sendError(HttpServletResponse.SC_BAD_REQUEST, "Commands=cacert | lastcert | listcerts | crl | revoked && issuer=<issuerdn>"); return; } } // doGet | 4109 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4109/34c7dd0bca7572b74c20a87116f29c116a7f13b4/CertDistServlet.java/clean/src/java/se/anatom/ejbca/webdist/CertDistServlet.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
23611,
12,
2940,
18572,
1111,
16,
225,
12446,
400,
13,
1216,
2252,
18,
1594,
18,
14106,
16,
16517,
288,
3639,
613,
18,
4148,
2932,
34,
2896,
967,
1435,
8863,
3639,
514,
1296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
23611,
12,
2940,
18572,
1111,
16,
225,
12446,
400,
13,
1216,
2252,
18,
1594,
18,
14106,
16,
16517,
288,
3639,
613,
18,
4148,
2932,
34,
2896,
967,
1435,
8863,
3639,
514,
1296,
... |
if (nextMatch < 0) return null; if (i == 0) matchStart = nextMatch; | if (nextMatch < 0) { return null; } if (i == 0) { matchStart = nextMatch; } | public StringMatcher.Position find(String text, int start, int end) { if (text == null) throw new IllegalArgumentException(); int tlen = text.length(); if (start < 0) start = 0; if (end > tlen) end = tlen; if (end < 0 || start >= end) return null; if (fLength == 0) return new Position(start, start); if (fIgnoreWildCards) { int x = posIn(text, start, end); if (x < 0) return null; return new Position(x, x + fLength); } int segCount = fSegments.length; if (segCount == 0)//pattern contains only '*'(s) return new Position(start, end); int curPos = start; int matchStart = -1; int i; for (i = 0; i < segCount && curPos < end; ++i) { String current = fSegments[i]; int nextMatch = regExpPosIn(text, curPos, end, current); if (nextMatch < 0) return null; if (i == 0) matchStart = nextMatch; curPos = nextMatch + current.length(); } if (i < segCount) return null; return new Position(matchStart, curPos); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/e38d295ea613cf9f08aadb93a84a33d2e91abc5f/StringMatcher.java/buggy/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/StringMatcher.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
6286,
18,
2555,
1104,
12,
780,
977,
16,
509,
787,
16,
509,
679,
13,
288,
3639,
309,
261,
955,
422,
446,
13,
5411,
604,
394,
2754,
5621,
3639,
509,
268,
1897,
273,
977,
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,
6286,
18,
2555,
1104,
12,
780,
977,
16,
509,
787,
16,
509,
679,
13,
288,
3639,
309,
261,
955,
422,
446,
13,
5411,
604,
394,
2754,
5621,
3639,
509,
268,
1897,
273,
977,
18,
... |
abstract public Result parse(Page page, Config cfg, Session session) throws ParsingException; | public abstract Result parse(Page page, Config cfg, Session session) throws ParsingException; | abstract public Result parse(Page page, Config cfg, Session session) throws ParsingException; | 651 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/651/5f215abdea441a9fbe198f9ec71a559585d6df89/AbstractParser.java/buggy/scraping-engine/src/java/org/osjava/scraping/AbstractParser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
8770,
1071,
3438,
1109,
12,
1964,
1363,
16,
1903,
2776,
16,
3877,
1339,
13,
1216,
19761,
503,
31,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
8770,
1071,
3438,
1109,
12,
1964,
1363,
16,
1903,
2776,
16,
3877,
1339,
13,
1216,
19761,
503,
31,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if (rootElem.getAttribute("selected") == null || !rootElem.getAttribute("selected").equals("true")) { | if (!Utility.areEqual(rootElem.getAttribute("selected"), "true")) { | public Element getXml (IGroupMember gm, Element anElem, Document aDoc) { String nextID; IEntityGroup entGrp = (IEntityGroup)gm; Element rootElem = (anElem != null ? anElem : GroupsManagerXML.createElement(ELEMENT_TAGNAME, aDoc, false)); Utility.logMessage("DEBUG", "GroupWrapper::getXml(): START, Element Expanded: " + rootElem.getAttribute("expanded")); try { Utility.logMessage("DEBUG", "GroupWrapper::getXml(): IEntityGroup: " + gm); String uid = rootElem.getAttribute("id"); if (Utility.areEqual(uid, "")) { nextID = GroupsManagerXML.getNextUid(); rootElem.setAttribute("id", nextID); } rootElem.setAttribute("key", gm.getKey()); rootElem.setAttribute("entityType",gm.getLeafType().getName()); rootElem.setAttribute("type", gm.getType().getName()); /** @todo uncomment next line when IEntityGroup answers isEditable() * Have to make sure that the root groups are always set to "false". * The default value is true (i.e. if attibute is not set.*/ //rootElem.setAttribute("editable", String.valueOf(gm.isEditable())); //rootElem.setAttribute("editable", "true"); boolean hasMems = gm.hasMembers(); Utility.logMessage("DEBUG", "GroupWrapper::getXml(): gm.hasMembers(): " + hasMems); if (!hasMems) { rootElem.setAttribute("expanded", "false"); } boolean isGroupExpanded = (Boolean.valueOf(rootElem.getAttribute("expanded")).booleanValue()); Utility.logMessage("DEBUG", "GroupWrapper::getXml(): Expanded = " + isGroupExpanded); if (rootElem.getAttribute("selected") == null || !rootElem.getAttribute("selected").equals("true")) { rootElem.setAttribute("selected", "false"); } rootElem.setAttribute("hasMembers", String.valueOf(hasMems)); Utility.logMessage("DEBUG", "GroupWrapper::getXml(): hasMembers = " + String.valueOf(hasMems)); // If no rdf element, create it, otherwise refresh the element NodeList nList = rootElem.getElementsByTagName("rdf:RDF"); if (nList.getLength() == 0) { Utility.logMessage("DEBUG", "GroupWrapper::getXml(): CREATING ELEMENT RDF"); Element rdf = GroupsManagerXML.createRdfElement(entGrp, aDoc); Utility.logMessage("DEBUG", "GroupWrapper::getXml(): APPENDING rdf element TO GRPROOT"); rootElem.appendChild(rdf); } else{ GroupsManagerXML.refreshAllNodesIfRequired(aDoc, rootElem); } if (isGroupExpanded) { expandElement(gm, rootElem, aDoc); } Utility.logMessage("DEBUG", "GroupWrapper::getXml(): FINISHED"); } catch (Exception e) { Utility.logMessage("ERROR", "GroupWrapper::getXml(): ERROR retrieving entity " + e.toString()); //throw new ChainedException("Exception from GroupsWrapper::getXml", e); } return rootElem; } | 1895 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1895/125d1956a9d4a7d8216c441f5a0c73d08c679e7d/GroupWrapper.java/buggy/source/org/jasig/portal/channels/groupsmanager/wrappers/GroupWrapper.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
565,
1071,
3010,
28504,
261,
45,
1114,
4419,
14125,
16,
3010,
392,
7498,
16,
4319,
279,
1759,
13,
288,
1377,
514,
1024,
734,
31,
1377,
29202,
1114,
3281,
43,
13832,
273,
261,
45,
1943,
1114,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
565,
1071,
3010,
28504,
261,
45,
1114,
4419,
14125,
16,
3010,
392,
7498,
16,
4319,
279,
1759,
13,
288,
1377,
514,
1024,
734,
31,
1377,
29202,
1114,
3281,
43,
13832,
273,
261,
45,
1943,
1114,
... |
public void testRoughTransformJ2000_TerRef_one() throws OrekitException, ParseException { System.out.println("bête test : "); AbsoluteDate test = new AbsoluteDate(AbsoluteDate.CNES1950Epoch, 19644*86400+7200.0); AbsoluteDate nous = new AbsoluteDate("2003-10-14T02:00:00", TTScale.getInstance()); System.out.println("date donnée : " + test); System.out.println("date nous : " + nous); AbsoluteDate date = new AbsoluteDate("2003-10-14T01:58:55.816", UTCScale.getInstance()); FrameSynchronizer fSynch = new FrameSynchronizer(date); ITRF2000Frame itrf = new ITRF2000Frame(fSynch); Transform trans = Frame.getJ2000().getTransformTo(itrf); // Positions Vector3D posJ2000 = new Vector3D(6500000.0, -1234567.0, 4000000.0); Vector3D posITRF = trans.transformPosition(posJ2000); Vector3D posTestCase = new Vector3D(3011113.9718319275, -5889820.8187575004, 4002169.292903322); // Position tests System.out.println("------------------------------------------"); System.out.println(""); System.out.println("tests position Ter Ref i = "); Vector3D d = Vector3D.subtract(posITRF, posTestCase); System.out.println("Ecarts position en metres " + d.getX() + " " + d.getY() + " " + d.getZ() + " " + d.getNorm()); Rotation r = new Rotation(posITRF, posTestCase); System.out.println("axe rotation position" + r.getAxis().getX() + " " + r.getAxis().getY() + " " + r.getAxis().getZ()); System.out.println("angle rotation position " + Math.toDegrees(r.getAngle())); checkClosePosition(posITRF, posTestCase, 2e-6, 12.0, 14.0); // speed tests Vector3D speedJ2000 = new Vector3D(3609.28229, 3322.88979, -7083.950661); Vector3D speedTestCase = new Vector3D(4410.401666334629, -1033.6270183038084, -7082.627462818678); Vector3D axe= trans.getRotation().getAxis(); double h = 0.5; fSynch.setDate(new AbsoluteDate(AbsoluteDate.CNES1950Epoch, 19644*86400+7200.0+h)); double A = Frame.getJ2000().getTransformTo(itrf).getRotation().getAngle(); fSynch.setDate(new AbsoluteDate(AbsoluteDate.CNES1950Epoch, 19644*86400+7200.0-h)); double B = Frame.getJ2000().getTransformTo(itrf).getRotation().getAngle(); fSynch.setDate(new AbsoluteDate(AbsoluteDate.CNES1950Epoch, 19644*86400+7200.0+2*h)); double C = Frame.getJ2000().getTransformTo(itrf).getRotation().getAngle(); fSynch.setDate(new AbsoluteDate(AbsoluteDate.CNES1950Epoch, 19644*86400+7200.0-2*h)); double D = Frame.getJ2000().getTransformTo(itrf).getRotation().getAngle(); double w = (1/(12*h))*(8*(A-B)-(C-D)); // System.out.println("omega : " + w); Vector3D rot = Vector3D.multiply(w,axe); Vector3D speedITRF = trans.transformVector(Vector3D.add(speedJ2000,Vector3D.crossProduct(rot,posJ2000))); System.out.println("------------------------------------------"); System.out.println(""); System.out.println("tests vitesse Ter Ref "); Vector3D v = Vector3D.subtract(speedITRF, speedTestCase); System.out.println("Ecarts vitesse en metres seconde " + v.getX() + " " + v.getY() + " " + v.getZ() + " " + v.getNorm()); checkClosePosition(speedITRF, speedTestCase, 1e-5, 0.2, 0.2); } | 4799 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4799/34929c520e9d49d2ea767710b97fbe46f7182818/ITRF2000FrameTest.java/buggy/tests-src/fr/cs/aerospace/orekit/frames/ITRF2000FrameTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
1842,
54,
4966,
4059,
46,
17172,
67,
56,
264,
1957,
67,
476,
1435,
1216,
531,
266,
8691,
503,
16,
10616,
288,
202,
225,
2332,
18,
659,
18,
8222,
2932,
70,
132,
108,
736,
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,
282,
1071,
918,
1842,
54,
4966,
4059,
46,
17172,
67,
56,
264,
1957,
67,
476,
1435,
1216,
531,
266,
8691,
503,
16,
10616,
288,
202,
225,
2332,
18,
659,
18,
8222,
2932,
70,
132,
108,
736,
18... | ||
getMessageUI().setBusy(true); | getMessageUI().setBusy(true); | public void actionPerformed(ActionEvent e) { if (getMessageUI() != null) getMessageUI().setBusy(true); FolderDisplayUI fw = getFolderDisplayUI(); if (fw != null) fw.setBusy(true);; openWindowAsNew(true); if (fw != null) fw.setBusy(false); if (getMessageUI() != null) getMessageUI().setBusy(false); } | 967 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/967/55c2ef8139608f0f93fb72272ca8300eb9ac663e/MessageProxy.java/buggy/src/net/suberic/pooka/gui/MessageProxy.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
26100,
12,
1803,
1133,
425,
13,
288,
1377,
309,
261,
24906,
5370,
1435,
480,
446,
13,
202,
24906,
5370,
7675,
542,
29289,
12,
3767,
1769,
1377,
12623,
4236,
5370,
7600,
273,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
26100,
12,
1803,
1133,
425,
13,
288,
1377,
309,
261,
24906,
5370,
1435,
480,
446,
13,
202,
24906,
5370,
7675,
542,
29289,
12,
3767,
1769,
1377,
12623,
4236,
5370,
7600,
273,
29... |
out.writeBoolean(bodyWriteOnly); | public void writeExternal(ObjectOutput out) throws IOException { byte[] arrayToSend = null; if (bodyWriteOnly) { p.flush(); arrayToSend = ostream.toByteArray(); } else { arrayToSend = (byte[])payload; } super.writeExternal(out); out.writeBoolean(bodyWriteOnly); if (arrayToSend == null) { out.writeInt(0); //pretend to be empty array } else { out.writeInt(arrayToSend.length); out.write(arrayToSend); } } | 3806 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3806/f957880e3959fea3b4f38d9dbb1e5dd0c710c09e/JBossBytesMessage.java/clean/src/main/org/jboss/jms/message/JBossBytesMessage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
565,
1071,
918,
1045,
6841,
12,
921,
1447,
596,
13,
1216,
1860,
282,
288,
1377,
1160,
8526,
526,
28878,
273,
446,
31,
5411,
309,
261,
3432,
3067,
3386,
13,
1377,
288,
540,
293,
18,
11330,
56... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
565,
1071,
918,
1045,
6841,
12,
921,
1447,
596,
13,
1216,
1860,
282,
288,
1377,
1160,
8526,
526,
28878,
273,
446,
31,
5411,
309,
261,
3432,
3067,
3386,
13,
1377,
288,
540,
293,
18,
11330,
56... | |
lirh ); | lirh, i); | public void renderLegend( IPrimitiveRenderer ipr, Legend lg, Map htRenderers ) throws ChartException { if ( !lg.isVisible( ) ) // CHECK VISIBILITY { return; } renderBlock( ipr, lg, StructureSource.createLegend( lg ) ); final IDisplayServer xs = getDevice( ).getDisplayServer( ); final double dScale = xs.getDpiResolution( ) / 72d; Bounds bo = lg.getBounds( ).scaledInstance( dScale ); Size sz = null; double dX, dY; if ( lg.getPosition( ) != Position.INSIDE_LITERAL ) { try { sz = lg.getPreferredSize( xs, cm, rtc ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, ex ); } sz.scale( dScale ); // USE ANCHOR IN POSITIONING THE LEGEND CLIENT AREA WITHIN THE BLOCK // SLACK SPACE dX = bo.getLeft( ) + ( bo.getWidth( ) - sz.getWidth( ) ) / 2; dY = 0; if ( lg.isSetAnchor( ) ) { int iAnchor = lg.getAnchor( ).getValue( ); // swap west/east if ( isRightToLeft( ) ) { if ( iAnchor == Anchor.EAST ) { iAnchor = Anchor.WEST; } else if ( iAnchor == Anchor.NORTH_EAST ) { iAnchor = Anchor.NORTH_WEST; } else if ( iAnchor == Anchor.SOUTH_EAST ) { iAnchor = Anchor.SOUTH_WEST; } else if ( iAnchor == Anchor.WEST ) { iAnchor = Anchor.EAST; } else if ( iAnchor == Anchor.NORTH_WEST ) { iAnchor = Anchor.NORTH_EAST; } else if ( iAnchor == Anchor.SOUTH_WEST ) { iAnchor = Anchor.SOUTH_EAST; } } switch ( iAnchor ) { case Anchor.NORTH : case Anchor.NORTH_EAST : case Anchor.NORTH_WEST : dY = bo.getTop( ); break; case Anchor.SOUTH : case Anchor.SOUTH_EAST : case Anchor.SOUTH_WEST : dY = bo.getTop( ) + bo.getHeight( ) - sz.getHeight( ); break; default : // CENTERED dY = bo.getTop( ) + ( bo.getHeight( ) - sz.getHeight( ) ) / 2; break; } switch ( iAnchor ) { case Anchor.WEST : case Anchor.NORTH_WEST : dX = bo.getLeft( ); break; case Anchor.EAST : case Anchor.SOUTH_EAST : dX = bo.getLeft( ) + bo.getWidth( ) - sz.getWidth( ); break; default : // CENTERED dX = bo.getLeft( ) + ( bo.getWidth( ) - sz.getWidth( ) ) / 2; break; } } else { dX = bo.getLeft( ) + ( bo.getWidth( ) - sz.getWidth( ) ) / 2; dY = bo.getTop( ) + ( bo.getHeight( ) - sz.getHeight( ) ) / 2; } } else { // USE PREVIOUSLY COMPUTED POSITION IN THE GENERATOR FOR LEGEND // 'INSIDE' PLOT dX = bo.getLeft( ); dY = bo.getTop( ); sz = SizeImpl.create( bo.getWidth( ), bo.getHeight( ) ); } // get cached legend info. final LegendLayoutHints lilh = rtc.getLegendLayoutHints( ); // consider legend title size. Label lgTitle = lg.getTitle( ); double lgTitleWidth = 0, lgTitleHeight = 0; double yOffset = 0, xOffset = 0, wOffset = 0, hOffset = 0; final boolean bRenderLegendTitle = lgTitle != null && lgTitle.isSetVisible( ) && lgTitle.isVisible( ); int iTitlePos = Position.ABOVE; if ( bRenderLegendTitle ) { lgTitle = LabelImpl.copyInstance( lgTitle ); if ( lilh != null ) { // use cached value Size titleSize = lilh.getTitleSize( ); lgTitleWidth = titleSize.getWidth( ); lgTitleHeight = titleSize.getHeight( ); } else { // handle external resource string final String sPreviousValue = lgTitle.getCaption( ).getValue( ); lgTitle.getCaption( ) .setValue( rtc.externalizedMessage( sPreviousValue ) ); BoundingBox bb = null; try { bb = Methods.computeBox( xs, IConstants.ABOVE, lgTitle, 0, 0 ); } catch ( IllegalArgumentException uiex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, uiex ); } lgTitleWidth = bb.getWidth( ); lgTitleHeight = bb.getHeight( ); } iTitlePos = lg.getTitlePosition( ).getValue( ); // swap left/right if ( isRightToLeft( ) ) { if ( iTitlePos == Position.LEFT ) { iTitlePos = Position.RIGHT; } else if ( iTitlePos == Position.RIGHT ) { iTitlePos = Position.LEFT; } } switch ( iTitlePos ) { case Position.ABOVE : yOffset = lgTitleHeight; hOffset = -yOffset; break; case Position.BELOW : hOffset = -lgTitleHeight; break; case Position.LEFT : xOffset = lgTitleWidth; wOffset = -xOffset; break; case Position.RIGHT : wOffset = -lgTitleWidth; break; } } // RENDER THE LEGEND CLIENT AREA final ClientArea ca = lg.getClientArea( ); final Insets lgIns = lg.getInsets( ).scaledInstance( dScale ); LineAttributes lia = ca.getOutline( ); bo = BoundsImpl.create( dX, dY, sz.getWidth( ), sz.getHeight( ) ); bo = bo.adjustedInstance( lgIns ); dX = bo.getLeft( ); dY = bo.getTop( ); // Adjust bounds. bo.delta( xOffset, yOffset, wOffset, hOffset ); dX = bo.getLeft( ); dY = bo.getTop( ); final double dBaseX = dX; final double dBaseY = dY; final RectangleRenderEvent rre = (RectangleRenderEvent) ( (EventObjectCache) ir ).getEventObject( StructureSource.createLegend( lg ), RectangleRenderEvent.class ); // render client area shadow. if ( ca.getShadowColor( ) != null ) { rre.setBounds( bo.translateInstance( 3, 3 ) ); rre.setBackground( ca.getShadowColor( ) ); ipr.fillRectangle( rre ); } // render client area rre.setBounds( bo ); rre.setOutline( lia ); rre.setBackground( ca.getBackground( ) ); ipr.fillRectangle( rre ); ipr.drawRectangle( rre ); lia = LineAttributesImpl.copyInstance( lia ); lia.setVisible( true ); // SEPARATOR LINES MUST BE VISIBLE LineAttributes liSep = lg.getSeparator( ) == null ? lia : lg.getSeparator( ); final SeriesDefinition[] seda = cm.getSeriesForLegend( ); // INITIALIZATION OF VARS USED IN FOLLOWING LOOPS final Orientation o = lg.getOrientation( ); final Direction d = lg.getDirection( ); final Label la = LabelImpl.create( ); la.setCaption( TextImpl.copyInstance( lg.getText( ) ) ); la.getCaption( ).setValue( "X" ); //$NON-NLS-1$ final ITextMetrics itm = xs.getTextMetrics( la ); final double maxWrappingSize = lg.getWrappingSize( ); final double dItemHeight = itm.getFullHeight( ); final double dHorizontalSpacing = 4; final double dVerticalSpacing = 4; double dSeparatorThickness = lia.getThickness( ); Insets insCA = ca.getInsets( ).scaledInstance( dScale ); Series seBase; ArrayList al; LegendItemRenderingHints lirh; Palette pa; int iPaletteCount; EList elPaletteEntries; Fill fPaletteEntry; final boolean bPaletteByCategory = ( cm.getLegend( ) .getItemType( ) .getValue( ) == LegendItemType.CATEGORIES ); // Get available maximum block width/height. Block bl = cm.getBlock( ); Bounds boFull = bl.getBounds( ).scaledInstance( dScale ); Insets ins = bl.getInsets( ).scaledInstance( dScale ); double dMaxX = boFull.getLeft( ) + boFull.getWidth( ) - ins.getRight( ) - lgIns.getRight( ); double dMaxY = boFull.getTop( ) + boFull.getHeight( ) - ins.getBottom( ) - lgIns.getBottom( ); // Calculate if minSlice applicable. String sMinSliceLabel = null; boolean bMinSliceApplied = false; if ( lilh != null ) { // use cached value. sMinSliceLabel = lilh.getMinSliceText( ); bMinSliceApplied = lilh.isMinSliceApplied( ); } else { boolean bMinSliceDefined = false; double dMinSlice = 0; boolean bPercentageMinSlice = false; if ( cm instanceof ChartWithoutAxes ) { bMinSliceDefined = ( (ChartWithoutAxes) cm ).isSetMinSlice( ); dMinSlice = ( (ChartWithoutAxes) cm ).getMinSlice( ); bPercentageMinSlice = ( (ChartWithoutAxes) cm ).isMinSlicePercent( ); sMinSliceLabel = ( (ChartWithoutAxes) cm ).getMinSliceLabel( ); if ( sMinSliceLabel == null || sMinSliceLabel.length( ) == 0 ) { sMinSliceLabel = IConstants.UNDEFINED_STRING; } else { sMinSliceLabel = rtc.externalizedMessage( sMinSliceLabel ); } } // calculate if need an extra legend item when minSlice defined. if ( bMinSliceDefined && bPaletteByCategory && cm instanceof ChartWithoutAxes ) { if ( !( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .isEmpty( ) ) { // OK TO ASSUME THAT 1 BASE SERIES DEFINITION EXISTS SeriesDefinition sdBase = (SeriesDefinition) ( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .get( 0 ); SeriesDefinition[] sdOrtho = (SeriesDefinition[]) sdBase.getSeriesDefinitions( ) .toArray( ); DataSetIterator dsiOrtho = null; double dCurrentMinSlice = 0; for ( int i = 0; i < sdOrtho.length && !bMinSliceApplied; i++ ) { try { dsiOrtho = new DataSetIterator( ( (Series) sdOrtho[i].getRunTimeSeries( ) .get( 0 ) ).getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, ex ); } // TODO Check dataset type, throw exception or ignore?. if ( bPercentageMinSlice ) { double total = 0; while ( dsiOrtho.hasNext( ) ) { Object obj = dsiOrtho.next( ); if ( obj instanceof Number ) { total += ( (Number) obj ).doubleValue( ); } } dsiOrtho.reset( ); dCurrentMinSlice = total * dMinSlice / 100d; } else { dCurrentMinSlice = dMinSlice; } while ( dsiOrtho.hasNext( ) ) { Object obj = dsiOrtho.next( ); if ( obj instanceof Number ) { double val = ( (Number) obj ).doubleValue( ); if ( val < dCurrentMinSlice ) { bMinSliceApplied = true; break; } } } } } } } // COMPUTATIONS HERE MUST BE IN SYNC WITH THE ACTUAL RENDERER if ( o.getValue( ) == Orientation.VERTICAL ) { double dXOffset = 0, dMaxW = 0; if ( bPaletteByCategory ) { SeriesDefinition sdBase = null; FormatSpecifier fs = null; if ( cm instanceof ChartWithAxes ) { // ONLY SUPPORT 1 BASE AXIS FOR NOW final Axis axPrimaryBase = ( (ChartWithAxes) cm ).getBaseAxes( )[0]; if ( axPrimaryBase.getSeriesDefinitions( ).isEmpty( ) ) { // NOTHING TO RENDER (BASE AXIS HAS NO SERIES // DEFINITIONS) return; } // OK TO ASSUME THAT 1 BASE SERIES DEFINITION EXISTS sdBase = (SeriesDefinition) axPrimaryBase.getSeriesDefinitions( ) .get( 0 ); } else if ( cm instanceof ChartWithoutAxes ) { if ( ( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .isEmpty( ) ) { // NOTHING TO RENDER (BASE AXIS HAS NO SERIES // DEFINITIONS) return; } // OK TO ASSUME THAT 1 BASE SERIES DEFINITION EXISTS sdBase = (SeriesDefinition) ( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .get( 0 ); } // OK TO ASSUME THAT 1 BASE RUNTIME SERIES EXISTS seBase = (Series) sdBase.getRunTimeSeries( ).get( 0 ); pa = sdBase.getSeriesPalette( ); elPaletteEntries = pa.getEntries( ); iPaletteCount = elPaletteEntries.size( ); if ( lilh != null && lilh.getLegendItemHints( ) != null ) { // use cached value LegendItemHints[] liha = lilh.getLegendItemHints( ); LegendItemHints lih; Map columnCache = searchMaxColumnWidth( liha ); for ( int i = 0; i < liha.length; i++ ) { // render each legend item. lih = liha[i]; if ( ( lih.getType( ) & IConstants.LEGEND_ENTRY ) == IConstants.LEGEND_ENTRY ) { la.getCaption( ).setValue( lih.getText( ) ); // CYCLE THROUGH THE PALETTE fPaletteEntry = (Fill) elPaletteEntries.get( lih.getCategoryIndex( ) % iPaletteCount ); lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); double columnWidth = bo.getWidth( ); Double cachedWidth = (Double) columnCache.get( lih ); if ( cachedWidth != null ) { columnWidth = cachedWidth.doubleValue( ) + 3 * dItemHeight / 2 + 2 * insCA.getLeft( ); } renderLegendItem( ipr, lg, la, null, dBaseX + lih.getLeft( ), dBaseY + lih.getTop( ) + insCA.getTop( ), lih.getWidth( ), dItemHeight, lih.getHeight( ), 0, columnWidth, insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); } } } else { DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( seBase.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, ex ); } if ( sdBase != null ) { fs = sdBase.getFormatSpecifier( ); } int i = 0; while ( dsiBase.hasNext( ) ) { Object obj = dsiBase.next( ); // TODO filter the not-used legend. // render legend item. dY += insCA.getTop( ); String lgtext = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, getRunTimeContext( ).getULocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la, maxWrappingSize ); // RECYCLED fPaletteEntry = (Fill) elPaletteEntries.get( i++ % iPaletteCount ); // CYCLE THROUGH THE PALETTE lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); if ( dY + itm.getFullHeight( ) + insCA.getBottom( ) > dMaxY ) { dXOffset += dMaxW + insCA.getLeft( ) + insCA.getRight( ) + ( 3 * dItemHeight ) / 2 + dHorizontalSpacing; dMaxW = 0; dY = bo.getTop( ) + insCA.getTop( ); dX = bo.getLeft( ) + dXOffset; } dMaxW = Math.max( dMaxW, itm.getFullWidth( ) ); renderLegendItem( ipr, lg, la, null, dX, dY, itm.getFullWidth( ), dItemHeight, itm.getFullHeight( ), 0, bo.getWidth( ), insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); dY += itm.getFullHeight( ) + insCA.getBottom( ); } // render the extra MinSlice legend item if applicable. if ( bMinSliceApplied ) { dY += insCA.getTop( ); la.getCaption( ).setValue( sMinSliceLabel ); itm.reuse( la, maxWrappingSize ); // RECYCLED fPaletteEntry = (Fill) elPaletteEntries.get( dsiBase.size( ) % iPaletteCount ); // CYCLE THROUGH THE PALETTE lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); if ( dY + itm.getFullHeight( ) + insCA.getBottom( ) > dMaxY ) { dXOffset += dMaxW + insCA.getLeft( ) + insCA.getRight( ) + ( 3 * dItemHeight ) / 2 + dHorizontalSpacing; dMaxW = 0; dY = bo.getTop( ) + insCA.getTop( ); dX = bo.getLeft( ) + dXOffset; } dMaxW = Math.max( dMaxW, itm.getFullWidth( ) ); renderLegendItem( ipr, lg, la, null, dX, dY, itm.getFullWidth( ), dItemHeight, itm.getFullHeight( ), 0, bo.getWidth( ), insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); dY += itm.getFullHeight( ) + insCA.getBottom( ); } } } else if ( d.getValue( ) == Direction.TOP_BOTTOM ) { if ( lilh != null && lilh.getLegendItemHints( ) != null ) { LegendItemHints[] liha = lilh.getLegendItemHints( ); LegendItemHints lih; int k = 0; Map columnCache = searchMaxColumnWidth( liha ); for ( int j = 0; j < seda.length; j++ ) { al = seda[j].getRunTimeSeries( ); pa = seda[j].getSeriesPalette( ); elPaletteEntries = pa.getEntries( ); iPaletteCount = elPaletteEntries.size( ); for ( int i = 0; i < al.size( ); i++ ) { seBase = (Series) al.get( i ); lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); lih = liha[k++]; if ( lih.getType( ) == IConstants.LEGEND_ENTRY ) { la.getCaption( ).setValue( lih.getText( ) ); Label valueLa = null; if ( lg.isShowValue( ) ) { valueLa = LabelImpl.copyInstance( seBase.getLabel( ) ); valueLa.getCaption( ) .setValue( lih.getExtraText( ) ); } // CYCLE THROUGH THE PALETTE fPaletteEntry = (Fill) elPaletteEntries.get( i % iPaletteCount ); double columnWidth = bo.getWidth( ); Double cachedWidth = (Double) columnCache.get( lih ); if ( cachedWidth != null ) { columnWidth = cachedWidth.doubleValue( ) + 3 * dItemHeight / 2 + 2 * insCA.getLeft( ); } renderLegendItem( ipr, lg, la, valueLa, dBaseX + lih.getLeft( ), dBaseY + lih.getTop( ) + insCA.getTop( ), lih.getWidth( ), dItemHeight, lih.getHeight( ), lih.getExtraHeight( ), columnWidth, insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); } } if ( j < seda.length - 1 ) { lih = liha[k]; if ( lih.getType( ) == IConstants.LEGEND_SEPERATOR ) { k++; renderSeparator( ipr, lg, liSep, dBaseX + lih.getLeft( ), dBaseY + lih.getTop( ), lih.getWidth( ), Orientation.HORIZONTAL_LITERAL ); } } } } else { dSeparatorThickness += dVerticalSpacing; for ( int j = 0; j < seda.length; j++ ) { al = seda[j].getRunTimeSeries( ); pa = seda[j].getSeriesPalette( ); elPaletteEntries = pa.getEntries( ); iPaletteCount = elPaletteEntries.size( ); FormatSpecifier fs = seda[j].getFormatSpecifier( ); for ( int i = 0; i < al.size( ); i++ ) { seBase = (Series) al.get( i ); lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); dY += insCA.getTop( ); Object obj = seBase.getSeriesIdentifier( ); String lgtext = rtc.externalizedMessage( String.valueOf( obj ) ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, getRunTimeContext( ).getULocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la, maxWrappingSize ); // RECYCLED double dFWidth = itm.getFullWidth( ); double dFHeight = itm.getFullHeight( ); Label valueLa = null; double valueHeight = 0; if ( lg.isShowValue( ) ) { DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( seBase.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, ex ); } // Use first value for each series. if ( dsiBase.hasNext( ) ) { obj = dsiBase.next( ); String valueText = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, ULocale.getDefault( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } valueLa = LabelImpl.copyInstance( seBase.getLabel( ) ); valueLa.getCaption( ).setValue( valueText ); itm.reuse( valueLa ); dFWidth = Math.max( dFWidth, itm.getFullWidth( ) ); valueHeight = itm.getFullHeight( ); } } if ( dY + dFHeight + valueHeight + 2 + insCA.getBottom( ) > dMaxY ) { dXOffset += dMaxW + insCA.getLeft( ) + insCA.getRight( ) + ( 3 * dItemHeight ) / 2 + dHorizontalSpacing; dMaxW = 0; dY = bo.getTop( ) + insCA.getTop( ); dX = bo.getLeft( ) + dXOffset; } dMaxW = Math.max( dMaxW, dFWidth ); fPaletteEntry = (Fill) elPaletteEntries.get( i % iPaletteCount ); // CYCLE THROUGH THE // PALETTE renderLegendItem( ipr, lg, la, valueLa, dX, dY, dFWidth, dItemHeight, dFHeight, valueHeight, bo.getWidth( ), insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); dY += dFHeight + insCA.getBottom( ) + valueHeight + 2; } if ( j < seda.length - 1 ) { renderSeparator( ipr, lg, liSep, dX, dY + dSeparatorThickness / 2, dMaxW + insCA.getLeft( ) + insCA.getRight( ) + ( 3 * dItemHeight ) / 2, Orientation.HORIZONTAL_LITERAL ); dY += dSeparatorThickness; } } } } else if ( d.getValue( ) == Direction.LEFT_RIGHT ) { if ( lilh != null && lilh.getLegendItemHints( ) != null ) { LegendItemHints[] liha = lilh.getLegendItemHints( ); LegendItemHints lih; int k = 0; Map columnCache = searchMaxColumnWidth( liha ); for ( int j = 0; j < seda.length; j++ ) { al = seda[j].getRunTimeSeries( ); pa = seda[j].getSeriesPalette( ); elPaletteEntries = pa.getEntries( ); iPaletteCount = elPaletteEntries.size( ); for ( int i = 0; i < al.size( ); i++ ) { seBase = (Series) al.get( i ); lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); lih = liha[k++]; if ( lih.getType( ) == IConstants.LEGEND_ENTRY ) { la.getCaption( ).setValue( lih.getText( ) ); Label valueLa = null; if ( lg.isShowValue( ) ) { valueLa = LabelImpl.copyInstance( seBase.getLabel( ) ); valueLa.getCaption( ) .setValue( lih.getExtraText( ) ); } // CYCLE THROUGH THE PALETTE fPaletteEntry = (Fill) elPaletteEntries.get( i % iPaletteCount ); double columnWidth = bo.getWidth( ); Double cachedWidth = (Double) columnCache.get( lih ); if ( cachedWidth != null ) { columnWidth = cachedWidth.doubleValue( ) + 3 * dItemHeight / 2 + 2 * insCA.getLeft( ); } renderLegendItem( ipr, lg, la, valueLa, dBaseX + lih.getLeft( ), dBaseY + lih.getTop( ) + insCA.getTop( ), lih.getWidth( ), dItemHeight, lih.getHeight( ), lih.getExtraHeight( ), columnWidth, insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); } } if ( j < seda.length - 1 ) { lih = liha[k]; if ( lih.getType( ) == IConstants.LEGEND_SEPERATOR ) { k++; renderSeparator( ipr, lg, liSep, dBaseX + lih.getLeft( ), dBaseY + lih.getTop( ), bo.getHeight( ), Orientation.VERTICAL_LITERAL ); } } } } else { dSeparatorThickness += dHorizontalSpacing; for ( int j = 0; j < seda.length; j++ ) { dMaxW = 0; al = seda[j].getRunTimeSeries( ); pa = seda[j].getSeriesPalette( ); elPaletteEntries = pa.getEntries( ); iPaletteCount = elPaletteEntries.size( ); FormatSpecifier fs = seda[j].getFormatSpecifier( ); for ( int i = 0; i < al.size( ); i++ ) { dY += insCA.getTop( ); seBase = (Series) al.get( i ); lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); Object obj = seBase.getSeriesIdentifier( ); String lgtext = rtc.externalizedMessage( String.valueOf( obj ) ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, getRunTimeContext( ).getULocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la, maxWrappingSize ); // RECYCLED double dFWidth = itm.getFullWidth( ); double dFHeight = itm.getFullHeight( ); Label valueLa = null; double valueHeight = 0; if ( lg.isShowValue( ) ) { DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( seBase.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, ex ); } // Use first value for each series. if ( dsiBase.hasNext( ) ) { obj = dsiBase.next( ); String valueText = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, ULocale.getDefault( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } valueLa = LabelImpl.copyInstance( seBase.getLabel( ) ); valueLa.getCaption( ).setValue( valueText ); itm.reuse( valueLa ); dFWidth = Math.max( dFWidth, itm.getFullWidth( ) ); valueHeight = itm.getFullHeight( ); } } if ( dY + dFHeight + valueHeight + 2 + insCA.getBottom( ) > dMaxY ) { dXOffset += dMaxW + insCA.getLeft( ) + insCA.getRight( ) + ( 3 * dItemHeight ) / 2 + dHorizontalSpacing; dMaxW = 0; dY = bo.getTop( ); dX = bo.getLeft( ) + dXOffset; } dMaxW = Math.max( dMaxW, dFWidth ); fPaletteEntry = (Fill) elPaletteEntries.get( i % iPaletteCount ); // CYCLE THROUGH THE // PALETTE renderLegendItem( ipr, lg, la, valueLa, dX, dY, dFWidth, dItemHeight, dFHeight, valueHeight, bo.getWidth( ), insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); dY += dFHeight + insCA.getBottom( ) + valueHeight + 2; } // LEFT INSETS + LEGEND ITEM WIDTH + HORIZONTAL SPACING // + // MAX ITEM WIDTH + RIGHT INSETS dXOffset += insCA.getLeft( ) + ( 3 * dItemHeight / 2 ) + dHorizontalSpacing + dMaxW + insCA.getRight( ); dX += insCA.getLeft( ) + ( 3 * dItemHeight / 2 ) + dHorizontalSpacing + dMaxW + insCA.getRight( ); dY = bo.getTop( ); // SETUP VERTICAL SEPARATOR SPACING if ( j < seda.length - 1 ) { renderSeparator( ipr, lg, liSep, dX + dSeparatorThickness / 2, dY, bo.getHeight( ), Orientation.VERTICAL_LITERAL ); dX += dSeparatorThickness; } } } } else { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, "exception.illegal.legend.direction", //$NON-NLS-1$ new Object[]{ d.getName( ) }, ResourceBundle.getBundle( Messages.ENGINE, rtc.getLocale( ) ) ); } } else if ( o.getValue( ) == Orientation.HORIZONTAL ) { double dYOffset = 0, dMaxH = 0; if ( bPaletteByCategory ) { SeriesDefinition sdBase = null; FormatSpecifier fs = null; if ( cm instanceof ChartWithAxes ) { // ONLY SUPPORT 1 BASE AXIS FOR NOW final Axis axPrimaryBase = ( (ChartWithAxes) cm ).getBaseAxes( )[0]; if ( axPrimaryBase.getSeriesDefinitions( ).isEmpty( ) ) { // NOTHING TO RENDER (BASE AXIS HAS NO SERIES // DEFINITIONS) return; } // OK TO ASSUME THAT 1 BASE SERIES DEFINITION EXISTS sdBase = (SeriesDefinition) axPrimaryBase.getSeriesDefinitions( ) .get( 0 ); } else if ( cm instanceof ChartWithoutAxes ) { if ( ( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .isEmpty( ) ) { // NOTHING TO RENDER (BASE AXIS HAS NO SERIES // DEFINITIONS) return; } // OK TO ASSUME THAT 1 BASE SERIES DEFINITION EXISTS sdBase = (SeriesDefinition) ( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .get( 0 ); } // OK TO ASSUME THAT 1 BASE RUNTIME SERIES EXISTS seBase = (Series) sdBase.getRunTimeSeries( ).get( 0 ); pa = sdBase.getSeriesPalette( ); elPaletteEntries = pa.getEntries( ); iPaletteCount = elPaletteEntries.size( ); if ( lilh != null && lilh.getLegendItemHints( ) != null ) { // use cached value LegendItemHints[] liha = lilh.getLegendItemHints( ); LegendItemHints lih; for ( int i = 0; i < liha.length; i++ ) { // render each legend item. lih = liha[i]; if ( ( lih.getType( ) & IConstants.LEGEND_ENTRY ) == IConstants.LEGEND_ENTRY ) { la.getCaption( ).setValue( lih.getText( ) ); // CYCLE THROUGH THE PALETTE fPaletteEntry = (Fill) elPaletteEntries.get( lih.getCategoryIndex( ) % iPaletteCount ); lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); renderLegendItem( ipr, lg, la, null, dBaseX + lih.getLeft( ), dBaseY + lih.getTop( ) + insCA.getTop( ), lih.getWidth( ), dItemHeight, lih.getHeight( ), 0, lih.getWidth( ) + 3 * dItemHeight / 2 + 2 * insCA.getLeft( ), insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); } } } else { DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( seBase.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, ex ); } if ( sdBase != null ) { fs = sdBase.getFormatSpecifier( ); } int i = 0; double dFullWidth = 0; dY += insCA.getTop( ); while ( dsiBase.hasNext( ) ) { Object obj = dsiBase.next( ); // TODO filter the not-used legend. dX += insCA.getLeft( ); String lgtext = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, getRunTimeContext( ).getULocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la, maxWrappingSize ); // RECYCLED fPaletteEntry = (Fill) elPaletteEntries.get( i++ % iPaletteCount ); // CYCLE THROUGH THE PALETTE lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); dFullWidth = itm.getFullWidth( ); if ( dX + dFullWidth + ( 3 * dItemHeight ) / 2 + insCA.getRight( ) > dMaxX ) { dYOffset += dMaxH + insCA.getTop( ) + insCA.getBottom( ) + dVerticalSpacing; dMaxH = 0; dX = bo.getLeft( ) + insCA.getLeft( ); dY = bo.getTop( ) + insCA.getTop( ) + dYOffset; } dMaxH = Math.max( dMaxH, itm.getFullHeight( ) ); renderLegendItem( ipr, lg, la, null, dX, dY, dFullWidth, dItemHeight, itm.getFullHeight( ), 0, dFullWidth + 3 * dItemHeight / 2 + 2 * insCA.getLeft( ), insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); dX += dFullWidth + ( 3 * dItemHeight ) / 2 + insCA.getRight( ); } // render the extra MinSlice legend item if applicable. if ( bMinSliceApplied ) { dX += insCA.getLeft( ); la.getCaption( ).setValue( sMinSliceLabel ); itm.reuse( la, maxWrappingSize ); // RECYCLED fPaletteEntry = (Fill) elPaletteEntries.get( dsiBase.size( ) % iPaletteCount ); // CYCLE THROUGH THE PALETTE lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); dFullWidth = itm.getFullWidth( ); if ( dX + dFullWidth + ( 3 * dItemHeight ) / 2 + insCA.getRight( ) > dMaxX ) { dYOffset += dMaxH + insCA.getTop( ) + insCA.getBottom( ) + dVerticalSpacing; dMaxH = 0; dX = bo.getLeft( ) + insCA.getLeft( ); dY = bo.getTop( ) + insCA.getTop( ) + dYOffset; } dMaxH = Math.max( dMaxH, itm.getFullHeight( ) ); renderLegendItem( ipr, lg, la, null, dX, dY, dFullWidth, dItemHeight, itm.getFullHeight( ), 0, dFullWidth + 3 * dItemHeight / 2 + 2 * insCA.getLeft( ), insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); dX += dFullWidth + ( 3 * dItemHeight ) / 2 + insCA.getRight( ); } } } else if ( d.getValue( ) == Direction.TOP_BOTTOM ) { if ( lilh != null && lilh.getLegendItemHints( ) != null ) { LegendItemHints[] liha = lilh.getLegendItemHints( ); LegendItemHints lih; int k = 0; for ( int j = 0; j < seda.length; j++ ) { al = seda[j].getRunTimeSeries( ); pa = seda[j].getSeriesPalette( ); elPaletteEntries = pa.getEntries( ); iPaletteCount = elPaletteEntries.size( ); for ( int i = 0; i < al.size( ); i++ ) { seBase = (Series) al.get( i ); lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); lih = liha[k++]; if ( lih.getType( ) == IConstants.LEGEND_ENTRY ) { la.getCaption( ).setValue( lih.getText( ) ); Label valueLa = null; if ( lg.isShowValue( ) ) { valueLa = LabelImpl.copyInstance( seBase.getLabel( ) ); valueLa.getCaption( ) .setValue( lih.getExtraText( ) ); } // CYCLE THROUGH THE PALETTE fPaletteEntry = (Fill) elPaletteEntries.get( i % iPaletteCount ); renderLegendItem( ipr, lg, la, valueLa, dBaseX + lih.getLeft( ), dBaseY + lih.getTop( ) + insCA.getTop( ), lih.getWidth( ), dItemHeight, lih.getHeight( ), lih.getExtraHeight( ), lih.getWidth( ) + 3 * dItemHeight / 2 + 2 * insCA.getLeft( ), insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); } } if ( j < seda.length - 1 ) { lih = liha[k]; if ( lih.getType( ) == IConstants.LEGEND_SEPERATOR ) { k++; renderSeparator( ipr, lg, liSep, dBaseX + lih.getLeft( ), dBaseY + lih.getTop( ), bo.getWidth( ), Orientation.HORIZONTAL_LITERAL ); } } } } else { dSeparatorThickness += dVerticalSpacing; for ( int j = 0; j < seda.length; j++ ) { dMaxH = 0; dY += insCA.getTop( ); dX = bo.getLeft( ) + insCA.getLeft( ); al = seda[j].getRunTimeSeries( ); pa = seda[j].getSeriesPalette( ); elPaletteEntries = pa.getEntries( ); iPaletteCount = elPaletteEntries.size( ); FormatSpecifier fs = seda[j].getFormatSpecifier( ); for ( int i = 0; i < al.size( ); i++ ) { seBase = (Series) al.get( i ); lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); Object obj = seBase.getSeriesIdentifier( ); String lgtext = rtc.externalizedMessage( String.valueOf( obj ) ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, getRunTimeContext( ).getULocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la, maxWrappingSize ); // RECYCLED double dFWidth = itm.getFullWidth( ); double dFHeight = itm.getFullHeight( ); Label valueLa = null; double valueHeight = 0; if ( lg.isShowValue( ) ) { DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( seBase.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, ex ); } // Use first value for each series. if ( dsiBase.hasNext( ) ) { obj = dsiBase.next( ); String valueText = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, ULocale.getDefault( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } valueLa = LabelImpl.copyInstance( seBase.getLabel( ) ); valueLa.getCaption( ).setValue( valueText ); itm.reuse( valueLa ); dFWidth = Math.max( dFWidth, itm.getFullWidth( ) ); valueHeight = itm.getFullHeight( ); } } if ( dX + insCA.getLeft( ) + dFWidth + ( 3 * dItemHeight ) / 2 + insCA.getRight( ) > dMaxX ) { dYOffset += dMaxH + insCA.getTop( ) + insCA.getBottom( ) + dVerticalSpacing; dMaxH = 0; dX = bo.getLeft( ) + insCA.getLeft( ); dY = bo.getTop( ) + insCA.getTop( ) + dYOffset; } dMaxH = Math.max( dMaxH, dFHeight + valueHeight + 2 ); fPaletteEntry = (Fill) elPaletteEntries.get( i % iPaletteCount ); // CYCLE THROUGH THE // PALETTE renderLegendItem( ipr, lg, la, valueLa, dX, dY, dFWidth, dItemHeight, dFHeight, valueHeight, dFWidth + 3 * dItemHeight / 2 + 2 * insCA.getLeft( ), insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); // LEFT INSETS + LEGEND ITEM WIDTH + HORIZONTAL // SPACING // + MAX ITEM WIDTH + RIGHT INSETS dX += insCA.getLeft( ) + ( 3 * dItemHeight ) / 2 + dFWidth + insCA.getRight( ); } dYOffset += insCA.getTop( ) + insCA.getBottom( ) + dMaxH + dVerticalSpacing; dY += insCA.getTop( ) + insCA.getBottom( ) + dMaxH + dVerticalSpacing; dX = bo.getLeft( ) + insCA.getLeft( ); // SETUP HORIZONTAL SEPARATOR SPACING if ( j < seda.length - 1 ) { renderSeparator( ipr, lg, liSep, dX, dY + dSeparatorThickness / 2, bo.getWidth( ), Orientation.HORIZONTAL_LITERAL ); dY += dSeparatorThickness; } } } } else if ( d.getValue( ) == Direction.LEFT_RIGHT ) { if ( lilh != null && lilh.getLegendItemHints( ) != null ) { LegendItemHints[] liha = lilh.getLegendItemHints( ); LegendItemHints lih; int k = 0; for ( int j = 0; j < seda.length; j++ ) { al = seda[j].getRunTimeSeries( ); pa = seda[j].getSeriesPalette( ); elPaletteEntries = pa.getEntries( ); iPaletteCount = elPaletteEntries.size( ); for ( int i = 0; i < al.size( ); i++ ) { seBase = (Series) al.get( i ); lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); lih = liha[k++]; if ( lih.getType( ) == IConstants.LEGEND_ENTRY ) { la.getCaption( ).setValue( lih.getText( ) ); Label valueLa = null; if ( lg.isShowValue( ) ) { valueLa = LabelImpl.copyInstance( seBase.getLabel( ) ); valueLa.getCaption( ) .setValue( lih.getExtraText( ) ); } // CYCLE THROUGH THE PALETTE fPaletteEntry = (Fill) elPaletteEntries.get( i % iPaletteCount ); renderLegendItem( ipr, lg, la, valueLa, dBaseX + lih.getLeft( ), dBaseY + lih.getTop( ) + insCA.getTop( ), lih.getWidth( ), dItemHeight, lih.getHeight( ), lih.getExtraHeight( ), lih.getWidth( ) + 3 * dItemHeight / 2 + 2 * insCA.getLeft( ), insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); } } if ( j < seda.length - 1 ) { lih = liha[k]; if ( lih.getType( ) == IConstants.LEGEND_SEPERATOR ) { k++; renderSeparator( ipr, lg, liSep, dBaseX + lih.getLeft( ), dBaseY + lih.getTop( ), lih.getHeight( ), Orientation.VERTICAL_LITERAL ); } } } } else { dSeparatorThickness += dHorizontalSpacing; dX += insCA.getLeft( ); dY += insCA.getTop( ); for ( int j = 0; j < seda.length; j++ ) { al = seda[j].getRunTimeSeries( ); pa = seda[j].getSeriesPalette( ); elPaletteEntries = pa.getEntries( ); iPaletteCount = elPaletteEntries.size( ); FormatSpecifier fs = seda[j].getFormatSpecifier( ); for ( int i = 0; i < al.size( ); i++ ) { seBase = (Series) al.get( i ); lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); Object obj = seBase.getSeriesIdentifier( ); String lgtext = rtc.externalizedMessage( String.valueOf( obj ) ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, getRunTimeContext( ).getULocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la, maxWrappingSize ); // RECYCLED double dFWidth = itm.getFullWidth( ); double dFHeight = itm.getFullHeight( ); Label valueLa = null; double valueHeight = 0; if ( lg.isShowValue( ) ) { DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( seBase.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, ex ); } // Use first value for each series. if ( dsiBase.hasNext( ) ) { obj = dsiBase.next( ); String valueText = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, ULocale.getDefault( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } valueLa = LabelImpl.copyInstance( seBase.getLabel( ) ); valueLa.getCaption( ).setValue( valueText ); itm.reuse( valueLa ); dFWidth = Math.max( dFWidth, itm.getFullWidth( ) ); valueHeight = itm.getFullHeight( ); } } if ( dX + insCA.getLeft( ) + dFWidth + ( 3 * dItemHeight ) / 2 + insCA.getRight( ) > dMaxX ) { dYOffset += dMaxH + insCA.getTop( ) + insCA.getBottom( ) + dVerticalSpacing; dMaxH = 0; dX = bo.getLeft( ) + insCA.getLeft( ); dY = bo.getTop( ) + dYOffset; } dMaxH = Math.max( dMaxH, dFHeight + valueHeight + 2 ); fPaletteEntry = (Fill) elPaletteEntries.get( i % iPaletteCount ); // CYCLE THROUGH THE // PALETTE renderLegendItem( ipr, lg, la, valueLa, dX, dY, dFWidth, dItemHeight, dFHeight, valueHeight, dFWidth + 3 * dItemHeight / 2 + 2 * insCA.getLeft( ), insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); // LEFT INSETS + LEGEND ITEM WIDTH + HORIZONTAL // SPACING // + MAX ITEM WIDTH + RIGHT INSETS dX += insCA.getLeft( ) + ( 3 * dItemHeight ) / 2 + dHorizontalSpacing + dFWidth + insCA.getRight( ); } // SETUP VERTICAL SEPARATOR SPACING if ( j < seda.length - 1 ) { renderSeparator( ipr, lg, liSep, dX + dSeparatorThickness / 2, dY, dMaxH, Orientation.VERTICAL_LITERAL ); dX += dSeparatorThickness; } } } } else { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, "exception.illegal.legend.direction", //$NON-NLS-1$ new Object[]{ d.getName( ) }, ResourceBundle.getBundle( Messages.ENGINE, rtc.getLocale( ) ) ); // i18n_CONCATENATIONS_REMOVED } } else { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, "exception.illegal.legend.orientation", //$NON-NLS-1$ new Object[]{ o.getName( ) }, ResourceBundle.getBundle( Messages.ENGINE, rtc.getLocale( ) ) ); } // Render legend title if defined. if ( bRenderLegendTitle ) { double lX = bo.getLeft( ); double lY = bo.getTop( ); switch ( iTitlePos ) { case Position.ABOVE : lX = bo.getLeft( ) + ( bo.getWidth( ) - lgTitleWidth ) / 2d; lY = bo.getTop( ) - lgTitleHeight; break; case Position.BELOW : lX = bo.getLeft( ) + ( bo.getWidth( ) - lgTitleWidth ) / 2d; lY = bo.getTop( ) + bo.getHeight( ); break; case Position.LEFT : lX = bo.getLeft( ) - lgTitleWidth; lY = bo.getTop( ) + ( bo.getHeight( ) - lgTitleHeight ) / 2d; break; case Position.RIGHT : lX = bo.getLeft( ) + bo.getWidth( ); lY = bo.getTop( ) + ( bo.getHeight( ) - lgTitleHeight ) / 2d; break; } final TextRenderEvent tre = (TextRenderEvent) ( (EventObjectCache) ir ).getEventObject( WrappedStructureSource.createLegendTitle( lg, lgTitle ), TextRenderEvent.class ); tre.setBlockBounds( BoundsImpl.create( lX, lY, lgTitleWidth, lgTitleHeight ) ); TextAlignment ta = TextAlignmentImpl.create( ); ta.setHorizontalAlignment( HorizontalAlignment.CENTER_LITERAL ); ta.setVerticalAlignment( VerticalAlignment.CENTER_LITERAL ); tre.setBlockAlignment( ta ); tre.setLabel( lgTitle ); tre.setAction( TextRenderEvent.RENDER_TEXT_IN_BLOCK ); ipr.drawText( tre ); } itm.dispose( ); // DISPOSE RESOURCES AFTER USE } | 46013 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46013/2d20506054849c42d48678ae5d0e59f9c37d95e8/BaseRenderer.java/buggy/chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/render/BaseRenderer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1743,
16812,
12,
467,
9840,
6747,
277,
683,
16,
17167,
409,
15266,
16,
1635,
14049,
3420,
414,
262,
1082,
202,
15069,
14804,
503,
202,
95,
202,
202,
430,
261,
401,
23623,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1743,
16812,
12,
467,
9840,
6747,
277,
683,
16,
17167,
409,
15266,
16,
1635,
14049,
3420,
414,
262,
1082,
202,
15069,
14804,
503,
202,
95,
202,
202,
430,
261,
401,
23623,
... |
catch (Exception se) | catch (Exception se) | public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Integer userId; // item id Integer itemId; // user id float minBuyNow; // minimum acceptable BuyNow for this item float BuyNow; // user BuyNow float maxBuyNow; // maximum BuyNow the user wants int maxQty; // maximum quantity available for this item int qty; // quantity asked by the user sp = new ServletPrinter(response, "StoreBuyNow"); /* Get and check all parameters */ String value = request.getParameter("userId"); if ((value == null) || (value.equals(""))) { printError("<h3>You must provide a user identifier !<br></h3>"); return ; } else userId = new Integer(value); value = request.getParameter("itemId"); if ((value == null) || (value.equals(""))) { printError("<h3>You must provide an item identifier !<br></h3>"); return ; } else itemId = new Integer(value); value = request.getParameter("maxQty"); if ((value == null) || (value.equals(""))) { printError("<h3>You must provide a maximum quantity !<br></h3>"); return ; } else { Integer foo = new Integer(value); maxQty = foo.intValue(); } value = request.getParameter("qty"); if ((value == null) || (value.equals(""))) { printError("<h3>You must provide a quantity !<br></h3>"); return ; } else { Integer foo = new Integer(value); qty = foo.intValue(); } /* Check for invalid values */ if (qty > maxQty) { printError("<h3>You cannot request "+qty+" items because only "+maxQty+" are proposed !<br></h3>"); return ; } try { initialContext = new InitialContext(); } catch (Exception e) { printError("Cannot get initial context for JNDI: " + e+"<br>"); return ; } // We want to start transactions from client UserTransaction utx = null; try { utx = (javax.transaction.UserTransaction)initialContext.lookup(Config.UserTransaction); utx.begin(); } catch (Exception e) { printError("Cannot lookup UserTransaction: "+e+"<br>"); return ; } // Try to find the Item corresponding to the Item ID Item item; try { ItemHome itemHome = (ItemHome)PortableRemoteObject.narrow(initialContext.lookup("ItemHome"), ItemHome.class); item = itemHome.findByPrimaryKey(new ItemPK(itemId)); item.setQuantity(item.getQuantity() - qty); if (item.getQuantity() == 0) item.setEndDate(TimeManagement.currentDateToString()); } catch (Exception e) { printError("Cannot update Item: " +e+"<br>"); try { utx.rollback(); } catch (Exception se) { printError("Transaction rollback failed: " + e +"<br>"); } return ; } try { BuyNowHome bHome = (BuyNowHome)PortableRemoteObject.narrow(initialContext.lookup("BuyNowHome"), BuyNowHome.class); edu.rice.rubis.beans.BuyNow b = bHome.create(userId, itemId, qty); utx.commit(); sp.printHTMLheader("RUBiS: BuyNow result"); if (qty == 1) sp.printHTML("<center><h2>Your have successfully bought this item.</h2></center>\n"); else sp.printHTML("<center><h2>Your have successfully bought these items.</h2></center>\n"); } catch (Exception e) { printError("Error while storing the BuyNow (got exception: " +e+")<br>"); try { utx.rollback(); } catch (Exception se) { printError("Transaction rollback failed: " + e +"<br>"); } return ; } sp.printHTMLfooter(); } | 5750 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5750/3d57ae5a342bc10d6c418636c07193a0289ffd6b/StoreBuyNow.java/buggy/EJB_EntityBean_id_BMP/edu/rice/rubis/beans/servlets/StoreBuyNow.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
741,
3349,
12,
2940,
18572,
590,
16,
12446,
766,
13,
1216,
1860,
16,
16517,
225,
288,
565,
2144,
6249,
31,
368,
761,
612,
565,
2144,
18424,
31,
368,
729,
612,
565,
1431,
282,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
741,
3349,
12,
2940,
18572,
590,
16,
12446,
766,
13,
1216,
1860,
16,
16517,
225,
288,
565,
2144,
6249,
31,
368,
761,
612,
565,
2144,
18424,
31,
368,
729,
612,
565,
1431,
282,... |
imcode.server.User user = getUserObj(req,res) ; | imcode.server.user.User user = getUserObj(req,res) ; | protected static boolean checkAdminRights(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { IMCServiceInterface imcref = IMCServiceRMI.getIMCServiceInterface(req) ; imcode.server.User user = getUserObj(req,res) ; if(user == null) { return false ; } else { return imcref.checkAdminRights(user) ; } } | 8781 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8781/9f7cf571ad8e7c19932f81f1b3ef8db152207741/Administrator.java/clean/servlets/Administrator.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
760,
1250,
866,
4446,
18464,
12,
2940,
18572,
1111,
16,
12446,
400,
13,
202,
15069,
16517,
16,
1860,
288,
202,
3445,
39,
18348,
709,
71,
1734,
273,
6246,
39,
1179,
54,
7492,
18,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
760,
1250,
866,
4446,
18464,
12,
2940,
18572,
1111,
16,
12446,
400,
13,
202,
15069,
16517,
16,
1860,
288,
202,
3445,
39,
18348,
709,
71,
1734,
273,
6246,
39,
1179,
54,
7492,
18,
5... |
inst.insertBefore(MIR_Move.create(IA32_MOV, M, R(nv))); | inst.insertBefore(MIR_Move.create(IA32_MOV, M, new OPT_RegisterOperand(nv, VM_TypeReference.Int))); | private void saveNonVolatiles(OPT_Instruction inst) { OPT_PhysicalRegisterSet phys = ir.regpool.getPhysicalRegisterSet(); int nNonvolatileGPRS = ir.compiledMethod.getNumberOfNonvolatileGPRs(); // Save each non-volatile GPR used by this method. int n = nNonvolatileGPRS - 1; for (Enumeration e = phys.enumerateNonvolatileGPRsBackwards(); e.hasMoreElements() && n >= 0 ; n--) { OPT_Register nv = (OPT_Register)e.nextElement(); int offset = getNonvolatileGPROffset(n); OPT_Operand M = new OPT_StackLocationOperand(true, -offset, 4); inst.insertBefore(MIR_Move.create(IA32_MOV, M, R(nv))); } } | 49871 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49871/34d593e20db098ebb2906460112536d78ee1592a/OPT_StackManager.java/buggy/rvm/src/vm/arch/intel/compilers/optimizing/regalloc/OPT_StackManager.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
918,
1923,
3989,
17431,
270,
1449,
12,
15620,
67,
11983,
1804,
13,
288,
565,
16456,
67,
18136,
3996,
694,
24758,
273,
9482,
18,
1574,
6011,
18,
588,
18136,
3996,
694,
5621,
565,
509... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1923,
3989,
17431,
270,
1449,
12,
15620,
67,
11983,
1804,
13,
288,
565,
16456,
67,
18136,
3996,
694,
24758,
273,
9482,
18,
1574,
6011,
18,
588,
18136,
3996,
694,
5621,
565,
509... |
if (tId == null && tgroup == null) return; | if (tId == null && tgroup == null) { return; } | protected void contributeToolbarAction(ActionDescriptor ad, IToolBarManager toolbar, boolean appendIfMissing) { // Get config data. String tId = ad.getToolbarId(); String tgroup = ad.getToolbarGroupId(); if (tId == null && tgroup == null) return; // Find reference group. if (tgroup == null) tgroup = IWorkbenchActionConstants.MB_ADDITIONS; IContributionItem sep = null; sep = toolbar.find(tgroup); if (sep == null) { if (appendIfMissing) { addGroup(toolbar, tgroup); } else { WorkbenchPlugin .log("Invalid Toolbar Extension (Group is invalid): " + ad.getId()); //$NON-NLS-1$ return; } } // Add action to tool bar. try { insertAfter(toolbar, tgroup, ad.getAction()); } catch (IllegalArgumentException e) { WorkbenchPlugin .log("Invalid Toolbar Extension (Group is missing): " + ad.getId()); //$NON-NLS-1$ } } | 55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/fa4a8cff0e027f8d3c6b1fcb92b30f46767dd191/PluginActionBuilder.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
4750,
918,
356,
887,
17907,
1803,
12,
1803,
3187,
1261,
16,
7734,
467,
6364,
5190,
1318,
12748,
16,
1250,
714,
2047,
4841,
13,
288,
5411,
368,
968,
642,
501,
18,
5411,
514,
268,
548,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
356,
887,
17907,
1803,
12,
1803,
3187,
1261,
16,
7734,
467,
6364,
5190,
1318,
12748,
16,
1250,
714,
2047,
4841,
13,
288,
5411,
368,
968,
642,
501,
18,
5411,
514,
268,
548,
27... |
public double getDouble(int field) throws FieldNotFound { String value = getField(field).getValue(); try { return DoubleConverter.convert(value); } catch (FieldConvertError e) { throw newIncorrectDataException(e, field); } } | 6791 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6791/ed98aa4c43f995af0db9d3ab676beb630d753e59/FieldMap.java/buggy/src/quickfix/FieldMap.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
9056,
588,
5265,
12,
474,
1518,
13,
15069,
974,
2768,
95,
780,
1132,
33,
588,
974,
12,
1518,
2934,
24805,
5621,
698,
95,
2463,
5265,
5072,
18,
6283,
12,
1132,
1769,
97,
14683,
12,
974,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
9056,
588,
5265,
12,
474,
1518,
13,
15069,
974,
2768,
95,
780,
1132,
33,
588,
974,
12,
1518,
2934,
24805,
5621,
698,
95,
2463,
5265,
5072,
18,
6283,
12,
1132,
1769,
97,
14683,
12,
974,... | ||
return new PasteNodeData(result, pointingOutReferences, modelProperties, necessaryLanguages, necessaryImports); | return new PasteNodeData(result, referencesRequireResolve, modelProperties, necessaryLanguages, necessaryImports); | public static PasteNodeData createNodeDataOut(List<SNode> sourceNodes, SModel model, SModel modelProperties, Set<String> necessaryLanguages, Set<SModelUID> necessaryImports) { if (sourceNodes.isEmpty()) return new PasteNodeData(new ArrayList<SNode>(), null, null, null, null); List<SNode> result = new ArrayList<SNode>(); model.setLoading(true); Set<SReference> pointingOutReferences = new HashSet<SReference>(); Map<SNode, SNode> sourceNodesToNewNodes = new HashMap<SNode, SNode>(); Set<SReference> allReferences = new HashSet<SReference>(); SModel originalModel = sourceNodes.get(0).getModel(); originalModel.setLoading(true); for (SNode sourceNode : sourceNodes) { assert sourceNode.getModel() == originalModel; SNode nodeToPaste = copyNode_internal(sourceNode, sourceNodesToNewNodes, allReferences); result.add(nodeToPaste); } SNode firstNodeToPaste = result.get(0); SModel fakeModel = firstNodeToPaste.getModel(); fakeModel.setLoading(true); for (SNode nodeToPaste : result) { nodeToPaste.changeModel(model); } processReferencesOut(sourceNodesToNewNodes, allReferences, pointingOutReferences); for (SNode nodeToPaste : result) { nodeToPaste.changeModel(model); } model.setLoading(false); originalModel.setLoading(false); fakeModel.setLoading(false); return new PasteNodeData(result, pointingOutReferences, modelProperties, necessaryLanguages, necessaryImports); } | 14939 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/14939/c57516210913b574690f94dfb1b3123292e7b331/CopyPasteUtil.java/buggy/source/jetbrains/mps/datatransfer/CopyPasteUtil.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
453,
14725,
23911,
752,
23911,
1182,
12,
682,
32,
55,
907,
34,
1084,
3205,
16,
348,
1488,
938,
16,
348,
1488,
938,
2297,
16,
1000,
32,
780,
34,
4573,
12912,
16,
1000,
32,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
453,
14725,
23911,
752,
23911,
1182,
12,
682,
32,
55,
907,
34,
1084,
3205,
16,
348,
1488,
938,
16,
348,
1488,
938,
2297,
16,
1000,
32,
780,
34,
4573,
12912,
16,
1000,
32,
5... |
openDesign( "CompatiblePublicOdaDriverProperties.xml" ); save(); assertTrue( compareFile( "CompatiblePublicOdaDriverProperties_golden.xml") ); | public void testPrivateOdaDriverProperties( ) throws Exception { openDesign( "CompatiblePrivateOdaDriverProperties.xml" ); //$NON-NLS-1$ save(); assertTrue( compareFile( "CompatiblePrivateOdaDriverProperties_golden.xml") );//$NON-NLS-1$ openDesign( "CompatiblePublicOdaDriverProperties.xml" ); //$NON-NLS-1$ save(); assertTrue( compareFile( "CompatiblePublicOdaDriverProperties_golden.xml") );//$NON-NLS-1$ } | 5230 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5230/172b2d92316f30282ab12ffaad5d23912936b8f3/ParserCompatibilityTest.java/clean/model/org.eclipse.birt.report.model.tests/test/org/eclipse/birt/report/model/parser/ParserCompatibilityTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1842,
6014,
51,
2414,
4668,
2297,
12,
262,
1216,
1185,
202,
95,
202,
202,
3190,
15478,
12,
315,
14599,
6014,
51,
2414,
4668,
2297,
18,
2902,
6,
11272,
4329,
3993,
17,
510... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6014,
51,
2414,
4668,
2297,
12,
262,
1216,
1185,
202,
95,
202,
202,
3190,
15478,
12,
315,
14599,
6014,
51,
2414,
4668,
2297,
18,
2902,
6,
11272,
4329,
3993,
17,
510... | |
return Collections.EMPTY_LIST; | return EMPTY_LIST; | public List childNodes() { return Collections.EMPTY_LIST; } | 48072 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/48072/b1293eda8454686e846e2a9837b348e2983bb423/ZArrayNode.java/clean/src/org/jruby/ast/ZArrayNode.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
987,
10582,
1435,
288,
3639,
327,
8984,
67,
7085,
31,
565,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
987,
10582,
1435,
288,
3639,
327,
8984,
67,
7085,
31,
565,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
globalState.getErr().println(ioe.toString()); | global.getErr().println(ioe.toString()); | public static Object evaluateReader(Context cx, Scriptable scope, Reader in, String sourceName, int lineno) { Object result = cx.getUndefinedValue(); try { result = cx.evaluateReader(scope, in, sourceName, lineno, null); } catch (WrappedException we) { globalState.getErr().println(we.getWrappedException().toString()); we.printStackTrace(); } catch (EcmaError ee) { String msg = ToolErrorReporter.getMessage( "msg.uncaughtJSException", ee.toString()); exitCode = EXITCODE_RUNTIME_ERROR; if (ee.getSourceName() != null) { Context.reportError(msg, ee.getSourceName(), ee.getLineNumber(), ee.getLineSource(), ee.getColumnNumber()); } else { Context.reportError(msg); } } catch (EvaluatorException ee) { // Already printed message. exitCode = EXITCODE_RUNTIME_ERROR; } catch (JavaScriptException jse) { // Need to propagate ThreadDeath exceptions. Object value = jse.getValue(); if (value instanceof ThreadDeath) throw (ThreadDeath) value; exitCode = EXITCODE_RUNTIME_ERROR; Context.reportError(ToolErrorReporter.getMessage( "msg.uncaughtJSException", jse.getMessage())); } catch (IOException ioe) { globalState.getErr().println(ioe.toString()); } finally { try { in.close(); } catch (IOException ioe) { globalState.getErr().println(ioe.toString()); } } return result; } | 47345 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47345/dcc50b2477b2063c90c140b044bec59ee39d93a0/Main.java/buggy/org/mozilla/javascript/tools/shell/Main.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
1033,
5956,
2514,
12,
1042,
9494,
16,
22780,
2146,
16,
29159,
5393,
316,
16,
514,
28337,
16,
29159,
509,
7586,
13,
565,
288,
3639,
1033,
563,
273,
9494,
18,
588,
10317,
620,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
1033,
5956,
2514,
12,
1042,
9494,
16,
22780,
2146,
16,
29159,
5393,
316,
16,
514,
28337,
16,
29159,
509,
7586,
13,
565,
288,
3639,
1033,
563,
273,
9494,
18,
588,
10317,
620,
... |
out.print(ma.getUID()); | out.print(ac.getUID()); | private void writeForm( PrintWriter out) throws IOException { // begin form out.print("<form method=\"GET\" action=\""); out.print(request.getRequestURI()); out.print("\">\n"); // show the current time out.print("<i>Time: "); out.print(new Date()); out.print("</i><p>"); out.print( "<h2>"+ "Local MoveAgent Objects:</h2><p>"); // show current MoveAgent objects Collection c = queryMoveAgents(); int n = ((c != null) ? c.size() : 0); if (n == 0) { out.print("<i>none</i>"); } else { out.print( "<table border=1 cellpadding=1\n"+ " cellspacing=1 width=95%\n"+ " bordercolordark=#660000 bordercolorlight=#cc9966>\n"+ "<tr>"+ "<td>\n"+ "<font size=+1 color=mediumblue><b>UID</b></font>"+ "</td>"+ "<td>"+ "<font size=+1 color=mediumblue><b>Ticket</b></font>"+ "</td>"+ "<td>"+ "<font size=+1 color=mediumblue><b>Status</b></font>"+ "</td>"+ "</tr>\n"); Iterator iter = c.iterator(); for (int i = 0; i < n; i++) { MoveAgent ma = (MoveAgent) iter.next(); out.print("<tr><td>"); out.print(ma.getUID()); out.print("</td><td>"); out.print(ma.getTicket()); out.print("</td><td bgcolor=\""); MoveAgent.Status status = ma.getStatus(); if (status == null) { out.print( "#FFFFBB\">"+ // yellow "In progress"); } else { out.print( (status.getCode() == MoveAgent.Status.OKAY) ? "#BBFFBB\">" : // green "#FFBBBB\">"); // red out.print(status); } out.print("</td></tr>\n"); } out.print("</table>\n"); } out.print( "<p><input type=\"submit\" name=\""+ ACTION_PARAM+ "\" value=\""+ REFRESH_VALUE+ "\">\n"); // allow user to remove an existing MoveAgent out.print( "<p><hr><p>"+ "<h2>Remove an existing move request:</h2>\n"); if (n > 0) { out.print( "<select name=\""+ REMOVE_UID_PARAM+ "\">"); Iterator iter = c.iterator(); for (int i = 0; i < n; i++) { MoveAgent ma = (MoveAgent) iter.next(); UID uid = ma.getUID(); out.print("<option value=\""); out.print(uid); out.print("\">"); out.print(uid); out.print("</option>"); } out.print( "</select>"+ "<input type=\"submit\" name=\""+ ACTION_PARAM+ "\" value=\""+ REMOVE_VALUE+ "\">\n"); } else { out.print("<i>none</i>"); } // allow user to submit a new MoveAgent request out.print( "<p>"+ "<h2>Create a new agent-movement request:</h2>\n"); out.print( "<table>\n"+ "<tr><td>"+ "Mobile Agent"+ "</td><td>\n"+ "<input type=\"text\" name=\""+ MOBILE_AGENT_PARAM+ "\" size=70"); if (mobileAgent != null) { out.print(" value=\""); out.print(mobileAgent); out.print("\""); } out.print( ">"+ "</td></tr>\n"+ "<tr><td>"+ "Origin Node"+ "</td><td>"+ "<input type=\"text\" name=\""+ ORIGIN_NODE_PARAM+ "\" size=70"); if (originNode != null) { out.print(" value=\""); out.print(originNode); out.print("\""); } out.print( ">"+ "</td></tr>\n"+ "<tr><td>"+ "Destination Node"+ "</td><td>"+ "<input type=\"text\" name=\""+ DEST_NODE_PARAM+ "\" size=70"); if (destNode != null) { out.print(" value=\""); out.print(destNode); out.print("\""); } out.print( ">"+ "</td></tr>\n"+ "<tr><td>"+ "Force Restart"+ "</td><td>"+ "<select name=\""+ IS_FORCE_RESTART_PARAM+ "\">"+ "<option value=\"true\""); if (isForceRestart) { out.print(" selected"); } out.print( ">true</option>"+ "<option value=\"false\""); if (!(isForceRestart)) { out.print(" selected"); } out.print( ">false</option>"+ "</select>\n"+ "</td></tr>\n"+ "<tr><td colwidth=2>"+ "<input type=\"submit\" name=\""+ ACTION_PARAM+ "\" value=\""+ ADD_VALUE+ "\">"+ "<input type=\"reset\">"+ "</td></tr>\n"+ "</table>\n"+ "</form>\n"); } | 7981 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7981/5771f339b6d2a0a1b2a246499efaa8f9773fa486/MoveAgentServlet.java/buggy/core/src/org/cougaar/core/mobility/servlet/MoveAgentServlet.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4202,
3238,
918,
1045,
1204,
12,
1850,
14071,
596,
13,
1216,
1860,
288,
3639,
368,
2376,
646,
3639,
596,
18,
1188,
2932,
32,
687,
707,
5189,
3264,
2412,
1301,
5189,
8863,
3639,
596,
18,
1188,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3238,
918,
1045,
1204,
12,
1850,
14071,
596,
13,
1216,
1860,
288,
3639,
368,
2376,
646,
3639,
596,
18,
1188,
2932,
32,
687,
707,
5189,
3264,
2412,
1301,
5189,
8863,
3639,
596,
18,
1188,
... |
private Object[] getIds(boolean getAll) { if (slots == null) return ScriptRuntime.emptyArgs; int count = 0; for (int i=slots.length-1; i >= 0; i--) { Slot slot = slots[i]; if (slot == null || slot == REMOVED) continue; if (getAll || (slot.attributes & DONTENUM) == 0) count++; } Object[] result = new Object[count]; for (int i=slots.length-1; i >= 0; i--) { Slot slot = slots[i]; if (slot == null || slot == REMOVED) continue; if (getAll || (slot.attributes & DONTENUM) == 0) result[--count] = slot.stringKey != null ? (Object) slot.stringKey : new Integer(slot.intKey); } return result; | public Object[] getIds() { return getIds(false); | private Object[] getIds(boolean getAll) { if (slots == null) return ScriptRuntime.emptyArgs; int count = 0; for (int i=slots.length-1; i >= 0; i--) { Slot slot = slots[i]; if (slot == null || slot == REMOVED) continue; if (getAll || (slot.attributes & DONTENUM) == 0) count++; } Object[] result = new Object[count]; for (int i=slots.length-1; i >= 0; i--) { Slot slot = slots[i]; if (slot == null || slot == REMOVED) continue; if (getAll || (slot.attributes & DONTENUM) == 0) result[--count] = slot.stringKey != null ? (Object) slot.stringKey : new Integer(slot.intKey); } return result; } | 54155 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54155/032b7f4436573637adbecdd4a87a1f7f49395249/ScriptableObject.java/buggy/js/rhino/org/mozilla/javascript/ScriptableObject.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
1033,
8526,
2634,
87,
12,
6494,
5514,
13,
288,
3639,
309,
261,
18875,
422,
446,
13,
5411,
327,
7739,
5576,
18,
5531,
2615,
31,
3639,
509,
1056,
273,
374,
31,
3639,
364,
261,
474,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1033,
8526,
2634,
87,
12,
6494,
5514,
13,
288,
3639,
309,
261,
18875,
422,
446,
13,
5411,
327,
7739,
5576,
18,
5531,
2615,
31,
3639,
509,
1056,
273,
374,
31,
3639,
364,
261,
474,
... |
void handle(Callback callback) throws IOException, UnsupportedCallbackException; | void handle(Callback callback) throws IOException, UnsupportedCallbackException; | void handle(Callback callback) throws IOException, UnsupportedCallbackException; | 14678 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/14678/e006f521f44c502299cf2412ebd71c5efd8645ba/JaasAuthenticationCallbackHandler.java/buggy/core/src/main/java/org/acegisecurity/providers/jaas/JaasAuthenticationCallbackHandler.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
918,
1640,
12,
2428,
1348,
13,
1216,
1860,
16,
7221,
2428,
503,
31,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
918,
1640,
12,
2428,
1348,
13,
1216,
1860,
16,
7221,
2428,
503,
31,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
private void writeFile(FileSystem fs, File name) throws IOException { | private void writeFile(FileSystem fs, Path name) throws IOException { | private void writeFile(FileSystem fs, File name) throws IOException { FSDataOutputStream stm = fs.create(name); stm.writeBytes("42\n"); stm.close(); } | 50370 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50370/ee01fef4b4fb82c7492a4a747793839a4d14cd39/TestLocalFileSystem.java/buggy/src/test/org/apache/hadoop/fs/TestLocalFileSystem.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
918,
13286,
12,
11785,
2662,
16,
2666,
508,
13,
1216,
1860,
288,
565,
9247,
751,
4632,
28358,
273,
2662,
18,
2640,
12,
529,
1769,
565,
28358,
18,
2626,
2160,
2932,
9452,
64,
82,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
918,
13286,
12,
11785,
2662,
16,
2666,
508,
13,
1216,
1860,
288,
565,
9247,
751,
4632,
28358,
273,
2662,
18,
2640,
12,
529,
1769,
565,
28358,
18,
2626,
2160,
2932,
9452,
64,
82,
8... |
return MOVE_REDUCED; | return DefUseEffect.MOVE_REDUCED; | private static byte refAnd(OPT_Instruction s) { if (CF_ADDR) { canonicalizeCommutativeOperator(s); OPT_Operand op1 = Binary.getVal1(s); OPT_Operand op2 = Binary.getVal2(s); if (op1.similar(op2)) { // THE SAME OPERAND: x & x == x Move.mutate(s, REF_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return op1.isConstant() ? MOVE_FOLDED : MOVE_REDUCED; } if (op2.isAddressConstant()) { Word val2 = op2.asAddressConstant().value.toWord(); if (op1.isAddressConstant()) { // BOTH CONSTANTS: FOLD Word val1 = op1.asAddressConstant().value.toWord(); Move.mutate(s, REF_MOVE, Binary.getClearResult(s), AC(val1.and(val2).toAddress())); return MOVE_FOLDED; } else { // ONLY OP2 IS CONSTANT: ATTEMPT TO APPLY AXIOMS if (val2.isZero()) { // x & 0 == 0 Move.mutate(s, REF_MOVE, Binary.getClearResult(s), AC(Address.zero())); return MOVE_FOLDED; } if (val2.isMax()) { // x & -1 == x & 0xffffffff == x Move.mutate(s, REF_MOVE, Binary.getClearResult(s), Binary.getClearVal1(s)); return MOVE_REDUCED; } } } } return UNCHANGED; } | 4011 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4011/582eb14323a5e74a2c99b6035e34aa59e229d896/OPT_Simplifier.java/clean/rvm/src/com/ibm/jikesrvm/opt/OPT_Simplifier.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
760,
1160,
1278,
1876,
12,
15620,
67,
11983,
272,
13,
288,
282,
309,
261,
8955,
67,
14142,
13,
288,
1377,
25839,
799,
10735,
1535,
5592,
12,
87,
1769,
1377,
16456,
67,
10265,
1061,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
760,
1160,
1278,
1876,
12,
15620,
67,
11983,
272,
13,
288,
282,
309,
261,
8955,
67,
14142,
13,
288,
1377,
25839,
799,
10735,
1535,
5592,
12,
87,
1769,
1377,
16456,
67,
10265,
1061,
... |
text.addListener(SWT.Traverse, new Listener() { | traverseListener = new Listener() { | public Control createControl(Composite parent) { Text text = (Text) super.createControl(parent); text.addListener(SWT.Traverse, new Listener() { public void handleEvent(Event e) { // do whatever it is you want to do on commit handleEnter(); // this will prevent the return from // traversing to the button e.doit = false; } }); return text; } | 14404 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/14404/7beced095a034e650bd7d7879559a6381932f19e/ModifiedTextCellEditor.java/buggy/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/ModifiedTextCellEditor.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
8888,
752,
3367,
12,
9400,
982,
13,
288,
202,
202,
1528,
977,
273,
261,
1528,
13,
2240,
18,
2640,
3367,
12,
2938,
1769,
202,
202,
955,
18,
1289,
2223,
12,
55,
8588,
18,
2965... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8888,
752,
3367,
12,
9400,
982,
13,
288,
202,
202,
1528,
977,
273,
261,
1528,
13,
2240,
18,
2640,
3367,
12,
2938,
1769,
202,
202,
955,
18,
1289,
2223,
12,
55,
8588,
18,
2965... |
public MetaClass newSingletonClass(RubyModule parent) { MetaClass newClass = new MetaClass(getRuntime(), this, parent); | public MetaClass newSingletonClass(SinglyLinkedList parentCRef) { MetaClass newClass = new MetaClass(getRuntime(), this, parentCRef); | public MetaClass newSingletonClass(RubyModule parent) { MetaClass newClass = new MetaClass(getRuntime(), this, parent); newClass.infectBy(this); return newClass; } | 46217 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46217/a1b8fc1d456e3d5c6e01579b88773383068aa85c/RubyClass.java/buggy/src/org/jruby/RubyClass.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
6565,
797,
394,
19571,
797,
12,
54,
10340,
3120,
982,
13,
288,
3639,
6565,
797,
394,
797,
273,
394,
6565,
797,
12,
588,
5576,
9334,
333,
16,
982,
1769,
3639,
394,
797,
18,
10625,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
6565,
797,
394,
19571,
797,
12,
54,
10340,
3120,
982,
13,
288,
3639,
6565,
797,
394,
797,
273,
394,
6565,
797,
12,
588,
5576,
9334,
333,
16,
982,
1769,
3639,
394,
797,
18,
10625,
... |
public void publish(Object impl, String service, PublicationDescription publicationDescription) throws PublicationException { invocationHandlerDelegate.publish(impl, service, publicationDescription); | public void publish(Object impl, String service, Class primaryFacade) throws PublicationException { invokerDelegate.publish(impl, service, primaryFacade); | public void publish(Object impl, String service, PublicationDescription publicationDescription) throws PublicationException { invocationHandlerDelegate.publish(impl, service, publicationDescription); } | 6329 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6329/12919d727ef78207867560614faba33a1beee2b1/StatefulServer.java/clean/jremoting/trunk/server/src/java/org/codehaus/jremoting/server/transports/StatefulServer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
3808,
12,
921,
9380,
16,
514,
1156,
16,
7224,
367,
3291,
20574,
3291,
13,
1216,
7224,
29304,
288,
3639,
9495,
1503,
9586,
18,
6543,
12,
11299,
16,
1156,
16,
20574,
3291,
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,
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,
918,
3808,
12,
921,
9380,
16,
514,
1156,
16,
7224,
367,
3291,
20574,
3291,
13,
1216,
7224,
29304,
288,
3639,
9495,
1503,
9586,
18,
6543,
12,
11299,
16,
1156,
16,
20574,
3291,
1769,
... |
public void setShowSuccess( final boolean showSuccess ) { createArg().setValue( "-s=" + showSuccess ); | public void setShowSuccess(final boolean showSuccess) { createArg().setValue("-s=" + showSuccess); | public void setShowSuccess( final boolean showSuccess ) { createArg().setValue( "-s=" + showSuccess ); } | 506 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/506/c6c232893c39257745a8f7a618bcdb5c59791cae/Test.java/clean/src/main/org/apache/tools/ant/taskdefs/optional/Test.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
444,
5706,
4510,
12,
727,
1250,
2405,
4510,
262,
288,
3639,
752,
4117,
7675,
542,
620,
12,
3701,
87,
1546,
397,
2405,
4510,
11272,
565,
289,
225,
2,
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,
0,
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,
918,
444,
5706,
4510,
12,
727,
1250,
2405,
4510,
262,
288,
3639,
752,
4117,
7675,
542,
620,
12,
3701,
87,
1546,
397,
2405,
4510,
11272,
565,
289,
225,
2,
-100,
-100,
-100,
-100,
-... |
generateReturnResult(cfw, retType); | generateReturnResult(cfw, returnType); | private static void generateMethod(ClassFileWriter cfw, String genName, String methodName, Class[] parms, Class returnType) { StringBuffer sb = new StringBuffer(); sb.append('('); short arrayLocal = 1; // includes this. for (int i = 0; i < parms.length; i++) { Class type = parms[i]; appendTypeString(sb, type); if (type.equals(Long.TYPE) || type.equals(Double.TYPE)) arrayLocal += 2; else arrayLocal += 1; } sb.append(')'); appendTypeString(sb, returnType); String methodSignature = sb.toString(); // System.out.println("generating " + m.getName() + methodSignature); // System.out.flush(); cfw.startMethod(methodName, methodSignature, ClassFileWriter.ACC_PUBLIC); cfw.add(ByteCode.BIPUSH, (byte) parms.length); // > 255 parms? cfw.add(ByteCode.ANEWARRAY, "java/lang/Object"); cfw.add(ByteCode.ASTORE, arrayLocal); // allocate a local variable to store the scope used to wrap native objects. short scopeLocal = (short) (arrayLocal + 1); boolean loadedScope = false; int paramOffset = 1; for (int i = 0; i < parms.length; i++) { cfw.add(ByteCode.ALOAD, arrayLocal); cfw.add(ByteCode.BIPUSH, i); if (parms[i].isPrimitive()) { paramOffset = generateWrapParam(cfw, paramOffset, parms[i]); } else { // An arbitary Java object; call Context.toObject to wrap in // a Scriptable object cfw.add(ByteCode.ALOAD, paramOffset++); if (! loadedScope) { // load this.self into a local the first time it's needed. // it will provide the scope needed by Context.toObject(). cfw.add(ByteCode.ALOAD_0); cfw.add(ByteCode.GETFIELD, genName, "self", "Lorg/mozilla/javascript/Scriptable;"); cfw.add(ByteCode.ASTORE, scopeLocal); loadedScope = true; } cfw.add(ByteCode.ALOAD, scopeLocal); // Get argument Class cfw.addLoadConstant(parms[i].getName()); cfw.add(ByteCode.INVOKESTATIC, "org/mozilla/javascript/ScriptRuntime", "loadClassName", "(Ljava/lang/String;)", "Ljava/lang/Class;"); cfw.add(ByteCode.INVOKESTATIC, "org/mozilla/javascript/JavaAdapter", "toObject", "(Ljava/lang/Object;" + "Lorg/mozilla/javascript/Scriptable;" + "Ljava/lang/Class;)", "Lorg/mozilla/javascript/Scriptable;"); } cfw.add(ByteCode.AASTORE); } cfw.add(ByteCode.ALOAD_0); // this cfw.add(ByteCode.GETFIELD, genName, "self", "Lorg/mozilla/javascript/Scriptable;"); cfw.addLoadConstant(methodName); cfw.add(ByteCode.ALOAD, arrayLocal); // go through utility method, which creates a Context to run the // method in. cfw.add(ByteCode.INVOKESTATIC, "org/mozilla/javascript/JavaAdapter", "callMethod", "(Lorg/mozilla/javascript/Scriptable;" + "Ljava/lang/String;[Ljava/lang/Object;)", "Ljava/lang/Object;"); Class retType = returnType; if (retType.equals(Void.TYPE)) { cfw.add(ByteCode.POP); cfw.add(ByteCode.RETURN); } else { generateReturnResult(cfw, retType); } cfw.stopMethod((short)(scopeLocal + 1), null); } | 51996 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51996/561cf27d9800e6f27583c1f2241f29d0ace7e910/JavaAdapter.java/clean/js/rhino/org/mozilla/javascript/JavaAdapter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
760,
918,
2103,
1305,
12,
797,
812,
2289,
6080,
91,
16,
514,
3157,
461,
16,
4766,
3639,
514,
4918,
16,
1659,
8526,
17902,
16,
4766,
4202,
1659,
9424,
13,
377,
288,
3639,
6674,
239... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1305,
12,
797,
812,
2289,
6080,
91,
16,
514,
3157,
461,
16,
4766,
3639,
514,
4918,
16,
1659,
8526,
17902,
16,
4766,
4202,
1659,
9424,
13,
377,
288,
3639,
6674,
239... |
private DefaultThreadPool configThreadPool( final Configuration config ) throws ConfigurationException { final String name = config.getChild( "name" ).getValue( ); final int queueSize = config.getChild( "queue-size" ).getValueAsInteger( DEFAULT_QUEUE_SIZE ); final int maxPoolSize = config.getChild( "max-pool-size" ).getValueAsInteger( DEFAULT_MAX_POOL_SIZE ); int minPoolSize = config.getChild( "min-pool-size" ).getValueAsInteger( DEFAULT_MIN_POOL_SIZE ); // make sure we have enough threads for the default thread pool as we // need one for ourself if( DEFAULT_THREADPOOL_NAME.equals( name ) && ( ( minPoolSize > 0 ) && ( minPoolSize < DEFAULT_MIN_POOL_SIZE ) ) ) { minPoolSize = DEFAULT_MIN_POOL_SIZE; } final String priority = config.getChild( "priority" ).getValue( DEFAULT_THREAD_PRIORITY ); final boolean isDaemon = config.getChild( "daemon" ).getValueAsBoolean( DEFAULT_DAEMON_MODE ); final long keepAliveTime = config.getChild( "keep-alive-time-ms" ).getValueAsLong( DEFAULT_KEEP_ALIVE_TIME ); final String blockPolicy = config.getChild( "block-policy" ).getValue( DefaultThreadPool.POLICY_DEFAULT ); final boolean shutdownGraceful = config.getChild( "shutdown-graceful" ).getValueAsBoolean( DEFAULT_SHUTDOWN_GRACEFUL ); final int shutdownWaitTime = config.getChild( "shutdown-wait-time-ms" ).getValueAsInteger( DEFAULT_SHUTDOWN_WAIT_TIME ); return createPool( new DefaultThreadPool( ), name, queueSize, maxPoolSize, minPoolSize, getPriority( priority ), isDaemon, keepAliveTime, blockPolicy, shutdownGraceful, shutdownWaitTime ); } | 46428 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46428/f0f74af4d50bbf3663fb4c99ebd3f794a844926b/DefaultRunnableManager.java/buggy/src/java/org/apache/cocoon/components/thread/DefaultRunnableManager.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
2989,
20621,
642,
20621,
12,
727,
4659,
642,
262,
3639,
1216,
22196,
565,
288,
3639,
727,
514,
508,
273,
642,
18,
588,
1763,
12,
315,
529,
6,
262,
18,
24805,
12,
225,
11272,
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,
3238,
2989,
20621,
642,
20621,
12,
727,
4659,
642,
262,
3639,
1216,
22196,
565,
288,
3639,
727,
514,
508,
273,
642,
18,
588,
1763,
12,
315,
529,
6,
262,
18,
24805,
12,
225,
11272,
3639,... | ||
case Element.ALIGN_LEFT: w[0] = left; break; case Element.ALIGN_RIGHT: w[0] = left + (totalWidth * (100 - widthPercentage)) / 100; break; case Element.ALIGN_CENTER: default: w[0] = left + (totalWidth * (100 - widthPercentage)) / 200; | case Element.ALIGN_LEFT: w[0] = left; break; case Element.ALIGN_RIGHT: w[0] = left + (totalWidth * (100 - widthPercentage)) / 100; break; case Element.ALIGN_CENTER: default: w[0] = left + (totalWidth * (100 - widthPercentage)) / 200; | public float[] getWidths(float left, float totalWidth) { // for x columns, there are x+1 borders float[] w = new float[columns + 1]; // the border at the left is calculated switch(alignment) { case Element.ALIGN_LEFT: w[0] = left; break; case Element.ALIGN_RIGHT: w[0] = left + (totalWidth * (100 - widthPercentage)) / 100; break; case Element.ALIGN_CENTER: default: w[0] = left + (totalWidth * (100 - widthPercentage)) / 200; } // the total available width is changed totalWidth = (totalWidth * widthPercentage) / 100; // the inner borders are calculated for (int i = 1; i < columns; i++) { w[i] = w[i - 1] + (widths[i - 1] * totalWidth / 100); } // the border at the right is calculated w[columns] = w[0] + totalWidth; return w; } | 6653 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6653/a153fa3650ccb0f85276e5a6a346675f3f3c045a/Table.java/clean/src/com/lowagie/text/Table.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1431,
8526,
8557,
87,
12,
5659,
2002,
16,
1431,
2078,
2384,
13,
288,
3639,
368,
364,
619,
2168,
16,
1915,
854,
619,
15,
21,
24028,
3639,
1431,
8526,
341,
273,
394,
1431,
63,
5112,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1431,
8526,
8557,
87,
12,
5659,
2002,
16,
1431,
2078,
2384,
13,
288,
3639,
368,
364,
619,
2168,
16,
1915,
854,
619,
15,
21,
24028,
3639,
1431,
8526,
341,
273,
394,
1431,
63,
5112,... |
public V removeLRUEntry() { | public V removeLRUEntry() { | public V removeLRUEntry() { //if there are no elements, return null. if(isEmpty()) return null; //get an element from the remove list to remove DoublyLinkedList.ListElement<K> toRemove = removeList.removeFirst(); //remove it from the hashMap ValueElement<K, V> removed = map.remove(toRemove.getKey()); //decrement the count currentSize--; //return the removed element (value) return removed.getValue(); } | 5134 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5134/d624fd2c10faeb5bb8a5cca068ee535bfeccfe12/FixedsizeForgetfulHashMap.java/clean/components/gnutella-core/src/main/java/com/limegroup/gnutella/util/FixedsizeForgetfulHashMap.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
776,
1206,
16018,
57,
1622,
1435,
565,
288,
3639,
368,
430,
1915,
854,
1158,
2186,
16,
327,
446,
18,
3639,
309,
12,
291,
1921,
10756,
5411,
327,
446,
31,
7734,
368,
588,
392,
930,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
776,
1206,
16018,
57,
1622,
1435,
565,
288,
3639,
368,
430,
1915,
854,
1158,
2186,
16,
327,
446,
18,
3639,
309,
12,
291,
1921,
10756,
5411,
327,
446,
31,
7734,
368,
588,
392,
930,... |
c = in.read(); | c = getChar(); | public int getToken() throws IOException { int c; tokenno++; // Check for pushed-back token if (this.pushbackToken != EOF) { int result = this.pushbackToken; this.pushbackToken = EOF; return result; } // Eat whitespace, possibly sensitive to newlines. do { c = in.read(); if (c == '\n') { flags &= ~TSF_DIRTYLINE; if ((flags & TSF_NEWLINES) != 0) break; } } while (isJSSpace(c) || c == '\n'); if (c == EOF_CHAR) return EOF; if (c != '-' && c != '\n') flags |= TSF_DIRTYLINE; // identifier/keyword/instanceof? // watch out for starting with a <backslash> boolean identifierStart; boolean isUnicodeEscapeStart = false; if (c == '\\') { c = in.read(); if (c == 'u') { identifierStart = true; isUnicodeEscapeStart = true; stringBufferTop = 0; } else { identifierStart = false; c = '\\'; in.unread(); } } else { identifierStart = Character.isJavaIdentifierStart((char)c); if (identifierStart) { stringBufferTop = 0; addToString(c); } } if (identifierStart) { boolean containsEscape = isUnicodeEscapeStart; for (;;) { if (isUnicodeEscapeStart) { // strictly speaking we should probably push-back // all the bad characters if the <backslash>uXXXX // sequence is malformed. But since there isn't a // correct context(is there?) for a bad Unicode // escape sequence in an identifier, we can report // an error here. int escapeVal = 0; for (int i = 0; i != 4; ++i) { c = in.read(); escapeVal = (escapeVal << 4) | xDigitToInt(c); // Next check takes care about c < 0 and bad escape if (escapeVal < 0) { break; } } if (escapeVal < 0) { reportSyntaxError("msg.invalid.escape", null); return ERROR; } addToString(escapeVal); isUnicodeEscapeStart = false; } else { c = in.read(); if (c == '\\') { c = in.read(); if (c == 'u') { isUnicodeEscapeStart = true; containsEscape = true; } else { reportSyntaxError("msg.illegal.character", null); return ERROR; } } else { if (!Character.isJavaIdentifierPart((char)c)) { break; } addToString(c); } } } in.unread(); String str = getStringFromBuffer(); if (!containsEscape) { // OPT we shouldn't have to make a string (object!) to // check if it's a keyword. // Return the corresponding token if it's a keyword int result = stringToKeyword(str); if (result != EOF) { if (result != RESERVED) { return result; } else if (!Context.getContext().hasFeature( Context.FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER)) { return result; } else { // If implementation permits to use future reserved // keywords in violation with the EcmaScript standard, // treat it as name but issue warning Object[] errArgs = { str }; reportSyntaxWarning("msg.reserved.keyword", errArgs); } } } this.string = str; return NAME; } // is it a number? if (isDigit(c) || (c == '.' && isDigit(in.peek()))) { stringBufferTop = 0; int base = 10; if (c == '0') { c = in.read(); if (c == 'x' || c == 'X') { base = 16; c = in.read(); } else if (isDigit(c)) { base = 8; } else { addToString('0'); } } if (base == 16) { while (0 <= xDigitToInt(c)) { addToString(c); c = in.read(); } } else { while ('0' <= c && c <= '9') { /* * We permit 08 and 09 as decimal numbers, which * makes our behavior a superset of the ECMA * numeric grammar. We might not always be so * permissive, so we warn about it. */ if (base == 8 && c >= '8') { Object[] errArgs = { c == '8' ? "8" : "9" }; reportSyntaxWarning("msg.bad.octal.literal", errArgs); base = 10; } addToString(c); c = in.read(); } } boolean isInteger = true; if (base == 10 && (c == '.' || c == 'e' || c == 'E')) { isInteger = false; if (c == '.') { do { addToString(c); c = in.read(); } while (isDigit(c)); } if (c == 'e' || c == 'E') { addToString(c); c = in.read(); if (c == '+' || c == '-') { addToString(c); c = in.read(); } if (!isDigit(c)) { reportSyntaxError("msg.missing.exponent", null); return ERROR; } do { addToString(c); c = in.read(); } while (isDigit(c)); } } in.unread(); String numString = getStringFromBuffer(); double dval; if (base == 10 && !isInteger) { try { // Use Java conversion to number from string... dval = (Double.valueOf(numString)).doubleValue(); } catch (NumberFormatException ex) { Object[] errArgs = { ex.getMessage() }; reportSyntaxError("msg.caught.nfe", errArgs); return ERROR; } } else { dval = ScriptRuntime.stringToNumber(numString, 0, base); } this.number = dval; return NUMBER; } // is it a string? if (c == '"' || c == '\'') { // We attempt to accumulate a string the fast way, by // building it directly out of the reader. But if there // are any escaped characters in the string, we revert to // building it out of a StringBuffer. int quoteChar = c; int val = 0; stringBufferTop = 0; c = in.read(); strLoop: while (c != quoteChar) { if (c == '\n' || c == EOF_CHAR) { in.unread(); reportSyntaxError("msg.unterminated.string.lit", null); return ERROR; } if (c == '\\') { // We've hit an escaped character c = in.read(); switch (c) { case 'b': c = '\b'; break; case 'f': c = '\f'; break; case 'n': c = '\n'; break; case 'r': c = '\r'; break; case 't': c = '\t'; break; // \v a late addition to the ECMA spec, // it is not in Java, so use 0xb case 'v': c = 0xb; break; case 'u': { /* * Get 4 hex digits; if the u escape is not * followed by 4 hex digits, use 'u' + the literal * character sequence that follows. */ int escapeStart = stringBufferTop; addToString('u'); int escapeVal = 0; for (int i = 0; i != 4; ++i) { c = in.read(); escapeVal = (escapeVal << 4) | xDigitToInt(c); if (escapeVal < 0) { continue strLoop; } addToString(c); } // prepare for replace of stored 'u' sequence // by escape value stringBufferTop = escapeStart; c = escapeVal; } break; case 'x': { /* Get 2 hex digits, defaulting to 'x' + literal * sequence, as above. */ c = in.read(); int escapeVal = xDigitToInt(c); if (escapeVal < 0) { addToString('x'); continue strLoop; } else { int c1 = c; c = in.read(); escapeVal = (escapeVal << 4) | xDigitToInt(c); if (escapeVal < 0) { addToString('x'); addToString(c1); continue strLoop; } else { // got 2 hex digits c = escapeVal; } } } break; default: if ('0' <= c && c < '8') { val = c - '0'; c = in.read(); if ('0' <= c && c < '8') { val = 8 * val + c - '0'; c = in.read(); if ('0' <= c && c < '8' && val <= 037) { // c is 3rd char of octal sequence only if // the resulting val <= 0377 val = 8 * val + c - '0'; c = in.read(); } } in.unread(); c = val; } } } addToString(c); c = in.read(); } this.string = getStringFromBuffer(); return STRING; } switch (c) { case '\n': return EOL; case ';': return SEMI; case '[': return LB; case ']': return RB; case '{': return LC; case '}': return RC; case '(': return LP; case ')': return RP; case ',': return COMMA; case '?': return HOOK; case ':': return COLON; case '.': return DOT; case '|': if (in.match('|')) { return OR; } else if (in.match('=')) { this.op = BITOR; return ASSIGN; } else { return BITOR; } case '^': if (in.match('=')) { this.op = BITXOR; return ASSIGN; } else { return BITXOR; } case '&': if (in.match('&')) { return AND; } else if (in.match('=')) { this.op = BITAND; return ASSIGN; } else { return BITAND; } case '=': if (in.match('=')) { if (in.match('=')) this.op = SHEQ; else this.op = EQ; return EQOP; } else { this.op = NOP; return ASSIGN; } case '!': if (in.match('=')) { if (in.match('=')) this.op = SHNE; else this.op = NE; return EQOP; } else { this.op = NOT; return UNARYOP; } case '<': /* NB:treat HTML begin-comment as comment-till-eol */ if (in.match('!')) { if (in.match('-')) { if (in.match('-')) { skipLine(); return getToken(); // in place of 'goto retry' } in.unread(); } in.unread(); } if (in.match('<')) { if (in.match('=')) { this.op = LSH; return ASSIGN; } else { this.op = LSH; return SHOP; } } else { if (in.match('=')) { this.op = LE; return RELOP; } else { this.op = LT; return RELOP; } } case '>': if (in.match('>')) { if (in.match('>')) { if (in.match('=')) { this.op = URSH; return ASSIGN; } else { this.op = URSH; return SHOP; } } else { if (in.match('=')) { this.op = RSH; return ASSIGN; } else { this.op = RSH; return SHOP; } } } else { if (in.match('=')) { this.op = GE; return RELOP; } else { this.op = GT; return RELOP; } } case '*': if (in.match('=')) { this.op = MUL; return ASSIGN; } else { return MUL; } case '/': // is it a // comment? if (in.match('/')) { skipLine(); return getToken(); } if (in.match('*')) { while ((c = in.read()) != -1 && !(c == '*' && in.match('/'))) { ; // empty loop body } if (c == EOF_CHAR) { reportSyntaxError("msg.unterminated.comment", null); return ERROR; } return getToken(); // `goto retry' } // is it a regexp? if ((flags & TSF_REGEXP) != 0) { stringBufferTop = 0; while ((c = in.read()) != '/') { if (c == '\n' || c == EOF_CHAR) { in.unread(); reportSyntaxError("msg.unterminated.re.lit", null); return ERROR; } if (c == '\\') { addToString(c); c = in.read(); } addToString(c); } int reEnd = stringBufferTop; while (true) { if (in.match('g')) addToString('g'); else if (in.match('i')) addToString('i'); else if (in.match('m')) addToString('m'); else break; } if (isAlpha(in.peek())) { reportSyntaxError("msg.invalid.re.flag", null); return ERROR; } this.string = new String(stringBuffer, 0, reEnd); this.regExpFlags = new String(stringBuffer, reEnd, stringBufferTop - reEnd); return REGEXP; } if (in.match('=')) { this.op = DIV; return ASSIGN; } else { return DIV; } case '%': this.op = MOD; if (in.match('=')) { return ASSIGN; } else { return MOD; } case '~': this.op = BITNOT; return UNARYOP; case '+': if (in.match('=')) { this.op = ADD; return ASSIGN; } else if (in.match('+')) { return INC; } else { return ADD; } case '-': if (in.match('=')) { this.op = SUB; c = ASSIGN; } else if (in.match('-')) { if (0 == (flags & TSF_DIRTYLINE)) { // treat HTML end-comment after possible whitespace // after line start as comment-utill-eol if (in.match('>')) { skipLine(); return getToken(); } } c = DEC; } else { c = SUB; } flags |= TSF_DIRTYLINE; return c; default: reportSyntaxError("msg.illegal.character", null); return ERROR; } } | 19042 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/19042/5739d875ab983543fdf729f70a15773fdbe9b1bd/TokenStream.java/clean/src/org/mozilla/javascript/TokenStream.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
509,
9162,
1435,
1216,
1860,
288,
3639,
509,
276,
31,
3639,
1147,
2135,
9904,
31,
3639,
368,
2073,
364,
18543,
17,
823,
1147,
3639,
309,
261,
2211,
18,
6206,
823,
1345,
480,
6431,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9162,
1435,
1216,
1860,
288,
3639,
509,
276,
31,
3639,
1147,
2135,
9904,
31,
3639,
368,
2073,
364,
18543,
17,
823,
1147,
3639,
309,
261,
2211,
18,
6206,
823,
1345,
480,
6431,
... |
return "ContentEl{" + "content=" + content + "}"; | Location loc = getLocation(); return loc != null ? loc.toString() : ("ContentEl{" + "content=" + content + '}'); | public String toString() { return "ContentEl{" + "content=" + content + "}"; } | 55401 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55401/b354fa924e934264cbb85a10083fc2833aea8145/ContentEl.java/buggy/core/src/java/scriptella/configuration/ContentEl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
1762,
1435,
288,
3639,
7050,
1515,
273,
13312,
5621,
327,
1515,
480,
446,
692,
1515,
18,
10492,
1435,
294,
7566,
1350,
4958,
16711,
397,
315,
1745,
1546,
397,
913,
397,
9571,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
1762,
1435,
288,
3639,
7050,
1515,
273,
13312,
5621,
327,
1515,
480,
446,
692,
1515,
18,
10492,
1435,
294,
7566,
1350,
4958,
16711,
397,
315,
1745,
1546,
397,
913,
397,
9571,
1... |
public void stopApplet() | void stopApplet() | public void stopApplet() { if( app != null ) app.stop(); } | 45545 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45545/3ea62068168d1d5e148e98e6c40ca7f4f9a004b0/KJASAppletStub.java/clean/khtml/java/org/kde/kjas/server/KJASAppletStub.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
918,
2132,
23696,
1435,
565,
288,
3639,
309,
12,
595,
480,
446,
262,
5411,
595,
18,
5681,
5621,
565,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
918,
2132,
23696,
1435,
565,
288,
3639,
309,
12,
595,
480,
446,
262,
5411,
595,
18,
5681,
5621,
565,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
public static Map loadViewMap(Element root, URL xml) { long startTime = System.currentTimeMillis(); FastMap map = FastMap.newInstance(); if (root == null) { root = loadDocument(xml); } if (root == null) { return map; } List includeElementList = UtilXml.childElementList(root, INCLUDE); Iterator includeElementIter = includeElementList.iterator(); while (includeElementIter.hasNext()) { Element includeElement = (Element) includeElementIter.next(); String includeLocation = includeElement.getAttribute(INCLUDE_LOCATION); if ((includeLocation != null) && (includeLocation.length() > 0)) { try { Map subMap = loadViewMap(null, FlexibleLocation.resolveLocation(includeLocation)); map.putAll(subMap); } catch (MalformedURLException mue) { Debug.logError(mue, "Error processing include at [" + includeLocation + "]:" + mue.toString(), module); } } } List viewMapElementList = UtilXml.childElementList(root, VIEW_MAPPING); Iterator viewMapElementIter = viewMapElementList.iterator(); while (viewMapElementIter.hasNext()) { Element viewMapElement = (Element) viewMapElementIter.next(); // Create a URI-MAP for each element found. FastMap uriMap = FastMap.newInstance(); // Get the view info. String name = viewMapElement.getAttribute(VIEW_NAME); String page = viewMapElement.getAttribute(VIEW_PAGE); if (page == null || page.length() == 0) { page = name; } uriMap.put(VIEW_NAME, name); uriMap.put(VIEW_PAGE, page); uriMap.put(VIEW_TYPE, viewMapElement.getAttribute(VIEW_TYPE)); uriMap.put(VIEW_INFO, viewMapElement.getAttribute(VIEW_INFO)); uriMap.put(VIEW_CONTENT_TYPE, viewMapElement.getAttribute(VIEW_CONTENT_TYPE)); uriMap.put(VIEW_ENCODING, viewMapElement.getAttribute(VIEW_ENCODING)); // Check for a description. String description = UtilXml.childElementValue(viewMapElement, VIEW_DESCRIPTION); uriMap.put(VIEW_DESCRIPTION, UtilValidate.isNotEmpty(description) ? description : ""); if (name != null) map.put(name, uriMap); } /* Debugging */ if (Debug.verboseOn()) { Debug.logVerbose("-------- View Mappings --------", module); FastMap debugMap = map; Set debugSet = debugMap.keySet(); Iterator i = debugSet.iterator(); while (i.hasNext()) { Object o = i.next(); String request = (String) o; FastMap thisURI = (FastMap) debugMap.get(o); StringBuffer verboseMessageBuffer = new StringBuffer(); Iterator debugIter = ((Set) thisURI.keySet()).iterator(); while (debugIter.hasNext()) { Object lo = debugIter.next(); String name = (String) lo; String value = (String) thisURI.get(lo); verboseMessageBuffer.append("[" + name + "=>" + value + "]"); } Debug.logVerbose(request + " :: " + verboseMessageBuffer.toString(), module); } Debug.logVerbose("------ End View Mappings ------", module); } /* End Debugging */ double totalSeconds = (System.currentTimeMillis() - startTime)/1000.0; if (Debug.infoOn()) Debug.logInfo("ViewMap Created: (" + map.size() + ") records in " + totalSeconds + "s", module); return map; } | 45953 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45953/4472bb323da633b067f267f37fb38fc1a4fa8990/ConfigXMLReader.java/clean/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
3845,
863,
945,
1767,
863,
12,
1046,
3085,
16,
1785,
2902,
15329,
5748,
1937,
950,
33,
3163,
18,
2972,
28512,
5621,
12305,
863,
1458,
33,
12305,
863,
18,
2704,
1442,
5621,
430,
12,
3085,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3845,
863,
945,
1767,
863,
12,
1046,
3085,
16,
1785,
2902,
15329,
5748,
1937,
950,
33,
3163,
18,
2972,
28512,
5621,
12305,
863,
1458,
33,
12305,
863,
18,
2704,
1442,
5621,
430,
12,
3085,... | ||
Class componentType = resolveType(elementType, loader); | Class componentType = resolveType(elementType); | private Object resolveType(final AnnotationElement.NamedValue namedValue, final ClassLoader loader) { final Object value = namedValue.getValue(); if (value instanceof Type) { // type final Type type = (Type)value; final Class resolvedType; try { if (type.getClassName().endsWith("[]")) { //if (type.getDimensions() > 0) { // Note: Bugs in ASM prevents me from using this check, first: if type is primitive -> NPE, second: dimension is wrong for non-array types (1) int dimensions = type.getDimensions(); Type elementType = type.getElementType(); Class componentType = resolveType(elementType, loader); resolvedType = Array.newInstance(componentType, new int[dimensions]).getClass(); } else { resolvedType = resolveType(type, loader); } } catch (ClassNotFoundException cnfe) { throw new ResolveAnnotationException( "class [" + type.getClassName() + "] defined in annotation can not be found in class loader [" + loader + "]", cnfe ); } return resolvedType; } else { // primitive value return value; } } | 7955 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7955/df097f28233b7edcfaab49c23d9ff775c71cc86d/JavaDocAnnotationInvocationHander.java/clean/backport175/src/main/org/codehaus/backport175/reader/proxy/JavaDocAnnotationInvocationHander.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
1033,
2245,
559,
12,
6385,
6090,
1046,
18,
7604,
620,
4141,
620,
16,
727,
9403,
4088,
13,
288,
3639,
727,
1033,
460,
273,
4141,
620,
18,
24805,
5621,
3639,
309,
261,
1132,
1276,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1033,
2245,
559,
12,
6385,
6090,
1046,
18,
7604,
620,
4141,
620,
16,
727,
9403,
4088,
13,
288,
3639,
727,
1033,
460,
273,
4141,
620,
18,
24805,
5621,
3639,
309,
261,
1132,
1276,
1... |
super(preferredFormat == Registry.ASN1_ENCODING_ID ? Registry.X509_ENCODING_ID : preferredFormat, n, e); | this(Registry.RAW_ENCODING_ID, n, e); | public GnuRSAPublicKey(int preferredFormat, BigInteger n, BigInteger e) { super(preferredFormat == Registry.ASN1_ENCODING_ID ? Registry.X509_ENCODING_ID : preferredFormat, n, e); } | 50763 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50763/a41d0899aa65f05fc526d9fb2ea0b096d1ff3f8c/GnuRSAPublicKey.java/buggy/core/src/classpath/gnu/gnu/java/security/key/rsa/GnuRSAPublicKey.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
611,
13053,
13225,
2203,
24312,
12,
474,
9119,
1630,
16,
10246,
290,
16,
10246,
425,
13,
225,
288,
565,
2240,
12,
23616,
1630,
422,
5438,
18,
22269,
21,
67,
14672,
67,
734,
692,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
611,
13053,
13225,
2203,
24312,
12,
474,
9119,
1630,
16,
10246,
290,
16,
10246,
425,
13,
225,
288,
565,
2240,
12,
23616,
1630,
422,
5438,
18,
22269,
21,
67,
14672,
67,
734,
692,
5... |
Workbench.getInstance().getDisplay().asyncExec(new Runnable() { public void run() { openTaskEditor(); } }); | if (forceSyncOpen) { openTaskEditor(); } else { Workbench.getInstance().getDisplay().asyncExec(new Runnable() { public void run() { openTaskEditor(); } }); } | public void openTaskInEditor(boolean offline) { Workbench.getInstance().getDisplay().asyncExec(new Runnable() { public void run() { openTaskEditor(); } }); } | 51151 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51151/558f40fad2aeb69f17a96cb2eabee4fb34ccd036/Task.java/clean/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/Task.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1696,
2174,
382,
6946,
12,
6494,
13493,
13,
288,
202,
202,
2421,
22144,
18,
588,
1442,
7675,
588,
4236,
7675,
3810,
1905,
12,
2704,
10254,
1435,
288,
1082,
202,
482,
918,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
225,
202,
482,
918,
1696,
2174,
382,
6946,
12,
6494,
13493,
13,
288,
202,
202,
2421,
22144,
18,
588,
1442,
7675,
588,
4236,
7675,
3810,
1905,
12,
2704,
10254,
1435,
288,
1082,
202,
482,
918,
... |
session.prepareStatement(INSERT_SEED_META_DATA_TYPE); for(final MetaDataType mdt : MetaDataType.values()) { session.setTypeAsInteger(1, mdt); session.setTypeAsString(2, mdt); if(1 != session.executeUpdate()) throw new HypersonicException( "Could not insert meta data seed data: " + mdt); } | session.prepareStatement(INSERT_SEED_META_DATA_TYPE); for(final MetaDataType mdt : MetaDataType.values()) { session.setTypeAsInteger(1, mdt); session.setTypeAsString(2, mdt); if(1 != session.executeUpdate()) throw new HypersonicException( "Could not insert meta data seed data: " + mdt); } | private void insertSeedData(final Session session) { session.prepareStatement(INSERT_SEED_META_DATA_TYPE); for(final MetaDataType mdt : MetaDataType.values()) { session.setTypeAsInteger(1, mdt); session.setTypeAsString(2, mdt); if(1 != session.executeUpdate()) throw new HypersonicException( "Could not insert meta data seed data: " + mdt); } session.prepareStatement(INSERT_SEED_VERSION); session.setTypeAsInteger(1, MetaDataType.STRING); session.setString(2, Constants.MetaData.RELEASE_ID_KEY); session.setString(3, Constants.Release.VERSION); if(1 != session.executeUpdate()) throw new HypersonicException( "Could not insert version seed."); session.prepareStatement(INSERT_SEED_ARTIFACT_FLAG); for(final ArtifactFlag af : ArtifactFlag.values()) { session.setInt(1, af.getId()); session.setString(2, af.toString()); if(1 != session.executeUpdate()) throw new HypersonicException( "Could not insert artifact flag seed data: " + af); } session.prepareStatement(INSERT_SEED_ARTIFACT_STATE); for(final ArtifactState as : ArtifactState.values()) { session.setInt(1, as.getId()); session.setString(2, as.toString()); if(1 != session.executeUpdate()) throw new HypersonicException( "Could not insert artifact state seed data: " + as); } session.prepareStatement(INSERT_SEED_ARTIFACT_TYPE); for(final ArtifactType at : ArtifactType.values()) { session.setInt(1, at.getId()); session.setString(2, at.toString()); if(1 != session.executeUpdate()) throw new HypersonicException( "Could not insert artifact type seed data: " + at); } session.prepareStatement(INSERT_SEED_ARTIFACT_AUDIT_TYPE); for(final AuditEventType aat : AuditEventType.values()) { session.setTypeAsInteger(1, aat); session.setTypeAsString(2, aat); if(1 != session.executeUpdate()) throw new HypersonicException( "Could not insert artifact audit type seed data: " + aat); } session.prepareStatement(INSERT_SEED_SYSTEM_MESSAGE_TYPE); for(final SystemMessageType smt : SystemMessageType.values()) { session.setTypeAsInteger(1, smt); session.setTypeAsString(2, smt); if(1 != session.executeUpdate()) throw new HypersonicException( "Could not insert system message type seed data: " + smt); } } | 53635 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53635/f88a7e6e85dd504c11c5b58ca96fca298ab490cf/HypersonicMigrator.java/buggy/local/model/src/main/java/com/thinkparity/model/parity/model/io/db/hsqldb/util/HypersonicMigrator.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
2243,
12702,
751,
12,
6385,
3877,
1339,
13,
288,
202,
202,
3184,
18,
9366,
3406,
12,
11356,
67,
1090,
2056,
67,
19294,
67,
4883,
67,
2399,
1769,
202,
202,
1884,
12,
6385... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2243,
12702,
751,
12,
6385,
3877,
1339,
13,
288,
202,
202,
3184,
18,
9366,
3406,
12,
11356,
67,
1090,
2056,
67,
19294,
67,
4883,
67,
2399,
1769,
202,
202,
1884,
12,
6385... |
al.sourcef(source.getInt(4*0),AL.GAIN,1.0f); | al.sourcef(source.get(0),AL.GAIN,1.0f); | protected void i_FreqTest() { int error; ByteBuffer source = ByteBuffer.allocateDirect(4); source.order(ByteOrder.nativeOrder()); int ch = -1; ByteBuffer source0Pos = ByteBuffer.allocateDirect(12); source0Pos.order(ByteOrder.nativeOrder()); source0Pos.putFloat(2.0f); source0Pos.putFloat(0.0f); source0Pos.putFloat(-2.0f); ByteBuffer source0Vel = ByteBuffer.allocateDirect(12); source0Vel.order(ByteOrder.nativeOrder()); source0Vel.putFloat(0.0f); source0Vel.putFloat(0.0f); source0Vel.putFloat(0.0f); al.genSources(1,Sys.getDirectBufferAddress(source)); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alGenSources 1 : ", error); return; } al.sourcef(source.getInt(4*0),AL.PITCH,1.0f); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourcef 0 AL_PITCH : \n", error); al.sourcef(source.getInt(4*0),AL.GAIN,1.0f); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourcef 0 AL_GAIN : \n", error); al.sourcefv(source.getInt(4*0),AL.POSITION,Sys.getDirectBufferAddress(source0Pos)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourcefv 0 AL_POSITION : \n", error); al.sourcefv(source.getInt(4*0),AL.VELOCITY, Sys.getDirectBufferAddress(source0Vel)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourcefv 0 AL_VELOCITY : \n", error); al.sourcei(source.getInt(4*0),AL.BUFFER, buffers.getInt(4*1)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourcei 0 AL_BUFFER buffer 1 : \n", error); al.sourcei(source.getInt(4*0),AL.LOOPING,AL.TRUE); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourcei 0 AL_LOOPING true: \n", error); System.out.print("Frequency Test\n"); System.out.print("Press '1' to play source 0 (looping)\n"); System.out.print("Press '2' to Double Frequency\n"); System.out.print("Press '3' to Halve Frequency\n"); System.out.print("Press 'Q' to quit\n"); do { try { ch = System.in.read(); } catch (IOException ioe) { } switch (ch) { case '1': al.sourcef(source.getInt(4*0), AL.PITCH, 1.0f); al.sourcePlay(source.getInt(4*0)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourcePlay source 0 : ", error); break; case '2': al.sourcef(source.getInt(4*0), AL.PITCH, 2.0f); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourcef source 0 AL_PITCH 2.0 : ", error); break; case '3': al.sourcef(source.getInt(4*0), AL.PITCH, 0.5f); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourcef source 0 AL PITCH 0.5: ", error); break; } } while (ch != 'Q'); // Release resources al.sourceStopv(1, Sys.getDirectBufferAddress(source)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourceStopv 2 : ", error); al.deleteSources(1, Sys.getDirectBufferAddress(source)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alDeleteSources 2 : ", error); } | 5076 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5076/c18e8bd28afc8401f80a918520500157aa5f199d/ALTest.java/buggy/src/java/org/lwjgl/openal/test/ALTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
918,
277,
67,
14485,
4709,
1435,
288,
3639,
509,
202,
1636,
31,
3639,
7400,
1084,
273,
7400,
18,
16247,
5368,
12,
24,
1769,
3639,
1084,
18,
1019,
12,
3216,
2448,
18,
13635,
2448,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
277,
67,
14485,
4709,
1435,
288,
3639,
509,
202,
1636,
31,
3639,
7400,
1084,
273,
7400,
18,
16247,
5368,
12,
24,
1769,
3639,
1084,
18,
1019,
12,
3216,
2448,
18,
13635,
2448,
... |
return cus; | return mcus; | private MockCachedUrlSet permissionPageTestSetup(List permissionPages, int passPermissionCheck, List urlsToCrawl, MockArchivalUnit mmau) { //set plugin mmau.setPlugin(new MockPlugin()); //make cus , set Cus MockCachedUrlSet cus = new MyMockCachedUrlSet(mmau, null); mmau.setAuCachedUrlSet(cus); crawlRule = new MockCrawlRule(); for (int ix=0; ix<urlsToCrawl.size(); ix++) { String curUrl = (String)urlsToCrawl.get(ix); cus.addUrl(curUrl); crawlRule.addUrlToCrawl(curUrl); } //set Crawl spec spec = new CrawlSpec(urlsToCrawl, permissionPages, crawlRule, 1); //set Crawler crawler = new NewContentCrawler(mmau, spec, new MockAuState()); ((CrawlerImpl)crawler).lockssCheckers = ListUtil.list( new MyMockPermissionChecker(passPermissionCheck)); //set parser mmau.setParser(parser); return cus; } | 8150 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8150/1daae17bba467f29e3575dfd082f58a6511a6679/TestNewContentCrawler.java/clean/test/src/org/lockss/crawler/TestNewContentCrawler.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
7867,
9839,
1489,
694,
4132,
1964,
4709,
7365,
12,
682,
4132,
5716,
16,
1377,
509,
1342,
5041,
1564,
16,
987,
6903,
774,
39,
15161,
16,
7867,
12269,
5162,
2802,
312,
2540,
89,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
7867,
9839,
1489,
694,
4132,
1964,
4709,
7365,
12,
682,
4132,
5716,
16,
1377,
509,
1342,
5041,
1564,
16,
987,
6903,
774,
39,
15161,
16,
7867,
12269,
5162,
2802,
312,
2540,
89,
13,
... |
valBuilder1.setToolTipText( Messages .getString( "HighlightRuleBuilderDialog.tooltip.ExpBuilder" ) ); | valBuilder1.setToolTipText( Messages.getString( "HighlightRuleBuilderDialog.tooltip.ExpBuilder" ) ); | protected Control createContents( Composite parent ) { GridData gdata; GridLayout glayout; createTitleArea( parent ); Composite composite = new Composite( parent, 0 ); glayout = new GridLayout( ); glayout.marginHeight = 0; glayout.marginWidth = 0; glayout.verticalSpacing = 0; composite.setLayout( glayout ); composite.setLayoutData( new GridData( GridData.FILL_BOTH ) ); applyDialogFont( composite ); initializeDialogUnits( composite ); Composite innerParent = (Composite) createDialogArea( composite ); createButtonBar( composite ); Label lb = new Label( innerParent, SWT.NONE ); lb.setText( Messages .getString( "HighlightRuleBuilderDialog.text.Condition" ) ); //$NON-NLS-1$ Composite condition = new Composite( innerParent, SWT.NONE ); condition.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); glayout = new GridLayout( 5, false ); condition.setLayout( glayout ); expression = new Combo( condition, SWT.NONE ); gdata = new GridData( ); gdata.widthHint = 100; expression.setLayoutData( gdata ); fillExpression( expression ); expression.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { if ( expression.getText( ).equals( VALUE_OF_THIS_DATA_ITEM ) && designHandle instanceof DataItemHandle ) { expression .setText( DEUtil .getColumnExpression( ( (DataItemHandle) designHandle ) .getResultSetColumn( ) ) ); } updateButtons( ); } } ); expression.addModifyListener( new ModifyListener( ) { public void modifyText( ModifyEvent e ) { updateButtons( ); } } ); Button expBuilder = new Button( condition, SWT.PUSH ); expBuilder.setText( "..." ); //$NON-NLS-1$ gdata = new GridData( ); gdata.heightHint = 20; gdata.widthHint = 20; expBuilder.setLayoutData( gdata ); expBuilder.setToolTipText( Messages .getString( "HighlightRuleBuilderDialog.tooltip.ExpBuilder" ) ); //$NON-NLS-1$ expBuilder.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { editValue( expression ); } } ); operator = new Combo( condition, SWT.READ_ONLY ); for ( int i = 0; i < OPERATOR.length; i++ ) { operator.add( OPERATOR[i][0] ); } operator.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { String value = getValueForOperator( operator.getText( ) ); int vv = determineValueVisible( value ); if ( vv == 0 ) { value1.setVisible( false ); value2.setVisible( false ); valBuilder1.setVisible( false ); valBuilder2.setVisible( false ); andLable.setVisible( false ); } else if ( vv == 1 ) { value1.setVisible( true ); valBuilder1.setVisible( true ); value2.setVisible( false ); valBuilder2.setVisible( false ); andLable.setVisible( false ); } else if ( vv == 2 ) { value1.setVisible( true ); value2.setVisible( true ); valBuilder1.setVisible( true ); valBuilder2.setVisible( true ); andLable.setVisible( true ); } updateButtons( ); } } ); value1 = createText( condition ); value1.addModifyListener( new ModifyListener( ) { public void modifyText( ModifyEvent e ) { updateButtons( ); } } ); valBuilder1 = new Button( condition, SWT.PUSH ); valBuilder1.setText( "..." ); //$NON-NLS-1$ gdata = new GridData( ); gdata.heightHint = 20; gdata.widthHint = 20; valBuilder1.setLayoutData( gdata ); valBuilder1.setToolTipText( Messages .getString( "HighlightRuleBuilderDialog.tooltip.ExpBuilder" ) ); //$NON-NLS-1$ valBuilder1.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { editValue( value1 ); } } ); createDummy( condition, 3 ); andLable = new Label( condition, SWT.NONE ); andLable.setText( Messages .getString( "HighlightRuleBuilderDialog.text.AND" ) ); //$NON-NLS-1$ andLable.setVisible( false ); createDummy( condition, 1 ); createDummy( condition, 3 ); value2 = createText( condition ); value2.addModifyListener( new ModifyListener( ) { public void modifyText( ModifyEvent e ) { updateButtons( ); } } ); value2.setVisible( false ); valBuilder2 = new Button( condition, SWT.PUSH ); valBuilder2.setText( "..." ); //$NON-NLS-1$ gdata = new GridData( ); gdata.heightHint = 20; gdata.widthHint = 20; valBuilder2.setLayoutData( gdata ); valBuilder2.setToolTipText( Messages .getString( "HighlightRuleBuilderDialog.tooltip.ExpBuilder" ) ); //$NON-NLS-1$ valBuilder2.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { editValue( value2 ); } } ); valBuilder2.setVisible( false ); if ( operator.getItemCount( ) > 0 ) { operator.select( 0 ); } lb = new Label( innerParent, SWT.NONE ); lb.setText( Messages .getString( "HighlightRuleBuilderDialog.text.Format" ) ); //$NON-NLS-1$ Composite format = new Composite( innerParent, SWT.NONE ); format.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); glayout = new GridLayout( 7, false ); format.setLayout( glayout ); lb = new Label( format, 0 ); lb .setText( Messages .getString( "HighlightRuleBuilderDialog.text.Font" ) ); //$NON-NLS-1$ lb = new Label( format, 0 ); lb .setText( Messages .getString( "HighlightRuleBuilderDialog.text.Size" ) ); //$NON-NLS-1$ lb = new Label( format, 0 ); lb.setText( Messages .getString( "HighlightRuleBuilderDialog.text.Color" ) ); //$NON-NLS-1$ createDummy( format, 4 ); font = new Combo( format, SWT.READ_ONLY ); gdata = new GridData( ); gdata.widthHint = 100; font.setLayoutData( gdata ); IChoiceSet fontSet = ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.FONT_FAMILY_PROP ); font.setData( fontSet ); font.setItems( ChoiceSetFactory.getDisplayNamefromChoiceSet( fontSet, new AlphabeticallyComparator( ) ) ); if ( SYSTEM_FONT_LIST != null && SYSTEM_FONT_LIST.length > 0 ) { for ( int i = 0; i < SYSTEM_FONT_LIST.length; i++ ) { font.add( SYSTEM_FONT_LIST[i] ); } } font.add( DEFAULT_CHOICE, 0 ); font.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { updatePreview( ); } } ); if ( font.getItemCount( ) > 0 ) { font.select( 0 ); } size = new FontSizeBuilder( format, SWT.None ); if ( designHandle != null ) { size.setDefaultUnit( designHandle.getPropertyHandle( StyleHandle.FONT_SIZE_PROP ).getDefaultUnit( ) ); } gdata = new GridData( ); gdata.widthHint = 120; size.setLayoutData( gdata ); size.setFontSizeValue( null ); size.addListener( SWT.Modify, new Listener( ) { public void handleEvent( Event event ) { updatePreview( ); } } ); color = new ColorBuilder( format, 0 ); gdata = new GridData( ); gdata.widthHint = 50; color.setLayoutData( gdata ); color.setChoiceSet( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.COLOR_PROP ) ); color.setRGB( null ); color.addListener( SWT.Modify, new Listener( ) { public void handleEvent( Event event ) { previewLabel.setForeground( ColorManager.getColor( color .getRGB( ) ) ); previewLabel.redraw( ); } } ); Composite fstyle = new Composite( format, 0 ); gdata = new GridData( ); gdata.horizontalSpan = 4; fstyle.setLayoutData( gdata ); fstyle.setLayout( new GridLayout( 4, false ) ); bold = createToggleButton( fstyle ); bold.setImage( ReportPlatformUIImages .getImage( AttributeConstant.FONT_WIDTH ) ); bold.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { isBoldChanged = true; updatePreview( ); } } ); bold.setToolTipText(Messages .getString("HighlightRuleBuilderDialog.tooltip.Bold")); italic = createToggleButton( fstyle ); italic.setImage( ReportPlatformUIImages .getImage( AttributeConstant.FONT_STYLE ) ); italic.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { isItalicChanged = true; updatePreview( ); } } ); italic.setToolTipText(Messages .getString("HighlightRuleBuilderDialog.tooltip.Italic")); underline = createToggleButton( fstyle ); underline.setImage( ReportPlatformUIImages .getImage( AttributeConstant.TEXT_UNDERLINE ) ); underline.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { isUnderlineChanged = true; previewLabel.setUnderline( underline.getSelection( ) ); previewLabel.redraw( ); } } ); underline.setToolTipText(Messages .getString("HighlightRuleBuilderDialog.tooltip.Underline")); linethrough = createToggleButton( fstyle ); linethrough.setImage( ReportPlatformUIImages .getImage( AttributeConstant.TEXT_LINE_THROUGH ) ); linethrough.addSelectionListener( new SelectionAdapter( ) { public void widgetSelected( SelectionEvent e ) { isLinethroughChanged = true; previewLabel.setLinethrough( linethrough.getSelection( ) ); previewLabel.redraw( ); } } ); linethrough .setToolTipText(Messages .getString("HighlightRuleBuilderDialog.tooltip.Text_Line_Through")); Composite back = new Composite( innerParent, SWT.NONE ); back.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); glayout = new GridLayout( 1, false ); back.setLayout( glayout ); lb = new Label( back, 0 ); lb .setText( Messages .getString( "HighlightRuleBuilderDialog.text.BackgroundColor" ) ); //$NON-NLS-1$ backColor = new ColorBuilder( back, 0 ); gdata = new GridData( ); gdata.widthHint = 50; backColor.setLayoutData( gdata ); backColor.setChoiceSet( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.BACKGROUND_COLOR_PROP ) ); backColor.setRGB( null ); backColor.addListener( SWT.Modify, new Listener( ) { public void handleEvent( Event event ) { previewLabel.setBackground( ColorManager.getColor( backColor .getRGB( ) ) ); previewLabel.redraw( ); } } ); Composite preview = new Composite( innerParent, SWT.NONE ); glayout = new GridLayout( ); preview.setLayout( glayout ); gdata = new GridData( GridData.FILL_BOTH ); preview.setLayoutData( gdata ); lb = new Label( preview, SWT.NONE ); lb.setText( Messages .getString( "HighlightRuleBuilderDialog.text.Preview" ) ); //$NON-NLS-1$ Composite previewPane = new Composite( preview, SWT.BORDER ); glayout = new GridLayout( ); glayout.marginWidth = 0; glayout.marginHeight = 0; previewPane.setLayout( glayout ); gdata = new GridData( GridData.FILL_BOTH ); gdata.heightHint = 60; previewPane.setLayoutData( gdata ); previewLabel = new PreviewLabel( previewPane, 0 ); previewLabel.setText( Messages .getString( "HighlightRuleBuilderDialog.text.PreviewContent" ) ); //$NON-NLS-1$ gdata = new GridData( GridData.FILL_BOTH ); previewLabel.setLayoutData( gdata ); updatePreview( ); lb = new Label( innerParent, SWT.SEPARATOR | SWT.HORIZONTAL ); lb.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); syncViewProperties( ); updatePreview( ); updateButtons( ); return composite; } | 5230 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5230/1cbdabafb0e6f5e8a50eeb05f5cc3d2a2fff1551/HighlightRuleBuilder.java/clean/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/HighlightRuleBuilder.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
8888,
752,
6323,
12,
14728,
982,
262,
202,
95,
202,
202,
6313,
751,
314,
892,
31,
202,
202,
6313,
3744,
5118,
2012,
31,
202,
202,
2640,
4247,
5484,
12,
982,
11272,
202,
202,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
8888,
752,
6323,
12,
14728,
982,
262,
202,
95,
202,
202,
6313,
751,
314,
892,
31,
202,
202,
6313,
3744,
5118,
2012,
31,
202,
202,
2640,
4247,
5484,
12,
982,
11272,
202,
202,
... |
} | } | private int traverseGroupDeclFromAnotherSchema( String groupName , String uriStr ) throws Exception { SchemaGrammar aGrammar = (SchemaGrammar) fGrammarResolver.getGrammar(uriStr); if (uriStr == null || aGrammar==null ||! (aGrammar instanceof SchemaGrammar) ) { // REVISIT: Localize reportGenericSchemaError("!!Schema not found in #traverseGroupDeclFromAnotherSchema, "+ "schema uri: " + uriStr +", groupName: " + groupName); return -1; } Element groupDecl = (Element) aGrammar.topLevelGroupDecls.get((Object)groupName); if (groupDecl == null) { // REVISIT: Localize reportGenericSchemaError( "no group named \"" + groupName + "\" was defined in schema : " + uriStr); return -1; } NamespacesScope saveNSMapping = fNamespacesScope; int saveTargetNSUri = fTargetNSURI; fTargetNSURI = fStringPool.addSymbol(aGrammar.getTargetNamespaceURI()); fNamespacesScope = aGrammar.getNamespacesScope(); Element child = checkContent( groupDecl, XUtil.getFirstChildElement(groupDecl), true ); String qualifiedGroupName = fTargetNSURIString + "," + groupName; Object contentSpecHolder = fGroupNameRegistry.get(qualifiedGroupName); if(contentSpecHolder != null ) // we've already traversed this group return ((Integer)contentSpecHolder).intValue(); // if we're here then we're traversing a top-level group that we've never seen before. 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 }); } if ( ! illegalChild && child != null) { index = expandContentModel( index, child); } contentSpecHolder = new Integer(index); fGroupNameRegistry.put(qualifiedGroupName, contentSpecHolder); fNamespacesScope = saveNSMapping; fTargetNSURI = saveTargetNSUri; return index; } // end of method traverseGroupDeclFromAnotherSchema | 1831 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1831/87731f2b2070ba79da173a5e6be82410b096d7c5/TraverseSchema.java/buggy/src/org/apache/xerces/validators/schema/TraverseSchema.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
509,
10080,
1114,
3456,
1265,
37,
24413,
3078,
12,
514,
11619,
269,
514,
2003,
1585,
262,
1216,
1185,
288,
7734,
4611,
18576,
279,
18576,
273,
261,
3078,
18576,
13,
284,
18576,
4301,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
509,
10080,
1114,
3456,
1265,
37,
24413,
3078,
12,
514,
11619,
269,
514,
2003,
1585,
262,
1216,
1185,
288,
7734,
4611,
18576,
279,
18576,
273,
261,
3078,
18576,
13,
284,
18576,
4301,
... |
if (headersValue[ContentEncoding] == null) { | String ct = getContentType(); if (ct == null) { | public Object getContent() throws IOException { if (headersValue[ContentEncoding] == null) { return (in); } /* * We only understand a limited number of things so far */ if (headersValue[ContentEncoding].startsWith("image/")) { return (Toolkit.getDefaultToolkit().getImage(url).getSource()); } // Return the input stream if we don't understand return (in);} | 45713 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45713/8367b1deaafbb90ce763614e515522be463b266a/HttpURLConnection.java/buggy/libraries/javalib/kaffe/net/www/protocol/http/HttpURLConnection.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
1033,
5154,
1435,
1216,
1860,
288,
202,
430,
261,
2485,
620,
63,
1350,
4705,
65,
422,
446,
13,
288,
202,
202,
2463,
261,
267,
1769,
202,
97,
202,
20308,
202,
380,
1660,
1338,
22413,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1033,
5154,
1435,
1216,
1860,
288,
202,
430,
261,
2485,
620,
63,
1350,
4705,
65,
422,
446,
13,
288,
202,
202,
2463,
261,
267,
1769,
202,
97,
202,
20308,
202,
380,
1660,
1338,
22413,
27... |
defaultValueExpr = ExpressionUtil.createParameterExpression( ( (OdaDataSetParameterHandle) modelParam ).getParamName( ) ); | defaultValueExpr = ExpressionUtil.createJSParameterExpression( ( (OdaDataSetParameterHandle) modelParam ).getParamName( ) ); | private Iterator populateParameter( DataSetHandle modelDataSet, BaseDataSetDesign dteDataSet ) { //dataset parameters definition HashMap paramBindingCandidates = new HashMap( ); Iterator elmtIter = modelDataSet.parametersIterator( ); if ( elmtIter != null ) { while ( elmtIter.hasNext( ) ) { DataSetParameterHandle modelParam = ( DataSetParameterHandle ) elmtIter .next( ); dteDataSet.addParameter( newParam( modelParam ) ); // collect input parameter default values as // potential parameter binding if no explicit ones are // defined for a parameter if ( modelParam.isInput( ) ) { String defaultValueExpr = null; if ( modelParam instanceof OdaDataSetParameterHandle && ( (OdaDataSetParameterHandle) modelParam ).getParamName( ) != null ) { defaultValueExpr = ExpressionUtil.createParameterExpression( ( (OdaDataSetParameterHandle) modelParam ).getParamName( ) ); } else defaultValueExpr = modelParam.getDefaultValue( ); if ( defaultValueExpr != null ) paramBindingCandidates.put( modelParam.getName( ), defaultValueExpr ); } } } // input parameter bindings elmtIter = modelDataSet.paramBindingsIterator( ); if ( elmtIter != null ) { while ( elmtIter.hasNext( ) ) { ParamBindingHandle modelParamBinding = ( ParamBindingHandle ) elmtIter .next( ); // replace default value of the same parameter, if defined paramBindingCandidates.put( modelParamBinding.getParamName( ), modelParamBinding.getExpression( ) ); } } // assign merged parameter bindings to the data set if ( paramBindingCandidates.size( ) > 0 ) { elmtIter = paramBindingCandidates.keySet( ).iterator( ); while ( elmtIter.hasNext( ) ) { Object paramName = elmtIter.next( ); assert ( paramName != null && paramName instanceof String ); String expression = ( String ) paramBindingCandidates .get( paramName ); dteDataSet.addInputParamBinding( newInputParamBinding( ( String ) paramName, expression ) ); } } return elmtIter; } | 5230 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5230/5309cb6d7202a0596cf50a4dbe36ca4fd04217f0/ModelDteApiAdapter.java/buggy/engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/adapter/ModelDteApiAdapter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
4498,
6490,
1662,
12,
14065,
3259,
938,
13676,
16,
3360,
13676,
15478,
302,
736,
13676,
262,
202,
95,
202,
202,
759,
8682,
1472,
2379,
202,
202,
8658,
579,
5250,
18455,
273,
39... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4498,
6490,
1662,
12,
14065,
3259,
938,
13676,
16,
3360,
13676,
15478,
302,
736,
13676,
262,
202,
95,
202,
202,
759,
8682,
1472,
2379,
202,
202,
8658,
579,
5250,
18455,
273,
39... |
LimeXMLDocument doc = (LimeXMLDocument) mainMap.get(hash); | LimeXMLDocument doc = null; synchronized (mainMap) { doc = (LimeXMLDocument) mainMap.get(hash); } | private boolean ripMP3XML(String modifiedFile) { if (!LimeXMLUtils.isMP3File(modifiedFile)) return false; try { String hash = new String(LimeXMLUtils.hashFile(new File(modifiedFile))); LimeXMLDocument doc = (LimeXMLDocument) mainMap.get(hash); String fName = doc.getIdentifier(); if (LimeXMLUtils.isMP3File(modifiedFile)) { ID3Editor e = new ID3Editor(); String xml = doc.getXMLStringWithIdentifier(); e.removeID3Tags(xml); this.editor = e; this.changedHash = hash; } return true; } catch (Exception e) { return false; } } | 5134 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5134/28162fe6981649bb515ccee99d1476b32545c648/LimeXMLReplyCollection.java/buggy/components/gnutella-core/src/main/java/com/limegroup/gnutella/xml/LimeXMLReplyCollection.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
1250,
436,
625,
4566,
23,
4201,
12,
780,
4358,
812,
13,
288,
3639,
309,
16051,
48,
494,
4201,
1989,
18,
291,
4566,
23,
812,
12,
7342,
812,
3719,
5411,
327,
629,
31,
3639,
775,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
1250,
436,
625,
4566,
23,
4201,
12,
780,
4358,
812,
13,
288,
3639,
309,
16051,
48,
494,
4201,
1989,
18,
291,
4566,
23,
812,
12,
7342,
812,
3719,
5411,
327,
629,
31,
3639,
775,
2... |
private void assertHasEntry( String msg, Name dn ) throws NamingException | private void assertHasEntry( NextInterceptor nextInterceptor, String msg, Name dn ) throws NamingException | private void assertHasEntry( String msg, Name dn ) throws NamingException { if ( !nexus.hasEntry( dn ) ) { LdapNameNotFoundException e = null; if ( msg != null ) { e = new LdapNameNotFoundException( msg + dn ); } else { e = new LdapNameNotFoundException( dn.toString() ); } e.setResolvedName( nexus.getMatchedName( dn, false ) ); throw e; } } | 17035 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/17035/0e26528e69b2b36c5f2f1fb03af87ad2ec26eb51/ExceptionService.java/buggy/core/src/main/java/org/apache/ldap/server/exception/ExceptionService.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
1815,
5582,
1622,
12,
4804,
10281,
1024,
10281,
16,
514,
1234,
16,
1770,
8800,
262,
1216,
26890,
565,
288,
3639,
309,
261,
401,
82,
21029,
18,
5332,
1622,
12,
8800,
262,
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,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
1815,
5582,
1622,
12,
4804,
10281,
1024,
10281,
16,
514,
1234,
16,
1770,
8800,
262,
1216,
26890,
565,
288,
3639,
309,
261,
401,
82,
21029,
18,
5332,
1622,
12,
8800,
262,
262,
... |
if (selStartMarker != null && selEndMarker != null) { int selStartLine = StringUtil.offsetToLineNumber(newFileText, selStartMarker.getStartOffset()); int selStartCol = selStartMarker.getStartOffset() - StringUtil.lineColToOffset(newFileText, selStartLine, 0); | if (loader.selStartMarker != null && loader.selEndMarker != null) { int selStartLine = StringUtil.offsetToLineNumber(loader.newFileText, loader.selStartMarker.getStartOffset()); int selStartCol = loader.selStartMarker.getStartOffset() - StringUtil.lineColToOffset(loader.newFileText, selStartLine, 0); | protected void checkResultByFile(@NonNls String filePath, boolean stripTrailingSpaces) { Project project = myProjectFixture.getProject(); project.getComponent(PostprocessReformattingAspect.class).doPostponedFormatting(); if (stripTrailingSpaces) { ((DocumentEx)myEditor.getDocument()).stripTrailingSpaces(false); } PsiDocumentManager.getInstance(project).commitAllDocuments(); String fullPath = getTestDataPath() + filePath; final VirtualFile vFile = LocalFileSystem.getInstance().findFileByPath(fullPath.replace(File.separatorChar, '/')); TestCase.assertNotNull("Cannot find file " + fullPath, vFile); String fileText = null; try { fileText = StringUtil.convertLineSeparators(VfsUtil.loadText(vFile), "\n"); } catch (IOException e) { TestCase.fail("Cannot load " + vFile); } Document document = EditorFactory.getInstance().createDocument(fileText); int caretIndex = fileText.indexOf(CARET_MARKER); int selStartIndex = fileText.indexOf(SELECTION_START_MARKER); int selEndIndex = fileText.indexOf(SELECTION_END_MARKER); final RangeMarker caretMarker = caretIndex >= 0 ? document.createRangeMarker(caretIndex, caretIndex) : null; final RangeMarker selStartMarker = selStartIndex >= 0 ? document.createRangeMarker(selStartIndex, selStartIndex) : null; final RangeMarker selEndMarker = selEndIndex >= 0 ? document.createRangeMarker(selEndIndex, selEndIndex) : null; if (caretMarker != null) { document.deleteString(caretMarker.getStartOffset(), caretMarker.getStartOffset() + CARET_MARKER.length()); } if (selStartMarker != null) { document.deleteString(selStartMarker.getStartOffset(), selStartMarker.getStartOffset() + SELECTION_START_MARKER.length()); } if (selEndMarker != null) { document.deleteString(selEndMarker.getStartOffset(), selEndMarker.getStartOffset() + SELECTION_END_MARKER.length()); } String newFileText = document.getText(); String newFileText1 = newFileText; if (stripTrailingSpaces) { Document document1 = EditorFactory.getInstance().createDocument(newFileText); ((DocumentEx)document1).stripTrailingSpaces(false); newFileText1 = document1.getText(); } String text = myFile.getText(); text = StringUtil.convertLineSeparators(text, "\n"); TestCase.assertEquals("Text mismatch in file " + filePath, newFileText1, text); if (caretMarker != null) { int caretLine = StringUtil.offsetToLineNumber(newFileText, caretMarker.getStartOffset()); int caretCol = caretMarker.getStartOffset() - StringUtil.lineColToOffset(newFileText, caretLine, 0); TestCase.assertEquals("caretLine", caretLine + 1, myEditor.getCaretModel().getLogicalPosition().line + 1); TestCase.assertEquals("caretColumn", caretCol + 1, myEditor.getCaretModel().getLogicalPosition().column + 1); } if (selStartMarker != null && selEndMarker != null) { int selStartLine = StringUtil.offsetToLineNumber(newFileText, selStartMarker.getStartOffset()); int selStartCol = selStartMarker.getStartOffset() - StringUtil.lineColToOffset(newFileText, selStartLine, 0); int selEndLine = StringUtil.offsetToLineNumber(newFileText, selEndMarker.getEndOffset()); int selEndCol = selEndMarker.getEndOffset() - StringUtil.lineColToOffset(newFileText, selEndLine, 0); TestCase.assertEquals("selectionStartLine", selStartLine + 1, StringUtil.offsetToLineNumber(newFileText, myEditor.getSelectionModel().getSelectionStart()) + 1); TestCase.assertEquals("selectionStartCol", selStartCol + 1, myEditor.getSelectionModel().getSelectionStart() - StringUtil.lineColToOffset(newFileText, selStartLine, 0) + 1); TestCase.assertEquals("selectionEndLine", selEndLine + 1, StringUtil.offsetToLineNumber(newFileText, myEditor.getSelectionModel().getSelectionEnd()) + 1); TestCase.assertEquals("selectionEndCol", selEndCol + 1, myEditor.getSelectionModel().getSelectionEnd() - StringUtil.lineColToOffset(newFileText, selEndLine, 0) + 1); } else { TestCase.assertTrue("has no selection", !myEditor.getSelectionModel().hasSelection()); } } | 12814 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12814/b44db92357ccab82c2b9e5857cf9c7994ec2b06d/CodeInsightTestFixtureImpl.java/clean/source/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
918,
27627,
858,
812,
26964,
3989,
50,
3251,
514,
4612,
16,
1250,
2569,
16808,
12077,
13,
288,
565,
5420,
1984,
273,
3399,
4109,
26392,
18,
588,
4109,
5621,
565,
1984,
18,
588,
1841... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
27627,
858,
812,
26964,
3989,
50,
3251,
514,
4612,
16,
1250,
2569,
16808,
12077,
13,
288,
565,
5420,
1984,
273,
3399,
4109,
26392,
18,
588,
4109,
5621,
565,
1984,
18,
588,
1841... |
setLumpChars(lumps[lumpindex - 1], w.storage, 0, w.size); | XMLLump newlump = newLump(parser); setLumpChars(newlump, w.storage, 0, w.size); | private void processDefaultTag(int token, XmlPullParser parser) { CharWrap w = new CharWrap(); writeToken(token, parser, w); setLumpChars(lumps[lumpindex - 1], w.storage, 0, w.size); // lumps[lumpindex - 1].text = w.toString(); } | 45809 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45809/6ffc52305a3138559d1609711801fba2fc8de7fd/XMLViewTemplate.java/buggy/src/uk/org/ponder/rsf/template/XMLViewTemplate.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
918,
1207,
1868,
1805,
12,
474,
1147,
16,
5714,
9629,
2678,
2082,
13,
288,
565,
3703,
2964,
341,
273,
394,
3703,
2964,
5621,
565,
1045,
1345,
12,
2316,
16,
2082,
16,
341,
1769,
56... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1207,
1868,
1805,
12,
474,
1147,
16,
5714,
9629,
2678,
2082,
13,
288,
565,
3703,
2964,
341,
273,
394,
3703,
2964,
5621,
565,
1045,
1345,
12,
2316,
16,
2082,
16,
341,
1769,
56... |
while (i < to) { buf.append(arg); buf.append(i); | while (i < to) { buf.append(arg); buf.append(i); | private String buildActualArgumentList(String arg, int from, int to) { StringBuffer buf = new StringBuffer(); int i = from; while (i < to) { buf.append(arg); buf.append(i); i++; if (i < to) { buf.append(", "); } } return buf.toString(); } | 3664 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3664/dfc73e34bff6e386ff1bb2959e83fe3849358bb0/FactoryGenerator.java/buggy/apigen/apigen/gen/java/FactoryGenerator.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
514,
1361,
11266,
1379,
682,
12,
780,
1501,
16,
509,
628,
16,
509,
358,
13,
288,
3639,
6674,
1681,
273,
394,
6674,
5621,
3639,
509,
277,
273,
628,
31,
3639,
1323,
261,
77,
411,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
514,
1361,
11266,
1379,
682,
12,
780,
1501,
16,
509,
628,
16,
509,
358,
13,
288,
3639,
6674,
1681,
273,
394,
6674,
5621,
3639,
509,
277,
273,
628,
31,
3639,
1323,
261,
77,
411,
... |
temp = functionsDec.matcher( temp ).replaceFirst( "function myFunction( ... ) \n #function content (can have multiple functions) \nend\n"); | temp = functionsDec.matcher( temp ).replaceFirst( "function myFunction( ... ) " + System.getProperty("line.separator") + " #function content (can have multiple functions) " + System.getProperty("line.separator") + "end" + System.getProperty("line.separator")); | public InputStream generatePackage(String packageName, boolean functions, boolean expander, InputStream template) throws IOException { String temp = readTemplate( template ); temp = doHeader(packageName, temp ); if (functions) { temp = functionsDec.matcher( temp ).replaceFirst( "function myFunction( ... ) \n #function content (can have multiple functions) \nend\n"); } else { temp = functionsDec.matcher( temp ).replaceFirst( ""); } if (expander) { temp = expanderDec.matcher( temp ).replaceFirst( "expander customLanguage.dsl\n"); } else { temp = expanderDec.matcher( temp ).replaceFirst( ""); } return toStream( temp ); } | 58098 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58098/1e2e1f1d3e81f700cee9a706d8a466813e8e6353/DRLGenerator.java/clean/drools-ide/src/main/java/org/drools/ide/wizard/rule/DRLGenerator.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
5037,
2103,
2261,
12,
780,
9929,
16,
1250,
4186,
16,
1250,
4542,
264,
16,
5037,
1542,
13,
1216,
1860,
288,
3639,
514,
1906,
273,
855,
2283,
12,
1542,
11272,
3639,
1906,
273,
741,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5037,
2103,
2261,
12,
780,
9929,
16,
1250,
4186,
16,
1250,
4542,
264,
16,
5037,
1542,
13,
1216,
1860,
288,
3639,
514,
1906,
273,
855,
2283,
12,
1542,
11272,
3639,
1906,
273,
741,
... |
final Constructor[] constructors = getComponentImplementation().getConstructors(); | final Constructor[] constructors = getComponentImplementation().getDeclaredConstructors(); | protected Constructor getGreediestSatisifableConstructor(List adapterInstantiationOrderTrackingList) throws PicoIntrospectionException, UnsatisfiableDependenciesException, AmbiguousComponentResolutionException, AssignabilityRegistrationException, NotConcreteRegistrationException { Constructor greediestConstructor = null; final Set conflicts = new HashSet(); final Set unsatisfiableDependencyTypes = new HashSet(); if(sortedMatchingConstructors == null) { sortedMatchingConstructors = getSortedMatchingConstructors(); } for (int i = 0; i < sortedMatchingConstructors.size(); i++) { List adapterDependencies = new ArrayList(); boolean failedDependency = false; Constructor constructor = (Constructor) sortedMatchingConstructors.get(i); Class[] parameterTypes = constructor.getParameterTypes(); Parameter[] currentParameters = parameters != null ? parameters : createDefaultParameters(parameterTypes);// Type[] genericParameterTypes = constructor.getGenericParameterTypes(); // remember: all constructors with less arguments than the given parameters are filtered out already for (int j = 0; j < currentParameters.length; j++) { ComponentAdapter adapter = currentParameters[j].resolveAdapter(getContainer(), parameterTypes[j]); if (adapter == null) { // perhaps it is an array or a generic collection if (parameterTypes[j].getComponentType() != null) { ComponentAdapter genericCollectionComponentAdapter = getGenericCollectionComponentAdapter(parameterTypes[j].getComponentType()); if (genericCollectionComponentAdapter != null) { genericCollectionComponentAdapter.setContainer(getContainer()); adapterDependencies.add(genericCollectionComponentAdapter); } else { failedDependency = true; unsatisfiableDependencyTypes.add(Arrays.asList(parameterTypes)); } } else { failedDependency = true; unsatisfiableDependencyTypes.add(Arrays.asList(parameterTypes)); } } else { // we can't depend on ourself if (adapter.equals(this)) { failedDependency = true; unsatisfiableDependencyTypes.add(Arrays.asList(parameterTypes)); } else if (getComponentKey().equals(adapter.getComponentKey())) { failedDependency = true; unsatisfiableDependencyTypes.add(Arrays.asList(parameterTypes)); } else { adapterDependencies.add(adapter); } } } if (!failedDependency) { if(conflicts.size() == 0 && greediestConstructor == null) { greediestConstructor = constructor; adapterInstantiationOrderTrackingList.addAll(adapterDependencies); } else if (conflicts.size() == 0 && greediestConstructor.getParameterTypes().length > parameterTypes.length) { // remember: we're sorted by length, therefore we've already found the optimal constructor break; } else { if (greediestConstructor != null) { conflicts.add(greediestConstructor); greediestConstructor = null; } conflicts.add(constructor); adapterInstantiationOrderTrackingList.clear(); } } } if (!conflicts.isEmpty()) { throw new TooManySatisfiableConstructorsException(getComponentImplementation(), conflicts); } if (greediestConstructor == null && unsatisfiableDependencyTypes.size() > 0) { throw new UnsatisfiableDependenciesException(this, unsatisfiableDependencyTypes); } if (greediestConstructor == null) { // be nice to the user, show all constructors that were filtered out final Set nonMatching = new HashSet(); final Constructor[] constructors = getComponentImplementation().getConstructors(); for (int i = 0; i < constructors.length; i++) { if (!sortedMatchingConstructors.contains(constructors[i])) { nonMatching.add(constructors[i]); } else { // TODO - will it ever get here?, is the if() bogus? } } if (nonMatching.size() > 0) { throw new PicoInitializationException("The specified parameters do not match any of the following constructors: " + nonMatching.toString() + " for '" + getComponentImplementation() + "'"); } else { throw new PicoInitializationException("There are no public constructors for '" + getComponentImplementation() + "'"); } } return greediestConstructor; } | 14040 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/14040/f0be5fbf6463ebcaa1346450d85ff363d7ed963f/ConstructorInjectionComponentAdapter.java/buggy/java/picocontainer/src/java/org/picocontainer/defaults/ConstructorInjectionComponentAdapter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
11417,
7162,
15656,
77,
395,
15163,
291,
430,
429,
6293,
12,
682,
4516,
10675,
7072,
2448,
12642,
682,
13,
1216,
453,
10764,
1702,
26362,
503,
16,
1351,
12973,
7396,
2214,
8053,
503,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11417,
7162,
15656,
77,
395,
15163,
291,
430,
429,
6293,
12,
682,
4516,
10675,
7072,
2448,
12642,
682,
13,
1216,
453,
10764,
1702,
26362,
503,
16,
1351,
12973,
7396,
2214,
8053,
503,
... |
OPT_MemoryOperand M = OPT_MemoryOperand.BD(R(PR),tsr,(byte)4,null,null); | OPT_MemoryOperand M = OPT_MemoryOperand.BD(new OPT_RegisterOperand(PR, VM_TypeReference.Int),tsr,(byte)4,null,null); | private static OPT_Instruction yield_point(OPT_Instruction s, OPT_IR ir) { OPT_Instruction nextInstr = s.nextInstructionInCodeOrder(); if (ir.options.FIXED_JTOC) return nextInstr; // defer expansion until later s.insertBefore(MIR_UnaryNoRes.create(REQUIRE_ESP, IC(0))); // get the correct method and condition for a yieldpoint VM_Method meth; OPT_IA32ConditionOperand ypCond; if (s.getOpcode() == YIELDPOINT_PROLOGUE_opcode) { meth = VM_Entrypoints.optThreadSwitchFromPrologueMethod; ypCond = OPT_IA32ConditionOperand.NE(); } else if (s.getOpcode() == YIELDPOINT_EPILOGUE_opcode) { meth = VM_Entrypoints.optThreadSwitchFromEpilogueMethod; ypCond = OPT_IA32ConditionOperand.NE(); } else { meth = VM_Entrypoints.optThreadSwitchFromBackedgeMethod; ypCond = OPT_IA32ConditionOperand.GT(); } // split the basic block after the yieldpoint OPT_BasicBlock thisBlock = s.getBasicBlock(); OPT_BasicBlock nextBlock = thisBlock.splitNodeWithLinksAt(s,ir); // create a basic block at the end of the IR to hold the yieldpoint OPT_BasicBlock yieldpoint = thisBlock.createSubBlock(s.bcIndex, ir, .00001f); thisBlock.insertOut(yieldpoint); yieldpoint.insertOut(nextBlock); ir.cfg.addLastInCodeOrder(yieldpoint); Offset offset = meth.getOffset(); OPT_Operand jtoc = OPT_MemoryOperand.BD(R(ir.regpool.getPhysicalRegisterSet().getPR()), VM_Entrypoints.jtocField.getOffset(), (byte)4, null, TG()); OPT_RegisterOperand regOp = ir.regpool.makeTempInt(); yieldpoint.appendInstruction(MIR_Move.create(IA32_MOV, regOp, jtoc)); OPT_Operand target = OPT_MemoryOperand.BD(regOp.copyD2U(), offset, (byte)4, new OPT_LocationOperand(offset), TG()); // call thread switch OPT_Instruction call = MIR_Call.create0(CALL_SAVE_VOLATILE, null, null, target, OPT_MethodOperand.STATIC(meth)); call.markAsNonPEI(); call.copyPosition(s); yieldpoint.appendInstruction(call); yieldpoint.appendInstruction(MIR_Branch.create(IA32_JMP, nextBlock.makeJumpTarget())); // Check to see if threadSwitch requested OPT_Register PR = ir.regpool.getPhysicalRegisterSet().getPR(); Offset tsr = VM_Entrypoints.takeYieldpointField.getOffset(); OPT_MemoryOperand M = OPT_MemoryOperand.BD(R(PR),tsr,(byte)4,null,null); OPT_Instruction compare = MIR_Compare.create(IA32_CMP, M, IC(0)); s.insertBefore(compare); MIR_CondBranch.mutate(s, IA32_JCC, ypCond, yieldpoint.makeJumpTarget(), OPT_BranchProfileOperand.unlikely()); return nextInstr; } | 49871 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49871/34d593e20db098ebb2906460112536d78ee1592a/OPT_ComplexLIR2MIRExpansion.java/buggy/rvm/src/vm/arch/intel/compilers/optimizing/ir/conversions/lir2mir/OPT_ComplexLIR2MIRExpansion.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
760,
16456,
67,
11983,
2824,
67,
1153,
12,
15620,
67,
11983,
272,
16,
16456,
67,
7937,
9482,
13,
288,
565,
16456,
67,
11983,
1024,
382,
701,
273,
272,
18,
4285,
11983,
382,
1085,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
760,
16456,
67,
11983,
2824,
67,
1153,
12,
15620,
67,
11983,
272,
16,
16456,
67,
7937,
9482,
13,
288,
565,
16456,
67,
11983,
1024,
382,
701,
273,
272,
18,
4285,
11983,
382,
1085,
... |
System.err.println("No config file found, creating new: "+f); | System.err.println("Cannot open temp config file either: "+tempFilename+" : "+e); | public FilePersistentConfig(File f) throws IOException { this.filename = f; this.tempFilename = new File(f.getPath()+".tmp"); boolean filenameExists = f.exists(); boolean tempFilenameExists = tempFilename.exists(); if(filenameExists && !filename.canWrite()) { Logger.error(this, "Warning: Cannot write to config file: "+filename); System.err.println("Warning: Cannot write to config file: "+filename); } if(tempFilenameExists && !tempFilename.canWrite()) { Logger.error(this, "Warning: Cannot write to config tempfile: "+tempFilename); System.err.println("Warning: Cannot write to config tempfile: "+tempFilename); } if(filenameExists) { if(f.canRead()) { try { initialLoad(filename); return; } catch (FileNotFoundException e) { System.err.println("No config file found, creating new: "+f); } catch (EOFException e) { System.err.println("Empty config file "+f); } // Other IOE's indicate a more serious problem. } else { throw new IOException("Cannot read config file"); } } if(tempFilename.exists()) { if(tempFilename.canRead()) { try { initialLoad(tempFilename); } catch (FileNotFoundException e) { System.err.println("No config file found, creating new: "+f); } // Other IOE's indicate a more serious problem. } else { throw new IOException("Cannot read config file"); } } else { System.err.println("No config file found, creating new: "+f); } } | 51834 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51834/8ab204955a98e7d52599fbcf20f449e9bc1f96d4/FilePersistentConfig.java/clean/src/freenet/config/FilePersistentConfig.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1387,
11906,
809,
12,
812,
284,
13,
1216,
1860,
288,
202,
202,
2211,
18,
3459,
273,
284,
31,
202,
202,
2211,
18,
5814,
5359,
273,
394,
1387,
12,
74,
18,
588,
743,
1435,
9078... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1387,
11906,
809,
12,
812,
284,
13,
1216,
1860,
288,
202,
202,
2211,
18,
3459,
273,
284,
31,
202,
202,
2211,
18,
5814,
5359,
273,
394,
1387,
12,
74,
18,
588,
743,
1435,
9078... |
cfw.addInvoke(ByteCode.INVOKEVIRTUAL, generatedClassName, "callDirect", fnCurrent.getDirectCallMethodSignature()); | cfw.addInvoke(ByteCode.INVOKESTATIC, mainClassName, getBodyMethodName(fn), getBodyMethodSignature(fn)); | private void emitDirectConstructor() {/* we generate .. Scriptable directConstruct(<directCallArgs>) { Scriptable newInstance = createObject(cx, scope); Object val = callDirect(cx, scope, newInstance, <directCallArgs>); if (val instanceof Scriptable && val != Undefined.instance) { return (Scriptable) val; } return newInstance; }*/ short flags = (short)(ClassFileWriter.ACC_PUBLIC | ClassFileWriter.ACC_FINAL); cfw.startMethod("constructDirect", fnCurrent.getDirectCallMethodSignature(), flags); int argCount = fnCurrent.getParamCount(); int firstLocal = (4 + argCount * 3) + 1; cfw.addALoad(0); // this cfw.addALoad(1); // cx cfw.addALoad(2); // scope cfw.addInvoke(ByteCode.INVOKEVIRTUAL, "org/mozilla/javascript/BaseFunction", "createObject", "(Lorg/mozilla/javascript/Context;" +"Lorg/mozilla/javascript/Scriptable;" +")Lorg/mozilla/javascript/Scriptable;"); cfw.addAStore(firstLocal); cfw.addALoad(0); cfw.addALoad(1); cfw.addALoad(2); cfw.addALoad(firstLocal); for (int i = 0; i < argCount; i++) { cfw.addALoad(4 + (i * 3)); cfw.addDLoad(5 + (i * 3)); } cfw.addALoad(4 + argCount * 3); cfw.addInvoke(ByteCode.INVOKEVIRTUAL, generatedClassName, "callDirect", fnCurrent.getDirectCallMethodSignature()); int exitLabel = cfw.acquireLabel(); cfw.add(ByteCode.DUP); // make a copy of callDirect result cfw.add(ByteCode.INSTANCEOF, "org/mozilla/javascript/Scriptable"); cfw.add(ByteCode.IFEQ, exitLabel); cfw.add(ByteCode.DUP); // make a copy of callDirect result pushUndefined(cfw); cfw.add(ByteCode.IF_ACMPEQ, exitLabel); // cast callDirect result cfw.add(ByteCode.CHECKCAST, "org/mozilla/javascript/Scriptable"); cfw.add(ByteCode.ARETURN); cfw.markLabel(exitLabel); cfw.addALoad(firstLocal); cfw.add(ByteCode.ARETURN); cfw.stopMethod((short)(firstLocal + 1), null); } | 19042 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/19042/7de4ae25f0fd144cbc3ddabc47e7a327a747af5a/Codegen.java/clean/src/org/mozilla/javascript/optimizer/Codegen.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
3626,
5368,
6293,
1435,
565,
288,
20308,
565,
732,
2103,
6116,
3639,
22780,
2657,
7249,
12,
32,
7205,
1477,
2615,
23429,
288,
5411,
22780,
5984,
273,
17109,
12,
71,
92,
16,
214... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3626,
5368,
6293,
1435,
565,
288,
20308,
565,
732,
2103,
6116,
3639,
22780,
2657,
7249,
12,
32,
7205,
1477,
2615,
23429,
288,
5411,
22780,
5984,
273,
17109,
12,
71,
92,
16,
214... |
else if (data[0] instanceof ArrayList) { if (! (data[1] instanceof Number)) { throw new PainterException("wrong arguments"); } context.operands.push( ( (ArrayList) data[0]).get( ( (Number) data[1]). intValue())); | patoken = (PAToken) data[1]; if (! (patoken.type == PAToken.KEY)) { throw new PainterException("put: wrong arguments"); | public void execute(PAContext context) throws PainterException { Object data[]; PAToken patoken; data = context.popOperands(2); if (! (data[0] instanceof HashMap) && ! (data[0] instanceof ArrayList)) { throw new PainterException("wrong arguments"); } if (data[0] instanceof HashMap) { if (! (data[1] instanceof PAToken)) { throw new PainterException("wrong arguments"); } patoken = (PAToken) data[1]; if (! (patoken.type == PAToken.KEY)) { throw new PainterException("wrong arguments"); } context.operands.push( ( (HashMap) data[0]).get(patoken.value)); } else if (data[0] instanceof ArrayList) { if (! (data[1] instanceof Number)) { throw new PainterException("wrong arguments"); } context.operands.push( ( (ArrayList) data[0]).get( ( (Number) data[1]). intValue())); } } | 3011 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3011/a9e36ef1e4e4be2e6d4839ed4e5a42aabe172a12/PAContext.java/clean/itext/src/com/lowagie/text/pdf/codec/postscript/PAContext.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4202,
1071,
918,
1836,
12,
4066,
1042,
819,
13,
1216,
453,
11606,
503,
288,
3639,
1033,
501,
8526,
31,
3639,
17988,
969,
9670,
969,
31,
3639,
501,
273,
819,
18,
5120,
3542,
5708,
12,
22,
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,
4202,
1071,
918,
1836,
12,
4066,
1042,
819,
13,
1216,
453,
11606,
503,
288,
3639,
1033,
501,
8526,
31,
3639,
17988,
969,
9670,
969,
31,
3639,
501,
273,
819,
18,
5120,
3542,
5708,
12,
22,
176... |
protected Object chooseBaseClass(){ List elementsFound = findClassElementsInProject(); ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new CSearchResultLabelProvider()); dialog.setTitle(NewWizardMessages.getString("BaseClassSelectionDialog.title")); dialog.setMessage(NewWizardMessages.getString("BaseClassSelectionDialog.message")); dialog.setElements(elementsFound.toArray()); dialog.setFilter("*"); if (dialog.open() == ElementListSelectionDialog.OK) { Object element= dialog.getFirstResult(); return element; } return null; | protected ITypeInfo chooseBaseClass(){ ITypeInfo[] elementsFound= findClassElementsInProject(); if (elementsFound == null || elementsFound.length == 0) { String title= NewWizardMessages.getString("NewClassWizardPage.getProjectClasses.noclasses.title"); String message= NewWizardMessages.getString("NewClassWizardPage.getProjectClasses.noclasses.message"); MessageDialog.openInformation(getShell(), title, message); return null; } BaseClassSelectionDialog dialog= new BaseClassSelectionDialog(getShell()); dialog.setElements(elementsFound); int result= dialog.open(); if (result != IDialogConstants.OK_ID) return null; return (ITypeInfo)dialog.getFirstResult(); | protected Object chooseBaseClass(){ // find the available classes in this project List elementsFound = findClassElementsInProject(); ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new CSearchResultLabelProvider()); dialog.setTitle(NewWizardMessages.getString("BaseClassSelectionDialog.title")); //$NON-NLS-1$ dialog.setMessage(NewWizardMessages.getString("BaseClassSelectionDialog.message")); //$NON-NLS-1$ dialog.setElements(elementsFound.toArray()); dialog.setFilter("*"); //$NON-NLS-1$ if (dialog.open() == ElementListSelectionDialog.OK) { Object element= dialog.getFirstResult(); return element; } return null; } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/0eb69047b450b0f033d3534e240c5f87ebfc1eae/NewClassWizardPage.java/clean/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassWizardPage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
1033,
9876,
2171,
797,
1435,
95,
202,
202,
759,
1104,
326,
2319,
3318,
316,
333,
1984,
202,
202,
682,
2186,
2043,
273,
1104,
797,
3471,
382,
4109,
5621,
9506,
202,
1046,
682,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1033,
9876,
2171,
797,
1435,
95,
202,
202,
759,
1104,
326,
2319,
3318,
316,
333,
1984,
202,
202,
682,
2186,
2043,
273,
1104,
797,
3471,
382,
4109,
5621,
9506,
202,
1046,
682,
... |
"page", ControlEnableState.disable(currentPage.getControl(), (focusControl != null) ? Collections.singletonList(focusControl) : null)); | "page", ControlEnableState.disable(currentPage.getControl())); | private Map saveUIState(boolean keepCancelEnabled, Control focusControl) { Map savedState = new HashMap(10); saveEnableStateAndSet(backButton, savedState, "back", false); //$NON-NLS-1$ saveEnableStateAndSet(nextButton, savedState, "next", false); //$NON-NLS-1$ saveEnableStateAndSet(finishButton, savedState, "finish", false); //$NON-NLS-1$ saveEnableStateAndSet(cancelButton, savedState, "cancel", keepCancelEnabled); //$NON-NLS-1$ saveEnableStateAndSet(helpButton, savedState, "help", false); //$NON-NLS-1$ if (currentPage != null) { savedState .put( "page", ControlEnableState.disable(currentPage.getControl(), (focusControl != null) ? Collections.singletonList(focusControl) : null)); //$NON-NLS-1$ } /* * The focus control must be disabled last as the disabling could search * for a new control to set focus to. This can throw superfluous FocusOut events * during the disabling process. */ if (focusControl != null) { saveEnableStateAndSet(focusControl, savedState, "focus", false); //$NON-NLS-1$ } return savedState; } | 55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/a6a7199102aa23c8fa6b16b58e084434454f8501/WizardDialog.java/clean/bundles/org.eclipse.jface/src/org/eclipse/jface/wizard/WizardDialog.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
1635,
1923,
5370,
1119,
12,
6494,
3455,
6691,
1526,
16,
8888,
7155,
3367,
13,
288,
3639,
1635,
5198,
1119,
273,
394,
4317,
12,
2163,
1769,
3639,
1923,
8317,
1119,
13152,
12,
823,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
1635,
1923,
5370,
1119,
12,
6494,
3455,
6691,
1526,
16,
8888,
7155,
3367,
13,
288,
3639,
1635,
5198,
1119,
273,
394,
4317,
12,
2163,
1769,
3639,
1923,
8317,
1119,
13152,
12,
823,
36... |
public int doEndTag() throws JspException { //System.err.println("in TableRowTag:doEndTag"); TableTag tableTag = (TableTag)getParent(); if (tableTag != null) { Iterator it = list.iterator(); while (it.hasNext()) { BaseComponentBean bean = (BaseComponentBean)it.next(); rowBean.addBean(bean); } DefaultTableModel tableModel = tableTag.getTableModel(); tableModel.addTableRowBean(rowBean); tableTag.setTableModel(tableModel); } return EVAL_PAGE; } | 49343 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49343/a68a3484a5f14c46bcce87dedf434471235ecbda/TableRowTag.java/clean/src/org/gridlab/gridsphere/tags/portletui/TableRowTag.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
474,
2896,
25633,
1435,
15069,
21796,
503,
95,
759,
3163,
18,
370,
18,
8222,
2932,
267,
30650,
1805,
30,
2896,
25633,
8863,
1388,
1805,
2121,
1805,
28657,
1388,
1805,
13,
588,
3054,
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,
1071,
474,
2896,
25633,
1435,
15069,
21796,
503,
95,
759,
3163,
18,
370,
18,
8222,
2932,
267,
30650,
1805,
30,
2896,
25633,
8863,
1388,
1805,
2121,
1805,
28657,
1388,
1805,
13,
588,
3054,
5621,
... | ||
public PyObject __ipow__(PyObject other) { return _pow(other); } | public PyObject __ipow__(PyObject other) { return _pow(other); } | public PyObject __ipow__(PyObject other) { return _pow(other); } | 6527 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6527/f1a14fc2e5b8633379ef5db31fa9e36925099543/PyObject.java/clean/org/python/core/PyObject.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
4707,
921,
1001,
625,
543,
972,
12,
9413,
921,
1308,
13,
288,
327,
389,
23509,
12,
3011,
1769,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
4707,
921,
1001,
625,
543,
972,
12,
9413,
921,
1308,
13,
288,
327,
389,
23509,
12,
3011,
1769,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
player.setMulligansLeft(0); | if (!getClientOption(Options.debugMulligans)) { player.setMulligansLeft(0); } | public boolean doneWithRecruits(String playerName) { if (playerName != getActivePlayerName()) { return false; } Player player = game.getPlayer(playerName); player.commitMoves(); // Mulligans are only allowed on turn 1. player.setMulligansLeft(0); game.advancePhase(Constants.MUSTER, playerName); return true; } | 51862 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51862/b2c7670d380ebf25b7a297a82ecb670764ad3144/Server.java/buggy/Colossus/net/sf/colossus/server/Server.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1250,
2731,
1190,
426,
3353,
89,
1282,
12,
780,
7291,
461,
13,
565,
288,
3639,
309,
261,
14872,
461,
480,
11960,
12148,
461,
10756,
3639,
288,
5411,
327,
629,
31,
3639,
289,
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,
1250,
2731,
1190,
426,
3353,
89,
1282,
12,
780,
7291,
461,
13,
565,
288,
3639,
309,
261,
14872,
461,
480,
11960,
12148,
461,
10756,
3639,
288,
5411,
327,
629,
31,
3639,
289,
3639,
... |
if(columnList == null || selected_colName == null || seqName_top == null) { | java.util.List columnList = sortedColumns; java.util.List sequencesList = sortedSequences; if(columnList == null || sequencesList == null || seqName_top == null) { | public List getSortedSequences(Set sequences) { // step 1: copy whichever sequence we've been told to put on top String seqName_top = tableManager.getReferenceSequence(); // step 2: copy out a basic sequencesList List sequencesList = new Vector(sequences); List columnList = new Vector(sortedColumns); columnList.remove(0); // get rid of "Sequence name" columnList.remove(0); // get rid of "Total score" columnList.remove(0); // get rid of "No of charsets" if(seqName_top == null) { if(sequencesList.size() > 0) seqName_top = (String) sequencesList.get(0); } if(columnList == null || selected_colName == null || seqName_top == null) { // something's not right; bail out sortedSequences = sequencesList; return sequencesList; } if(override_reference_sequence != null) seqName_top = override_reference_sequence; // Okay: NOW, we need to calculate all the distances! Isn't this fun?! distances = new double[columnList.size()][sequencesList.size()]; // TODO: catch OutOfMemory here? double max[] = new double[columnList.size()]; Arrays.fill(max, -1.0); double min[] = new double[columnList.size()]; Arrays.fill(min, +2.0); // pass 1: calculate all the distances, figure out max and min for(int x = 0; x < columnList.size(); x++) { String colName = (String) columnList.get(x); for(int y = 0; y < sequencesList.size(); y++) { String seqName = (String) sequencesList.get(y); Sequence seq = tableManager.getSequence(colName, seqName); Sequence seq_compare = tableManager.getSequence(colName, seqName_top); double dist = DIST_ILLEGAL; if(seq_compare == null) { dist = DIST_NO_COMPARE_SEQ; } else if(seqName_top.equals(seqName)) { dist = DIST_SEQ_ON_TOP; } else if(seq == null) { if(tableManager.isSequenceCancelled(colName, seqName)) dist = DIST_CANCELLED; else dist = DIST_SEQ_NA; } else if((dist = seq.getPairwise(seq_compare)) < 0) { // illegal! dist = DIST_NO_OVERLAP; } distances[x][y] = dist; if(dist >= 0) { if(dist > max[x]) max[x] = dist; if(dist < min[x]) min[x] = dist; } } } // pass 2: normalise this norm_distances = new double[columnList.size()][sequencesList.size()]; for(int x = 0; x < columnList.size(); x++) { for(int y = 0; y < sequencesList.size(); y++) { if(distances[x][y] >= 0) norm_distances[x][y] = (distances[x][y] - min[x])/(max[x] - min[x]); else norm_distances[x][y] = distances[x][y]; // save the <0's } } // pass 3: now, we've got rationalised numbers // we need to figure out the average of THESE, and use THIS to sort the // sequenceList. scores = (List) new Vector(); for(int y = 0; y < sequencesList.size(); y++) { String seqName = (String) sequencesList.get(y); double totalScore = 0.0; int count = 0; for(int x = 0; x < columnList.size(); x++) { String colName = (String) columnList.get(x); if(colName.equals(selected_colName)) continue; if(distances[x][y] >= 0) { totalScore += norm_distances[x][y]; count++; } } totalScore = totalScore/count; scores.add(new Score(seqName, totalScore)); } // sort out the sequence names ... Collections.sort(scores); double[][] old_distances = distances; // ditto (see below) double[][] old_norm_distances = norm_distances; // I'm just saving a pointer, I hope norm_distances = new double[columnList.size()][scores.size()]; // and writing over the old POINTER, // NOT the old data. I hope. distances = new double[columnList.size()][scores.size()]; // ditto (see above) // ... and resort the distances[][] table. Iterator i = scores.iterator(); int seqIndex = 0; while(i.hasNext()) { String seqName = ((Score) i.next()).getName(); int oldIndex = sequencesList.indexOf(seqName); for(int x = 0; x < columnList.size(); x++) { distances[x][seqIndex] = old_distances[x][oldIndex]; norm_distances[x][seqIndex] = old_norm_distances[x][oldIndex]; } seqIndex++; } old_distances = null; // free the array old_norm_distances = null; sequencesList = (List) new Vector(); i = scores.iterator(); while(i.hasNext()) { String seqName = ((Score) i.next()).getName(); sequencesList.add(seqName); } // Now that we have a definite list, nicely synced up and // everything, we can figure out the rank table! // ranks = new int[columnList.size()][sequencesList.size()]; for(int x = 0; x < columnList.size(); x++) { LinkedList ll = new LinkedList(); // easier to append for(int y = 0; y < sequencesList.size(); y++) { if(distances[x][y] >= 0) ll.add(new Double(distances[x][y])); } Collections.sort(ll); for(int y = 0; y < sequencesList.size(); y++) { if(distances[x][y] >= 0) ranks[x][y] = ll.indexOf(new Double(distances[x][y])); else ranks[x][y] = (int) Math.floor(distances[x][y]); } } sortedSequences = sequencesList; //testCorrelation(); return sequencesList; } | 47892 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47892/cc3538b3e2c8a86dc7ca9c65d0730c02cc469620/DisplayCorrelationsMode.java/clean/TaxonDNA/com/ggvaidya/TaxonDNA/SequenceMatrix/DisplayCorrelationsMode.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
987,
15175,
329,
21710,
12,
694,
8463,
13,
288,
202,
202,
759,
2235,
404,
30,
1610,
600,
335,
580,
502,
3102,
732,
8081,
2118,
268,
1673,
358,
1378,
603,
1760,
202,
202,
780,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
987,
15175,
329,
21710,
12,
694,
8463,
13,
288,
202,
202,
759,
2235,
404,
30,
1610,
600,
335,
580,
502,
3102,
732,
8081,
2118,
268,
1673,
358,
1378,
603,
1760,
202,
202,
780,
... |
String[] foo = IMCServiceRMI.sqlQuery(imcserver, sqlStr) ; | String[] foo = imcref.sqlQuery( sqlStr) ; | public void service( HttpServletRequest req, HttpServletResponse res ) throws ServletException, IOException { String host = req.getHeader("Host") ; String imcserver = Utility.getDomainPref("adminserver",host) ; String start_url = Utility.getDomainPref( "start_url",host ) ; imcode.server.User user ; String htmlStr = "" ; String child_str = "" ; int meta_id ; Vector childs = new Vector( ) ; Vector sort_no = new Vector( ) ; res.setContentType( "text/html" ); Writer out = res.getWriter( ) ; meta_id = Integer.parseInt( req.getParameter( "meta_id" ) ) ; int doc_menu_no = Integer.parseInt( req.getParameter( "doc_menu_no" ) ) ; child_str = req.getParameter( "childs" ) ; // Check if user logged on if ( (user=Check.userLoggedOn(req,res,start_url))==null ) { return ; } if ( !IMCServiceRMI.checkDocAdminRights(imcserver,meta_id,user,262144 ) ) { // Checking to see if user may edit this String output = AdminDoc.adminDoc(meta_id,meta_id,host,user,req,res) ; if ( output != null ) { out.write(output) ; } return ; } String temp_str = "" ; String childsThisMenu[] ; SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd") ; Date dt = IMCServiceRMI.getCurrentDate(imcserver) ; String sqlStr = "update meta set date_modified = '"+dateformat.format(dt)+"' where meta_id = "+meta_id ; IMCServiceRMI.sqlUpdateQuery(imcserver,sqlStr) ; sqlStr = "select to_meta_id from childs where meta_id = " + meta_id ; String[] foo = IMCServiceRMI.sqlQuery(imcserver, sqlStr) ; for ( int i=0 ; i<foo.length ; ++i ) { temp_str = req.getParameter(foo[i]) ; if ( temp_str != null ) { childs.add(foo[i]) ; sort_no.add(temp_str) ; } } childsThisMenu = req.getParameterValues( "archiveDelBox" ) ; user.put("flags",new Integer(262144)) ; if( req.getParameter("sort")!=null ) { String sort_order = req.getParameter("sort_order") ; IMCServiceRMI.sqlUpdateQuery(imcserver,"update text_docs set sort_order = "+sort_order+" where meta_id = "+meta_id) ; if ( childs.size() > 0 ) { IMCServiceRMI.saveManualSort( imcserver,meta_id,user,childs,sort_no ) ; } } else if( req.getParameter("delete")!=null ) { if( childsThisMenu != null ) { IMCServiceRMI.deleteChilds( imcserver,meta_id,doc_menu_no,user,childsThisMenu ) ; } } else if( req.getParameter("archive")!=null ) { if( childsThisMenu != null ) { IMCServiceRMI.archiveChilds( imcserver,meta_id,user,childsThisMenu ) ; } } else if( req.getParameter("copy")!=null ) { if( childsThisMenu != null ) { String copyPrefix = IMCServiceRMI.parseDoc(imcserver, null, COPY_PREFIX_TEMPLATE, user.getLangPrefix()); String[] file_meta_ids = IMCServiceRMI.copyDocs( imcserver,meta_id,doc_menu_no,user,childsThisMenu,copyPrefix ) ; if (file_meta_ids.length > 0) { // Build an option-list StringBuffer fileMetaIds = new StringBuffer() ; for (int i=0; i<file_meta_ids.length; ++i) { imcode.server.parser.Document doc = IMCServiceRMI.getDocument(imcserver,Integer.parseInt(file_meta_ids[i])) ; fileMetaIds.append("<option>["+file_meta_ids[i]+"] "+doc.getHeadline()+"</option>") ; } Vector vec = new Vector() ; vec.add("#meta_id#") ; vec.add(""+meta_id) ; vec.add("#filedocs#") ; vec.add(fileMetaIds.toString()) ; String fileWarning = IMCServiceRMI.parseDoc(imcserver,vec,FILE_WARNING_TEMPLATE, user.getLangPrefix()) ; out.write(fileWarning) ; return ; } } } String output = AdminDoc.adminDoc(meta_id,meta_id,host,user,req,res) ; if ( output != null ) { out.write(output) ; } } | 8781 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8781/a270627916b37a677a391dd9f45c54d3d6f12503/SaveSort.java/clean/servlets/SaveSort.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1156,
12,
9984,
1111,
16,
12446,
400,
262,
1216,
16517,
16,
1860,
288,
202,
780,
1479,
9506,
202,
33,
1111,
18,
588,
1864,
2932,
2594,
7923,
274,
202,
780,
709,
71,
3567,
108... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1156,
12,
9984,
1111,
16,
12446,
400,
262,
1216,
16517,
16,
1860,
288,
202,
780,
1479,
9506,
202,
33,
1111,
18,
588,
1864,
2932,
2594,
7923,
274,
202,
780,
709,
71,
3567,
108... |
Logger.minor(this, "compare("+o1+","+o2+") = "+x); | Logger.debug(this, "compare("+o1+","+o2+") = "+x); | public int compare(Object o1, Object o2) { int x = ocompare(o1, o2); Logger.minor(this, "compare("+o1+","+o2+") = "+x); return x; } | 50653 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50653/a6a9cc01004d94d4bdefc0b76c0bdb1962187369/SimpleIntNumberedItemComparator.java/clean/src/freenet/support/SimpleIntNumberedItemComparator.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
509,
3400,
12,
921,
320,
21,
16,
1033,
320,
22,
13,
288,
3639,
509,
619,
273,
320,
9877,
12,
83,
21,
16,
320,
22,
1769,
3639,
4242,
18,
4148,
12,
2211,
16,
315,
9877,
2932,
15... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3400,
12,
921,
320,
21,
16,
1033,
320,
22,
13,
288,
3639,
509,
619,
273,
320,
9877,
12,
83,
21,
16,
320,
22,
1769,
3639,
4242,
18,
4148,
12,
2211,
16,
315,
9877,
2932,
15... |
if(null != toggleHistoryJLabel && toggleHistoryJLabel.isEnabled()) { if(getController().isHistoryVisible()) { return HIDE_HISTORY_ICON; } else { return SHOW_HISTORY_ICON; } } else { return INVISIBLE_HISTORY_ICON; } } | if(null != toggleHistoryJLabel && toggleHistoryJLabel.isEnabled()) { if(getController().isHistoryVisible()) { return HIDE_HISTORY_ICON; } else { return SHOW_HISTORY_ICON; } } else { return INVISIBLE_HISTORY_ICON; } } | private Icon getHistoryIcon() { if(null != toggleHistoryJLabel && toggleHistoryJLabel.isEnabled()) { if(getController().isHistoryVisible()) { return HIDE_HISTORY_ICON; } else { return SHOW_HISTORY_ICON; } } else { return INVISIBLE_HISTORY_ICON; } } | 53635 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53635/307eed86bd6b2e7a0979608d755659b8a324e0b6/BrowserInfoAvatar.java/clean/local/browser/src/main/java/com/thinkparity/browser/application/browser/display/avatar/BrowserInfoAvatar.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
16011,
336,
5623,
5554,
1435,
288,
202,
202,
430,
12,
2011,
480,
10486,
5623,
46,
2224,
597,
10486,
5623,
46,
2224,
18,
291,
1526,
10756,
288,
1082,
202,
430,
12,
588,
2933,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16011,
336,
5623,
5554,
1435,
288,
202,
202,
430,
12,
2011,
480,
10486,
5623,
46,
2224,
597,
10486,
5623,
46,
2224,
18,
291,
1526,
10756,
288,
1082,
202,
430,
12,
588,
2933,
... |
IRubyObject module = getConstantAt(name); return (module instanceof RubyClass) ? (RubyClass) module : null; | IRubyObject module = getConstantAt(name); return (module instanceof RubyClass) ? (RubyClass) module : null; | public RubyClass getClass(String name) { IRubyObject module = getConstantAt(name); return (module instanceof RubyClass) ? (RubyClass) module : null; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
19817,
797,
2900,
12,
780,
508,
13,
288,
377,
202,
7937,
10340,
921,
1605,
273,
24337,
861,
12,
529,
1769,
377,
202,
377,
202,
2463,
225,
261,
2978,
1276,
19817,
797,
13,
692,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
19817,
797,
2900,
12,
780,
508,
13,
288,
377,
202,
7937,
10340,
921,
1605,
273,
24337,
861,
12,
529,
1769,
377,
202,
377,
202,
2463,
225,
261,
2978,
1276,
19817,
797,
13,
692,
261... |
if (input instanceof cdrBufInput) | if (input instanceof BufferredCdrInput) | private static cdrBufOutput createBuffer(InputStream input, int proposed_size) { cdrBufOutput bout; bout = new cdrBufOutput(2 * proposed_size + 256); if (input instanceof cdrBufInput) { cdrBufInput in = (cdrBufInput) input; bout.setBigEndian(in.isBigEndian()); } if (input instanceof gnuValueStream) bout.setRunTime(((gnuValueStream) input).getRunTime()); else bout.setRunTime(new gnuRuntime(null, null)); return bout; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e9344cb85925e12da0e0cccb4ba0521d8696a226/Vio.java/clean/core/src/classpath/gnu/gnu/CORBA/CDR/Vio.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
760,
276,
3069,
5503,
1447,
752,
1892,
12,
4348,
810,
16,
509,
20084,
67,
1467,
13,
225,
288,
565,
276,
3069,
5503,
1447,
31095,
31,
565,
31095,
273,
394,
276,
3069,
5503,
1447,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
760,
276,
3069,
5503,
1447,
752,
1892,
12,
4348,
810,
16,
509,
20084,
67,
1467,
13,
225,
288,
565,
276,
3069,
5503,
1447,
31095,
31,
565,
31095,
273,
394,
276,
3069,
5503,
1447,
1... |
synchronized (pg_stream) { | sendQuery(sql); | public java.sql.ResultSet execute() throws SQLException { int fqp = 0; boolean hfr = false; StringBuffer errorMessage = null; synchronized (pg_stream) { sendQuery(sql); while (!hfr || fqp > 0) { int c = pg_stream.ReceiveChar(); switch (c) { case 'A': // Asynchronous Notify int pid = pg_stream.ReceiveInteger(4); String msg = pg_stream.ReceiveString(connection.getEncoding()); break; case 'B': // Binary Data Transfer receiveTuple(true); break; case 'C': // Command Status receiveCommandStatus(); if (fields != null) hfr = true; else { sendQuery(" "); fqp++; } break; case 'D': // Text Data Transfer receiveTuple(false); break; case 'E': // Error Message // it's possible to get more than one error message for a query // see libpq comments wrt backend closing a connection // so, append messages to a string buffer and keep processing // check at the bottom to see if we need to throw an exception if ( errorMessage == null ) errorMessage = new StringBuffer(); errorMessage.append(pg_stream.ReceiveString(connection.getEncoding())); // keep processing break; case 'I': // Empty Query int t = pg_stream.ReceiveChar(); if (t != 0) throw new PSQLException("postgresql.con.garbled"); if (fqp > 0) fqp--; if (fqp == 0) hfr = true; break; case 'N': // Error Notification connection.addWarning(pg_stream.ReceiveString(connection.getEncoding())); break; case 'P': // Portal Name String pname = pg_stream.ReceiveString(connection.getEncoding()); break; case 'T': // MetaData Field Description receiveFields(); break; case 'Z': // backend ready for query, ignore for now :-) break; default: throw new PSQLException("postgresql.con.type", new Character((char) c)); } // did we get an error during this query? if ( errorMessage != null ) throw new SQLException( errorMessage.toString() ); } return connection.getResultSet(connection, statement, fields, tuples, status, update_count, insert_oid, binaryCursor); } } | 46312 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46312/ef7d7910745cf2812007668138eaaf0a8e1d8d99/QueryExecutor.java/buggy/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
2252,
18,
4669,
18,
13198,
1836,
1435,
1216,
6483,
202,
95,
202,
202,
474,
8508,
84,
273,
374,
31,
202,
202,
6494,
366,
4840,
273,
629,
31,
202,
202,
780,
1892,
9324,
273,
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,
482,
2252,
18,
4669,
18,
13198,
1836,
1435,
1216,
6483,
202,
95,
202,
202,
474,
8508,
84,
273,
374,
31,
202,
202,
6494,
366,
4840,
273,
629,
31,
202,
202,
780,
1892,
9324,
273,
4... |
searchList.setSelectedIndex(new_index); searchList.ensureIndexIsVisible(new_index); | browseList.setSelectedIndex(new_index); browseList.ensureIndexIsVisible(new_index); | public void mouseWheelMoved(MouseWheelEvent e) { int new_index = searchList.getSelectedIndex() + e.getWheelRotation(); int list_size = searchList.getModel().getSize(); if (new_index < list_size && new_index >= 0) { searchList.setSelectedIndex(new_index); searchList.ensureIndexIsVisible(new_index); } } | 49828 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49828/ed859fe26a34736cfab02a44ad74bb68d42cd59f/ConfigDefinitionChooser.java/buggy/modules/jackal/editors/org/vrjuggler/jccl/editors/ConfigDefinitionChooser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1850,
1071,
918,
7644,
59,
11648,
25317,
12,
9186,
59,
11648,
1133,
425,
13,
1850,
288,
5411,
509,
394,
67,
1615,
273,
1623,
682,
18,
588,
7416,
1016,
1435,
397,
425,
18,
588,
59,
11648,
140... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1850,
1071,
918,
7644,
59,
11648,
25317,
12,
9186,
59,
11648,
1133,
425,
13,
1850,
288,
5411,
509,
394,
67,
1615,
273,
1623,
682,
18,
588,
7416,
1016,
1435,
397,
425,
18,
588,
59,
11648,
140... |
ProjectBrowser.getInstance() .setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); | ProjectBrowser.getInstance().setCursor( Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); | public void run() { // We shouldn't really turn off events, but as long // as we are, wrap in try block to make sure they get // turned back on. Model.getPump().stopPumpingEvents(); try { if (filesLeft.size() > 0) { // if there ae 2 passes: if (importLevel > 0) { if (filesLeft.size() <= countFiles / 2) { if (importLevel == 1) setAttribute("level", new Integer(1)); else setAttribute("level", new Integer(2)); } } Object curFile = filesLeft.elementAt(0); filesLeft.removeElementAt(0); try { st.mark(curFile.toString()); ProjectBrowser.getInstance() .showStatus("Importing " + curFile.toString()); parseFile(ProjectManager.getManager().getCurrentProject(), curFile); // Try to parse this file. int tot = countFiles; if (diagramInterface != null) { tot += diagramInterface.getModifiedDiagrams().size() / 10; } iss.setMaximum(tot); int act = countFiles - filesLeft.size() - nextPassFiles.size(); iss.setValue(act); ProjectBrowser.getInstance() .getStatusBar().showProgress(100 * act / tot); } catch (Exception e1) { nextPassFiles.addElement(curFile); StringBuffer sb = new StringBuffer(80); // RuntimeExceptions should be reported here! if (e1 instanceof RuntimeException) { sb.append("Program bug encountered while parsing "); sb.append(curFile.toString()); sb.append(", so some elements are not" + " created in the model\n"); StringWriter sw = new StringWriter(); PrintWriter pw = new java.io.PrintWriter(sw); e1.printStackTrace(pw); sb.append(sw.getBuffer()); LOG.error(sb.toString(), e1); } else { sb.append("Uncaught exception encountered" + " while parsing "); sb.append(curFile.toString()); sb.append(", so some elements are not " + "created in the model\n"); StringWriter sw = new StringWriter(); PrintWriter pw = new java.io.PrintWriter(sw); e1.printStackTrace(pw); sb.append(sw.getBuffer()); LOG.warn(sb.toString(), e1); } problems.append(sb); } if (!isCancelled()) { SwingUtilities.invokeLater(this); return; } } if (nextPassFiles.size() > 0 && nextPassFiles.size() < countFilesThisPass) { filesLeft = nextPassFiles; nextPassFiles = new Vector(); countFilesThisPass = filesLeft.size(); SwingUtilities.invokeLater(this); return; } // Do post load processings. st.mark("postprocessings"); // Check if any diagrams where modified and the project // should be saved before exiting. if (diagramInterface != null && needsSave()) { ProjectManager.getManager().setNeedsSave(true); } ProjectBrowser.getInstance().showStatus("Import done"); // Layout the modified diagrams. if (doLayout) { st.mark("layout"); if (diagramInterface != null) { for (int i = 0; i < diagramInterface.getModifiedDiagrams().size(); i++) { UMLDiagram diagram = (UMLDiagram) diagramInterface.getModifiedDiagrams() .elementAt(i); ClassdiagramLayouter layouter = module.getLayout(diagram); layouter.layout(); // Resize the diagram??? iss.setValue(countFiles + (i + 1) / 10); } } } iss.done(); ProjectBrowser.getInstance() .setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); // if errors occured, display the collected messages here if (problems != null && problems.length() > 0) { ProblemsDialog pd = new ProblemsDialog(); pd.setVisible(true); } // turn criticing on again if (criticThreadWasOn) Designer.theDesigner().setAutoCritique(true); ExplorerEventAdaptor.getInstance().structureChanged(); LOG.info(st); ProjectBrowser.getInstance().getStatusBar().showProgress(0); } finally { // Be sure event pump gets turned back on again. // Note: this doesn't deal with the critics Model.getPump().startPumpingEvents(); } } | 7166 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7166/f590a94b518a7f556db7f1ad4d20ebcb3652903a/Import.java/buggy/src_new/org/argouml/uml/reveng/Import.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
1071,
918,
1086,
1435,
288,
5411,
368,
1660,
12044,
1404,
8654,
7005,
3397,
2641,
16,
1496,
487,
1525,
5411,
368,
487,
732,
854,
16,
2193,
316,
775,
1203,
358,
1221,
3071,
2898,
336,
2398... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1086,
1435,
288,
5411,
368,
1660,
12044,
1404,
8654,
7005,
3397,
2641,
16,
1496,
487,
1525,
5411,
368,
487,
732,
854,
16,
2193,
316,
775,
1203,
358,
1221,
3071,
2898,
336,
2398... |
} catch (InvocationTargetException ite) { | } catch (Exception ex) { errorCount++; if (errorCount >= ERROR_THRESHOLD) { start = false; } | public boolean evaluate(Object event) throws NullPointerException, EvaluationException { try { Boolean result = (Boolean) ee.evaluate(getParameterValues(event)); return result.booleanValue(); } catch (InvocationTargetException ite) { throw new EvaluationException("Evaluator [" + name + "] caused an exception", ite); } } | 47666 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47666/7e755b8978a294df3e6d9708c2e25dcac0c5d6c8/JaninoEventEvaluatorBase.java/buggy/logback-core/src/main/java/ch/qos/logback/core/boolex/JaninoEventEvaluatorBase.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
1250,
5956,
12,
921,
871,
13,
1216,
10108,
16,
1377,
17340,
503,
288,
565,
775,
288,
1377,
3411,
563,
273,
261,
5507,
13,
14657,
18,
21024,
12,
588,
1662,
1972,
12,
2575,
10019,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1250,
5956,
12,
921,
871,
13,
1216,
10108,
16,
1377,
17340,
503,
288,
565,
775,
288,
1377,
3411,
563,
273,
261,
5507,
13,
14657,
18,
21024,
12,
588,
1662,
1972,
12,
2575,
10019,
1... |
return true; | public boolean isAssignableTo(Bundle bundle, String className) { AbstractBundle consumer = (AbstractBundle) bundle; // always return false for fragments if (consumer.isFragment()) return false; BundleHost producer = (BundleHost) registration.bundle; // 1) if the registrant == consumer always return true if (consumer == producer) return true; // 2) get the package name from the specified className String pkgName = BundleLoader.getPackageName(className); if (pkgName.startsWith("java.")) //$NON-NLS-1$ return true; BundleLoader producerBL = producer.getBundleLoader(); if (producerBL == null) return false; BundleLoader consumerBL = consumer.getBundleLoader(); if (consumerBL == null) return false; // 3) for the specified bundle, find the wiring for the package. If no wiring is found return true PackageSource consumerSource = consumerBL.getPackageSource(pkgName); if (consumerSource == null) return true; // 4) For the registrant bundle, find the wiring for the package. PackageSource producerSource = producerBL.getPackageSource(pkgName); if (producerSource == null) { // 5) If no wiring is found for the registrant bundle then find the wiring for the classloader of the service object. If no wiring is found return false. AbstractBundle serviceBundle = (AbstractBundle) registration.framework.packageAdmin.getBundle(registration.service.getClass()); producerBL = serviceBundle.getBundleLoader(); if (producerBL == null) return false; producerSource = producerBL.getPackageSource(pkgName); if (producerSource == null) return false; return true; } // 6) If the two wirings found are equal then return true; otherwise return false. return producerSource.hasCommonSource(consumerSource); } | 2516 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2516/ccf6208e5b5c52eb1534fb8fba32360eef1f6d31/ServiceReferenceImpl.java/clean/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/ServiceReferenceImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1250,
8540,
774,
12,
3405,
3440,
16,
514,
2658,
13,
288,
202,
202,
7469,
3405,
4765,
273,
261,
7469,
3405,
13,
3440,
31,
202,
202,
759,
3712,
327,
629,
364,
14656,
202,
202,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1250,
8540,
774,
12,
3405,
3440,
16,
514,
2658,
13,
288,
202,
202,
7469,
3405,
4765,
273,
261,
7469,
3405,
13,
3440,
31,
202,
202,
759,
3712,
327,
629,
364,
14656,
202,
202,
... | |
public PreparedStatementTest( String name ) { | public PreparedStatementTest(String name) { | public PreparedStatementTest( String name ) { super(name); } | 439 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/439/acc856d6a1ff980996754d535c2c5fd7d785a680/PreparedStatementTest.java/clean/trunk/jtds/src/test/net/sourceforge/jtds/test/PreparedStatementTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
16913,
4709,
12,
514,
508,
262,
565,
288,
3639,
2240,
12,
529,
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,
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,
16913,
4709,
12,
514,
508,
262,
565,
288,
3639,
2240,
12,
529,
1769,
565,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.