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 |
|---|---|---|---|---|---|---|
String rString = | String resultString = | protected String executeExpr(String mdxCmd) { StringBuffer buf = new StringBuffer(256); mdxCmd = (mdxCmd.length() == 5) ? "" : mdxCmd.substring(5); String regex = "(\"[^\"]+\"|'[^\']+'|\\[[^\\]]+\\]|[^\\s]+)\\s+.*"; Pattern p = Pattern.compile(regex); Matcher m = p.matcher(mdxCmd); boolean b = m.matches(); if (! b) { buf.append("Could not parse into \"cubename expression\" command:"); buf.append(nl); buf.append(mdxCmd); } else { String cubeName = m.group(1); String expression = mdxCmd.substring(cubeName.length()+1); if (cubeName.charAt(0) == '"') { cubeName = cubeName.substring(1, cubeName.length()-1); } else if (cubeName.charAt(0) == '\'') { cubeName = cubeName.substring(1, cubeName.length()-1); } else if (cubeName.charAt(0) == '[') { cubeName = cubeName.substring(1, cubeName.length()-1); } int len = expression.length(); if (expression.charAt(0) == '"') { if (expression.charAt(len-1) != '"') { buf.append("Missing end '\"' in expression:"); buf.append(nl); buf.append(expression); return buf.toString(); } expression = expression.substring(1, len-1); } else if (expression.charAt(0) == '\'') { if (expression.charAt(len-1) != '\'') { buf.append("Missing end \"'\" in expression:"); buf.append(nl); buf.append(expression); return buf.toString(); } expression = expression.substring(1, len-1); } Cube cube = getCube(cubeName); if (cube == null) { buf.append("No cube found with name \""); buf.append(cubeName); buf.append("\""); } else { try { if (cubeName.indexOf(' ') >= 0) { if (cubeName.charAt(0) != '[') { cubeName = Util.quoteMdxIdentifier(cubeName); } } // taken from FoodMartTest code String queryString = "with member [Measures].[Foo] as '" + expression + "' select {[Measures].[Foo]} on columns from " + cubeName; Result result = runQuery(queryString, true); String rString = result.getCell(new int[]{0}).getFormattedValue(); buf.append(rString); } catch (Exception ex) { setError(ex); return null; } } } return buf.toString(); } | 37907 /local/tlutelli/issta_data/temp/all_java3context/java/2006_temp/2006/37907/4f9ca07b5e70542bacee499a4ddf5df87be3c9ab/CmdRunner.java/clean/src/main/mondrian/tui/CmdRunner.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
514,
1836,
4742,
12,
780,
3481,
92,
5931,
13,
288,
3639,
6674,
1681,
273,
394,
6674,
12,
5034,
1769,
3639,
3481,
92,
5931,
273,
261,
1264,
92,
5931,
18,
2469,
1435,
422,
1381,
13,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
514,
1836,
4742,
12,
780,
3481,
92,
5931,
13,
288,
3639,
6674,
1681,
273,
394,
6674,
12,
5034,
1769,
3639,
3481,
92,
5931,
273,
261,
1264,
92,
5931,
18,
2469,
1435,
422,
1381,
13,... |
addMenu( manager, getBaseSeriesMenu( getChartModel( ) ) ); | if ( !( getChartModel( ) instanceof DialChart ) ) { addMenu( manager, getBaseSeriesMenu( getChartModel( ) ) ); } | public void menuAboutToShow( IMenuManager manager ) { addMenu( manager, new HeaderShowAction( ) ); addMenu( manager, getBaseSeriesMenu( getChartModel( ) ) ); addMenu( manager, getOrthogonalSeriesMenu( getChartModel( ) ) ); if ( !( getChartModel( ) instanceof DialChart ) ) { addMenu( manager, getGroupSeriesMenu( getChartModel( ) ) ); } // manager.add( actionInsertAggregation ); } | 15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/7c941526439249b73c1c528f95482ee8cf1e564e/TaskSelectData.java/buggy/chart/org.eclipse.birt.chart.ui.extension/src/org/eclipse/birt/chart/ui/swt/wizard/TaskSelectData.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4697,
202,
482,
918,
3824,
24813,
774,
5706,
12,
467,
4599,
1318,
3301,
262,
9506,
202,
95,
6862,
202,
1289,
4599,
12,
3301,
16,
394,
4304,
5706,
1803,
12,
262,
11272,
6862,
202,
1289,
4599,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4697,
202,
482,
918,
3824,
24813,
774,
5706,
12,
467,
4599,
1318,
3301,
262,
9506,
202,
95,
6862,
202,
1289,
4599,
12,
3301,
16,
394,
4304,
5706,
1803,
12,
262,
11272,
6862,
202,
1289,
4599,
... |
this.clazz = getApplicationClass(classname); /* create an instance and see if it is a ViewTool or Configurable */ Object instance = clazz.newInstance(); if (instance instanceof ViewTool) | if (classname != null && classname.length() != 0) | public void setClassname(String classname) throws Exception { this.clazz = getApplicationClass(classname); /* create an instance and see if it is a ViewTool or Configurable */ Object instance = clazz.newInstance(); if (instance instanceof ViewTool) { this.initializable = true; } if (instance instanceof Configurable) { this.configurable = true; } } | 52538 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52538/d37ded02b75ba4242467e0aa0fdb0dc16f732059/ViewToolInfo.java/buggy/src/java/org/apache/velocity/tools/view/ViewToolInfo.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
444,
20531,
12,
780,
7479,
13,
1216,
1185,
565,
288,
3639,
333,
18,
830,
3638,
273,
9615,
797,
12,
18340,
1769,
3639,
1748,
752,
392,
791,
471,
2621,
309,
518,
353,
279,
4441... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
444,
20531,
12,
780,
7479,
13,
1216,
1185,
565,
288,
3639,
333,
18,
830,
3638,
273,
9615,
797,
12,
18340,
1769,
3639,
1748,
752,
392,
791,
471,
2621,
309,
518,
353,
279,
4441... |
return tokadd_escape(); | return tokadd_escape(term); /* FIX 1.6.5*/ | private int tokadd_escape() { int c; switch (c = nextc()) { case '\n': return 0; /* just ignore */ case '0': case '1': case '2': case '3': /* octal constant */ case '4': case '5': case '6': case '7': { int i; tokadd('\\'); tokadd(c); for (i=0; i<2; i++) { c = nextc(); if (c == -1) { //goto eof; yyerror("Invalid escape character syntax"); return -1; } if (c < '0' || '7' < c) { pushback(c); break; } tokadd(c); } } return 0; case 'x': /* hex constant */ { tokadd('\\'); tokadd(c); int[] numlen = new int[1]; scan_hex(lex_curline, lex_p, 2, numlen); while (numlen[0]-- != 0) tokadd(nextc()); } return 0; case 'M': if ((c = nextc()) != '-') { yyerror("Invalid escape character syntax"); pushback(c); return 0; } tokadd('\\'); tokadd('M'); tokadd('-'); //goto escaped; if ((c = nextc()) == '\\') { return tokadd_escape(); } else if (c == -1) { // goto eof; yyerror("Invalid escape character syntax"); return -1; } tokadd(c); return 0; case 'C': if ((c = nextc()) != '-') { yyerror("Invalid escape character syntax"); pushback(c); return 0; } tokadd('\\'); tokadd('C'); tokadd('-'); //goto escaped; if ((c = nextc()) == '\\') { return tokadd_escape(); } else if (c == -1) { // goto eof; yyerror("Invalid escape character syntax"); return -1; } tokadd(c); return 0; case 'c': tokadd('\\'); tokadd('c'); //escaped: if ((c = nextc()) == '\\') { return tokadd_escape(); } else if (c == -1) { // goto eof; yyerror("Invalid escape character syntax"); return -1; } tokadd(c); return 0; case -1: // eof: yyerror("Invalid escape character syntax"); return -1; default: tokadd('\\'); tokadd(c); } return 0; } | 49687 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49687/241a0fe060c8d239aa9e5d2519e98cf44d69a201/parse.java/clean/org/jruby/parser/parse.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
509,
946,
1289,
67,
6939,
1435,
288,
3639,
509,
276,
31,
3639,
1620,
261,
71,
273,
1024,
71,
10756,
288,
202,
3593,
2337,
82,
4278,
5411,
327,
374,
31,
202,
202,
20308,
2537,
2305... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
946,
1289,
67,
6939,
1435,
288,
3639,
509,
276,
31,
3639,
1620,
261,
71,
273,
1024,
71,
10756,
288,
202,
3593,
2337,
82,
4278,
5411,
327,
374,
31,
202,
202,
20308,
2537,
2305... |
selectLastInfoTableItem(); | public void popRule() { ruleTableDataModel.remove(rules.peek()); selectLastInfoTableItem(); rules.pop(); } | 4430 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4430/479d874b4f93e1ae6cd1867bd84e84f23d59491f/DBInfoPanel.java/buggy/src/org/antlr/works/debugger/panels/DBInfoPanel.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1843,
2175,
1435,
288,
3639,
1720,
1388,
26349,
18,
4479,
12,
7482,
18,
347,
3839,
10663,
9079,
2931,
18,
5120,
5621,
565,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1843,
2175,
1435,
288,
3639,
1720,
1388,
26349,
18,
4479,
12,
7482,
18,
347,
3839,
10663,
9079,
2931,
18,
5120,
5621,
565,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
PeerReplyFoundJob reply = new PeerReplyFoundJob(_context, peer, inTunnel, outTunnel); PeerReplyTimeoutJob timeoutJob = new PeerReplyTimeoutJob(_context, peer, inTunnel, outTunnel); SendTunnelMessageJob j = new SendTunnelMessageJob(_context, msg, outTunnelId, peer.getIdentity().getHash(), | PeerReplyFoundJob reply = new PeerReplyFoundJob(getContext(), peer, inTunnel, outTunnel); PeerReplyTimeoutJob timeoutJob = new PeerReplyTimeoutJob(getContext(), peer, inTunnel, outTunnel); SendTunnelMessageJob j = new SendTunnelMessageJob(getContext(), msg, outTunnelId, peer.getIdentity().getHash(), | private void testPeer(RouterInfo peer) { TunnelId inTunnelId = getInboundTunnelId(); if (inTunnelId == null) { _log.error("No tunnels to get peer test replies through! wtf!"); return; } TunnelInfo inTunnel = _context.tunnelManager().getTunnelInfo(inTunnelId); RouterInfo inGateway = _context.netDb().lookupRouterInfoLocally(inTunnel.getThisHop()); if (inGateway == null) { _log.error("We can't find the gateway to our inbound tunnel?! wtf"); return; } long timeoutMs = getTestTimeout(); long expiration = _context.clock().now() + timeoutMs; long nonce = _context.random().nextLong(I2NPMessage.MAX_ID_VALUE); DatabaseStoreMessage msg = buildMessage(peer, inTunnelId, inGateway.getIdentity().getHash(), nonce, expiration); TunnelId outTunnelId = getOutboundTunnelId(); if (outTunnelId == null) { _log.error("No tunnels to send search out through! wtf!"); return; } TunnelInfo outTunnel = _context.tunnelManager().getTunnelInfo(outTunnelId); if (_log.shouldLog(Log.DEBUG)) _log.debug(getJobId() + ": Sending peer test to " + peer.getIdentity().getHash().toBase64() + "w/ replies through [" + inGateway.getIdentity().getHash().toBase64() + "] via tunnel [" + msg.getReplyTunnel() + "]"); ReplySelector sel = new ReplySelector(peer.getIdentity().getHash(), nonce, expiration); PeerReplyFoundJob reply = new PeerReplyFoundJob(_context, peer, inTunnel, outTunnel); PeerReplyTimeoutJob timeoutJob = new PeerReplyTimeoutJob(_context, peer, inTunnel, outTunnel); SendTunnelMessageJob j = new SendTunnelMessageJob(_context, msg, outTunnelId, peer.getIdentity().getHash(), null, null, reply, timeoutJob, sel, timeoutMs, TEST_PRIORITY); _context.jobQueue().addJob(j); } | 3808 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3808/e737e5c9507ed0d463dc9e45a8f63657f466b177/PeerTestJob.java/clean/router/java/src/net/i2p/router/peermanager/PeerTestJob.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
1842,
6813,
12,
8259,
966,
4261,
13,
288,
3639,
399,
8564,
548,
316,
20329,
548,
273,
7854,
3653,
20329,
548,
5621,
540,
309,
261,
267,
20329,
548,
422,
446,
13,
288,
5411,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1842,
6813,
12,
8259,
966,
4261,
13,
288,
3639,
399,
8564,
548,
316,
20329,
548,
273,
7854,
3653,
20329,
548,
5621,
540,
309,
261,
267,
20329,
548,
422,
446,
13,
288,
5411,
3... |
SVGAnimatedLength result; if (widthReference == null || (result = (SVGAnimatedLength)widthReference.get()) == null) { result = new SVGOMAnimatedLength(this, null, "width", null); widthReference = new WeakReference(result); } return result; | throw new RuntimeException(" !!! TODO: getWidth()"); | public SVGAnimatedLength getWidth() { SVGAnimatedLength result; if (widthReference == null || (result = (SVGAnimatedLength)widthReference.get()) == null) { result = new SVGOMAnimatedLength(this, null, "width", null); widthReference = new WeakReference(result); } return result; } | 46680 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46680/c91b2fb5364b1bf541875570f744ed45f27d936e/SVGOMRectElement.java/clean/sources/org/apache/batik/dom/svg/SVGOMRectElement.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
11281,
979,
17275,
1782,
8557,
1435,
288,
202,
26531,
979,
17275,
1782,
563,
31,
202,
430,
261,
2819,
2404,
422,
446,
747,
202,
565,
261,
2088,
273,
261,
26531,
979,
17275,
1782,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
11281,
979,
17275,
1782,
8557,
1435,
288,
202,
26531,
979,
17275,
1782,
563,
31,
202,
430,
261,
2819,
2404,
422,
446,
747,
202,
565,
261,
2088,
273,
261,
26531,
979,
17275,
1782,
13... |
Object[] context = { menuitem, key }; | Object[] context = { menuitem, key }; | private void appendPluggableMenus(JMenuItem menuitem, String key) { Object[] context = { menuitem, key }; ArrayList arraylist = Argo.getPlugins(PluggableMenu.class, context); ListIterator iterator = arraylist.listIterator(); while (iterator.hasNext()) { PluggableMenu module = (PluggableMenu)iterator.next(); menuitem.add(module.getMenuItem(context)); menuitem.setEnabled(true); } } | 7166 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7166/ca3bcb5d6dd283c4553bcbfe50b108dc5d499768/GenericArgoMenuBar.java/buggy/src_new/org/argouml/ui/menubar/GenericArgoMenuBar.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
714,
1749,
30382,
29755,
12,
46,
12958,
3824,
1726,
16,
514,
498,
13,
288,
3639,
1033,
8526,
819,
273,
288,
3824,
1726,
16,
498,
289,
31,
3639,
2407,
526,
1098,
273,
1201,
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,
714,
1749,
30382,
29755,
12,
46,
12958,
3824,
1726,
16,
514,
498,
13,
288,
3639,
1033,
8526,
819,
273,
288,
3824,
1726,
16,
498,
289,
31,
3639,
2407,
526,
1098,
273,
1201,
32... |
Image image = super.getImage(element); Point size = new Point(image.getBounds().width, image.getBounds().height); return CUIPlugin.getImageDescriptorRegistry().get( new CElementImageDescriptor(CPluginImages.DESC_OBJS_CEXEC, 0, size)); | return DebugUITools.getImage(IDebugUIConstants.IMG_ACT_RUN); | public Image getImage(Object element) { if (! (element instanceof ICElement)) { return super.getImage(element); } ICElement celement = (ICElement)element; if (celement.getElementType() == ICElement.C_BINARY) { IBinary belement = (IBinary)celement; if (belement.isExecutable()) { Image image = super.getImage(element); Point size = new Point(image.getBounds().width, image.getBounds().height); return CUIPlugin.getImageDescriptorRegistry().get( new CElementImageDescriptor(CPluginImages.DESC_OBJS_CEXEC, 0, size)); } } return super.getImage(element); } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/9951df73a12a84b938a13000bb2e7dd8809ffe20/CMainTab.java/buggy/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1875,
202,
482,
3421,
10567,
12,
921,
930,
13,
288,
9506,
202,
430,
16051,
261,
2956,
1276,
26899,
1046,
3719,
288,
6862,
202,
2463,
2240,
18,
588,
2040,
12,
2956,
1769,
9506,
202,
97,
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,
1875,
202,
482,
3421,
10567,
12,
921,
930,
13,
288,
9506,
202,
430,
16051,
261,
2956,
1276,
26899,
1046,
3719,
288,
6862,
202,
2463,
2240,
18,
588,
2040,
12,
2956,
1769,
9506,
202,
97,
9506,
... |
if (manager != null) updateManager(manager); | if (manager != null) { updateManager(manager); } | private void updateWindowBars( final WorkbenchWindow window) { IContributionManager manager = window .getMenuBarManager(); if (manager != null) updateManager(manager); manager = window .getCoolBarManager2(); if (manager != null) updateManager(manager); manager = window .getToolBarManager2(); if (manager != null) updateManager(manager); manager = window .getStatusLineManager(); if (manager != null) updateManager(manager); } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/fa4a8cff0e027f8d3c6b1fcb92b30f46767dd191/WorkbenchActivitySupport.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/ws/WorkbenchActivitySupport.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
29159,
3238,
918,
1089,
3829,
5190,
87,
12,
4766,
7734,
727,
4147,
22144,
3829,
2742,
13,
288,
4766,
5411,
467,
442,
4027,
1318,
3301,
273,
2742,
4766,
10792,
263,
588,
4599,
5190,
1318,
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,
29159,
3238,
918,
1089,
3829,
5190,
87,
12,
4766,
7734,
727,
4147,
22144,
3829,
2742,
13,
288,
4766,
5411,
467,
442,
4027,
1318,
3301,
273,
2742,
4766,
10792,
263,
588,
4599,
5190,
1318,
5621,
... |
byte[] results = block.getData(); | byte[] results = block.decode(chk); | public static void main(String[] args) throws FSParseException, PeerParseException, CHKEncodeException { NodePeer.disableProbabilisticHTLs = true; Node.MAX_HTL = 5; Logger.setupStdoutLogging(Logger.NORMAL, "freenet.node:minor,freenet.node.Location:normal,freenet.node.FNP:normal,freenet.node.NodePeer:normal" /*"freenet.node.LocationManager:debug,freenet.node.FNPPacketManager:normal,freenet.io.comm.UdpSocketManager:debug"*/); System.out.println("Insert/retrieve test"); System.out.println(); DummyRandomSource random = new DummyRandomSource(); Node[] nodes = new Node[NUMBER_OF_NODES]; Logger.normal(RealNodeRoutingTest.class, "Creating nodes..."); for(int i=0;i<NUMBER_OF_NODES;i++) { nodes[i] = new Node(5000+i, random); Logger.normal(RealNodeRoutingTest.class, "Created node "+i); } SimpleFieldSet refs[] = new SimpleFieldSet[NUMBER_OF_NODES]; for(int i=0;i<NUMBER_OF_NODES;i++) refs[i] = nodes[i].exportFieldSet(); Logger.normal(RealNodeRoutingTest.class, "Created "+NUMBER_OF_NODES+" nodes"); // Now link them up // Connect the set for(int i=0;i<NUMBER_OF_NODES;i++) { int next = (i+1) % NUMBER_OF_NODES; int prev = (i+NUMBER_OF_NODES-1)%NUMBER_OF_NODES; nodes[i].peers.connect(refs[next]); nodes[i].peers.connect(refs[prev]); } Logger.normal(RealNodeRoutingTest.class, "Connected nodes"); // Now add some random links for(int i=0;i<NUMBER_OF_NODES*5;i++) { if(i % NUMBER_OF_NODES == 0) Logger.normal(RealNodeRoutingTest.class, ""+i); int length = (int)Math.pow(NUMBER_OF_NODES, random.nextDouble()); int nodeA = random.nextInt(NUMBER_OF_NODES); int nodeB = (nodeA+length)%NUMBER_OF_NODES; //System.out.println(""+nodeA+" -> "+nodeB); Node a = nodes[nodeA]; Node b = nodes[nodeB]; a.peers.connect(b.exportFieldSet()); b.peers.connect(a.exportFieldSet()); } Logger.normal(RealNodeRoutingTest.class, "Added random links"); SwapRequestInterval sri = new CPUAdjustingSwapRequestInterval(((500*1000*NUMBER_OF_NODES)/200), 50); for(int i=0;i<NUMBER_OF_NODES;i++) nodes[i].start(sri); // Now sit back and watch the fireworks! int cycleNumber = 0; int lastSwaps = 0; int lastNoSwaps = 0; int failures = 0; int successes = 0; RunningAverage avg = new SimpleRunningAverage(100, 0.0); RunningAverage avg2 = new BootstrappingDecayingRunningAverage(0.0, 0.0, 1.0, 100); int pings = 0; while(true) { cycleNumber++; try { Thread.sleep(5000); } catch (InterruptedException e) { // Ignore } for(int i=0;i<NUMBER_OF_NODES;i++) { Logger.normal(RealNodeRoutingTest.class, "Cycle "+cycleNumber+" node "+i+": "+nodes[i].lm.getLocation().getValue()); } int newSwaps = LocationManager.swaps; int totalStarted = LocationManager.startedSwaps; int noSwaps = LocationManager.noSwaps; Logger.normal(RealNodeRoutingTest.class, "Swaps: "+(newSwaps-lastSwaps)); Logger.normal(RealNodeRoutingTest.class, "\nTotal swaps: Started*2: "+totalStarted*2+", succeeded: "+newSwaps+", last minute failures: "+noSwaps+ ", ratio "+(double)noSwaps/(double)newSwaps+", early failures: "+((totalStarted*2)-(noSwaps+newSwaps))); Logger.normal(RealNodeRoutingTest.class, "This cycle ratio: "+((double)(noSwaps-lastNoSwaps)) / ((double)(newSwaps - lastSwaps))); lastNoSwaps = noSwaps; Logger.normal(RealNodeRoutingTest.class, "Swaps rejected (already locked): "+LocationManager.swapsRejectedAlreadyLocked); Logger.normal(RealNodeRoutingTest.class, "Swaps rejected (nowhere to go): "+LocationManager.swapsRejectedNowhereToGo); Logger.normal(RealNodeRoutingTest.class, "Swaps rejected (rate limit): "+LocationManager.swapsRejectedRateLimit); Logger.normal(RealNodeRoutingTest.class, "Swaps rejected (loop): "+LocationManager.swapsRejectedLoop); Logger.normal(RealNodeRoutingTest.class, "Swaps rejected (recognized ID):" +LocationManager.swapsRejectedRecognizedID); lastSwaps = newSwaps; // Do some (routed) test-pings for(int i=0;i<10;i++) { try { Thread.sleep(2000); } catch (InterruptedException e1) { } try { Node randomNode = nodes[random.nextInt(NUMBER_OF_NODES)]; Node randomNode2 = randomNode; while(randomNode2 == randomNode) randomNode2 = nodes[random.nextInt(NUMBER_OF_NODES)]; Logger.normal(RealNodeRoutingTest.class, "Pinging "+randomNode2.portNumber+" from "+randomNode.portNumber); double loc2 = randomNode2.lm.getLocation().getValue(); int hopsTaken = randomNode.routedPing(loc2); pings++; if(hopsTaken < 0) { failures++; avg.report(0.0); avg2.report(0.0); double ratio = (double)successes / ((double)(failures+successes)); Logger.normal(RealNodeRoutingTest.class, "Routed ping "+pings+" FAILED from "+randomNode.portNumber+" to "+randomNode2.portNumber+" (long:"+ratio+", short:"+avg.currentValue()+", vague:"+avg2.currentValue()+")"); } else { successes++; avg.report(1.0); avg2.report(1.0); double ratio = (double)successes / ((double)(failures+successes)); Logger.normal(RealNodeRoutingTest.class, "Routed ping "+pings+" success: "+hopsTaken+" "+randomNode.portNumber+" to "+randomNode2.portNumber+" (long:"+ratio+", short:"+avg.currentValue()+", vague:"+avg2.currentValue()+")"); } } catch (Throwable t) { Logger.error(RealNodeRoutingTest.class, "Caught "+t, t); } } if(pings > 10 && avg.currentValue() > 0.98 && ((double)successes / ((double)(failures+successes)) > 0.98)) { break; } System.out.println(); System.out.println("Ping average > 98%, lets do some inserts/requests"); System.out.println(); int requestNumber = 0; RunningAverage requestsAvg = new SimpleRunningAverage(100, 0.0); while(true) { try { requestNumber++; try { Thread.sleep(5000); } catch (InterruptedException e1) { } String dataString = Integer.toString(requestNumber); Logger.error(RealNodeRequestInsertTest.class,"Inserting: \""+dataString+"\""); byte[] data = dataString.getBytes(); ClientCHKBlock block; block = ClientCHKBlock.encode(data); ClientCHK chk = block.getClientKey(); Logger.error(RealNodeRequestInsertTest.class,"CHK: "+chk.getURI()); Logger.error(RealNodeRequestInsertTest.class,"Headers: "+HexUtil.bytesToHex(block.getHeader())); // Pick random node to insert to int node1 = random.nextInt(NUMBER_OF_NODES); Node randomNode = nodes[random.nextInt(NUMBER_OF_NODES)]; randomNode.putCHK(block); Logger.error(RealNodeRequestInsertTest.class, "Inserted to "+node1); // Pick random node to request from int node2; do { node2 = random.nextInt(NUMBER_OF_NODES); } while(node2 == node1); Node fetchNode = nodes[node2]; block = fetchNode.getCHK(chk); if(block == null) { Logger.error(RealNodeRequestInsertTest.class, "Fetch FAILED from "+node2); requestsAvg.report(0.0); } else { byte[] results = block.getData(); requestsAvg.report(1.0); if(Arrays.equals(results, data)) { Logger.error(RealNodeRequestInsertTest.class, "Succeeded: "+new String(results)); } else { Logger.error(RealNodeRequestInsertTest.class, "Returned invalid data!"); } } } catch (Throwable t) { Logger.error(RealNodeRequestInsertTest.class, "Caught "+t, t); } } } } | 45341 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45341/27f407d086a1dbf43da0232680fb0f61503732d4/RealNodeRequestInsertTest.java/buggy/src/freenet/node/RealNodeRequestInsertTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
918,
2774,
12,
780,
8526,
833,
13,
1216,
9247,
13047,
16,
10669,
13047,
16,
6469,
47,
5509,
503,
288,
3639,
2029,
6813,
18,
8394,
9152,
22681,
5846,
5062,
48,
87,
273,
638,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
918,
2774,
12,
780,
8526,
833,
13,
1216,
9247,
13047,
16,
10669,
13047,
16,
6469,
47,
5509,
503,
288,
3639,
2029,
6813,
18,
8394,
9152,
22681,
5846,
5062,
48,
87,
273,
638,
3... |
/ intervalRange ) ); | / getDateIntervalRange( ) ) ); | public Object calculate( Object value ) { if ( value == null ) { return new Double( -1 ); } if ( intervalStart == null ) { return new Double( Math.floor( DateTimeUtil.diffWeek( defaultStart, (Date) value ) / intervalRange ) ); } else { if ( DateTimeUtil.diffWeek( (Date) intervalStart, (Date) value ) < 0 ) { return new Double( -1 ); } else { return new Double( Math.floor( DateTimeUtil.diffWeek( (Date) intervalStart, (Date) value ) / intervalRange ) ); } } } | 12803 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12803/35a18968e0f43e01d83f937f28657cdc3dce90ad/WeekGroupCalculator.java/buggy/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/group/WeekGroupCalculator.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1033,
4604,
12,
1033,
460,
262,
202,
95,
202,
202,
430,
261,
460,
422,
446,
262,
202,
202,
95,
1082,
202,
2463,
394,
3698,
12,
300,
21,
11272,
202,
202,
97,
202,
202,
430,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1033,
4604,
12,
1033,
460,
262,
202,
95,
202,
202,
430,
261,
460,
422,
446,
262,
202,
202,
95,
1082,
202,
2463,
394,
3698,
12,
300,
21,
11272,
202,
202,
97,
202,
202,
430,
... |
code = (code << 2) ^ headLabel.hashCode(); | code = (code << 2) ^ headLabel.hashCode(); | public int hashCode() { // all three types of chart items (stopped, baseNP and others) // depend on label and head word int code = label.hashCode(); code = (code << 2) ^ headWord.hashCode(); // special case for stopped items if (label != topSym && stop) { code = (code << 1) | (isPreterminal() ? 1 : 0); return code; } // special case for baseNP items if (this.label == baseNP) { Symbol headLabel = headLabel(); if (headLabel != null) code = (code << 2) ^ headLabel.hashCode(); code = (code << 2) ^ leftPrevMods.hashCode(); code = (code << 2) ^ rightPrevMods.hashCode(); return code; } // finish computation of hash code for all other items if (leftSubcat != null) code = (code << 2) ^ leftSubcat.hashCode(); if (rightSubcat != null) code = (code << 2) ^ rightSubcat.hashCode(); Symbol headLabel = headLabel(); if (headLabel != null) code = (code << 2) ^ headLabel.hashCode(); code = (code << 2) ^ leftPrevMods.hashCode(); code = (code << 2) ^ rightPrevMods.hashCode(); int booleanCode = 0; //booleanCode = (booleanCode << 1) | (stop ? 1 : 0); booleanCode = (booleanCode << 1) | (leftVerb ? 1 : 0); booleanCode = (booleanCode << 1) | (rightVerb ? 1 : 0); return code ^ booleanCode; } | 5472 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5472/c7d9ce9326436a54e35da129b840721ac0f41db2/CKYItem.java/clean/src/danbikel/parser/CKYItem.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
509,
13374,
1435,
288,
1377,
368,
777,
8925,
1953,
434,
4980,
1516,
261,
24228,
16,
1026,
23430,
471,
10654,
13,
1377,
368,
2447,
603,
1433,
471,
910,
2076,
1377,
509,
981,
273,
143... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13374,
1435,
288,
1377,
368,
777,
8925,
1953,
434,
4980,
1516,
261,
24228,
16,
1026,
23430,
471,
10654,
13,
1377,
368,
2447,
603,
1433,
471,
910,
2076,
1377,
509,
981,
273,
143... |
pageContext = null; _parent = null; | public void release() { internalRelease(); //members, that must/need only be reset when there is no more risk, that the container //wants to reuse this tag pageContext = null; _parent = null; // Reset tag attribute members. These are reset here rather than in // internalRelease because of some Resin-related issue. See commit // r166747. _binding = null; _id = null; _rendered = null; } | 47051 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47051/4a7857a588e791341bb7e586f281eca2c41842fe/UIComponentTag.java/clean/api/src/main/java/javax/faces/webapp/UIComponentTag.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
3992,
1435,
565,
288,
3639,
2713,
7391,
5621,
3639,
368,
7640,
16,
716,
1297,
19,
14891,
1338,
506,
2715,
1347,
1915,
353,
1158,
1898,
18404,
16,
716,
326,
1478,
3639,
368,
91,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3992,
1435,
565,
288,
3639,
2713,
7391,
5621,
3639,
368,
7640,
16,
716,
1297,
19,
14891,
1338,
506,
2715,
1347,
1915,
353,
1158,
1898,
18404,
16,
716,
326,
1478,
3639,
368,
91,... | |
sendCommunityRequest(communityName, requestType, entity, attrMods, timeout, crl); | sendCommunityRequest(communityName, requestType, entity, attrMods, crl); | protected void queueCommunityRequest(final String communityName, final int requestType, final Entity entity, final ModificationItem[] attrMods, final CommunityResponseListener crl, final long timeout, final long delay) { if (log.isDebugEnabled()) { log.debug(agentName + ": queueCommunityRequest: " + " community=" + communityName + " type=" + requestType + " entity=" + entity + " attrMods=" + attrMods + " delay=" + delay); } if (delay > 0) { requestQueue.add(delay, communityName, requestType, entity, attrMods, timeout, crl); } else { sendCommunityRequest(communityName, requestType, entity, attrMods, timeout, crl); } } | 11317 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11317/d15772ee503470dc15063061ac9e455f86663be3/DefaultCommunityServiceImpl.java/buggy/community/src/org/cougaar/community/DefaultCommunityServiceImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
918,
2389,
12136,
13352,
691,
12,
6385,
514,
19833,
461,
16,
4766,
4202,
727,
509,
27179,
16,
4766,
4202,
727,
3887,
1522,
16,
4766,
4202,
727,
3431,
1480,
1180,
8526,
1604,
1739,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
918,
2389,
12136,
13352,
691,
12,
6385,
514,
19833,
461,
16,
4766,
4202,
727,
509,
27179,
16,
4766,
4202,
727,
3887,
1522,
16,
4766,
4202,
727,
3431,
1480,
1180,
8526,
1604,
1739,
8... |
if (createOnly) { System.out.println("NationalRegisterHandler create only variable set to TRUE"); } | public boolean handleRecords() throws RemoteException {// UserTransaction transaction = getSessionContext().getUserTransaction(); Timer clock = new Timer(); clock.start(); try { //if the transaction failes all the users and their relations are removed// transaction.begin(); //iterate through the records and process them String item; _familyRelations = new MultivaluedHashMap(); _spouseRelations = new MultivaluedHashMap(); IWBundle bundle = getIWMainApplication().getBundle(Importer.IW_BUNDLE_IDENTIFIER); String sCreateOnly = bundle.getProperty(PROPERTY_NAME_CREATE_ONLY); String sRelationOnly = bundle.getProperty(PROPERTY_NAME_RELATION_ONLY); String sPostal = bundle.getProperty(PROPERTY_NAME_POSTAL_CODE_FIX); createOnly = (sCreateOnly != null && sCreateOnly.equalsIgnoreCase("yes")); relationOnly = (sRelationOnly != null && sRelationOnly.equalsIgnoreCase("yes")); postalCodeFix = (sPostal != null && sPostal.equalsIgnoreCase("yes")); int count = 0; if (createOnly) { System.out.println("NationalRegisterHandler create only variable set to TRUE"); } if (relationOnly) { System.out.println("NationalRegisterHandler relation only variable set to TRUE"); } if (postalCodeFix) { System.out.println("NationalRegisterHandler postalCodeFix variable set to TRUE"); } System.out.println("NationalRegisterHandler processing RECORD [0] time: " + IWTimestamp.getTimestampRightNow().toString()); while (!(item = (String) _file.getNextRecord()).equals("")) { count++; if (!processRecord(item)) _failedRecords.add(item); if ((count % 100) == 0) { System.out.println("NationalRegisterHandler processing RECORD [" + count + "] time: " + IWTimestamp.getTimestampRightNow().toString()); } item = null; } System.out.println("NationalRegisterHandler processed RECORD [" + count + "] time: " + IWTimestamp.getTimestampRightNow().toString()); clock.stop(); long msTime = clock.getTime(); long secTime = msTime / 1000; System.out.println("Time to handleRecords: " + msTime + " ms OR " + secTime + " s, averaging "+(msTime / count)+"ms per record"); clock.start(); handleFamilyRelation(); clock.stop(); msTime = clock.getTime(); secTime = msTime / 1000; System.out.println("Time to handleFamilyRelation: " + clock.getTime() + " ms OR " + ((int) (clock.getTime() / 1000)) + " s, averaging "+(msTime / count)+"ms per record"); printFailedRecords();// transaction.commit(); return true; } catch (Exception ex) { ex.printStackTrace();// try {// transaction.rollback();// }// catch (SystemException e) {// e.printStackTrace();// } return false; } } | 14545 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/14545/fb0b95c4d7dfcd039aeabb288c81f08db693b5f4/NationalRegisterFileImportHandlerBean.java/clean/src/java/is/idega/block/nationalregister/business/NationalRegisterFileImportHandlerBean.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1250,
1640,
6499,
1435,
1216,
18361,
288,
759,
202,
202,
1299,
3342,
2492,
273,
7183,
1042,
7675,
588,
1299,
3342,
5621,
202,
202,
6777,
7268,
273,
394,
12290,
5621,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1250,
1640,
6499,
1435,
1216,
18361,
288,
759,
202,
202,
1299,
3342,
2492,
273,
7183,
1042,
7675,
588,
1299,
3342,
5621,
202,
202,
6777,
7268,
273,
394,
12290,
5621,
202,
202,
1... | |
assertNull( "Should return null", new VoidStub().invoke(invocation) ); } | assertNull("Should return null", new VoidStub().invoke(invocation)); } | public void testReturnsNullWhenInvoked() throws Throwable { assertNull( "Should return null", new VoidStub().invoke(invocation) ); } | 57371 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57371/4aaf60d8fa76687c3492c508dd98678fbbd3d935/VoidStubTest.java/buggy/jmock/core/src/test/jmock/core/stub/VoidStubTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1842,
1356,
2041,
9434,
26215,
1435,
1216,
4206,
288,
3639,
1815,
2041,
12,
315,
14309,
327,
446,
3113,
1850,
1082,
565,
394,
6988,
11974,
7675,
14407,
12,
5768,
4431,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1842,
1356,
2041,
9434,
26215,
1435,
1216,
4206,
288,
3639,
1815,
2041,
12,
315,
14309,
327,
446,
3113,
1850,
1082,
565,
394,
6988,
11974,
7675,
14407,
12,
5768,
4431,
13,
... |
asyncResponses.add (response); | asyncResponses.add(response); | public Quota setquota (String quotaRoot, Quota.Resource[] resources) throws IOException { // Create resource limits list StringBuffer resourceLimits = new StringBuffer (); if (resources != null) { for (int i = 0; i < resources.length; i++) { if (i > 0) { resourceLimits.append (' '); } resourceLimits.append (resources[i].toString ()); } } String tag = newTag (); String command = SETQUOTA + ' ' + quote (UTF7imap.encode (quotaRoot)) + ' ' + resourceLimits.toString (); sendCommand (tag, command); Quota ret = null; while (true) { IMAPResponse response = readResponse (); String id = response.getID (); if (tag.equals (response.getTag ())) { processAlerts (response); if (id == OK) { return ret; } else if (id == NO) { return null; } else { throw new IMAPException (id, response.getText ()); } } else if (response.isUntagged ()) { if (QUOTA.equals (response.getID ())) { ret = new Quota (response.getText ()); } else { asyncResponses.add (response); } } else { throw new IMAPException (id, response.getText ()); } } } | 45713 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45713/32651f721fa7044d71e84f6431a1ca18d965af13/IMAPConnection.java/buggy/libraries/javalib/gnu/inet/imap/IMAPConnection.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
4783,
25441,
444,
23205,
261,
780,
13257,
2375,
16,
4783,
25441,
18,
1420,
8526,
2703,
13,
565,
1216,
1860,
225,
288,
565,
368,
1788,
1058,
8181,
666,
565,
6674,
1058,
12768,
273,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4783,
25441,
444,
23205,
261,
780,
13257,
2375,
16,
4783,
25441,
18,
1420,
8526,
2703,
13,
565,
1216,
1860,
225,
288,
565,
368,
1788,
1058,
8181,
666,
565,
6674,
1058,
12768,
273,
3... |
protected void getTimeZone (String buffer, DateTimeData data, int sign, int end, int[] timeZone) throws RuntimeException{ | protected void getTimeZone (String buffer, DateTimeData data, int sign, int end) throws RuntimeException{ | protected void getTimeZone (String buffer, DateTimeData data, int sign, int end, int[] timeZone) throws RuntimeException{ data.utc=buffer.charAt(sign); if ( buffer.charAt(sign) == 'Z' ) { if (end>(++sign)) { throw new RuntimeException("Error in parsing time zone"); } return; } if ( sign<=(end-6) ) { //parse [hh] int stop = ++sign+2; timeZone[hh]=parseInt(buffer, sign, stop); if (buffer.charAt(stop++)!=':') { throw new RuntimeException("Error in parsing time zone" ); } //parse [ss] timeZone[mm]=parseInt(buffer, stop, stop+2); if ( stop+2!=end ) { throw new RuntimeException("Error in parsing time zone"); } } else { throw new RuntimeException("Error in parsing time zone"); } if ( DEBUG ) { System.out.println("time[hh]="+timeZone[hh] + " time[mm]=" +timeZone[mm]); } } | 1831 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1831/a3debc04b594b9a613443001263a38ec7e3fec7a/AbstractDateTimeDV.java/clean/src/org/apache/xerces/impl/dv/xs/AbstractDateTimeDV.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
918,
28556,
261,
780,
1613,
16,
3716,
751,
501,
16,
509,
1573,
16,
509,
679,
13,
1216,
3235,
95,
3639,
501,
18,
17892,
33,
4106,
18,
3001,
861,
12,
2977,
1769,
3639,
309,
261,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
918,
28556,
261,
780,
1613,
16,
3716,
751,
501,
16,
509,
1573,
16,
509,
679,
13,
1216,
3235,
95,
3639,
501,
18,
17892,
33,
4106,
18,
3001,
861,
12,
2977,
1769,
3639,
309,
261,
1... |
UpdateBuildpathWizard wizard = new UpdateBuildpathWizard(modelArray); final WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); BusyIndicator .showWhile( PDEPlugin.getActiveWorkbenchShell().getDisplay(), new Runnable() { | UpdateBuildpathWizard wizard = new UpdateBuildpathWizard(modelArray); final WizardDialog dialog = new WizardDialog(PDEPlugin .getActiveWorkbenchShell(), wizard); BusyIndicator.showWhile(PDEPlugin.getActiveWorkbenchShell() .getDisplay(), new Runnable() { | public void run(IAction action) { if (fSelection instanceof IStructuredSelection) { Object[] elems = ((IStructuredSelection) fSelection).toArray(); ArrayList models = new ArrayList(elems.length); PluginModelManager manager = PDECore.getDefault().getModelManager(); for (int i = 0; i < elems.length; i++) { Object elem = elems[i]; IProject project = null; if (elem instanceof IFile) { IFile file = (IFile) elem; project = file.getProject(); } else if (elem instanceof IProject) { project = (IProject) elem; } else if (elem instanceof IJavaProject) { project = ((IJavaProject) elem).getProject(); } if (project != null && WorkspaceModelManager.isJavaPluginProject(project)) { IPluginModelBase model = manager.findModel(project); if (model != null) { models.add(model); } } } final IPluginModelBase[] modelArray = (IPluginModelBase[]) models.toArray( new IPluginModelBase[models.size()]); UpdateBuildpathWizard wizard = new UpdateBuildpathWizard(modelArray); final WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); BusyIndicator .showWhile( PDEPlugin.getActiveWorkbenchShell().getDisplay(), new Runnable() { public void run() { dialog.open(); } }); } } | 14404 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/14404/fb8cc99347ed89eba89feea8ec146c92f358e9b0/UpdateClasspathAction.java/clean/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateClasspathAction.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1086,
12,
45,
1803,
1301,
13,
288,
202,
202,
430,
261,
74,
6233,
1276,
467,
30733,
6233,
13,
288,
1082,
202,
921,
8526,
14733,
273,
14015,
45,
30733,
6233,
13,
284,
6233,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1086,
12,
45,
1803,
1301,
13,
288,
202,
202,
430,
261,
74,
6233,
1276,
467,
30733,
6233,
13,
288,
1082,
202,
921,
8526,
14733,
273,
14015,
45,
30733,
6233,
13,
284,
6233,... |
diffControlsState(pipelineContext, ch, containingDocument, null, children2, itemsetsFull1, itemsetsFull2, valueChangeControlIds); | diffControlsState(ch, containingDocument, null, children2, itemsetsFull1, itemsetsFull2, valueChangeControlIds); | public static void diffControlsState(PipelineContext pipelineContext, ContentHandlerHelper ch, XFormsContainingDocument containingDocument, List state1, List state2, Map itemsetsFull1, Map itemsetsFull2, Map valueChangeControlIds) { // Trivial case if (state1 == null && state2 == null) return; // Both lists must have the same size if present; state1 can be null if ((state1 != null && state2 != null && state1.size() != state2.size()) || (state2 == null)) { throw new IllegalStateException("Illegal state when comparing controls."); } final boolean isStaticReadonly = containingDocument.getReadonlyAppearance().equals(XFormsConstants.XXFORMS_READONLY_APPEARANCE_STATIC_VALUE); final AttributesImpl attributesImpl = new AttributesImpl(); final Iterator j = (state1 == null) ? null : state1.iterator(); for (Iterator i = state2.iterator(); i.hasNext();) { final XFormsControl xformsControl1 = (state1 == null) ? null : (XFormsControl) j.next(); final XFormsControl xformsControl2 = (XFormsControl) i.next(); // 1: Check current control if (!(xformsControl2 instanceof XFormsRepeatControl)) { // xforms:repeat doesn't need to be handled independently, iterations do it // Output diffs between controlInfo1 and controlInfo2 final boolean isValueChangeControl = valueChangeControlIds != null && valueChangeControlIds.get(xformsControl2.getEffectiveId()) != null; if ((!xformsControl2.equals(xformsControl1) || isValueChangeControl) && !(isStaticReadonly && xformsControl2.isReadonly() && xformsControl2 instanceof XFormsTriggerControl)) { // Don't send anything if nothing has changed // But we force a change for controls whose values changed in the request // Also, we don't output anything for triggers in static readonly mode attributesImpl.clear(); // Control id attributesImpl.addAttribute("", "id", "id", ContentHandlerHelper.CDATA, xformsControl2.getEffectiveId()); // Control children values if (!(xformsControl2 instanceof RepeatIterationControl)) { { final String labelValue1 = (xformsControl1 == null) ? null : xformsControl1.getLabel(); final String labelValue2 = xformsControl2.getLabel(); if (!((labelValue1 == null && labelValue2 == null) || (labelValue1 != null && labelValue2 != null && labelValue1.equals(labelValue2)))) { attributesImpl.addAttribute("", "label", "label", ContentHandlerHelper.CDATA, labelValue2 != null ? labelValue2 : ""); } } { final String helpValue1 = (xformsControl1 == null) ? null : xformsControl1.getHelp(); final String helpValue2 = xformsControl2.getHelp(); if (!((helpValue1 == null && helpValue2 == null) || (helpValue1 != null && helpValue2 != null && helpValue1.equals(helpValue2)))) { attributesImpl.addAttribute("", "help", "help", ContentHandlerHelper.CDATA, helpValue2 != null ? helpValue2 : ""); } } { final String hintValue1 = (xformsControl1 == null) ? null : xformsControl1.getHint(); final String hintValue2 = xformsControl2.getHint(); if (!((hintValue1 == null && hintValue2 == null) || (hintValue1 != null && hintValue2 != null && hintValue1.equals(hintValue2)))) { attributesImpl.addAttribute("", "hint", "hint", ContentHandlerHelper.CDATA, hintValue2 != null ? hintValue2 : ""); } } { final String alertValue1 = (xformsControl1 == null) ? null : xformsControl1.getAlert(); final String alertValue2 = xformsControl2.getAlert(); if (!((alertValue1 == null && alertValue2 == null) || (alertValue1 != null && alertValue2 != null && alertValue1.equals(alertValue2)))) { attributesImpl.addAttribute("", "alert", "alert", ContentHandlerHelper.CDATA, alertValue2 != null ? alertValue2 : ""); } } // Output xforms:output-specific information if (xformsControl2 instanceof XFormsOutputControl) { final XFormsOutputControl outputControlInfo1 = (XFormsOutputControl) xformsControl1; final XFormsOutputControl outputControlInfo2 = (XFormsOutputControl) xformsControl2; final String mediaTypeValue1 = (outputControlInfo1 == null) ? null : outputControlInfo1.getMediaTypeAttribute(); final String mediaTypeValue2 = outputControlInfo2.getMediaTypeAttribute(); if (!((mediaTypeValue1 == null && mediaTypeValue2 == null) || (mediaTypeValue1 != null && mediaTypeValue2 != null && mediaTypeValue1.equals(mediaTypeValue2)))) { attributesImpl.addAttribute("", "mediatype", "mediatype", ContentHandlerHelper.CDATA, mediaTypeValue2 != null ? mediaTypeValue2 : ""); } } } // Model item properties if (xformsControl1 == null || xformsControl1.isReadonly() != xformsControl2.isReadonly()) { attributesImpl.addAttribute("", XFormsConstants.XXFORMS_READONLY_ATTRIBUTE_NAME, XFormsConstants.XXFORMS_READONLY_ATTRIBUTE_NAME, ContentHandlerHelper.CDATA, Boolean.toString(xformsControl2.isReadonly())); } if (xformsControl1 == null || xformsControl1.isRequired() != xformsControl2.isRequired()) { attributesImpl.addAttribute("", XFormsConstants.XXFORMS_REQUIRED_ATTRIBUTE_NAME, XFormsConstants.XXFORMS_REQUIRED_ATTRIBUTE_NAME, ContentHandlerHelper.CDATA, Boolean.toString(xformsControl2.isRequired())); } if (xformsControl1 == null || xformsControl1.isRelevant() != xformsControl2.isRelevant()) { attributesImpl.addAttribute("", XFormsConstants.XXFORMS_RELEVANT_ATTRIBUTE_NAME, XFormsConstants.XXFORMS_RELEVANT_ATTRIBUTE_NAME, ContentHandlerHelper.CDATA, Boolean.toString(xformsControl2.isRelevant())); } if (xformsControl1 == null || xformsControl1.isValid() != xformsControl2.isValid()) { attributesImpl.addAttribute("", XFormsConstants.XXFORMS_VALID_ATTRIBUTE_NAME, XFormsConstants.XXFORMS_VALID_ATTRIBUTE_NAME, ContentHandlerHelper.CDATA, Boolean.toString(xformsControl2.isValid())); } final boolean isOutputControlWithValueAttribute = xformsControl2 instanceof XFormsOutputControl && ((XFormsOutputControl) xformsControl2).getValueAttribute() != null; if (!(xformsControl2 instanceof RepeatIterationControl) && !isOutputControlWithValueAttribute) { final String typeValue1 = (xformsControl1 == null) ? null : xformsControl1.getType(); final String typeValue2 = xformsControl2.getType(); if (xformsControl1 == null || !((typeValue1 == null && typeValue2 == null) || (typeValue1 != null && typeValue2 != null && typeValue1.equals(typeValue2)))) { attributesImpl.addAttribute("", XFormsConstants.XXFORMS_TYPE_ATTRIBUTE_NAME, XFormsConstants.XXFORMS_TYPE_ATTRIBUTE_NAME, ContentHandlerHelper.CDATA, typeValue2 != null ? typeValue2 : ""); } } if (!(xformsControl2 instanceof RepeatIterationControl)) { // Regular control // Get current value if possible for this control // NOTE: We issue the new value in all cases because we don't have yet a mechanism to tell the // client not to update the value, unlike with attributes which can be missing if (xformsControl2 instanceof XFormsValueControl && !(xformsControl2 instanceof XFormsUploadControl)) { final XFormsValueControl xformsValueControl = (XFormsValueControl) xformsControl2; // Check if a "display-value" attribute must be added if (!isOutputControlWithValueAttribute) { final String displayValue = xformsValueControl.getDisplayValue(); if (displayValue != null) attributesImpl.addAttribute("", "display-value", "display-value", ContentHandlerHelper.CDATA, displayValue); } // Create element with text value ch.startElement("xxf", XFormsConstants.XXFORMS_NAMESPACE_URI, "control", attributesImpl); ch.text(xformsValueControl.convertToExternalValue(xformsValueControl.getValue())); ch.endElement(); } else if (!"case".equals(xformsControl2.getName())) { // No value, just output element with no content ch.element("xxf", XFormsConstants.XXFORMS_NAMESPACE_URI, "control", attributesImpl); } } else { // Repeat iteration final RepeatIterationControl repeatIterationInfo = (RepeatIterationControl) xformsControl2; attributesImpl.addAttribute("", "iteration", "iteration", ContentHandlerHelper.CDATA, Integer.toString(repeatIterationInfo.getIteration())); ch.element("xxf", XFormsConstants.XXFORMS_NAMESPACE_URI, "repeat-iteration", attributesImpl); } } // Handle itemsets if (xformsControl2 instanceof XFormsSelect1Control || xformsControl2 instanceof XFormsSelectControl) { final XFormsSelect1Control xformsSelect1Control1 = (XFormsSelect1Control) xformsControl1; final XFormsSelect1Control xformsSelect1Control2 = (XFormsSelect1Control) xformsControl2; if (itemsetsFull1 != null && xformsSelect1Control1 != null) { final Object items = xformsSelect1Control1.getItemset(); if (items != null) itemsetsFull1.put(xformsSelect1Control1.getEffectiveId(), items); } if (itemsetsFull2 != null && xformsSelect1Control2 != null) { final Object items = xformsSelect1Control2.getItemset(); if (items != null) itemsetsFull2.put(xformsSelect1Control2.getEffectiveId(), items); } } } // 2: Check children if any if (XFormsControls.isGroupingControl(xformsControl2.getName()) || xformsControl2 instanceof RepeatIterationControl) { final List children1 = (xformsControl1 == null) ? null : xformsControl1.getChildren(); final List children2 = (xformsControl2.getChildren() == null) ? Collections.EMPTY_LIST : xformsControl2.getChildren(); // Repeat grouping control if (xformsControl2 instanceof XFormsRepeatControl && children1 != null) { final XFormsRepeatControl repeatControlInfo = (XFormsRepeatControl) xformsControl2; // Special case of repeat update final int size1 = children1.size(); final int size2 = children2.size(); if (size1 == size2) { // No add or remove of children diffControlsState(pipelineContext, ch, containingDocument, children1, xformsControl2.getChildren(), itemsetsFull1, itemsetsFull2, valueChangeControlIds); } else if (size2 > size1) { // Size has grown // Copy template instructions for (int k = size1 + 1; k <= size2; k++) { outputCopyRepeatTemplate(ch, repeatControlInfo, k); } // Diff the common subset diffControlsState(pipelineContext, ch, containingDocument, children1, children2.subList(0, size1), itemsetsFull1, itemsetsFull2, valueChangeControlIds); // Issue new values for new iterations diffControlsState(pipelineContext, ch, containingDocument, null, children2.subList(size1, size2), itemsetsFull1, itemsetsFull2, valueChangeControlIds); } else if (size2 < size1) { // Size has shrunk final String repeatControlId = xformsControl2.getEffectiveId(); final int indexOfRepeatHierarchySeparator = repeatControlId.indexOf(XFormsConstants.REPEAT_HIERARCHY_SEPARATOR_1); final String templateId = (indexOfRepeatHierarchySeparator == -1) ? repeatControlId : repeatControlId.substring(0, indexOfRepeatHierarchySeparator); final String parentIndexes = (indexOfRepeatHierarchySeparator == -1) ? "" : repeatControlId.substring(indexOfRepeatHierarchySeparator + 1); ch.element("xxf", XFormsConstants.XXFORMS_NAMESPACE_URI, "delete-repeat-elements", new String[]{"id", templateId, "parent-indexes", parentIndexes, "count", "" + (size1 - size2)}); // Diff the remaining subset diffControlsState(pipelineContext, ch, containingDocument, children1.subList(0, size2), children2, itemsetsFull1, itemsetsFull2, valueChangeControlIds); } } else if (xformsControl2 instanceof XFormsRepeatControl && xformsControl1 == null) { final XFormsRepeatControl repeatControlInfo = (XFormsRepeatControl) xformsControl2; // Handle new sub-xforms:repeat // Copy template instructions final int size2 = children2.size(); for (int k = 2; k <= size2; k++) { // don't copy the first template, which is already copied when the parent is copied outputCopyRepeatTemplate(ch, repeatControlInfo, k); } // Issue new values for the children diffControlsState(pipelineContext, ch, containingDocument, null, children2, itemsetsFull1, itemsetsFull2, valueChangeControlIds); } else if (xformsControl2 instanceof XFormsRepeatControl && children1 == null) { final XFormsRepeatControl repeatControlInfo = (XFormsRepeatControl) xformsControl2; // Handle repeat growing from size 0 (case of instance replacement, for example) // Copy template instructions final int size2 = children2.size(); for (int k = 1; k <= size2; k++) { outputCopyRepeatTemplate(ch, repeatControlInfo, k); } // Issue new values for the children diffControlsState(pipelineContext, ch, containingDocument, null, children2, itemsetsFull1, itemsetsFull2, valueChangeControlIds); } else { // Other grouping controls diffControlsState(pipelineContext, ch, containingDocument, children1, children2, itemsetsFull1, itemsetsFull2, valueChangeControlIds); } } } } | 51410 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51410/4991b30415dcfb1b79b16bb5c46a194e21aa81a4/XFormsServer.java/buggy/src/java/org/orbeon/oxf/xforms/processor/XFormsServer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
918,
3122,
16795,
1119,
12,
8798,
1042,
5873,
1042,
16,
3697,
1503,
2276,
462,
16,
1139,
18529,
24344,
2519,
4191,
2519,
16,
987,
919,
21,
16,
987,
919,
22,
16,
1635,
761,
44... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
918,
3122,
16795,
1119,
12,
8798,
1042,
5873,
1042,
16,
3697,
1503,
2276,
462,
16,
1139,
18529,
24344,
2519,
4191,
2519,
16,
987,
919,
21,
16,
987,
919,
22,
16,
1635,
761,
44... |
if(!var.isConstant()) var.setValidValue(false); | var.setValidValue(false); | public void clearValues() { for(Enumeration e = this.elements(); e.hasMoreElements(); ) { Variable var = (Variable) e.nextElement(); if(!var.isConstant()) var.setValidValue(false); } } | 54194 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54194/4c1747ce66c6087c08feb88c02f810d07c3236de/SymbolTable.java/clean/src/org/nfunk/jep/SymbolTable.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
2424,
1972,
1435,
202,
95,
202,
202,
1884,
12,
21847,
425,
273,
333,
18,
6274,
5621,
425,
18,
5332,
7417,
3471,
5621,
262,
3196,
202,
95,
1082,
202,
3092,
569,
273,
261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
2424,
1972,
1435,
202,
95,
202,
202,
1884,
12,
21847,
425,
273,
333,
18,
6274,
5621,
425,
18,
5332,
7417,
3471,
5621,
262,
3196,
202,
95,
1082,
202,
3092,
569,
273,
261,
... |
final Collection activations = activationsBySourcePriority[i]; if (activations != null) { final Iterator activationItr = activations.iterator(); while (activationItr.hasNext()) { activationsToRecompute.add(activationItr.next()); | final Map activationsByExpression = activationsByExpressionBySourcePriority[i]; if (activationsByExpression != null) { final Iterator activationByExpressionItr = activationsByExpression .values().iterator(); while (activationByExpressionItr.hasNext()) { final Collection activations = (Collection) activationByExpressionItr .next(); final Iterator activationItr = activations.iterator(); if (activationItr.hasNext()) { IHandlerActivation activation = (IHandlerActivation) activationItr .next(); final boolean currentActive = evaluate(activation); activation.clearResult(); final boolean newActive = evaluate(activation); if (newActive != currentActive) { changedCommandIds .add(activation.getCommandId()); while (activationItr.hasNext()) { activation = (IHandlerActivation) activationItr .next(); if (activation instanceof EvaluationResultCache) { ((EvaluationResultCache) activation) .setResult(newActive); } else { activation.clearResult(); } changedCommandIds.add(activation .getCommandId()); } } } | protected final void sourceChanged(final int sourcePriority) { // If tracing, then track how long it takes to process the activations. long startTime = 0L; if (DEBUG_PERFORMANCE) { startTime = System.currentTimeMillis(); } /* * In this first phase, we cycle through all of the activations that * could have potentially changed. Each such activation is added to a * set for future processing. We add it to a set so that we avoid * handling any individual activation more than once. */ final Set activationsToRecompute = new HashSet( ACTIVATIONS_TO_RECOMPUTE_SIZE); for (int i = 1; i <= 32; i++) { if ((sourcePriority & (1 << i)) != 0) { final Collection activations = activationsBySourcePriority[i]; if (activations != null) { final Iterator activationItr = activations.iterator(); while (activationItr.hasNext()) { activationsToRecompute.add(activationItr.next()); } } } } /* * For every activation, we recompute its active state, and check * whether it has changed. If it has changed, then we take note of the * command identifier so we can update the command later. */ final Collection changedCommandIds = new ArrayList( activationsToRecompute.size()); final Iterator activationItr = activationsToRecompute.iterator(); while (activationItr.hasNext()) { final IHandlerActivation activation = (IHandlerActivation) activationItr .next(); final boolean currentActive = evaluate(activation); activation.clearResult(); final boolean newActive = evaluate(activation); if (newActive != currentActive) { changedCommandIds.add(activation.getCommandId()); } } /* * For every command identifier with a changed activation, we resolve * conflicts and trigger an update. */ final Iterator changedCommandIdItr = changedCommandIds.iterator(); while (changedCommandIdItr.hasNext()) { final String commandId = (String) changedCommandIdItr.next(); final Object value = handlerActivationsByCommandId.get(commandId); if (value instanceof IHandlerActivation) { final IHandlerActivation activation = (IHandlerActivation) value; updateCommand(commandId, (evaluate(activation) ? activation : null)); } else if (value instanceof Collection) { final IHandlerActivation activation = resolveConflicts( commandId, (Collection) value); updateCommand(commandId, activation); } else { updateCommand(commandId, null); } } // If tracing performance, then print the results. if (DEBUG_PERFORMANCE) { final long elapsedTime = System.currentTimeMillis() - startTime; final int size = activationsToRecompute.size(); if (size > 0) { Tracing.printTrace(TRACING_COMPONENT, size + " activations recomputed in " + elapsedTime + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ } } } | 56152 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56152/5cfb5f88a049bbc9efcf0fade7d5687d0ec50ed3/HandlerAuthority.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
727,
918,
1084,
5033,
12,
6385,
509,
1084,
8183,
13,
288,
202,
202,
759,
971,
17144,
16,
1508,
3298,
3661,
1525,
518,
5530,
358,
1207,
326,
25751,
18,
202,
202,
5748,
8657,
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,
225,
202,
1117,
727,
918,
1084,
5033,
12,
6385,
509,
1084,
8183,
13,
288,
202,
202,
759,
971,
17144,
16,
1508,
3298,
3661,
1525,
518,
5530,
358,
1207,
326,
25751,
18,
202,
202,
5748,
8657,
2... |
false, false, false, false, false, 0, 0) && | false, false, false, false, false, 0) && | boolean isLOSBlocked(BattleHex hex1, BattleHex hex2) { if (hex1 == hex2) { return false; } int x1 = hex1.getXCoord(); double y1 = hex1.getYCoord(); int x2 = hex2.getXCoord(); double y2 = hex2.getYCoord(); // Offboard hexes are not allowed. if (x1 == -1 || x2 == -1) { return true; } // Hexes with odd X coordinates are pushed down half a hex. if ((x1 & 1) == 1) { y1 += 0.5; } if ((x2 & 1) == 1) { y2 += 0.5; } double xDist = x2 - x1; double yDist = y2 - y1; // Creatures below the level of the strike do not block LOS. int strikeElevation = Math.min(hex1.getElevation(), hex2.getElevation()); if (yDist == 0 || Math.abs(yDist) == 1.5 * Math.abs(xDist)) { // Hexspine; try both sides. return (isLOSBlockedDir(hex1, hex1, hex2, true, strikeElevation, false, false, false, false, false, 0, 0) && isLOSBlockedDir(hex1, hex1, hex2, false, strikeElevation, false, false, false, false, false, 0, 0)); } else { return isLOSBlockedDir(hex1, hex1, hex2, toLeft(xDist, yDist), strikeElevation, false, false, false, false, false, 0, 0); } } | 51862 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51862/c2bcb5e8ab7b09e28b37fb8d19c0d03aadea8edb/Strike.java/clean/Colossus/net/sf/colossus/client/Strike.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1250,
353,
1502,
55,
23722,
12,
38,
4558,
298,
7037,
3827,
21,
16,
605,
4558,
298,
7037,
3827,
22,
13,
565,
288,
3639,
309,
261,
7118,
21,
422,
3827,
22,
13,
3639,
288,
5411,
327,
629... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1250,
353,
1502,
55,
23722,
12,
38,
4558,
298,
7037,
3827,
21,
16,
605,
4558,
298,
7037,
3827,
22,
13,
565,
288,
3639,
309,
261,
7118,
21,
422,
3827,
22,
13,
3639,
288,
5411,
327,
629... |
String path = getText(); | public void processKeyEvent(KeyEvent evt) { String path = getText(); if(evt.getID() == KeyEvent.KEY_PRESSED) { switch(evt.getKeyCode()) { case KeyEvent.VK_TAB: doComplete(path); break; case KeyEvent.VK_LEFT: if(getCaretPosition() == 0) browser.getBrowserView().getTree().processKeyEvent(evt); break; case KeyEvent.VK_UP: case KeyEvent.VK_DOWN: case KeyEvent.VK_PAGE_UP: case KeyEvent.VK_PAGE_DOWN: browser.getBrowserView().getTree().processKeyEvent(evt); break; default: super.processKeyEvent(evt); break; } } else if(evt.getID() == KeyEvent.KEY_TYPED) { super.processKeyEvent(evt); char ch = evt.getKeyChar(); if(ch == '/') { if(!MiscUtilities.isAbsolutePath(path)) { VFS.DirectoryEntry[] files = browser .getBrowserView().getSelectedFiles(); if(files.length != 1 || files[0].type == VFS.DirectoryEntry.FILE) { return; } path = files[0].path; } VFS vfs = VFSManager.getVFSForPath(path); if((vfs.getCapabilities() & VFS.LOW_LATENCY_CAP) != 0) { setText(null); browser.setDirectory(path); VFSManager.waitForRequests(); } } else if(ch > 0x20 && ch != 0x7f && ch != 0xff) { BrowserView view = browser.getBrowserView(); view.selectNone(); view.getTree().doTypeSelect(path,false); } } } //}}} | 8690 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8690/36396d5632cb3ab7317ecd51bc00c12f0f349e83/VFSFileNameField.java/clean/org/gjt/sp/jedit/browser/VFSFileNameField.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1207,
653,
1133,
12,
653,
1133,
6324,
13,
202,
95,
202,
202,
780,
589,
273,
6701,
5621,
202,
202,
430,
12,
73,
11734,
18,
588,
734,
1435,
422,
23737,
18,
3297,
67,
2738... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1207,
653,
1133,
12,
653,
1133,
6324,
13,
202,
95,
202,
202,
780,
589,
273,
6701,
5621,
202,
202,
430,
12,
73,
11734,
18,
588,
734,
1435,
422,
23737,
18,
3297,
67,
2738... | |
public void test_read() { pis = new PipedInputStream(); pos = new PipedOutputStream(); try { pis.connect(pos); t = new Thread(pw = new PWriter(pos, 1000)); t.start(); } catch (IOException e) { fail("Exception during read test : " + e.getMessage()); } try { synchronized (pw) { pw.wait(10000); } assertTrue("Available returned incorrect number of bytes: " + pis.available(), pis.available() == 1000); assertTrue("read returned incorrect byte", ((byte) pis.read()) == pw.bytes[0]); } catch (IOException e) { fail("Exception reading byte : " + e.getMessage()); } catch (InterruptedException e) { fail("InterruptedException getting available bytes : " + e.getMessage()); } } | public void test_read() throws Exception { pis = new PipedInputStream(); pos = new PipedOutputStream(); pis.connect(pos); t = new Thread(pw = new PWriter(pos, 1000)); t.start(); synchronized (pw) { pw.wait(10000); } assertEquals("Available returned incorrect number of bytes", 1000, pis .available()); assertEquals("read returned incorrect byte", pw.bytes[0], (byte) pis .read()); } | public void test_read() { // Test for method int java.io.PipedInputStream.read() pis = new PipedInputStream(); pos = new PipedOutputStream(); try { pis.connect(pos); t = new Thread(pw = new PWriter(pos, 1000)); t.start(); } catch (IOException e) { fail("Exception during read test : " + e.getMessage()); } try { synchronized (pw) { pw.wait(10000); } assertTrue("Available returned incorrect number of bytes: " + pis.available(), pis.available() == 1000); assertTrue("read returned incorrect byte", ((byte) pis.read()) == pw.bytes[0]); } catch (IOException e) { fail("Exception reading byte : " + e.getMessage()); } catch (InterruptedException e) { fail("InterruptedException getting available bytes : " + e.getMessage()); } } | 54769 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54769/4cabb8a284e891d471dd7549c70691af5c68e790/PipedInputStreamTest.java/clean/modules/luni/src/test/java/tests/api/java/io/PipedInputStreamTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1842,
67,
896,
1435,
288,
202,
202,
759,
7766,
364,
707,
509,
2252,
18,
1594,
18,
24925,
329,
4348,
18,
896,
1435,
202,
202,
84,
291,
273,
394,
29305,
329,
4348,
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,
225,
202,
482,
918,
1842,
67,
896,
1435,
288,
202,
202,
759,
7766,
364,
707,
509,
2252,
18,
1594,
18,
24925,
329,
4348,
18,
896,
1435,
202,
202,
84,
291,
273,
394,
29305,
329,
4348,
5621,
... |
public int getKeySize(); | int getKeySize(); | public int getKeySize(); | 48807 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/48807/0400e73e7503ab43211657c44d8448afd6346cce/BlockCipher.java/buggy/src/freenet/crypt/BlockCipher.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
509,
3579,
1225,
5621,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
509,
3579,
1225,
5621,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
mDataSources = new Vector (); } | mDataSources = new Vector (); } | DataSourceList () { mDataSources = new Vector (); } | 11366 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11366/b0fa2f56cd2dcc90452b768e6b38187cfb8c30eb/AddressBook.java/buggy/grendel/addressbook/AddressBook.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
12806,
682,
1832,
288,
5411,
312,
751,
8628,
273,
394,
5589,
261,
1769,
3639,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
12806,
682,
1832,
288,
5411,
312,
751,
8628,
273,
394,
5589,
261,
1769,
3639,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
int difference = 8 - (new_header_end % 8); | int difference = 8 - (new_header_end % 8); | public void write_to( GIOPConnection conn ) throws IOException { if( contexts == null || contexts.size() == 0 ) { //no additional service contexts present, so buffer can be //sent as a whole insertMsgSize(); write( conn, 0, size() ); } else { switch( giop_minor ) { case 0 : { // GIOP 1.0 (== GIOP 1.1, fall through) } case 1 : { //GIOP 1.1 //First of all, we need to know the the length of //the service context array //For GIOP 1.1, we have to add a padding context contexts.addElement( padding_ctx ); CDROutputStream ctx_out = createContextStream(); //difference to next 8 byte border int difference = 8 - (ctx_out.size() % 8); difference = (difference == 8)? 0 : difference; if( difference > 0 ) { //the last padding context has a 0 length data //part. Therefore, the last data is a ulong //with value 0 (the length of the array). To //increase the data part, we have to increase //the size and add the actual data. //"unwrite" the last ulong ctx_out.reduceSize( 4 ); //write new length ctx_out.write_ulong( difference ); //add "new" data (by just increasing the size //of the stream and not actually writing //anything). ctx_out.increaseSize( difference ); } //Then, we have to update the message size in the GIOP //message header. The new size is the size of the //"original" message minus the length ulong (4 bytes) of //the original empty ServiceContext array plus the length //of the new service context array insertMsgSize( size() - Messages.MSG_HEADER_SIZE - 4 + ctx_out.size() ); //The ServiceContexts are the first attribute in //the RequestHeader struct. Therefore firstly, we //have to write the GIOP message header... write( conn, 0, Messages.MSG_HEADER_SIZE ); //... then add the contexts ... ctx_out.write( conn, 0, ctx_out.size() ); //... and finally the rest of the message //(omitting the empty original context array). write( conn, Messages.MSG_HEADER_SIZE + 4, size() - (Messages.MSG_HEADER_SIZE + 4) ); break; } case 2 : { //GIOP 1.2 //First of all, we need to know the the length of //the service context array //For GIOP 1.2, the header is padded per spec, so //no additional context is needed CDROutputStream ctx_out = createContextStream(); //the new header end is the old header end minus //the length ulong of the context array plus the //length of the context array (wich contains its //own length ulong) int new_header_end = getHeaderEnd() - 4 + ctx_out.size(); //difference to next 8 byte border int difference = 8 - (new_header_end % 8); difference = (difference == 8)? 0 : difference; if( difference > 0 && hasBody() ) { //add padding bytes (by just increasing the //size of the stream and not actually writing //anything). If no body is present, no padding //has to be inserted ctx_out.increaseSize( difference ); } //Then, we have to update the message size in the //GIOP message header. The new size is the size of //the "original" message minus the length ulong (4 //bytes) of the original empty ServiceContext //array minus the "original" header padding plus //the length of the new service context array //(containing the new padding) insertMsgSize( size() - Messages.MSG_HEADER_SIZE - 4 - getHeaderPadding() + ctx_out.size() ); //The GIOP message and request header (up until //the ServiceContexts) stay unmanipulated. We also //have to remove the length ulong of the //"original" empty service context array, because //the new one has its own length attribute write( conn, 0, getHeaderEnd() - 4 ); //... then add the contexts ... ctx_out.write( conn, 0, ctx_out.size()); //... and finally the rest of the message //(omitting the empty original context array). write( conn, getBodyBegin(), size() - getBodyBegin() ); break; } default : { throw new Error( "Unknown GIOP minor: " + giop_minor ); } } } } | 46355 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46355/8dde8aede0a6c1b315d3593f658ccf36ed77e3e3/ServiceContextTransportingOutputStream.java/buggy/src/org/jacorb/orb/giop/ServiceContextTransportingOutputStream.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1045,
67,
869,
12,
611,
45,
3665,
1952,
1487,
262,
3639,
1216,
1860,
565,
288,
3639,
309,
12,
5781,
422,
446,
747,
5781,
18,
1467,
1435,
422,
374,
262,
3639,
288,
5411,
368,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1045,
67,
869,
12,
611,
45,
3665,
1952,
1487,
262,
3639,
1216,
1860,
565,
288,
3639,
309,
12,
5781,
422,
446,
747,
5781,
18,
1467,
1435,
422,
374,
262,
3639,
288,
5411,
368,
... |
public void preDeregister() throws Exception { | public void preDeregister() throws Exception { | public void preDeregister() throws Exception { } | 2370 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2370/de57e83604ff70600cd4eb94962f10f49e5fe102/ComponentStats.java/clean/mule/src/java/org/mule/management/mbeans/ComponentStats.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
675,
40,
13630,
1435,
1216,
1185,
565,
288,
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,
0,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
675,
40,
13630,
1435,
1216,
1185,
565,
288,
565,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
assertTrue("Test not perfrormed", performed); | assertTrue("Test not performed", performed); | public final void testGetEncoded02() throws IOException { boolean performed = false; for (int i = 0; i < EncryptedPrivateKeyInfoData.algName0.length; i++) { try { EncryptedPrivateKeyInfo epki = new EncryptedPrivateKeyInfo( EncryptedPrivateKeyInfoData.algName0[i][0], EncryptedPrivateKeyInfoData.encryptedData); // check that method under test returns // valid encoded form byte[] refEnc = EncryptedPrivateKeyInfoData .getValidEncryptedPrivateKeyInfoEncoding( EncryptedPrivateKeyInfoData.algName0[i][0], false); // System.out.println(Array.toString(refEnc, " ")); byte[] actEnc = epki.getEncoded(); // System.out.println(Array.toString(actEnc, " ")); assertTrue(Arrays.equals(refEnc, actEnc)); performed = true; } catch (NoSuchAlgorithmException allowedFailure) { } } assertTrue("Test not perfrormed", performed); } | 54769 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54769/7a69ebc64b1c37749259bf41611166e1e654aaf3/EncryptedPrivateKeyInfoTest.java/clean/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/EncryptedPrivateKeyInfoTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
727,
918,
1842,
967,
10397,
3103,
1435,
1216,
1860,
288,
3639,
1250,
9591,
273,
629,
31,
3639,
364,
261,
474,
277,
273,
374,
31,
277,
411,
22811,
10824,
966,
751,
18,
18413,
461,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
727,
918,
1842,
967,
10397,
3103,
1435,
1216,
1860,
288,
3639,
1250,
9591,
273,
629,
31,
3639,
364,
261,
474,
277,
273,
374,
31,
277,
411,
22811,
10824,
966,
751,
18,
18413,
461,
... |
define(new FunDefBase("Distinct", "Distinct(<Set>)", "Eliminates duplicate tuples from a set.", "fxx"){ | define(new FunDefBase("Distinct", "Distinct(<Set>)", "Eliminates duplicate tuples from a set.", "fxx"){ | protected void defineFunctions() { defineReserved("NULL"); // first char: p=Property, m=Method, i=Infix, P=Prefix // 2nd: // ARRAY FUNCTIONS if (false) define(new FunDefBase("SetToArray", "SetToArray(<Set>[, <Set>]...[, <Numeric Expression>])", "Converts one or more sets to an array for use in a user-if (false) defined function.", "fa*")); // // DIMENSION FUNCTIONS define(new FunDefBase("Dimension", "<Hierarchy>.Dimension", "Returns the dimension that contains a specified hierarchy.", "pdh") { public Object evaluate(Evaluator evaluator, Exp[] args) { Hierarchy hierarchy = getHierarchyArg(evaluator, args, 0, true); return hierarchy.getDimension(); } }); //??Had to add this to get <Hierarchy>.Dimension to work? define(new FunDefBase("Dimension", "<Dimension>.Dimension", "Returns the dimension that contains a specified hierarchy.", "pdd") { public Object evaluate(Evaluator evaluator, Exp[] args) { Dimension dimension = getDimensionArg(evaluator, args, 0, true); return dimension; } }); define(new FunDefBase("Dimension", "<Level>.Dimension", "Returns the dimension that contains a specified level.", "pdl") { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = getLevelArg(evaluator, args, 0, true); return level.getDimension(); } }); define(new FunDefBase("Dimension", "<Member>.Dimension", "Returns the dimension that contains a specified member.", "pdm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.getDimension(); } }); define(new FunDefBase("Dimensions", "Dimensions(<Numeric Expression>)", "Returns the dimension whose zero-based position within the cube is specified by a numeric expression.", "fdn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Cube cube = evaluator.getCube(); Dimension[] dimensions = cube.getDimensions(); int n = getIntArg(evaluator, args, 0); if ((n > dimensions.length) || (n < 1)) { throw newEvalException( this, "Index '" + n + "' out of bounds"); } return dimensions[n - 1]; } }); define(new FunDefBase("Dimensions", "Dimensions(<String Expression>)", "Returns the dimension whose name is specified by a string.", "fdS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String defValue = "Default Value"; String s = getStringArg(evaluator, args, 0, defValue); if (s.indexOf("[") == -1) { s = Util.quoteMdxIdentifier(s); } OlapElement o = evaluator.getSchemaReader().lookupCompound( evaluator.getCube(), explode(s), false, Category.Dimension); if (o instanceof Dimension) { return (Dimension) o; } else if (o == null) { throw newEvalException(this, "Dimension '" + s + "' not found"); } else { throw newEvalException(this, "Dimensions(" + s + ") found " + o); } } }); // // HIERARCHY FUNCTIONS define(new FunDefBase("Hierarchy", "<Level>.Hierarchy", "Returns a level's hierarchy.", "phl") { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = getLevelArg(evaluator, args, 0, true); return level.getHierarchy(); } }); define(new FunDefBase("Hierarchy", "<Member>.Hierarchy", "Returns a member's hierarchy.", "phm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.getHierarchy(); } }); // // LEVEL FUNCTIONS define(new FunDefBase("Level", "<Member>.Level", "Returns a member's level.", "plm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.getLevel(); } }); define(new FunDefBase("Levels", "<Hierarchy>.Levels(<Numeric Expression>)", "Returns the level whose position in a hierarchy is specified by a numeric expression.", "mlhn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Hierarchy hierarchy = getHierarchyArg(evaluator, args, 0, true); Level[] levels = hierarchy.getLevels(); int n = getIntArg(evaluator, args, 1); if ((n >= levels.length) || (n < 0)) { throw newEvalException( this, "Index '" + n + "' out of bounds"); } return levels[n]; } }); define(new FunDefBase("Levels", "Levels(<String Expression>)", "Returns the level whose name is specified by a string expression.", "flS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String s = getStringArg(evaluator, args, 0, null); Cube cube = evaluator.getCube(); OlapElement o = null; if (s.startsWith("[")) { o = evaluator.getSchemaReader().lookupCompound(cube, explode(s), false, Category.Level); } else { // lookupCompound barfs if "s" doesn't have matching // brackets, so don't even try o = null; } if (o instanceof Level) { return (Level) o; } else if (o == null) { throw newEvalException(this, "Level '" + s + "' not found"); } else { throw newEvalException(this, "Levels('" + s + "') found " + o); } } }); // // LOGICAL FUNCTIONS define(new FunkResolver("IsEmpty", "IsEmpty(<Value Expression>)", "Determines if an expression evaluates to the empty cell value.", new String[] {"fbS", "fbn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Object o = getScalarArg(evaluator, args, 0); if (o == Util.nullValue) { return Boolean.TRUE; } else { return Boolean.FALSE; } } })); define(new FunDefBase("IsEmpty", "IsEmpty(<Value Expression>)", "Determines if an expression evaluates to the empty cell value.", "fbn")); // // MEMBER FUNCTIONS define(new FunkResolver("Ancestor", "Ancestor(<Member>, {<Level>|<Numeric Expression>})", "Returns the ancestor of a member at a specified level.", new String[] {"fmml", "fmmn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, false); Object arg2 = getArg(evaluator, args, 1); Level level = null; int distance; if (arg2 instanceof Level) { level = (Level) arg2; distance = member.getLevel().getDepth() - level.getDepth(); } else { distance = ((Number)arg2).intValue(); } return ancestor(evaluator, member, distance, level); } })); define(new FunDefBase("Cousin", "Cousin(<member>, <ancestor member>)", "Returns the member with the same relative position under <ancestor member> as the member specified.", "fmmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Member ancestorMember = getMemberArg(evaluator, args, 1, true); Member cousin = cousin(evaluator.getSchemaReader(), member, ancestorMember); return cousin; } }); define(new FunDefBase("CurrentMember", "<Dimension>.CurrentMember", "Returns the current member along a dimension during an iteration.", "pmd") { public Object evaluate(Evaluator evaluator, Exp[] args) { Dimension dimension = getDimensionArg(evaluator, args, 0, true); return evaluator.getContext(dimension); } }); define(new FunDefBase("DataMember", "<Member>.DataMember", "Returns the system-generated data member that is associated with a nonleaf member of a dimension.", "pmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.getDataMember(); } }); define(new FunDefBase("DefaultMember", "<Dimension>.DefaultMember", "Returns the default member of a dimension.", "pmd") { public Object evaluate(Evaluator evaluator, Exp[] args) { Dimension dimension = getDimensionArg(evaluator, args, 0, true); return evaluator.getSchemaReader().getHierarchyDefaultMember( dimension.getHierarchy()); } }); define(new FunDefBase("FirstChild", "<Member>.FirstChild", "Returns the first child of a member.", "pmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Member[] children = evaluator.getSchemaReader().getMemberChildren(member); if (children.length == 0) { return member.getHierarchy().getNullMember(); } else { return children[0]; } } }); define(new FunDefBase("FirstSibling", "<Member>.FirstSibling", "Returns the first child of the parent of a member.", "pmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Member parent = member.getParentMember(); Member[] children; if (parent == null) { if (member.isNull()) { return member; } children = evaluator.getSchemaReader().getHierarchyRootMembers(member.getHierarchy()); } else { children = evaluator.getSchemaReader().getMemberChildren(parent); } return children[0]; } }); if (false) define(new FunDefBase("Item", "<Tuple>.Item(<Numeric Expression>)", "Returns a member from a tuple.", "mm*")); define(new FunkResolver( "Lag", "<Member>.Lag(<Numeric Expression>)", "Returns a member further along the specified member's dimension.", new String[]{"mmmn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); int n = getIntArg(evaluator, args, 1); return evaluator.getSchemaReader().getLeadMember(member, -n); } })); define(new FunDefBase("LastChild", "<Member>.LastChild", "Returns the last child of a member.", "pmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Member[] children = evaluator.getSchemaReader().getMemberChildren(member); if (children.length == 0) { return member.getHierarchy().getNullMember(); } else { return children[children.length - 1]; } } }); define(new FunDefBase("LastSibling", "<Member>.LastSibling", "Returns the last child of the parent of a member.", "pmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Member parent = member.getParentMember(); Member[] children; final SchemaReader schemaReader = evaluator.getSchemaReader(); if (parent == null) { if (member.isNull()) { return member; } children = schemaReader.getHierarchyRootMembers( member.getHierarchy()); } else { children = schemaReader.getMemberChildren(parent); } return children[children.length - 1]; } }); define(new FunkResolver( "Lead", "<Member>.Lead(<Numeric Expression>)", "Returns a member further along the specified member's dimension.", new String[]{"mmmn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); int n = getIntArg(evaluator, args, 1); return evaluator.getSchemaReader().getLeadMember(member, n); } })); define(new FunDefBase("Members", "Members(<String Expression>)", "Returns the member whose name is specified by a string expression.", "fmS")); define(new FunDefBase( "NextMember", "<Member>.NextMember", "Returns the next member in the level that contains a specified member.", "pmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return evaluator.getSchemaReader().getLeadMember(member, +1); } }); define(new FunkResolver("OpeningPeriod", "OpeningPeriod([<Level>[, <Member>]])", "Returns the first descendant of a member at a level.", new String[] {"fm", "fml", "fmlm"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { return openingClosingPeriod(evaluator, args, true); } })); define(new FunkResolver("ClosingPeriod", "ClosingPeriod([<Level>[, <Member>]])", "Returns the last descendant of a member at a level.", new String[] {"fm", "fml", "fmlm", "fmm"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { return openingClosingPeriod(evaluator, args, false); } })); define(new FunkResolver( "ParallelPeriod", "ParallelPeriod([<Level>[, <Numeric Expression>[, <Member>]]])", "Returns a member from a prior period in the same relative position as a specified member.", new String[] {"fm", "fml", "fmln", "fmlnm"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { // Member defaults to [Time].currentmember Member member; if (args.length == 3) { member = getMemberArg(evaluator, args, 2, true); } else { member = evaluator.getContext(evaluator.getCube().getTimeDimension()); } // Numeric Expression defaults to 1. int lagValue; if (args.length >= 2) { lagValue = getIntArg(evaluator, args, 1); } else { lagValue = 1; } Level ancestorLevel; if (args.length >= 1) { ancestorLevel = getLevelArg(evaluator, args, 0, true); } else { Member parent = member.getParentMember(); if (parent == null || parent.getType() != Category.Member) { // // The parent isn't a member (it's probably a hierarchy), // so there is no parallelperiod. // return member.getHierarchy().getNullMember(); } ancestorLevel = parent.getLevel(); } // // Now do some error checking. // The ancestorLevel and the member must be from the // same hierarchy. // if (member.getHierarchy() != ancestorLevel.getHierarchy()) { MondrianResource.instance().newFunctionMbrAndLevelHierarchyMismatch( "ParallelPeriod", ancestorLevel.getHierarchy().getUniqueName(), member.getHierarchy().getUniqueName() ); } int distance = member.getLevel().getDepth() - ancestorLevel.getDepth(); Member ancestor = ancestor(evaluator, member, distance, ancestorLevel); Member inLaw = evaluator.getSchemaReader().getLeadMember(ancestor, -lagValue); return cousin(evaluator.getSchemaReader(), member, inLaw); } })); define(new FunDefBase("Parent", "<Member>.Parent", "Returns the parent of a member.", "pmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Member parent = evaluator.getSchemaReader().getMemberParent(member); if (parent == null) { parent = member.getHierarchy().getNullMember(); } return parent; } }); define(new FunDefBase("PrevMember", "<Member>.PrevMember", "Returns the previous member in the level that contains a specified member.", "pmm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return evaluator.getSchemaReader().getLeadMember(member, -1); } }); define(new FunDefBase("StrToMember", "StrToMember(<String Expression>)", "Returns a member from a unique name String in MDX format.", "fmS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String mname = getStringArg(evaluator, args, 0, null); Cube cube = evaluator.getCube(); SchemaReader schemaReader = evaluator.getSchemaReader(); String[] uniqueNameParts = Util.explode(mname); Member member = (Member) schemaReader.lookupCompound(cube, uniqueNameParts, true, Category.Member); // Member member = schemaReader.getMemberByUniqueName(uniqueNameParts, false); return member; } }); if (false) define(new FunDefBase("ValidMeasure", "ValidMeasure(<Tuple>)", "Returns a valid measure in a virtual cube by forcing inapplicable dimensions to their top level.", "fm*")); // // NUMERIC FUNCTIONS define(new FunkResolver("Aggregate", "Aggregate(<Set>[, <Numeric Expression>])", "Returns a calculated value using the appropriate aggregate function, based on the context of the query.", new String[] {"fnx", "fnxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { // compute members only if the context has changed List members = (List) evaluator.getCachedResult(args[0]); if (members == null) { members = (List) getArg(evaluator, args, 0); evaluator.setCachedResult(args[0], members); } ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); Aggregator aggregator = (Aggregator) evaluator.getProperty(Property.PROPERTY_AGGREGATION_TYPE); if (aggregator == null) { throw newEvalException(null, "Could not find an aggregator in the current evaluation context"); } Aggregator rollup = aggregator.getRollup(); if (rollup == null) { throw newEvalException(null, "Don't know how to rollup aggregator '" + aggregator + "'"); } return rollup.aggregate(evaluator.push(), members, exp); } })); define(new FunkResolver("$AggregateChildren", "$AggregateChildren(<Hierarchy>)", "Equivalent to 'Aggregate(<Hierarchy>.CurrentMember.Children); for internal use.", new String[] {"Inh"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Hierarchy hierarchy = getHierarchyArg(evaluator, args, 0, true); Member member = evaluator.getParent().getContext(hierarchy.getDimension()); List members = (List) member.getPropertyValue(Property.PROPERTY_CONTRIBUTING_CHILDREN); Aggregator aggregator = (Aggregator) evaluator.getProperty(Property.PROPERTY_AGGREGATION_TYPE); if (aggregator == null) { throw newEvalException(null, "Could not find an aggregator in the current evaluation context"); } Aggregator rollup = aggregator.getRollup(); if (rollup == null) { throw newEvalException(null, "Don't know how to rollup aggregator '" + aggregator + "'"); } return rollup.aggregate(evaluator.push(), members, valueFunCall); } })); define(new FunkResolver( "Avg", "Avg(<Set>[, <Numeric Expression>])", "Returns the average value of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return avg(evaluator.push(), members, exp); } })); define(new FunkResolver( "Correlation", "Correlation(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Returns the correlation of two series evaluated over a set.", new String[]{"fnxn","fnxnn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp1 = (ExpBase) getArgNoEval(args, 1); ExpBase exp2 = (ExpBase) getArgNoEval(args, 2, valueFunCall); return correlation(evaluator.push(), members, exp1, exp2); } })); final String[] resWords = {"INCLUDEEMPTY", "EXCLUDEEMPTY"}; define(new FunkResolver( "Count", "Count(<Set>[, EXCLUDEEMPTY | INCLUDEEMPTY])", "Returns the number of tuples in a set, empty cells included unless the optional EXCLUDEEMPTY flag is used.", new String[]{"fnx", "fnxy"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); String empties = getLiteralArg(args, 1, "INCLUDEEMPTY", resWords, null); final boolean includeEmpty = empties.equals("INCLUDEEMPTY"); return count(evaluator, members, includeEmpty); } }) { public String[] getReservedWords() { return resWords; } }); define(new FunDefBase( "Count", "<Set>.Count", "Returns the number of tuples in a set including empty cells.", "pnx") { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); return count(evaluator, members, true); } }); define(new FunkResolver( "Covariance", "Covariance(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Returns the covariance of two series evaluated over a set (biased).", new String[]{"fnxn","fnxnn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp1 = (ExpBase) getArgNoEval(args, 1); ExpBase exp2 = (ExpBase) getArgNoEval(args, 2); return covariance(evaluator.push(), members, exp1, exp2, true); } })); define(new FunkResolver( "CovarianceN", "CovarianceN(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Returns the covariance of two series evaluated over a set (unbiased).", new String[]{"fnxn","fnxnn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp1 = (ExpBase) getArgNoEval(args, 1); ExpBase exp2 = (ExpBase) getArgNoEval(args, 2, valueFunCall); return covariance(evaluator.push(), members, exp1, exp2, false); } })); define(new FunDefBase("IIf", "IIf(<Logical Expression>, <Numeric Expression1>, <Numeric Expression2>)", "Returns one of two numeric values determined by a logical test.", "fnbnn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Boolean b = getBooleanArg(evaluator, args, 0); if (b == null) { // The result of the logical expression is not known, // probably because some necessary value is not in the // cache yet. Evaluate both expressions so that the cache // gets populated as soon as possible. getDoubleArg(evaluator, args, 1, null); getDoubleArg(evaluator, args, 2, null); return new Double(Double.NaN); } if (b.booleanValue()) return getDoubleArg(evaluator, args, 1, null); else return getDoubleArg(evaluator, args, 2, null); } }); define(new FunkResolver( "LinRegIntercept", "LinRegIntercept(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Calculates the linear regression of a set and returns the value of b in the regression line y = ax + b.", new String[]{"fnxn","fnxnn"}, new LinReg.Intercept())); define(new FunkResolver( "LinRegPoint", "LinRegPoint(<Numeric Expression>, <Set>, <Numeric Expression>[, <Numeric Expression>])", "Calculates the linear regression of a set and returns the value of y in the regression line y = ax + b.", new String[]{"fnnxn","fnnxnn"}, new LinReg.Point())); define(new FunkResolver( "LinRegR2", "LinRegR2(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Calculates the linear regression of a set and returns R2 (the coefficient of determination).", new String[]{"fnxn","fnxnn"}, new LinReg.R2())); define(new FunkResolver( "LinRegSlope", "LinRegSlope(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Calculates the linear regression of a set and returns the value of a in the regression line y = ax + b.", new String[]{"fnxn","fnxnn"}, new LinReg.Slope())); define(new FunkResolver( "LinRegVariance", "LinRegVariance(<Set>, <Numeric Expression>[, <Numeric Expression>])", "Calculates the linear regression of a set and returns the variance associated with the regression line y = ax + b.", new String[]{"fnxn","fnxnn"}, new LinReg.Variance())); define(new FunkResolver( "Max", "Max(<Set>[, <Numeric Expression>])", "Returns the maximum value of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return max(evaluator.push(), members, exp); } })); define(new FunkResolver( "Median", "Median(<Set>[, <Numeric Expression>])", "Returns the median value of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); //todo: ignore nulls, do we need to ignore the List? return median(evaluator.push(), members, exp); } })); define(new FunkResolver( "Min", "Min(<Set>[, <Numeric Expression>])", "Returns the minimum value of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return min(evaluator.push(), members, exp); } })); define(new FunDefBase("Ordinal", "<Level>.Ordinal", "Returns the zero-based ordinal value associated with a level.", "pnl") { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = getLevelArg(evaluator, args, 0, false); return new Double(level.getDepth()); } }); define(new FunkResolver( "Rank", "Rank(<Tuple>, <Set> [, <Calc Expression>])", "Returns the one-based rank of a tuple in a set.", new String[]{"fntx","fntxn", "fnmx", "fnmxn"}, new RankFunDef())); define(new FunkResolver( "Stddev", "Stddev(<Set>[, <Numeric Expression>])", "Alias for Stdev.", new String[]{"fnx", "fnxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return stdev(evaluator.push(), members, exp, false); } })); define(new FunkResolver( "Stdev", "Stdev(<Set>[, <Numeric Expression>])", "Returns the standard deviation of a numeric expression evaluated over a set (unbiased).", new String[]{"fnx", "fnxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return stdev(evaluator.push(), members, exp, false); } })); define(new FunkResolver( "StddevP", "StddevP(<Set>[, <Numeric Expression>])", "Alias for StdevP.", new String[]{"fnx", "fnxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return stdev(evaluator.push(), members, exp, true); } })); define(new FunkResolver( "StdevP", "StdevP(<Set>[, <Numeric Expression>])", "Returns the standard deviation of a numeric expression evaluated over a set (biased).", new String[]{"fnx", "fnxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return stdev(evaluator.push(), members, exp, true); } })); define(new FunkResolver( "Sum", "Sum(<Set>[, <Numeric Expression>])", "Returns the sum of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return sum(evaluator.push(), members, exp); } })); define(new FunDefBase("Value", "<Measure>.Value", "Returns the value of a measure.", "pnm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.evaluateScalar(evaluator); } }); define(new FunDefBase("_Value", "_Value(<Tuple>)", "Returns the value of the current measure within the context of a tuple.", "fnt") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member[] members = getTupleArg(evaluator, args, 0); Evaluator evaluator2 = evaluator.push(members); return evaluator2.evaluateCurrent(); } }); define(new FunDefBase("_Value", "_Value()", "Returns the value of the current measure.", "fn") { public Object evaluate(Evaluator evaluator, Exp[] args) { return evaluator.evaluateCurrent(); } }); // _Value is a pseudo-function which evaluates a tuple to a number. // It needs a custom resolver. if (false) define(new ResolverBase("_Value", null, null, Syntax.Parentheses) { public FunDef resolve(Exp[] args, int[] conversionCount) { if (args.length == 1 && args[0].getType() == Category.Tuple) { return new ValueFunDef(new int[] {Category.Tuple}); } for (int i = 0; i < args.length; i++) { Exp arg = args[i]; if (!canConvert(arg, Category.Member, conversionCount)) { return null; } } int[] argTypes = new int[args.length]; for (int i = 0; i < argTypes.length; i++) { argTypes[i] = Category.Member; } return new ValueFunDef(argTypes); } }); define(new FunkResolver( "Var", "Var(<Set>[, <Numeric Expression>])", "Returns the variance of a numeric expression evaluated over a set (unbiased).", new String[]{"fnx", "fnxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return var(evaluator.push(), members, exp, false); } })); define(new FunkResolver( "Variance", "Variance(<Set>[, <Numeric Expression>])", "Alias for Var.", new String[]{"fnx", "fnxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return var(evaluator.push(), members, exp, false); } })); define(new FunkResolver( "VarianceP", "VarianceP(<Set>[, <Numeric Expression>])", "Alias for VarP.", new String[]{"fnx", "fnxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return var(evaluator.push(), members, exp, true); } })); define(new FunkResolver( "VarP", "VarP(<Set>[, <Numeric Expression>])", "Returns the variance of a numeric expression evaluated over a set (biased).", new String[]{"fnx", "fnxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 1, valueFunCall); return var(evaluator.push(), members, exp, true); } })); // // SET FUNCTIONS if (false) define(new FunDefBase("AddCalculatedMembers", "AddCalculatedMembers(<Set>)", "Adds calculated members to a set.", "fx*")); define(new FunDefBase("Ascendants", "Ascendants(<Member>)", "Returns the set of the ascendants of a specified member.", "fxm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, false); if (member.isNull()) { return new ArrayList(); } Member[] members = member.getAncestorMembers(); final ArrayList result = new ArrayList(members.length + 1); result.add(member); addAll(result, members); return result; } }); define(new FunkResolver( "BottomCount", "BottomCount(<Set>, <Count>[, <Numeric Expression>])", "Returns a specified number of items from the bottom of a set, optionally ordering the set first.", new String[]{"fxxnn", "fxxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List list = (List) getArg(evaluator, args, 0); int n = getIntArg(evaluator, args, 1); ExpBase exp = (ExpBase) getArgNoEval(args, 2, null); if (exp != null) { boolean desc = false, brk = true; sort(evaluator, list, exp, desc, brk); } if (n < list.size()) { list = list.subList(0, n); } return list; } })); define(new FunkResolver( "BottomPercent", "BottomPercent(<Set>, <Percentage>, <Numeric Expression>)", "Sorts a set and returns the bottom N elements whose cumulative total is at least a specified percentage.", new String[]{"fxxnn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 2); Double n = getDoubleArg(evaluator, args, 1); return topOrBottom(evaluator.push(), members, exp, false, true, n.doubleValue()); } })); define(new FunkResolver( "BottomSum", "BottomSum(<Set>, <Value>, <Numeric Expression>)", "Sorts a set and returns the bottom N elements whose cumulative total is at least a specified value.", new String[]{"fxxnn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 2); Double n = getDoubleArg(evaluator, args, 1); return topOrBottom(evaluator.push(), members, exp, false, false, n.doubleValue()); } })); define(new FunDefBase("Children", "<Member>.Children", "Returns the children of a member.", "pxm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Member[] children = evaluator.getSchemaReader().getMemberChildren(member); return Arrays.asList(children); } }); define(new MultiResolver( "Crossjoin", "Crossjoin(<Set1>, <Set2>)", "Returns the cross product of two sets.", new String[]{"fxxx"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new CrossJoinFunDef(dummyFunDef); } }); define(new MultiResolver( "NonEmptyCrossJoin", "NonEmptyCrossJoin(<Set1>, <Set2>)", "Returns the cross product of two sets, excluding empty tuples and tuples without associated fact table data.", new String[]{"fxxx"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new NonEmptyCrossJoinFunDef(dummyFunDef); } }); define(new MultiResolver( "*", "<Set1> * <Set2>", "Returns the cross product of two sets.", new String[]{"ixxx", "ixmx", "ixxm", "ixmm"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { return new CrossJoinFunDef(dummyFunDef); } }); define(new DescendantsFunDef.Resolver()); define(new FunDefBase("Distinct", "Distinct(<Set>)", "Eliminates duplicate tuples from a set.", "fxx"){ // implement FunDef public Object evaluate(Evaluator evaluator, Exp[] args) { List list = (List) getArg(evaluator, args, 0); HashSet hashSet = new HashSet(list.size()); Iterator iter = list.iterator(); List result = new ArrayList(); while (iter.hasNext()) { Object element = iter.next(); MemberHelper lookupObj = new MemberHelper(element); if (hashSet.add(lookupObj)) { result.add(element); } } return result; } }); define(new FunkResolver("DrilldownLevel", "DrilldownLevel(<Set>[, <Level>]) or DrilldownLevel(<Set>, , <Index>)", "Drills down the members of a set, at a specified level, to one level below. Alternatively, drills down on a specified dimension in the set.", new String[]{"fxx", "fxxl"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { //todo add fssl functionality List set0 = (List) getArg(evaluator, args, 0); if (set0.size() == 0) { return set0; } int searchDepth = -1; Level level = getLevelArg(evaluator, args, 1, false); if (level != null) { searchDepth = level.getDepth(); } if (searchDepth == -1) { searchDepth = ((Member)set0.get(0)).getLevel().getDepth(); for (int i = 1, m = set0.size(); i < m; i++) { Member member = (Member) set0.get(i); int memberDepth = member.getLevel().getDepth(); if (memberDepth > searchDepth) { searchDepth = memberDepth; } } } List drilledSet = new ArrayList(); for (int i = 0, m = set0.size(); i < m; i++) { Member member = (Member) set0.get(i); drilledSet.add(member); Member nextMember = i == m - 1 ? null : (Member) set0.get(i + 1); // // This member is drilled if it's at the correct depth // and if it isn't drilled yet. A member is considered // to be "drilled" if it is immediately followed by // at least one descendant // if (member.getLevel().getDepth() == searchDepth && !isAncestorOf(member, nextMember, true)) { Member[] childMembers = evaluator.getSchemaReader().getMemberChildren(member); for (int j = 0; j < childMembers.length; j++) { drilledSet.add(childMembers[j]); } } } return drilledSet; } } )); if (false) define(new FunDefBase("DrilldownLevelBottom", "DrilldownLevelBottom(<Set>, <Count>[, [<Level>][, <Numeric Expression>]])", "Drills down the bottom N members of a set, at a specified level, to one level below.", "fx*")); if (false) define(new FunDefBase("DrilldownLevelTop", "DrilldownLevelTop(<Set>, <Count>[, [<Level>][, <Numeric Expression>]])", "Drills down the top N members of a set, at a specified level, to one level below.", "fx*")); define(new DrilldownMemberFunDef.Resolver()); if (false) define(new FunDefBase("DrilldownMemberBottom", "DrilldownMemberBottom(<Set1>, <Set2>, <Count>[, [<Numeric Expression>][, RECURSIVE]])", "Like DrilldownMember except that it includes only the bottom N children.", "fx*")); if (false) define(new FunDefBase("DrilldownMemberTop", "DrilldownMemberTop(<Set1>, <Set2>, <Count>[, [<Numeric Expression>][, RECURSIVE]])", "Like DrilldownMember except that it includes only the top N children.", "fx*")); if (false) define(new FunDefBase("DrillupLevel", "DrillupLevel(<Set>[, <Level>])", "Drills up the members of a set that are below a specified level.", "fx*")); if (false) define(new FunDefBase("DrillupMember", "DrillupMember(<Set1>, <Set2>)", "Drills up the members in a set that are present in a second specified set.", "fx*")); define(new FunkResolver( "Except", "Except(<Set1>, <Set2>[, ALL])", "Finds the difference between two sets, optionally retaining duplicates.", new String[]{"fxxx", "fxxxs"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { // todo: implement ALL HashSet set = new HashSet(); set.addAll((List) getArg(evaluator, args, 1)); List set1 = (List) getArg(evaluator, args, 0); List result = new ArrayList(); for (int i = 0, count = set1.size(); i < count; i++) { Object o = set1.get(i); if (!set.contains(o)) { result.add(o); } } return result; } })); if (false) define(new FunDefBase("Extract", "Extract(<Set>, <Dimension>[, <Dimension>...])", "Returns a set of tuples from extracted dimension elements. The opposite of Crossjoin.", "fx*")); define(new FunDefBase("Filter", "Filter(<Set>, <Search Condition>)", "Returns the set resulting from filtering a set based on a search condition.", "fxxb") { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); Exp exp = args[1]; List result = new ArrayList(); Evaluator evaluator2 = evaluator.push(); for (int i = 0, count = members.size(); i < count; i++) { Object o = members.get(i); if (o instanceof Member) { evaluator2.setContext((Member) o); } else if (o instanceof Member[]) { evaluator2.setContext((Member[]) o); } else { throw Util.newInternal( "unexpected type in set: " + o.getClass()); } Boolean b = (Boolean) exp.evaluateScalar(evaluator2); if (b != null && b.booleanValue()) { result.add(o); } } return result; } public boolean dependsOn(Exp[] args, Dimension dimension) { return dependsOnIntersection(args, dimension); } }); define(new MultiResolver( "Generate", "Generate(<Set1>, <Set2>[, ALL])", "Applies a set to each member of another set and joins the resulting sets by union.", new String[] {"fxxx", "fxxxy"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { final boolean all = getLiteralArg(args, 2, "", new String[] {"ALL"}, dummyFunDef).equalsIgnoreCase("ALL"); return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); List result = new ArrayList(); HashSet emitted = all ? null : new HashSet(); for (int i = 0; i < members.size(); i++) { Object o = members.get(i); if (o instanceof Member) { evaluator.setContext((Member) o); } else { evaluator.setContext((Member[]) o); } final List result2 = (List) args[1].evaluate(evaluator); if (all) { result.addAll(result2); } else { for (int j = 0; j < result2.size(); j++) { Object row = result2.get(j); if (emitted.add(row)) { result.add(row); } } } } return result; } }; } }); define(new FunkResolver( "Head", "Head(<Set>[, < Numeric Expression >])", "Returns the first specified number of elements in a set.", new String[] {"fxx", "fxxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); final int count = args.length < 2 ? 1 : getIntArg(evaluator, args, 1); if (count >= members.size()) { return members; } if (count <= 0) { return new ArrayList(); } return members.subList(0, count); } })); final String[] prePost = {"PRE","POST"}; define(new MultiResolver( "Hierarchize", "Hierarchize(<Set>[, POST])", "Orders the members of a set in a hierarchy.", new String[] {"fxx", "fxxy"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { String order = getLiteralArg(args, 1, "PRE", prePost, dummyFunDef); final boolean post = order.equals("POST"); return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); hierarchize(members, post); return members; } }; } public String[] getReservedWords() { return prePost; } }); define(new MultiResolver( "Intersect", "Intersect(<Set1>, <Set2>[, ALL])", "Returns the intersection of two input sets, optionally retaining duplicates.", new String[] {"fxxxy", "fxxx"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { final boolean all = getLiteralArg(args, 2, "", new String[] {"ALL"}, dummyFunDef).equalsIgnoreCase("ALL"); return new IntersectFunDef(dummyFunDef, all); } }); if (false) define(new FunDefBase("LastPeriods", "LastPeriods(<Index>[, <Member>])", "Returns a set of members prior to and including a specified member.", "fx*")); define(new FunDefBase("Members", "<Dimension>.Members", "Returns the set of all members in a dimension.", "pxd") { public Object evaluate(Evaluator evaluator, Exp[] args) { Dimension dimension = (Dimension) getArg(evaluator, args, 0); Hierarchy hierarchy = dimension.getHierarchy(); return addMembers(evaluator.getSchemaReader(), new ArrayList(), hierarchy); } }); define(new FunDefBase("Members", "<Hierarchy>.Members", "Returns the set of all members in a hierarchy.", "pxh") { public Object evaluate(Evaluator evaluator, Exp[] args) { Hierarchy hierarchy = (Hierarchy) getArg(evaluator, args, 0); return addMembers(evaluator.getSchemaReader(), new ArrayList(), hierarchy); } }); define(new FunDefBase("Members", "<Level>.Members", "Returns the set of all members in a level.", "pxl") { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = (Level) getArg(evaluator, args, 0); return Arrays.asList(evaluator.getSchemaReader().getLevelMembers(level)); } }); define(new FunkResolver( "Mtd", "Mtd([<Member>])", "A shortcut function for the PeriodsToDate function that specifies the level to be Month.", new String[]{"fx", "fxm"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { return periodsToDate( evaluator, evaluator.getCube().getMonthLevel(), getMemberArg(evaluator, args, 0, false)); } })); define(new OrderFunDef.OrderResolver()); define(new FunkResolver( "PeriodsToDate", "PeriodsToDate([<Level>[, <Member>]])", "Returns a set of periods (members) from a specified level starting with the first period and ending with a specified member.", new String[]{"fx", "fxl", "fxlm"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = getLevelArg(evaluator, args, 0, false); Member member = getMemberArg(evaluator, args, 1, false); return periodsToDate(evaluator, level, member); } })); define(new FunkResolver( "Qtd", "Qtd([<Member>])", "A shortcut function for the PeriodsToDate function that specifies the level to be Quarter.", new String[]{"fx", "fxm"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { return periodsToDate( evaluator, evaluator.getCube().getQuarterLevel(), getMemberArg(evaluator, args, 0, false)); } })); if (false) define(new FunDefBase("StripCalculatedMembers", "StripCalculatedMembers(<Set>)", "Removes calculated members from a set.", "fx*")); // "Siblings" is not a standard MDX function. define(new FunDefBase("Siblings", "<Member>.Siblings", "Returns the set of siblings of the specified member.", "pxm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); Member parent = member.getParentMember(); final SchemaReader schemaReader = evaluator.getSchemaReader(); Member[] siblings; if (parent == null) { siblings = schemaReader.getHierarchyRootMembers(member.getHierarchy()); } else { siblings = schemaReader.getMemberChildren(parent); } return Arrays.asList(siblings); } }); define(new FunDefBase("StrToSet", "StrToSet(<String Expression>)", "Constructs a set from a string expression.", "fxS") { public Hierarchy getHierarchy(Exp[] args) { // StrToSet(s, <Hie1>, ... <HieN>) is of type [Hie1] x ... x [HieN]; // so, for example, So StrToTuple("[Time].[1997]", [Time]) is of type // [Time]. But if n > 1, we cannot represent the compound type, and we // return null. return (args.length == 2) ? (Hierarchy) args[1] : null; } }); define(new FunkResolver( "Subset", "Subset(<Set>, <Start>[, <Count>])", "Returns a subset of elements from a set.", new String[] {"fxxn", "fxxnn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); final int start = getIntArg(evaluator, args, 1); final int end; if (args.length < 3) { end = members.size(); } else { final int count = getIntArg(evaluator, args, 2); end = start + count; } if (start >= end || start < 0) { return new ArrayList(); } if (start == 0 && end >= members.size()) { return members; } return members.subList(start, end); } })); define(new FunkResolver( "Tail", "Tail(<Set>[, <Count>])", "Returns a subset from the end of a set.", new String[] {"fxx", "fxxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); final int count = args.length < 2 ? 1 : getIntArg(evaluator, args, 1); if (count >= members.size()) { return members; } if (count <= 0) { return new ArrayList(); } return members.subList(members.size() - count, members.size()); } })); define(new FunkResolver( "ToggleDrillState", "ToggleDrillState(<Set1>, <Set2>[, RECURSIVE])", "Toggles the drill state of members. This function is a combination of DrillupMember and DrilldownMember.", new String[]{"fxxx", "fxxxy"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List v0 = (List) getArg(evaluator, args, 0), v1 = (List) getArg(evaluator, args, 1); if (args.length > 2) { throw MondrianResource.instance().newToggleDrillStateRecursiveNotSupported(); } if (v1.isEmpty()) { return v0; } if (v0.isEmpty()) { return v0; } HashSet set = new HashSet(); set.addAll(v1); HashSet set1 = set; List result = new ArrayList(); int i = 0, n = v0.size(); while (i < n) { Object o = v0.get(i++); result.add(o); Member m = null; int k = -1; if (o instanceof Member) { if (!set1.contains(o)) { continue; } m = (Member) o; k = -1; } else { Util.assertTrue(o instanceof Member[]); Member[] members = (Member[]) o; for (int j = 0; j < members.length; j++) { Member member = members[j]; if (set1.contains(member)) { k = j; m = member; break; } } if (k == -1) { continue; } } boolean isDrilledDown = false; if (i < n) { Object next = v0.get(i); Member nextMember = (k < 0) ? (Member) next : ((Member[]) next)[k]; boolean strict = true; if (isAncestorOf(m, nextMember, strict)) { isDrilledDown = true; } } if (isDrilledDown) { // skip descendants of this member do { Object next = v0.get(i); Member nextMember = (k < 0) ? (Member) next : ((Member[]) next)[k]; boolean strict = true; if (isAncestorOf(m, nextMember, strict)) { i++; } else { break; } } while (i < n); } else { Member[] children = evaluator.getSchemaReader().getMemberChildren(m); for (int j = 0; j < children.length; j++) { if (k < 0) { result.add(children[j]); } else { Member[] members = (Member[]) ((Member[]) o).clone(); members[k] = children[j]; result.add(members); } } } } return result; } }) { public String[] getReservedWords() { return new String[] {"RECURSIVE"}; } }); define(new FunkResolver( "TopCount", "TopCount(<Set>, <Count>[, <Numeric Expression>])", "Returns a specified number of items from the top of a set, optionally ordering the set first.", new String[]{"fxxnn", "fxxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List list = (List) getArg(evaluator, args, 0); int n = getIntArg(evaluator, args, 1); ExpBase exp = (ExpBase) getArgNoEval(args, 2, null); if (exp != null) { boolean desc = true, brk = true; sort(evaluator, list, exp, desc, brk); } if (n < list.size()) { list = list.subList(0, n); } return list; } })); define(new FunkResolver( "TopPercent", "TopPercent(<Set>, <Percentage>, <Numeric Expression>)", "Sorts a set and returns the top N elements whose cumulative total is at least a specified percentage.", new String[]{"fxxnn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 2); Double n = getDoubleArg(evaluator, args, 1); return topOrBottom(evaluator.push(), members, exp, true, true, n.doubleValue()); } })); define(new FunkResolver( "TopSum", "TopSum(<Set>, <Value>, <Numeric Expression>)", "Sorts a set and returns the top N elements whose cumulative total is at least a specified value.", new String[]{"fxxnn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArgNoEval(args, 2); Double n = getDoubleArg(evaluator, args, 1); return topOrBottom(evaluator.push(), members, exp, true, false, n.doubleValue()); } })); final String[] allDistinct = new String[] {"ALL", "DISTINCT"}; define(new MultiResolver( "Union", "Union(<Set1>, <Set2>[, ALL])", "Returns the union of two sets, optionally retaining duplicates.", new String[] {"fxxx", "fxxxy"}) { public String[] getReservedWords() { return allDistinct; } protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { String allString = getLiteralArg(args, 2, "DISTINCT", allDistinct, dummyFunDef); final boolean all = allString.equalsIgnoreCase("ALL"); checkCompatible(args[0], args[1], dummyFunDef); return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { List left = (List) getArg(evaluator, args, 0), right = (List) getArg(evaluator, args, 1); if (all) { if (left == null || left.isEmpty()) { return right; } left.addAll(right); return left; } else { HashSet added = new HashSet(); List result = new ArrayList(); addUnique(result, left, added); addUnique(result, right, added); return result; } } }; } }); if (false) define(new FunDefBase("VisualTotals", "VisualTotals(<Set>, <Pattern>)", "Dynamically totals child members specified in a set using a pattern for the total label in the result set.", "fx*")); define(new FunkResolver( "Wtd", "Wtd([<Member>])", "A shortcut function for the PeriodsToDate function that specifies the level to be Week.", new String[]{"fx", "fxm"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { return periodsToDate( evaluator, evaluator.getCube().getWeekLevel(), getMemberArg(evaluator, args, 0, false)); } })); define(new FunkResolver( "Ytd", "Ytd([<Member>])", "A shortcut function for the PeriodsToDate function that specifies the level to be Year.", new String[]{"fx", "fxm"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { return periodsToDate( evaluator, evaluator.getCube().getYearLevel(), getMemberArg(evaluator, args, 0, false)); } })); define(new FunDefBase(":", "<Member>:<Member>", "Infix colon operator returns the set of members between a given pair of members.", "ixmm") { // implement FunDef public Object evaluate(Evaluator evaluator, Exp[] args) { final Member member0 = getMemberArg(evaluator, args, 0, true); final Member member1 = getMemberArg(evaluator, args, 1, true); if (member0.isNull() || member1.isNull()) { return Collections.EMPTY_LIST; } if (member0.getLevel() != member1.getLevel()) { throw newEvalException(this, "Members must belong to the same level"); } return FunUtil.memberRange(evaluator, member0, member1); } }); // special resolver for the "{...}" operator define(new ResolverBase( "{}", "{<Member> [, <Member>]...}", "Brace operator constructs a set.", Syntax.Braces) { public FunDef resolve(Exp[] args, int[] conversionCount) { int[] parameterTypes = new int[args.length]; for (int i = 0; i < args.length; i++) { if (canConvert( args[i], Category.Member, conversionCount)) { parameterTypes[i] = Category.Member; continue; } if (canConvert( args[i], Category.Set, conversionCount)) { parameterTypes[i] = Category.Set; continue; } if (canConvert( args[i], Category.Tuple, conversionCount)) { parameterTypes[i] = Category.Tuple; continue; } return null; } return new SetFunDef(this, parameterTypes); } }); // // STRING FUNCTIONS define(new MultiResolver("Format", "Format(<Numeric Expression>, <String Expression>)", "Formats a number to string.", new String[] { "fSmS", "fSnS" }) { protected FunDef createFunDef(final Exp[] args, final FunDef dummyFunDef) { final Locale locale = Locale.getDefault(); // todo: use connection's locale if (args[1] instanceof Literal) { // Constant string expression: optimize by compiling // format string. String formatString = (String) ((Literal) args[1]).getValue(); final Format format = new Format(formatString, locale); return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o = getDoubleArg(evaluator, args, 0); return format.format(o); } }; } else { // Variable string expression return new FunDefBase(dummyFunDef) { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o = getDoubleArg(evaluator, args, 0); String formatString = getStringArg(evaluator, args, 1, null); final Format format = new Format(formatString, locale); return format.format(o); } }; } } }); define(new FunDefBase("IIf", "IIf(<Logical Expression>, <String Expression1>, <String Expression2>)", "Returns one of two string values determined by a logical test.", "fSbSS") { public Object evaluate(Evaluator evaluator, Exp[] args) { Boolean b = getBooleanArg(evaluator, args, 0); if (b == null) { // The result of the logical expression is not known, // probably because some necessary value is not in the // cache yet. Evaluate both expressions so that the cache // gets populated as soon as possible. getStringArg(evaluator, args, 1, null); getStringArg(evaluator, args, 2, null); return null; } if (b.booleanValue()) { return getStringArg(evaluator, args, 1, null); } else { return getStringArg(evaluator, args, 2, null); } } }); define(new FunDefBase("Caption", "<Dimension>.Caption", "Returns the caption of a dimension.", "pSd") { public Object evaluate(Evaluator evaluator, Exp[] args) { Dimension dimension = getDimensionArg(evaluator, args, 0, true); return dimension.getCaption(); } }); define(new FunDefBase("Caption", "<Hierarchy>.Caption", "Returns the caption of a hierarchy.", "pSh") { public Object evaluate(Evaluator evaluator, Exp[] args) { Hierarchy hierarchy = getHierarchyArg(evaluator, args, 0, true); return hierarchy.getCaption(); } }); define(new FunDefBase("Caption", "<Level>.Caption", "Returns the caption of a level.", "pSl") { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = getLevelArg(evaluator, args, 0, true); return level.getCaption(); } }); define(new FunDefBase("Caption", "<Member>.Caption", "Returns the caption of a member.", "pSm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.getCaption(); } }); define(new FunDefBase("Name", "<Dimension>.Name", "Returns the name of a dimension.", "pSd") { public Object evaluate(Evaluator evaluator, Exp[] args) { Dimension dimension = getDimensionArg(evaluator, args, 0, true); return dimension.getName(); } }); define(new FunDefBase("Name", "<Hierarchy>.Name", "Returns the name of a hierarchy.", "pSh") { public Object evaluate(Evaluator evaluator, Exp[] args) { Hierarchy hierarchy = getHierarchyArg(evaluator, args, 0, true); return hierarchy.getName(); } }); define(new FunDefBase("Name", "<Level>.Name", "Returns the name of a level.", "pSl") { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = getLevelArg(evaluator, args, 0, true); return level.getName(); } }); define(new FunDefBase("Name", "<Member>.Name", "Returns the name of a member.", "pSm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.getName(); } }); define(new FunDefBase("SetToStr", "SetToStr(<Set>)", "Constructs a string from a set.", "fSx")); define(new FunDefBase("TupleToStr", "TupleToStr(<Tuple>)", "Constructs a string from a tuple.", "fSt")); define(new FunDefBase("UniqueName", "<Dimension>.UniqueName", "Returns the unique name of a dimension.", "pSd") { public Object evaluate(Evaluator evaluator, Exp[] args) { Dimension dimension = getDimensionArg(evaluator, args, 0, true); return dimension.getUniqueName(); } }); define(new FunDefBase("UniqueName", "<Hierarchy>.UniqueName", "Returns the unique name of a hierarchy.", "pSh") { public Object evaluate(Evaluator evaluator, Exp[] args) { Hierarchy hierarchy = getHierarchyArg(evaluator, args, 0, true); return hierarchy.getUniqueName(); } }); define(new FunDefBase("UniqueName", "<Level>.UniqueName", "Returns the unique name of a level.", "pSl") { public Object evaluate(Evaluator evaluator, Exp[] args) { Level level = getLevelArg(evaluator, args, 0, true); return level.getUniqueName(); } }); define(new FunDefBase("UniqueName", "<Member>.UniqueName", "Returns the unique name of a member.", "pSm") { public Object evaluate(Evaluator evaluator, Exp[] args) { Member member = getMemberArg(evaluator, args, 0, true); return member.getUniqueName(); } }); // // TUPLE FUNCTIONS define(new FunDefBase("Current", "<Set>.Current", "Returns the current tuple from a set during an iteration.", "ptx")); if (false) { // we do not support the <String expression> arguments define(new FunDefBase("Item", "<Set>.Item(<String Expression>[, <String Expression>...] | <Index>)", "Returns a tuple from a set.", "mx*")); } define (new FunkResolver("Item", "<Set>.Item(<Index>)", "Returns the <Index>th element in the set, or ", new String[] {"mtxn", "mmtn"}, new FunkBase() { // Returns the item specified from the set. public Object evaluate(Evaluator evaluator, Exp[] args) { Object arg0 = getArg(evaluator, args, 0); int index = getIntArg(evaluator, args, 1); int setSize; if (arg0 instanceof List) { List theSet = (List)arg0; setSize = theSet.size(); if (index < setSize && index >= 0) { return theSet.get(index); } } else { // // You'll get a member in the following case: // {[member]}.item(0).item(0), even though the first invocation of // item returned a tuple. // assert ((arg0 instanceof Member[]) || (arg0 instanceof Member)); if (arg0 instanceof Member) { if (index == 0) { return arg0; } setSize = 0; } else { Member[] tuple = (Member[]) arg0; if (index < tuple.length && index >= 0) { return tuple[index]; } setSize = tuple.length; } } throw MondrianResource.instance().newItemIndexOutOfBounds(Integer.toString(index), Integer.toString(setSize - 1)); } })); define(new FunDefBase("StrToTuple", "StrToTuple(<String Expression>)", "Constructs a tuple from a string.", "ftS") { public Hierarchy getHierarchy(Exp[] args) { // StrToTuple(s, <Hie1>, ... <HieN>) is of type [Hie1] x // ... x [HieN]; so, for example, So // StrToTuple("[Time].[1997]", [Time]) is of type [Time]. // But if n > 1, we cannot represent the compound type, and // we return null. return (args.length == 2) ? (Hierarchy) args[1] : null; } }); // special resolver for "()" define(new ResolverBase("()", null, null, Syntax.Parentheses) { public FunDef resolve(Exp[] args, int[] conversionCount) { // Compare with TupleFunDef.getReturnType(). For example, // ([Gender].members) is a set, // ([Gender].[M]) is a member, // (1 + 2) is a numeric, // but // ([Gender].[M], [Marital Status].[S]) is a tuple. if (args.length == 1) { return new ParenthesesFunDef(args[0].getType()); } else { return new TupleFunDef(ExpBase.getTypes(args)); } } }); // // GENERIC VALUE FUNCTIONS define(new ResolverBase( "CoalesceEmpty", "CoalesceEmpty(<Value Expression>[, <Value Expression>]...)", "Coalesces an empty cell value to a different value. All of the expressions must be of the same type (number or string).", Syntax.Function) { public FunDef resolve(Exp[] args, int[] conversionCount) { if (args.length < 1) { return null; } final int[] types = {Category.Numeric, Category.String}; for (int j = 0; j < types.length; j++) { int type = types[j]; int matchingArgs = 0; conversionCount[0] = 0; for (int i = 0; i < args.length; i++) { if (canConvert(args[i], type, conversionCount)) { matchingArgs++; } } if (matchingArgs == args.length) { return new CoalesceEmptyFunDef(this, type, ExpBase.getTypes(args)); } } return null; } public boolean requiresExpression(int k) { return true; } }); define(new ResolverBase( "_CaseTest", "Case When <Logical Expression> Then <Expression> [...] [Else <Expression>] End", "Evaluates various conditions, and returns the corresponding expression for the first which evaluates to true.", Syntax.Case) { public FunDef resolve(Exp[] args, int[] conversionCount) { if (args.length < 1) { return null; } int j = 0, clauseCount = args.length / 2, mismatchingArgs = 0; int returnType = args[1].getType(); for (int i = 0; i < clauseCount; i++) { if (!canConvert(args[j++], Category.Logical, conversionCount)) { mismatchingArgs++; } if (!canConvert(args[j++], returnType, conversionCount)) { mismatchingArgs++; } } if (j < args.length) { if (!canConvert(args[j++], returnType, conversionCount)) { mismatchingArgs++; } } Util.assertTrue(j == args.length); if (mismatchingArgs == 0) { return new FunDefBase(this, returnType, ExpBase.getTypes(args)) { // implement FunDef public Object evaluate(Evaluator evaluator, Exp[] args) { return evaluateCaseTest(evaluator, args); } }; } else { return null; } } public boolean requiresExpression(int k) { return true; } Object evaluateCaseTest(Evaluator evaluator, Exp[] args) { int clauseCount = args.length / 2, j = 0; for (int i = 0; i < clauseCount; i++) { boolean logical = getBooleanArg(evaluator, args, j++, false); if (logical) { return getArg(evaluator, args, j); } else { j++; } } if (j < args.length) { return getArg(evaluator, args, j); // ELSE } else { return null; } } }); define(new ResolverBase( "_CaseMatch", "Case <Expression> When <Expression> Then <Expression> [...] [Else <Expression>] End", "Evaluates various expressions, and returns the corresponding expression for the first which matches a particular value.", Syntax.Case) { public FunDef resolve(Exp[] args, int[] conversionCount) { if (args.length < 3) { return null; } int valueType = args[0].getType(); int returnType = args[2].getType(); int j = 0, clauseCount = (args.length - 1) / 2, mismatchingArgs = 0; if (!canConvert(args[j++], valueType, conversionCount)) { mismatchingArgs++; } for (int i = 0; i < clauseCount; i++) { if (!canConvert(args[j++], valueType, conversionCount)) { mismatchingArgs++; } if (!canConvert(args[j++], returnType, conversionCount)) { mismatchingArgs++; } } if (j < args.length) { if (!canConvert(args[j++], returnType, conversionCount)) { mismatchingArgs++; } } Util.assertTrue(j == args.length); if (mismatchingArgs == 0) { return new FunDefBase(this, returnType, ExpBase.getTypes(args)) { // implement FunDef public Object evaluate(Evaluator evaluator, Exp[] args) { return evaluateCaseMatch(evaluator, args); } }; } else { return null; } } public boolean requiresExpression(int k) { return true; } Object evaluateCaseMatch(Evaluator evaluator, Exp[] args) { int clauseCount = (args.length - 1)/ 2, j = 0; Object value = getArg(evaluator, args, j++); for (int i = 0; i < clauseCount; i++) { Object match = getArg(evaluator, args, j++); if (match.equals(value)) { return getArg(evaluator, args, j); } else { j++; } } if (j < args.length) { return getArg(evaluator, args, j); // ELSE } else { return null; } } }); define(new PropertiesFunDef.Resolver()); // // PARAMETER FUNCTIONS define(new MultiResolver("Parameter", "Parameter(<Name>, <Type>, <DefaultValue>, <Description>)", "Returns default value of parameter.", new String[] { "fS#yS#", "fs#yS", // Parameter(string const, symbol, string[, string const]): string "fn#yn#", "fn#yn", // Parameter(string const, symbol, numeric[, string const]): numeric "fm#hm#", "fm#hm", // Parameter(string const, hierarchy constant, member[, string const]): member }) { public String[] getReservedWords() { return new String[] {"NUMERIC","STRING"}; } protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { String parameterName; if (args[0] instanceof Literal && args[0].getType() == Category.String) { parameterName = (String) ((Literal) args[0]).getValue(); } else { throw newEvalException(dummyFunDef, "Parameter name must be a string constant"); } Exp typeArg = args[1]; Hierarchy hierarchy; int type; switch (typeArg.getType()) { case Category.Hierarchy: case Category.Dimension: hierarchy = typeArg.getHierarchy(); if (hierarchy == null || !isConstantHierarchy(typeArg)) { throw newEvalException(dummyFunDef, "Invalid hierarchy for parameter '" + parameterName + "'"); } type = Category.Member; break; case Category.Symbol: hierarchy = null; String s = (String) ((Literal) typeArg).getValue(); if (s.equalsIgnoreCase("NUMERIC")) { type = Category.Numeric; break; } else if (s.equalsIgnoreCase("STRING")) { type = Category.String; break; } // fall through and throw error default: // Error is internal because the function call has already been // type-checked. throw newEvalException(dummyFunDef, "Invalid type for parameter '" + parameterName + "'; expecting NUMERIC, STRING or a hierarchy"); } Exp exp = args[2]; if (exp.getType() != type) { String typeName = Category.instance.getName(type).toUpperCase(); throw newEvalException(dummyFunDef, "Default value of parameter '" + parameterName + "' is inconsistent with its type, " + typeName); } if (type == Category.Member) { Hierarchy expHierarchy = exp.getHierarchy(); if (expHierarchy != hierarchy) { throw newEvalException(dummyFunDef, "Default value of parameter '" + parameterName + "' must belong to the hierarchy " + hierarchy); } } String parameterDescription = null; if (args.length > 3) { if (args[3] instanceof Literal && args[3].getType() == Category.String) { parameterDescription = (String) ((Literal) args[3]).getValue(); } else { throw newEvalException(dummyFunDef, "Description of parameter '" + parameterName + "' must be a string constant"); } } return new ParameterFunDef(dummyFunDef, parameterName, hierarchy, type, exp, parameterDescription); } }); define(new MultiResolver("ParamRef", "ParamRef(<Name>)", "Returns current value of parameter. If it's null, returns default.", new String[] {"fv#"}) { protected FunDef createFunDef(Exp[] args, FunDef dummyFunDef) { String parameterName; if (args[0] instanceof Literal && args[0].getType() == Category.String) { parameterName = (String) ((Literal) args[0]).getValue(); } else { throw newEvalException(dummyFunDef, "Parameter name must be a string constant"); } return new ParameterFunDef(dummyFunDef, parameterName, null, Category.Unknown, null, null); } }); // // OPERATORS define(new FunDefBase("+", "<Numeric Expression> + <Numeric Expression>", "Adds two numbers.", "innn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0, null), o1 = getDoubleArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return new Double(o0.doubleValue() + o1.doubleValue()); } }); define(new FunDefBase("-", "<Numeric Expression> - <Numeric Expression>", "Subtracts two numbers.", "innn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0, null), o1 = getDoubleArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return new Double(o0.doubleValue() - o1.doubleValue()); } }); define(new FunDefBase("*", "<Numeric Expression> * <Numeric Expression>", "Multiplies two numbers.", "innn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0, null), o1 = getDoubleArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return new Double(o0.doubleValue() * o1.doubleValue()); } }); define(new FunDefBase("/", "<Numeric Expression> / <Numeric Expression>", "Divides two numbers.", "innn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0, null), o1 = getDoubleArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return new Double(o0.doubleValue() / o1.doubleValue()); } // todo: use this, via reflection public double evaluate(double d1, double d2) { return d1 / d2; } }); define(new FunDefBase("-", "- <Numeric Expression>", "Returns the negative of a number.", "Pnn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0, null); if (o0 == null) { return null; } return new Double(- o0.doubleValue()); } }); define(new FunDefBase("||", "<String Expression> || <String Expression>", "Concatenates two strings.", "iSSS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String o0 = getStringArg(evaluator, args, 0, null), o1 = getStringArg(evaluator, args, 1, null); return o0 + o1; } }); define(new FunDefBase("AND", "<Logical Expression> AND <Logical Expression>", "Returns the conjunction of two conditions.", "ibbb") { public Object evaluate(Evaluator evaluator, Exp[] args) { // if the first arg is known and false, we dont evaluate the second Boolean b1 = getBooleanArg(evaluator, args, 0); if (b1 != null && !b1.booleanValue()) { return Boolean.FALSE; } Boolean b2 = getBooleanArg(evaluator, args, 1); if (b2 != null && !b2.booleanValue()) { return Boolean.FALSE; } if (b1 == null || b2 == null) { return null; } return Boolean.valueOf(b1.booleanValue() && b2.booleanValue()); } }); define(new FunDefBase("OR", "<Logical Expression> OR <Logical Expression>", "Returns the disjunction of two conditions.", "ibbb") { public Object evaluate(Evaluator evaluator, Exp[] args) { // if the first arg is known and true, we dont evaluate the second Boolean b1 = getBooleanArg(evaluator, args, 0); if (b1 != null && b1.booleanValue()) { return Boolean.TRUE; } Boolean b2 = getBooleanArg(evaluator, args, 1); if (b2 != null && b2.booleanValue()) { return Boolean.TRUE; } if (b1 == null || b2 == null) { return null; } return Boolean.valueOf(b1.booleanValue() || b2.booleanValue()); } }); define(new FunDefBase("XOR", "<Logical Expression> XOR <Logical Expression>", "Returns whether two conditions are mutually exclusive.", "ibbb") { public Object evaluate(Evaluator evaluator, Exp[] args) { Boolean b1 = getBooleanArg(evaluator, args, 0); Boolean b2 = getBooleanArg(evaluator, args, 1); if (b1 == null || b2 == null) { return null; } return Boolean.valueOf(b1.booleanValue() != b2.booleanValue()); } }); define(new FunDefBase("NOT", "NOT <Logical Expression>", "Returns the negation of a condition.", "Pbb") { public Object evaluate(Evaluator evaluator, Exp[] args) { Boolean b = getBooleanArg(evaluator, args, 0); if (b == null) { return null; } boolean b1 = !b.booleanValue(); return Boolean.valueOf(b1); } }); define(new FunDefBase("=", "<String Expression> = <String Expression>", "Returns whether two expressions are equal.", "ibSS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String o0 = getStringArg(evaluator, args, 0, null), o1 = getStringArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return Boolean.valueOf(o0.equals(o1)); } }); define(new FunDefBase("=", "<Numeric Expression> = <Numeric Expression>", "Returns whether two expressions are equal.", "ibnn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0), o1 = getDoubleArg(evaluator, args, 1); if (o0.isNaN() || o1.isNaN()) { return null; } return Boolean.valueOf(o0.equals(o1)); } }); define(new FunDefBase("<>", "<String Expression> <> <String Expression>", "Returns whether two expressions are not equal.", "ibSS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String o0 = getStringArg(evaluator, args, 0, null), o1 = getStringArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } boolean b = !o0.equals(o1); return Boolean.valueOf(b); } }); define(new FunDefBase("<>", "<Numeric Expression> <> <Numeric Expression>", "Returns whether two expressions are not equal.", "ibnn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0), o1 = getDoubleArg(evaluator, args, 1); if (o0.isNaN() || o1.isNaN()) { return null; } boolean b = !o0.equals(o1); return Boolean.valueOf(b); } }); define(new FunDefBase("<", "<Numeric Expression> < <Numeric Expression>", "Returns whether an expression is less than another.", "ibnn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0), o1 = getDoubleArg(evaluator, args, 1); if (o0.isNaN() || o1.isNaN()) { return null; } return Boolean.valueOf(o0.compareTo(o1) < 0); } }); define(new FunDefBase("<", "<String Expression> < <String Expression>", "Returns whether an expression is less than another.", "ibSS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String o0 = getStringArg(evaluator, args, 0, null), o1 = getStringArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return Boolean.valueOf(o0.compareTo(o1) < 0); } }); define(new FunDefBase("<=", "<Numeric Expression> <= <Numeric Expression>", "Returns whether an expression is less than or equal to another.", "ibnn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0), o1 = getDoubleArg(evaluator, args, 1); if (o0.isNaN() || o1.isNaN()) { return null; } return Boolean.valueOf(o0.compareTo(o1) <= 0); } }); define(new FunDefBase("<=", "<String Expression> <= <String Expression>", "Returns whether an expression is less than or equal to another.", "ibSS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String o0 = getStringArg(evaluator, args, 0, null), o1 = getStringArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return Boolean.valueOf(o0.compareTo(o1) <= 0); } }); define(new FunDefBase(">", "<Numeric Expression> > <Numeric Expression>", "Returns whether an expression is greater than another.", "ibnn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0), o1 = getDoubleArg(evaluator, args, 1); if (o0.isNaN() || o1.isNaN()) { return null; } return Boolean.valueOf(o0.compareTo(o1) > 0); } }); define(new FunDefBase(">", "<String Expression> > <String Expression>", "Returns whether an expression is greater than another.", "ibSS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String o0 = getStringArg(evaluator, args, 0, null), o1 = getStringArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return Boolean.valueOf(o0.compareTo(o1) > 0); } }); define(new FunDefBase(">=", "<Numeric Expression> >= <Numeric Expression>", "Returns whether an expression is greater than or equal to another.", "ibnn") { public Object evaluate(Evaluator evaluator, Exp[] args) { Double o0 = getDoubleArg(evaluator, args, 0), o1 = getDoubleArg(evaluator, args, 1); if (o0.isNaN() || o1.isNaN()) { return null; } return Boolean.valueOf(o0.compareTo(o1) >= 0); } }); define(new FunDefBase(">=", "<String Expression> >= <String Expression>", "Returns whether an expression is greater than or equal to another.", "ibSS") { public Object evaluate(Evaluator evaluator, Exp[] args) { String o0 = getStringArg(evaluator, args, 0, null), o1 = getStringArg(evaluator, args, 1, null); if (o0 == null || o1 == null) { return null; } return Boolean.valueOf(o0.compareTo(o1) >= 0); } }); // NON-STANDARD FUNCTIONS define(new FunkResolver( "FirstQ", "FirstQ(<Set>[, <Numeric Expression>])", "Returns the 1st quartile value of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArg(evaluator, args, 1, valueFunCall); //todo: ignore nulls, do we need to ignore the List? return quartile(evaluator.push(), members, exp, 1); } })); define(new FunkResolver( "ThirdQ", "ThirdQ(<Set>[, <Numeric Expression>])", "Returns the 3rd quartile value of a numeric expression evaluated over a set.", new String[]{"fnx", "fnxn"}, new FunkBase() { public Object evaluate(Evaluator evaluator, Exp[] args) { List members = (List) getArg(evaluator, args, 0); ExpBase exp = (ExpBase) getArg(evaluator, args, 1, valueFunCall); //todo: ignore nulls, do we need to ignore the List? return quartile(evaluator.push(), members, exp, 3); } })); } | 4891 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4891/b5b5168edc3af09cb74945a80b0c36e6630ed502/BuiltinFunTable.java/buggy/src/main/mondrian/olap/fun/BuiltinFunTable.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
918,
4426,
7503,
1435,
288,
202,
202,
11255,
10435,
2932,
8560,
8863,
202,
202,
759,
1122,
1149,
30,
293,
33,
1396,
16,
312,
33,
1305,
16,
277,
33,
382,
904,
16,
453,
33,
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,
225,
202,
1117,
918,
4426,
7503,
1435,
288,
202,
202,
11255,
10435,
2932,
8560,
8863,
202,
202,
759,
1122,
1149,
30,
293,
33,
1396,
16,
312,
33,
1305,
16,
277,
33,
382,
904,
16,
453,
33,
2... |
final Entity ce = ce(); | public void keyPressed(KeyEvent ev) { // Are we ignoring events? if ( this.isIgnoringEvents() ) { return; } if (ev.getKeyCode() == KeyEvent.VK_ESCAPE) { clearAllMoves(); } if (ev.getKeyCode() == KeyEvent.VK_BACK_SPACE) { if (client.isMyTurn()) { removeLastStep(); } } if (ev.getKeyCode() == KeyEvent.VK_ENTER && ev.isControlDown()) { if (client.isMyTurn()) { moveTo(cmd); } } if (ev.getKeyCode() == KeyEvent.VK_SHIFT && !shiftheld) { shiftheld = true; if (client.isMyTurn() && client.game.board.lastCursor != null && !client.game.board.lastCursor.equals(client.game.board.selected)) { // switch to turning //clientgui.bv.clearMovementData(); currentMove(client.game.board.lastCursor); clientgui.bv.drawMovementData(ce(), cmd); } } // arrow can also rotate when shift is down if (shiftheld && client.isMyTurn() && (ev.getKeyCode() == KeyEvent.VK_LEFT || ev.getKeyCode() == KeyEvent.VK_RIGHT)) { int curDir = cmd.getFinalFacing(); int dir = curDir; if (ev.getKeyCode() == KeyEvent.VK_LEFT) { dir = (dir + 5) % 6; } else { dir = (dir + 7) % 6; } Coords curPos = cmd.getFinalCoords(); Coords target = curPos.translated(dir); currentMove(target); clientgui.bv.drawMovementData(ce(), cmd); } } | 3464 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3464/0bcdeb0f45ab5ce89927be8a8c7c1c35c012d562/MovementDisplay.java/buggy/megamek/src/megamek/client/ui/AWT/MovementDisplay.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
727,
3887,
5898,
273,
5898,
5621,
282,
727,
3887,
5898,
273,
5898,
5621,
282,
727,
3887,
5898,
273,
5898,
5621,
282,
727,
3887,
5898,
273,
5898,
5621,
282,
1071,
6385,
3887,
5898,
273,
5898,
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,
727,
3887,
5898,
273,
5898,
5621,
282,
727,
3887,
5898,
273,
5898,
5621,
282,
727,
3887,
5898,
273,
5898,
5621,
282,
727,
3887,
5898,
273,
5898,
5621,
282,
1071,
6385,
3887,
5898,
273,
5898,
5... | |
} | } | void startAllPlugins() { for(int i = 0; i < pluginClasses.size(); i++) { String name = (String)pluginClasses.elementAt(i); name = MiscUtilities.fileToClass(name); try { loadPluginClass(name); } catch(Throwable t) { Log.log(Log.ERROR,this,"Error while starting plugin " + name); Log.log(Log.ERROR,this,t); jar.addPlugin(new EditPlugin.Broken(name)); String[] args = { t.toString() }; jEdit.pluginError(jar.getPath(), "plugin-error.start-error",args); } } } | 6564 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6564/407c816d2e53752683a02c9f1e8a5073ae86bdb7/JARClassLoader.java/clean/org/gjt/sp/jedit/JARClassLoader.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
6459,
787,
1595,
9461,
1435,
202,
95,
202,
202,
1884,
12,
474,
277,
273,
374,
31,
277,
411,
1909,
4818,
18,
1467,
5621,
277,
27245,
202,
202,
95,
1082,
202,
780,
508,
273,
261,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
6459,
787,
1595,
9461,
1435,
202,
95,
202,
202,
1884,
12,
474,
277,
273,
374,
31,
277,
411,
1909,
4818,
18,
1467,
5621,
277,
27245,
202,
202,
95,
1082,
202,
780,
508,
273,
261,
7... |
private void checkIdRefs() throws InvalidDatatypeValueException { if ( this.fTableIDRefs == null) return; Enumeration en = this.fTableIDRefs.keys(); //System.out.println("TabIDREFs= " + this.fTableIDRefs ); while (en.hasMoreElements()) { String key = (String)en.nextElement(); //System.out.println( "Key here = x>>" + key + "<<" ); //System.out.println("Tab Ids = " + this.fTableOfId ); if ( this.fTableOfId == null || ! this.fTableOfId.containsKey(key)) { InvalidDatatypeValueException error = new InvalidDatatypeValueException( key ); error.setMinorCode(XMLMessages.MSG_ELEMENT_WITH_ID_REQUIRED); error.setMajorCode(XMLMessages.VC_IDREF); throw error; } } } // checkIdRefs() | 6373 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6373/d4d6cb515d1e4da913b4d8d417b56672e59b79da/IDREFDatatypeValidator.java/buggy/src/org/apache/xerces/validators/datatype/IDREFDatatypeValidator.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
866,
548,
9837,
1435,
1216,
1962,
20228,
9738,
288,
3639,
309,
261,
333,
18,
74,
1388,
734,
9837,
422,
446,
13,
5411,
327,
31,
7734,
13864,
570,
273,
333,
18,
74,
1388,
734,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
866,
548,
9837,
1435,
1216,
1962,
20228,
9738,
288,
3639,
309,
261,
333,
18,
74,
1388,
734,
9837,
422,
446,
13,
5411,
327,
31,
7734,
13864,
570,
273,
333,
18,
74,
1388,
734,
... | ||
throw new ProjectBuildingException( | throw new ProjectBuildingException( project.getId(), | private MavenProject buildFromSourceFile( File projectDescriptor, ArtifactRepository localRepository, ProfileManager profileManager ) throws ProjectBuildingException { Model model = readModel( projectDescriptor ); // Always cache files in the source tree over those in the repository MavenProject p = new MavenProject( model ); p.setFile( projectDescriptor ); modelCache.put( createCacheKey( model.getGroupId(), model.getArtifactId(), model.getVersion() ), p ); MavenProject project = build( projectDescriptor.getAbsolutePath(), model, localRepository, buildArtifactRepositories( getSuperModel() ), projectDescriptor.getAbsoluteFile().getParentFile(), profileManager ); if ( project.getDistributionManagement() != null && project.getDistributionManagement().getStatus() != null ) { throw new ProjectBuildingException( "Invalid project file: distribution status must not be specified for a project outside of the repository" ); } // Only translate the base directory for files in the source tree pathTranslator.alignToBaseDirectory( project.getModel(), projectDescriptor.getParentFile() ); Build build = project.getBuild(); project.addCompileSourceRoot( build.getSourceDirectory() ); project.addScriptSourceRoot( build.getScriptSourceDirectory() ); project.addTestCompileSourceRoot( build.getTestSourceDirectory() ); // Only track the file of a POM in the source tree project.setFile( projectDescriptor ); return project; } | 1315 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1315/f685d8605d2680e70b1ff2895947d2d11787e3c9/DefaultMavenProjectBuilder.java/buggy/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
17176,
4109,
1361,
1265,
31150,
12,
1387,
1984,
3187,
16,
14022,
3305,
1191,
3305,
16,
4766,
2868,
11357,
1318,
3042,
1318,
262,
3639,
1216,
5420,
16713,
503,
565,
288,
3639,
3164,
93... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
17176,
4109,
1361,
1265,
31150,
12,
1387,
1984,
3187,
16,
14022,
3305,
1191,
3305,
16,
4766,
2868,
11357,
1318,
3042,
1318,
262,
3639,
1216,
5420,
16713,
503,
565,
288,
3639,
3164,
93... |
protected void updateBoard() { | protected synchronized void updateBoard() { | protected void updateBoard() { updateBoardSize(); backGraph = null; backImage = null; backSize = null; boardImage = null; boardGraph = null; tileManager.reset(); redrawAllEntities(); } | 3464 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3464/7a25e0a17fc302d6d4451d4b880b81d7763bb7d5/BoardView1.java/clean/megamek/src/megamek/client/ui/AWT/BoardView1.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
3852,
918,
1089,
22233,
1435,
288,
3639,
1089,
22233,
1225,
5621,
3639,
1473,
4137,
273,
446,
31,
3639,
1473,
2040,
273,
446,
31,
3639,
1473,
1225,
273,
446,
31,
3639,
11094,
2040,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3852,
918,
1089,
22233,
1435,
288,
3639,
1089,
22233,
1225,
5621,
3639,
1473,
4137,
273,
446,
31,
3639,
1473,
2040,
273,
446,
31,
3639,
1473,
1225,
273,
446,
31,
3639,
11094,
2040,
... |
if (DEBUG_NEW_GROUP) findAndCreateElements(gInfo.contentSpecIndex,gInfo.scope); | if (DEBUG_NEW_GROUP) findAndCreateElements(gInfo.contentSpecIndex,gInfo.scope); | private GroupInfo traverseGroupDecl( Element groupDecl ) throws Exception { // General Attribute Checking int scope = isTopLevel(groupDecl)? GeneralAttrCheck.ELE_CONTEXT_GLOBAL: GeneralAttrCheck.ELE_CONTEXT_LOCAL; Hashtable attrValues = fGeneralAttrCheck.checkAttributes(groupDecl, scope); String groupName = groupDecl.getAttribute(SchemaSymbols.ATT_NAME); String ref = groupDecl.getAttribute(SchemaSymbols.ATT_REF); GroupInfo gInfo = null; Element child = checkContent( groupDecl, XUtil.getFirstChildElement(groupDecl), true ); if (!ref.equals("")) { if (isTopLevel(groupDecl)) // REVISIT: localize reportGenericSchemaError ( "A group with \"ref\" present must not have <schema> or <redefine> as its parent"); if (!groupName.equals("")) // REVISIT: localize reportGenericSchemaError ( "group " + groupName + " cannot refer to another group, but it refers to " + ref); // there should be no children for <group ref="..."> if (XUtil.getFirstChildElement(groupDecl)!=null) reportGenericSchemaError ( "A group with \"ref\" present must not have children"); String prefix = ""; String localpart = ref; int colonptr = ref.indexOf(":"); if ( colonptr > 0) { prefix = ref.substring(0,colonptr); localpart = ref.substring(colonptr+1); } int localpartIndex = fStringPool.addSymbol(localpart); String uriStr = resolvePrefixToURI(prefix); if (!uriStr.equals(fTargetNSURIString)) { gInfo = traverseGroupDeclFromAnotherSchema(localpart, uriStr); if (DEBUG_NEW_GROUP) findAndCreateElements(gInfo.contentSpecIndex,gInfo.scope); return gInfo; } try { gInfo = (GroupInfo) fGroupNameRegistry.get(uriStr + "," + localpart); if (gInfo != null) { // Ensure any LEAF elements are created at the // scope of the referencing type if (DEBUG_NEW_GROUP) findAndCreateElements(gInfo.contentSpecIndex,gInfo.scope); return gInfo; } } catch (ClassCastException c) { } // Check if we are in the middle of traversing this group (i.e. circular references) if (fCurrentGroupNameStack.search((Object)localpart) > - 1) { reportGenericSchemaError("mg-props-correct: Circular definition for group " + localpart); return null; } int contentSpecIndex = -1; Element referredGroup = getTopLevelComponentByName(SchemaSymbols.ELT_GROUP,localpart); if (referredGroup == null) { // REVISIT: Localize reportGenericSchemaError("Group " + localpart + " not found in the Schema"); //REVISIT, this should be some custom Exception //throw new RuntimeException("Group " + localpart + " not found in the Schema"); } else { gInfo = traverseGroupDecl(referredGroup); } // Now that we have a tree, ensure any LEAF elements are created at the // scope of the referencing type if (gInfo != null) { if (DEBUG_NEW_GROUP) findAndCreateElements(gInfo.contentSpecIndex,gInfo.scope); } return gInfo; } else if (groupName.equals("")) // REVISIT: Localize reportGenericSchemaError("a <group> must have a name or a ref present"); String qualifiedGroupName = fTargetNSURIString + "," + groupName; try { gInfo = (GroupInfo) fGroupNameRegistry.get(qualifiedGroupName); if (gInfo != null) { // Ensure any LEAF elements are created at the // scope of the referencing type if (DEBUG_NEW_GROUP) findAndCreateElements(gInfo.contentSpecIndex,gInfo.scope); return gInfo; } } catch (ClassCastException c) { } // if we're here then we're traversing a top-level group that we've never seen before. // Push the group name onto a stack, so that we can check for circular groups fCurrentGroupNameStack.push(groupName); // Save the scope and set the current scope to -1 int savedScope = fCurrentScope; if (DEBUG_NEW_GROUP) fCurrentScope = fScopeCount++; else fCurrentScope = -1; int index = -2; boolean illegalChild = false; String childName = (child != null) ? child.getLocalName() : ""; if (childName.equals(SchemaSymbols.ELT_ALL)) { index = traverseAll(child); } else if (childName.equals(SchemaSymbols.ELT_CHOICE)) { index = traverseChoice(child); } else if (childName.equals(SchemaSymbols.ELT_SEQUENCE)) { index = traverseSequence(child); } else if (!childName.equals("") || (child != null && XUtil.getNextSiblingElement(child) != null)) { illegalChild = true; reportSchemaError(SchemaMessageProvider.GroupContentRestricted, new Object [] { "group", childName }); } //Must have all or choice or sequence child. if (child == null) { reportGenericSchemaError("Named group must contain an 'all', 'choice' or 'sequence' child"); } else if (XUtil.getNextSiblingElement(child) != null) { illegalChild = true; reportSchemaError(SchemaMessageProvider.GroupContentRestricted, new Object [] { "group", childName }); } if ( ! illegalChild && child != null) { index = handleOccurrences(index, child, CHILD_OF_GROUP); } gInfo = new GroupInfo(); gInfo.contentSpecIndex = index; gInfo.scope = fCurrentScope; fCurrentScope = savedScope; fCurrentGroupNameStack.pop(); fGroupNameRegistry.put(qualifiedGroupName, gInfo); return gInfo; } | 6373 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6373/da45b42b94081019264a2fd9051fc5b04fc15d44/TraverseSchema.java/buggy/src/org/apache/xerces/validators/schema/TraverseSchema.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
3756,
966,
10080,
1114,
3456,
12,
3010,
1041,
3456,
262,
1216,
1185,
288,
3639,
368,
9544,
3601,
24471,
3639,
509,
2146,
273,
353,
27046,
12,
1655,
3456,
9945,
10792,
9544,
3843,
1564... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
3756,
966,
10080,
1114,
3456,
12,
3010,
1041,
3456,
262,
1216,
1185,
288,
3639,
368,
9544,
3601,
24471,
3639,
509,
2146,
273,
353,
27046,
12,
1655,
3456,
9945,
10792,
9544,
3843,
1564... |
super( dataSetHandle, reportContext ); | super( dataSetHandle, context ); | public ScriptDataSetScriptExecutor( ScriptDataSetHandle dataSetHandle, IReportContext reportContext ) { super( dataSetHandle, reportContext ); } | 12803 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12803/c0422a1db84842d1e332663c3d4c7e2a8109aca8/ScriptDataSetScriptExecutor.java/buggy/engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/script/internal/ScriptDataSetScriptExecutor.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
7739,
13676,
3651,
6325,
12,
7739,
13676,
3259,
14837,
3259,
16,
1082,
202,
45,
4820,
1042,
2605,
1042,
262,
202,
95,
202,
202,
9565,
12,
14837,
3259,
16,
2605,
1042,
11272,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
7739,
13676,
3651,
6325,
12,
7739,
13676,
3259,
14837,
3259,
16,
1082,
202,
45,
4820,
1042,
2605,
1042,
262,
202,
95,
202,
202,
9565,
12,
14837,
3259,
16,
2605,
1042,
11272,
202... |
(m_resultType == XPathResult.UNORDERED_NODE_ITERATOR_TYPE))&& (contextNode instanceof EventTarget)) { ((EventTarget)contextNode).addEventListener("MutationEvents",this,true); | (m_resultType == XPathResult.UNORDERED_NODE_ITERATOR_TYPE))) { addEventListener(); | XPathResultImpl(short type, XObject result, Node contextNode) { // Check that the type is valid if (!isValidType(type)) { String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_INVALID_XPATH_TYPE, new Object[] {new Integer(type)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // Invalid XPath type argument: {0} } // Result object should never be null! if (null == result) { String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_EMPTY_XPATH_RESULT, null); throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,fmsg); // Empty XPath result object } this.m_resultObj = result; this.m_contextNode = contextNode; // If specified result was ANY_TYPE, determine XObject type if (type == ANY_TYPE) { this.m_resultType = getTypeFromXObject(result); } else { this.m_resultType = type; } // If the context node supports DOM Events and the type is one of the iterator // types register this result as an event listener if (((m_resultType == XPathResult.ORDERED_NODE_ITERATOR_TYPE) || (m_resultType == XPathResult.UNORDERED_NODE_ITERATOR_TYPE))&& (contextNode instanceof EventTarget)) { ((EventTarget)contextNode).addEventListener("MutationEvents",this,true); }// else can we handle iterator types if contextNode doesn't support EventTarget?? // If this is an iterator type get the iterator if ((m_resultType == ORDERED_NODE_ITERATOR_TYPE) || (m_resultType == UNORDERED_NODE_ITERATOR_TYPE) || (m_resultType == ANY_UNORDERED_NODE_TYPE) || (m_resultType == FIRST_ORDERED_NODE_TYPE)) { try { m_iterator = m_resultObj.nodeset(); } catch (TransformerException te) { // probably not a node type String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // The returned type: {0} can not be coerced into the specified type: {1} } // If user requested ordered nodeset and result is unordered // need to sort...TODO // if ((m_resultType == ORDERED_NODE_ITERATOR_TYPE) && // (!(((DTMNodeIterator)m_iterator).getDTMIterator().isDocOrdered()))) { // // } // If it's a snapshot type, get the nodelist } else if ((m_resultType == UNORDERED_NODE_SNAPSHOT_TYPE) || (m_resultType == ORDERED_NODE_SNAPSHOT_TYPE)) { try { m_list = m_resultObj.nodelist(); } catch (TransformerException te) { // probably not a node type String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // The returned type: {0} can not be coerced into the specified type: {1} } } } | 2723 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2723/1441e4cef5a7cc93aaa00b474d087d8d524906dc/XPathResultImpl.java/buggy/src/org/apache/xpath/domapi/XPathResultImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3196,
10172,
1253,
2828,
12,
6620,
618,
16,
1139,
921,
563,
16,
2029,
819,
907,
13,
288,
202,
202,
759,
2073,
716,
326,
618,
353,
923,
202,
202,
430,
16051,
26810,
559,
12,
723,
3719,
288,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3196,
10172,
1253,
2828,
12,
6620,
618,
16,
1139,
921,
563,
16,
2029,
819,
907,
13,
288,
202,
202,
759,
2073,
716,
326,
618,
353,
923,
202,
202,
430,
16051,
26810,
559,
12,
723,
3719,
288,
... |
debug="Number null"; | private String formatField(Value v, int idx) { String retval=""; XMLField field = null; if (idx>=0) field = meta.getOutputFields()[idx]; if (v.isBigNumber()) { retval+=v.getString(); // Sorry, no formatting yet, just dump it... } else if (v.isNumeric()) { debug="Number is formatted?"; if (idx>=0 && field!=null && field.getFormat()!=null) { debug="Number formatted!"; if (v.isNull()) { debug="Number null"; if (field.getNullString()!=null) retval=field.getNullString(); } else { debug="Formatted number pattern, field="+v.getName()+", idx="+idx; data.df.applyPattern(field.getFormat()); if (field.getDecimalSymbol()!=null && field.getDecimalSymbol().length()>0) data.dfs.setDecimalSeparator( field.getDecimalSymbol().charAt(0) ); if (field.getGroupingSymbol()!=null && field.getGroupingSymbol().length()>0) data.dfs.setGroupingSeparator( field.getGroupingSymbol().charAt(0) ); if (field.getCurrencySymbol()!=null) data.dfs.setCurrencySymbol( field.getCurrencySymbol() ); data.df.setDecimalFormatSymbols(data.dfs); retval=data.df.format(v.getNumber()); } } else { debug="Not formatted number"; if (v.isNull()) { if (idx>=0 && field!=null && field.getNullString()!=null) retval=field.getNullString(); } else { retval=v.toString(); } } } else if (v.isDate()) { debug="Date is formatted?"; if (idx>=0 && field!=null && field.getFormat()!=null && v.getDate()!=null) { debug="Formatted date pattern, field="+v.getName()+", idx="+idx; data.daf.applyPattern( field.getFormat() ); data.daf.setDateFormatSymbols(data.dafs); retval= data.daf.format(v.getDate()); } else { debug="Date is not formatted"; if (v.isNull() || v.getDate()==null) { if (log.isDebug()) debug="nulliff date (field==null? "+(field==null)+", idx="+idx+")"; if (idx>=0 && field!=null && field.getNullString()!=null) { retval=field.getNullString(); } debug="nulliff date finished"; } else { retval=v.toString(); } } } else if (v.isString()) { debug="String length="+v.getLength()+", value="+v.toString(); if (v.isNull() || v.getString()==null) { if (idx>=0 && field!=null && field.getNullString()!=null) retval=field.getNullString(); } else { retval=v.toString(); } } else // Boolean { debug="Boolean: "+v.getBoolean(); if (v.isNull()) { if (idx>=0 && field!=null && field.getNullString()!=null) retval=field.getNullString(); } else { retval=v.toString(); } } debug="End of formatField"; return retval; } | 58146 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58146/b8c6b02ffc35cf6ae44d1cb0cdf4ecec0144af21/XMLOutput.java/clean/kettle/src/be/ibridge/kettle/trans/step/xmloutput/XMLOutput.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
514,
740,
974,
12,
620,
331,
16,
509,
2067,
13,
202,
95,
202,
202,
780,
5221,
1546,
14432,
202,
202,
4201,
974,
652,
273,
446,
31,
202,
202,
430,
261,
3465,
34,
33,
20,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
514,
740,
974,
12,
620,
331,
16,
509,
2067,
13,
202,
95,
202,
202,
780,
5221,
1546,
14432,
202,
202,
4201,
974,
652,
273,
446,
31,
202,
202,
430,
261,
3465,
34,
33,
20,
1... | |
String id=(String)idTable.get((Element) source); | String id=(String)idTable.get(serializeNode(source)); | protected static NodeImpl importNodeWithId(DocumentImpl doc,Hashtable idTable, Node source) { NodeImpl newnode = null; int type = source.getNodeType(); switch (type) { case DocumentImpl.ELEMENT_NODE: { Element newelement = doc.createElement(source.getNodeName()); // Copy the identifier String id=(String)idTable.get((Element) source); if (id != null) doc.putIdentifier(id, newelement); NamedNodeMap srcattr = source.getAttributes(); if (srcattr != null) { for(int i = 0; i < srcattr.getLength(); i++) { newelement.setAttributeNode((AttrImpl)importNodeWithId(doc, idTable,srcattr.item(i))); } } newnode = (NodeImpl)newelement; break; } case DocumentImpl.ATTRIBUTE_NODE: { newnode = (NodeImpl)doc.createAttribute(source.getNodeName()); // Kids carry value break; } case DocumentImpl.TEXT_NODE: { newnode = (NodeImpl)doc.createTextNode(source.getNodeValue()); break; } case DocumentImpl.CDATA_SECTION_NODE: { newnode = (NodeImpl)doc.createCDATASection(source.getNodeValue()); break; } case DocumentImpl.ENTITY_REFERENCE_NODE: { newnode = (NodeImpl) doc.createEntityReference(source.getNodeName()); break; } case DocumentImpl.ENTITY_NODE: { Entity srcentity = (Entity)source; EntityImpl newentity = (EntityImpl)doc.createEntity(source.getNodeName()); newentity.setPublicId(srcentity.getPublicId()); newentity.setSystemId(srcentity.getSystemId()); newentity.setNotationName(srcentity.getNotationName()); // Kids carry additional value newnode = newentity; break; } case DocumentImpl.PROCESSING_INSTRUCTION_NODE: { newnode = (ProcessingInstructionImpl)doc.createProcessingInstruction(source.getNodeName(), source.getNodeValue()); break; } case DocumentImpl.COMMENT_NODE: { newnode = (NodeImpl)doc.createComment(source.getNodeValue()); break; } case DocumentImpl.DOCUMENT_TYPE_NODE: { DocumentTypeImpl doctype = (DocumentTypeImpl)source; DocumentTypeImpl newdoctype =(DocumentTypeImpl)doc.createDocumentType(doctype.getNodeName(),doctype.getPublicId(),doctype.getSystemId()); // Values are on NamedNodeMaps NamedNodeMap smap = ((DocumentType)source).getEntities(); NamedNodeMap tmap = newdoctype.getEntities(); if (smap != null) { for(int i = 0; i < smap.getLength(); i++) { tmap.setNamedItem((EntityImpl)importNodeWithId(doc, idTable, smap.item(i))); } } smap = ((DocumentType)source).getNotations(); tmap = newdoctype.getNotations(); if (smap != null) { for (int i = 0; i < smap.getLength(); i++) { tmap.setNamedItem((NotationImpl)importNodeWithId(doc, idTable, smap.item(i))); } } // NOTE: At this time, the DOM definition of DocumentType // doesn't cover Elements and their Attributes. domimpl's // extentions in that area will not be preserved, even if // copying from domimpl to domimpl. We could special-case // that here. Arguably we should. Consider. ????? newnode = newdoctype; break; } case DocumentImpl.DOCUMENT_FRAGMENT_NODE: { newnode = (NodeImpl)doc.createDocumentFragment(); // No name, kids carry value break; } case DocumentImpl.NOTATION_NODE: { Notation srcnotation = (Notation)source; NotationImpl newnotation = (NotationImpl)doc.createNotation(source.getNodeName()); newnotation.setPublicId(srcnotation.getPublicId()); newnotation.setSystemId(srcnotation.getSystemId()); // Kids carry additional value newnode = newnotation; // No name, no value break; } case DocumentImpl.DOCUMENT_NODE : // Document can't be child of Document default: { // Unknown node type //throw new DOMExceptionImpl(DOMException.HIERARCHY_REQUEST_ERR, "DOM006 Hierarchy request error"); } } // If deep, replicate and attach the kids. for (Node srckid = source.getFirstChild(); srckid != null; srckid = srckid.getNextSibling()) { newnode.appendChild(importNodeWithId(doc, idTable, srckid)); } return newnode; } | 1895 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1895/db46b87ef8237e00ae7c5e6e6f3595682b87d9d1/XML.java/buggy/source/org/jasig/portal/utils/XML.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
4750,
760,
2029,
2828,
1930,
907,
1190,
548,
12,
2519,
2828,
997,
16,
5582,
14544,
612,
1388,
16,
2029,
1084,
13,
288,
565,
2029,
2828,
29267,
273,
446,
31,
565,
509,
618,
273,
1084,
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,
4750,
760,
2029,
2828,
1930,
907,
1190,
548,
12,
2519,
2828,
997,
16,
5582,
14544,
612,
1388,
16,
2029,
1084,
13,
288,
565,
2029,
2828,
29267,
273,
446,
31,
565,
509,
618,
273,
1084,
18... |
if (printer instanceof AbstractTablePrinter) { printer.print(componentStat.values()); } else { Iterator it = componentStat.values().iterator(); while (it.hasNext()) { printer.print(it.next()); } } | logSummary(new SimplePrinter(System.out)); | public void logSummary(PrintWriter printer) { if (printer instanceof AbstractTablePrinter) { printer.print(componentStat.values()); } else { Iterator it = componentStat.values().iterator(); while (it.hasNext()) { printer.print(it.next()); } } // printer.println("-----------------------------"); // printer.println("duration (ms): " + (System.currentTimeMillis() - // startTime)); } | 2370 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2370/5f11d3c7c4a6860001997529ec9cb38955dcdcf5/AllStatistics.java/buggy/mule/src/main/java/org/mule/management/stats/AllStatistics.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
613,
4733,
12,
5108,
2289,
12539,
13,
565,
288,
3639,
309,
261,
30439,
1276,
4115,
1388,
12149,
13,
288,
5411,
12539,
18,
1188,
12,
4652,
5000,
18,
2372,
10663,
3639,
289,
469,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
613,
4733,
12,
5108,
2289,
12539,
13,
565,
288,
3639,
309,
261,
30439,
1276,
4115,
1388,
12149,
13,
288,
5411,
12539,
18,
1188,
12,
4652,
5000,
18,
2372,
10663,
3639,
289,
469,... |
public String getMarginRight() | public DimensionType getMarginRight( ) | public String getMarginRight() { // TODO Auto-generated method stub return null; } | 15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/83de512a7dc3a128ad54fa2607c01f0ef928234c/PageContent.java/clean/engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/content/impl/PageContent.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
514,
2108,
5243,
4726,
1435,
202,
95,
202,
202,
759,
2660,
8064,
17,
11168,
707,
7168,
202,
202,
2463,
446,
31,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
514,
2108,
5243,
4726,
1435,
202,
95,
202,
202,
759,
2660,
8064,
17,
11168,
707,
7168,
202,
202,
2463,
446,
31,
202,
97,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
synchronized (ObjectSpace.this) { if (prev != null) { prev.next = next; } if (next != null) { next.prev = prev; } } | synchronized (ObjectSpace.this) { if (prev != null) { prev.next = next; } if (next != null) { next.prev = prev; } } | public void remove() { synchronized (ObjectSpace.this) { if (prev != null) { prev.next = next; } if (next != null) { next.prev = prev; } } } | 47984 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47984/250878be8c9efe07e17604ffe3f6f53c3d98a3e1/ObjectSpace.java/clean/src/org/jruby/runtime/ObjectSpace.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
1071,
918,
1206,
1435,
288,
540,
202,
22043,
261,
921,
3819,
18,
2211,
13,
288,
202,
5411,
309,
261,
10001,
480,
446,
13,
288,
202,
7734,
2807,
18,
4285,
273,
1024,
31,
202,
5411,
289,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1206,
1435,
288,
540,
202,
22043,
261,
921,
3819,
18,
2211,
13,
288,
202,
5411,
309,
261,
10001,
480,
446,
13,
288,
202,
7734,
2807,
18,
4285,
273,
1024,
31,
202,
5411,
289,
... |
PropertyDescriptor propertyDescriptor = propertyDescriptors[i]; if (Closure.class.isAssignableFrom(propertyDescriptor.getPropertyType())) { | PropertyDescriptor propertyDescriptor = propertyDescriptors[i]; Closure closure = (Closure)getPropertyValue(propertyDescriptor.getName(), Closure.class); if (closure != null) { | public DefaultGrailsControllerClass(Class clazz) { super(clazz, CONTROLLER); String uri = SLASH + (StringUtils.isNotBlank(getPackageName()) ? getPackageName().replace('.', '/') + SLASH : "" ) + WordUtils.uncapitalize(getName()); String defaultClosureName = (String)getPropertyValue(DEFAULT_CLOSURE_PROPERTY, String.class); Boolean tmp = (Boolean)getPropertyValue(SCAFFOLDING_PROPERTY, Boolean.class); if(tmp != null) { this.scaffolding = tmp.booleanValue(); } Collection closureNames = new ArrayList(); this.uri2viewMap = new HashMap(); this.uri2closureMap = new HashMap(); this.viewNames = new HashMap(); if(this.scaffolding) { for(int i = 0; i < DefaultGrailsScaffolder.ACTION_NAMES.length;i++) { closureNames.add(DefaultGrailsScaffolder.ACTION_NAMES[i]); String viewName = (String)getPropertyValue(DefaultGrailsScaffolder.ACTION_NAMES[i] + VIEW, String.class); // if no explicity view name is specified just use action name if(viewName == null) { viewName =DefaultGrailsScaffolder.ACTION_NAMES[i]; } String tmpUri = uri + SLASH + DefaultGrailsScaffolder.ACTION_NAMES[i]; String viewUri = uri + SLASH + viewName; if (StringUtils.isNotBlank(viewName)) { this.uri2viewMap.put(tmpUri, viewUri); this.viewNames.put( DefaultGrailsScaffolder.ACTION_NAMES[i], viewUri ); } this.uri2closureMap.put(tmpUri, DefaultGrailsScaffolder.ACTION_NAMES[i]); } } PropertyDescriptor[] propertyDescriptors = getReference().getPropertyDescriptors(); for (int i = 0; i < propertyDescriptors.length; i++) { PropertyDescriptor propertyDescriptor = propertyDescriptors[i]; if (Closure.class.isAssignableFrom(propertyDescriptor.getPropertyType())) { closureNames.add(propertyDescriptor.getName()); String closureName = propertyDescriptor.getName(); String viewName = (String)getPropertyValue(propertyDescriptor.getName() + VIEW, String.class); // if no explicity view name is specified just use property name if(viewName == null) { viewName = propertyDescriptor.getName(); } Map typedViews = (Map)getPropertyValue(propertyDescriptor.getName() + TYPED_VIEWS, Map.class); String tmpUri = uri + SLASH + propertyDescriptor.getName(); String viewUri = uri + SLASH + viewName; if (StringUtils.isNotBlank(viewName)) { this.uri2viewMap.put(tmpUri, viewUri); this.viewNames.put( closureName, viewUri ); } Closure closure = (Closure)getPropertyValue(propertyDescriptor.getName(), Closure.class); if (closure != null) { this.uri2closureMap.put(tmpUri, propertyDescriptor.getName()); // TODO: This code is likely broken and needs re-thinking as there may be a better way to // handle typed views if (typedViews != null) { for (Iterator iter = typedViews.keySet().iterator(); iter.hasNext();) { String viewType = (String)iter.next(); String typedViewName = (String)typedViews.get(viewType); String typedUri = tmpUri + SLASH + viewType; this.uri2viewMap.put(typedUri, typedViewName); this.uri2closureMap.put(typedUri, propertyDescriptor.getName()); if (defaultClosureName != null && defaultClosureName.equals(propertyDescriptor.getName())) { this.uri2closureMap.put(uri + SLASH + viewType, propertyDescriptor.getName()); this.uri2viewMap.put(uri + SLASH + viewType, typedViewName); } } } } } } if (defaultClosureName != null) { this.uri2closureMap.put(uri, defaultClosureName); this.uri2closureMap.put(uri + SLASH, defaultClosureName); this.uri2viewMap.put(uri + SLASH, uri + SLASH + defaultClosureName); this.uri2viewMap.put(uri,uri + SLASH + defaultClosureName); this.viewNames.put( defaultClosureName, uri + SLASH + defaultClosureName ); } if (closureNames.size() == 1) { String closureName = ((String)closureNames.iterator().next()); this.uri2closureMap.put(uri, this.uri2closureMap.values().iterator().next()); if (!this.uri2viewMap.isEmpty()) { this.uri2viewMap.put(uri, this.uri2viewMap.values().iterator().next()); } Map typedViews = (Map)getPropertyValue(closureName + TYPED_VIEWS, Map.class); if (typedViews != null) { for (Iterator iter = typedViews.keySet().iterator(); iter.hasNext();) { String viewType = (String)iter.next(); String typedViewName = (String)typedViews.get(viewType); this.uri2closureMap.put(uri + SLASH + viewType, this.uri2closureMap.values().iterator().next()); this.uri2viewMap.put(uri + SLASH + viewType, typedViewName); } } } this.uris = (String[])this.uri2closureMap.keySet().toArray(new String[this.uri2closureMap.keySet().size()]); } | 51763 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51763/d97b70157b5e91dc25ea3dcc0ce1a185bd3e2468/DefaultGrailsControllerClass.java/buggy/src/commons/org/codehaus/groovy/grails/commons/DefaultGrailsControllerClass.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
2989,
14571,
14573,
2933,
797,
12,
797,
4003,
13,
288,
202,
202,
9565,
12,
830,
3638,
16,
8020,
25353,
1769,
202,
202,
780,
2003,
273,
348,
16504,
397,
261,
780,
1989,
18,
291... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2989,
14571,
14573,
2933,
797,
12,
797,
4003,
13,
288,
202,
202,
9565,
12,
830,
3638,
16,
8020,
25353,
1769,
202,
202,
780,
2003,
273,
348,
16504,
397,
261,
780,
1989,
18,
291... |
.getSessionHandle( ).openLibrary( ( (File) children[i] ) .getAbsolutePath( ) ); | .getSessionHandle( ) .openLibrary( ( (File) children[i] ).getAbsolutePath( ) ); | public Object[] getChildren( ) { if ( childrenList.size( ) > 0 ) { return childrenList.toArray( ); } File file = new File( directoryPath ); if ( !file.exists( ) ) { return new Object[]{Messages .getString( "LibraryExplorerProvider.FolderNotExist" ) //$NON-NLS-1$ }; } if ( file.isDirectory( ) ) { File[] children = file.listFiles( filter ); for ( int i = 0; i < children.length; i++ ) { if ( children[i].isDirectory( ) ) { childrenList.add( new LibDirectoryNodeModel( ( (File) children[i] ).getAbsolutePath( ) ) ); } else { LibraryHandle library; try { library = SessionHandleAdapter.getInstance( ) .getSessionHandle( ).openLibrary( ( (File) children[i] ) .getAbsolutePath( ) ); if ( resourceListener != null ) { library .addResourceChangeListener( resourceListener ); } childrenList.add( library ); } catch ( DesignFileException e ) { } } } return childrenList.toArray( ); } return null; } | 5230 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5230/f06fb5699fc635c9c62b83fb721c2da353cf68a6/LibDirectoryNodeModel.java/buggy/UI/org.eclipse.birt.report.designer.ui.lib.explorer/src/org/eclipse/birt/report/designer/internal/ui/lib/explorer/model/LibDirectoryNodeModel.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1033,
8526,
10268,
12,
262,
202,
95,
202,
202,
430,
261,
2325,
682,
18,
1467,
12,
262,
405,
374,
262,
202,
202,
95,
1082,
202,
2463,
2325,
682,
18,
31447,
12,
11272,
202,
20... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1033,
8526,
10268,
12,
262,
202,
95,
202,
202,
430,
261,
2325,
682,
18,
1467,
12,
262,
405,
374,
262,
202,
202,
95,
1082,
202,
2463,
2325,
682,
18,
31447,
12,
11272,
202,
20... |
m_urlOfSource = xmlSource.getSystemId(); | { m_urlOfSource = org.apache.xml.utils.SystemIDResolver.getAbsoluteURI(xmlSource.getSystemId()); xmlSource.setSystemId(m_urlOfSource); } | public void transform(Source source) throws TransformerException { if(source instanceof DOMSource) { DOMSource dsource = (DOMSource)source; m_urlOfSource = dsource.getSystemId(); Node dNode = dsource.getNode(); if (null != dNode) { if(null != m_urlOfSource) { // System.out.println("Putting document in cache: "+m_urlOfSource); this.getXPathContext().getSourceTreeManager().putDocumentInCache(dNode, dsource); } this.transformNode(dsource.getNode()); return; } else { String messageStr = XSLMessages.createMessage(XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } InputSource xmlSource = SAXSource.sourceToInputSource(source); if(null == xmlSource) { m_errorHandler.fatalError(new TransformerException("Can't transform a Source of type "+ source.getClass().getName()+"!")); } if (null != xmlSource.getSystemId()) m_urlOfSource = xmlSource.getSystemId(); try { XMLReader reader = null; if(source instanceof SAXSource) reader = ((SAXSource)source).getXMLReader(); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} } if (null == reader) { reader = XMLReaderFactory.createXMLReader(); } try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); reader.setFeature("http://apache.org/xml/features/validation/dynamic", true); } catch (org.xml.sax.SAXException se) { // We don't care. } // Get the input content handler, which will handle the // parse events and create the source tree. ContentHandler inputHandler = getInputContentHandler(); reader.setContentHandler(inputHandler); if(inputHandler instanceof org.xml.sax.DTDHandler) reader.setDTDHandler((org.xml.sax.DTDHandler)inputHandler); try { if(inputHandler instanceof org.xml.sax.ext.LexicalHandler) reader.setProperty("http://xml.org/sax/properties/lexical-handler", inputHandler); if(inputHandler instanceof org.xml.sax.ext.DeclHandler) reader.setProperty("http://xml.org/sax/properties/declaration-handler", inputHandler); } catch(org.xml.sax.SAXException se) {} try { if(inputHandler instanceof org.xml.sax.ext.LexicalHandler) reader.setProperty("http://xml.org/sax/handlers/LexicalHandler", inputHandler); if(inputHandler instanceof org.xml.sax.ext.DeclHandler) reader.setProperty("http://xml.org/sax/handlers/DeclHandler", inputHandler); } catch(org.xml.sax.SAXNotRecognizedException snre) { } // Set the reader for cloning purposes. getXPathContext().setPrimaryReader(reader); this.m_exceptionThrown = null; if (inputHandler instanceof SourceTreeHandler) { SourceTreeHandler sth = (SourceTreeHandler) inputHandler; sth.setInputSource(source); sth.setUseMultiThreading(true); Node doc = sth.getRoot(); if (null != doc) { SourceTreeManager stm = getXPathContext().getSourceTreeManager(); stm.putDocumentInCache(doc, source); m_xmlSource = source; m_doc = doc; if (isParserEventsOnMain()) { m_isTransformDone = false; getXPathContext().getPrimaryReader().parse(xmlSource); } else { Thread t = createTransformThread();// m_reportInPostExceptionFromThread = false; t.start(); transformNode(doc); } } } else { // ?? reader.parse(xmlSource); } // Kick off the parse. When the ContentHandler gets // the startDocument event, it will call transformNode( node ). // reader.parse( xmlSource ); // This has to be done to catch exceptions thrown from // the transform thread spawned by the STree handler. Exception e = getExceptionThrown(); if (null != e) { if (e instanceof javax.xml.transform.TransformerException) { throw (javax.xml.transform.TransformerException) e; } else if (e instanceof org.apache.xml.utils.WrappedRuntimeException) { m_errorHandler.fatalError( new javax.xml.transform.TransformerException( ((org.apache.xml.utils.WrappedRuntimeException) e).getException()) ); } else { throw new javax.xml.transform.TransformerException(e); } } else if (null != m_resultTreeHandler) { m_resultTreeHandler.endDocument(); } } catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } m_errorHandler.fatalError( new TransformerException(wre.getException()) ); } // Patch attributed to David Eisenberg <david@catcode.com> catch (org.xml.sax.SAXParseException spe) { String msg = spe.getMessage(); SAXSourceLocator loc = new SAXSourceLocator(spe); m_errorHandler.fatalError(new TransformerException( msg, loc )); } catch(org.xml.sax.SAXException se) { m_errorHandler.fatalError(new TransformerException( se )); } catch (IOException ioe) { m_errorHandler.fatalError(new TransformerException( ioe )); } finally { // This looks to be redundent to the one done in TransformNode. reset(); } } | 46591 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46591/be58440a49fdab9237347e3450c474f2dd9ad24d/TransformerImpl.java/clean/src/org/apache/xalan/transformer/TransformerImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
2510,
12,
1830,
1084,
13,
377,
1216,
21684,
225,
288,
565,
309,
12,
3168,
1276,
4703,
1830,
13,
565,
288,
1377,
4703,
1830,
302,
3168,
273,
261,
8168,
1830,
13,
3168,
31,
137... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2510,
12,
1830,
1084,
13,
377,
1216,
21684,
225,
288,
565,
309,
12,
3168,
1276,
4703,
1830,
13,
565,
288,
1377,
4703,
1830,
302,
3168,
273,
261,
8168,
1830,
13,
3168,
31,
137... |
return(menu); } | return menu; } | add(Menu menu){ if (menu.parent != null) menu.parent.remove (menu); menu.parent = this; menus.addElement(menu); if (peer != null) { menu.addNotify(); } return(menu);} | 50763 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50763/5806c07c3eeedb0f4f92b9fbacf30c0f55915c25/MenuBar.java/buggy/core/src/classpath/java/java/awt/MenuBar.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
527,
12,
4599,
3824,
15329,
225,
309,
261,
5414,
18,
2938,
480,
446,
13,
565,
3824,
18,
2938,
18,
4479,
261,
5414,
1769,
225,
3824,
18,
2938,
273,
333,
31,
225,
21374,
18,
1289,
1046,
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,
527,
12,
4599,
3824,
15329,
225,
309,
261,
5414,
18,
2938,
480,
446,
13,
565,
3824,
18,
2938,
18,
4479,
261,
5414,
1769,
225,
3824,
18,
2938,
273,
333,
31,
225,
21374,
18,
1289,
1046,
12,
... |
if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalSliderUI instance; if (o == null) { instance = new MetalSliderUI(); instances.put(component, instance); } else instance = (MetalSliderUI) o; return instance; | return new MetalSliderUI(); | public static ComponentUI createUI(JComponent component) { if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalSliderUI instance; if (o == null) { instance = new MetalSliderUI(); instances.put(component, instance); } else instance = (MetalSliderUI) o; return instance; } | 45713 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45713/d03b7ded9dacd5a74a8420d7dade451079b17d89/MetalSliderUI.java/buggy/libraries/javalib/javax/swing/plaf/metal/MetalSliderUI.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
5435,
5370,
752,
5370,
12,
46,
1841,
1794,
13,
225,
288,
565,
309,
261,
10162,
422,
446,
13,
1377,
3884,
273,
394,
4317,
5621,
565,
1033,
320,
273,
3884,
18,
588,
12,
4652,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5435,
5370,
752,
5370,
12,
46,
1841,
1794,
13,
225,
288,
565,
309,
261,
10162,
422,
446,
13,
1377,
3884,
273,
394,
4317,
5621,
565,
1033,
320,
273,
3884,
18,
588,
12,
4652,
... |
public static NodeSet selectPrecedingSiblings(NodeSet candidates, NodeSet references, boolean rememberContext) { | public static NodeSet selectPrecedingSiblings(NodeSet candidates, NodeSet references, int contextId) { | public static NodeSet selectPrecedingSiblings(NodeSet candidates, NodeSet references, boolean rememberContext) { if (references.getLength() == 0 || candidates.getLength() == 0) return NodeSet.EMPTY_SET; NodeSet result = new ExtArrayNodeSet(); Iterator iReferences = references.iterator(); Iterator iCandidates = candidates.iterator(); NodeProxy reference = (NodeProxy) iReferences.next(); NodeProxy candidate = (NodeProxy) iCandidates.next(); while (true) { // first, try to find nodes belonging to the same doc if (reference.getDocument().getDocId() < candidate.getDocument().getDocId()) { if (iReferences.hasNext()) reference = (NodeProxy) iReferences.next(); else break; } else if (reference.getDocument().getDocId() > candidate.getDocument().getDocId()) { if (iCandidates.hasNext()) candidate = (NodeProxy) iCandidates.next(); else break; } else { // same document: check if the nodes have the same parent long pa = getParentId(reference.getDocument(), reference.getGID()); long pb = getParentId(candidate.getDocument(), candidate.getGID()); if (pa < pb) { // wrong parent: proceed if (iReferences.hasNext()) reference = (NodeProxy) iReferences.next(); else break; } else if (pa > pb) { // wrong parent: proceed if (iCandidates.hasNext()) candidate = (NodeProxy) iCandidates.next(); else break; } else { // found two nodes with the same parent // now, compare the ids: a node is a following sibling // if its id is greater than the id of the other node if (candidate.getGID() < reference.getGID()) { // found a preceding sibling if (rememberContext) //TODO : add transverse context candidate.addContextNode(reference); else candidate.copyContext(reference); result.add(candidate); if (iCandidates.hasNext()) candidate = (NodeProxy) iCandidates.next(); else break; } else if (candidate.getGID() > reference.getGID()) { // found a following sibling if (iCandidates.hasNext()) //TODO : break ? candidate = (NodeProxy) iCandidates.next(); else break; // equal nodes: proceed with next node } else { if (iReferences.hasNext()) reference = (NodeProxy) iReferences.next(); else break; } } } } return result; } | 2909 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2909/e6d5b6635c91c6ad23ce5fb6e28c29f5e09d6107/NodeSetHelper.java/clean/src/org/exist/dom/NodeSetHelper.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
760,
2029,
694,
2027,
1386,
3263,
310,
31555,
12,
907,
694,
7965,
16,
2029,
694,
5351,
16,
1250,
11586,
1042,
13,
288,
202,
202,
430,
261,
14353,
18,
588,
1782,
1435,
422,
374... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
760,
2029,
694,
2027,
1386,
3263,
310,
31555,
12,
907,
694,
7965,
16,
2029,
694,
5351,
16,
1250,
11586,
1042,
13,
288,
202,
202,
430,
261,
14353,
18,
588,
1782,
1435,
422,
374... |
bindingLabel.setText(Util.translateString(RESOURCE_BUNDLE, "bindingLabel.Text")); | bindingLabel.setText(NewKeysPreferenceMessages.BindingLabel_Text); | private final Control createDataControls(final Composite parent) { GridLayout layout; GridData gridData; // Creates the data area. final Composite dataArea = new Composite(parent, SWT.NONE); layout = new GridLayout(2, true); layout.marginWidth = 0; dataArea.setLayout(layout); gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = SWT.FILL; dataArea.setLayoutData(gridData); // LEFT DATA AREA // Creates the left data area. final Composite leftDataArea = new Composite(dataArea, SWT.NONE); layout = new GridLayout(3, false); leftDataArea.setLayout(layout); gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.verticalAlignment = SWT.TOP; gridData.horizontalAlignment = SWT.FILL; leftDataArea.setLayoutData(gridData); // The command name label. final Label commandNameLabel = new Label(leftDataArea, SWT.NONE); commandNameLabel.setText(Util.translateString(RESOURCE_BUNDLE, "commandNameLabel.Text")); //$NON-NLS-1$ // The current command name. commandNameValueLabel = new Label(leftDataArea, SWT.NONE); gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.horizontalSpan = 2; gridData.horizontalAlignment = SWT.FILL; commandNameValueLabel.setLayoutData(gridData); // The binding label. final Label bindingLabel = new Label(leftDataArea, SWT.NONE); bindingLabel.setText(Util.translateString(RESOURCE_BUNDLE, "bindingLabel.Text")); //$NON-NLS-1$ // The key sequence entry widget. bindingText = new Text(leftDataArea, SWT.BORDER); gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = SWT.FILL; gridData.widthHint = 200; bindingText.setLayoutData(gridData); keySequenceText = new KeySequenceText(bindingText); keySequenceText.setKeyStrokeLimit(4); keySequenceText .addPropertyChangeListener(new IPropertyChangeListener() { public final void propertyChange( final PropertyChangeEvent event) { if (!event.getOldValue().equals(event.getNewValue())) { keySequenceChanged(); } } }); // Button for adding trapped key strokes final Button addKeyButton = new Button(leftDataArea, SWT.LEFT | SWT.ARROW); addKeyButton.setToolTipText(Util.translateString(RESOURCE_BUNDLE, "addKeyButton.ToolTipText")); //$NON-NLS-1$ gridData = new GridData(); gridData.heightHint = schemeCombo.getCombo().getTextHeight(); addKeyButton.setLayoutData(gridData); // Arrow buttons aren't normally added to the tab list. Let's fix that. final Control[] tabStops = dataArea.getTabList(); final ArrayList newTabStops = new ArrayList(); for (int i = 0; i < tabStops.length; i++) { Control tabStop = tabStops[i]; newTabStops.add(tabStop); if (bindingText.equals(tabStop)) { newTabStops.add(addKeyButton); } } final Control[] newTabStopArray = (Control[]) newTabStops .toArray(new Control[newTabStops.size()]); dataArea.setTabList(newTabStopArray); // Construct the menu to attach to the above button. final Menu addKeyMenu = new Menu(addKeyButton); final Iterator trappedKeyItr = KeySequenceText.TRAPPED_KEYS.iterator(); while (trappedKeyItr.hasNext()) { final KeyStroke trappedKey = (KeyStroke) trappedKeyItr.next(); final MenuItem menuItem = new MenuItem(addKeyMenu, SWT.PUSH); menuItem.setText(trappedKey.format()); menuItem.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { keySequenceText.insert(trappedKey); bindingText.setFocus(); bindingText.setSelection(bindingText.getTextLimit()); } }); } addKeyButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent selectionEvent) { Point buttonLocation = addKeyButton.getLocation(); buttonLocation = dataArea.toDisplay(buttonLocation.x, buttonLocation.y); Point buttonSize = addKeyButton.getSize(); addKeyMenu.setLocation(buttonLocation.x, buttonLocation.y + buttonSize.y); addKeyMenu.setVisible(true); } }); // The when label. final Label whenLabel = new Label(leftDataArea, SWT.NONE); whenLabel.setText(Util.translateString(RESOURCE_BUNDLE, "whenLabel.Text")); //$NON-NLS-1$ // The when combo. whenCombo = new ComboViewer(leftDataArea); gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = SWT.FILL; gridData.horizontalSpan = 2; whenCombo.getCombo().setLayoutData(gridData); whenCombo.setLabelProvider(new NamedHandleObjectLabelProvider()); whenCombo.setContentProvider(new ArrayContentProvider()); // RIGHT DATA AREA // Creates the right data area. final Composite rightDataArea = new Composite(dataArea, SWT.NONE); layout = new GridLayout(1, false); rightDataArea.setLayout(layout); gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.verticalAlignment = SWT.TOP; gridData.horizontalAlignment = SWT.FILL; rightDataArea.setLayoutData(gridData); // The description label. final Label descriptionLabel = new Label(rightDataArea, SWT.NONE); descriptionLabel.setText(Util.translateString(RESOURCE_BUNDLE, "descriptionLabel.Text")); //$NON-NLS-1$ gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = SWT.FILL; descriptionLabel.setLayoutData(gridData); // The description value. descriptionValueLabel = new Label(rightDataArea, SWT.WRAP); gridData = new GridData(); gridData.horizontalAlignment = SWT.FILL; gridData.verticalAlignment = SWT.FILL; gridData.grabExcessHorizontalSpace = true; gridData.grabExcessVerticalSpace = true; gridData.horizontalIndent = 30; gridData.verticalIndent = 5; gridData.widthHint = 200; descriptionValueLabel.setLayoutData(gridData); return dataArea; } | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/513fdd2ff09faa46895497ae1bc94b7630736b66/NewKeysPreferencePage.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
727,
8888,
752,
751,
16795,
12,
6385,
14728,
982,
13,
288,
202,
202,
6313,
3744,
3511,
31,
202,
202,
6313,
751,
3068,
751,
31,
202,
202,
759,
10210,
326,
501,
5091,
18,
202,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
727,
8888,
752,
751,
16795,
12,
6385,
14728,
982,
13,
288,
202,
202,
6313,
3744,
3511,
31,
202,
202,
6313,
751,
3068,
751,
31,
202,
202,
759,
10210,
326,
501,
5091,
18,
202,
... |
exceptionClass.defineSingletonMethod( "exception", CallbackFactory.getOptSingletonMethod(RubyException.class, "newInstance")); | exceptionClass.defineSingletonMethod("exception", CallbackFactory.getOptSingletonMethod(RubyException.class, "newInstance")); exceptionClass.defineSingletonMethod("new", CallbackFactory.getOptSingletonMethod(RubyException.class, "newInstance")); | public static RubyClass createExceptionClass(Ruby ruby) { RubyClass exceptionClass = ruby.defineClass("Exception", ruby.getClasses().getObjectClass()); exceptionClass.defineSingletonMethod( "exception", CallbackFactory.getOptSingletonMethod(RubyException.class, "newInstance")); exceptionClass.defineMethod("initialize", CallbackFactory.getOptMethod(RubyException.class, "initialize")); exceptionClass.defineMethod("exception", CallbackFactory.getOptMethod(RubyException.class, "exception")); exceptionClass.defineMethod("to_s", CallbackFactory.getMethod(RubyException.class, "to_s")); exceptionClass.defineMethod("to_str", CallbackFactory.getMethod(RubyException.class, "to_s")); exceptionClass.defineMethod("message", CallbackFactory.getMethod(RubyException.class, "to_s")); exceptionClass.defineMethod("inspect", CallbackFactory.getMethod(RubyException.class, "inspect")); exceptionClass.defineMethod("backtrace", CallbackFactory.getMethod(RubyException.class, "backtrace")); exceptionClass.defineMethod( "set_backtrace", CallbackFactory.getMethod(RubyException.class, "set_backtrace", RubyArray.class)); return exceptionClass; } | 49476 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49476/8adb5153eae22c0f6dba4d97072deb88f2715e8a/RubyException.java/clean/org/jruby/RubyException.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
19817,
797,
752,
503,
797,
12,
54,
10340,
22155,
13,
288,
3639,
19817,
797,
1520,
797,
273,
22155,
18,
11255,
797,
2932,
503,
3113,
22155,
18,
588,
4818,
7675,
588,
921,
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,
760,
19817,
797,
752,
503,
797,
12,
54,
10340,
22155,
13,
288,
3639,
19817,
797,
1520,
797,
273,
22155,
18,
11255,
797,
2932,
503,
3113,
22155,
18,
588,
4818,
7675,
588,
921,
797,
... |
changeFontButton.setFont(parent.getFont()); | applyDialogFont(changeFontButton); | private void createChangeControl( Composite parent, String changeButtonLabel) { changeFontButton = new Button(parent, SWT.PUSH); changeFontButton.setText(changeButtonLabel); //$NON-NLS-1$ changeFontButton.setFont(parent.getFont()); setButtonLayoutData(changeFontButton); changeFontButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { FontDefinition definition = getSelectedFontDefinition(); if (definition != null) { FontDialog fontDialog = new FontDialog(changeFontButton.getShell()); FontData[] currentData = getFontDataSetting(definition); fontDialog.setFontData(currentData[0]); FontData font = fontDialog.open(); if (font != null) { FontData[] fonts = new FontData[1]; fonts[0] = font; fontDataSettings.put(definition.getId(), fonts); updateForSelectedFontDefinition(definition); } } } }); changeFontButton.setEnabled(false); } | 58148 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58148/fa3d8b2c736e3652be89a2f1f10b1731caba01eb/FontPreferencePage.java/clean/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/FontPreferencePage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
752,
3043,
3367,
12,
202,
202,
9400,
982,
16,
202,
202,
780,
2549,
3616,
2224,
13,
288,
202,
202,
3427,
5711,
3616,
273,
394,
12569,
12,
2938,
16,
348,
8588,
18,
30348,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
752,
3043,
3367,
12,
202,
202,
9400,
982,
16,
202,
202,
780,
2549,
3616,
2224,
13,
288,
202,
202,
3427,
5711,
3616,
273,
394,
12569,
12,
2938,
16,
348,
8588,
18,
30348,
... |
+ sipTransaction.getTransactionId()); | + sipTransaction.getTransactionId() + " transaction = " + sipTransaction); | public void removeTransaction(SIPTransaction sipTransaction) { if (logWriter.isLoggingEnabled()) { logWriter.logDebug("Removing Transaction = " + sipTransaction.getTransactionId()); } if (sipTransaction instanceof SIPServerTransaction) { String key = sipTransaction.getTransactionId(); Object removed = serverTransactionTable.remove(key); this .removePendingTransaction((SIPServerTransaction) sipTransaction); this.removeFromMergeTable((SIPServerTransaction) sipTransaction); // Send a notification to the listener. SipProviderImpl sipProvider = (SipProviderImpl) sipTransaction .getSipProvider(); if (removed != null && sipTransaction.testAndSetTransactionTerminatedEvent()) { TransactionTerminatedEvent event = new TransactionTerminatedEvent( sipProvider, (ServerTransaction) sipTransaction); sipProvider.handleEvent(event, sipTransaction); } } else { String key = sipTransaction.getTransactionId(); Object removed = clientTransactionTable.remove(key); // Send a notification to the listener. if (removed != null && sipTransaction.testAndSetTransactionTerminatedEvent()) { SipProviderImpl sipProvider = (SipProviderImpl) sipTransaction .getSipProvider(); TransactionTerminatedEvent event = new TransactionTerminatedEvent( sipProvider, (ClientTransaction) sipTransaction); sipProvider.handleEvent(event, sipTransaction); } } } | 3364 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3364/5b9a05782bade9415f7b6c90a328b3a26640f8e0/SIPTransactionStack.java/buggy/src/gov/nist/javax/sip/stack/SIPTransactionStack.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1206,
3342,
12,
17739,
3342,
10341,
3342,
13,
288,
202,
202,
430,
261,
1330,
2289,
18,
291,
7735,
1526,
10756,
288,
1082,
202,
1330,
2289,
18,
1330,
2829,
2932,
18939,
5947... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1206,
3342,
12,
17739,
3342,
10341,
3342,
13,
288,
202,
202,
430,
261,
1330,
2289,
18,
291,
7735,
1526,
10756,
288,
1082,
202,
1330,
2289,
18,
1330,
2829,
2932,
18939,
5947... |
programArgs.add("-dev"); if (PDECore.getDefault().getModelManager().isOSGiRuntime()) programArgs.add(ClasspathHelper.getDevEntriesProperties(getConfigDir(configuration).toString() + "/dev.properties", true)); | programArgs.add( "-dev" ); if ( PDECore.getDefault( ).getModelManager( ).isOSGiRuntime( ) ) programArgs.add( DebugUtil.getDevEntriesProperties( getConfigDir( configuration ).toString( ) + "/dev.properties", true ) ); | private String[] getProgramArguments(ILaunchConfiguration configuration) throws CoreException { ArrayList programArgs = new ArrayList(); // If a product is specified, then add it to the program args if (configuration.getAttribute(USE_PRODUCT, false)) { programArgs.add("-product"); //$NON-NLS-1$ programArgs.add(configuration.getAttribute(PRODUCT, "")); //$NON-NLS-1$ } else { // specify the application to launch programArgs.add("-application"); //$NON-NLS-1$ programArgs.add(configuration.getAttribute(APPLICATION, LauncherUtils.getDefaultApplicationName())); } // specify the workspace location for the runtime workbench String targetWorkspace = configuration.getAttribute(LOCATION + "0", LauncherUtils.getDefaultPath().append("runtime-workbench-workspace").toOSString()); //$NON-NLS-1$ //$NON-NLS-2$ programArgs.add("-data"); //$NON-NLS-1$ programArgs.add(targetWorkspace); boolean isOSGI = PDECore.getDefault().getModelManager().isOSGiRuntime(); if (configuration.getAttribute(USEFEATURES, false)) { validateFeatures(); IPath installPath = PDEPlugin.getWorkspace().getRoot().getLocation(); programArgs.add("-install"); //$NON-NLS-1$ programArgs.add("file:" + installPath.removeLastSegments(1).addTrailingSeparator().toString()); //$NON-NLS-1$ programArgs.add("-update"); //$NON-NLS-1$ } else { TreeMap pluginMap = LauncherUtils.getPluginsToRun(configuration); if (pluginMap == null) return null; String primaryFeatureId = LauncherUtils.getPrimaryFeatureId(); TargetPlatform.createPlatformConfigurationArea( pluginMap, getConfigDir(configuration), primaryFeatureId, ReportLauncherUtils.getAutoStartPlugins(configuration)); programArgs.add("-configuration"); //$NON-NLS-1$ if (isOSGI) programArgs.add("file:" + new Path(getConfigDir(configuration).getPath()).addTrailingSeparator().toString()); //$NON-NLS-1$ else programArgs.add("file:" + new Path(getConfigDir(configuration).getPath()).append("platform.cfg").toString()); //$NON-NLS-1$ //$NON-NLS-2$ if (!isOSGI) { if (primaryFeatureId != null) { programArgs.add("-feature"); //$NON-NLS-1$ programArgs.add(primaryFeatureId); } IPluginModelBase bootModel = (IPluginModelBase)pluginMap.get("org.eclipse.core.boot"); //$NON-NLS-1$ String bootPath = LauncherUtils.getBootPath(bootModel); if (bootPath != null && !bootPath.endsWith(".jar")) { //$NON-NLS-1$ programArgs.add("-boot"); //$NON-NLS-1$ programArgs.add("file:" + bootPath); //$NON-NLS-1$ } } } // add the output folder names programArgs.add("-dev"); //$NON-NLS-1$ if (PDECore.getDefault().getModelManager().isOSGiRuntime()) programArgs.add(ClasspathHelper.getDevEntriesProperties(getConfigDir(configuration).toString() + "/dev.properties", true)); //$NON-NLS-1$ else programArgs.add(ClasspathHelper.getDevEntries(true)); // necessary for PDE to know how to load plugins when target platform = host platform // see PluginPathFinder.getPluginPaths() programArgs.add("-pdelaunch"); //$NON-NLS-1$ // add tracing, if turned on if (configuration.getAttribute(TRACING, false) && !TRACING_NONE.equals(configuration.getAttribute(TRACING_CHECKED, (String) null))) { programArgs.add("-debug"); //$NON-NLS-1$ programArgs.add( LauncherUtils.getTracingFileArgument( configuration, getConfigDir(configuration).toString() + Path.SEPARATOR + ".options")); //$NON-NLS-1$ } // add the program args specified by the user StringTokenizer tokenizer = new StringTokenizer(configuration.getAttribute(PROGARGS, "")); //$NON-NLS-1$ while (tokenizer.hasMoreTokens()) { programArgs.add(tokenizer.nextToken()); } // show splash only if we are launching the default application boolean showSplash = true; int index = programArgs.indexOf("-application"); //$NON-NLS-1$ if (index != -1 && index <= programArgs.size() - 2) { if (!programArgs.get(index + 1).equals(LauncherUtils.getDefaultApplicationName())) { showSplash = false; } } if (showSplash && !programArgs.contains("-nosplash")) { //$NON-NLS-1$ programArgs.add(0, "-showsplash"); //$NON-NLS-1$ programArgs.add(1, computeShowsplashArgument()); } return (String[])programArgs.toArray(new String[programArgs.size()]); } | 5230 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5230/84984bdff51060b92abfead47bb784698b54f38d/ReportLaunchConfigurationDelegate.java/clean/UI/org.eclipse.birt.report.debug.ui/src/org/eclipse/birt/report/debug/ui/launcher/ReportLaunchConfigurationDelegate.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
514,
8526,
3570,
3295,
4628,
12,
2627,
4760,
1750,
1664,
13,
1216,
30015,
288,
202,
202,
19558,
5402,
2615,
273,
394,
2407,
5621,
9506,
202,
759,
971,
279,
3017,
353,
1269,
16,
1508... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8526,
3570,
3295,
4628,
12,
2627,
4760,
1750,
1664,
13,
1216,
30015,
288,
202,
202,
19558,
5402,
2615,
273,
394,
2407,
5621,
9506,
202,
759,
971,
279,
3017,
353,
1269,
16,
1508... |
viewOnlyMenu.show(hostTree, e.getX(), e.getY()); | viewOnlyHostMenu.show(hostTree, e.getX(), e.getY()); | private void displayHostTreeMenu(MouseEvent e) { // the path to the node the mouse is pointing at TreePath selPath = hostTree.getPathForLocation(e.getX(), e.getY()); if (selPath == null) return; // if the mouse is pointing at a selected node // and all selected nodes are of the same type, then act on all of them TreePath[] selectedPaths = hostTree.getSelectionPaths(); if (hostTree.isPathSelected(selPath) && selectedPaths.length > 1) { boolean haveHosts = false; boolean haveNodes = false; for (int i = 0; i < selectedPaths.length; i++) { DefaultMutableTreeNode selNode = (DefaultMutableTreeNode)selectedPaths[i].getLastPathComponent(); ConsoleTreeObject selected = (ConsoleTreeObject)selNode.getUserObject(); if (selected.isHost()) { if (!haveHosts && !haveNodes) haveHosts = true; else if (haveNodes) { haveNodes = false; break; } } else if (selected.isNode()) { if (!haveHosts && !haveNodes) haveNodes = true; else if (haveHosts) { haveHosts = false; break; } } else { haveHosts = false; haveNodes = false; break; } } if (haveHosts) { newNodeInHostMenuItem.setEnabled(false); showComponentsHostMenuItem.setEnabled(false); showComponentsHostAMenuItem.setEnabled(false); if (hostTree.isEditable()) hostHostMenu.show(hostTree, e.getX(), e.getY()); else viewOnlyMenu.show(hostTree, e.getX(), e.getY()); return; } else if (haveNodes) { cmdLineNodeInHostMenuItem.setEnabled(false); showComponentsHostMenuItem.setEnabled(false); showComponentsHostAMenuItem.setEnabled(false); if (hostTree.isEditable()) hostNodeMenu.show(hostTree, e.getX(), e.getY()); else viewOnlyMenu.show(hostTree, e.getX(), e.getY()); return; } } else { // else set the selected node to be the node the mouse is pointing at hostTree.setSelectionPath(selPath); DefaultMutableTreeNode selNode = (DefaultMutableTreeNode)selPath.getLastPathComponent(); ConsoleTreeObject selected = (ConsoleTreeObject)selNode.getUserObject(); // display popup menu if (selected.isRoot()) { if (hostTree.isEditable()) hostRootMenu.show(hostTree, e.getX(), e.getY()); else viewOnlyMenu.show(hostTree, e.getX(), e.getY()); } else if (selected.isHost()) { newNodeInHostMenuItem.setEnabled(true); if (hostTree.isEditable()) hostHostMenu.show(hostTree, e.getX(), e.getY()); else viewOnlyMenu.show(hostTree, e.getX(), e.getY()); } else if (selected.isNode()) { // Allow showAgentComponents here! cmdLineNodeInHostMenuItem.setEnabled(true); showComponentsHostMenuItem.setEnabled(true); showComponentsHostAMenuItem.setEnabled(false); if (hostTree.isEditable()) hostNodeMenu.show(hostTree, e.getX(), e.getY()); else viewOnlyMenu.show(hostTree, e.getX(), e.getY()); } else if (selected.isAgent()) { showComponentsHostMenuItem.setEnabled(false); showComponentsHostAMenuItem.setEnabled(true); hostAgentMenu.show(hostTree, e.getX(), e.getY()); } } } | 9368 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/9368/f7bec3abc6aceac0713185cd8e6753a63e4ae471/HostConfigurationBuilder.java/clean/csmart/src/org/cougaar/tools/csmart/ui/experiment/HostConfigurationBuilder.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
918,
2562,
2594,
2471,
4599,
12,
9186,
1133,
425,
13,
288,
565,
368,
326,
589,
358,
326,
756,
326,
7644,
353,
17022,
622,
565,
4902,
743,
357,
743,
273,
1479,
2471,
18,
588,
743,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2562,
2594,
2471,
4599,
12,
9186,
1133,
425,
13,
288,
565,
368,
326,
589,
358,
326,
756,
326,
7644,
353,
17022,
622,
565,
4902,
743,
357,
743,
273,
1479,
2471,
18,
588,
743,
... |
Button chkbox = new Button( container, SWT.CHECK ); chkbox.setText( REMEMBER_DECISION ); chkbox.addSelectionListener( new SelectionListener( ) { | Button chkbox = new Button( container, SWT.CHECK ); chkbox.setText( REMEMBER_DECISION ); chkbox.addSelectionListener( new SelectionListener( ) { | public void run( ) { try { FileDialog dialog = new FileDialog( UIUtil.getDefaultShell( ), SWT.OPEN ); dialog.setFilterExtensions( new String[]{ "*.rptlibrary" //$NON-NLS-1$ } ); String filename; pref = ReportPlugin.getDefault( ) .getPreferenceStore( ) .getInt( PREF_KEY ); filename = dialog.open( ); if ( filename != null ) { if ( pref == PREF_PROMPT ) { MessageDialog prefDialog = new MessageDialog( dialog.getParent( ), DIALOG_TITLE, null, DIALOG_MESSAGE, MessageDialog.INFORMATION, new String[]{ BUTTON_YES, BUTTON_NO, BUTTON_CANCEL }, 0 ) { /* * (non-Javadoc) * * @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite) */ protected Control createCustomArea( Composite parent ) { Composite container = new Composite( parent, SWT.NONE ); GridLayout gridLayout = new GridLayout( ); gridLayout.marginWidth = 20; gridLayout.marginTop = 15; container.setLayout( gridLayout ); Button chkbox = new Button( container, SWT.CHECK ); chkbox.setText( REMEMBER_DECISION ); chkbox.addSelectionListener( new SelectionListener( ) { public void widgetSelected( SelectionEvent e ) { saveDecision = !saveDecision; } public void widgetDefaultSelected( SelectionEvent e ) { saveDecision = false; } } ); return super.createCustomArea( parent ); } /* * (non-Javadoc) * * @see org.eclipse.jface.dialogs.MessageDialog#buttonPressed(int) */ protected void buttonPressed( int buttonId ) { switch ( buttonId ) { case 0 : pref = PREF_OVERWRITE; break; case 1 : pref = PREF_NOT_OVERWRITE; break; default : break; } if ( saveDecision ) { ReportPlugin.getDefault( ) .getPreferenceStore( ) .setValue( PREF_KEY, pref ); } super.buttonPressed( buttonId ); } }; if ( prefDialog.open( ) == 2 ) return; } ElementExportUtil.exportElement( (DesignElementHandle) getSelection( ), filename, pref == PREF_OVERWRITE ); } } catch ( Exception e ) { ExceptionHandler.handle( e ); } } | 5230 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5230/c7ff27323be7f22a6b56c5b5d61ff17ed3e4f30a/ExportToLibraryAction.java/buggy/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/views/actions/ExportToLibraryAction.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1086,
12,
262,
202,
95,
202,
202,
698,
202,
202,
95,
1082,
202,
812,
6353,
6176,
273,
394,
1387,
6353,
12,
6484,
1304,
18,
588,
1868,
13220,
12,
262,
16,
6862,
202,
55,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1086,
12,
262,
202,
95,
202,
202,
698,
202,
202,
95,
1082,
202,
812,
6353,
6176,
273,
394,
1387,
6353,
12,
6484,
1304,
18,
588,
1868,
13220,
12,
262,
16,
6862,
202,
55,... |
public void init(Config config, DataHolder data, String fileName) { this.config = config; File classFile = new File(fileName); desiredOutputs = new Output(1, data.nSamples); try { BufferedReader out = new BufferedReader(new FileReader(classFile)); //Find out if we are using snr info: boolean useWeight = false; String line = out.readLine().trim(); if (line.split("\\s+").length == 2) { useWeight = true; weights = new double[data.nSamples]; } out = new BufferedReader(new FileReader(classFile)); for (int sample=0; sample<data.nSamples; sample++) { line = out.readLine().trim(); if (useWeight) { String[] vals = line.split("\\s+"); //First comes the desiredOutput: desiredOutputs.getArray(0)[sample] = Double.parseDouble(vals[0]); //Then the weight: weights[sample] = Double.parseDouble(vals[1]); } else { desiredOutputs.getArray(0)[sample] = Double.parseDouble(line); } } Logger.log("Using classic (generic) fitness"); Logger.log("Fitness initialized from file \"" + fileName + "\""); if (useWeight) { Logger.log("\t Using weight data"); } Logger.log("\t Samples: " + data.nSamples); } /* TODO: These exceptions shouldn't be catched here, but thrown to the * evolution and then to the controller */ catch (FileNotFoundException e) { Logger.log(e); } catch (IOException e) { Logger.log(e); } catch (NumberFormatException e) { Logger.log(e); } } | 12140 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12140/c8d65a27c93288808a0b1972be71dd13e5de9df2/FitnessClassic.java/clean/branches/clustering/src/gpalta/core/FitnessClassic.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1208,
12,
809,
642,
16,
1910,
6064,
501,
16,
514,
3968,
13,
377,
288,
3639,
333,
18,
1425,
273,
642,
31,
7734,
1387,
29728,
273,
394,
1387,
12,
17812,
1769,
3639,
6049,
13856... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1208,
12,
809,
642,
16,
1910,
6064,
501,
16,
514,
3968,
13,
377,
288,
3639,
333,
18,
1425,
273,
642,
31,
7734,
1387,
29728,
273,
394,
1387,
12,
17812,
1769,
3639,
6049,
13856... | ||
return ; | public void expressionList() throws RecognitionException { try { // /Users/bob/Documents/workspace/jbossrules/drools-compiler/src/main/java/org/drools/semantics/java/parser/java.g:513:17: ( expression ( COMMA expression )* ) // /Users/bob/Documents/workspace/jbossrules/drools-compiler/src/main/java/org/drools/semantics/java/parser/java.g:513:17: expression ( COMMA expression )* { following.push(FOLLOW_expression_in_expressionList1855); expression(); following.pop(); // /Users/bob/Documents/workspace/jbossrules/drools-compiler/src/main/java/org/drools/semantics/java/parser/java.g:513:28: ( COMMA expression )* loop50: do { int alt50=2; int LA50_0 = input.LA(1); if ( LA50_0==COMMA ) { alt50=1; } switch (alt50) { case 1 : // /Users/bob/Documents/workspace/jbossrules/drools-compiler/src/main/java/org/drools/semantics/java/parser/java.g:513:29: COMMA expression { match(input,COMMA,FOLLOW_COMMA_in_expressionList1858); following.push(FOLLOW_expression_in_expressionList1860); expression(); following.pop(); } break; default : break loop50; } } while (true); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } } | 6736 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6736/7e425814ce563fcc662b266adb2a4dc8e1a95d19/JavaParser.java/clean/drools-compiler/src/main/java/org/drools/semantics/java/parser/JavaParser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
327,
274,
327,
274,
327,
274,
327,
274,
1071,
2463,
274,
918,
2463,
274,
2652,
682,
1435,
2463,
274,
1216,
2463,
274,
9539,
2463,
274,
288,
2463,
274,
327,
274,
327,
274,
327,
274,
327,
274,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
327,
274,
327,
274,
327,
274,
327,
274,
1071,
2463,
274,
918,
2463,
274,
2652,
682,
1435,
2463,
274,
1216,
2463,
274,
9539,
2463,
274,
288,
2463,
274,
327,
274,
327,
274,
327,
274,
327,
274,... | |
NumberFormat nf = NumberFormat.getInstance( ); | NumberFormat nf = ChartUIUtil.getDefaultNumberFormatInstance( ); | private DataElement getTypedDataElement( String strDataElement ) { if ( strDataElement.trim( ).length( ) == 0 ) { return NumberDataElementImpl.create( 0.0 ); } NumberFormat nf = NumberFormat.getInstance( ); try { Number numberElement = nf.parse( strDataElement ); return NumberDataElementImpl.create( numberElement.doubleValue( ) ); } catch ( ParseException e1 ) { return NumberDataElementImpl.create( 0.0 ); } } | 15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/a49449a59135dce3bf12e1cc0f2e1514a96901e6/SeriesRegionSheet.java/buggy/chart/org.eclipse.birt.chart.ui.extension/src/org/eclipse/birt/chart/ui/swt/wizard/format/popup/series/SeriesRegionSheet.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
1910,
1046,
3181,
6140,
751,
1046,
12,
514,
609,
751,
1046,
262,
202,
95,
202,
202,
430,
261,
609,
751,
1046,
18,
5290,
12,
262,
18,
2469,
12,
262,
422,
374,
262,
202,
202,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
1910,
1046,
3181,
6140,
751,
1046,
12,
514,
609,
751,
1046,
262,
202,
95,
202,
202,
430,
261,
609,
751,
1046,
18,
5290,
12,
262,
18,
2469,
12,
262,
422,
374,
262,
202,
202,... |
public org.quickfix.field.MsgDirection getMsgDirection() throws FieldNotFound { org.quickfix.field.MsgDirection value = new org.quickfix.field.MsgDirection(); | public quickfix.field.MsgDirection getMsgDirection() throws FieldNotFound { quickfix.field.MsgDirection value = new quickfix.field.MsgDirection(); | public org.quickfix.field.MsgDirection getMsgDirection() throws FieldNotFound { org.quickfix.field.MsgDirection value = new org.quickfix.field.MsgDirection(); getField(value); return value; } | 5926 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5926/fecc27f98261270772ff182a1d4dfd94b5daa73d/Logon.java/clean/src/java/src/quickfix/fix42/Logon.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
2358,
18,
19525,
904,
18,
1518,
18,
3332,
8212,
2108,
1055,
8212,
1435,
1216,
2286,
2768,
565,
288,
2358,
18,
19525,
904,
18,
1518,
18,
3332,
8212,
460,
273,
394,
2358,
18,
19525,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
377,
1071,
2358,
18,
19525,
904,
18,
1518,
18,
3332,
8212,
2108,
1055,
8212,
1435,
1216,
2286,
2768,
565,
288,
2358,
18,
19525,
904,
18,
1518,
18,
3332,
8212,
460,
273,
394,
2358,
18,
19525,
... |
int lastSeparator = classFileName == null ? -1 : classFileName.lastIndexOf(File.separatorChar); | if (classFileName == null) { packageName = "org.mozilla.javascript.gen"; initialName = "c"; return; } int lastSeparator = classFileName.lastIndexOf(File.separatorChar); | public void setTargetClassFileName(String classFileName) { int lastSeparator = classFileName == null ? -1 : classFileName.lastIndexOf(File.separatorChar); String initialName; if (lastSeparator == -1) { generatingDirectory = ""; initialName = classFileName; } else { generatingDirectory = classFileName.substring(0, lastSeparator); initialName = classFileName.substring(lastSeparator+1); } if (initialName.endsWith(".class")) initialName = initialName.substring(0, initialName.length() - 6); setInitialClassName(initialName); } | 13991 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13991/446ea9e8daeb555b392289daff4598707e062327/OptClassNameHelper.java/clean/js/rhino/org/mozilla/javascript/optimizer/OptClassNameHelper.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
18367,
797,
4771,
12,
780,
667,
4771,
13,
288,
3639,
509,
1142,
6581,
273,
667,
4771,
422,
446,
11794,
692,
300,
21,
18701,
294,
667,
4771,
18,
2722,
31985,
12,
812,
18,
1128... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18367,
797,
4771,
12,
780,
667,
4771,
13,
288,
3639,
509,
1142,
6581,
273,
667,
4771,
422,
446,
11794,
692,
300,
21,
18701,
294,
667,
4771,
18,
2722,
31985,
12,
812,
18,
1128... |
if (left instanceof Integer && right instanceof Integer) { return new Integer(((Integer) left).intValue() + ((Integer) right).intValue()); | /* * Arithmetic operation. */ if (left instanceof Number && right instanceof Number) { return MathUtils.add((Number)left, (Number)right); | public Object value( InternalContextAdapter context) throws MethodInvocationException { /* * get the two addends */ Object left = jjtGetChild(0).value(context); Object right = jjtGetChild(1).value(context); /* * if either is null, lets log and bail */ if (left == null || right == null) { rsvc.error( ( left == null ? "Left" : "Right" ) + " side (" + jjtGetChild( (left == null? 0 : 1) ).literal() + ") of addition operation has null value." + " Operation not possible. " + context.getCurrentTemplateName() + " [line " + getLine() + ", column " + getColumn() + "]"); return null; } /* * put the Integer test first, as that should happen most often */ if (left instanceof Integer && right instanceof Integer) { return new Integer(((Integer) left).intValue() + ((Integer) right).intValue()); } /* * shall we try for strings? */ if (left instanceof String || right instanceof String) { return left.toString().concat(right.toString()); } /* * if not an Integer or Strings, not much we can do right now */ rsvc.error( ( !( left instanceof Integer ) ? "Left" : "Right" ) + " side of addition operation is not a valid type. " + "Currently only Strings, integers (1,2,3...) and Integer type are supported. " + context.getCurrentTemplateName() + " [line " + getLine() + ", column " + getColumn() + "]"); return null; } | 55820 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55820/5b85dc5e122a5bdf3ea90d4f89cebe71413fc26b/ASTAddNode.java/clean/src/java/org/apache/velocity/runtime/parser/node/ASTAddNode.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1033,
460,
12,
3186,
1042,
4216,
819,
13,
3639,
1216,
2985,
9267,
503,
565,
288,
3639,
1748,
540,
380,
225,
336,
326,
2795,
527,
5839,
540,
1195,
3639,
1033,
2002,
273,
10684,
88,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
460,
12,
3186,
1042,
4216,
819,
13,
3639,
1216,
2985,
9267,
503,
565,
288,
3639,
1748,
540,
380,
225,
336,
326,
2795,
527,
5839,
540,
1195,
3639,
1033,
2002,
273,
10684,
88,
... |
processDirectory(classLoader, "", directory); | processDirectory("", classLoader, applicationContext, baseDir); | public void afterPropertiesSet() throws Exception { if (classLoader == null) { classLoader = getClass().getClassLoader(); } if (directory == null) { log.warn("No directory specified so using current directory"); directory = new File("."); } directory = directory.getAbsoluteFile(); log.info("Starting to load components from: " + directory); // lets load the deployment processDirectory(classLoader, "", directory); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/8c4b10c7539271fd58e482930eb1c78190efe56b/FileDeployer.java/buggy/server/src/main/java/org/apache/xbean/server/deployer/FileDeployer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1839,
2297,
694,
1435,
1216,
1185,
288,
3639,
309,
261,
1106,
2886,
422,
446,
13,
288,
5411,
11138,
273,
2900,
7675,
588,
7805,
5621,
3639,
289,
3639,
309,
261,
5149,
422,
446,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1839,
2297,
694,
1435,
1216,
1185,
288,
3639,
309,
261,
1106,
2886,
422,
446,
13,
288,
5411,
11138,
273,
2900,
7675,
588,
7805,
5621,
3639,
289,
3639,
309,
261,
5149,
422,
446,... |
String msg = e.toString(); TestUI.this.messageHandler.print(msg); | TestUI.this.parentErrorHandler.error(e, st); | public TestUI(TranslateToken translator, MessageHandler messageHandler) { this.translator = translator; this.messageHandler = messageHandler; this.errorHandler = new ErrorHandler() { public void error(Exception e) { if (e instanceof TokenFailure) { String msg = TestUI.this.translator.translate((TokenFailure)e); TestUI.this.messageHandler.print(msg); } else { String msg = e.toString(); TestUI.this.messageHandler.print(msg); } } }; currentSeat = null; } | 49579 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49579/d458cbcc4bdacff31b4d5c44b111474feeae77ae/TestUI.java/clean/Javolin/source/org/volity/testbench/TestUI.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
7766,
5370,
12,
12818,
1345,
8333,
16,
3639,
2350,
1503,
883,
1503,
13,
288,
3639,
333,
18,
17879,
273,
8333,
31,
3639,
333,
18,
2150,
1503,
273,
883,
1503,
31,
3639,
333,
18,
163... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7766,
5370,
12,
12818,
1345,
8333,
16,
3639,
2350,
1503,
883,
1503,
13,
288,
3639,
333,
18,
17879,
273,
8333,
31,
3639,
333,
18,
2150,
1503,
273,
883,
1503,
31,
3639,
333,
18,
163... |
QuickFixAction.registerQuickFixAction(info, quickFixInfo.textRange, quickFixInfo.quickFix, quickFixInfo.options); | QuickFixAction.registerQuickFixAction(info, quickFixInfo.textRange, quickFixInfo.quickFix, quickFixInfo.options, quickFixInfo.displayName); | public static HighlightInfo convertToHighlightInfo(Annotation annotation) { HighlightInfo info = new HighlightInfo(annotation.getTextAttributes(), convertType(annotation), annotation.getStartOffset(), annotation.getEndOffset(), annotation.getMessage(), annotation.getTooltip(), annotation.getSeverity(), annotation.isAfterEndOfLine(), annotation.needsUpdateOnTyping()); info.setGutterIconRenderer(annotation.getGutterIconRenderer()); List<Annotation.QuickFixInfo> fixes = annotation.getQuickFixes(); if (fixes != null) { for (Annotation.QuickFixInfo quickFixInfo : fixes) { QuickFixAction.registerQuickFixAction(info, quickFixInfo.textRange, quickFixInfo.quickFix, quickFixInfo.options); } } return info; } | 56598 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56598/dee9b62fe1ee40a1d6ca8afc95e5e1eca32dd11f/HighlightUtil.java/buggy/codeInsight/impl/com/intellij/codeInsight/daemon/impl/analysis/HighlightUtil.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
31386,
966,
8137,
16205,
966,
12,
3257,
3204,
13,
288,
565,
31386,
966,
1123,
273,
394,
31386,
966,
12,
11495,
18,
588,
1528,
2498,
9334,
1765,
559,
12,
11495,
3631,
3204,
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,
760,
31386,
966,
8137,
16205,
966,
12,
3257,
3204,
13,
288,
565,
31386,
966,
1123,
273,
394,
31386,
966,
12,
11495,
18,
588,
1528,
2498,
9334,
1765,
559,
12,
11495,
3631,
3204,
18,
... |
Object element = array[i]; if (element != null) findLiteral(element); | literal = new Literal (value, objArrayType, this); for (int i = len; --i >= 0; ) { Object element = array[i]; if (element != null) findLiteral(element); } | public Literal findLiteral (Object value) { Literal literal = (Literal) literalTable.get (value); if (literal != null) { // This value is used multiple times (perhaps recursively), // so do allocate a LitN Field for it. // However, String literals are shared in the constant pool instead. if (literal.field == null && ! (literal.value instanceof String)) literal.assign (this); } else { if (value instanceof Boolean) { boolean val = ((Boolean)value).booleanValue (); literal = new Literal (value, val ? trueConstant : falseConstant, this); } else if (value == Values.empty) literal = new Literal (value, voidConstant, this); else if (value instanceof Undefined) literal = new Literal (value, undefinedConstant, this); else if (immediate) { literal = new Literal (value, this); } else if (value instanceof Compilable) literal = ((Compilable) value).makeLiteral (this); else if (value instanceof Object[]) { Object[] array = (Object[]) value; int len = array.length; literal = new Literal (value, objArrayType, this); for (int i = array.length; --i >= 0; ) { Object element = array[i]; if (element != null) findLiteral(element); } } else literal = new Literal (value, Type.make(value.getClass()), this); } return literal; } | 40769 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/40769/0a820848f7d64971115fbe74bb9bff5a16b4bbf9/Compilation.java/clean/gnu/expr/Compilation.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
14392,
1104,
6177,
261,
921,
460,
13,
225,
288,
565,
14392,
7158,
273,
261,
6177,
13,
7158,
1388,
18,
588,
261,
1132,
1769,
565,
309,
261,
13107,
480,
446,
13,
1377,
288,
202,
759... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14392,
1104,
6177,
261,
921,
460,
13,
225,
288,
565,
14392,
7158,
273,
261,
6177,
13,
7158,
1388,
18,
588,
261,
1132,
1769,
565,
309,
261,
13107,
480,
446,
13,
1377,
288,
202,
759... |
private final void removeIfUsed(SimpleNode node, String nodeImage, int args) { String img = (nodeImage.indexOf('.') == -1) ? nodeImage : nodeImage.substring(nodeImage.indexOf('.') + 1, nodeImage.length()); | private final void removeIfUsed(SimpleNode node, int args) { String img = (node.getImage().indexOf('.') == -1) ? node.getImage() : node.getImage().substring(node.getImage().indexOf('.') + 1, node.getImage().length()); | private final void removeIfUsed(SimpleNode node, String nodeImage, int args) { String img = (nodeImage.indexOf('.') == -1) ? nodeImage : nodeImage.substring(nodeImage.indexOf('.') + 1, nodeImage.length()); for (Iterator i = privateMethodNodes.iterator(); i.hasNext();) { ASTMethodDeclarator methodNode = (ASTMethodDeclarator) i.next(); // are name and number of parameters the same? if (methodNode.getImage().equals(img) && methodNode.getParameterCount() == args && !methodCalledFromItself(node, nodeImage)) { // TODO should check parameter types here, this misses some unused methods, probably causing bug 1114754 http://sourceforge.net/tracker/index.php?func=detail&aid=1114754&group_id=56262&atid=479921 i.remove(); } } } | 45569 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45569/a25567f5b2efbd3d83953f9893631f45373f5340/UnusedPrivateMethodRule.java/clean/pmd/src/net/sourceforge/pmd/rules/UnusedPrivateMethodRule.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
727,
918,
1206,
2047,
6668,
12,
5784,
907,
756,
16,
514,
756,
2040,
16,
509,
833,
13,
288,
3639,
514,
3774,
273,
261,
2159,
2040,
18,
31806,
2668,
1093,
13,
422,
300,
21,
13,
69... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
727,
918,
1206,
2047,
6668,
12,
5784,
907,
756,
16,
514,
756,
2040,
16,
509,
833,
13,
288,
3639,
514,
3774,
273,
261,
2159,
2040,
18,
31806,
2668,
1093,
13,
422,
300,
21,
13,
69... |
container.setLayout( WidgetUtil.createGridLayout( 6 ) ); | container.setLayout( WidgetUtil.createGridLayout( 6 ,15) ); | public void buildUI( Composite parent ) { super.buildUI( parent ); container.setLayout( WidgetUtil.createGridLayout( 6 ) ); LibraryDescriptorProvider provider = new LibraryDescriptorProvider( ); librarySection = new TextSection( provider.getDisplayName( ), container, true ); librarySection.setProvider( provider ); librarySection.setGridPlaceholder( 2, true ); addSection( PageSectionId.GENERAL_LIBRARY, librarySection ); seperatorSection = new SeperatorSection( container, SWT.HORIZONTAL ); addSection( PageSectionId.GENERAL_SEPERATOR, seperatorSection ); buildContent( ); } | 12803 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12803/b1c54a82f7e0fded60b986c55329f90d6daefd16/GeneralPage.java/buggy/UI/org.eclipse.birt.report.designer.ui.views/src/org/eclipse/birt/report/designer/internal/ui/views/attributes/page/GeneralPage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1361,
5370,
12,
14728,
982,
225,
262,
202,
95,
202,
202,
9565,
18,
3510,
5370,
12,
982,
11272,
202,
202,
3782,
18,
542,
3744,
12,
11103,
1304,
18,
2640,
6313,
3744,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1361,
5370,
12,
14728,
982,
225,
262,
202,
95,
202,
202,
9565,
18,
3510,
5370,
12,
982,
11272,
202,
202,
3782,
18,
542,
3744,
12,
11103,
1304,
18,
2640,
6313,
3744,
12,
... |
} else if (e instanceof IOException) { setState(getResourceString("DownloadThread.Download_failure") + track.getName()); track.increaseDownloadAttempts(); } else { System.out.println("Exception not handled"); } | } else if (e instanceof IOException) { setState(getResourceString("DownloadThread.Download_failure") + track.getName()); track.increaseDownloadAttempts(); } else { System.out.println("Exception not handled"); } | public void download(final Track track) throws IOException { final URL url = getProxyURL(track.getURL()); System.out.println(url); final File file = getFileName(url); setState(getResourceString("DownloadThread.Connecting_to") + url.getHost()); try { long timeout = 120000; DownloadConnection connection = new DownloadConnection(url); connection.connect(0, timeout); // Get rid of the problem where tracks are downloaded but in reality // they are 404 messages or some other html crud. String contentType = connection.getContentType(); if (contentType == null) throw new ProtocolException("Something went wrong talking to the "+ "download site"); if (contentType.indexOf("text") != -1) throw new FileNotFoundException("Content type is Text"); int contentLength = connection.getContentLength(); long continueOffset = file.exists() ? file.length() : 0; // If the file isn't already the right length, then we need to download if (continueOffset != contentLength) { boolean resume = false; if (continueOffset > 0) { resume = true; DownloadConnection resumeConnection = null; try { resumeConnection = new DownloadConnection(url); resumeConnection.connect(continueOffset, timeout); System.out.println("Resuming download (offset=" + continueOffset + ")"); } catch (DownloadConnection.ResumeNotSupportedException exception) { System.out.println("Server does not support resuming downloads"); resume = false; } if (resume) { try { connection.close(timeout); } catch (IOException e) { } connection = resumeConnection; } } setState(getResourceString("DownloadThread.Downloading") + track.getName()); // If the continue offset is non-zero then we open the file in // append mode. If the file on the server is shorter than the one // we have on disk then we just start again. OutputStream os = new FileOutputStream(file.toString(), resume); try { final byte buf[] = new byte[128000]; int totalBytes = (int)continueOffset; while (true) { int nbytes = connection.read(buf, timeout); if (nbytes < 0) break; os.write(buf, 0, nbytes); if (contentLength >= 0) { totalBytes += nbytes; int percent = totalBytes * 100 / contentLength; if (percent != percentComplete) { percentComplete = percent; track.setPercentComplete(percent); notifyUpdateListeners(track); for (Iterator iter = downloadListeners.iterator(); iter.hasNext();) { DownloadListener d = (DownloadListener) iter.next(); d.downloadProgressed(track, percent, Resources.getString("DownloadThread.Downloading_Tracks")); } } } } } finally { os.close(); try { connection.close(timeout); } catch (IOException exception) { } } } track.setFile(file); trackDatabase.save(); } catch (Exception e) { e.printStackTrace(); if (e instanceof FileNotFoundException) { setState("Broken download: " + track.getName()); //$NON-NLS-1$ track.setBroken(); } else if (e instanceof IOException) { setState(getResourceString("DownloadThread.Download_failure") + track.getName()); track.increaseDownloadAttempts(); } else { System.out.println("Exception not handled"); } } finally { percentComplete = 0; } } | 11635 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11635/de453f91c5b6e7f580ccddb1f2604248f5bfcb69/DownloadThread.java/buggy/trunk/irate/irate/download/DownloadThread.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
4224,
12,
6385,
11065,
3298,
13,
1216,
1860,
288,
565,
727,
1976,
880,
273,
18992,
1785,
12,
4101,
18,
588,
1785,
10663,
565,
2332,
18,
659,
18,
8222,
12,
718,
1769,
565,
727... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4224,
12,
6385,
11065,
3298,
13,
1216,
1860,
288,
565,
727,
1976,
880,
273,
18992,
1785,
12,
4101,
18,
588,
1785,
10663,
565,
2332,
18,
659,
18,
8222,
12,
718,
1769,
565,
727... |
e.printStackTrace( ); | WizardBase.displayException( e ); | private Series getNewSeries( String sSeriesName, Series oldSeries ) { try { Class seriesClass = Class.forName( (String) htSeriesNames.get( sSeriesName ) ); Method createMethod = seriesClass.getDeclaredMethod( "create", new Class[]{} ); //$NON-NLS-1$ Series series = (Series) createMethod.invoke( seriesClass, new Object[]{} ); setIgnoreNotifications( true ); series.translateFrom( oldSeries, iSeriesDefinitionIndex, getChart( ) ); setIgnoreNotifications( false ); return series; } catch ( Exception e ) { e.printStackTrace( ); } return null; } | 15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/c89ffbb080bd4f4bbe669a22853161e1a16d81d1/SeriesSheetImpl.java/clean/chart/org.eclipse.birt.chart.ui.extension/src/org/eclipse/birt/chart/ui/swt/wizard/format/series/SeriesSheetImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3196,
202,
1152,
9225,
12654,
6485,
12,
514,
272,
6485,
461,
16,
9225,
1592,
6485,
262,
202,
202,
95,
1082,
202,
698,
1082,
202,
95,
9506,
202,
797,
4166,
797,
273,
1659,
18,
1884,
461,
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,
3196,
202,
1152,
9225,
12654,
6485,
12,
514,
272,
6485,
461,
16,
9225,
1592,
6485,
262,
202,
202,
95,
1082,
202,
698,
1082,
202,
95,
9506,
202,
797,
4166,
797,
273,
1659,
18,
1884,
461,
12,
... |
target.addComponent(models); | target.addComponent(modelsContainer); | public ChoicePage() { modelsMap.put("AUDI", Arrays.asList(new String[] { "A4", "A6", "TT" })); modelsMap.put("CADILLAC", Arrays.asList(new String[] { "CTS", "DTS", "ESCALADE", "SRX", "DEVILLE" })); modelsMap.put("FORD", Arrays.asList(new String[] { "CROWN", "ESCAPE", "EXPEDITION", "EXPLORER", "F-150" })); IModel makeChoices = new AbstractReadOnlyModel() { public Object getObject(Component component) { Set keys = modelsMap.keySet(); List list = new ArrayList(keys.size()); list.addAll(keys); return list; } }; IModel modelChoices = new AbstractReadOnlyModel() { public Object getObject(Component component) { List models = (List)modelsMap.get(selectedMake); if (models == null) { models = Collections.EMPTY_LIST; } return models; } }; Form form = new Form("form"); add(form); final DropDownChoice makes = new DropDownChoice("makes", new PropertyModel(this, "selectedMake"), makeChoices); final DropDownChoice models = new DropDownChoice("models", new Model(), modelChoices); form.add(makes); form.add(models.add(MarkupIdSetter.INSTANCE)); makes.add(new AjaxFormComponentUpdatingBehavior("onchange") { protected void onUpdate(AjaxRequestTarget target) { target.addComponent(models); } }); } | 46434 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46434/081ee752203a52c032d20c1e111d551cabde17fd/ChoicePage.java/buggy/wicket-examples/src/java/wicket/examples/ajax/builtin/ChoicePage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
16432,
1964,
1435,
202,
95,
202,
202,
7665,
863,
18,
458,
2932,
14237,
2565,
3113,
5647,
18,
345,
682,
12,
2704,
514,
8526,
288,
315,
37,
24,
3113,
315,
37,
26,
3113,
315,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16432,
1964,
1435,
202,
95,
202,
202,
7665,
863,
18,
458,
2932,
14237,
2565,
3113,
5647,
18,
345,
682,
12,
2704,
514,
8526,
288,
315,
37,
24,
3113,
315,
37,
26,
3113,
315,
1... |
int dataBlocks = 0; int checkBlocks = 0; for(int i=0;i<segments.length;i++) { String index = Integer.toString(i); SimpleFieldSet segment = segFS.subset(index); segFS.removeSubset(index); if(segment == null) throw new ResumeException("No segment "+i); segments[i] = new SplitFileInserterSegment(this, segment, splitfileAlgorithm, ctx, getCHKOnly, i); dataBlocks += segments[i].countDataBlocks(); checkBlocks += segments[i].countCheckBlocks(); } this.countDataBlocks = dataBlocks; this.countCheckBlocks = checkBlocks; | segments = splitIntoSegments(segmentSize, dataBuckets); int count = 0; for(int i=0;i<segments.length;i++) count += segments[i].countCheckBlocks(); countCheckBlocks = count; | public SplitFileInserter(BaseClientPutter parent, PutCompletionCallback cb, ClientMetadata clientMetadata, InserterContext ctx, boolean getCHKOnly, boolean metadata, Object token, boolean insertAsArchiveManifest, SimpleFieldSet fs) throws ResumeException { logMINOR = Logger.shouldLog(Logger.MINOR, this); this.parent = parent; this.insertAsArchiveManifest = insertAsArchiveManifest; this.token = token; this.finished = false; this.isMetadata = metadata; this.cm = clientMetadata; this.getCHKOnly = getCHKOnly; this.cb = cb; this.ctx = ctx; // Don't read finished, wait for the segmentFinished()'s. String length = fs.get("DataLength"); if(length == null) throw new ResumeException("No DataLength"); try { dataLength = Long.parseLong(length); } catch (NumberFormatException e) { throw new ResumeException("Corrupt DataLength: "+e+" : "+length); } String tmp = fs.get("SegmentSize"); if(length == null) throw new ResumeException("No SegmentSize"); try { segmentSize = Integer.parseInt(tmp); } catch (NumberFormatException e) { throw new ResumeException("Corrupt SegmentSize: "+e+" : "+length); } tmp = fs.get("CheckSegmentSize"); if(length == null) throw new ResumeException("No CheckSegmentSize"); try { checkSegmentSize = Integer.parseInt(tmp); } catch (NumberFormatException e) { throw new ResumeException("Corrupt CheckSegmentSize: "+e+" : "+length); } String ccodec = fs.get("CompressionCodec"); if(ccodec == null) throw new ResumeException("No compression codec"); try { compressionCodec = Short.parseShort(ccodec); } catch (NumberFormatException e) { throw new ResumeException("Corrupt CompressionCodec: "+e+" : "+ccodec); } String scodec = fs.get("SplitfileCodec"); if(scodec == null) throw new ResumeException("No splitfile codec"); try { // FIXME remove soon, backwards compat hack! short t = Short.parseShort(scodec); if(t == -1) t = 1; splitfileAlgorithm = t; } catch (NumberFormatException e) { throw new ResumeException("Corrupt SplitfileCodec: "+e+" : "+scodec); } SimpleFieldSet segFS = fs.subset("Segments"); if(segFS == null) throw new ResumeException("No segments"); String segc = segFS.get("Count"); if(segc == null) throw new ResumeException("No segment count"); int segmentCount; try { segmentCount = Integer.parseInt(segc); } catch (NumberFormatException e) { throw new ResumeException("Corrupt segment count: "+e+" : "+segc); } segments = new SplitFileInserterSegment[segmentCount]; int dataBlocks = 0; int checkBlocks = 0; for(int i=0;i<segments.length;i++) { String index = Integer.toString(i); SimpleFieldSet segment = segFS.subset(index); segFS.removeSubset(index); if(segment == null) throw new ResumeException("No segment "+i); segments[i] = new SplitFileInserterSegment(this, segment, splitfileAlgorithm, ctx, getCHKOnly, i); dataBlocks += segments[i].countDataBlocks(); checkBlocks += segments[i].countCheckBlocks(); } this.countDataBlocks = dataBlocks; this.countCheckBlocks = checkBlocks; } | 46035 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46035/0591129065b7962994e34d81ea2689620fae16ff/SplitFileInserter.java/buggy/src/freenet/client/async/SplitFileInserter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
5385,
812,
382,
550,
387,
12,
2171,
1227,
6426,
387,
982,
16,
4399,
11238,
2428,
2875,
16,
2445,
2277,
1004,
2277,
16,
657,
550,
387,
1042,
1103,
16,
1250,
336,
1792,
47,
3386... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5385,
812,
382,
550,
387,
12,
2171,
1227,
6426,
387,
982,
16,
4399,
11238,
2428,
2875,
16,
2445,
2277,
1004,
2277,
16,
657,
550,
387,
1042,
1103,
16,
1250,
336,
1792,
47,
3386... |
void handleStartElement(QName element, XMLAttributes attributes) { if (DEBUG) { System.out.println("handleStartElement: " +element); } // we receive prefix binding events before this one, // so at this point, the prefix bindings for this element is done, // and we need to push context when we receive another prefix binding. // but if fPushForNextBinding is still true, that means there has // been no prefix binding for this element. we still need to push // context, because the context is always popped in end element. if (fPushForNextBinding) fNamespaceSupport.pushContext(); else fPushForNextBinding = true; // whether to do validation // root element // REVISIT: consider DynamicValidation if (fElementDepth == -1) { fDoValidation = fValidation; fValidationState = fValidationManager.getValidationState(); fValidationState.setNamespaceSupport(fNamespaceSupport); } // if we are in the content of "skip", then just skip this element // REVISIT: is this the correct behaviour for ID constraints? -NG if (fSkipValidationDepth >= 0) { fElementDepth++; return; } // if it's not the root element, we push the current states in the stacks if (fElementDepth != -1) { ensureStackCapacity(); fChildCountStack[fElementDepth] = fChildCount+1; fChildCount = 0; fElemDeclStack[fElementDepth] = fCurrentElemDecl; fNilStack[fElementDepth] = fNil; fTypeStack[fElementDepth] = fCurrentType; fCMStack[fElementDepth] = fCurrentCM; fStringContent[fElementDepth] = fSawCharacters; } // get xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes, // parse them to get the grammars // REVISIT: we'll defer this operation until there is a reference to // a component from that namespace String sLocation = attributes.getValue(URI_XSI, XSI_SCHEMALOCATION); String nsLocation = attributes.getValue(URI_XSI, XSI_NONAMESPACESCHEMALOCATION); if (sLocation != null) { StringTokenizer t = new StringTokenizer(sLocation, " \n\t\r"); String namespace, location; while (t.hasMoreTokens()) { namespace = t.nextToken (); if (!t.hasMoreTokens()) { // REVISIT: report error for wrong number of uris break; } location = t.nextToken(); if (fGrammarResolver.getGrammar(namespace) == null) fSchemaHandler.parseSchema(namespace, location); } } if (nsLocation != null) { if (fGrammarResolver.getGrammar(fSchemaHandler.EMPTY_STRING) == null) fSchemaHandler.parseSchema(fSchemaHandler.EMPTY_STRING, nsLocation); } // get the element decl for this element fCurrentElemDecl = null; fNil = false; XSWildcardDecl wildcard = null; // if there is a content model, then get the decl from that if (fCurrentCM != null) { Object decl = fCurrentCM.oneTransition(element, fCurrCMState, fSubGroupHandler); // it could be an element decl or a wildcard decl // REVISIT: is there a more efficient way than 'instanceof' if (decl == null) { if (fCurrCMState[0] == XSCMValidator.FIRST_ERROR && fDoValidation) { XSComplexTypeDecl ctype = (XSComplexTypeDecl)fCurrentType; //REVISIT: is it the only case we will have particle = null? if (ctype.fParticle != null) { reportSchemaError("cvc-complex-type.2.4.a", new Object[]{element.rawname, ctype.fParticle.toString()}); } else { reportSchemaError("cvc-complex-type.2.4.a", new Object[]{element.rawname, "mixed with no element content"}); } } } else if (decl instanceof XSElementDecl) { fCurrentElemDecl = (XSElementDecl)decl; } else { wildcard = (XSWildcardDecl)decl; } } // save the current content model state in the stack if (fElementDepth != -1) fCMStateStack[fElementDepth] = fCurrCMState; // increase the element depth after we've saved all states for the // parent element fElementDepth++; // if the wildcard is skip, then return if (wildcard != null && wildcard.fProcessContents == XSWildcardDecl.WILDCARD_SKIP) { fSkipValidationDepth = fElementDepth; return; } // try again to get the element decl if (fCurrentElemDecl == null) { SchemaGrammar sGrammar = fGrammarResolver.getGrammar(element.uri); if (sGrammar != null) fCurrentElemDecl = sGrammar.getGlobalElementDecl(element.localpart); } // Element Locally Valid (Element) // 2 Its {abstract} must be false. if (fCurrentElemDecl != null && fCurrentElemDecl.isAbstract()) reportSchemaError("cvc-elt.2", new Object[]{element.rawname}); // get the type for the current element fCurrentType = null; if (fCurrentElemDecl != null) { // then get the type fCurrentType = fCurrentElemDecl.fType; } // get type from xsi:type String xsiType = attributes.getValue(URI_XSI, XSI_TYPE); if (xsiType != null) getAndCheckXsiType(element, xsiType); // Element Locally Valid (Type) // 2 Its {abstract} must be false. if (fCurrentType != null) { if ((fCurrentType.getXSType() & XSTypeDecl.COMPLEX_TYPE) != 0) { XSComplexTypeDecl ctype = (XSComplexTypeDecl)fCurrentType; if (ctype.isAbstractType()) { reportSchemaError("cvc-type.2", new Object[]{"Element " + element.rawname + " is declared with a type that is abstract. Use xsi:type to specify a non-abstract type"}); } } } // if the element decl is not found if (fCurrentType == null ) { if (fDoValidation) { // if this is the root element, or wildcard = strict, report error if (fElementDepth == 0) { // report error, because it's root element reportSchemaError("cvc-elt.1", new Object[]{element.rawname}); } else if (wildcard != null && wildcard.fProcessContents == XSWildcardDecl.WILDCARD_STRICT) { // report error, because wilcard = strict reportSchemaError("cvc-complex-type.2.4.c", new Object[]{element.rawname}); } } // no element decl found, have to skip this element fSkipValidationDepth = fElementDepth; return; } // then try to get the content model fCurrentCM = null; if (fCurrentType != null) { if ((fCurrentType.getXSType() & XSTypeDecl.COMPLEX_TYPE) != 0) { fCurrentCM = ((XSComplexTypeDecl)fCurrentType).getContentModel(fCMBuilder); } } // and get the initial content model state fCurrCMState = null; if (fCurrentCM != null) fCurrCMState = fCurrentCM.startContentModel(); // and the buffer to hold the value of the element fBuffer.setLength(0); fSawCharacters = false; // get information about xsi:nil String xsiNil = attributes.getValue(URI_XSI, XSI_NIL); if (xsiNil != null) getXsiNil(element, xsiNil); // now validate everything related with the attributes // first, get the attribute group XSAttributeGroupDecl attrGrp = null; if ((fCurrentType.getXSType() & XSTypeDecl.COMPLEX_TYPE) != 0) { XSComplexTypeDecl ctype = (XSComplexTypeDecl)fCurrentType; attrGrp = ctype.fAttrGrp; } processAttributes(element, attributes, attrGrp); // activate identity constraints if (fValidation ) { fValueStoreCache.startElement(); fMatcherStack.pushContext(); if (fCurrentElemDecl != null) { fValueStoreCache.initValueStoresFor(fCurrentElemDecl); int icCount = fCurrentElemDecl.fIDCPos; int uniqueOrKey = 0; for (;uniqueOrKey < icCount; uniqueOrKey++) { if(fCurrentElemDecl.fIDConstraints[uniqueOrKey].getType() != IdentityConstraint.KEYREF ) { activateSelectorFor(fCurrentElemDecl.fIDConstraints[uniqueOrKey]); } else break; } for (int keyref = uniqueOrKey; keyref < icCount; keyref++) { activateSelectorFor((IdentityConstraint)fCurrentElemDecl.fIDConstraints[keyref]); } } // call all active identity constraints int count = fMatcherStack.getMatcherCount(); for (int i = 0; i < count; i++) { XPathMatcher matcher = fMatcherStack.getMatcherAt(i); matcher.startElement(element, attributes, fGrammarResolver.getGrammar(element.uri)); } } } // handleStartElement(QName,XMLAttributes,boolean) | 1831 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1831/7d23b0f822620b832b611e0946e73bb880886a98/SchemaValidator.java/clean/src/org/apache/xerces/impl/v2/SchemaValidator.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
918,
1640,
1685,
1046,
12,
13688,
930,
16,
3167,
2498,
1677,
13,
288,
3639,
309,
261,
9394,
13,
288,
5411,
2332,
18,
659,
18,
8222,
2932,
4110,
1685,
1046,
30,
315,
397,
2956,
1769,
363... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
918,
1640,
1685,
1046,
12,
13688,
930,
16,
3167,
2498,
1677,
13,
288,
3639,
309,
261,
9394,
13,
288,
5411,
2332,
18,
659,
18,
8222,
2932,
4110,
1685,
1046,
30,
315,
397,
2956,
1769,
363... | ||
{ boolean[] stateSet1 = getStateSet(state1); boolean[] stateSet2 = getStateSet(state2); double sumMatch = 0.0; double sum1 = 0.0; double sum2 = 0.0; for (int i = 0; i < stateCount; i++) { if (stateSet1[i]) { sum1 += 1.0; if (stateSet1[i] == stateSet2[i]) { sumMatch += 1.0; } } if (stateSet2[i]) { sum2 += 1.0; } } double distance = (1.0 - (sumMatch / (sum1 * sum2))); | { boolean[] stateSet1 = getStateSet(state1); boolean[] stateSet2 = getStateSet(state2); | public double getObservedDistanceWithAmbiguity(int state1, int state2) { boolean[] stateSet1 = getStateSet(state1); boolean[] stateSet2 = getStateSet(state2); double sumMatch = 0.0; double sum1 = 0.0; double sum2 = 0.0; for (int i = 0; i < stateCount; i++) { if (stateSet1[i]) { sum1 += 1.0; if (stateSet1[i] == stateSet2[i]) { sumMatch += 1.0; } } if (stateSet2[i]) { sum2 += 1.0; } } double distance = (1.0 - (sumMatch / (sum1 * sum2))); return distance; } | 51824 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51824/db824f7406b15c81ab50a47915eb39fbaf2a2803/DataType.java/buggy/src/dr/evolution/datatype/DataType.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1645,
336,
9013,
2155,
7200,
1190,
30706,
8810,
560,
12,
474,
919,
21,
16,
509,
919,
22,
13,
202,
95,
202,
202,
6494,
8526,
919,
694,
21,
273,
8997,
694,
12,
2019,
21,
1769,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1645,
336,
9013,
2155,
7200,
1190,
30706,
8810,
560,
12,
474,
919,
21,
16,
509,
919,
22,
13,
202,
95,
202,
202,
6494,
8526,
919,
694,
21,
273,
8997,
694,
12,
2019,
21,
1769,... |
switch (id) { case ConstructorId_UTC: return "UTC"; case ConstructorId_parse: return "parse"; case Id_constructor: return "constructor"; case Id_toString: return "toString"; case Id_toTimeString: return "toTimeString"; case Id_toDateString: return "toDateString"; case Id_toLocaleString: return "toLocaleString"; case Id_toLocaleTimeString: return "toLocaleTimeString"; case Id_toLocaleDateString: return "toLocaleDateString"; case Id_toGMTString: return "toGMTString"; case Id_toUTCString: return "toUTCString"; case Id_valueOf: return "valueOf"; case Id_getTime: return "getTime"; case Id_getYear: return "getYear"; case Id_getFullYear: return "getFullYear"; case Id_getUTCFullYear: return "getUTCFullYear"; case Id_getMonth: return "getMonth"; case Id_getUTCMonth: return "getUTCMonth"; case Id_getDate: return "getDate"; case Id_getUTCDate: return "getUTCDate"; case Id_getDay: return "getDay"; case Id_getUTCDay: return "getUTCDay"; case Id_getHours: return "getHours"; case Id_getUTCHours: return "getUTCHours"; case Id_getMinutes: return "getMinutes"; case Id_getUTCMinutes: return "getUTCMinutes"; case Id_getSeconds: return "getSeconds"; case Id_getUTCSeconds: return "getUTCSeconds"; case Id_getMilliseconds: return "getMilliseconds"; case Id_getUTCMilliseconds: return "getUTCMilliseconds"; case Id_getTimezoneOffset: return "getTimezoneOffset"; case Id_setTime: return "setTime"; case Id_setMilliseconds: return "setMilliseconds"; case Id_setUTCMilliseconds: return "setUTCMilliseconds"; case Id_setSeconds: return "setSeconds"; case Id_setUTCSeconds: return "setUTCSeconds"; case Id_setMinutes: return "setMinutes"; case Id_setUTCMinutes: return "setUTCMinutes"; case Id_setHours: return "setHours"; case Id_setUTCHours: return "setUTCHours"; case Id_setDate: return "setDate"; case Id_setUTCDate: return "setUTCDate"; case Id_setMonth: return "setMonth"; case Id_setUTCMonth: return "setUTCMonth"; case Id_setFullYear: return "setFullYear"; case Id_setUTCFullYear: return "setUTCFullYear"; case Id_setYear: return "setYear"; | if (prototypeFlag) { switch (id) { case ConstructorId_UTC: return "UTC"; case ConstructorId_parse: return "parse"; case Id_constructor: return "constructor"; case Id_toString: return "toString"; case Id_toTimeString: return "toTimeString"; case Id_toDateString: return "toDateString"; case Id_toLocaleString: return "toLocaleString"; case Id_toLocaleTimeString: return "toLocaleTimeString"; case Id_toLocaleDateString: return "toLocaleDateString"; case Id_toGMTString: return "toGMTString"; case Id_toUTCString: return "toUTCString"; case Id_valueOf: return "valueOf"; case Id_getTime: return "getTime"; case Id_getYear: return "getYear"; case Id_getFullYear: return "getFullYear"; case Id_getUTCFullYear: return "getUTCFullYear"; case Id_getMonth: return "getMonth"; case Id_getUTCMonth: return "getUTCMonth"; case Id_getDate: return "getDate"; case Id_getUTCDate: return "getUTCDate"; case Id_getDay: return "getDay"; case Id_getUTCDay: return "getUTCDay"; case Id_getHours: return "getHours"; case Id_getUTCHours: return "getUTCHours"; case Id_getMinutes: return "getMinutes"; case Id_getUTCMinutes: return "getUTCMinutes"; case Id_getSeconds: return "getSeconds"; case Id_getUTCSeconds: return "getUTCSeconds"; case Id_getMilliseconds: return "getMilliseconds"; case Id_getUTCMilliseconds: return "getUTCMilliseconds"; case Id_getTimezoneOffset: return "getTimezoneOffset"; case Id_setTime: return "setTime"; case Id_setMilliseconds: return "setMilliseconds"; case Id_setUTCMilliseconds: return "setUTCMilliseconds"; case Id_setSeconds: return "setSeconds"; case Id_setUTCSeconds: return "setUTCSeconds"; case Id_setMinutes: return "setMinutes"; case Id_setUTCMinutes: return "setUTCMinutes"; case Id_setHours: return "setHours"; case Id_setUTCHours: return "setUTCHours"; case Id_setDate: return "setDate"; case Id_setUTCDate: return "setUTCDate"; case Id_setMonth: return "setMonth"; case Id_setUTCMonth: return "setUTCMonth"; case Id_setFullYear: return "setFullYear"; case Id_setUTCFullYear: return "setUTCFullYear"; case Id_setYear: return "setYear"; } | protected String getIdName(int id) { switch (id) { case ConstructorId_UTC: return "UTC"; case ConstructorId_parse: return "parse"; case Id_constructor: return "constructor"; case Id_toString: return "toString"; case Id_toTimeString: return "toTimeString"; case Id_toDateString: return "toDateString"; case Id_toLocaleString: return "toLocaleString"; case Id_toLocaleTimeString: return "toLocaleTimeString"; case Id_toLocaleDateString: return "toLocaleDateString"; case Id_toGMTString: return "toGMTString"; case Id_toUTCString: return "toUTCString"; case Id_valueOf: return "valueOf"; case Id_getTime: return "getTime"; case Id_getYear: return "getYear"; case Id_getFullYear: return "getFullYear"; case Id_getUTCFullYear: return "getUTCFullYear"; case Id_getMonth: return "getMonth"; case Id_getUTCMonth: return "getUTCMonth"; case Id_getDate: return "getDate"; case Id_getUTCDate: return "getUTCDate"; case Id_getDay: return "getDay"; case Id_getUTCDay: return "getUTCDay"; case Id_getHours: return "getHours"; case Id_getUTCHours: return "getUTCHours"; case Id_getMinutes: return "getMinutes"; case Id_getUTCMinutes: return "getUTCMinutes"; case Id_getSeconds: return "getSeconds"; case Id_getUTCSeconds: return "getUTCSeconds"; case Id_getMilliseconds: return "getMilliseconds"; case Id_getUTCMilliseconds: return "getUTCMilliseconds"; case Id_getTimezoneOffset: return "getTimezoneOffset"; case Id_setTime: return "setTime"; case Id_setMilliseconds: return "setMilliseconds"; case Id_setUTCMilliseconds: return "setUTCMilliseconds"; case Id_setSeconds: return "setSeconds"; case Id_setUTCSeconds: return "setUTCSeconds"; case Id_setMinutes: return "setMinutes"; case Id_setUTCMinutes: return "setUTCMinutes"; case Id_setHours: return "setHours"; case Id_setUTCHours: return "setUTCHours"; case Id_setDate: return "setDate"; case Id_setUTCDate: return "setUTCDate"; case Id_setMonth: return "setMonth"; case Id_setUTCMonth: return "setUTCMonth"; case Id_setFullYear: return "setFullYear"; case Id_setUTCFullYear: return "setUTCFullYear"; case Id_setYear: return "setYear"; } return null; } | 51996 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51996/35caf7c2bb93872680ae16e34746d94fe1e533e3/NativeDate.java/clean/js/rhino/src/org/mozilla/javascript/NativeDate.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
514,
2634,
461,
12,
474,
612,
13,
288,
3639,
1620,
261,
350,
13,
288,
3639,
648,
11417,
548,
67,
11471,
30,
377,
327,
315,
11471,
14432,
3639,
648,
11417,
548,
67,
2670,
30,
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,
377,
4750,
514,
2634,
461,
12,
474,
612,
13,
288,
3639,
1620,
261,
350,
13,
288,
3639,
648,
11417,
548,
67,
11471,
30,
377,
327,
315,
11471,
14432,
3639,
648,
11417,
548,
67,
2670,
30,
282,
... |
ProjectHelper.addFrameworkListToClasspathEntries( pbProject.getFrameworks(), newJavaProject); | wolipsJavaProject .getClasspathAccessor() .addFrameworkListToClasspathEntries( pbProject.getFrameworks()); | private void addAdditionalFrameworks( IProgressMonitor monitor, File additionalResourceDir) { File projectFile = new File(additionalResourceDir, PROJECT_FILE_NAME); if (this.parentResource instanceof IProject && projectFile.exists() && !projectFile.isDirectory()) { boolean isFramework = EXT_FRAMEWORK.equals(this.parentResource.getFileExtension()); // try to add frameworks from project file PBProject pbProject; try { pbProject = new PBProject(projectFile, isFramework); } catch (IOException e) { WOLipsLog.log(e); return; } IJavaProject newJavaProject = JavaCore.create((IProject) parentResource); try { IClasspathEntry[] newClasspathEntries = ProjectHelper.addFrameworkListToClasspathEntries( pbProject.getFrameworks(), newJavaProject); newJavaProject.setRawClasspath(newClasspathEntries, monitor); } catch (JavaModelException e) { WOLipsLog.log(e); } } } | 47899 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47899/ca3f25bc75f304401b8e6187ffe71a9f580ec836/WOProjectCreator.java/clean/projects/wolips/plugins/org.objectstyle.wolips.wizards/java/org/objectstyle/wolips/wizards/WOProjectCreator.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
527,
10552,
13701,
87,
12,
202,
202,
45,
5491,
7187,
6438,
16,
202,
202,
812,
3312,
1420,
1621,
13,
288,
202,
202,
812,
1984,
812,
273,
394,
1387,
12,
13996,
1420,
1621,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
527,
10552,
13701,
87,
12,
202,
202,
45,
5491,
7187,
6438,
16,
202,
202,
812,
3312,
1420,
1621,
13,
288,
202,
202,
812,
1984,
812,
273,
394,
1387,
12,
13996,
1420,
1621,... |
String tmp=Strings.join("/", fullRootPath, RESOURCES_PATH_PREFIX); if (url.startsWith(Strings.join("/", fullRootPath, RESOURCES_PATH_PREFIX))) | String tmp = Strings.join("/", fullRootPath, RESOURCES_PATH_PREFIX); if (url.startsWith(tmp)) | private boolean isWicketRequest(HttpServletRequest request) { String fullRootPath = getRootPath(request); String url = request.getRequestURI(); // Homepage if (Strings.isEmpty(request.getQueryString()) && url.equals(fullRootPath)) { return true; } // SharedResources String tmp=Strings.join("/", fullRootPath, RESOURCES_PATH_PREFIX); if (url.startsWith(Strings.join("/", fullRootPath, RESOURCES_PATH_PREFIX))) { return true; } // Url with wicket namespace in one of the params. Enumeration enumeration = request.getParameterNames(); while (enumeration.hasMoreElements()) { String name = (String)enumeration.nextElement(); if (name.startsWith(WebRequestCodingStrategy.NAME_SPACE)) { return true; } } // Mount url String path = url.substring(fullRootPath.length()); return webApplication.getRequestCycleProcessor().getRequestCodingStrategy() .urlCodingStrategyForPath(path) != null; } | 46434 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46434/d9968907909564821c5daccb6f9339f06d369f69/WicketFilter.java/clean/wicket/src/java/wicket/protocol/http/WicketFilter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
1250,
353,
59,
29378,
691,
12,
2940,
18572,
590,
13,
202,
95,
202,
202,
780,
1983,
21302,
273,
18863,
12,
2293,
1769,
202,
202,
780,
880,
273,
590,
18,
588,
691,
3098,
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,
225,
202,
1152,
1250,
353,
59,
29378,
691,
12,
2940,
18572,
590,
13,
202,
95,
202,
202,
780,
1983,
21302,
273,
18863,
12,
2293,
1769,
202,
202,
780,
880,
273,
590,
18,
588,
691,
3098,
5621,
... |
if(v == null) { | if (v == null) { | void runToCursor(String fileName, int lineNumber, ActionEvent evt) { Vector v = (Vector) sourceNames.get(fileName); if(v == null) { System.out.println("debugger error: Couldn't find source: " + fileName); } int i; SourceEntry se = null; for (i = v.size() -1; i >= 0; i--) { se = (SourceEntry) v.elementAt(i); if (se.fnOrScript.removeBreakpoint(lineNumber)) { se.fnOrScript.placeBreakpoint(lineNumber); break; } else if(se.fnOrScript.placeBreakpoint(lineNumber)) { se.fnOrScript.removeBreakpoint(lineNumber); break; } } if(i >= 0) { runToCursorFile = fileName; runToCursorLine = lineNumber; actionPerformed(evt); } } | 19042 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/19042/bebd557da53b74c60ab8525aa96904d4cee6224c/Main.java/buggy/toolsrc/org/mozilla/javascript/tools/debugger/Main.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
918,
1086,
774,
6688,
12,
780,
3968,
16,
5397,
509,
13629,
16,
5397,
19641,
6324,
13,
288,
3639,
5589,
331,
273,
261,
5018,
13,
1084,
1557,
18,
588,
12,
17812,
1769,
3639,
309,
261,
90,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
918,
1086,
774,
6688,
12,
780,
3968,
16,
5397,
509,
13629,
16,
5397,
19641,
6324,
13,
288,
3639,
5589,
331,
273,
261,
5018,
13,
1084,
1557,
18,
588,
12,
17812,
1769,
3639,
309,
261,
90,... |
length = (int) Context.toNumber(p.get("length", p)); | length = (int) Context.toNumber(getProperty(p, "length")); | public static Class createAdapterClass(Context cx, Scriptable jsObj, String adapterName, Class superClass, Class[] interfaces, String scriptClassName, ClassNameHelper nameHelper) throws ClassNotFoundException { ClassFileWriter cfw = new ClassFileWriter(adapterName, superClass.getName(), "<adapter>"); cfw.addField("self", "Lorg/mozilla/javascript/Scriptable;", (short) (ClassFileWriter.ACC_PUBLIC | ClassFileWriter.ACC_FINAL)); int interfacesCount = interfaces == null ? 0 : interfaces.length; for (int i=0; i < interfacesCount; i++) { if (interfaces[i] != null) cfw.addInterface(interfaces[i].getName()); } String superName = superClass.getName().replace('.', '/'); generateCtor(cfw, adapterName, superName); if (scriptClassName != null) generateEmptyCtor(cfw, adapterName, superName, scriptClassName); Hashtable generatedOverrides = new Hashtable(); Hashtable generatedMethods = new Hashtable(); // generate methods to satisfy all specified interfaces. for (int i = 0; i < interfacesCount; i++) { Method[] methods = interfaces[i].getMethods(); for (int j = 0; j < methods.length; j++) { Method method = methods[j]; int mods = method.getModifiers(); if (Modifier.isStatic(mods) || Modifier.isFinal(mods)) continue; // make sure to generate only one instance of a particular // method/signature. String methodName = method.getName(); String methodKey = methodName + getMethodSignature(method); if (! generatedOverrides.containsKey(methodKey)) { generateMethod(cfw, adapterName, methodName, method.getParameterTypes(), method.getReturnType()); generatedOverrides.put(methodKey, methodKey); generatedMethods.put(methodName, Boolean.TRUE); } } } // Now, go through the superclasses methods, checking for abstract // methods or additional methods to override. // generate any additional overrides that the object might contain. Method[] methods = superClass.getMethods(); for (int j = 0; j < methods.length; j++) { Method method = methods[j]; int mods = method.getModifiers(); if (Modifier.isStatic(mods) || Modifier.isFinal(mods)) continue; // if a method is marked abstract, must implement it or the // resulting class won't be instantiable. otherwise, if the object // has a property of the same name, then an override is intended. boolean isAbstractMethod = Modifier.isAbstract(mods); if (isAbstractMethod || (jsObj != null && jsObj.has(method.getName(), jsObj))) { // make sure to generate only one instance of a particular // method/signature. String methodName = method.getName(); String methodSignature = getMethodSignature(method); String methodKey = methodName + methodSignature; if (! generatedOverrides.containsKey(methodKey)) { generateMethod(cfw, adapterName, methodName, method.getParameterTypes(), method.getReturnType()); generatedOverrides.put(methodKey, method); generatedMethods.put(methodName, Boolean.TRUE); } // if a method was overridden, generate a "super$method" // which lets the delegate call the superclass' version. if (!isAbstractMethod) { generateSuper(cfw, adapterName, superName, methodName, methodSignature, method.getParameterTypes(), method.getReturnType()); } } } // Generate Java methods, fields for remaining properties that // are not overrides. Object[] ids = jsObj.getIds(); for (int j=0; j < ids.length; j++) { if (!(ids[j] instanceof String)) continue; String id = (String) ids[j]; if (generatedMethods.containsKey(id)) continue; Object f = jsObj.get(id, jsObj); int length; if (f instanceof Scriptable) { Scriptable p = (Scriptable) f; if (!(p instanceof Function)) continue; length = (int) Context.toNumber(p.get("length", p)); } else if (f instanceof FunctionNode) { length = ((FunctionNode) f).getVariableTable().getParameterCount(); } else { continue; } Class[] parms = new Class[length]; for (int k=0; k < length; k++) parms[k] = Object.class; generateMethod(cfw, adapterName, id, parms, Object.class); } ByteArrayOutputStream out = new ByteArrayOutputStream(512); try { cfw.write(out); } catch (IOException ioe) { throw new RuntimeException("unexpected IOException"); } byte[] bytes = out.toByteArray(); if (nameHelper != null && nameHelper.getGeneratingDirectory() != null) { try { int lastDot = adapterName.lastIndexOf('.'); if (lastDot != -1) adapterName = adapterName.substring(lastDot+1); String filename = nameHelper.getTargetClassFileName(adapterName); FileOutputStream file = new FileOutputStream(filename); file.write(bytes); file.close(); } catch (IOException iox) { throw WrappedException.wrapException(iox); } return null; } SecuritySupport ss = cx.getSecuritySupport(); if (ss != null) { Object securityDomain = cx.getSecurityDomainForStackDepth(-1); return ss.defineClass(adapterName, bytes, securityDomain); } else { classLoader.defineClass(adapterName, bytes); return classLoader.loadClass(adapterName, true); } } | 13991 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/13991/9675752f93681c12d34768399e8d54cd7efe94e9/JavaAdapter.java/buggy/js/rhino/org/mozilla/javascript/JavaAdapter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
1659,
752,
4216,
797,
12,
1042,
9494,
16,
22780,
3828,
2675,
16,
4766,
6647,
514,
4516,
461,
16,
1659,
18846,
16,
4766,
5411,
1659,
8526,
7349,
16,
4766,
5411,
514,
2728,
3834,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1659,
752,
4216,
797,
12,
1042,
9494,
16,
22780,
3828,
2675,
16,
4766,
6647,
514,
4516,
461,
16,
1659,
18846,
16,
4766,
5411,
1659,
8526,
7349,
16,
4766,
5411,
514,
2728,
3834,... |
SanityManager.ASSERT(cursorTargetTableName!=null); | SanityManager.ASSERT(cursorTargetTableName != null); } if (targetTable instanceof FromVTI) { targetVTI = (FromVTI) targetTable; targetVTI.setTarget(); } else { if (targetTableName == null) { if (SanityManager.DEBUG) SanityManager.ASSERT(cursorTargetTableName!=null); | public QueryTreeNode bind() throws StandardException { FromList fromList = (FromList) getNodeFactory().getNode( C_NodeTypes.FROM_LIST, getNodeFactory().doJoinOrderOptimization(), getContextManager()); ResultColumn rowLocationColumn = null; CurrentRowLocationNode rowLocationNode; TableName cursorTargetTableName = null; CurrentOfNode currentOfNode = null; DataDictionary dataDictionary = getDataDictionary(); super.bindTables(dataDictionary); // wait to bind named target table until the underlying // cursor is bound, so that we can get it from the // cursor if this is a positioned delete. // for positioned delete, get the cursor's target table. if (SanityManager.DEBUG) SanityManager.ASSERT(resultSet != null && resultSet instanceof SelectNode, "Delete must have a select result set"); SelectNode sel; sel = (SelectNode)resultSet; targetTable = (FromTable) sel.fromList.elementAt(0); if (targetTable instanceof CurrentOfNode) { currentOfNode = (CurrentOfNode) targetTable; cursorTargetTableName = currentOfNode.getBaseCursorTargetTableName(); // instead of an assert, we might say the cursor is not updatable. if (SanityManager.DEBUG) SanityManager.ASSERT(cursorTargetTableName != null); } if (targetTable instanceof FromVTI) { targetVTI = (FromVTI) targetTable; targetVTI.setTarget(); } else { // positioned delete can leave off the target table. // we get it from the cursor supplying the position. if (targetTableName == null) { // verify we have current of if (SanityManager.DEBUG) SanityManager.ASSERT(cursorTargetTableName!=null); targetTableName = cursorTargetTableName; } // for positioned delete, we need to verify that // the named table is the same as the cursor's target (base table name). else if (cursorTargetTableName != null) { // this match requires that the named table in the delete // be the same as a base name in the cursor. if ( !targetTableName.equals(cursorTargetTableName)) { throw StandardException.newException(SQLState.LANG_CURSOR_DELETE_MISMATCH, targetTableName, currentOfNode.getCursorName()); } } } // descriptor must exist, tables already bound. verifyTargetTable(); /* Generate a select list for the ResultSetNode - CurrentRowLocation(). */ if (SanityManager.DEBUG) SanityManager.ASSERT((resultSet.resultColumns == null), "resultColumns is expected to be null until bind time"); if (targetTable instanceof FromVTI) { getResultColumnList(); resultColumnList = targetTable.getResultColumnsForList(null, resultColumnList, null); /* Set the new result column list in the result set */ resultSet.setResultColumns(resultColumnList); } else { /* ** Start off assuming no columns from the base table ** are needed in the rcl. */ resultColumnList = new ResultColumnList(); FromBaseTable fbt = getResultColumnList(resultColumnList); readColsBitSet = getReadMap(dataDictionary, targetTableDescriptor); resultColumnList = fbt.addColsToList(resultColumnList, readColsBitSet); /* ** If all bits are set, then behave as if we chose all ** in the first place */ int i = 1; int size = targetTableDescriptor.getMaxColumnID(); for (; i <= size; i++) { if (!readColsBitSet.get(i)) { break; } } if (i > size) { readColsBitSet = null; } /* ** Construct an empty heap row for use in our constant action. */ emptyHeapRow = targetTableDescriptor.getEmptyExecRow(getContextManager()); /* Generate the RowLocation column */ rowLocationNode = (CurrentRowLocationNode) getNodeFactory().getNode( C_NodeTypes.CURRENT_ROW_LOCATION_NODE, getContextManager()); rowLocationColumn = (ResultColumn) getNodeFactory().getNode( C_NodeTypes.RESULT_COLUMN, COLUMNNAME, rowLocationNode, getContextManager()); rowLocationColumn.markGenerated(); /* Append to the ResultColumnList */ resultColumnList.addResultColumn(rowLocationColumn); /* Force the added columns to take on the table's correlation name, if any */ correlateAddedColumns( resultColumnList, targetTable ); /* Set the new result column list in the result set */ resultSet.setResultColumns(resultColumnList); } /* Bind the expressions before the ResultColumns are bound */ super.bindExpressions(); /* Bind untyped nulls directly under the result columns */ resultSet. getResultColumns(). bindUntypedNullsToResultColumns(resultColumnList); if (! (targetTable instanceof FromVTI)) { /* Bind the new ResultColumn */ rowLocationColumn.bindResultColumnToExpression(); bindConstraints(dataDictionary, getNodeFactory(), targetTableDescriptor, null, resultColumnList, (int[]) null, readColsBitSet, false, true); /* we alway include triggers in core language */ /* If the target table is also a source table, then * the delete will have to be in deferred mode * For deletes, this means that the target table appears in a * subquery. Also, self-referencing foreign key deletes * are deferred. And triggers cause the delete to be deferred. */ if (resultSet.subqueryReferencesTarget( targetTableDescriptor.getName(), true) || requiresDeferredProcessing()) { deferred = true; } } else { deferred = VTIDeferModPolicy.deferIt( DeferModification.DELETE_STATEMENT, targetVTI, null, sel.getWhereClause()); } sel = null; // done with sel /* Verify that all underlying ResultSets reclaimed their FromList */ if (SanityManager.DEBUG) { SanityManager.ASSERT(fromList.size() == 0, "fromList.size() is expected to be 0, not " + fromList.size() + " on return from RS.bindExpressions()"); } //In case of cascade delete , create nodes for //the ref action dependent tables and bind them. if(fkTableNames != null) { String currentTargetTableName = targetTableDescriptor.getSchemaName() + "." + targetTableDescriptor.getName(); if(!isDependentTable){ //graph node graphHashTable = new Hashtable(); } /*Check whether the current tatget is already been explored. *If we are seeing the same table name which we binded earlier *means we have cyclic references. */ if(!graphHashTable.containsKey(currentTargetTableName)) { cascadeDelete = true; int noDependents = fkTableNames.length; dependentNodes = new QueryTreeNode[noDependents]; graphHashTable.put(currentTargetTableName, new Integer(noDependents)); for(int i =0 ; i < noDependents ; i ++) { dependentNodes[i] = getDependentTableNode(fkTableNames[i], fkRefActions[i], fkColDescriptors[i]); dependentNodes[i].bind(); } } }else { //case where current dependent table does not have dependent tables if(isDependentTable) { String currentTargetTableName = targetTableDescriptor.getSchemaName() + "." + targetTableDescriptor.getName(); graphHashTable.put(currentTargetTableName, new Integer(0)); } } return this; } // end of bind | 56322 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56322/c45f5b1e96f1b68b99f5b8346614c813fd03aa09/DeleteNode.java/buggy/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
2770,
12513,
1993,
1435,
1216,
8263,
503,
202,
95,
202,
202,
1265,
682,
6862,
202,
2080,
682,
273,
6862,
9506,
202,
12,
1265,
682,
13,
5973,
1733,
7675,
588,
907,
12,
6862,
68... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2770,
12513,
1993,
1435,
1216,
8263,
503,
202,
95,
202,
202,
1265,
682,
6862,
202,
2080,
682,
273,
6862,
9506,
202,
12,
1265,
682,
13,
5973,
1733,
7675,
588,
907,
12,
6862,
68... |
return c == 0x20 || c == 0x08; | return c == ' ' || c == '\t'; | private static boolean isspace(int c) { return c == 0x20 || c == 0x08; } | 47685 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47685/0f2e038bfc9670d8549f83846c5da2c90f252b41/Syntax.java/clean/code/Syntax.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
760,
1250,
353,
2981,
12,
474,
276,
13,
288,
565,
327,
276,
422,
296,
296,
747,
276,
422,
2337,
88,
13506,
225,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
760,
1250,
353,
2981,
12,
474,
276,
13,
288,
565,
327,
276,
422,
296,
296,
747,
276,
422,
2337,
88,
13506,
225,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
public static void addDragListener(Control control, Listener dragListener) { | public static void addDragListener(Control control, Listener externalDragListener) { | public static void addDragListener(Control control, Listener dragListener) { control.addListener(SWT.DragDetect, dragListener); control.addListener(SWT.MouseUp, clickListener); control.addListener(SWT.MouseDoubleClick, clickListener); control.addListener(SWT.MouseDown, mouseDownListener); control.addListener(SWT.MouseMove, moveListener); control.setData(LISTENER_ID, dragListener); } | 56152 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56152/0e077b4f362e0e5a3f190b294dd9c5251371667a/PresentationUtil.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/presentations/PresentationUtil.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
760,
918,
527,
11728,
2223,
12,
3367,
3325,
16,
10652,
8823,
2223,
13,
288,
202,
202,
7098,
18,
1289,
2223,
12,
55,
8588,
18,
11728,
12081,
16,
8823,
2223,
1769,
202,
202,
709... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
760,
918,
527,
11728,
2223,
12,
3367,
3325,
16,
10652,
8823,
2223,
13,
288,
202,
202,
7098,
18,
1289,
2223,
12,
55,
8588,
18,
11728,
12081,
16,
8823,
2223,
1769,
202,
202,
709... |
Object mutex=new Object(); synchronized(mutex) { try { mutex.wait(); } catch(InterruptedException ex) { System.err.println("InterruptTest.SleeperThread.runWait(): " + ex); } } } | Object mutex=new Object(); synchronized(mutex) { try { mutex.wait(); } catch(InterruptedException ex) { System.err.println("InterruptTest.SleeperThread.runWait(): " + ex); } } } | void runWait() { Object mutex=new Object(); synchronized(mutex) { try { mutex.wait(); } catch(InterruptedException ex) { System.err.println("InterruptTest.SleeperThread.runWait(): " + ex); } } } | 51463 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51463/dd6282cd73f50a476093653aab3a8de52fc1c5c4/InterruptTest.java/clean/tests/junit/org/jgroups/tests/InterruptTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
6459,
1086,
5480,
1435,
288,
202,
565,
1033,
9020,
33,
2704,
1033,
5621,
202,
565,
3852,
12,
29946,
13,
288,
202,
202,
698,
288,
1082,
565,
9020,
18,
7048,
5621,
202,
202,
97,
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,
6459,
1086,
5480,
1435,
288,
202,
565,
1033,
9020,
33,
2704,
1033,
5621,
202,
565,
3852,
12,
29946,
13,
288,
202,
202,
698,
288,
1082,
565,
9020,
18,
7048,
5621,
202,
202,
97,
202,... |
GridData estimatedSpinnerGridData = new org.eclipse.swt.layout.GridData(); | GridData estimatedSpinnerGridData = new GridData(); | private void createPlanningSection(Composite parent, FormToolkit toolkit) { Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR); section.setText("Planning"); section.setLayout(new TableWrapLayout()); section.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); section.addExpansionListener(new IExpansionListener() { public void expansionStateChanging(ExpansionEvent e) { form.reflow(true); } public void expansionStateChanged(ExpansionEvent e) { form.reflow(true); } }); Composite container = toolkit.createComposite(section); section.setClient(container); TableWrapLayout layout = new TableWrapLayout(); layout.numColumns = 3; container.setLayout(layout); Label label = toolkit.createLabel(container, "Reminder:"); label.setForeground(toolkit.getColors().getColor(FormColors.TITLE)); datePicker = new DatePicker(container, SWT.NULL); Calendar calendar = Calendar.getInstance(); if (task.getReminderDate() != null) { calendar.setTime(task.getReminderDate()); datePicker.setDate(calendar); } datePicker.setBackground(new Color(Display.getDefault(), 255, 255, 255)); datePicker.addPickerSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent arg0) { TaskInfoEditor.this.markDirty(true); } public void widgetDefaultSelected(SelectionEvent arg0) { // ignore } }); label = toolkit.createLabel(container, " "); label.setForeground(toolkit.getColors().getColor(FormColors.TITLE)); label = toolkit.createLabel(container, "Estimated time:"); label.setForeground(toolkit.getColors().getColor(FormColors.TITLE)); Composite estimatedComposite = toolkit.createComposite(container); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; gridLayout.horizontalSpacing = 2; gridLayout.verticalSpacing = 2; gridLayout.marginWidth = 0; gridLayout.marginHeight = 2; gridLayout.makeColumnsEqualWidth = false; estimatedComposite.setLayout(gridLayout); estimated = new Spinner(estimatedComposite, SWT.BORDER); estimated.setSelection(task.getEstimateTimeHours()); estimated.setDigits(0); estimated.setMaximum(100); estimated.setMinimum(0); estimated.setIncrement(1); estimated.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { TaskInfoEditor.this.markDirty(true); } }); GridData estimatedSpinnerGridData = new org.eclipse.swt.layout.GridData(); estimatedSpinnerGridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL; estimatedSpinnerGridData.grabExcessHorizontalSpace = true; estimatedSpinnerGridData.verticalAlignment = org.eclipse.swt.layout.GridData.FILL; estimated.setData(estimatedSpinnerGridData); label = toolkit.createLabel(estimatedComposite, "hours "); label.setForeground(toolkit.getColors().getColor(FormColors.TITLE)); GridData hoursLabelGridData = new org.eclipse.swt.layout.GridData(); hoursLabelGridData.horizontalAlignment = org.eclipse.swt.layout.GridData.END; hoursLabelGridData.verticalAlignment = org.eclipse.swt.layout.GridData.FILL; label.setData(hoursLabelGridData); // Temp hack because couldn't get the estimatedComposite above to span // two columns label = toolkit.createLabel(container, " "); label = toolkit.createLabel(container, "Elapsed time:"); label.setForeground(toolkit.getColors().getColor(FormColors.TITLE)); String reminderDateString = ""; try { if (task.getReminderDate() != null) { reminderDateString = DateFormat.getDateInstance(DateFormat.SHORT).format(task.getReminderDate()); } } catch (RuntimeException e) { MylarPlugin.fail(e, "Could not format reminder date", true); } Text text2 = toolkit.createText(container, reminderDateString, SWT.BORDER); TableWrapData td = new TableWrapData(TableWrapData.FILL_GRAB); td.grabHorizontal = true; td.colspan = 2; text2.setLayoutData(td); text2.setEditable(false); text2.setEnabled(false); label = toolkit.createLabel(container, "Creation date:"); label.setForeground(toolkit.getColors().getColor(FormColors.TITLE)); String creationDateString = ""; try { creationDateString = DateFormat.getDateInstance(DateFormat.LONG).format(task.getCreationDate()); } catch (RuntimeException e) { MylarPlugin.fail(e, "Could not format creation date", true); } Text creationDate = toolkit.createText(container, creationDateString, SWT.BORDER); td = new TableWrapData(TableWrapData.FILL_GRAB); td.grabHorizontal = true; td.colspan = 2; creationDate.setLayoutData(td); creationDate.setEditable(false); creationDate.setEnabled(false); label = toolkit.createLabel(container, "Completion date:"); label.setForeground(toolkit.getColors().getColor(FormColors.TITLE)); String completionDateString = ""; if (task.getCompletionDate() != null) { try { completionDateString = DateFormat.getDateInstance(DateFormat.LONG).format(task.getCompletionDate()); } catch (RuntimeException e) { MylarPlugin.fail(e, "Could not format date", true); } } Text endDate = toolkit.createText(container, completionDateString, SWT.BORDER); td = new TableWrapData(TableWrapData.FILL_GRAB); td.grabHorizontal = true; td.colspan = 2; endDate.setLayoutData(td); endDate.setEditable(false); endDate.setEnabled(false); } | 51989 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51989/5816fd0cd1ac9fca2315d48f417d09db234132b4/TaskInfoEditor.java/clean/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskInfoEditor.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
752,
1749,
10903,
5285,
12,
9400,
982,
16,
2748,
6364,
8691,
5226,
8691,
13,
288,
202,
202,
5285,
2442,
273,
5226,
8691,
18,
2640,
5285,
12,
2938,
16,
16429,
429,
9400,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
752,
1749,
10903,
5285,
12,
9400,
982,
16,
2748,
6364,
8691,
5226,
8691,
13,
288,
202,
202,
5285,
2442,
273,
5226,
8691,
18,
2640,
5285,
12,
2938,
16,
16429,
429,
9400,
... |
stringBuffer.append(TEXT_418); | stringBuffer.append(TEXT_420); | public String generate(Object argument) { final StringBuffer stringBuffer = new StringBuffer(); final GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];final GenEditorGenerator editorGen = genDiagram.getEditorGen();final GenModel genModel = editorGen.getDomainGenModel();final String pluginActivatorClass = importManager.getImportedName(editorGen.getPlugin().getActivatorQualifiedClassName());final boolean isRichClientPlatform = genDiagram.getEditorGen().getDomainGenModel().isRichClientPlatform(); stringBuffer.append(TEXT_1); String copyrightText = genDiagram.getEditorGen().getCopyrightText();if (copyrightText != null && copyrightText.trim().length() > 0) { stringBuffer.append(TEXT_2); stringBuffer.append(copyrightText.replaceAll("\n", "\n * ")); stringBuffer.append(TEXT_3); } importManager.emitPackageStatement(stringBuffer);importManager.markImportLocation(stringBuffer);importManager.registerInnerClass("RootElementSelectorPage");if (isRichClientPlatform) { importManager.registerInnerClass("URISelectorPage"); importManager.registerInnerClass("SourceURISelectorPage"); importManager.registerInnerClass("DiagramURISelectorPage");} stringBuffer.append(TEXT_4); class FeatureGetAccessorHelper { /** * @param containerName the name of the container * @param feature the feature whose value is in interest * @param containerMetaClass the <code>GenClass</code> of the container, or <code>null</code>, if the container is declared as an <code>EObject</code>. * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the <code>EClass</code> this feature belongs to is an external interface). */ public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) { if (feature.getGenClass().isExternalInterface()) { boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface(); if (needsCastToResultType) { stringBuffer.append(TEXT_5); stringBuffer.append(importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_6); } if (needsCastToEObject) { stringBuffer.append(TEXT_7); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_8); } stringBuffer.append(containerName); if (needsCastToEObject) { stringBuffer.append(TEXT_9); } stringBuffer.append(TEXT_10); stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_11); stringBuffer.append(feature.getFeatureAccessorName()); stringBuffer.append(TEXT_12); if (needsCastToResultType) { stringBuffer.append(TEXT_13); } } else { boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface(); if (needsCastToFeatureGenType) { stringBuffer.append(TEXT_14); stringBuffer.append(importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_15); } stringBuffer.append(containerName); if (needsCastToFeatureGenType) { stringBuffer.append(TEXT_16); } stringBuffer.append(TEXT_17); stringBuffer.append(feature.getGetAccessor()); stringBuffer.append(TEXT_18); } }}final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper(); stringBuffer.append(TEXT_19); stringBuffer.append(genDiagram.getNewDiagramFileWizardClassName()); stringBuffer.append(TEXT_20); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.Wizard")); stringBuffer.append(TEXT_21); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_22); if (isRichClientPlatform) { stringBuffer.append(TEXT_23); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_24); } else { stringBuffer.append(TEXT_25); stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IFile")); stringBuffer.append(TEXT_26); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.dialogs.WizardNewFileCreationPage")); stringBuffer.append(TEXT_27); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchPage")); stringBuffer.append(TEXT_28); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection")); stringBuffer.append(TEXT_29); } stringBuffer.append(TEXT_30); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_31); if (isRichClientPlatform) { stringBuffer.append(TEXT_32); stringBuffer.append(genDiagram.getNewDiagramFileWizardClassName()); stringBuffer.append(TEXT_33); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_34); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_35); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_36); } else { stringBuffer.append(TEXT_37); stringBuffer.append(genDiagram.getNewDiagramFileWizardClassName()); stringBuffer.append(TEXT_38); stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IFile")); stringBuffer.append(TEXT_39); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchPage")); stringBuffer.append(TEXT_40); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection")); stringBuffer.append(TEXT_41); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_42); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_43); stringBuffer.append(genDiagram.getNewDiagramFileWizardClassName()); stringBuffer.append(TEXT_44); stringBuffer.append(genDiagram.getNewDiagramFileWizardClassName()); stringBuffer.append(TEXT_45); stringBuffer.append(genDiagram.getNewDiagramFileWizardClassName()); stringBuffer.append(TEXT_46); stringBuffer.append(genDiagram.getNewDiagramFileWizardClassName()); stringBuffer.append(TEXT_47); } stringBuffer.append(TEXT_48); stringBuffer.append(genDiagram.getNewDiagramFileWizardClassName()); stringBuffer.append(TEXT_49); if (isRichClientPlatform) { stringBuffer.append(TEXT_50); } else { stringBuffer.append(TEXT_51); } stringBuffer.append(TEXT_52); if (isRichClientPlatform) { stringBuffer.append(TEXT_53); } else { stringBuffer.append(TEXT_54); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.dialogs.WizardNewFileCreationPage")); stringBuffer.append(TEXT_55); stringBuffer.append(genModel.getModelName()); stringBuffer.append(TEXT_56); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); stringBuffer.append(TEXT_57); stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IContainer")); stringBuffer.append(TEXT_58); stringBuffer.append(editorGen.getDiagramFileExtension()); stringBuffer.append(TEXT_59); stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.Path")); stringBuffer.append(TEXT_60); stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.Path")); stringBuffer.append(TEXT_61); stringBuffer.append(genModel.getModelName()); stringBuffer.append(TEXT_62); } stringBuffer.append(TEXT_63); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.ResourceSet")); stringBuffer.append(TEXT_64); if (isRichClientPlatform) { stringBuffer.append(TEXT_65); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_66); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")); stringBuffer.append(TEXT_67); } else { stringBuffer.append(TEXT_68); stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IFile")); stringBuffer.append(TEXT_69); stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.NullProgressMonitor")); stringBuffer.append(TEXT_70); stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.CoreException")); stringBuffer.append(TEXT_71); stringBuffer.append(pluginActivatorClass); stringBuffer.append(TEXT_72); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")); stringBuffer.append(TEXT_73); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_74); } stringBuffer.append(TEXT_75); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); stringBuffer.append(TEXT_76); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); stringBuffer.append(TEXT_77); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); stringBuffer.append(TEXT_78); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); stringBuffer.append(TEXT_79); stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_80); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); stringBuffer.append(TEXT_81); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoryQualifiedClassName())); stringBuffer.append(TEXT_82); if (editorGen.isSameFileForDiagramAndModel()) { stringBuffer.append(TEXT_83); } stringBuffer.append(TEXT_84); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); stringBuffer.append(TEXT_85); stringBuffer.append(importManager.getImportedName("java.util.Collections")); stringBuffer.append(TEXT_86); if (isRichClientPlatform) { stringBuffer.append(TEXT_87); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorPart")); stringBuffer.append(TEXT_88); stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())); stringBuffer.append(TEXT_89); } else { stringBuffer.append(TEXT_90); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorPart")); stringBuffer.append(TEXT_91); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.ide.IDE")); stringBuffer.append(TEXT_92); } stringBuffer.append(TEXT_93); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter")); stringBuffer.append(TEXT_94); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter")); stringBuffer.append(TEXT_95); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter")); stringBuffer.append(TEXT_96); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer")); stringBuffer.append(TEXT_97); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer")); stringBuffer.append(TEXT_98); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer")); stringBuffer.append(TEXT_99); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_100); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); stringBuffer.append(TEXT_101); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); stringBuffer.append(TEXT_102); stringBuffer.append(importManager.getImportedName("java.io.IOException")); stringBuffer.append(TEXT_103); if (isRichClientPlatform) { stringBuffer.append(TEXT_104); stringBuffer.append(pluginActivatorClass); stringBuffer.append(TEXT_105); } else { stringBuffer.append(TEXT_106); stringBuffer.append(pluginActivatorClass); stringBuffer.append(TEXT_107); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException")); stringBuffer.append(TEXT_108); stringBuffer.append(pluginActivatorClass); stringBuffer.append(TEXT_109); } stringBuffer.append(TEXT_110); stringBuffer.append(TEXT_111); stringBuffer.append(TEXT_112); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); stringBuffer.append(TEXT_113); stringBuffer.append(genDiagram.getUniqueIdentifier()); stringBuffer.append(TEXT_114); if(!genDiagram.getLinks().isEmpty()) { stringBuffer.append(TEXT_115); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.NaiveViewService")); stringBuffer.append(TEXT_116); stringBuffer.append(genDiagram.getUniqueIdentifier()); stringBuffer.append(TEXT_117); } stringBuffer.append(TEXT_118); final Comparator<GenContainerBase> comparator = new Comparator<GenContainerBase>() { public int compare(GenContainerBase o1, GenContainerBase o2) { return o1.getVisualID() - o2.getVisualID(); }};TreeSet<GenContainerBase> containers2Generate = new TreeSet<GenContainerBase>(comparator);for (Iterator containers = genDiagram.getAllContainers().iterator(); containers.hasNext();) { GenContainerBase nextContainer = (GenContainerBase) containers.next(); if (!nextContainer.getContainedNodes().isEmpty()) { containers2Generate.add(nextContainer); continue; } if (nextContainer instanceof GenDiagram) { containers2Generate.add(nextContainer); continue; } if (nextContainer instanceof GenNode) { //May need to generate if contains compartments with children for(Iterator compartments = ((GenNode) nextContainer).getCompartments().iterator(); compartments.hasNext(); ) { GenCompartment nextCompartment = (GenCompartment) compartments.next(); if (!nextCompartment.getContainedNodes().isEmpty()) { containers2Generate.add(nextContainer); break; } } }}for (Iterator<GenContainerBase> containers = containers2Generate.iterator(); containers.hasNext();) { GenContainerBase nextContainer = containers.next(); stringBuffer.append(TEXT_119); stringBuffer.append(nextContainer.getUniqueIdentifier()); stringBuffer.append(TEXT_120); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_121); if (nextContainer instanceof GenNode) { boolean shouldIterateOverCompartments = false; for(Iterator compartments = ((GenNode) nextContainer).getCompartments().iterator(); compartments.hasNext(); ) { GenCompartment nextCompartment = (GenCompartment) compartments.next(); if (!nextCompartment.getContainedNodes().isEmpty()) { shouldIterateOverCompartments = true; break; } } if (shouldIterateOverCompartments) { stringBuffer.append(TEXT_122); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_123); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_124); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_125); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); stringBuffer.append(TEXT_126); for(Iterator compartments = ((GenNode) nextContainer).getCompartments().iterator(); compartments.hasNext(); ) { GenCompartment nextCompartment = (GenCompartment) compartments.next(); if (nextCompartment.getContainedNodes().isEmpty()) { continue; } stringBuffer.append(TEXT_127); stringBuffer.append(importManager.getImportedName(nextCompartment.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_128); stringBuffer.append(nextCompartment.getUniqueIdentifier()); stringBuffer.append(TEXT_129); } stringBuffer.append(TEXT_130); } } stringBuffer.append(TEXT_131); stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_132); stringBuffer.append(nextContainer.getUniqueIdentifier()); stringBuffer.append(TEXT_133); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_134); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")); stringBuffer.append(TEXT_135); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")); stringBuffer.append(TEXT_136); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand")); stringBuffer.append(TEXT_137); stringBuffer.append(nextContainer.getUniqueIdentifier()); stringBuffer.append(TEXT_138); boolean shouldIterateToGenerate = false; for(Iterator containedNodes = nextContainer.getContainedNodes().iterator(); containedNodes.hasNext(); ) { GenNode nextNode = (GenNode) containedNodes.next(); if (containers2Generate.contains(nextNode)) { shouldIterateToGenerate = true; break; } } if (shouldIterateToGenerate) { stringBuffer.append(TEXT_139); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_140); for(Iterator containedNodes = nextContainer.getContainedNodes().iterator(); containedNodes.hasNext(); ) { GenNode nextNode = (GenNode) containedNodes.next(); if (containers2Generate.contains(nextNode)) { stringBuffer.append(TEXT_141); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_142); stringBuffer.append(nextNode.getUniqueIdentifier()); stringBuffer.append(TEXT_143); } } stringBuffer.append(TEXT_144); } stringBuffer.append(TEXT_145); stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_146); stringBuffer.append(nextContainer.getUniqueIdentifier()); stringBuffer.append(TEXT_147); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_148); { String _getViewCode = "parentView"; List childNodes = nextContainer.getContainedNodes(); stringBuffer.append(TEXT_149); if (childNodes.size() == 0) { stringBuffer.append(TEXT_150); stringBuffer.append(importManager.getImportedName("java.util.Collections")); stringBuffer.append(TEXT_151); } else { stringBuffer.append(TEXT_152); stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_153); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); stringBuffer.append(TEXT_154); Map genFeature2genNodeMap = new LinkedHashMap(); for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) { GenNode nextNode = (GenNode) childNodes.get(nodeIndex); TypeModelFacet typeModelFacet = nextNode.getModelFacet(); if (typeModelFacet == null) { continue; } GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature(); if (!genFeature2genNodeMap.containsKey(childMetaFeature)) { genFeature2genNodeMap.put(childMetaFeature, new ArrayList()); } ((Collection) genFeature2genNodeMap.get(childMetaFeature)).add(nextNode); } Set entrySet = genFeature2genNodeMap.entrySet(); if (entrySet.size() > 0) { stringBuffer.append(TEXT_155); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_156); stringBuffer.append(_getViewCode); stringBuffer.append(TEXT_157); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_158); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_159); } for (Iterator entries = entrySet.iterator(); entries.hasNext();) { Map.Entry nextEntry = (Map.Entry) entries.next(); GenFeature childMetaFeature = (GenFeature) nextEntry.getKey(); Collection genNodesCollection = (Collection) nextEntry.getValue(); if (childMetaFeature.isListType()) { stringBuffer.append(TEXT_160); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_161); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, true); stringBuffer.append(TEXT_162); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_163); } else { stringBuffer.append(TEXT_164); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_165); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, false); stringBuffer.append(TEXT_166); } stringBuffer.append(TEXT_167); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); stringBuffer.append(TEXT_168); boolean generateSwitch = genNodesCollection.size() != 1; if (generateSwitch) { stringBuffer.append(TEXT_169); } for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) { GenNode nextNode = (GenNode) genNodesIterator.next(); if (generateSwitch) { stringBuffer.append(TEXT_170); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_171); } else { stringBuffer.append(TEXT_172); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_173); } stringBuffer.append(TEXT_174); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")); stringBuffer.append(TEXT_175); if (generateSwitch) { stringBuffer.append(TEXT_176); } else { stringBuffer.append(TEXT_177); } } if (generateSwitch) { stringBuffer.append(TEXT_178); } if (childMetaFeature.isListType()) { stringBuffer.append(TEXT_179); }} stringBuffer.append(TEXT_180); } } stringBuffer.append(TEXT_181); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand")); stringBuffer.append(TEXT_182); stringBuffer.append(nextContainer.getUniqueIdentifier()); stringBuffer.append(TEXT_183); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_184); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")); stringBuffer.append(TEXT_185); { String _parentNode = "parentView"; List childNodes = nextContainer.getContainedNodes(); boolean isListLayout; if (nextContainer instanceof GenNode) { isListLayout = !org.eclipse.gmf.codegen.gmfgen.util.ViewmapLayoutTypeHelper.getSharedInstance().isStoringChildPositions((GenNode) nextContainer); } else if (nextContainer instanceof GenCompartment) { isListLayout = ((GenCompartment) nextContainer).isListLayout(); } else if (nextContainer instanceof GenDiagram) { isListLayout = false; } else { throw new RuntimeException("Unexpected container"); } stringBuffer.append(TEXT_186); stringBuffer.append(TEXT_187); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_188); for (Iterator it = childNodes.iterator(); it.hasNext(); ) { GenNode nextNode = (GenNode) it.next(); TypeModelFacet typeModelFacet = nextNode.getModelFacet(); if (typeModelFacet == null) { continue; } String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName()); stringBuffer.append(TEXT_189); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_190); stringBuffer.append(childNodeInterfaceName); stringBuffer.append(TEXT_191); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalNodeCommand")); stringBuffer.append(TEXT_192); stringBuffer.append(_parentNode); stringBuffer.append(TEXT_193); if (!isListLayout) { int defaultWidth = 40; int defaultHeight = 40; DefaultSizeAttributes defSizeAttrs = (DefaultSizeAttributes) nextNode.getViewmap().find(DefaultSizeAttributes.class); if (defSizeAttrs != null) { defaultWidth = defSizeAttrs.getWidth(); defaultHeight = defSizeAttrs.getHeight(); } stringBuffer.append(TEXT_194); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); stringBuffer.append(TEXT_195); stringBuffer.append(defaultWidth); stringBuffer.append(TEXT_196); stringBuffer.append(defaultHeight); stringBuffer.append(TEXT_197); } else { stringBuffer.append(TEXT_198); } stringBuffer.append(TEXT_199); stringBuffer.append(importManager.getImportedName(nextNode.getNotationViewFactoryQualifiedClassName())); stringBuffer.append(TEXT_200); } stringBuffer.append(TEXT_201); } stringBuffer.append(TEXT_202); }class LinksCollection { private Collection<GenLink> myTypeModelFacetLinks = new LinkedList<GenLink>(); private Collection<GenLink> myFeatureModelFacetLinks = new LinkedList<GenLink>(); public void add(GenLink link) { if (link.getModelFacet() instanceof TypeLinkModelFacet) { myTypeModelFacetLinks.add(link); } else if (link.getModelFacet() instanceof FeatureLinkModelFacet) { myFeatureModelFacetLinks.add(link); } } public Iterator<GenLink> getContainedTypeModelFacetLinks() { return myTypeModelFacetLinks.iterator(); } public Iterator<GenLink> getContainedFeatureModelFacetLinks() { return myFeatureModelFacetLinks.iterator(); }}class CreateChildLinkElements { private TreeMap<GenContainerBase, LinksCollection> myElements; public CreateChildLinkElements() { myElements = new TreeMap<GenContainerBase, LinksCollection>(comparator); } public void add(GenContainerBase o, GenLink link) { buildAncestors(o); myElements.get(o).add(link); } private void buildAncestors(GenContainerBase o) { if (!myElements.containsKey(o)) { LinksCollection elements = new LinksCollection(); myElements.put(o, elements); addAncestors(o); } } private void addAncestors(GenContainerBase o) { if (o instanceof GenCompartment) { GenCompartment compartment = (GenCompartment) o; buildAncestors(compartment.getNode()); } else if (o instanceof GenTopLevelNode) { GenTopLevelNode node = (GenTopLevelNode) o; buildAncestors(node.getDiagram()); } else if (o instanceof GenChildNode) { GenChildNode node = (GenChildNode) o; for(Iterator it = node.getContainers().iterator(); it.hasNext(); ) { GenContainerBase next = (GenContainerBase) it.next(); buildAncestors(next); } } } public boolean contains(GenContainerBase o) { return myElements.containsKey(o); } public Iterator<Map.Entry<GenContainerBase, LinksCollection>> iterator() { return myElements.entrySet().iterator(); }}if (!genDiagram.getLinks().isEmpty()) { CreateChildLinkElements linkContainers2Generate = new CreateChildLinkElements(); //No need to explicitly add diagram, since we build the whole hierarchy up. for(Iterator links = genDiagram.getLinks().iterator(); links.hasNext(); ) { GenLink next = (GenLink) links.next(); GenClass containerClass; LinkModelFacet nextModelFacet = next.getModelFacet(); if (nextModelFacet instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) next.getModelFacet(); if (modelFacet.getSourceMetaFeature() == null && modelFacet.getTargetMetaFeature() == null) { //if one link feature is null, the element is treated as this end of the link. If both are null, we cannot do anything about such a link. containerClass = null; } else { containerClass = modelFacet.getContainmentMetaFeature().getGenClass(); } } else if (nextModelFacet instanceof FeatureLinkModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) next.getModelFacet()).getMetaFeature(); containerClass = metaFeature.getGenClass(); } else { continue; } for (Iterator nodes = genDiagram.getAllNodes().iterator(); nodes.hasNext(); ) { GenNode nextNode = (GenNode) nodes.next(); if (containerClass.getEcoreClass().isSuperTypeOf(nextNode.getDomainMetaClass().getEcoreClass())) { linkContainers2Generate.add(nextNode, next); } } } for(Iterator<Map.Entry<GenContainerBase, LinksCollection>> entryIt = linkContainers2Generate.iterator(); entryIt.hasNext(); ) { Map.Entry<GenContainerBase, LinksCollection> next = entryIt.next(); GenContainerBase nextContainer = next.getKey(); LinksCollection linksCollection = next.getValue(); Iterator<GenLink> typeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks(); Iterator<GenLink> featureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks(); stringBuffer.append(TEXT_203); stringBuffer.append(nextContainer.getUniqueIdentifier()); stringBuffer.append(TEXT_204); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_205); if (typeModelFacetLinks.hasNext() || featureModelFacetLinks.hasNext()) { stringBuffer.append(TEXT_206); stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_207); stringBuffer.append(nextContainer.getUniqueIdentifier()); stringBuffer.append(TEXT_208); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_209); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")); stringBuffer.append(TEXT_210); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")); stringBuffer.append(TEXT_211); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand")); stringBuffer.append(TEXT_212); stringBuffer.append(nextContainer.getUniqueIdentifier()); stringBuffer.append(TEXT_213); } boolean shouldIterateToGenerate = false; Collection childElements = new ArrayList(nextContainer.getContainedNodes()); if (nextContainer instanceof GenNode) { childElements.addAll(((GenNode) nextContainer).getCompartments()); } for(Iterator childrenIterator = childElements.iterator(); childrenIterator.hasNext(); ) { GenContainerBase nextChild = (GenContainerBase) childrenIterator.next(); if (linkContainers2Generate.contains(nextChild)) { shouldIterateToGenerate = true; break; } } if (shouldIterateToGenerate) { stringBuffer.append(TEXT_214); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_215); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_216); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_217); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); stringBuffer.append(TEXT_218); for(Iterator childrenIterator = childElements.iterator(); childrenIterator.hasNext(); ) { GenContainerBase nextChild = (GenContainerBase) childrenIterator.next(); if (!linkContainers2Generate.contains(nextChild)) { continue; } stringBuffer.append(TEXT_219); stringBuffer.append(importManager.getImportedName(nextChild.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_220); stringBuffer.append(nextChild.getUniqueIdentifier()); stringBuffer.append(TEXT_221); } stringBuffer.append(TEXT_222); } stringBuffer.append(TEXT_223); if (typeModelFacetLinks.hasNext() || featureModelFacetLinks.hasNext()) { stringBuffer.append(TEXT_224); stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_225); stringBuffer.append(nextContainer.getUniqueIdentifier()); stringBuffer.append(TEXT_226); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_227); { String _getViewCode = "parentView"; List childNodes = nextContainer.getContainedNodes(); Iterator<GenLink> _containedTypeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks();; Iterator<GenLink> _containedFeatureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks();; stringBuffer.append(TEXT_228); stringBuffer.append(TEXT_229); stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_230); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); stringBuffer.append(TEXT_231); Map genFeature2genLinkMap = new LinkedHashMap();for(Iterator it = _containedTypeModelFacetLinks; it.hasNext(); ) { GenLink genLink = (GenLink)it.next(); TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); GenFeature metaFeature = modelFacet.getChildMetaFeature(); if (!genFeature2genLinkMap.containsKey(metaFeature)) { genFeature2genLinkMap.put(metaFeature, new ArrayList()); } ((Collection) genFeature2genLinkMap.get(metaFeature)).add(genLink);}Map genFeature2featureGenLinkMap = new LinkedHashMap();for(Iterator it = _containedFeatureModelFacetLinks; it.hasNext(); ) { GenLink genLink = (GenLink)it.next(); GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); if (!genFeature2featureGenLinkMap.containsKey(metaFeature)) { genFeature2featureGenLinkMap.put(metaFeature, new ArrayList()); } ((Collection) genFeature2featureGenLinkMap.get(metaFeature)).add(genLink);}if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) { stringBuffer.append(TEXT_232); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_233); stringBuffer.append(_getViewCode); stringBuffer.append(TEXT_234); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_235); }if (!genFeature2genLinkMap.isEmpty()) { stringBuffer.append(TEXT_236); }for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) { Map.Entry nextEntry = (Map.Entry) entries.next(); GenFeature metaFeature = (GenFeature) nextEntry.getKey(); Collection genLinksCollection = (Collection) nextEntry.getValue(); if (metaFeature.isListType()) { stringBuffer.append(TEXT_237); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_238); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true); stringBuffer.append(TEXT_239); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_240); } else { stringBuffer.append(TEXT_241); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_242); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false); stringBuffer.append(TEXT_243); } stringBuffer.append(TEXT_244); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); stringBuffer.append(TEXT_245); boolean generateSwitch = genLinksCollection.size() != 1; if (generateSwitch) { stringBuffer.append(TEXT_246); } for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) { GenLink nextLink = (GenLink) genLinksIterator.next(); TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); if (generateSwitch) { stringBuffer.append(TEXT_247); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_248); } else { stringBuffer.append(TEXT_249); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_250); } if (modelFacet.getSourceMetaFeature() != null) { stringBuffer.append(TEXT_251); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_252); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_253); myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getSourceMetaFeature(), null, false); stringBuffer.append(TEXT_254); } else { stringBuffer.append(TEXT_255); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_256); stringBuffer.append(_getViewCode); stringBuffer.append(TEXT_257); } if (modelFacet.getTargetMetaFeature() != null) { stringBuffer.append(TEXT_258); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_259); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_260); myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getTargetMetaFeature(), null, false); stringBuffer.append(TEXT_261); } else { stringBuffer.append(TEXT_262); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_263); stringBuffer.append(_getViewCode); stringBuffer.append(TEXT_264); } stringBuffer.append(TEXT_265); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")); stringBuffer.append(TEXT_266); if (generateSwitch) { stringBuffer.append(TEXT_267); } else { stringBuffer.append(TEXT_268); } } //iterate over genLinksCollection if (generateSwitch) { stringBuffer.append(TEXT_269); } if (metaFeature.isListType()) { stringBuffer.append(TEXT_270); }}for (Iterator entries = genFeature2featureGenLinkMap.entrySet().iterator(); entries.hasNext();) { Map.Entry nextEntry = (Map.Entry) entries.next(); GenFeature metaFeature = (GenFeature) nextEntry.getKey(); Collection genLinksCollection = (Collection) nextEntry.getValue(); if (metaFeature.isListType()) { stringBuffer.append(TEXT_271); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_272); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true); stringBuffer.append(TEXT_273); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_274); } else { stringBuffer.append(TEXT_275); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_276); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false); stringBuffer.append(TEXT_277); } stringBuffer.append(TEXT_278); for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) { GenLink nextLink = (GenLink) genLinksIterator.next(); stringBuffer.append(TEXT_279); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")); stringBuffer.append(TEXT_280); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_281); } stringBuffer.append(TEXT_282); if (metaFeature.isListType()) { stringBuffer.append(TEXT_283); }} stringBuffer.append(TEXT_284); } stringBuffer.append(TEXT_285); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand")); stringBuffer.append(TEXT_286); stringBuffer.append(nextContainer.getUniqueIdentifier()); stringBuffer.append(TEXT_287); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_288); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")); stringBuffer.append(TEXT_289); { String _diagramCode = "parentView.getDiagram()"; Iterator<GenLink> _containedTypeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks();; Iterator<GenLink> _containedFeatureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks();; stringBuffer.append(TEXT_290); stringBuffer.append(TEXT_291); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_292); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_293); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IViewDecorator")); stringBuffer.append(TEXT_294); for(Iterator it = _containedTypeModelFacetLinks; it.hasNext(); ) { GenLink nextLink = (GenLink) it.next(); TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); if (modelFacet == null) { continue; } stringBuffer.append(TEXT_295); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_296); stringBuffer.append(importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_297); stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())); stringBuffer.append(TEXT_298); } for(Iterator it = _containedFeatureModelFacetLinks; it.hasNext(); ) { GenLink nextLink = (GenLink) it.next(); stringBuffer.append(TEXT_299); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_300); stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())); stringBuffer.append(TEXT_301); } stringBuffer.append(TEXT_302); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalEdgeCommand")); stringBuffer.append(TEXT_303); stringBuffer.append(_diagramCode); stringBuffer.append(TEXT_304); } stringBuffer.append(TEXT_305); } }}if(!genDiagram.getLinks().isEmpty()) { stringBuffer.append(TEXT_306); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService")); stringBuffer.append(TEXT_307); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService")); stringBuffer.append(TEXT_308); } stringBuffer.append(TEXT_309); if (isRichClientPlatform) { stringBuffer.append(TEXT_310); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardPage")); stringBuffer.append(TEXT_311); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Text")); stringBuffer.append(TEXT_312); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); stringBuffer.append(TEXT_313); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); stringBuffer.append(TEXT_314); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); stringBuffer.append(TEXT_315); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_316); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout")); stringBuffer.append(TEXT_317); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout")); stringBuffer.append(TEXT_318); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_319); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_320); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_321); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_322); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label")); stringBuffer.append(TEXT_323); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label")); stringBuffer.append(TEXT_324); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_325); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_326); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_327); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_328); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); stringBuffer.append(TEXT_329); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); stringBuffer.append(TEXT_330); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_331); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_332); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_333); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_334); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout")); stringBuffer.append(TEXT_335); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout")); stringBuffer.append(TEXT_336); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Text")); stringBuffer.append(TEXT_337); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_338); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_339); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_340); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_341); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Button")); stringBuffer.append(TEXT_342); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Button")); stringBuffer.append(TEXT_343); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_344); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.SelectionAdapter")); stringBuffer.append(TEXT_345); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.SelectionEvent")); stringBuffer.append(TEXT_346); stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())); stringBuffer.append(TEXT_347); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_348); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyListener")); stringBuffer.append(TEXT_349); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyListener")); stringBuffer.append(TEXT_350); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyEvent")); stringBuffer.append(TEXT_351); stringBuffer.append(importManager.getImportedName("java.io.File")); stringBuffer.append(TEXT_352); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_353); stringBuffer.append(importManager.getImportedName("java.io.File")); stringBuffer.append(TEXT_354); stringBuffer.append(importManager.getImportedName("java.io.File")); stringBuffer.append(TEXT_355); stringBuffer.append(importManager.getImportedName("java.io.File")); stringBuffer.append(TEXT_356); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_357); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_358); stringBuffer.append(editorGen.getDomainFileExtension()); stringBuffer.append(TEXT_359); stringBuffer.append(importManager.getImportedName("java.io.File")); stringBuffer.append(TEXT_360); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_361); stringBuffer.append(editorGen.getDiagramFileExtension()); stringBuffer.append(TEXT_362); stringBuffer.append(editorGen.getDomainGenModel().getModelName()); stringBuffer.append(TEXT_363); stringBuffer.append(editorGen.getDiagramFileExtension()); stringBuffer.append(TEXT_364); stringBuffer.append(importManager.getImportedName("java.io.File")); stringBuffer.append(TEXT_365); stringBuffer.append(importManager.getImportedName("java.io.File")); stringBuffer.append(TEXT_366); stringBuffer.append(importManager.getImportedName("java.io.File")); stringBuffer.append(TEXT_367); stringBuffer.append(importManager.getImportedName("java.io.File")); stringBuffer.append(TEXT_368); stringBuffer.append(importManager.getImportedName("java.io.File")); stringBuffer.append(TEXT_369); stringBuffer.append(importManager.getImportedName("java.io.File")); stringBuffer.append(TEXT_370); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_371); stringBuffer.append(importManager.getImportedName("java.io.File")); stringBuffer.append(TEXT_372); } stringBuffer.append(TEXT_373); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardPage")); stringBuffer.append(TEXT_374); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.ISelectionChangedListener")); stringBuffer.append(TEXT_375); if (isRichClientPlatform) { stringBuffer.append(TEXT_376); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TreeViewer")); stringBuffer.append(TEXT_377); } stringBuffer.append(TEXT_378); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); stringBuffer.append(TEXT_379); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); stringBuffer.append(TEXT_380); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); stringBuffer.append(TEXT_381); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_382); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout")); stringBuffer.append(TEXT_383); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_384); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_385); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_386); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); stringBuffer.append(TEXT_387); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); stringBuffer.append(TEXT_388); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); stringBuffer.append(TEXT_389); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_390); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_391); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_392); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout")); stringBuffer.append(TEXT_393); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout")); stringBuffer.append(TEXT_394); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label")); stringBuffer.append(TEXT_395); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label")); stringBuffer.append(TEXT_396); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_397); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_398); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_399); final String treeViewer = isRichClientPlatform ? "myTreeViewer" : "treeViewer"; stringBuffer.append(TEXT_400); if (!isRichClientPlatform){ stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TreeViewer")); stringBuffer.append(TEXT_401); } stringBuffer.append(treeViewer); stringBuffer.append(TEXT_402); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TreeViewer")); stringBuffer.append(TEXT_403); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_404); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_405); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_406); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_407); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_408); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_409); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); stringBuffer.append(TEXT_410); stringBuffer.append(treeViewer); stringBuffer.append(TEXT_411); stringBuffer.append(treeViewer); stringBuffer.append(TEXT_412); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider")); stringBuffer.append(TEXT_413); stringBuffer.append(pluginActivatorClass); stringBuffer.append(TEXT_414); stringBuffer.append(treeViewer); stringBuffer.append(TEXT_415); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider")); stringBuffer.append(TEXT_416); stringBuffer.append(pluginActivatorClass); stringBuffer.append(TEXT_417); if (!isRichClientPlatform) { stringBuffer.append(TEXT_418); stringBuffer.append(treeViewer); stringBuffer.append(TEXT_419); stringBuffer.append(treeViewer); stringBuffer.append(TEXT_420); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.StructuredSelection")); stringBuffer.append(TEXT_421); } stringBuffer.append(TEXT_422); stringBuffer.append(treeViewer); stringBuffer.append(TEXT_423); if (isRichClientPlatform) { stringBuffer.append(TEXT_424); stringBuffer.append(treeViewer); stringBuffer.append(TEXT_425); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.StructuredSelection")); stringBuffer.append(TEXT_426); } stringBuffer.append(TEXT_427); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.SelectionChangedEvent")); stringBuffer.append(TEXT_428); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection")); stringBuffer.append(TEXT_429); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection")); stringBuffer.append(TEXT_430); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection")); stringBuffer.append(TEXT_431); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.IWrapperItemProvider")); stringBuffer.append(TEXT_432); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.IWrapperItemProvider")); stringBuffer.append(TEXT_433); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")); stringBuffer.append(TEXT_434); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")); stringBuffer.append(TEXT_435); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_436); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_437); stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_438); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); stringBuffer.append(TEXT_439); importManager.emitSortedImports(); stringBuffer.append(TEXT_440); return stringBuffer.toString(); } | 7409 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7409/88670058e3792eb12387f6a2bac58d878ca8f3f6/NewDiagramFileWizardGenerator.java/clean/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/NewDiagramFileWizardGenerator.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
514,
2103,
12,
921,
1237,
13,
225,
288,
565,
727,
6674,
533,
1892,
273,
394,
6674,
5621,
565,
727,
10938,
14058,
1940,
3157,
14058,
1940,
273,
261,
7642,
14058,
1940,
13,
14015,
921... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
514,
2103,
12,
921,
1237,
13,
225,
288,
565,
727,
6674,
533,
1892,
273,
394,
6674,
5621,
565,
727,
10938,
14058,
1940,
3157,
14058,
1940,
273,
261,
7642,
14058,
1940,
13,
14015,
921... |
if (fs != null) { fs.close(); fs = null; } | public synchronized void close() throws IOException { if (fs != null) { fs.close(); fs = null; } } | 51718 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51718/e4001be4fd1b3b0ad74ce38168cf0c691b251e62/JobClient.java/buggy/src/java/org/apache/hadoop/mapred/JobClient.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
3852,
918,
1746,
1435,
1216,
1860,
288,
3639,
309,
261,
2556,
480,
446,
13,
288,
5411,
2662,
18,
4412,
5621,
5411,
2662,
273,
446,
31,
3639,
289,
565,
289,
2,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
3852,
918,
1746,
1435,
1216,
1860,
288,
3639,
309,
261,
2556,
480,
446,
13,
288,
5411,
2662,
18,
4412,
5621,
5411,
2662,
273,
446,
31,
3639,
289,
565,
289,
2,
-100,
-100,
-100,
-1... | |
if (type == -1) return(iterator.getLast()); | if (type == -1) type = _type[node]; | public int getTypedLast(NodeIterator iterator, int type, int node) { // Just return the basic position if no type is specified if (type == -1) return(iterator.getLast()); int match = 0; int curr = 0; iterator.setMark(); iterator.reset(); while ((curr = iterator.next()) != NULL) { if (_type[curr] == type) match++; } iterator.gotoMark(); return match; } | 46591 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46591/55c7e7b1d0d253233427e97e19ee63ad1f81ba31/DOMImpl.java/clean/src/org/apache/xalan/xsltc/dom/DOMImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
509,
3181,
6140,
3024,
12,
907,
3198,
2775,
16,
509,
618,
16,
509,
756,
13,
288,
202,
759,
12526,
327,
326,
5337,
1754,
309,
1158,
618,
353,
1269,
202,
430,
261,
723,
422,
300,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
509,
3181,
6140,
3024,
12,
907,
3198,
2775,
16,
509,
618,
16,
509,
756,
13,
288,
202,
759,
12526,
327,
326,
5337,
1754,
309,
1158,
618,
353,
1269,
202,
430,
261,
723,
422,
300,
... |
if (isZoomed()) zoomOut(); | private void busySetPerspective(IPerspectiveDescriptor desc) { // If zoomed unzoom. if (isZoomed()) zoomOut(); // Create new layout. PerspectiveDescriptor realDesc = (PerspectiveDescriptor)desc; Perspective newPersp = findPerspective(realDesc); if (newPersp == null) { newPersp = createPerspective(realDesc); window.addPerspectiveShortcut(realDesc, this); if (newPersp == null) return; } // Change layout. setPerspective(newPersp);} | 57470 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57470/6f98e948e32acef3425e44770bbd91bae6ac6a6d/WorkbenchPage.java/clean/bundles/org.eclipse.ui/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3238,
918,
21697,
694,
14781,
16772,
12,
2579,
414,
16772,
3187,
3044,
13,
288,
202,
759,
971,
7182,
329,
640,
14932,
18,
202,
430,
261,
291,
11497,
329,
10756,
202,
202,
14932,
1182,
5621,
20... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3238,
918,
21697,
694,
14781,
16772,
12,
2579,
414,
16772,
3187,
3044,
13,
288,
202,
759,
971,
7182,
329,
640,
14932,
18,
202,
430,
261,
291,
11497,
329,
10756,
202,
202,
14932,
1182,
5621,
20... | |
public void classSpecifierEnd(Object classSpecifier); | public void classSpecifierEnd(Object classSpecifier, Token closingBrace ); | public void classSpecifierEnd(Object classSpecifier); | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/0ff98a152ca4ebe0c2b3707e158d5194dc4acfeb/IParserCallback.java/buggy/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IParserCallback.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
667,
21416,
1638,
12,
921,
667,
21416,
1769,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
667,
21416,
1638,
12,
921,
667,
21416,
1769,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
public org.quickfix.field.OrderID get(org.quickfix.field.OrderID value) | public quickfix.field.OrderID get(quickfix.field.OrderID value) | public org.quickfix.field.OrderID get(org.quickfix.field.OrderID value) throws FieldNotFound { getField(value); return value; } | 8803 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8803/fecc27f98261270772ff182a1d4dfd94b5daa73d/DontKnowTrade.java/clean/src/java/src/quickfix/fix43/DontKnowTrade.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
9549,
904,
18,
1518,
18,
2448,
734,
336,
12,
19525,
904,
18,
1518,
18,
2448,
734,
225,
460,
13,
565,
1216,
2286,
2768,
225,
288,
5031,
12,
1132,
1769,
327,
460,
31,
289,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9549,
904,
18,
1518,
18,
2448,
734,
336,
12,
19525,
904,
18,
1518,
18,
2448,
734,
225,
460,
13,
565,
1216,
2286,
2768,
225,
288,
5031,
12,
1132,
1769,
327,
460,
31,
289,
2,
-100... |
private void populateGrouping( Context cx ) throws DataException { List groups = this.baseQueryDefn.getGroups( ); if ( groups != null && !groups.isEmpty( ) ) { IQuery.GroupSpec[] groupSpecs = new IQuery.GroupSpec[groups.size( )]; Iterator it = groups.iterator( ); for ( int i = 0; it.hasNext( ); i++ ) { IGroupDefinition src = (IGroupDefinition) it.next( ); if ( ( src.getKeyColumn( ) == null || src.getKeyColumn( ) .trim( ) .length( ) == 0 ) && ( src.getKeyExpression( ) == null || src.getKeyExpression( ) .trim( ) .length( ) == 0 ) ) throw new DataException( ResourceConstants.BAD_GROUP_EXPRESSION ); //TODO does the index of column significant? String expr = getGroupKeyExpression( src ); String groupName = ""; if ( expr.trim( ).equalsIgnoreCase( "row[0]" ) || expr.trim( ) .equalsIgnoreCase( "row._rowPosition" ) || expr.trim( ).equalsIgnoreCase( "dataSetRow[0]" ) || expr.trim( ) .equalsIgnoreCase( "dataSetRow._rowPosition" ) ) { groupName = "_{$TEMP_GROUP_" + i + "ROWID$}_"; } else { groupName = "_{$TEMP_GROUP_" + i + "$}_"; } if ( ( src.getInterval( ) != IGroupDefinition.NO_INTERVAL ) && ( src.getIntervalRange( ) != 0 ) ) { try { expr = ExpressionUtil.createGroupByExpression( src.getInterval( ), src.getIntervalStart( ), getGroupKeyExpression( src ), src.getIntervalRange( ) ); } catch(BirtException be) { throw DataException.wrap( be ); } } IQuery.GroupSpec dest = QueryExecutorUtil.groupDefnToSpec( cx, src, expr, groupName, -1 ); groupSpecs[i] = dest; if ( ( dest.getInterval( ) != IGroupDefinition.NO_INTERVAL ) && ( dest.getIntervalRange( ) != 0 ) ) { if (dest.getInterval( ) == IGroupDefinition.STRING_PREFIX_INTERVAL) { temporaryComputedColumns.add( new ComputedColumn( groupName, expr, DataType.STRING_TYPE ) ); } else { temporaryComputedColumns.add( new ComputedColumn( groupName, expr, DataType.INTEGER_TYPE ) ); } } else { temporaryComputedColumns.add( new ComputedColumn( groupName, expr, QueryExecutorUtil.getTempComputedColumnType( groupSpecs[i].getInterval( ) ) ) ); } } odiQuery.setGrouping( Arrays.asList( groupSpecs ) ); } } | 12803 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12803/bfd6039efc3bc0dd109a256742a0122ae0a5a6a1/QueryExecutor.java/clean/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/QueryExecutor.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
6490,
21014,
12,
1772,
9494,
262,
1216,
1910,
503,
202,
95,
202,
202,
682,
3252,
273,
333,
18,
1969,
1138,
3262,
82,
18,
588,
3621,
12,
11272,
202,
202,
430,
261,
3252,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6490,
21014,
12,
1772,
9494,
262,
1216,
1910,
503,
202,
95,
202,
202,
682,
3252,
273,
333,
18,
1969,
1138,
3262,
82,
18,
588,
3621,
12,
11272,
202,
202,
430,
261,
3252,
... | ||
public org.quickfix.field.Account getAccount() throws FieldNotFound { org.quickfix.field.Account value = new org.quickfix.field.Account(); | public quickfix.field.Account getAccount() throws FieldNotFound { quickfix.field.Account value = new quickfix.field.Account(); | public org.quickfix.field.Account getAccount() throws FieldNotFound { org.quickfix.field.Account value = new org.quickfix.field.Account(); getField(value); return value; } | 8803 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8803/fecc27f98261270772ff182a1d4dfd94b5daa73d/CollateralResponse.java/clean/src/java/src/quickfix/fix44/CollateralResponse.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
2358,
18,
19525,
904,
18,
1518,
18,
3032,
23393,
1435,
1216,
2286,
2768,
225,
288,
2358,
18,
19525,
904,
18,
1518,
18,
3032,
460,
273,
394,
2358,
18,
19525,
904,
18,
1518,
18,
303... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
282,
1071,
2358,
18,
19525,
904,
18,
1518,
18,
3032,
23393,
1435,
1216,
2286,
2768,
225,
288,
2358,
18,
19525,
904,
18,
1518,
18,
3032,
460,
273,
394,
2358,
18,
19525,
904,
18,
1518,
18,
303... |
super(sm,process); _process = process; } | super(sm,process); _process = process; } | public ProcessDaoImpl(SessionManager sm, HProcess process) { super(sm,process); _process = process; } | 47044 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47044/e4081f282ae2ddc9c22fc84cbce46d579a3ac0dc/ProcessDaoImpl.java/buggy/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ProcessDaoImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
4389,
11412,
2828,
12,
2157,
1318,
3029,
16,
670,
2227,
1207,
13,
288,
565,
2240,
12,
4808,
16,
2567,
1769,
565,
389,
2567,
273,
1207,
31,
225,
289,
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,
4389,
11412,
2828,
12,
2157,
1318,
3029,
16,
670,
2227,
1207,
13,
288,
565,
2240,
12,
4808,
16,
2567,
1769,
565,
389,
2567,
273,
1207,
31,
225,
289,
2,
-100,
-100,
-100,
-100,
-10... |
return ScriptRuntime.call(cx, fun, object, args, object); | return ScriptRuntime.call(cx, fun, thisObj, args, object); | public static Object callMethod(Scriptable object, String methodId, Object[] args) { try { Context cx = Context.enter(); Object fun = ScriptableObject.getProperty(object,methodId); if (fun == Scriptable.NOT_FOUND) { // It is an error that this function doesn't exist. // Easiest thing to do is just pass the undefined value // along and ScriptRuntime will take care of reporting // the error. fun = Undefined.instance; } return ScriptRuntime.call(cx, fun, object, args, object); } catch (JavaScriptException ex) { throw WrappedException.wrapException(ex); } finally { Context.exit(); } } | 19000 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/19000/394383a65dd802c3dde5b8a2f99b406cd7527b4f/JavaAdapter.java/clean/org/mozilla/javascript/JavaAdapter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
1033,
745,
1305,
12,
3651,
429,
733,
16,
514,
707,
548,
16,
4766,
565,
1033,
8526,
833,
13,
377,
288,
3639,
775,
288,
5411,
1772,
9494,
273,
1772,
18,
2328,
5621,
5411,
1033,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
745,
1305,
12,
3651,
429,
733,
16,
514,
707,
548,
16,
4766,
565,
1033,
8526,
833,
13,
377,
288,
3639,
775,
288,
5411,
1772,
9494,
273,
1772,
18,
2328,
5621,
5411,
1033,... |
SQLColumn col = (SQLColumn) columnsFolder.getChild(oldIdx); removeColumn(oldIdx); addColumn(newIdx, col); | SQLColumn col = (SQLColumn) columnsFolder.children.remove(oldIdx); columnsFolder.fireDbChildRemoved(oldIdx, col); columnsFolder.children.add(newIdx, col); if (newIdx == 0 || ((SQLColumn) columnsFolder.children.get(newIdx-1)).primaryKeySeq != null) { col.primaryKeySeq = new Integer(1); } normalizePrimaryKey(); columnsFolder.fireDbChildInserted(newIdx, col); | public void changeColumnIndex(int oldIdx, int newIdx) throws ArchitectException { // this old way didn't cause any events// SQLColumn col = (SQLColumn) columnsFolder.children.remove(oldIdx);// columnsFolder.children.add(newIdx, col);// if (newIdx == 0// || ((SQLColumn) columnsFolder.children.get(newIdx-1)).primaryKeySeq != null) {// col.primaryKeySeq = new Integer(1); // will get sane value when normalized// }// normalizePrimaryKey(); SQLColumn col = (SQLColumn) columnsFolder.getChild(oldIdx); removeColumn(oldIdx); addColumn(newIdx, col); } | 53257 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53257/1dc9909debcd09cb88e79aa5c88727ee488ca4b8/SQLTable.java/clean/src/ca/sqlpower/architect/SQLTable.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
2549,
21689,
12,
474,
1592,
4223,
16,
509,
394,
4223,
13,
1216,
16959,
15004,
503,
288,
202,
202,
759,
333,
1592,
4031,
10242,
1404,
4620,
1281,
2641,
759,
3196,
202,
3997,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2549,
21689,
12,
474,
1592,
4223,
16,
509,
394,
4223,
13,
1216,
16959,
15004,
503,
288,
202,
202,
759,
333,
1592,
4031,
10242,
1404,
4620,
1281,
2641,
759,
3196,
202,
3997,... |
if (!getRunBusiness(iwc).isRegisteredInRun(run, runner.getUser())) { | if (!getRunBusiness(iwc).isRegisteredInRun(yearString, run, runner.getUser())) { | private void stepTwo(IWContext iwc) throws RemoteException { Form form = new Form(); form.maintainParameter(PARAMETER_PERSONAL_ID); form.addParameter(PARAMETER_ACTION, "-1"); form.addParameter(PARAMETER_FROM_ACTION, ACTION_STEP_TWO); Table table = new Table(); table.setCellpadding(0); table.setCellspacing(0); table.setWidth(Table.HUNDRED_PERCENT); form.add(table); int row = 1; table.add(getPhasesTable(isIcelandic ? 2 : 1, isIcelandic ? 7 : 6, "run_reg.registration", "Registration"), 1, row++); table.setHeight(row++, 12); table.add(getInformationTable(localize("run_reg.information_text_step_2", "Information text 2...")), 1, row++); table.setHeight(row++, 18); Table choiceTable = new Table(); choiceTable.setColumns(3); choiceTable.setCellpadding(2); choiceTable.setCellspacing(0); choiceTable.setWidth(1, "50%"); choiceTable.setWidth(2, 12); choiceTable.setWidth(3, "50%"); choiceTable.setWidth(Table.HUNDRED_PERCENT); table.add(choiceTable, 1, row++); int iRow = 1; boolean hasRuns = false; DropdownMenu runDropdown = (DropdownMenu) getStyledInterface(new DropdownMenu(PARAMETER_RUN)); Collection runs = getRunBusiness(iwc).getRuns(); runDropdown.addMenuElement("-1", localize("run_year_ddd.select_run","Select run...")); if(runs != null) { Iterator iter = runs.iterator(); while (iter.hasNext()) { Group run = (Group) iter.next(); if (runner.getUser() != null) { if (!getRunBusiness(iwc).isRegisteredInRun(run, runner.getUser())) { runDropdown.addMenuElement(run.getPrimaryKey().toString(), localize(run.getName(), run.getName())); hasRuns = true; } } else { runDropdown.addMenuElement(run.getPrimaryKey().toString(), localize(run.getName(), run.getName())); hasRuns = true; } } } if (runner.getRun() != null) { runDropdown.setSelectedElement(runner.getRun().getPrimaryKey().toString()); } runDropdown.setAsNotEmpty(localize("run_reg.must_select_run", "You have to select a run"), ""); if (!hasRuns) { getParentPage().setAlertOnLoad(localize("run_reg.no_runs_available", "There are no runs you can register for.")); if (isIcelandic) { removeRunner(iwc, runner.getPersonalID()); stepOne(iwc); return; } } IWTimestamp ts = IWTimestamp.RightNow(); Integer y = new Integer(ts.getYear()); String yearString = y.toString(); DropdownMenu distanceDropdown = (DropdownMenu) getStyledInterface(new DropdownMenu(PARAMETER_DISTANCE)); distanceDropdown.addMenuElement("", localize("run_year_ddd.select_distance","Select distance...")); if(runner.getRun() != null) { Collection distances = getRunBusiness(iwc).getDistancesMap(runner.getRun(), yearString); if(distances != null) { distanceDropdown.addMenuElements(distances); } if (runner.getDistance() != null) { distanceDropdown.setSelectedElement(runner.getDistance().getPrimaryKey().toString()); } } distanceDropdown.setAsNotEmpty(localize("run_reg.must_select_distance", "You have to select a distance"), ""); Text redStar = getHeader("*"); redStar.setFontColor("#ff0000"); choiceTable.add(getHeader(localize(IWMarathonConstants.RR_PRIMARY_DD, "Run") + "/" + localize(IWMarathonConstants.RR_SECONDARY_DD, "Distance")), 1, iRow); choiceTable.add(redStar, 1, iRow++); choiceTable.mergeCells(1, iRow, choiceTable.getColumns(), iRow); choiceTable.add(runDropdown, 1, iRow); choiceTable.add(distanceDropdown, 1, iRow++); RemoteScriptHandler rsh = new RemoteScriptHandler(runDropdown, distanceDropdown); try { rsh.setRemoteScriptCollectionClass(RunInputCollectionHandler.class); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } add(rsh); choiceTable.setHeight(iRow++, 12); TextInput nameField = (TextInput) getStyledInterface(new TextInput(PARAMETER_NAME)); nameField.setInFocusOnPageLoad(true); nameField.setWidth(Table.HUNDRED_PERCENT); if (runner.getName() != null) { nameField.setContent(runner.getName()); } if (isIcelandic) { nameField.setDisabled(true); if (runner.getUser() != null) { nameField.setContent(runner.getUser().getName()); } } else { nameField.setAsAlphabeticText(localize("run_reg.name_err_msg", "Your name may only contain alphabetic characters")); nameField.setAsNotEmpty(localize("run_reg.name_not_empty", "Name field can not be empty")); } DropdownMenu genderField = (DropdownMenu) getStyledInterface(new DropdownMenu(PARAMETER_GENDER)); Collection genders = getGenderBusiness(iwc).getAllGenders(); genderField.addMenuElement("", localize("run_reg.select_gender","Select gender...")); if(genders != null) { genderField.addMenuElements(genders); } if (runner.getGender() != null) { genderField.setSelectedElement(runner.getGender().getPrimaryKey().toString()); } if (isIcelandic) { genderField.setDisabled(true); if (runner.getUser() != null) { genderField.setSelectedElement(runner.getUser().getGenderID()); } } else { genderField.setAsNotEmpty(localize("run_reg.gender_not_empty", "Gender can not be empty")); } choiceTable.add(getHeader(localize(IWMarathonConstants.RR_NAME, "Name")), 1, iRow); choiceTable.add(redStar, 1, iRow); choiceTable.add(getHeader(localize(IWMarathonConstants.RR_GENDER, "Gender")), 3, iRow); choiceTable.add(redStar, 3, iRow++); choiceTable.add(nameField, 1, iRow); choiceTable.add(genderField, 3, iRow++); choiceTable.setHeight(iRow++, 3); TextInput ssnISField = (TextInput) getStyledInterface(new TextInput(PARAMETER_PERSONAL_ID)); ssnISField.setLength(10); if (isIcelandic) { ssnISField.setDisabled(true); if (runner.getUser() != null) { ssnISField.setContent(runner.getUser().getPersonalID()); } } IWTimestamp stamp = new IWTimestamp(); DateInput ssnField = (DateInput) getStyledInterface(new DateInput(PARAMETER_PERSONAL_ID)); ssnField.setAsNotEmpty("Date of birth can not be empty"); ssnField.setYearRange(stamp.getYear(), stamp.getYear() - 100); if (runner.getDateOfBirth() != null) { ssnField.setDate(runner.getDateOfBirth()); } Collection countries = getRunBusiness(iwc).getCountries(); DropdownMenu nationalityField = (DropdownMenu) getStyledInterface(new DropdownMenu(PARAMETER_NATIONALITY)); DropdownMenu countryField = (DropdownMenu) getStyledInterface(new DropdownMenu(PARAMETER_COUNTRY)); nationalityField.addMenuElement("-1", localize("run_reg.select_nationality", "Select nationality...")); countryField.addMenuElement("-1", localize("run_reg.select_country", "Select country...")); SelectorUtility util = new SelectorUtility(); if (countries != null && !countries.isEmpty()) { nationalityField = (DropdownMenu) util.getSelectorFromIDOEntities(nationalityField, countries, "getName"); countryField = (DropdownMenu) util.getSelectorFromIDOEntities(countryField, countries, "getName"); } if (isIcelandic) { countryField.setDisabled(true); nationalityField.setSelectedElement("104"); if (runner.getUser() != null) { Address address = getUserBusiness(iwc).getUsersMainAddress(runner.getUser()); if (address.getCountry() != null) { countryField.setSelectedElement(address.getCountry().getPrimaryKey().toString()); } } } nationalityField.setWidth(Table.HUNDRED_PERCENT); nationalityField.setAsNotEmpty(localize("run_reg.must_select_nationality", "You must select your nationality")); countryField.setWidth(Table.HUNDRED_PERCENT); if (!isIcelandic) { countryField.setAsNotEmpty(localize("run_reg.must_select_country", "You must select your country")); } if (runner.getCountry() != null) { countryField.setSelectedElement(runner.getCountry().getPrimaryKey().toString()); } if (runner.getNationality() != null) { nationalityField.setSelectedElement(runner.getNationality().getPrimaryKey().toString()); } choiceTable.add(getHeader(localize(IWMarathonConstants.RR_SSN, "SSN")), 1, iRow); choiceTable.add(redStar, 1, iRow); choiceTable.add(getHeader(localize(IWMarathonConstants.RR_NATIONALITY, "Nationality")), 3, iRow); choiceTable.add(redStar, 3, iRow++); if (isIcelandic) { choiceTable.add(ssnISField, 1, iRow); } else { choiceTable.add(ssnField, 1, iRow); } choiceTable.add(nationalityField, 3, iRow++); choiceTable.setHeight(iRow++, 3); TextInput addressField = (TextInput) getStyledInterface(new TextInput(PARAMETER_ADDRESS)); addressField.setWidth(Table.HUNDRED_PERCENT); if (!isIcelandic) { addressField.setAsNotEmpty(localize("run_reg.must_provide_address", "You must enter your address.")); } if (runner.getAddress() != null) { addressField.setContent(runner.getAddress()); } if (isIcelandic) { addressField.setDisabled(true); if (runner.getUser() != null) { Address address = getUserBusiness(iwc).getUsersMainAddress(runner.getUser()); if (address != null) { addressField.setContent(address.getStreetAddress()); } } } TextInput emailField = (TextInput) getStyledInterface(new TextInput(PARAMETER_EMAIL)); emailField.setAsEmail(localize("run_reg.email_err_msg", "Not a valid email address")); emailField.setWidth(Table.HUNDRED_PERCENT); if (runner.getEmail() != null) { emailField.setContent(runner.getEmail()); } else if (runner.getUser() != null) { try { Email mail = getUserBusiness(iwc).getUsersMainEmail(runner.getUser()); emailField.setContent(mail.getEmailAddress()); } catch (NoEmailFoundException nefe) { //No email registered... } } choiceTable.add(getHeader(localize(IWMarathonConstants.RR_ADDRESS, "Address")), 1, iRow); choiceTable.add(redStar, 1, iRow); choiceTable.add(getHeader(localize(IWMarathonConstants.RR_EMAIL, "Email")), 3, iRow++); choiceTable.add(addressField, 1, iRow); choiceTable.add(emailField, 3, iRow++); choiceTable.setHeight(iRow++, 3); TextInput cityField = (TextInput) getStyledInterface(new TextInput(PARAMETER_CITY)); cityField.setWidth(Table.HUNDRED_PERCENT); if (!isIcelandic) { cityField.setAsNotEmpty(localize("run_reg.must_provide_city", "You must enter your city of living.")); } if (runner.getCity() != null) { cityField.setContent(runner.getCity()); } if (isIcelandic) { cityField.setDisabled(true); if (runner.getUser() != null) { Address address = getUserBusiness(iwc).getUsersMainAddress(runner.getUser()); if (address != null) { cityField.setContent(address.getCity()); } } } TextInput telField = (TextInput) getStyledInterface(new TextInput(PARAMETER_HOME_PHONE)); telField.setWidth(Table.HUNDRED_PERCENT); if (runner.getHomePhone() != null) { telField.setContent(runner.getHomePhone()); } else if (runner.getUser() != null) { try { Phone phone = getUserBusiness(iwc).getUsersHomePhone(runner.getUser()); telField.setContent(phone.getNumber()); } catch (NoPhoneFoundException nefe) { //No phone registered... } } choiceTable.add(getHeader(localize(IWMarathonConstants.RR_CITY, "City")), 1, iRow); choiceTable.add(redStar, 1, iRow); choiceTable.add(getHeader(localize(IWMarathonConstants.RR_TEL, "Telephone")), 3, iRow++); choiceTable.add(cityField, 1, iRow); choiceTable.add(telField, 3, iRow++); choiceTable.setHeight(iRow++, 3); TextInput postalField = (TextInput) getStyledInterface(new TextInput(PARAMETER_POSTAL_CODE)); if (!isIcelandic) { postalField.setAsNotEmpty(localize("run_reg.must_provide_postal", "You must enter your postal address.")); } postalField.setMaxlength(10); postalField.setLength(10); if (runner.getPostalCode() != null) { postalField.setContent(runner.getPostalCode()); } if (isIcelandic) { postalField.setDisabled(true); if (runner.getUser() != null) { Address address = getUserBusiness(iwc).getUsersMainAddress(runner.getUser()); if (address != null) { PostalCode postal = address.getPostalCode(); if (postal != null) { postalField.setContent(postal.getPostalCode()); } } } } TextInput mobileField = (TextInput) getStyleObject(new TextInput(PARAMETER_MOBILE_PHONE), STYLENAME_INTERFACE); mobileField.setWidth(Table.HUNDRED_PERCENT); if (runner.getMobilePhone() != null) { mobileField.setContent(runner.getMobilePhone()); } else if (runner.getUser() != null) { try { Phone phone = getUserBusiness(iwc).getUsersMobilePhone(runner.getUser()); mobileField.setContent(phone.getNumber()); } catch (NoPhoneFoundException nefe) { //No phone registered... } } choiceTable.add(getHeader(localize(IWMarathonConstants.RR_POSTAL, "Postal Code")), 1, iRow); choiceTable.add(redStar, 1, iRow); choiceTable.add(getHeader(localize(IWMarathonConstants.RR_MOBILE, "Mobile Phone")), 3, iRow++); choiceTable.add(postalField, 1, iRow); choiceTable.add(mobileField, 3, iRow++); choiceTable.setHeight(iRow++, 3); DropdownMenu tShirtField = (DropdownMenu) getStyledInterface(new DropdownMenu(PARAMETER_SHIRT_SIZE)); tShirtField.addOption(new SelectOption(localize("run_reg.select_tee_shirt_size", "Select tee-shirt size"), "-1")); tShirtField.addOption(new SelectOption(localize("run_reg.adult_sized", "Adult sizes"), "-1")); tShirtField.addOption(new SelectOption("- " + localize("run_reg.small", "Small"), IWMarathonConstants.PARAMETER_TSHIRT_S)); tShirtField.addOption(new SelectOption("- " + localize("run_reg.medium", "Medium"), IWMarathonConstants.PARAMETER_TSHIRT_M)); tShirtField.addOption(new SelectOption("- " + localize("run_reg.large", "Large"), IWMarathonConstants.PARAMETER_TSHIRT_L)); tShirtField.addOption(new SelectOption("- " + localize("run_reg.xlarge", "Larger"), IWMarathonConstants.PARAMETER_TSHIRT_XL)); tShirtField.addOption(new SelectOption("- " + localize("run_reg.xxlarge", "Largest"), IWMarathonConstants.PARAMETER_TSHIRT_XXL)); tShirtField.addOption(new SelectOption(localize("run_reg.kids_sized", "Kids sizes"), "-1")); tShirtField.addOption(new SelectOption("- " + localize("run_reg.small_kids", "Small"), IWMarathonConstants.PARAMETER_TSHIRT_S + "_kids")); tShirtField.addOption(new SelectOption("- " + localize("run_reg.medium_kids", "Medium"), IWMarathonConstants.PARAMETER_TSHIRT_M + "_kids")); tShirtField.addOption(new SelectOption("- " + localize("run_reg.large_kids", "Large"), IWMarathonConstants.PARAMETER_TSHIRT_L + "_kids")); tShirtField.addOption(new SelectOption("- " + localize("run_reg.xlarge_kids", "Larger"), IWMarathonConstants.PARAMETER_TSHIRT_XL + "_kids")); tShirtField.setAsNotEmpty(localize("run_reg.must_select_shirt_size", "You must select tee-shirt size"), "-1"); if (runner.getShirtSize() != null) { tShirtField.setSelectedElement(runner.getShirtSize()); } choiceTable.add(getHeader(localize(IWMarathonConstants.RR_COUNTRY, "Country")), 1, iRow); choiceTable.add(redStar, 1, iRow); choiceTable.add(getHeader(localize(IWMarathonConstants.RR_TSHIRT, "T-Shirt")), 3, iRow++); choiceTable.add(countryField, 1, iRow); choiceTable.add(tShirtField, 3, iRow++); SubmitButton next = (SubmitButton) getButton(new SubmitButton(localize("next", "Next"))); next.setValueOnClick(PARAMETER_ACTION, String.valueOf(ACTION_STEP_THREE)); table.setHeight(row++, 18); table.add(next, 1, row); table.setAlignment(1, row, Table.HORIZONTAL_ALIGN_RIGHT); add(form); } | 14024 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/14024/4d9c93b4243d7053845f5c3d88248c835131a344/Registration.java/clean/src/java/is/idega/idegaweb/marathon/presentation/Registration.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
2235,
11710,
12,
45,
59,
1042,
25522,
71,
13,
1216,
18361,
288,
202,
202,
1204,
646,
273,
394,
2748,
5621,
202,
202,
687,
18,
81,
1598,
530,
1662,
12,
9819,
67,
3194,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2235,
11710,
12,
45,
59,
1042,
25522,
71,
13,
1216,
18361,
288,
202,
202,
1204,
646,
273,
394,
2748,
5621,
202,
202,
687,
18,
81,
1598,
530,
1662,
12,
9819,
67,
3194,
... |
System.out.println("FILTER=" + requestedURI); | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { //if (filterConfig == null) // return; HttpServletRequest req = (HttpServletRequest) request; String requestedURI = req.getRequestURI(); String stuff = req.getRequestURI(); System.out.println("FILTER=" + requestedURI); String rh= req.getRemoteHost(); String p = req.getParameter("jsp_precompile"); int numParams = req.getParameterMap().keySet().size(); // allow jsp precompilation if ((p != null) && ("localhost".equals(rh)) && (numParams == 1)){ chain.doFilter(request, response); return; } String fqHostName = System.getProperty("fullyQualifiedHostName"); if (fqHostName == null) fqHostName = InetAddress.getLocalHost().getCanonicalHostName(); if (fqHostName.equals("localhost")) fqHostName = "127.0.0.1"; String serverName = request.getServerName(); if (!fqHostName.equalsIgnoreCase(serverName)) { redirectToFullyQualifiedHostName((HttpServletRequest)request, (HttpServletResponse )response); return; } String userId = null; boolean isLogin = requestedURI.indexOf("login.jsp") >= 0; boolean isResultFetch = (requestedURI.indexOf("retrieveResults.jsp") >= 0) || (requestedURI.indexOf("getFile.jsp") >= 0); if (!(isLogin || isResultFetch )) { userId = _getUserID((HttpServletRequest) request); System.out.println("UserID=" + userId); if (userId == null){ setLoginPageRedirect((HttpServletRequest)request, (HttpServletResponse )response); return ; } request.setAttribute("userID", userId); chain.doFilter(request, response); } else { // looking for userID System.out.println("Filter: Redirecting to login"); chain.doFilter(request, response); return; } } | 57344 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57344/cf1eca544295d6797312803d2291f1b14757a0cb/AuthenticationFilter.java/clean/src/org/genepattern/server/webapp/AuthenticationFilter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
741,
1586,
12,
18572,
590,
16,
7971,
1064,
766,
16,
4008,
3893,
2687,
13,
1216,
1860,
16,
16517,
288,
4202,
202,
759,
430,
261,
2188,
809,
422,
446,
13,
4202,
202,
759,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
741,
1586,
12,
18572,
590,
16,
7971,
1064,
766,
16,
4008,
3893,
2687,
13,
1216,
1860,
16,
16517,
288,
4202,
202,
759,
430,
261,
2188,
809,
422,
446,
13,
4202,
202,
759,
... | |
assertEquals("Ross", ((Person) result.getPayload()).getFirstName()); assertEquals("Mason", ((Person) result.getPayload()).getLastName()); | assertEquals("Betty", ((Person) result.getPayload()).getFirstName()); assertEquals("Rubble", ((Person) result.getPayload()).getLastName()); | public void testRequestResponseComplex2() throws Exception { MuleClient client = new MuleClient(); String[] args = new String[] { "Ross", "Mason" }; UMOMessage result = client.send("axis:http://localhost:38104/mule/services/mycomponent3?method=addPerson", args, null); assertNotNull(result); assertTrue(result.getPayload() instanceof Person); assertEquals("Ross", ((Person) result.getPayload()).getFirstName()); assertEquals("Mason", ((Person) result.getPayload()).getLastName()); // do a receive result = client.send("axis:http://localhost:38104/mule/services/mycomponent3?method=getPerson", "Ross", null); assertNotNull(result); assertTrue(result.getPayload() instanceof Person); assertEquals("Ross", ((Person) result.getPayload()).getFirstName()); assertEquals("Mason", ((Person) result.getPayload()).getLastName()); } | 28323 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/28323/b656e0806058d87c5db05880209b51a8d57416d0/MuleClientAxisTestCase.java/buggy/tests/integration/src/test/java/org/mule/test/integration/client/MuleClientAxisTestCase.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
691,
1064,
12795,
22,
1435,
1216,
1185,
565,
288,
3639,
490,
725,
1227,
1004,
273,
394,
490,
725,
1227,
5621,
3639,
514,
8526,
833,
273,
394,
514,
8526,
288,
315,
54,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
691,
1064,
12795,
22,
1435,
1216,
1185,
565,
288,
3639,
490,
725,
1227,
1004,
273,
394,
490,
725,
1227,
5621,
3639,
514,
8526,
833,
273,
394,
514,
8526,
288,
315,
54,
8... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.