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 |
|---|---|---|---|---|---|---|
int wildPos, starPos, questionPos; | int wildPos, starPos = -1, questionPos; | public static final char[] bestPrefix( char [] prefix, char optionalType, char[] name, char[][] containingTypes, int matchMode, boolean isCaseSensitive) { char[] result = null; int pos = 0; int wildPos, starPos, questionPos; //length of prefix + separator int length = prefix.length; //add length for optional type + another separator if( optionalType != 0 ) length += 2; if (!isCaseSensitive){ //index is case sensitive, thus in case attempting case insensitive search, cannot consider //type name. name = null; } else if( matchMode == PATTERN_MATCH && name != null ){ starPos = CharOperation.indexOf( '*', name ); questionPos = CharOperation.indexOf( '?', name ); if( starPos >= 0 ){ if( questionPos >= 0 ) wildPos = ( starPos < questionPos ) ? starPos : questionPos; else wildPos = starPos; } else { wildPos = questionPos; } switch( wildPos ){ case -1 : break; case 0 : name = null; break; default : name = CharOperation.subarray( name, 0, wildPos ); break; } } //add length for name if( name != null ){ length += name.length; } else { //name is null, don't even consider qualifications. result = new char [ length ]; System.arraycopy( prefix, 0, result, 0, pos = prefix.length ); if( optionalType != 0){ result[ pos++ ] = optionalType; result[ pos++ ] = SEPARATOR; } return result; } //add the total length of the qualifiers //we don't want to mess with the contents of this array (treat it as constant) //so check for wild cards later. if( containingTypes != null ){ for( int i = 0; i < containingTypes.length; i++ ){ if( containingTypes[i].length > 0 ){ length += containingTypes[ i ].length; length++; //separator } } } //because we haven't checked qualifier wild cards yet, this array might turn out //to be too long. So fill a temp array, then check the length after char [] temp = new char [ length ]; System.arraycopy( prefix, 0, temp, 0, pos = prefix.length ); if( optionalType != 0 ){ temp[ pos++ ] = optionalType; temp[ pos++ ] = SEPARATOR; } System.arraycopy( name, 0, temp, pos, name.length ); pos += name.length; if( containingTypes != null ){ for( int i = containingTypes.length - 1; i >= 0; i-- ){ if( matchMode == PATTERN_MATCH ){ starPos = CharOperation.indexOf( '*', containingTypes[i] ); questionPos = CharOperation.indexOf( '?', containingTypes[i] ); if( starPos >= 0 ){ if( questionPos >= 0 ) wildPos = ( starPos < questionPos ) ? starPos : questionPos; else wildPos = starPos; } else { wildPos = questionPos; } if( wildPos >= 0 ){ temp[ pos++ ] = SEPARATOR; System.arraycopy( containingTypes[i], 0, temp, pos, wildPos ); pos += starPos; break; } } if( containingTypes[i].length > 0 ){ temp[ pos++ ] = SEPARATOR; System.arraycopy( containingTypes[i], 0, temp, pos, containingTypes[i].length ); pos += containingTypes[i].length; } } } if( pos < length ){ result = new char[ pos ]; System.arraycopy( temp, 0, result, 0, pos ); } else { result = temp; } return result; } | 54911 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54911/51a73af86dfc48263b870da877579caead870558/AbstractIndexer.java/buggy/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
760,
727,
1149,
8526,
3796,
2244,
12,
1149,
5378,
1633,
16,
1149,
3129,
559,
16,
1149,
8526,
508,
16,
1149,
63,
6362,
65,
4191,
2016,
16,
509,
845,
2309,
16,
1250,
353,
2449,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
727,
1149,
8526,
3796,
2244,
12,
1149,
5378,
1633,
16,
1149,
3129,
559,
16,
1149,
8526,
508,
16,
1149,
63,
6362,
65,
4191,
2016,
16,
509,
845,
2309,
16,
1250,
353,
2449,
... |
LOSDialog ld = new LOSDialog(frame, client.game.getMechInFirst(), client.game.getMechInSecond()); | GUIPreferences gp = GUIPreferences.getInstance(); LOSDialog ld = new LOSDialog(frame, gp.getMechInFirst(), gp.getMechInSecond()); | public void showLOSSettingDialog() { LOSDialog ld = new LOSDialog(frame, client.game.getMechInFirst(), client.game.getMechInSecond()); ld.show(); client.game.setMechInFirst(ld.getMechInFirst()); client.game.setMechInSecond(ld.getMechInSecond()); } | 4135 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4135/92a73ae877ead830a9e6ebc17df507943de8c895/ClientGUI.java/clean/megamek/src/megamek/client/ui/AWT/ClientGUI.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
2405,
1502,
55,
5568,
6353,
1435,
288,
3639,
10978,
12377,
4178,
273,
10978,
12377,
18,
588,
1442,
5621,
1806,
55,
6353,
16916,
273,
394,
1806,
55,
6353,
12,
3789,
16,
4178,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
2405,
1502,
55,
5568,
6353,
1435,
288,
3639,
10978,
12377,
4178,
273,
10978,
12377,
18,
588,
1442,
5621,
1806,
55,
6353,
16916,
273,
394,
1806,
55,
6353,
12,
3789,
16,
4178,
18... |
throw (RuntimeException)itExcptn.getTargetException(); | throw (RuntimeException) itExcptn.getTargetException(); | protected RubyObject invokeMethod(RubyObject recv, Object[] methodArgs, Ruby ruby) { if (restArgs) { RubyObject[] restArray = new RubyObject[methodArgs.length - (args.length - 1)]; Object[] newMethodArgs = new Object[args.length]; try { System.arraycopy(methodArgs, args.length - 1, restArray, 0, methodArgs.length - (args.length - 1)); } catch (ArrayIndexOutOfBoundsException aioobExcptn) { throw new RuntimeException("Cannot call \"" + methodName + "\" in class \"" + klass.getName() + "\". " + getExceptedArgsString((RubyObject[])methodArgs)); } System.arraycopy(methodArgs, 0, newMethodArgs, 0, args.length - 1); newMethodArgs[args.length - 1] = restArray; methodArgs = newMethodArgs; } if (staticMethod) { Object[] newMethodArgs = new Object[methodArgs.length + 2]; System.arraycopy(methodArgs, 0, newMethodArgs, 2, methodArgs.length); newMethodArgs[0] = ruby; newMethodArgs[1] = recv; methodArgs = newMethodArgs; } try { return (RubyObject)getMethod().invoke(staticMethod ? null : recv, methodArgs); } catch (InvocationTargetException itExcptn) { if (itExcptn.getTargetException() instanceof RaiseException) { throw (RaiseException)itExcptn.getTargetException(); } else if (itExcptn.getTargetException() instanceof RuntimeException) { throw (RuntimeException)itExcptn.getTargetException(); } else { System.err.println("[ERROR] ReflectionCallback:"); itExcptn.getTargetException().printStackTrace(); return ruby.getNil(); } } catch (IllegalAccessException iaExcptn) { throw new RaiseException(ruby, "RuntimeError", iaExcptn.getMessage()); } catch (IllegalArgumentException iaExcptn) { throw new RaiseException(ruby, "RuntimeError", iaExcptn.getMessage()); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7f0711e7cbb2b441d095c8d8c0838be2b630638c/ReflectionCallbackMethod.java/clean/org/jruby/runtime/ReflectionCallbackMethod.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
19817,
921,
27632,
12,
54,
10340,
921,
10665,
16,
1033,
8526,
707,
2615,
16,
19817,
22155,
13,
288,
3639,
309,
261,
8792,
2615,
13,
288,
5411,
19817,
921,
8526,
3127,
1076,
273,
394... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
4750,
19817,
921,
27632,
12,
54,
10340,
921,
10665,
16,
1033,
8526,
707,
2615,
16,
19817,
22155,
13,
288,
3639,
309,
261,
8792,
2615,
13,
288,
5411,
19817,
921,
8526,
3127,
1076,
273,
394... |
Parser.Rule matchedRule = editor.rules.getRuleAtPosition(candidate.start); | Parser.Rule matchedRule = editor.rules.getRuleAtPosition(candidate.getStart()); | public void findUsage() { Token token = getTokenAtPosition(getCaretPosition()); if(token == null) return; String tokenAttribute = token.getAttribute(); TUsage usage = new TUsage(editor); editor.getTabbedPane().add("Usages of \""+tokenAttribute+"\"", usage.getContainer()); editor.getTabbedPane().setSelectedIndex(editor.getTabbedPane().getTabCount()-1); Iterator iterator = editor.getTokens().iterator(); while(iterator.hasNext()) { Token candidate = (Token)iterator.next(); if(candidate.getAttribute().equals(tokenAttribute)) { Parser.Rule matchedRule = editor.rules.getRuleAtPosition(candidate.start); if(matchedRule != null) usage.addMatch(matchedRule, candidate); } } Statistics.shared().recordEvent(Statistics.EVENT_FIND_USAGES); } | 51505 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51505/f13d59e2934691783709edc81c3eb7cea20d0849/MenuGrammar.java/clean/src/org/antlr/works/editor/actions/MenuGrammar.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1104,
5357,
1435,
288,
3639,
3155,
1147,
273,
9162,
861,
2555,
12,
588,
39,
20731,
2555,
10663,
3639,
309,
12,
2316,
422,
446,
13,
5411,
327,
31,
3639,
514,
1147,
1499,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1104,
5357,
1435,
288,
3639,
3155,
1147,
273,
9162,
861,
2555,
12,
588,
39,
20731,
2555,
10663,
3639,
309,
12,
2316,
422,
446,
13,
5411,
327,
31,
3639,
514,
1147,
1499,
273,
... |
setModified(true); | public void setCreateDate(Date createDate) { if (((createDate == null) && (_createDate != null)) || ((createDate != null) && (_createDate == null)) || ((createDate != null) && (_createDate != null) && !createDate.equals(_createDate))) { _createDate = createDate; setModified(true); } } | 53908 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53908/f4d6afc6707f57fd84bf6b624f0c119657b0a766/ReleaseModel.java/buggy/portal-ejb/src/com/liferay/portal/model/ReleaseModel.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
444,
1684,
1626,
12,
1626,
752,
1626,
13,
288,
202,
202,
430,
261,
12443,
2640,
1626,
422,
446,
13,
597,
261,
67,
2640,
1626,
480,
446,
3719,
747,
9506,
202,
12443,
2640,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
444,
1684,
1626,
12,
1626,
752,
1626,
13,
288,
202,
202,
430,
261,
12443,
2640,
1626,
422,
446,
13,
597,
261,
67,
2640,
1626,
480,
446,
3719,
747,
9506,
202,
12443,
2640,... | |
throw new IllegalArgumentException("no argument may be less then 1"); | throw new IllegalArgumentException("no argument may be less than 1"); | public ResolutionSyntax(int crossFeedResolution, int feedResolution, int units) { if (crossFeedResolution < 1 || feedResolution < 1 || units < 1) throw new IllegalArgumentException("no argument may be less then 1"); this.crossFeedResolution = crossFeedResolution * units; this.feedResolution = feedResolution * units; } | 25352 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/25352/f6df144a51f6df4ab5f69c781f796e6a912ade6a/ResolutionSyntax.java/buggy/libjava/javax/print/attribute/ResolutionSyntax.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
24933,
8070,
12,
474,
6828,
8141,
11098,
16,
509,
4746,
11098,
16,
12900,
509,
4971,
13,
225,
288,
565,
309,
261,
14653,
8141,
11098,
411,
404,
3639,
747,
4746,
11098,
411,
404,
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,
282,
1071,
24933,
8070,
12,
474,
6828,
8141,
11098,
16,
509,
4746,
11098,
16,
12900,
509,
4971,
13,
225,
288,
565,
309,
261,
14653,
8141,
11098,
411,
404,
3639,
747,
4746,
11098,
411,
404,
363... |
MylarPlugin.log(ex, "couldn't open summary editor"); | ErrorLogger.log(ex, "couldn't open summary editor"); | public void run(IAction action) { if (action instanceof ViewPluginAction) { ViewPluginAction objectAction = (ViewPluginAction)action; final List<File> files = getStatsFilesFromSelection(objectAction); Workbench.getInstance().getDisplay().asyncExec(new Runnable() { public void run() { try { List<IUsageCollector> delegates = new ArrayList<IUsageCollector>(); delegates.add(new ViewUsageCollector()); delegates.add(new PerspectiveUsageCollector()); delegates.add(new CommandUsageCollector());// delegates.add(new CsvOutputCollector()); delegates.add(new SummaryCollector()); DelegatingUsageCollector collector = new DelegatingUsageCollector(); collector.setReportTitle("Usage Summary"); collector.setDelegates(delegates); ReportGenerator generator = new ReportGenerator(MylarMonitorPlugin.getDefault().getInteractionLogger(), collector); IWorkbenchPage page = MylarReportsPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage(); if (page == null) return; IEditorInput input = new UsageStatsEditorInput(files, generator); page.openEditor(input, MylarReportsPlugin.REPORT_SUMMARY_ID); } catch (PartInitException ex) { MylarPlugin.log(ex, "couldn't open summary editor"); } } }); } } | 51151 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51151/6e4c36ce82823e91011a538b1e18917054cfdf11/UsageSummaryAction.java/buggy/sandbox/org.eclipse.mylyn.monitor.reports/src/org/eclipse/mylyn/monitor/reports/ui/actions/UsageSummaryAction.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1086,
12,
45,
1803,
1301,
13,
288,
377,
202,
430,
261,
1128,
1276,
4441,
3773,
1803,
13,
288,
377,
202,
202,
1767,
3773,
1803,
733,
1803,
273,
261,
1767,
3773,
1803,
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,
225,
202,
482,
918,
1086,
12,
45,
1803,
1301,
13,
288,
377,
202,
430,
261,
1128,
1276,
4441,
3773,
1803,
13,
288,
377,
202,
202,
1767,
3773,
1803,
733,
1803,
273,
261,
1767,
3773,
1803,
13,
... |
img = (java.awt.Image) _ids.loadImage( new URL( sUrl ) ); | try { byte[] data = Base64.decode( ( (EmbeddedImage) flBackground ).getData( ) ); img = createImage( data ); } catch ( Exception ilex ) { throw new ChartException( ChartDeviceExtensionPlugin.ID, ChartException.RENDERING, ilex ); } | public void fillOval( OvalRenderEvent ore ) throws ChartException { final Fill flBackground = ore.getBackground( ); final Bounds bo = ore.getBounds( ); final Ellipse2D.Double e2d = new Ellipse2D.Double( bo.getLeft( ), bo.getTop( ), bo.getWidth( ), bo.getHeight( ) ); if ( flBackground instanceof ColorDefinition ) { final ColorDefinition cd = (ColorDefinition) flBackground; _g2d.setColor( (Color) _ids.getColor( cd ) ); _g2d.fill( e2d ); } else if ( flBackground instanceof Gradient ) { final Gradient g = (Gradient) flBackground; final ColorDefinition cdStart = (ColorDefinition) g.getStartColor( ); final ColorDefinition cdEnd = (ColorDefinition) g.getEndColor( ); // boolean bCyclic = g.isCyclic(); double dAngleInDegrees = g.getDirection( ); final double dAngleInRadians = ( ( -dAngleInDegrees * Math.PI ) / 180.0 ); // int iAlpha = g.getTransparency(); /* * if (bCyclic) { } */ if ( dAngleInDegrees < -90 || dAngleInDegrees > 90 ) { throw new ChartException( ChartDeviceExtensionPlugin.ID, ChartException.RENDERING, "exception.gradient.angle",//$NON-NLS-1$ new Object[]{ new Double( dAngleInDegrees ) }, ResourceBundle.getBundle( Messages.DEVICE_EXTENSION, getLocale( ) ) ); } Point2D.Double p2dStart, p2dEnd; if ( dAngleInDegrees == 90 ) { p2dStart = new Point2D.Double( bo.getLeft( ), bo.getTop( ) + bo.getHeight( ) ); p2dEnd = new Point2D.Double( bo.getLeft( ), bo.getTop( ) ); } else if ( dAngleInDegrees == -90 ) { p2dEnd = new Point2D.Double( bo.getLeft( ), bo.getTop( ) + bo.getHeight( ) ); p2dStart = new Point2D.Double( bo.getLeft( ), bo.getTop( ) ); } else if ( dAngleInDegrees > 0 ) { p2dStart = new Point2D.Double( bo.getLeft( ), bo.getTop( ) + bo.getHeight( ) ); p2dEnd = new Point2D.Double( bo.getLeft( ) + bo.getWidth( ), bo.getTop( ) + bo.getHeight( ) - bo.getWidth( ) * Math.abs( Math.tan( dAngleInRadians ) ) ); } else if ( dAngleInDegrees < 0 ) { p2dStart = new Point2D.Double( bo.getLeft( ), bo.getTop( ) ); p2dEnd = new Point2D.Double( bo.getLeft( ) + bo.getWidth( ), bo.getTop( ) + bo.getWidth( ) * Math.abs( Math.tan( dAngleInRadians ) ) ); } else { p2dStart = new Point2D.Double( bo.getLeft( ), bo.getTop( ) ); p2dEnd = new Point2D.Double( bo.getLeft( ) + bo.getWidth( ), bo.getTop( ) ); } _g2d.setPaint( new GradientPaint( p2dStart, (Color) _ids.getColor( cdStart ), p2dEnd, (Color) _ids.getColor( cdEnd ) ) ); _g2d.fill( e2d ); } else if ( flBackground instanceof org.eclipse.birt.chart.model.attribute.Image ) { final String sUrl = ( (org.eclipse.birt.chart.model.attribute.Image) flBackground ).getURL( ); java.awt.Image img = null; try { img = (java.awt.Image) _ids.loadImage( new URL( sUrl ) ); } catch ( ChartException ilex ) { throw new ChartException( ChartDeviceExtensionPlugin.ID, ChartException.RENDERING, ilex ); } catch ( MalformedURLException muex ) { throw new ChartException( ChartDeviceExtensionPlugin.ID, ChartException.RENDERING, muex ); } final Shape shClip = _g2d.getClip( ); Area ar1 = new Area( shClip ); Area ar2 = new Area( e2d ); ar2.intersect( ar1 ); _g2d.setClip( ar2 ); final Size szImage = _ids.getSize( img ); int iXRepeat = (int) ( Math.ceil( e2d.width / szImage.getWidth( ) ) ); int iYRepeat = (int) ( Math.ceil( e2d.height / szImage.getHeight( ) ) ); ImageObserver io = (ImageObserver) _ids.getObserver( ); for ( int i = 0; i < iXRepeat; i++ ) { for ( int j = 0; j < iYRepeat; j++ ) { _g2d.drawImage( img, (int) ( e2d.x + i * szImage.getWidth( ) ), (int) ( e2d.y + j * szImage.getHeight( ) ), io ); } } // img.flush(); // FLUSHED LATER BY CACHE; DON'T FLUSH HERE _g2d.setClip( shClip ); // RESTORE } } | 15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/99ab478a2cd0ab25560606c29779d9cf026ebe25/SwingRendererImpl.java/clean/chart/org.eclipse.birt.chart.device.extension/src/org/eclipse/birt/chart/device/swing/SwingRendererImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
3636,
51,
1125,
12,
531,
1125,
3420,
1133,
320,
266,
262,
1216,
14804,
503,
202,
95,
202,
202,
6385,
14192,
1183,
8199,
273,
320,
266,
18,
588,
8199,
12,
11272,
202,
202,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
3636,
51,
1125,
12,
531,
1125,
3420,
1133,
320,
266,
262,
1216,
14804,
503,
202,
95,
202,
202,
6385,
14192,
1183,
8199,
273,
320,
266,
18,
588,
8199,
12,
11272,
202,
202,... |
jdk.getVersionString().indexOf("1.5") > 0 && | JavaSdk.getInstance().compareTo(jdk.getVersionString(), "1.5") >= 0 && | public boolean isAvailable(Project project, Editor editor, PsiFile file) { final Module module = ModuleUtil.findModuleForPsiElement(myContext); if (module == null) return false; final ProjectJdk jdk = ModuleRootManager.getInstance(module).getJdk(); if (jdk == null) return false; if (DaemonCodeAnalyzerSettings.getInstance().SUPPRESS_WARNINGS && jdk.getVersionString().indexOf("1.5") > 0 && LanguageLevel.JDK_1_5.compareTo(PsiUtil.getLanguageLevel(myContext)) <= 0) return false; final PsiDocCommentOwner container = getContainer(); return myContext.isValid() && myContext.getManager().isInProject(myContext) && container != null && !(container instanceof JspHolderMethod); } | 56627 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56627/7f8b6b854d7639111c3f49ad5e5b3d9966c6adfe/AddNoInspectionDocTagAction.java/clean/codeInsight/impl/com/intellij/codeInsight/daemon/impl/AddNoInspectionDocTagAction.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
1250,
28293,
12,
4109,
1984,
16,
18451,
4858,
16,
453,
7722,
812,
585,
13,
288,
565,
727,
5924,
1605,
273,
5924,
1304,
18,
4720,
3120,
1290,
52,
7722,
1046,
12,
4811,
1042,
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,
282,
1071,
1250,
28293,
12,
4109,
1984,
16,
18451,
4858,
16,
453,
7722,
812,
585,
13,
288,
565,
727,
5924,
1605,
273,
5924,
1304,
18,
4720,
3120,
1290,
52,
7722,
1046,
12,
4811,
1042,
1769,
... |
System.out.println("Reading serialized object"); | public static Object instantiate(ClassLoader cld, String beanName) throws IOException, ClassNotFoundException {System.out.println("Beans:instantiate: name=" + beanName + ", loader=" + cld); if (cld == null) { cld = SystemClassLoader.getClassLoader(); } InputStream in = cld.getResourceAsStream(beanName.replace('.', '/') + ".ser"); Object obj; if (in != null) {System.out.println("Reading serialized object"); obj = (new ClassLoaderObjectInputStream(in, cld)).readObject(); } else { try {System.out.println("Creating new instance"); obj = cld.loadClass(beanName).newInstance(); } catch (InstantiationException _) {System.out.println("InstantiationException"); throw new ClassNotFoundException(beanName); } catch (IllegalAccessException _) {System.out.println("IllegalAccessException"); throw new ClassNotFoundException(beanName); } } return (obj);} | 45713 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45713/06e7e9b156ff83048f7b63b268ef1cdd965a5fc5/Beans.java/buggy/libraries/javalib/java/beans/Beans.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
760,
1033,
10275,
12,
7805,
23451,
16,
514,
17932,
13,
1216,
1860,
16,
10403,
288,
3163,
18,
659,
18,
8222,
2932,
14495,
30,
24628,
3840,
30,
508,
1546,
397,
17932,
397,
3104,
4088,
1546... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
760,
1033,
10275,
12,
7805,
23451,
16,
514,
17932,
13,
1216,
1860,
16,
10403,
288,
3163,
18,
659,
18,
8222,
2932,
14495,
30,
24628,
3840,
30,
508,
1546,
397,
17932,
397,
3104,
4088,
1546... | |
Object selectedObject = ((IStructuredSelection) TaskListView.getFromActivePerspective().getViewer().getSelection()) .getFirstElement(); | Object selectedObject = ((IStructuredSelection) TaskListView.getFromActivePerspective().getViewer() .getSelection()).getFirstElement(); | public final boolean performFinish() { AbstractRepositoryConnector connector = MylarTaskListPlugin.getRepositoryManager().getRepositoryConnector( this.repository.getKind()); ITask newTask = connector.createTaskFromExistingKey(repository, getTaskId()); if (newTask != null && TaskListView.getFromActivePerspective() != null) { Object selectedObject = ((IStructuredSelection) TaskListView.getFromActivePerspective().getViewer().getSelection()) .getFirstElement(); if (selectedObject instanceof TaskCategory) { MylarTaskListPlugin.getTaskListManager().getTaskList().moveToContainer(((TaskCategory) selectedObject), newTask); } else { MylarTaskListPlugin.getTaskListManager().getTaskList().moveToRoot(newTask); } if (TaskListView.getFromActivePerspective() != null) { TaskListView.getFromActivePerspective().getViewer().setSelection(new StructuredSelection(newTask)); } } return true; } | 51151 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51151/9f7b425ebe40b57391edde8836bf0743b3191033/AbstractAddExistingTaskWizard.java/buggy/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/AbstractAddExistingTaskWizard.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
727,
1250,
3073,
11641,
1435,
288,
202,
202,
7469,
3305,
7487,
8703,
273,
8005,
7901,
2174,
682,
3773,
18,
588,
3305,
1318,
7675,
588,
3305,
7487,
12,
9506,
202,
2211,
18,
9071,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
727,
1250,
3073,
11641,
1435,
288,
202,
202,
7469,
3305,
7487,
8703,
273,
8005,
7901,
2174,
682,
3773,
18,
588,
3305,
1318,
7675,
588,
3305,
7487,
12,
9506,
202,
2211,
18,
9071,... |
myTodoTreeBuilder.dispose(); | Disposer.dispose(myTodoTreeBuilder); | void dispose() { myTodoTreeBuilder.dispose(); myVisibilityWatcher.deinstall(this); myVisibilityWatcher = null; myProject = null; } | 56598 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56598/8d49b43184460e7ec1fcd7632132ba7e586d295c/TodoPanel.java/buggy/source/com/intellij/ide/todo/TodoPanel.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
918,
15825,
1435,
288,
565,
3035,
5607,
18,
2251,
4150,
12,
4811,
56,
7370,
25060,
1769,
565,
3399,
10135,
9918,
18,
323,
5425,
12,
2211,
1769,
565,
3399,
10135,
9918,
273,
446,
31,
565,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
918,
15825,
1435,
288,
565,
3035,
5607,
18,
2251,
4150,
12,
4811,
56,
7370,
25060,
1769,
565,
3399,
10135,
9918,
18,
323,
5425,
12,
2211,
1769,
565,
3399,
10135,
9918,
273,
446,
31,
565,
... |
args[i] = cast(gen.Ident(params1[i]), symparams[i].type()); | args[i] = cast(gen.Ident(params1[i]), symparams[i].type().erasure()); | public void addBridge(Symbol sym, Symbol sym1) { Type bridgeType = sym1.type().erasure(); // create bridge symbol and add to bridgeSyms(sym) // or return if bridge with required type already exists for sym. SymSet bridgesOfSym = (SymSet) bridgeSyms.get(sym); if (bridgesOfSym == null) bridgesOfSym = SymSet.EMPTY; Symbol[] brs = bridgesOfSym.toArray(); for (int i = 0; i < brs.length; i++) { if (brs[i].type().isSameAs(bridgeType)) return; } Symbol bridgeSym = sym.cloneSymbol(); bridgeSym.flags |= (SYNTHETIC | BRIDGE); bridgeSym.flags &= ~JAVA; bridgesOfSym = bridgesOfSym.incl(bridgeSym); bridgeSyms.put(sym, bridgesOfSym); // check that there is no overloaded symbol with same erasure as bridge Symbol overSym = sym.owner().members().lookup(sym.name); switch (overSym.type()) { case OverloadedType(Symbol[] alts, Type[] alttypes): for (int i = 0; i < alts.length; i++) { if (sym != alts[i] && bridgeType.isSameAs(alttypes[i].erasure())) { unit.error(sym.pos, "overlapping overloaded alternatives; " + "overridden " + sym1 + sym1.locationString() + " has same erasure as " + alts[i] + alttypes[i] + alts[i].locationString()); } } } switch (bridgeType) { case MethodType(Symbol[] params, Type restp): // assign to bridge symbol its bridge type // where owner of all parameters is bridge symbol itself. Symbol[] params1 = new Symbol[params.length]; for (int i = 0; i < params.length; i++) { params1[i] = params[i].cloneSymbol(); params1[i].setOwner(bridgeSym); } bridgeSym.setType(Type.MethodType(params1, restp)); // create bridge definition Type symtype = sym.type().erasure(); switch (symtype) { case MethodType(Symbol[] symparams, Type symrestp): assert params1.length == symparams.length; Tree[] args = new Tree[params1.length]; for (int i = 0; i < args.length; i++) { args[i] = cast(gen.Ident(params1[i]), symparams[i].type()); } Tree fwd = make.Apply(sym.pos, gen.Ident(sym).setType(symtype), args) .setType(symrestp); bridges.append(gen.DefDef(bridgeSym, coerce(fwd, restp))); return; } } throw Debug.abort("bad bridge types " + bridgeType + "," + sym.type().erasure()); } | 10130 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/10130/f4f582966af1fb2cd0179b63f92cf86c13156111/Erasure.java/buggy/sources/scalac/transformer/Erasure.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
527,
13691,
12,
5335,
5382,
16,
8565,
5382,
21,
13,
288,
202,
559,
10105,
559,
273,
5382,
21,
18,
723,
7675,
264,
3619,
5621,
202,
759,
752,
10105,
3273,
471,
527,
358,
10105... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
527,
13691,
12,
5335,
5382,
16,
8565,
5382,
21,
13,
288,
202,
559,
10105,
559,
273,
5382,
21,
18,
723,
7675,
264,
3619,
5621,
202,
759,
752,
10105,
3273,
471,
527,
358,
10105... |
MyFoo a = new MyFoo(); a = new MyFoo(10); | director_default_MyFoo a = new director_default_MyFoo(); a = new director_default_MyFoo(10); | public static void main(String argv[]) { { MyFoo a = new MyFoo(); a = new MyFoo(10); } MyFoo a = new MyFoo(); if (!a.GetMsg().equals("MyFoo-default")) { throw new RuntimeException ( "Test 1 failed" ); } if (!a.GetMsg("boo").equals("MyFoo-boo")) { throw new RuntimeException ( "Test 2 failed" ); } Foo b = new Foo(); if (!b.GetMsg().equals("Foo-default")) { throw new RuntimeException ( "Test 1 failed" ); } if (!b.GetMsg("boo").equals("Foo-boo")) { throw new RuntimeException ( "Test 2 failed" ); } } | 45321 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45321/676f166752f4d6323f0b425c6ade22b8185bdaba/director_default_runme.java/clean/SWIG/Examples/test-suite/java/director_default_runme.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
918,
2774,
12,
780,
5261,
63,
5717,
288,
565,
288,
1377,
8005,
42,
5161,
279,
273,
394,
8005,
42,
5161,
5621,
1377,
279,
273,
394,
8005,
42,
5161,
12,
2163,
1769,
565,
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,
282,
1071,
760,
918,
2774,
12,
780,
5261,
63,
5717,
288,
565,
288,
1377,
8005,
42,
5161,
279,
273,
394,
8005,
42,
5161,
5621,
1377,
279,
273,
394,
8005,
42,
5161,
12,
2163,
1769,
565,
289,
... |
int i; Object lhs; final int maxStack = theData.itsMaxStack; | final Object DBL_MRK = Interpreter.DBL_MRK; final Scriptable undefined = Undefined.instance; final int VAR_SHFT = theData.itsMaxStack; | public static Object interpret(Context cx, Scriptable scope, Scriptable thisObj, Object[] args, NativeFunction fnOrScript, InterpreterData theData) throws JavaScriptException { if (cx.interpreterSecurityDomain != theData.securityDomain) { // If securityDomain is different, update domain in Cotext // and call self under new domain Object savedDomain = cx.interpreterSecurityDomain; cx.interpreterSecurityDomain = theData.securityDomain; try { return interpret(cx, scope, thisObj, args, fnOrScript, theData); } finally { cx.interpreterSecurityDomain = savedDomain; } } int i; Object lhs; final int maxStack = theData.itsMaxStack; final int maxVars = (fnOrScript.argNames == null) ? 0 : fnOrScript.argNames.length; final int maxLocals = theData.itsMaxLocals; final int maxTryDepth = theData.itsMaxTryDepth; final int VAR_SHFT = maxStack; final int LOCAL_SHFT = VAR_SHFT + maxVars; final int TRY_SCOPE_SHFT = LOCAL_SHFT + maxLocals;// stack[0 <= i < VAR_SHFT]: stack data// stack[VAR_SHFT <= i < LOCAL_SHFT]: variables// stack[LOCAL_SHFT <= i < TRY_SCOPE_SHFT]: used for newtemp/usetemp// stack[TRY_SCOPE_SHFT <= i]: try scopes// when 0 <= i < LOCAL_SHFT and stack[x] == DBL_MRK,// sDbl[i] gives the number value final Object DBL_MRK = Interpreter.DBL_MRK; Object[] stack = new Object[TRY_SCOPE_SHFT + maxTryDepth]; double[] sDbl = new double[TRY_SCOPE_SHFT]; int stackTop = -1; byte[] iCode = theData.itsICode; String[] strings = theData.itsStringTable; int pc = 0; int iCodeLength = theData.itsICodeTop; final Scriptable undefined = Undefined.instance; if (maxVars != 0) { int definedArgs = fnOrScript.argCount; if (definedArgs != 0) { if (definedArgs > args.length) { definedArgs = args.length; } for (i = 0; i != definedArgs; ++i) { stack[VAR_SHFT + i] = args[i]; } } for (i = definedArgs; i != maxVars; ++i) { stack[VAR_SHFT + i] = undefined; } } if (theData.itsNestedFunctions != null) { for (i = 0; i < theData.itsNestedFunctions.length; i++) createFunctionObject(theData.itsNestedFunctions[i], scope); } Object id; Object rhs, val; double valDbl; boolean valBln; int count; int slot; String name = null; Object[] outArgs; int lIntValue; double lDbl; int rIntValue; double rDbl;// tryStack[2 * i]: starting pc of catch block// tryStack[2 * i + 1]: starting pc of finally block int[] tryStack = null; int tryStackTop = 0; InterpreterFrame frame = null; if (cx.debugger != null) { frame = new InterpreterFrame(scope, theData, fnOrScript); cx.pushFrame(frame); } Object result = undefined; int pcPrevBranch = pc; final int instructionThreshold = cx.instructionThreshold; // During function call this will be set to -1 so catch can properly // adjust it int instructionCount = cx.instructionCount; // arbitrary number to add to instructionCount when calling // other functions final int INVOCATION_COST = 100; while (pc < iCodeLength) { try { switch (iCode[pc] & 0xff) { case TokenStream.ENDTRY : tryStackTop--; break; case TokenStream.TRY : if (tryStackTop == 0) { tryStack = new int[maxTryDepth * 2]; } i = getTarget(iCode, pc + 1); if (i == pc) i = 0; tryStack[tryStackTop * 2] = i; i = getTarget(iCode, pc + 3); if (i == (pc + 2)) i = 0; tryStack[tryStackTop * 2 + 1] = i; stack[TRY_SCOPE_SHFT + tryStackTop] = scope; ++tryStackTop; pc += 4; break; case TokenStream.GE : --stackTop; rhs = stack[stackTop + 1]; lhs = stack[stackTop]; if (rhs == DBL_MRK || lhs == DBL_MRK) { rDbl = stack_double(stack, sDbl, stackTop + 1); lDbl = stack_double(stack, sDbl, stackTop); valBln = (rDbl == rDbl && lDbl == lDbl && rDbl <= lDbl); } else { valBln = (1 == ScriptRuntime.cmp_LE(rhs, lhs)); } stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; case TokenStream.LE : --stackTop; rhs = stack[stackTop + 1]; lhs = stack[stackTop]; if (rhs == DBL_MRK || lhs == DBL_MRK) { rDbl = stack_double(stack, sDbl, stackTop + 1); lDbl = stack_double(stack, sDbl, stackTop); valBln = (rDbl == rDbl && lDbl == lDbl && lDbl <= rDbl); } else { valBln = (1 == ScriptRuntime.cmp_LE(lhs, rhs)); } stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; case TokenStream.GT : --stackTop; rhs = stack[stackTop + 1]; lhs = stack[stackTop]; if (rhs == DBL_MRK || lhs == DBL_MRK) { rDbl = stack_double(stack, sDbl, stackTop + 1); lDbl = stack_double(stack, sDbl, stackTop); valBln = (rDbl == rDbl && lDbl == lDbl && rDbl < lDbl); } else { valBln = (1 == ScriptRuntime.cmp_LT(rhs, lhs)); } stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; case TokenStream.LT : --stackTop; rhs = stack[stackTop + 1]; lhs = stack[stackTop]; if (rhs == DBL_MRK || lhs == DBL_MRK) { rDbl = stack_double(stack, sDbl, stackTop + 1); lDbl = stack_double(stack, sDbl, stackTop); valBln = (rDbl == rDbl && lDbl == lDbl && lDbl < rDbl); } else { valBln = (1 == ScriptRuntime.cmp_LT(lhs, rhs)); } stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; case TokenStream.IN : rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); valBln = ScriptRuntime.in(lhs, rhs, scope); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; case TokenStream.INSTANCEOF : rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); valBln = ScriptRuntime.instanceOf(scope, lhs, rhs); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; case TokenStream.EQ : --stackTop; valBln = do_eq(stack, sDbl, stackTop); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; case TokenStream.NE : --stackTop; valBln = !do_eq(stack, sDbl, stackTop); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; case TokenStream.SHEQ : --stackTop; valBln = do_sheq(stack, sDbl, stackTop); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; case TokenStream.SHNE : --stackTop; valBln = !do_sheq(stack, sDbl, stackTop); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; break; case TokenStream.IFNE : val = stack[stackTop]; if (val != DBL_MRK) { valBln = !ScriptRuntime.toBoolean(val); } else { valDbl = sDbl[stackTop]; valBln = !(valDbl == valDbl && valDbl != 0.0); } --stackTop; if (valBln) { if (instructionThreshold != 0) { instructionCount += pc + 3 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount (instructionCount); instructionCount = 0; } } pcPrevBranch = pc = getTarget(iCode, pc + 1); continue; } pc += 2; break; case TokenStream.IFEQ : val = stack[stackTop]; if (val != DBL_MRK) { valBln = ScriptRuntime.toBoolean(val); } else { valDbl = sDbl[stackTop]; valBln = (valDbl == valDbl && valDbl != 0.0); } --stackTop; if (valBln) { if (instructionThreshold != 0) { instructionCount += pc + 3 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount (instructionCount); instructionCount = 0; } } pcPrevBranch = pc = getTarget(iCode, pc + 1); continue; } pc += 2; break; case TokenStream.GOTO : if (instructionThreshold != 0) { instructionCount += pc + 3 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = getTarget(iCode, pc + 1); continue; case TokenStream.GOSUB : sDbl[++stackTop] = pc + 3; if (instructionThreshold != 0) { instructionCount += pc + 3 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = getTarget(iCode, pc + 1); continue; case TokenStream.RETSUB : slot = (iCode[pc + 1] & 0xFF); if (instructionThreshold != 0) { instructionCount += pc + 2 - pcPrevBranch; if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc = (int)sDbl[LOCAL_SHFT + slot]; continue; case TokenStream.POP : stackTop--; break; case TokenStream.DUP : stack[stackTop + 1] = stack[stackTop]; sDbl[stackTop + 1] = sDbl[stackTop]; stackTop++; break; case TokenStream.POPV : result = stack[stackTop]; if (result == DBL_MRK) result = doubleWrap(sDbl[stackTop]); --stackTop; break; case TokenStream.RETURN : result = stack[stackTop]; if (result == DBL_MRK) result = doubleWrap(sDbl[stackTop]); --stackTop; pc = getTarget(iCode, pc + 1); break; case TokenStream.BITNOT : rIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = ~rIntValue; break; case TokenStream.BITAND : rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue & rIntValue; break; case TokenStream.BITOR : rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue | rIntValue; break; case TokenStream.BITXOR : rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue ^ rIntValue; break; case TokenStream.LSH : rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue << rIntValue; break; case TokenStream.RSH : rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue >> rIntValue; break; case TokenStream.URSH : rIntValue = stack_int32(stack, sDbl, stackTop) & 0x1F; --stackTop; lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = ScriptRuntime.toUint32(lDbl) >>> rIntValue; break; case TokenStream.ADD : --stackTop; do_add(stack, sDbl, stackTop); break; case TokenStream.SUB : rDbl = stack_double(stack, sDbl, stackTop); --stackTop; lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lDbl - rDbl; break; case TokenStream.NEG : rDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = -rDbl; break; case TokenStream.POS : rDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = rDbl; break; case TokenStream.MUL : rDbl = stack_double(stack, sDbl, stackTop); --stackTop; lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lDbl * rDbl; break; case TokenStream.DIV : rDbl = stack_double(stack, sDbl, stackTop); --stackTop; lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; // Detect the divide by zero or let Java do it ? sDbl[stackTop] = lDbl / rDbl; break; case TokenStream.MOD : rDbl = stack_double(stack, sDbl, stackTop); --stackTop; lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lDbl % rDbl; break; case TokenStream.BINDNAME : name = strings[getShort(iCode, pc + 1)]; stack[++stackTop] = ScriptRuntime.bind(scope, name); pc += 2; break; case TokenStream.GETBASE : name = strings[getShort(iCode, pc + 1)]; stack[++stackTop] = ScriptRuntime.getBase(scope, name); pc += 2; break; case TokenStream.SETNAME : rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; lhs = stack[stackTop]; // what about class cast exception here for lhs? stack[stackTop] = ScriptRuntime.setName ((Scriptable)lhs, rhs, scope, strings[getShort(iCode, pc + 1)]); pc += 2; break; case TokenStream.DELPROP : rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.delete(lhs, rhs); break; case TokenStream.GETPROP : name = (String)stack[stackTop]; --stackTop; lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.getProp(lhs, name, scope); break; case TokenStream.SETPROP : rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; name = (String)stack[stackTop]; --stackTop; lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.setProp(lhs, name, rhs, scope); break; case TokenStream.GETELEM : do_getElem(cx, stack, sDbl, stackTop, scope); --stackTop; break; case TokenStream.SETELEM : do_setElem(cx, stack, sDbl, stackTop, scope); stackTop -= 2; break; case TokenStream.PROPINC : name = (String)stack[stackTop]; --stackTop; lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.postIncrement(lhs, name, scope); break; case TokenStream.PROPDEC : name = (String)stack[stackTop]; --stackTop; lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.postDecrement(lhs, name, scope); break; case TokenStream.ELEMINC : rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.postIncrementElem(lhs, rhs, scope); break; case TokenStream.ELEMDEC : rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.postDecrementElem(lhs, rhs, scope); break; case TokenStream.GETTHIS : lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.getThis((Scriptable)lhs); break; case TokenStream.NEWTEMP : slot = (iCode[++pc] & 0xFF); stack[LOCAL_SHFT + slot] = stack[stackTop]; sDbl[LOCAL_SHFT + slot] = sDbl[stackTop]; break; case TokenStream.USETEMP : slot = (iCode[++pc] & 0xFF); ++stackTop; stack[stackTop] = stack[LOCAL_SHFT + slot]; sDbl[stackTop] = sDbl[LOCAL_SHFT + slot]; break; case TokenStream.CALLSPECIAL : if (instructionThreshold != 0) { instructionCount += INVOCATION_COST; cx.instructionCount = instructionCount; instructionCount = -1; } int lineNum = getShort(iCode, pc + 1); name = strings[getShort(iCode, pc + 3)]; count = getShort(iCode, pc + 5); outArgs = getArgsArray(stack, sDbl, stackTop, count); stackTop -= count; rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.callSpecial( cx, lhs, rhs, outArgs, thisObj, scope, name, lineNum); pc += 6; instructionCount = cx.instructionCount; break; case TokenStream.CALL : if (instructionThreshold != 0) { instructionCount += INVOCATION_COST; cx.instructionCount = instructionCount; instructionCount = -1; } cx.instructionCount = instructionCount; count = getShort(iCode, pc + 3); outArgs = getArgsArray(stack, sDbl, stackTop, count); stackTop -= count; rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); if (lhs == undefined) { i = getShort(iCode, pc + 1); if (i != -1) lhs = strings[i]; } Scriptable calleeScope = scope; if (theData.itsNeedsActivation) { calleeScope = ScriptableObject. getTopLevelScope(scope); } stack[stackTop] = ScriptRuntime.call(cx, lhs, rhs, outArgs, calleeScope); pc += 4; instructionCount = cx.instructionCount; break; case TokenStream.NEW : if (instructionThreshold != 0) { instructionCount += INVOCATION_COST; cx.instructionCount = instructionCount; instructionCount = -1; } count = getShort(iCode, pc + 3); outArgs = getArgsArray(stack, sDbl, stackTop, count); stackTop -= count; lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); if (lhs == undefined && getShort(iCode, pc + 1) != -1) { // special code for better error message for call // to undefined lhs = strings[getShort(iCode, pc + 1)]; } stack[stackTop] = ScriptRuntime.newObject(cx, lhs, outArgs, scope); pc += 4; instructionCount = cx.instructionCount; break; case TokenStream.TYPEOF : lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.typeof(lhs); break; case TokenStream.TYPEOFNAME : name = strings[getShort(iCode, pc + 1)]; stack[++stackTop] = ScriptRuntime.typeofName(scope, name); pc += 2; break; case TokenStream.STRING : stack[++stackTop] = strings[getShort(iCode, pc + 1)]; pc += 2; break; case SHORTNUMBER_ICODE : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = getShort(iCode, pc + 1); pc += 2; break; case INTNUMBER_ICODE : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = getInt(iCode, pc + 1); pc += 4; break; case TokenStream.NUMBER : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = theData. itsDoubleTable[getShort(iCode, pc + 1)]; pc += 2; break; case TokenStream.NAME : stack[++stackTop] = ScriptRuntime.name (scope, strings[getShort(iCode, pc + 1)]); pc += 2; break; case TokenStream.NAMEINC : stack[++stackTop] = ScriptRuntime.postIncrement (scope, strings[getShort(iCode, pc + 1)]); pc += 2; break; case TokenStream.NAMEDEC : stack[++stackTop] = ScriptRuntime.postDecrement (scope, strings[getShort(iCode, pc + 1)]); pc += 2; break; case TokenStream.SETVAR : slot = (iCode[++pc] & 0xFF); stack[VAR_SHFT + slot] = stack[stackTop]; sDbl[VAR_SHFT + slot] = sDbl[stackTop]; break; case TokenStream.GETVAR : slot = (iCode[++pc] & 0xFF); ++stackTop; stack[stackTop] = stack[VAR_SHFT + slot]; sDbl[stackTop] = sDbl[VAR_SHFT + slot]; break; case TokenStream.VARINC : slot = (iCode[++pc] & 0xFF); ++stackTop; stack[stackTop] = stack[VAR_SHFT + slot]; sDbl[stackTop] = sDbl[VAR_SHFT + slot]; stack[VAR_SHFT + slot] = DBL_MRK; sDbl[VAR_SHFT + slot] = stack_double(stack, sDbl, stackTop) + 1.0; break; case TokenStream.VARDEC : slot = (iCode[++pc] & 0xFF); ++stackTop; stack[stackTop] = stack[VAR_SHFT + slot]; sDbl[stackTop] = sDbl[VAR_SHFT + slot]; stack[VAR_SHFT + slot] = DBL_MRK; sDbl[VAR_SHFT + slot] = stack_double(stack, sDbl, stackTop) - 1.0; break; case TokenStream.ZERO : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = 0; break; case TokenStream.ONE : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = 1; break; case TokenStream.NULL : stack[++stackTop] = null; break; case TokenStream.THIS : stack[++stackTop] = thisObj; break; case TokenStream.THISFN : stack[++stackTop] = fnOrScript; break; case TokenStream.FALSE : stack[++stackTop] = Boolean.FALSE; break; case TokenStream.TRUE : stack[++stackTop] = Boolean.TRUE; break; case TokenStream.UNDEFINED : stack[++stackTop] = Undefined.instance; break; case TokenStream.THROW : result = stack[stackTop]; if (result == DBL_MRK) result = doubleWrap(sDbl[stackTop]); --stackTop; throw new JavaScriptException(result); case TokenStream.JTHROW : result = stack[stackTop]; // No need to check for DBL_MRK: result is Exception --stackTop; if (result instanceof JavaScriptException) throw (JavaScriptException)result; else throw (RuntimeException)result; case TokenStream.ENTERWITH : lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); --stackTop; scope = ScriptRuntime.enterWith(lhs, scope); break; case TokenStream.LEAVEWITH : scope = ScriptRuntime.leaveWith(scope); break; case TokenStream.NEWSCOPE : stack[++stackTop] = ScriptRuntime.newScope(); break; case TokenStream.ENUMINIT : slot = (iCode[++pc] & 0xFF); lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); --stackTop; stack[LOCAL_SHFT + slot] = ScriptRuntime.initEnum(lhs, scope); break; case TokenStream.ENUMNEXT : slot = (iCode[++pc] & 0xFF); val = stack[LOCAL_SHFT + slot]; ++stackTop; stack[stackTop] = ScriptRuntime. nextEnum((Enumeration)val); break; case TokenStream.GETPROTO : lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.getProto(lhs, scope); break; case TokenStream.GETPARENT : lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.getParent(lhs); break; case TokenStream.GETSCOPEPARENT : lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.getParent(lhs, scope); break; case TokenStream.SETPROTO : rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.setProto(lhs, rhs, scope); break; case TokenStream.SETPARENT : rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.setParent(lhs, rhs, scope); break; case TokenStream.SCOPE : stack[++stackTop] = scope; break; case TokenStream.CLOSURE : i = getShort(iCode, pc + 1); stack[++stackTop] = new InterpretedFunction( theData.itsNestedFunctions[i], scope, cx); createFunctionObject( (InterpretedFunction)stack[stackTop], scope); pc += 2; break; case TokenStream.OBJECT : i = getShort(iCode, pc + 1); stack[++stackTop] = theData.itsRegExpLiterals[i]; pc += 2; break; case SOURCEFILE_ICODE : cx.interpreterSourceFile = theData.itsSourceFile; break; case LINE_ICODE : case BREAKPOINT_ICODE : i = getShort(iCode, pc + 1); cx.interpreterLine = i; if (frame != null) frame.setLineNumber(i); if ((iCode[pc] & 0xff) == BREAKPOINT_ICODE || cx.inLineStepMode) { cx.getDebuggableEngine(). getDebugger().handleBreakpointHit(cx); } pc += 2; break; default : dumpICode(theData); throw new RuntimeException("Unknown icode : " + (iCode[pc] & 0xff) + " @ pc : " + pc); } pc++; } catch (Throwable ex) { if (instructionThreshold != 0) { if (instructionCount < 0) { // throw during function call instructionCount = cx.instructionCount; } else { // throw during any other operation instructionCount += pc - pcPrevBranch; cx.instructionCount = instructionCount; } } final int SCRIPT_THROW = 0, ECMA = 1, RUNTIME = 2, OTHER = 3; int exType; Object errObj; // Object seen by catch for (;;) { if (ex instanceof JavaScriptException) { errObj = ScriptRuntime. unwrapJavaScriptException((JavaScriptException)ex); exType = SCRIPT_THROW; } else if (ex instanceof EcmaError) { // an offical ECMA error object, errObj = ((EcmaError)ex).getErrorObject(); exType = ECMA; } else if (ex instanceof WrappedException) { Object w = ((WrappedException) ex).unwrap(); if (w instanceof Throwable) { ex = (Throwable) w; continue; } errObj = ex; exType = RUNTIME; } else if (ex instanceof RuntimeException) { errObj = ex; exType = RUNTIME; } else { errObj = ex; // Error instance exType = OTHER; } break; } if (exType != OTHER && cx.debugger != null) { cx.debugger.handleExceptionThrown(cx, errObj); } boolean rethrow = true; if (exType != OTHER && tryStackTop > 0) { --tryStackTop; if (exType == SCRIPT_THROW || exType == ECMA) { // Check for catch only for // JavaScriptException and EcmaError pc = tryStack[tryStackTop * 2]; if (pc != 0) { // Has catch block rethrow = false; } } if (rethrow) { pc = tryStack[tryStackTop * 2 + 1]; if (pc != 0) { // has finally block rethrow = false; errObj = ex; } } } if (rethrow) { if (frame != null) cx.popFrame(); if (exType == SCRIPT_THROW) throw (JavaScriptException)ex; if (exType == ECMA || exType == RUNTIME) throw (RuntimeException)ex; throw (Error)ex; } // We caught an exception, // Notify instruction observer if necessary // and point pcPrevBranch to start of catch/finally block if (instructionThreshold != 0) { if (instructionCount > instructionThreshold) { // Note: this can throw Error cx.observeInstructionCount(instructionCount); instructionCount = 0; } } pcPrevBranch = pc; // prepare stack and restore this function's security domain. scope = (Scriptable)stack[TRY_SCOPE_SHFT + tryStackTop]; stackTop = 0; stack[0] = errObj; } } if (frame != null) cx.popFrame(); if (instructionThreshold != 0) { if (instructionCount > instructionThreshold) { cx.observeInstructionCount(instructionCount); instructionCount = 0; } cx.instructionCount = instructionCount; } return result; } | 51275 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51275/052726b68e684efc593535d50a73767571084837/Interpreter.java/clean/js/rhino/src/org/mozilla/javascript/Interpreter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
1033,
10634,
12,
1042,
9494,
16,
22780,
2146,
16,
4766,
282,
22780,
15261,
16,
1033,
8526,
833,
16,
4766,
282,
16717,
2083,
2295,
1162,
3651,
16,
4766,
282,
5294,
11599,
751,
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,
1033,
10634,
12,
1042,
9494,
16,
22780,
2146,
16,
4766,
282,
22780,
15261,
16,
1033,
8526,
833,
16,
4766,
282,
16717,
2083,
2295,
1162,
3651,
16,
4766,
282,
5294,
11599,
751,
3... |
in.startString(); | public int getToken() throws IOException { int c; tokenno++; // Check for pushed-back token if (this.pushbackToken != EOF) { int result = this.pushbackToken; this.pushbackToken = EOF; return result; } // Eat whitespace, possibly sensitive to newlines. do { c = in.read(); if (c == '\n') if ((flags & TSF_NEWLINES) != 0) break; } while (isJSSpace(c) || c == '\n'); if (c == EOF_CHAR) return EOF; // identifier/keyword/instanceof? // watch out for starting with a <backslash> boolean isUnicodeEscapeStart = false; if (c == '\\') { c = in.read(); if (c == 'u') isUnicodeEscapeStart = true; else c = '\\'; // always unread the 'u' or whatever, we need // to start the string below at the <backslash>. in.unread(); } if (isUnicodeEscapeStart || Character.isJavaIdentifierStart((char)c)) { in.startString(); boolean containsEscape = isUnicodeEscapeStart; do { c = in.read(); if (c == '\\') { c = in.read(); containsEscape = (c == 'u'); } } while (Character.isJavaIdentifierPart((char)c)); in.unread(); int result; String str = in.getString(); // OPT we shouldn't have to make a string (object!) to // check if it's a keyword. // strictly speaking we should probably push-back // all the bad characters if the <backslash>uXXXX // sequence is malformed. But since there isn't a // correct context(is there?) for a bad Unicode // escape sequence after an identifier, we can report // an error here. if (containsEscape) { char ca[] = str.toCharArray(); int L = str.length(); int destination = 0; for (int i = 0; i != L;) { c = ca[i]; ++i; if (c == '\\' && i != L && ca[i] == 'u') { boolean goodEscape = false; if (i + 4 < L) { int val = xDigitToInt(ca[i + 1]); if (val >= 0) { val = (val << 4) | xDigitToInt(ca[i + 2]); if (val >= 0) { val = (val << 4) | xDigitToInt(ca[i + 3]); if (val >= 0) { val = (val << 4) | xDigitToInt(ca[i + 4]); if (val >= 0) { c = (char)val; i += 5; goodEscape = true; } } } } } if (!goodEscape) { reportSyntaxError("msg.invalid.escape", null); return ERROR; } } ca[destination] = (char)c; ++destination; } str = new String(ca, 0, destination); } else { // Return the corresponding token if it's a keyword result = stringToKeyword(str); if (result != EOF) { if (result != RESERVED) { return result; } else if (!Context.getContext().hasFeature( Context.FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER)) { return result; } else { // If implementation permits to use future reserved // keywords in violation with the EcmaScript standard, // treat it as name but issue warning Object[] errArgs = { str }; reportSyntaxWarning("msg.reserved.keyword", errArgs); result = EOF; } } } this.string = str; return NAME; } // is it a number? if (isDigit(c) || (c == '.' && isDigit(in.peek()))) { int base = 10; in.startString(); if (c == '0') { c = in.read(); if (c == 'x' || c == 'X') { c = in.read(); base = 16; // restart the string, losing leading 0x in.startString(); } else if (isDigit(c)) { base = 8; } } while (0 <= xDigitToInt(c)) { if (base < 16) { if (isAlpha(c)) break; /* * We permit 08 and 09 as decimal numbers, which * makes our behavior a superset of the ECMA * numeric grammar. We might not always be so * permissive, so we warn about it. */ if (base == 8 && c >= '8') { Object[] errArgs = { c == '8' ? "8" : "9" }; reportSyntaxWarning("msg.bad.octal.literal", errArgs); base = 10; } } c = in.read(); } boolean isInteger = true; if (base == 10 && (c == '.' || c == 'e' || c == 'E')) { isInteger = false; if (c == '.') { do { c = in.read(); } while (isDigit(c)); } if (c == 'e' || c == 'E') { c = in.read(); if (c == '+' || c == '-') { c = in.read(); } if (!isDigit(c)) { in.getString(); // throw away string in progress reportSyntaxError("msg.missing.exponent", null); return ERROR; } do { c = in.read(); } while (isDigit(c)); } } in.unread(); String numString = in.getString(); double dval; if (base == 10 && !isInteger) { try { // Use Java conversion to number from string... dval = (Double.valueOf(numString)).doubleValue(); } catch (NumberFormatException ex) { Object[] errArgs = { ex.getMessage() }; reportSyntaxError("msg.caught.nfe", errArgs); return ERROR; } } else { dval = ScriptRuntime.stringToNumber(numString, 0, base); } this.number = dval; return NUMBER; } // is it a string? if (c == '"' || c == '\'') { // We attempt to accumulate a string the fast way, by // building it directly out of the reader. But if there // are any escaped characters in the string, we revert to // building it out of a StringBuffer. StringBuffer stringBuf = null; int quoteChar = c; int val = 0; c = in.read(); in.startString(); // start after the first " while(c != quoteChar) { if (c == '\n' || c == EOF_CHAR) { in.unread(); in.getString(); // throw away the string in progress reportSyntaxError("msg.unterminated.string.lit", null); return ERROR; } if (c == '\\') { // We've hit an escaped character; revert to the // slow method of building a string. if (stringBuf == null) { // Don't include the backslash in.unread(); stringBuf = new StringBuffer(in.getString()); in.read(); } switch (c = in.read()) { case 'b': c = '\b'; break; case 'f': c = '\f'; break; case 'n': c = '\n'; break; case 'r': c = '\r'; break; case 't': c = '\t'; break; case 'v': c = '\u000B'; break; // \v a late addition to the ECMA spec. // '\v' doesn't seem to be valid Java. default: if (isDigit(c) && c < '8') { val = c - '0'; c = in.read(); if (isDigit(c) && c < '8') { val = 8 * val + c - '0'; c = in.read(); if (isDigit(c) && c < '8') { val = 8 * val + c - '0'; c = in.read(); } } in.unread(); if (val > 0377) { reportSyntaxError("msg.oct.esc.too.large", null); return ERROR; } c = val; } else if (c == 'u') { /* * Get 4 hex digits; if the u escape is not * followed by 4 hex digits, use 'u' + the literal * character sequence that follows. Do some manual * match (OK because we're in a string) to avoid * multi-char match on the underlying stream. */ int c1 = in.read(); c = xDigitToInt(c1); if (c < 0) { in.unread(); c = 'u'; } else { int c2 = in.read(); c = (c << 4) | xDigitToInt(c2); if (c < 0) { in.unread(); stringBuf.append('u'); c = c1; } else { int c3 = in.read(); c = (c << 4) | xDigitToInt(c3); if (c < 0) { in.unread(); stringBuf.append('u'); stringBuf.append((char)c1); c = c2; } else { int c4 = in.read(); c = (c << 4) | xDigitToInt(c4); if (c < 0) { in.unread(); stringBuf.append('u'); stringBuf.append((char)c1); stringBuf.append((char)c2); c = c3; } else { // got 4 hex digits! Woo Hoo! } } } } } else if (c == 'x') { /* Get 2 hex digits, defaulting to 'x' + literal * sequence, as above. */ int c1 = in.read(); c = xDigitToInt(c1); if (c < 0) { in.unread(); c = 'x'; } else { int c2 = in.read(); c = (c << 4) | xDigitToInt(c2); if (c < 0) { in.unread(); stringBuf.append('x'); c = c1; } else { // got 2 hex digits } } } } } if (stringBuf != null) stringBuf.append((char) c); c = in.read(); } if (stringBuf != null) this.string = stringBuf.toString(); else { in.unread(); // miss the trailing " this.string = in.getString(); in.read(); } return STRING; } switch (c) { case '\n': return EOL; case ';': return SEMI; case '[': return LB; case ']': return RB; case '{': return LC; case '}': return RC; case '(': return LP; case ')': return RP; case ',': return COMMA; case '?': return HOOK; case ':': return COLON; case '.': return DOT; case '|': if (in.match('|')) { return OR; } else if (in.match('=')) { this.op = BITOR; return ASSIGN; } else { return BITOR; } case '^': if (in.match('=')) { this.op = BITXOR; return ASSIGN; } else { return BITXOR; } case '&': if (in.match('&')) { return AND; } else if (in.match('=')) { this.op = BITAND; return ASSIGN; } else { return BITAND; } case '=': if (in.match('=')) { if (in.match('=')) this.op = SHEQ; else this.op = EQ; return EQOP; } else { this.op = NOP; return ASSIGN; } case '!': if (in.match('=')) { if (in.match('=')) this.op = SHNE; else this.op = NE; return EQOP; } else { this.op = NOT; return UNARYOP; } case '<': /* NB:treat HTML begin-comment as comment-till-eol */ if (in.match('!')) { if (in.match('-')) { if (in.match('-')) { while ((c = in.read()) != EOF_CHAR && c != '\n') /* skip to end of line */; in.unread(); return getToken(); // in place of 'goto retry' } in.unread(); } in.unread(); } if (in.match('<')) { if (in.match('=')) { this.op = LSH; return ASSIGN; } else { this.op = LSH; return SHOP; } } else { if (in.match('=')) { this.op = LE; return RELOP; } else { this.op = LT; return RELOP; } } case '>': if (in.match('>')) { if (in.match('>')) { if (in.match('=')) { this.op = URSH; return ASSIGN; } else { this.op = URSH; return SHOP; } } else { if (in.match('=')) { this.op = RSH; return ASSIGN; } else { this.op = RSH; return SHOP; } } } else { if (in.match('=')) { this.op = GE; return RELOP; } else { this.op = GT; return RELOP; } } case '*': if (in.match('=')) { this.op = MUL; return ASSIGN; } else { return MUL; } case '/': // is it a // comment? if (in.match('/')) { while ((c = in.read()) != EOF_CHAR && c != '\n') /* skip to end of line */; in.unread(); return getToken(); } if (in.match('*')) { while ((c = in.read()) != -1 && !(c == '*' && in.match('/'))) { ; // empty loop body } if (c == EOF_CHAR) { reportSyntaxError("msg.unterminated.comment", null); return ERROR; } return getToken(); // `goto retry' } // is it a regexp? if ((flags & TSF_REGEXP) != 0) { // We don't try to use the in.startString/in.getString // approach, because escaped characters (which break it) // seem likely to be common. StringBuffer re = new StringBuffer(); while ((c = in.read()) != '/') { if (c == '\n' || c == EOF_CHAR) { in.unread(); reportSyntaxError("msg.unterminated.re.lit", null); return ERROR; } if (c == '\\') { re.append((char) c); c = in.read(); } re.append((char) c); } StringBuffer flagsBuf = new StringBuffer(); while (true) { if (in.match('g')) flagsBuf.append('g'); else if (in.match('i')) flagsBuf.append('i'); else if (in.match('m')) flagsBuf.append('m'); else break; } if (isAlpha(in.peek())) { reportSyntaxError("msg.invalid.re.flag", null); return ERROR; } this.string = re.toString(); this.regExpFlags = flagsBuf.toString(); return OBJECT; } if (in.match('=')) { this.op = DIV; return ASSIGN; } else { return DIV; } case '%': this.op = MOD; if (in.match('=')) { return ASSIGN; } else { return MOD; } case '~': this.op = BITNOT; return UNARYOP; case '+': case '-': if (in.match('=')) { if (c == '+') { this.op = ADD; return ASSIGN; } else { this.op = SUB; return ASSIGN; } } else if (in.match((char) c)) { if (c == '+') { return INC; } else { return DEC; } } else if (c == '-') { return SUB; } else { return ADD; } default: reportSyntaxError("msg.illegal.character", null); return ERROR; } } | 12904 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12904/339b48088d2d671f2f921c6c78e0136088eb0ac9/TokenStream.java/clean/js/rhino/src/org/mozilla/javascript/TokenStream.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
509,
9162,
1435,
1216,
1860,
288,
3639,
509,
276,
31,
3639,
1147,
2135,
9904,
31,
3639,
368,
2073,
364,
18543,
17,
823,
1147,
3639,
309,
261,
2211,
18,
6206,
823,
1345,
480,
6431,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
509,
9162,
1435,
1216,
1860,
288,
3639,
509,
276,
31,
3639,
1147,
2135,
9904,
31,
3639,
368,
2073,
364,
18543,
17,
823,
1147,
3639,
309,
261,
2211,
18,
6206,
823,
1345,
480,
6431,
... | |
ImageDescriptor imageDescriptor = perspective.getImageDescriptor(); if (imageDescriptor != null) { toolItem.setImage(imageDescriptor.createImage()); | toolItem .setSelection(workbenchPage.getPerspective() == perspective); if (apiPreferenceStore .getBoolean(IWorkbenchPreferenceConstants.SHOW_TEXT_ON_PERSPECTIVE_BAR)) { if (apiPreferenceStore.getString( IWorkbenchPreferenceConstants.DOCK_PERSPECTIVE_BAR) .equals(IWorkbenchPreferenceConstants.TOP_LEFT)) { toolItem.setText(perspective.getLabel()); } else { toolItem.setText(shortenText(perspective.getLabel(), toolItem)); } | public void update(IPerspectiveDescriptor newDesc) { perspective = newDesc; if (toolItem != null && !toolItem.isDisposed()) { ImageDescriptor imageDescriptor = perspective.getImageDescriptor(); if (imageDescriptor != null) { toolItem.setImage(imageDescriptor.createImage()); } else { toolItem.setImage(WorkbenchImages.getImageDescriptor( IWorkbenchGraphicConstants.IMG_ETOOL_DEF_PERSPECTIVE) .createImage()); } toolItem.setToolTipText(NLS.bind(WorkbenchMessages.PerspectiveBarContributionItem_toolTip, perspective.getLabel() )); } update(); } | 55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/fa4a8cff0e027f8d3c6b1fcb92b30f46767dd191/PerspectiveBarContributionItem.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveBarContributionItem.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1089,
12,
2579,
414,
16772,
3187,
394,
4217,
13,
288,
3639,
26651,
273,
394,
4217,
31,
3639,
309,
261,
6738,
1180,
480,
446,
597,
401,
6738,
1180,
18,
291,
1669,
7423,
10756,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1089,
12,
2579,
414,
16772,
3187,
394,
4217,
13,
288,
3639,
26651,
273,
394,
4217,
31,
3639,
309,
261,
6738,
1180,
480,
446,
597,
401,
6738,
1180,
18,
291,
1669,
7423,
10756,
... |
public org.quickfix.field.LegDatedDate getLegDatedDate() throws FieldNotFound { org.quickfix.field.LegDatedDate value = new org.quickfix.field.LegDatedDate(); | public quickfix.field.LegDatedDate getLegDatedDate() throws FieldNotFound { quickfix.field.LegDatedDate value = new quickfix.field.LegDatedDate(); | public org.quickfix.field.LegDatedDate getLegDatedDate() throws FieldNotFound { org.quickfix.field.LegDatedDate value = new org.quickfix.field.LegDatedDate(); getField(value); return value; } | 8803 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8803/fecc27f98261270772ff182a1d4dfd94b5daa73d/MarketDataRequest.java/clean/src/java/src/quickfix/fix44/MarketDataRequest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
2358,
18,
19525,
904,
18,
1518,
18,
8329,
40,
690,
1626,
336,
8329,
40,
690,
1626,
1435,
1216,
2286,
2768,
225,
288,
2358,
18,
19525,
904,
18,
1518,
18,
8329,
40,
690,
1626,
460,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
2358,
18,
19525,
904,
18,
1518,
18,
8329,
40,
690,
1626,
336,
8329,
40,
690,
1626,
1435,
1216,
2286,
2768,
225,
288,
2358,
18,
19525,
904,
18,
1518,
18,
8329,
40,
690,
1626,
460,
... |
return cx.compileString(source, filename, linep[0], null); | ErrorReporter reporter; reporter = DefaultErrorReporter.forEval(cx.getErrorReporter()); return cx.compileString(source, reporter, filename, linep[0], null); | private static Script compile(Context cx, String source) { int[] linep = { 0 }; String filename = Context.getSourcePositionFromStack(linep); if (filename == null) { filename = "<Script object>"; linep[0] = 1; } return cx.compileString(source, filename, linep[0], null); } | 12904 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12904/89769e9a859e560ff528f4f8481341066305ed25/NativeScript.java/buggy/js/rhino/src/org/mozilla/javascript/NativeScript.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
760,
7739,
4074,
12,
1042,
9494,
16,
514,
1084,
13,
565,
288,
3639,
509,
8526,
980,
84,
273,
288,
374,
289,
31,
3639,
514,
1544,
273,
1772,
18,
588,
1830,
2555,
1265,
2624,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
760,
7739,
4074,
12,
1042,
9494,
16,
514,
1084,
13,
565,
288,
3639,
509,
8526,
980,
84,
273,
288,
374,
289,
31,
3639,
514,
1544,
273,
1772,
18,
588,
1830,
2555,
1265,
2624,
12,
... |
Pagination pagination = new Pagination(urlFormatString); | Pagination pagination = new Pagination(baseHref, pageParameter); | public String getPageNavigationBar(String urlFormatString) { log.debug("getPageNavigationBar"); int maxPages = 8; maxPages = this.properties.getPagingGroupSize(maxPages); int currentIndex = this.currentPage; int count = this.pageCount; int startPage = 1; int endPage = maxPages; Pagination pagination = new Pagination(urlFormatString); log.debug("this.pageCount=" + this.pageCount); // if no items are found still add pagination? if (count == 0) { pagination.addPage(1, true); } if (currentIndex < maxPages) { startPage = 1; endPage = maxPages; if (count < endPage) { endPage = count; } } else { startPage = currentIndex; while (startPage + maxPages > (count + 1)) { startPage--; } endPage = startPage + (maxPages - 1); } if (currentIndex != 1) { pagination.setFirst(new Integer(1)); pagination.setPrevious(new Integer(currentIndex - 1)); } for (int j = startPage; j <= endPage; j++) { log.debug("adding page " + j); pagination.addPage(j, (j == currentIndex)); } if (currentIndex != count) { pagination.setNext(new Integer(currentIndex + 1)); pagination.setLast(new Integer(count)); } // format for previous/next banner String bannerFormat; log.debug("lPagination.isOnePage()=" + pagination.isOnePage()); if (pagination.isOnePage()) { bannerFormat = this.properties.getPagingBannerOnePage(); } else if (pagination.isFirst()) { bannerFormat = this.properties.getPagingBannerFirst(); } else if (pagination.isLast()) { bannerFormat = this.properties.getPagingBannerLast(); } else { bannerFormat = this.properties.getPagingBannerFull(); } log.debug("getPageNavigationBar end"); return pagination.getFormattedBanner( this.properties.getPagingPageLink(), this.properties.getPagingPageSelected(), this.properties.getPagingPageSeparator(), bannerFormat); } | 10316 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/10316/dc1944fe381d59f00b8ab4eb9df3620d136a8910/SmartListHelper.java/buggy/displaytag/src/main/java/org/displaytag/pagination/SmartListHelper.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
8957,
14301,
5190,
12,
780,
880,
1630,
780,
13,
565,
288,
3639,
613,
18,
4148,
2932,
588,
1964,
14301,
5190,
8863,
3639,
509,
943,
5716,
273,
1725,
31,
3639,
943,
5716,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
8957,
14301,
5190,
12,
780,
880,
1630,
780,
13,
565,
288,
3639,
613,
18,
4148,
2932,
588,
1964,
14301,
5190,
8863,
3639,
509,
943,
5716,
273,
1725,
31,
3639,
943,
5716,
273,
... |
public void setRight(BugReport newRight) { | public void setRight(BugzillaReport newRight) { | public void setRight(BugReport newRight) { BugzillaStructureCreator structureCreator = new BugzillaStructureCreator(); right = structureCreator.getStructure(newRight); } | 51151 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51151/021b803558816829652dd500f5695e5bfd03ae6c/BugzillaCompareInput.java/buggy/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/compare/BugzillaCompareInput.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
444,
4726,
12,
19865,
4820,
394,
4726,
13,
288,
202,
202,
19865,
15990,
6999,
10636,
3695,
10636,
273,
394,
16907,
15990,
6999,
10636,
5621,
202,
202,
4083,
273,
3695,
10636,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
444,
4726,
12,
19865,
4820,
394,
4726,
13,
288,
202,
202,
19865,
15990,
6999,
10636,
3695,
10636,
273,
394,
16907,
15990,
6999,
10636,
5621,
202,
202,
4083,
273,
3695,
10636,... |
FormComponent current = (FormComponent) it.next(); | PaletteComponent current = (PaletteComponent) it.next(); | public void initializeComponent(FacesContext context) { Application application = context.getApplication(); System.out.println("PALETTE INITILIZATION: " + this.getChildren().size()); this.getChildren().clear(); System.out.println("PALETTE INITILIZATION: " + this.getChildren().size()); ValueBinding vb = this.getValueBinding("items"); if(vb != null) { List items = (List) vb.getValue(context); Iterator it = items.iterator(); while(it.hasNext()) { FormComponent current = (FormComponent) it.next(); FBPaletteComponent formComponent = (FBPaletteComponent) application.createComponent(FBPaletteComponent.COMPONENT_TYPE); formComponent.setStyleClass(this.getItemStyleClass()); formComponent.setName(current.getName()); formComponent.setType(current.getType()); formComponent.setIcon(current.getIconPath()); this.getChildren().add(formComponent); } } System.out.println("PALETTE INITILIZATION: " + this.getChildren().size()); } | 56193 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56193/d1561dbc686191a2e5ec0a03dabf3e7588133788/FBPalette.java/buggy/src/java/com/idega/formbuilder/presentation/FBPalette.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
4046,
1841,
12,
17268,
1042,
819,
13,
288,
202,
202,
3208,
2521,
273,
819,
18,
588,
3208,
5621,
202,
202,
3163,
18,
659,
18,
8222,
2932,
4066,
15146,
1448,
12584,
45,
205... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4046,
1841,
12,
17268,
1042,
819,
13,
288,
202,
202,
3208,
2521,
273,
819,
18,
588,
3208,
5621,
202,
202,
3163,
18,
659,
18,
8222,
2932,
4066,
15146,
1448,
12584,
45,
205... |
ee.getSourceName(), ee.getLineNumber()); | ee.sourceName(), ee.lineNumber()); | public static Object getCatchObject(Context cx, Scriptable scope, Throwable t) throws JavaScriptException { EvaluatorException evaluator = null; if (t instanceof EvaluatorException) { evaluator = (EvaluatorException)t; while (t instanceof WrappedException) { t = ((WrappedException)t).getWrappedException(); } } if (t instanceof JavaScriptException) { return ((JavaScriptException)t).getValue(); } else if (t instanceof EcmaError) { EcmaError ee = (EcmaError)t; String errorName = ee.getName(); return makeErrorObject(cx, scope, errorName, ee.getErrorMessage(), ee.getSourceName(), ee.getLineNumber()); } else if (evaluator == null) { // Script can catch only instances of JavaScriptException, // EcmaError and EvaluatorException Kit.codeBug(); } if (t != evaluator && t instanceof EvaluatorException) { // ALERT: it should not happen as throwAsUncheckedException // takes care about it when exception is propagated through Java // reflection calls, but for now check for it evaluator = (EvaluatorException)t; } String errorName; String message; if (t == evaluator) { // Pure evaluator exception if (evaluator instanceof WrappedException) Kit.codeBug(); message = evaluator.getMessage(); errorName = "InternalError"; } else { errorName = "JavaException"; message = t.getClass().getName()+": "+t.getMessage(); } Scriptable errorObject = makeErrorObject(cx, scope, errorName, message, evaluator.getSourceName(), evaluator.getLineNumber()); if (t != evaluator) { Object twrap = cx.getWrapFactory().wrap(cx, scope, t, null); ScriptableObject.putProperty(errorObject, "javaException", twrap); } return errorObject; } | 51996 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51996/b538849b5b431bc21e58fb6e0fc818f0a017ed10/ScriptRuntime.java/clean/js/rhino/src/org/mozilla/javascript/ScriptRuntime.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
1033,
1927,
505,
921,
12,
1042,
9494,
16,
22780,
2146,
16,
4766,
3639,
4206,
268,
13,
3639,
1216,
11905,
503,
565,
288,
3639,
31956,
503,
18256,
273,
446,
31,
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,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
1033,
1927,
505,
921,
12,
1042,
9494,
16,
22780,
2146,
16,
4766,
3639,
4206,
268,
13,
3639,
1216,
11905,
503,
565,
288,
3639,
31956,
503,
18256,
273,
446,
31,
3639,
309,
261,
... |
String t = editor.getText(); int antlr_tab = 8; int antlr_pos = 0; int c = 0; while(antlr_pos<pos) { if(t.charAt(line.position+c) == '\t') { antlr_pos = ((antlr_pos/antlr_tab)+1)*antlr_tab; } else { antlr_pos++; } c++; } return line.position+(c-1); | return line.position+pos-1; | public int computeAbsoluteGrammarIndex(int lineIndex, int pos) { List lines = editor.getLines(); if(lineIndex-1<0 || lineIndex-1 >= lines.size()) return -1; ATELine line = (ATELine)lines.get(lineIndex-1); String t = editor.getText(); // ANTLR gives a position using a tab size of 8. I have to // convert this to the current editor tab size // @todo if ANTLR changes the tab size, adjust here int antlr_tab = 8; int antlr_pos = 0; int c = 0; while(antlr_pos<pos) { if(t.charAt(line.position+c) == '\t') { antlr_pos = ((antlr_pos/antlr_tab)+1)*antlr_tab; } else { antlr_pos++; } c++; } //System.out.println(lineIndex+", "+pos+"="+(line.position+(c-1))); return line.position+(c-1); } | 4430 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4430/ce31e666e75d19aa399e0335c36c189fa887d849/Debugger.java/buggy/src/org/antlr/works/debugger/Debugger.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
509,
3671,
10368,
18576,
1016,
12,
474,
980,
1016,
16,
509,
949,
13,
288,
3639,
987,
2362,
273,
4858,
18,
588,
5763,
5621,
3639,
309,
12,
1369,
1016,
17,
21,
32,
20,
747,
980,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3671,
10368,
18576,
1016,
12,
474,
980,
1016,
16,
509,
949,
13,
288,
3639,
987,
2362,
273,
4858,
18,
588,
5763,
5621,
3639,
309,
12,
1369,
1016,
17,
21,
32,
20,
747,
980,
1... |
IASTName name = new ScannerASTName(d.name); | IASTName name = new ASTMacroName(d.name); | private IASTPreprocessorMacroDefinition createASTMacroDefinition( _MacroDefinition d) { IASTPreprocessorMacroDefinition r = null; if (d instanceof _ObjectMacroDefinition) r = new ASTObjectMacro(); else if (d instanceof _FunctionMacroDefinition) { IASTPreprocessorFunctionStyleMacroDefinition f = new ASTFunctionMacro(); char[][] parms = ((_FunctionMacroDefinition) d).parms; for (int j = 0; j < parms.length; ++j) { IASTFunctionStyleMacroParameter parm = new ASTFunctionMacroParameter(); parm.setParameter(new String(parms[j])); f.addParameter(parm); parm.setParent(f); parm .setPropertyInParent(IASTPreprocessorFunctionStyleMacroDefinition.PARAMETER); } r = f; } IASTName name = new ScannerASTName(d.name); name.setPropertyInParent(IASTPreprocessorMacroDefinition.MACRO_NAME); name.setParent(r); ((ScannerASTNode) name).setOffsetAndLength(d.nameOffset, d.name.length); r.setName(name); r.setExpansion(new String(d.expansion)); ((ScannerASTNode) r).setOffsetAndLength(d.context_directive_start, d.context_directive_end - d.context_directive_start); return r; } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/1e8393f7a2cd5d5de7919712722d6a1202f825c5/LocationMap.java/buggy/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/LocationMap.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
467,
9053,
1386,
8700,
17392,
1852,
752,
9053,
17392,
1852,
12,
5411,
389,
17392,
1852,
302,
13,
288,
3639,
467,
9053,
1386,
8700,
17392,
1852,
436,
273,
446,
31,
3639,
309,
261,
72... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
467,
9053,
1386,
8700,
17392,
1852,
752,
9053,
17392,
1852,
12,
5411,
389,
17392,
1852,
302,
13,
288,
3639,
467,
9053,
1386,
8700,
17392,
1852,
436,
273,
446,
31,
3639,
309,
261,
72... |
/*SwingUtilities.invokeLater(new Runnable() | SwingUtilities.invokeLater(new Runnable() | public boolean applicationShouldHandleReopen(NSApplication theApplication, boolean flag) { /*SwingUtilities.invokeLater(new Runnable() { public void run() { if (jEdit.getViewCount() == 0) jEdit.newView(null); } });*/ return false; } //}}} | 8690 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8690/d2bf676fd4cbad64f5fe5446a52a1474e8508c55/Delegate.java/buggy/jars/MacOS/macos/Delegate.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1250,
2521,
14309,
3259,
426,
3190,
12,
3156,
3208,
326,
3208,
16,
1250,
2982,
13,
202,
95,
202,
202,
20308,
6050,
310,
11864,
18,
14407,
20607,
12,
2704,
10254,
1435,
202,
202,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1250,
2521,
14309,
3259,
426,
3190,
12,
3156,
3208,
326,
3208,
16,
1250,
2982,
13,
202,
95,
202,
202,
20308,
6050,
310,
11864,
18,
14407,
20607,
12,
2704,
10254,
1435,
202,
202,... |
manager.add(action1); manager.add(action2); | manager.add(clearBoxesAction); | private void fillLocalToolBar(IToolBarManager manager) { manager.add(action1); manager.add(action2); } | 56152 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56152/055cdadfc48a294fa16ea68d9f7366f79782db28/BoxView.java/clean/examples/org.eclipse.ui.examples.undo/Eclipse UI Examples Undo/org/eclipse/ui/examples/undo/views/BoxView.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
3636,
2042,
6364,
5190,
12,
45,
6364,
5190,
1318,
3301,
13,
288,
202,
202,
4181,
18,
1289,
12,
1128,
21,
1769,
202,
202,
4181,
18,
1289,
12,
1128,
22,
1769,
202,
97,
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,
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,
1152,
918,
3636,
2042,
6364,
5190,
12,
45,
6364,
5190,
1318,
3301,
13,
288,
202,
202,
4181,
18,
1289,
12,
1128,
21,
1769,
202,
202,
4181,
18,
1289,
12,
1128,
22,
1769,
202,
97,
2... |
for(int i=0;i<uris.length;i++) uris[i] = checkBlocks[i].getURI(); | for(int i=0;i<uris.length;i++) { FreenetURI uri = checkBlocks[i].getURI(); uris[i] = uri; } | public FreenetURI[] getCheckURIs() { FreenetURI[] uris = new FreenetURI[checkBlocks.length]; for(int i=0;i<uris.length;i++) uris[i] = checkBlocks[i].getURI(); return uris; } | 56348 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56348/b7133fb27d8a7d18085bd1d9ba428adcdbe21b69/InsertSegment.java/buggy/src/freenet/client/InsertSegment.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
478,
2842,
278,
3098,
8526,
336,
1564,
1099,
2520,
1435,
288,
202,
202,
42,
2842,
278,
3098,
8526,
21476,
273,
394,
478,
2842,
278,
3098,
63,
1893,
6450,
18,
2469,
15533,
202,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
478,
2842,
278,
3098,
8526,
336,
1564,
1099,
2520,
1435,
288,
202,
202,
42,
2842,
278,
3098,
8526,
21476,
273,
394,
478,
2842,
278,
3098,
63,
1893,
6450,
18,
2469,
15533,
202,
... |
if (newCCattr != null) { if (newCCattr.getNewValue().equals("")) { newCCattr.setNewValue(repository.getUserName()); } } | newCCattr.setValue(repository.getUserName()); bug.addAttribute(BugzillaReportElement.NEWCC, newCCattr); | private static void setDefaultCCValue(BugReport bug, TaskRepository repository) { Attribute newCCattr = bug.getAttributeForKnobName(KEY_NEWCC); Attribute owner = bug.getAttribute(KEY_ASSIGNED_TO); // Don't add the cc if the user is the bug owner if (repository.getUserName() == null || (owner != null && owner.getValue().indexOf(repository.getUserName()) != -1)) { MylarStatusHandler.log("Could not determine CC value for repository: " + repository, null); return; } // Add the user to the cc list if (newCCattr != null) { if (newCCattr.getNewValue().equals("")) { newCCattr.setNewValue(repository.getUserName()); } } } | 51151 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51151/021b803558816829652dd500f5695e5bfd03ae6c/BugzillaReportSubmitForm.java/buggy/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaReportSubmitForm.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
760,
918,
9277,
6743,
620,
12,
19865,
4820,
7934,
16,
3837,
3305,
3352,
13,
288,
202,
202,
1499,
394,
6743,
1747,
273,
7934,
18,
588,
1499,
1290,
47,
82,
947,
461,
12,
3297,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
760,
918,
9277,
6743,
620,
12,
19865,
4820,
7934,
16,
3837,
3305,
3352,
13,
288,
202,
202,
1499,
394,
6743,
1747,
273,
7934,
18,
588,
1499,
1290,
47,
82,
947,
461,
12,
3297,
... |
Map results = new HashMap(); String alphaNumeric = "^\\w+$"; String alphaNumericDotted = "^\\w[.\\w]+$"; | String parsedProperty = LsidUtils.parseField(property); | public Map getCollectionCount(@NotNull String type, @NotNull String property, @NotNull @Validate(Integer.class) Set ids, Map options) { Map results = new HashMap(); String alphaNumeric = "^\\w+$"; String alphaNumericDotted = "^\\w[.\\w]+$"; // TODO annotations if (!type.matches(alphaNumericDotted)) { throw new IllegalArgumentException("Type argument to getCollectionCount may ONLY be alpha-numeric with dots ("+alphaNumericDotted+")"); } if (!property.matches(alphaNumeric)) { throw new IllegalArgumentException("Property argument to getCollectionCount may ONLY be alpha-numeric ("+alphaNumeric+")"); } if (iQuery.checkType(type)) { throw new IllegalArgumentException(type+"."+property+" is an unknown type."); } if (iQuery.checkProperty(type,property)) { throw new IllegalArgumentException(type+"."+property+" is an unknown property on type "+type); } String query = "select size(table."+property+") from "+type+" table where table.id = ?"; // FIXME: optimize by doing new list(id,size(table.property)) ... group by id for (Iterator iter = ids.iterator(); iter.hasNext();) { Integer id = (Integer) iter.next(); Integer count = (Integer) iQuery.queryUnique(query,new Object[]{id}); results.put(id,count); } return results; } | 55464 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55464/0b36a8e77f5bacb7e122d76ffce01866205b09d7/PojosImpl.java/buggy/components/server/src/ome/logic/PojosImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1635,
12075,
1380,
26964,
5962,
514,
618,
16,
632,
5962,
514,
1272,
16,
2398,
632,
5962,
632,
4270,
12,
4522,
18,
1106,
13,
1000,
3258,
16,
1635,
702,
13,
565,
288,
7734,
1635,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
1635,
12075,
1380,
26964,
5962,
514,
618,
16,
632,
5962,
514,
1272,
16,
2398,
632,
5962,
632,
4270,
12,
4522,
18,
1106,
13,
1000,
3258,
16,
1635,
702,
13,
565,
288,
7734,
1635,
16... |
this.expr = getExpr().simplify(); | if ( this.expr != null ) { this.expr = this.expr.simplify(); } | public Expr simplify() { this.predicates.simplify(); this.expr = getExpr().simplify(); if ( this.predicates.getPredicates().size() == 0 ) { return getExpr(); } return this; } | 47110 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47110/0e26c11ee2398475ce7baab8fcfeb14f7ba01cb3/DefaultFilterExpr.java/buggy/jaxen/src/java/main/org/jaxen/expr/DefaultFilterExpr.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
8074,
16499,
1435,
565,
288,
3639,
333,
18,
6510,
8242,
18,
9812,
412,
1164,
5621,
3639,
309,
261,
333,
18,
8638,
480,
446,
262,
288,
333,
18,
8638,
273,
333,
18,
8638,
18,
9812,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8074,
16499,
1435,
565,
288,
3639,
333,
18,
6510,
8242,
18,
9812,
412,
1164,
5621,
3639,
309,
261,
333,
18,
8638,
480,
446,
262,
288,
333,
18,
8638,
273,
333,
18,
8638,
18,
9812,
... |
return fnOrScript.securityController.callWithDomain( fnOrScript.securityDomain, cx, fnOrScript, scope, thisObj, args); | return ifun.securityController.callWithDomain( ifun.securityDomain, cx, ifun, scope, thisObj, args); | static Object interpret(Context cx, Scriptable scope, Scriptable thisObj, Object[] args, double[] argsDbl, int argShift, int argCount, InterpretedFunction fnOrScript) { if (cx.interpreterSecurityDomain != fnOrScript.securityDomain) { if (argsDbl != null) { args = getArgsArray(args, argsDbl, argShift, argCount); } SecurityController sc = fnOrScript.securityController; Object savedDomain = cx.interpreterSecurityDomain; cx.interpreterSecurityDomain = fnOrScript.securityDomain; try { return fnOrScript.securityController.callWithDomain( fnOrScript.securityDomain, cx, fnOrScript, scope, thisObj, args); } finally { cx.interpreterSecurityDomain = savedDomain; } } InterpreterData idata = fnOrScript.idata; final Object DBL_MRK = Interpreter.DBL_MRK; final Scriptable undefined = Undefined.instance; final int LOCAL_SHFT = idata.itsMaxVars; final int STACK_SHFT = LOCAL_SHFT + idata.itsMaxLocals;// stack[0 <= i < LOCAL_SHFT]: variables// stack[LOCAL_SHFT <= i < TRY_STACK_SHFT]: used for local temporaries// stack[STACK_SHFT <= i < STACK_SHFT + idata.itsMaxStack]: stack data// sDbl[i]: if stack[i] is DBL_MRK, sDbl[i] holds the number value int maxFrameArray = idata.itsMaxFrameArray; if (maxFrameArray != STACK_SHFT + idata.itsMaxStack) Kit.codeBug(); Object[] stack = new Object[maxFrameArray]; double[] sDbl = new double[maxFrameArray]; int stackTop = STACK_SHFT - 1; int withDepth = 0; int definedArgs = fnOrScript.argCount; if (definedArgs > argCount) { definedArgs = argCount; } for (int i = 0; i != definedArgs; ++i) { Object arg = args[argShift + i]; stack[i] = arg; if (arg == DBL_MRK) { sDbl[i] = argsDbl[argShift + i]; } } for (int i = definedArgs; i != idata.itsMaxVars; ++i) { stack[i] = undefined; } DebugFrame debuggerFrame = null; boolean useActivationVars = false; if (cx.debugger != null) { debuggerFrame = cx.debugger.getFrame(cx, idata); useActivationVars = (debuggerFrame != null); } if (idata.itsNeedsActivation || useActivationVars) { if (argsDbl != null) { args = getArgsArray(args, argsDbl, argShift, argCount); argShift = 0; argsDbl = null; } } if (idata.itsFunctionType != 0) { if (!idata.useDynamicScope) { scope = fnOrScript.getParentScope(); } if (idata.itsCheckThis) { thisObj = ScriptRuntime.getThis(thisObj); } if (idata.itsNeedsActivation || useActivationVars) { scope = ScriptRuntime.enterActivationFunction(cx, scope, fnOrScript, thisObj, args); } } else { ScriptRuntime.initScript(fnOrScript, thisObj, cx, scope, fnOrScript.evalScriptFlag); } if (idata.itsNestedFunctions != null) { if (idata.itsFunctionType != 0 && !idata.itsNeedsActivation) Kit.codeBug(); for (int i = 0; i < idata.itsNestedFunctions.length; i++) { InterpreterData fdata = idata.itsNestedFunctions[i]; if (fdata.itsFunctionType == FunctionNode.FUNCTION_STATEMENT) { initFunction(cx, scope, fnOrScript, i); } } } Scriptable[] scriptRegExps = null; if (idata.itsRegExpLiterals != null) { // Wrapped regexps for functions are stored in InterpretedFunction // but for script which should not contain references to scope // the regexps re-wrapped during each script execution if (idata.itsFunctionType != 0) { scriptRegExps = fnOrScript.functionRegExps; } else { scriptRegExps = fnOrScript.createRegExpWraps(cx, scope); } } if (debuggerFrame != null) { debuggerFrame.onEnter(cx, scope, thisObj, args); } InterpreterData savedData = cx.interpreterData; int savedLineIndex = cx.interpreterLineIndex; cx.interpreterData = idata; cx.interpreterLineIndex = idata.firstLinePC; Object result = undefined; // If javaException != null on exit, it will be throw instead of // normal return Throwable javaException = null; int exceptionPC = -1; byte[] iCode = idata.itsICode; int pc = 0; int pcPrevBranch = 0; final boolean instructionCounting = (cx.instructionThreshold != 0); // arbitrary number to add to instructionCount when calling // other functions final int INVOCATION_COST = 100; String[] strings = idata.itsStringTable; String stringReg = null; int indexReg = 0; Loop: for (;;) { try { int op = iCode[pc++]; jumplessRun: { // Back indent to ease imlementation readingswitch (op) { case Icode_CATCH: { // The following code should be executed inside try/catch inside main // loop, not in the loop catch block itself to deal with exceptions // from observeInstructionCount. A special bytecode is used only to // simplify logic. if (javaException == null) Kit.codeBug(); pc = -1; boolean doCatch = false; int handlerOffset = getExceptionHandler(idata.itsExceptionTable, exceptionPC); if (handlerOffset >= 0) { final int SCRIPT_CAN_CATCH = 0, ONLY_FINALLY = 1, OTHER = 2; int exType; if (javaException instanceof JavaScriptException) { exType = SCRIPT_CAN_CATCH; } else if (javaException instanceof EcmaError) { // an offical ECMA error object, exType = SCRIPT_CAN_CATCH; } else if (javaException instanceof EvaluatorException) { exType = SCRIPT_CAN_CATCH; } else if (javaException instanceof RuntimeException) { exType = ONLY_FINALLY; } else { // Error instance exType = OTHER; } if (exType != OTHER) { // Do not allow for JS to interfere with Error instances // (exType == OTHER), as they can be used to terminate // long running script if (exType == SCRIPT_CAN_CATCH) { // Allow JS to catch only JavaScriptException and // EcmaError pc = idata.itsExceptionTable[handlerOffset + EXCEPTION_CATCH_SLOT]; if (pc >= 0) { // Has catch block doCatch = true; } } if (pc < 0) { pc = idata.itsExceptionTable[handlerOffset + EXCEPTION_FINALLY_SLOT]; } } } if (debuggerFrame != null && !(javaException instanceof Error)) { debuggerFrame.onExceptionThrown(cx, javaException); } if (pc < 0) { break Loop; } // We caught an exception // restore scope at try point int tryWithDepth = idata.itsExceptionTable[ handlerOffset + EXCEPTION_WITH_DEPTH_SLOT]; while (tryWithDepth != withDepth) { if (scope == null) Kit.codeBug(); scope = ScriptRuntime.leaveWith(scope); --withDepth; } if (doCatch) { stackTop = STACK_SHFT - 1; int exLocal = idata.itsExceptionTable[ handlerOffset + EXCEPTION_LOCAL_SLOT]; stack[LOCAL_SHFT + exLocal] = ScriptRuntime.getCatchObject( cx, scope, javaException); } else { stackTop = STACK_SHFT; // Call finally handler with javaException on stack top to // distinguish from normal invocation through GOSUB // which would contain DBL_MRK on the stack stack[stackTop] = javaException; } // clear exception javaException = null; if (instructionCounting) { // 500: catch cost cx.addInstructionCount(500); pcPrevBranch = pc; } continue Loop; } case Token.THROW: { Object value = stack[stackTop]; if (value == DBL_MRK) value = doubleWrap(sDbl[stackTop]); --stackTop; int sourceLine = getShort(iCode, pc); throw new JavaScriptException(value, idata.itsSourceFile, sourceLine); } case Token.GE : case Token.LE : case Token.GT : case Token.LT : stackTop = do_cmp(stack, sDbl, stackTop, op); continue Loop; case Token.IN : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); boolean valBln = ScriptRuntime.in(lhs, rhs, cx, scope); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; continue Loop; } case Token.INSTANCEOF : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); boolean valBln = ScriptRuntime.instanceOf(lhs, rhs, cx, scope); stack[stackTop] = valBln ? Boolean.TRUE : Boolean.FALSE; continue Loop; } case Token.EQ : case Token.NE : stackTop = do_eq(stack, sDbl, stackTop, op); continue Loop; case Token.SHEQ : case Token.SHNE : stackTop = do_sheq(stack, sDbl, stackTop, op); continue Loop; case Token.IFNE : if (stack_boolean(stack, sDbl, stackTop--)) { pc += 2; continue Loop; } break jumplessRun; case Token.IFEQ : if (!stack_boolean(stack, sDbl, stackTop--)) { pc += 2; continue Loop; } break jumplessRun; case Icode_IFEQ_POP : if (!stack_boolean(stack, sDbl, stackTop--)) { pc += 2; continue Loop; } stack[stackTop--] = null; break jumplessRun; case Token.GOTO : break jumplessRun; case Icode_GOSUB : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = pc + 2; break jumplessRun; case Icode_RETSUB : { // indexReg: local to store return address if (instructionCounting) { cx.addInstructionCount(pc - pcPrevBranch); } Object value = stack[LOCAL_SHFT + indexReg]; if (value != DBL_MRK) { // Invocation from exception handler, restore object to rethrow javaException = (Throwable)value; exceptionPC = pc - 1; pc = getJavaCatchPC(iCode); } else { // Normal return from GOSUB pc = (int)sDbl[LOCAL_SHFT + indexReg]; pcPrevBranch = pc; } continue Loop; } case Icode_POP : stack[stackTop] = null; stackTop--; continue Loop; case Icode_POP_RESULT : result = stack[stackTop]; if (result == DBL_MRK) result = doubleWrap(sDbl[stackTop]); stack[stackTop] = null; --stackTop; continue Loop; case Icode_DUP : stack[stackTop + 1] = stack[stackTop]; sDbl[stackTop + 1] = sDbl[stackTop]; stackTop++; continue Loop; case Icode_DUP2 : stack[stackTop + 1] = stack[stackTop - 1]; sDbl[stackTop + 1] = sDbl[stackTop - 1]; stack[stackTop + 2] = stack[stackTop]; sDbl[stackTop + 2] = sDbl[stackTop]; stackTop += 2; continue Loop; case Icode_SWAP : { Object o = stack[stackTop]; stack[stackTop] = stack[stackTop - 1]; stack[stackTop - 1] = o; double d = sDbl[stackTop]; sDbl[stackTop] = sDbl[stackTop - 1]; sDbl[stackTop - 1] = d; continue Loop; } case Token.RETURN : result = stack[stackTop]; if (result == DBL_MRK) result = doubleWrap(sDbl[stackTop]); --stackTop; break Loop; case Token.RETURN_RESULT : break Loop; case Icode_RETUNDEF : result = undefined; break Loop; case Token.BITNOT : { int rIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = ~rIntValue; continue Loop; } case Token.BITAND : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue & rIntValue; continue Loop; } case Token.BITOR : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue | rIntValue; continue Loop; } case Token.BITXOR : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue ^ rIntValue; continue Loop; } case Token.LSH : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue << rIntValue; continue Loop; } case Token.RSH : { int rIntValue = stack_int32(stack, sDbl, stackTop); --stackTop; int lIntValue = stack_int32(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lIntValue >> rIntValue; continue Loop; } case Token.URSH : { int rIntValue = stack_int32(stack, sDbl, stackTop) & 0x1F; --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = ScriptRuntime.toUint32(lDbl) >>> rIntValue; continue Loop; } case Token.NEG : { double rDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = -rDbl; continue Loop; } case Token.POS : { double rDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = rDbl; continue Loop; } case Token.ADD : stackTop = do_add(stack, sDbl, stackTop, cx); continue Loop; case Token.SUB : { double rDbl = stack_double(stack, sDbl, stackTop); --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lDbl - rDbl; continue Loop; } case Token.MUL : { double rDbl = stack_double(stack, sDbl, stackTop); --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lDbl * rDbl; continue Loop; } case Token.DIV : { double rDbl = stack_double(stack, sDbl, stackTop); --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; // Detect the divide by zero or let Java do it ? sDbl[stackTop] = lDbl / rDbl; continue Loop; } case Token.MOD : { double rDbl = stack_double(stack, sDbl, stackTop); --stackTop; double lDbl = stack_double(stack, sDbl, stackTop); stack[stackTop] = DBL_MRK; sDbl[stackTop] = lDbl % rDbl; continue Loop; } case Token.NOT : stack[stackTop] = stack_boolean(stack, sDbl, stackTop) ? Boolean.FALSE : Boolean.TRUE; continue Loop; case Token.BINDNAME : stack[++stackTop] = ScriptRuntime.bind(cx, scope, stringReg); continue Loop; case Token.SETNAME : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Scriptable lhs = (Scriptable)stack[stackTop]; stack[stackTop] = ScriptRuntime.setName(lhs, rhs, cx, scope, stringReg); continue Loop; } case Token.DELPROP : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.delete(cx, scope, lhs, rhs); continue Loop; } case Token.GETPROP : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.getObjectProp(lhs, stringReg, cx, scope); continue Loop; } case Token.SETPROP : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.setObjectProp(lhs, stringReg, rhs, cx, scope); continue Loop; } case Icode_PROP_INC_DEC : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.propIncrDecr(lhs, stringReg, scope, iCode[pc]); ++pc; continue Loop; } case Token.GETELEM : stackTop = do_getElem(stack, sDbl, stackTop, cx, scope); continue Loop; case Token.SETELEM : stackTop = do_setElem(stack, sDbl, stackTop, cx, scope); continue Loop; case Icode_ELEM_INC_DEC: { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.elemIncrDecr(lhs, rhs, cx, scope, iCode[pc]); ++pc; continue Loop; } case Token.GET_REF : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.getReference(lhs); continue Loop; } case Token.SET_REF : { Object rhs = stack[stackTop]; if (rhs == DBL_MRK) rhs = doubleWrap(sDbl[stackTop]); --stackTop; Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.setReference(lhs, rhs); continue Loop; } case Token.DEL_REF : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.deleteReference(lhs); continue Loop; } case Icode_REF_INC_DEC : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.referenceIncrDecr(lhs, iCode[pc]); ++pc; continue Loop; } case Token.LOCAL_SAVE : stack[LOCAL_SHFT + indexReg] = stack[stackTop]; sDbl[LOCAL_SHFT + indexReg] = sDbl[stackTop]; --stackTop; continue Loop; case Token.LOCAL_LOAD : ++stackTop; stack[stackTop] = stack[LOCAL_SHFT + indexReg]; sDbl[stackTop] = sDbl[LOCAL_SHFT + indexReg]; continue Loop; case Icode_NAME_AND_THIS : // stringReg: name ++stackTop; stack[stackTop] = ScriptRuntime.getNameFunctionAndThis(stringReg, cx, scope); ++stackTop; stack[stackTop] = ScriptRuntime.lastStoredScriptable(cx); continue Loop; case Icode_PROP_AND_THIS: { Object obj = stack[stackTop]; if (obj == DBL_MRK) obj = doubleWrap(sDbl[stackTop]); // stringReg: property stack[stackTop] = ScriptRuntime.getPropFunctionAndThis(obj, stringReg, cx, scope); ++stackTop; stack[stackTop] = ScriptRuntime.lastStoredScriptable(cx); continue Loop; } case Icode_ELEM_AND_THIS: { Object obj = stack[stackTop - 1]; if (obj == DBL_MRK) obj = doubleWrap(sDbl[stackTop - 1]); Object id = stack[stackTop]; if (id == DBL_MRK) id = doubleWrap(sDbl[stackTop]); stack[stackTop - 1] = ScriptRuntime.getElemFunctionAndThis(obj, id, cx, scope); stack[stackTop] = ScriptRuntime.lastStoredScriptable(cx); continue Loop; } case Icode_VALUE_AND_THIS : { Object value = stack[stackTop]; if (value == DBL_MRK) value = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.getValueFunctionAndThis(value, cx); ++stackTop; stack[stackTop] = ScriptRuntime.lastStoredScriptable(cx); continue Loop; } case Icode_CALLSPECIAL : { if (instructionCounting) { cx.instructionCount += INVOCATION_COST; } // indexReg: number of arguments int callType = iCode[pc] & 0xFF; boolean isNew = (iCode[pc + 1] != 0); int sourceLine = getShort(iCode, pc + 2); stackTop -= indexReg; Object[] outArgs = getArgsArray(stack, sDbl, stackTop + 1, indexReg); if (isNew) { Object function = stack[stackTop]; if (function == DBL_MRK) function = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.newSpecial( cx, function, outArgs, scope, callType); } else { // Call code generation ensure that stack here // is ... Function Scriptable Scriptable functionThis = (Scriptable)stack[stackTop]; --stackTop; Function function = (Function)stack[stackTop]; stack[stackTop] = ScriptRuntime.callSpecial( cx, function, functionThis, outArgs, scope, thisObj, callType, idata.itsSourceFile, sourceLine); } pc += 4; continue Loop; } case Token.CALL : { if (instructionCounting) { cx.instructionCount += INVOCATION_COST; } // indexReg: number of arguments stackTop -= indexReg; int calleeArgShft = stackTop + 1; // CALL generation ensures that funThisObj and fun // are already Scriptable and Function objects respectively Scriptable funThisObj = (Scriptable)stack[stackTop]; --stackTop; Function fun = (Function)stack[stackTop]; Scriptable funScope = scope; if (idata.itsNeedsActivation) { funScope = ScriptableObject.getTopLevelScope(scope); } if (fun instanceof InterpretedFunction) { // Inlining of InterpretedFunction.call not to create // argument array InterpretedFunction ifun = (InterpretedFunction)fun; stack[stackTop] = interpret(cx, funScope, funThisObj, stack, sDbl, calleeArgShft, indexReg, ifun); } else { Object[] outArgs = getArgsArray(stack, sDbl, calleeArgShft, indexReg); stack[stackTop] = fun.call(cx, funScope, funThisObj, outArgs); } continue Loop; } case Token.REF_CALL : { if (instructionCounting) { cx.instructionCount += INVOCATION_COST; } // indexReg: number of arguments stackTop -= indexReg; int calleeArgShft = stackTop + 1; // REF_CALL generation ensures that funThisObj and fun // are already Scriptable and Function objects respectively Scriptable funThisObj = (Scriptable)stack[stackTop]; --stackTop; Function fun = (Function)stack[stackTop]; Scriptable funScope = scope; if (idata.itsNeedsActivation) { funScope = ScriptableObject.getTopLevelScope(scope); } Object[] outArgs = getArgsArray(stack, sDbl, calleeArgShft, indexReg); stack[stackTop] = ScriptRuntime.referenceCall(fun, funThisObj, outArgs, cx, funScope); continue Loop; } case Token.NEW : { if (instructionCounting) { cx.instructionCount += INVOCATION_COST; } // indexReg: number of arguments stackTop -= indexReg; int calleeArgShft = stackTop + 1; Object lhs = stack[stackTop]; if (lhs instanceof InterpretedFunction) { // Inlining of InterpretedFunction.construct not to create // argument array InterpretedFunction f = (InterpretedFunction)lhs; Scriptable newInstance = f.createObject(cx, scope); Object callResult = interpret(cx, scope, newInstance, stack, sDbl, calleeArgShft, indexReg, f); if (callResult instanceof Scriptable && callResult != undefined) { stack[stackTop] = callResult; } else { stack[stackTop] = newInstance; } } else if (lhs instanceof Function) { Function f = (Function)lhs; Object[] outArgs = getArgsArray(stack, sDbl, calleeArgShft, indexReg); stack[stackTop] = f.construct(cx, scope, outArgs); } else { if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); throw notAFunction(lhs, idata, pc); } pc += 2; // skip debug name index continue Loop; } case Token.TYPEOF : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.typeof(lhs); continue Loop; } case Icode_TYPEOFNAME : stack[++stackTop] = ScriptRuntime.typeofName(scope, stringReg); continue Loop; case Token.STRING : stack[++stackTop] = stringReg; continue Loop; case Icode_SHORTNUMBER : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = getShort(iCode, pc); pc += 2; continue Loop; case Icode_INTNUMBER : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = getInt(iCode, pc); pc += 4; continue Loop; case Token.NUMBER : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = idata.itsDoubleTable[indexReg]; continue Loop; case Token.NAME : stack[++stackTop] = ScriptRuntime.name(cx, scope, stringReg); continue Loop; case Icode_NAME_INC_DEC : stack[++stackTop] = ScriptRuntime.nameIncrDecr(scope, stringReg, iCode[pc]); ++pc; continue Loop; case Icode_SETVAR1: indexReg = iCode[pc++]; // fallthrough case Token.SETVAR : if (!useActivationVars) { stack[indexReg] = stack[stackTop]; sDbl[indexReg] = sDbl[stackTop]; } else { Object val = stack[stackTop]; if (val == DBL_MRK) val = doubleWrap(sDbl[stackTop]); activationPut(fnOrScript, scope, indexReg, val); } continue Loop; case Icode_GETVAR1: indexReg = iCode[pc++]; // fallthrough case Token.GETVAR : ++stackTop; if (!useActivationVars) { stack[stackTop] = stack[indexReg]; sDbl[stackTop] = sDbl[indexReg]; } else { stack[stackTop] = activationGet(fnOrScript, scope, indexReg); } continue Loop; case Icode_VAR_INC_DEC : { // indexReg : varindex ++stackTop; int incrDecrMask = iCode[pc]; if (!useActivationVars) { stack[stackTop] = DBL_MRK; Object varValue = stack[indexReg]; double d; if (varValue == DBL_MRK) { d = sDbl[indexReg]; } else { d = ScriptRuntime.toNumber(varValue); stack[indexReg] = DBL_MRK; } double d2 = ((incrDecrMask & Node.DECR_FLAG) == 0) ? d + 1.0 : d - 1.0; sDbl[indexReg] = d2; sDbl[stackTop] = ((incrDecrMask & Node.POST_FLAG) == 0) ? d2 : d; } else { String varName = fnOrScript.argNames[indexReg]; stack[stackTop] = ScriptRuntime.nameIncrDecr(scope, varName, incrDecrMask); } ++pc; continue Loop; } case Icode_ZERO : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = 0; continue Loop; case Icode_ONE : ++stackTop; stack[stackTop] = DBL_MRK; sDbl[stackTop] = 1; continue Loop; case Token.NULL : stack[++stackTop] = null; continue Loop; case Token.THIS : stack[++stackTop] = thisObj; continue Loop; case Token.THISFN : stack[++stackTop] = fnOrScript; continue Loop; case Token.FALSE : stack[++stackTop] = Boolean.FALSE; continue Loop; case Token.TRUE : stack[++stackTop] = Boolean.TRUE; continue Loop; case Icode_UNDEF : stack[++stackTop] = undefined; continue Loop; case Token.ENTERWITH : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); --stackTop; scope = ScriptRuntime.enterWith(lhs, scope); ++withDepth; continue Loop; } case Token.LEAVEWITH : scope = ScriptRuntime.leaveWith(scope); --withDepth; continue Loop; case Token.CATCH_SCOPE : stack[stackTop] = ScriptRuntime.newCatchScope(stringReg, stack[stackTop]); continue Loop; case Token.ENUM_INIT_KEYS : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); --stackTop; stack[LOCAL_SHFT + indexReg] = ScriptRuntime.enumInit(lhs, scope); continue Loop; } case Token.ENUM_INIT_VALUES : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); --stackTop; stack[LOCAL_SHFT + indexReg] = ScriptRuntime.enumValuesInit(lhs, scope); continue Loop; } case Token.ENUM_NEXT : case Token.ENUM_ID : { Object val = stack[LOCAL_SHFT + indexReg]; ++stackTop; stack[stackTop] = (op == Token.ENUM_NEXT) ? (Object)ScriptRuntime.enumNext(val) : (Object)ScriptRuntime.enumId(val, cx); continue Loop; } case Token.SPECIAL_REF : { //stringReg: name of special property Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.specialReference(lhs, stringReg, cx, scope); continue Loop; } case Token.XML_REF : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.xmlReference(lhs, cx, scope); continue Loop; } case Icode_SCOPE : stack[++stackTop] = scope; continue Loop; case Icode_CLOSURE_EXPR : stack[++stackTop] = InterpretedFunction.createFunction(cx, scope, fnOrScript, indexReg); continue Loop; case Icode_CLOSURE_STMT : initFunction(cx, scope, fnOrScript, indexReg); continue Loop; case Token.REGEXP : stack[++stackTop] = scriptRegExps[indexReg]; continue Loop; case Icode_LITERAL_NEW : // indexReg: number of values in the literal ++stackTop; stack[stackTop] = new Object[indexReg]; sDbl[stackTop] = 0; continue Loop; case Icode_LITERAL_SET : { Object value = stack[stackTop]; if (value == DBL_MRK) value = doubleWrap(sDbl[stackTop]); --stackTop; int i = (int)sDbl[stackTop]; ((Object[])stack[stackTop])[i] = value; sDbl[stackTop] = i + 1; continue Loop; } case Token.ARRAYLIT : case Icode_SPARE_ARRAYLIT : case Token.OBJECTLIT : { Object[] data = (Object[])stack[stackTop]; Object val; if (op == Token.OBJECTLIT) { Object[] ids = (Object[])idata.literalIds[indexReg]; val = ScriptRuntime.newObjectLiteral(ids, data, cx, scope); } else { int[] skipIndexces = null; if (op == Icode_SPARE_ARRAYLIT) { skipIndexces = (int[])idata.literalIds[indexReg]; } val = ScriptRuntime.newArrayLiteral(data, skipIndexces, cx, scope); } stack[stackTop] = val; continue Loop; } case Icode_ENTERDQ : { Object lhs = stack[stackTop]; if (lhs == DBL_MRK) lhs = doubleWrap(sDbl[stackTop]); --stackTop; scope = ScriptRuntime.enterDotQuery(lhs, scope); ++withDepth; continue Loop; } case Icode_LEAVEDQ : { boolean valBln = stack_boolean(stack, sDbl, stackTop); Object x = ScriptRuntime.updateDotQuery(valBln, scope); if (x != null) { stack[stackTop] = x; scope = ScriptRuntime.leaveDotQuery(scope); --withDepth; pc += 2; continue Loop; } // reset stack and PC to code after ENTERDQ --stackTop; break jumplessRun; } case Token.DEFAULTNAMESPACE : { Object value = stack[stackTop]; if (value == DBL_MRK) value = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.setDefaultNamespace(value, cx); continue Loop; } case Token.ESCXMLATTR : { Object value = stack[stackTop]; if (value != DBL_MRK) { stack[stackTop] = ScriptRuntime.escapeAttributeValue(value, cx); } continue Loop; } case Token.ESCXMLTEXT : { Object value = stack[stackTop]; if (value != DBL_MRK) { stack[stackTop] = ScriptRuntime.escapeTextValue(value, cx); } continue Loop; } case Token.TOATTRNAME : { Object value = stack[stackTop]; if (value == DBL_MRK) value = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.toAttributeName(value, cx); continue Loop; } case Token.DESCENDANTS : { Object value = stack[stackTop]; if(value == DBL_MRK) value = doubleWrap(sDbl[stackTop]); stack[stackTop] = ScriptRuntime.toDescendantsName(value, cx); continue Loop; } case Token.COLONCOLON : { Object value = stack[stackTop]; if (value == DBL_MRK) value = doubleWrap(sDbl[stackTop]); // stringReg contains namespace stack[stackTop] = ScriptRuntime.toQualifiedName(stringReg, value, cx, scope); continue Loop; } case Icode_LINE : cx.interpreterLineIndex = pc; if (debuggerFrame != null) { int line = getShort(iCode, pc); debuggerFrame.onLineChange(cx, line); } pc += 2; continue Loop; case Icode_REG_IND_C0: indexReg = 0; continue Loop; case Icode_REG_IND_C1: indexReg = 1; continue Loop; case Icode_REG_IND_C2: indexReg = 2; continue Loop; case Icode_REG_IND_C3: indexReg = 3; continue Loop; case Icode_REG_IND_C4: indexReg = 4; continue Loop; case Icode_REG_IND_C5: indexReg = 5; continue Loop; case Icode_REG_IND1: indexReg = 0xFF & iCode[pc]; ++pc; continue Loop; case Icode_REG_IND2: indexReg = getIndex(iCode, pc); pc += 2; continue Loop; case Icode_REG_IND4: indexReg = getInt(iCode, pc); pc += 4; continue Loop; case Icode_REG_STR_C0: stringReg = strings[0]; continue Loop; case Icode_REG_STR_C1: stringReg = strings[1]; continue Loop; case Icode_REG_STR_C2: stringReg = strings[2]; continue Loop; case Icode_REG_STR_C3: stringReg = strings[3]; continue Loop; case Icode_REG_STR1: stringReg = strings[0xFF & iCode[pc]]; ++pc; continue Loop; case Icode_REG_STR2: stringReg = strings[getIndex(iCode, pc)]; pc += 2; continue Loop; case Icode_REG_STR4: stringReg = strings[getInt(iCode, pc)]; pc += 4; continue Loop; default : dumpICode(idata); throw new RuntimeException("Unknown icode : "+op+" @ pc : "+(pc-1));} // end of interpreter switch } // end of jumplessRun label block // This should be reachable only for jump implementation // when pc points to encoded target offset if (instructionCounting) { cx.addInstructionCount(pc + 2 - pcPrevBranch); } int offset = getShort(iCode, pc); if (offset != 0) { // -1 accounts for pc pointing to jump opcode + 1 pc += offset - 1; } else { pc = idata.longJumps.getExistingInt(pc); } pcPrevBranch = pc; continue Loop; } // end of interpreter try catch (Throwable ex) { if (instructionCounting) { // Can not call addInstructionCount as it may trigger // exception cx.instructionCount += pc - pcPrevBranch; } javaException = ex; exceptionPC = pc - 1; pc = getJavaCatchPC(iCode); continue Loop; } } // end of interpreter loop cx.interpreterData = savedData; cx.interpreterLineIndex = savedLineIndex; if (debuggerFrame != null) { if (javaException != null) { debuggerFrame.onExit(cx, true, javaException); } else { debuggerFrame.onExit(cx, false, result); } } if (idata.itsFunctionType != 0) { if (idata.itsNeedsActivation || useActivationVars) { ScriptRuntime.exitActivationFunction(cx); } } if (javaException != null) { if (javaException instanceof RuntimeException) { throw (RuntimeException)javaException; } else { // Must be instance of Error or code bug throw (Error)javaException; } } return result; } | 51996 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51996/199b043221701f9744538a048390c041bd370c5f/Interpreter.java/buggy/js/rhino/src/org/mozilla/javascript/Interpreter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
760,
1033,
10634,
12,
1042,
9494,
16,
22780,
2146,
16,
22780,
15261,
16,
18701,
1033,
8526,
833,
16,
1645,
8526,
833,
40,
3083,
16,
18701,
509,
1501,
10544,
16,
509,
1501,
1380,
16,
18701... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
760,
1033,
10634,
12,
1042,
9494,
16,
22780,
2146,
16,
22780,
15261,
16,
18701,
1033,
8526,
833,
16,
1645,
8526,
833,
40,
3083,
16,
18701,
509,
1501,
10544,
16,
509,
1501,
1380,
16,
18701... |
String phones = Html.createOptionList( "", tmp_phones ); vec.add( "#PHONES_MENU#" ); vec.add( phones ); | private void showAddUserPage( Properties tmp_userInfo, HttpServletResponse res, Vector phoneTypesV, Vector tmp_phones, UserDomainObject user, IMCServiceInterface imcref, HttpServletRequest req, HttpSession session ) throws IOException { String login_name = ""; String password1 = ""; String password2 = ""; String new_pwd1 = ""; //hidden fildes String new_pwd2 = ""; //hidden fildes String first_name = ""; String last_name = ""; String title = ""; String company = ""; String address = ""; String city = ""; String zip = ""; String country = ""; String country_council = ""; String email = ""; //Lets set values from session if we have any if ( tmp_userInfo != null ) { login_name = tmp_userInfo.getProperty( "login_name" ); password1 = tmp_userInfo.getProperty( "password1" ); password2 = tmp_userInfo.getProperty( "password2" ); new_pwd1 = tmp_userInfo.getProperty( "new_pwd1" ); //hidden fildes new_pwd2 = tmp_userInfo.getProperty( "new_pwd2" ); //hidden fildes first_name = tmp_userInfo.getProperty( "first_name" ); last_name = tmp_userInfo.getProperty( "last_name" ); title = tmp_userInfo.getProperty( "title" ); company = tmp_userInfo.getProperty( "company" ); address = tmp_userInfo.getProperty( "address" ); city = tmp_userInfo.getProperty( "city" ); zip = tmp_userInfo.getProperty( "zip" ); country = tmp_userInfo.getProperty( "country" ); country_council = tmp_userInfo.getProperty( "country_council" ); email = tmp_userInfo.getProperty( "email" ); } Vector vec = new Vector(); // hold tags and values to parse html page Utility.setDefaultHtmlContentType( res ); // set content type Writer out = res.getWriter(); // to write out html page // VariableManager vm = new VariableManager() ; vec.add( "#LOGIN_NAME#" ); vec.add( login_name ); vec.add( "#PWD1#" ); vec.add( password1 ); vec.add( "#PWD2#" ); vec.add( password2 ); vec.add( "#NEW_PWD1#" ); vec.add( new_pwd1 ); //hidden fildes vec.add( "#NEW_PWD2#" ); vec.add( new_pwd2 ); //hidden fildes vec.add( "#FIRST_NAME#" ); vec.add( first_name ); vec.add( "#LAST_NAME#" ); vec.add( last_name ); vec.add( "#TITLE#" ); vec.add( title ); vec.add( "#COMPANY#" ); vec.add( company ); vec.add( "#ADDRESS#" ); vec.add( address ); vec.add( "#CITY#" ); vec.add( city ); vec.add( "#ZIP#" ); vec.add( zip ); vec.add( "#COUNTRY#" ); vec.add( country ); vec.add( "#COUNTRY_COUNCIL#" ); vec.add( country_council ); vec.add( "#EMAIL#" ); vec.add( email ); vec.add( "#ADMIN_TASK#" ); vec.add( "ADD_USER" ); vec.add( "#PHONE_ID#" ); vec.add( "" ); vec.add( "#NUMBER#" ); vec.add( "" ); // phonetype list String phonetypes = Html.createOptionList( "1", phoneTypesV ); vec.add( "#PHONETYPES_MENU#" ); vec.add( phonetypes ); // phoneslist String phones = Html.createOptionList( "", tmp_phones ); vec.add( "#PHONES_MENU#" ); vec.add( phones ); // Lets add html for admin_part in AdminUserResp vec.add( "#ADMIN_PART#" ); vec.add( createAdminPartHtml( user, null, imcref, req, session ) ); String languagesHtmlOptionList = getLanguagesHtmlOptionList( user, imcref, user ); vec.add( "#LANG_TYPES#" ); vec.add( languagesHtmlOptionList ); //store all data into the session session.setAttribute( "Ok_phoneNumbers", tmp_phones ); // Lets create the HTML page String outputString = imcref.getAdminTemplate( HTML_RESPONSE, user, vec ); out.write( outputString ); } | 8781 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8781/987c2b1b5f744d06cd89f9c3915a4d15e8fe5445/AdminUserProps.java/buggy/server/src/com/imcode/imcms/servlet/superadmin/AdminUserProps.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
2405,
986,
1299,
1964,
12,
6183,
1853,
67,
1355,
966,
16,
12446,
400,
16,
5589,
7353,
2016,
58,
16,
21394,
5589,
1853,
67,
844,
5322,
16,
2177,
3748,
921,
729,
16,
6246,
39,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
2405,
986,
1299,
1964,
12,
6183,
1853,
67,
1355,
966,
16,
12446,
400,
16,
5589,
7353,
2016,
58,
16,
21394,
5589,
1853,
67,
844,
5322,
16,
2177,
3748,
921,
729,
16,
6246,
39,
... | |
HtmlTagFilter reader = HtmlTagFilter.makeNestedFilter(new StringReader(content), ListUtil.list(tagPair2, tagPair1)); assertReaderMatchesString(expectedContent, reader); | assertFilterString(expectedContent, content, ListUtil.list(tagPair2, tagPair1)); | public void testFiltersMultipleTagsSimpleNesting() throws IOException { String content = "This "+startTag1+"is "+startTag2 +"test "+endTag2+"content"+endTag1+"here"; String expectedContent = "This here"; HtmlTagFilter reader = HtmlTagFilter.makeNestedFilter(new StringReader(content), ListUtil.list(tagPair2, tagPair1)); assertReaderMatchesString(expectedContent, reader); } | 8150 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8150/0418a89b51dc6662e200d5915cd31ca83affc74f/TestHtmlTagFilter.java/buggy/test/src/org/lockss/filter/TestHtmlTagFilter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
1842,
5422,
8438,
3453,
5784,
50,
10100,
1435,
1216,
1860,
288,
565,
514,
913,
273,
1377,
315,
2503,
13773,
1937,
1805,
21,
9078,
291,
13773,
1937,
1805,
22,
1377,
397,
6,
3813... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
1842,
5422,
8438,
3453,
5784,
50,
10100,
1435,
1216,
1860,
288,
565,
514,
913,
273,
1377,
315,
2503,
13773,
1937,
1805,
21,
9078,
291,
13773,
1937,
1805,
22,
1377,
397,
6,
3813... |
public IPreferenceStore getPreferenceStore() { | protected IPreferenceStore getPreferenceStore() { | public IPreferenceStore getPreferenceStore() { return fPreferenceStore; } | 9698 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/9698/f2db10c91328da519181230c2f744867ca4fb6b1/JavaTextTools.java/buggy/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaTextTools.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
467,
9624,
2257,
336,
9624,
2257,
1435,
288,
202,
202,
2463,
284,
9624,
2257,
31,
202,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
467,
9624,
2257,
336,
9624,
2257,
1435,
288,
202,
202,
2463,
284,
9624,
2257,
31,
202,
97,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
public NumberFormatter getNumberFormatter(String value) { NumberFormatter fmt = (NumberFormatter) numberFormatters.get(value); if (fmt == null) { fmt = new NumberFormatter(value, locale); numberFormatters.put(value, fmt); | public NumberFormatter getNumberFormatter( String value ) { NumberFormatter fmt = ( NumberFormatter ) numberFormatters.get( value ); if ( fmt == null ) { fmt = new NumberFormatter( value, locale ); numberFormatters.put( value, fmt ); | public NumberFormatter getNumberFormatter(String value) { NumberFormatter fmt = (NumberFormatter) numberFormatters.get(value); if (fmt == null) { fmt = new NumberFormatter(value, locale); numberFormatters.put(value, fmt); } return fmt; } | 15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/b900dee3dd264c71eb7ed27f88571d5b40a336c0/ExecutionContext.java/buggy/engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/executor/ExecutionContext.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
3588,
5074,
18491,
5074,
12,
780,
460,
13,
288,
202,
202,
1854,
5074,
1325,
273,
261,
1854,
5074,
13,
1300,
31332,
18,
588,
12,
1132,
1769,
202,
202,
430,
261,
8666,
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,
225,
202,
482,
3588,
5074,
18491,
5074,
12,
780,
460,
13,
288,
202,
202,
1854,
5074,
1325,
273,
261,
1854,
5074,
13,
1300,
31332,
18,
588,
12,
1132,
1769,
202,
202,
430,
261,
8666,
422,
446,... |
} | public Expr clone(Object context) { NamespaceContext n = nsctx; if (context instanceof NamespaceContext) { n = (NamespaceContext) context; } ElementAvailableFunction f = new ElementAvailableFunction(n); int len = args.size(); List args2 = new ArrayList(len); for (int i = 0; i < len; i++) { args2.add(((Expr) args.get(i)).clone(context)); } f.setArguments(args2); return f; } | 1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/ElementAvailableFunction.java/buggy/core/src/classpath/gnu/gnu/xml/transform/ElementAvailableFunction.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
8074,
3236,
12,
921,
819,
13,
225,
288,
565,
6005,
1042,
290,
273,
3153,
5900,
31,
565,
309,
261,
2472,
1276,
6005,
1042,
13,
1377,
288,
3639,
290,
273,
261,
3402,
1042,
13,
819,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8074,
3236,
12,
921,
819,
13,
225,
288,
565,
6005,
1042,
290,
273,
3153,
5900,
31,
565,
309,
261,
2472,
1276,
6005,
1042,
13,
1377,
288,
3639,
290,
273,
261,
3402,
1042,
13,
819,
... | |
if (mouseButton == MouseEvent.BUTTON3) { | if (layer == null) { return; } else if (mouseButton == MouseEvent.BUTTON3) { | private void doMouse(MouseEvent event) { if (currentMap == null || currentLayer < 0) { return; } //MapLayerEdit mle; //Component c = e.getComponent(); //System.out.println(e.toString()); //System.out.println(c.getClass().toString()); Point tile = mapView.screenToTileCoords(event.getX(), event.getY()); MapLayer layer = currentMap.getLayer(currentLayer); if (mouseButton == MouseEvent.BUTTON3) { Tile newTile = layer.getTileAt(tile.x, tile.y); if (newTile != currentMap.getNullTile() && newTile != currentTile) { setCurrentTile(newTile); } } else { switch (currentPointerState) { case PS_PAINT: paintEdit.setPresentationName("Paint Tool"); currentBrush.commitPaint(currentMap, tile.x, tile.y, currentLayer); mapView.repaintRegion(currentBrush.getCenteredBounds(tile.x,tile.y)); break; case PS_ERASE: paintEdit.setPresentationName("Erase Tool"); layer.setTileAt(tile.x, tile.y, currentMap.getNullTile()); mapView.repaintRegion(new Rectangle(tile.x, tile.y, 1, 1)); break; case PS_POUR: paintEdit = null; Tile oldTile = layer.getTileAt(tile.x, tile.y); pour(layer, tile.x, tile.y, currentTile, oldTile); mapView.repaint(); break; case PS_EYED: Tile newTile = layer.getTileAt(tile.x, tile.y); if (newTile != currentMap.getNullTile() && newTile != currentTile) { setCurrentTile(newTile); } break; case PS_MOVE: layer.translate( tile.x - this.mousePressLocation.x, tile.y - mousePressLocation.y); mapView.repaint(); break; } updateHistory(); } } | 6621 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6621/0ccdf044d1c2050a196cba4fd6b891f33510af62/MapEditor.java/clean/tiled/mapeditor/MapEditor.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
741,
9186,
12,
9186,
1133,
871,
13,
288,
3639,
309,
261,
2972,
863,
422,
446,
747,
783,
4576,
411,
374,
13,
288,
5411,
327,
31,
3639,
289,
3639,
368,
863,
4576,
4666,
312,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
741,
9186,
12,
9186,
1133,
871,
13,
288,
3639,
309,
261,
2972,
863,
422,
446,
747,
783,
4576,
411,
374,
13,
288,
5411,
327,
31,
3639,
289,
3639,
368,
863,
4576,
4666,
312,
... |
protected static String guessContentTypeFromName(String fname) | public static String guessContentTypeFromName(String fname) | protected static String guessContentTypeFromName(String fname) { int dot = fname.lastIndexOf ("."); if (dot != -1) { if (dot == fname.length()) return ("application/octet-stream"); else fname = fname.substring (dot + 1); } String type = MimeTypes.getMimeTypeFromExtension (fname); if (type == null) return("application/octet-stream"); return(type); } | 5916 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/5916/b36f8eef237505f078dd95cd2d50183f990c35aa/URLConnection.java/buggy/libjava/java/net/URLConnection.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
760,
514,
7274,
8046,
29732,
12,
780,
5299,
13,
225,
288,
565,
509,
3928,
273,
5299,
18,
2722,
31985,
7566,
1199,
1769,
3639,
309,
261,
9811,
480,
300,
21,
13,
1377,
288,
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,
282,
1071,
760,
514,
7274,
8046,
29732,
12,
780,
5299,
13,
225,
288,
565,
509,
3928,
273,
5299,
18,
2722,
31985,
7566,
1199,
1769,
3639,
309,
261,
9811,
480,
300,
21,
13,
1377,
288,
202,
430... |
Assert.fail( ee.getMessage() ); | fail( ee.getMessage() ); | public void testDecodeModifyDNRequestSuccess() throws NamingException { Asn1Decoder ldapDecoder = new LdapDecoder(); ByteBuffer stream = ByteBuffer.allocate( 0x48 ); stream.put( new byte[] { 0x30, 0x46, // LDAPMessage ::= SEQUENCE { 0x02, 0x01, 0x01, // messageID MessageID 0x6C, 0x41, // CHOICE { ..., modifyDNRequest ModifyDNRequest, ... // ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { // entry LDAPDN, 0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o', 'u', '=', 'u', 's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', // newrdn RelativeLDAPDN, 0x04, 0x0F, 'c', 'n', '=', 't', 'e', 's', 't', 'D', 'N', 'M', 'o', 'd', 'i', 'f', 'y', 0x01, 0x01, 0x00, // deleteoldrdn BOOLEAN, // newSuperior [0] LDAPDN OPTIONAL } (byte)0x80, 0x09, 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm' } ); String decodedPdu = StringTools.dumpBytes( stream.array() ); stream.flip(); // Allocate a ModifyRequest Container IAsn1Container ldapMessageContainer = new LdapMessageContainer(); try { ldapDecoder.decode( stream, ldapMessageContainer ); } catch ( DecoderException de ) { de.printStackTrace(); Assert.fail( de.getMessage() ); } LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage(); ModifyDNRequest modifyDNRequest = message.getModifyDNRequest(); Assert.assertEquals( 1, message.getMessageId() ); Assert.assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry() ); Assert.assertEquals( false, modifyDNRequest.isDeleteOldRDN() ); Assert.assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN() ); Assert.assertEquals( "ou=system", modifyDNRequest.getNewSuperior() ); // Check the length Assert.assertEquals(0x48, message.computeLength()); // Check the encoding try { ByteBuffer bb = message.encode( null ); String encodedPdu = StringTools.dumpBytes( bb.array() ); Assert.assertEquals(encodedPdu, decodedPdu ); } catch ( EncoderException ee ) { ee.printStackTrace(); Assert.fail( ee.getMessage() ); } } | 54578 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54578/b1f00abcb7ac934d21160a8bbfc5a5c09acdf2be/ModifyDNRequestTest.java/buggy/ldap/src/test/java/org/apache/ldap/common/codec/modifyDn/ModifyDNRequestTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
6615,
11047,
8609,
691,
4510,
1435,
1216,
26890,
565,
288,
3639,
31277,
21,
7975,
8079,
7975,
273,
394,
18053,
7975,
5621,
3639,
7400,
225,
1407,
1377,
273,
7400,
18,
16247... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6615,
11047,
8609,
691,
4510,
1435,
1216,
26890,
565,
288,
3639,
31277,
21,
7975,
8079,
7975,
273,
394,
18053,
7975,
5621,
3639,
7400,
225,
1407,
1377,
273,
7400,
18,
16247... |
throws IOException, XmlPullParserException { beginReq(); beginReqBody(); | throws ZmeException { try { beginReq(); beginReqBody(); | public void exec(String acctName, String passwd) throws IOException, XmlPullParserException { beginReq(); beginReqBody(); mSerializer.setPrefix("", NS_ZIMBRA_ACCT); mSerializer.startTag(NS_ZIMBRA_ACCT, EL_AUTH_REQ); mSerializer.startTag(null, EL_ACCT); mSerializer.attribute(null, AT_BY, NAME); mSerializer.text(acctName); mSerializer.endTag(null, EL_ACCT); mSerializer.startTag(null, EL_PASSWD); mSerializer.text(passwd); mSerializer.endTag(null, EL_PASSWD); mSerializer.endTag(NS_ZIMBRA_ACCT, EL_AUTH_REQ); endReqBody(); endReq(); handleResp(); } | 6965 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6965/80514d3dd1e5de7a8390999e3282f15146c16e44/AuthCmd.java/buggy/ZimbraME/src/com/zimbra/zme/client/AuthCmd.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1196,
12,
780,
20774,
461,
16,
5397,
514,
19093,
13,
5411,
1216,
1860,
16,
10402,
5714,
9629,
25746,
288,
3639,
2376,
6113,
5621,
3639,
2376,
6113,
2250,
5621,
3639,
312,
6306,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1196,
12,
780,
20774,
461,
16,
5397,
514,
19093,
13,
5411,
1216,
1860,
16,
10402,
5714,
9629,
25746,
288,
3639,
2376,
6113,
5621,
3639,
2376,
6113,
2250,
5621,
3639,
312,
6306,
... |
if(annotation == null) clss[0] = RMIClassLoader.loadClass(intfs[0]); | for (int i = 0; i < intfs.length; i++) { if (annotation == null) clss[i] = RMIClassLoader.loadClass(intfs[i]); else clss[i] = RMIClassLoader.loadClass(annotation, intfs[i]); } ClassLoader loader; if (clss.length > 0) { ArrayList loaders = new ArrayList(intfs.length); ClassLoader cx; for (int i = 0; i < clss.length; i++) { cx = clss[i].getClassLoader(); if (!loaders.contains(cx)) { loaders.add(0, cx); } } loader = new CombinedClassLoader(loaders); } | protected Class resolveProxyClass(String intfs[]) throws IOException, ClassNotFoundException{ String annotation = (String)getAnnotation(); Class clss[] = new Class[intfs.length]; if(annotation == null) clss[0] = RMIClassLoader.loadClass(intfs[0]); else clss[0] = RMIClassLoader.loadClass(annotation, intfs[0]); //assume all interfaces can be loaded by the same classloader ClassLoader loader = clss[0].getClassLoader(); for (int i = 0; i < intfs.length; i++) clss[i] = Class.forName(intfs[i], false, loader); try { return Proxy.getProxyClass(loader, clss); } catch (IllegalArgumentException e) { throw new ClassNotFoundException(null, e); } } | 50763 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50763/b9aa2b76c5fb6ec27c94f7eecf71cb3bc137fe2f/RMIObjectInputStream.java/clean/core/src/classpath/gnu/gnu/java/rmi/server/RMIObjectInputStream.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4750,
1659,
2245,
3886,
797,
12,
780,
509,
2556,
63,
5717,
3639,
1216,
1860,
16,
10403,
95,
565,
514,
3204,
273,
261,
780,
13,
588,
3257,
5621,
202,
565,
1659,
927,
1049,
8526,
273,
394,
165... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4750,
1659,
2245,
3886,
797,
12,
780,
509,
2556,
63,
5717,
3639,
1216,
1860,
16,
10403,
95,
565,
514,
3204,
273,
261,
780,
13,
588,
3257,
5621,
202,
565,
1659,
927,
1049,
8526,
273,
394,
165... |
process.setSecurityFile(policyServerFile); | process.setSecurityFile(policyServerFile); | public void activate() { if (!isActivated) { for (int i = 0; i < virtualMachines.size(); i++) { VirtualMachine vm = getVirtualMachine(); boolean vmAlreadyAssigned = !((vm.getCreatorId()).equals(this.name)); ExternalProcess process = getProcess(vm, vmAlreadyAssigned); // Test if that is this virtual Node that originates the creation of the vm // else the vm was already created by another virtualNode, in that case, nothing is // done at this point, nodes creation will occur when the runtime associated with the jvm // will register. if (!vmAlreadyAssigned) { setParameters(process, vm); process.setSecurityFile(policyServerFile); // It is this virtual Node that originates the creation of the vm try { proActiveRuntimeImpl.createVM(process); } catch (java.io.IOException e) { e.printStackTrace(); logger.error("cannot activate virtualNode " + this.name + " with the process " + process.getCommand()); } } // }else{ // // add in the hashtable the vm's creator id, and the number of nodes that should be created // awaitedVirtualNodes.put(vm.getCreatorId(),vm.getNodeNumber()); // } increaseIndex(); } isActivated = true; if (registration) { register(); } } else { logger.info("VirtualNode " + this.name + " already activated !!!"); } } | 50951 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50951/6b8f97718d45f572212cc6545d96778a1ac32913/VirtualNodeImpl.java/buggy/src/org/objectweb/proactive/core/descriptor/data/VirtualNodeImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
10235,
1435,
288,
3639,
309,
16051,
291,
28724,
13,
288,
5411,
364,
261,
474,
277,
273,
374,
31,
277,
411,
5024,
25222,
18,
1467,
5621,
277,
27245,
288,
7734,
18452,
4268,
273,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
10235,
1435,
288,
3639,
309,
16051,
291,
28724,
13,
288,
5411,
364,
261,
474,
277,
273,
374,
31,
277,
411,
5024,
25222,
18,
1467,
5621,
277,
27245,
288,
7734,
18452,
4268,
273,... |
Map<Integer, ReminderTransfer> map = remTransferCache.get(reminderID); | WeakValueMap<Integer, ReminderTransfer> map = remTransferCache.get(reminderID); | static ReminderTransfer getReminderTransferforIDs(final Integer reminderID, final Integer accountID) { Map<Integer, ReminderTransfer> map = remTransferCache.get(reminderID); if(map == null) { map = new WeakHashMap<Integer, ReminderTransfer>(); remTransferCache.put(reminderID, map); } ReminderTransfer tt = map.get(accountID); if(tt == null) { tt = new ReminderTransfer(reminderID, accountID); map.put(accountID, tt); } return tt; } | 11042 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/11042/b21e42fd18ff42c7aa5338160f703d7ea328c75d/ReminderTransfer.java/clean/trunk/JPAS/src/org/jpas/model/ReminderTransfer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
760,
2663,
14055,
5912,
336,
1933,
14055,
5912,
1884,
5103,
12,
6385,
2144,
849,
14055,
734,
16,
727,
2144,
26643,
13,
565,
288,
3639,
23632,
26795,
32,
4522,
16,
2663,
14055,
5912,
34,
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,
760,
2663,
14055,
5912,
336,
1933,
14055,
5912,
1884,
5103,
12,
6385,
2144,
849,
14055,
734,
16,
727,
2144,
26643,
13,
565,
288,
3639,
23632,
26795,
32,
4522,
16,
2663,
14055,
5912,
34,
8... |
public static NodeManager getNodeManager() { | public synchronized static NodeManager getNodeManager(ArchivalUnit au) { nodeManager = (NodeManager)auMaps.get(au); | public static NodeManager getNodeManager() { if (nodeManager==null) { nodeManager = new NodeManagerImpl(); } return nodeManager; } | 8150 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8150/b29f815557f9c3fa7484586ed261f7f89c6f9b94/NodeManagerImpl.java/buggy/src/org/lockss/state/NodeManagerImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
3852,
760,
2029,
1318,
5973,
1318,
12,
12269,
5162,
2802,
20309,
13,
288,
756,
1318,
273,
261,
907,
1318,
13,
8377,
8903,
18,
588,
12,
8377,
1769,
565,
309,
261,
2159,
1318,
631,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3852,
760,
2029,
1318,
5973,
1318,
12,
12269,
5162,
2802,
20309,
13,
288,
756,
1318,
273,
261,
907,
1318,
13,
8377,
8903,
18,
588,
12,
8377,
1769,
565,
309,
261,
2159,
1318,
631,
... |
long number = Integer.parseInt(backkupScheduleTimeText.getText()); | long number = Integer.parseInt(backupScheduleTimeText.getText()); | public void updateRefreshGroupEnablements() { if (backupAutomaticallyButton.getSelection()) { try { long number = Integer.parseInt(backkupScheduleTimeText.getText()); if (number <= 0) { this.setErrorMessage("Archive schedule time must be > 0"); this.setValid(false); } else if (backupFolderText.getText() == "") { this.setErrorMessage("Archive destination folder must be specified"); this.setValid(false); } else { this.setErrorMessage(null); this.setValid(true); } } catch (NumberFormatException e) { this.setErrorMessage("Archive schedule time must be valid integer"); this.setValid(false); } } else { this.setValid(true); this.setErrorMessage(null); } backkupScheduleTimeText.setEnabled(backupAutomaticallyButton.getSelection()); backupNow.setEnabled(backupFolderText.getText() != ""); } | 51989 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51989/89db1d12a45ab2b6e8abf850c2019acf847a3786/MylarTaskListPreferencePage.java/buggy/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/preferences/MylarTaskListPreferencePage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1089,
8323,
1114,
8317,
1346,
1435,
288,
202,
202,
430,
261,
9572,
31910,
3616,
18,
588,
6233,
10756,
288,
1082,
202,
698,
288,
9506,
202,
5748,
1300,
273,
2144,
18,
2670,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1089,
8323,
1114,
8317,
1346,
1435,
288,
202,
202,
430,
261,
9572,
31910,
3616,
18,
588,
6233,
10756,
288,
1082,
202,
698,
288,
9506,
202,
5748,
1300,
273,
2144,
18,
2670,
... |
public void setPage(URL page) throws IOException | public void setPage(String url) throws IOException | public void setPage(URL page) throws IOException { if (page == null) throw new IOException("invalid url"); try { this.page = page; getEditorKit().read(page.openStream(), getDocument(), 0); } catch (BadLocationException e) { // Ignored. '0' is always a valid offset. } } | 47947 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47947/68f678cd302ace0954186c0ecfde3afa6c8064a3/JEditorPane.java/buggy/javax/swing/JEditorPane.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
18663,
12,
780,
880,
13,
1216,
1860,
225,
288,
565,
309,
261,
2433,
422,
446,
13,
1377,
604,
394,
1860,
2932,
5387,
880,
8863,
565,
775,
1377,
288,
202,
2211,
18,
2433,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
18663,
12,
780,
880,
13,
1216,
1860,
225,
288,
565,
309,
261,
2433,
422,
446,
13,
1377,
604,
394,
1860,
2932,
5387,
880,
8863,
565,
775,
1377,
288,
202,
2211,
18,
2433,
273,
... |
topLabel.setText(PreferencesMessages.getString("PathEntryVariablePreference.explanation")); | topLabel.setText(PreferencesMessages.PathEntryVariablePreference_explanation); | protected Control createContents(Composite parent) { Font font = parent.getFont(); PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, ICHelpContextIds.PATHENTRY_VARIABLES_PREFERENCE_PAGE); // define container & its gridding Composite pageComponent = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); layout.marginWidth = 0; layout.marginHeight = 0; pageComponent.setLayout(layout); GridData data = new GridData(); data.verticalAlignment = GridData.FILL; data.horizontalAlignment = GridData.FILL; pageComponent.setLayoutData(data); pageComponent.setFont(font); topLabel = new Label(pageComponent, SWT.NONE); topLabel.setText(PreferencesMessages.getString("PathEntryVariablePreference.explanation")); //$NON-NLS-1$ data = new GridData(); data.verticalAlignment = GridData.FILL; data.horizontalAlignment = GridData.FILL; topLabel.setLayoutData(data); topLabel.setFont(font); pathEntryVariablesGroup.createContents(pageComponent); return pageComponent; } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/f234a522db00e1071063f0885f1670c3e1eb4c39/PathEntryVariablePreferencePage.java/buggy/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PathEntryVariablePreferencePage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
8888,
752,
6323,
12,
9400,
982,
13,
288,
202,
202,
5711,
3512,
273,
982,
18,
588,
5711,
5621,
9506,
202,
8201,
5370,
18,
588,
2421,
22144,
7675,
588,
6696,
3163,
7675,
542,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
8888,
752,
6323,
12,
9400,
982,
13,
288,
202,
202,
5711,
3512,
273,
982,
18,
588,
5711,
5621,
9506,
202,
8201,
5370,
18,
588,
2421,
22144,
7675,
588,
6696,
3163,
7675,
542,
6... |
if(state != null) { | if (state != null) { | void interrupted(Context cx) { synchronized(swingMonitor) { if(java.awt.EventQueue.isDispatchThread()) { dispatcherIsWaiting++; if(nonDispatcherWaiting) { // Another thread is stopped in the debugger // process events until it resumes and we // can enter java.awt.EventQueue eventQ = java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue(); while(nonDispatcherWaiting) { try { AWTEvent event = eventQ.getNextEvent(); if(event instanceof ActiveEvent) { ((ActiveEvent)event).dispatch(); } else { Object source = event.getSource(); if(source instanceof Component) { Component comp = (Component)source; // Suppress Window/InputEvent's that aren't // directed to the Debugger // if(!(event instanceof InputEvent || //event instanceof WindowEvent)|| //shouldDispatchTo(comp)) { comp.dispatchEvent(event); //} } else if(source instanceof MenuComponent) { ((MenuComponent)source).dispatchEvent(event); } } if(this.returnValue == EXIT) { return; } swingMonitor.wait(1); } catch(InterruptedException exc) { return; } } } } else { while(isInterrupted || dispatcherIsWaiting > 0) { try { swingMonitor.wait(); } catch(InterruptedException exc) { return; } } nonDispatcherWaiting = true; } isInterrupted = true; } do { currentContext = cx; DebuggableEngine engine = cx.getDebuggableEngine(); Thread thread = Thread.currentThread(); statusBar.setText("Thread: " + thread.toString()); ThreadState state = (ThreadState)threadState.get(thread); int stopAtFrameDepth = -1; if(state != null) { stopAtFrameDepth = state.stopAtFrameDepth; } if(runToCursorFile != null && thread == runToCursorThread) { int frameCount = engine.getFrameCount(); if(frameCount > 0) { DebugFrame frame = engine.getFrame(0); String sourceName = frame.getSourceName(); if(sourceName != null) { if(sourceName.equals(runToCursorFile)) { int lineNumber = frame.getLineNumber(); if(lineNumber == runToCursorLine) { stopAtFrameDepth = -1; runToCursorFile = null; } else { FileWindow w = getFileWindow(sourceName); if(w == null || !w.isBreakPoint(lineNumber)) { return; } else { runToCursorFile = null; } } } } } else { } } if(stopAtFrameDepth > 0) { if (engine.getFrameCount() > stopAtFrameDepth) { break; } } if(state != null) { state.stopAtFrameDepth = -1; } threadState.remove(thread); int frameCount = engine.getFrameCount(); this.frameIndex = frameCount -1; int line = 0; if(frameCount == 0) { break; } DebugFrame frame = engine.getFrame(0); String fileName = frame.getSourceName(); engine.setBreakNextLine(false); line = frame.getLineNumber(); int enterCount = 0; boolean isDispatchThread = java.awt.EventQueue.isDispatchThread(); if(!isDispatchThread) { // detach cx from its thread so the debugger (in the awt // dispatcher thread) can enter it if necessary cx.exit(); while(Context.getCurrentContext() != null) { Context.exit(); enterCount++; } } if(fileName != null && !fileName.equals("<stdin>")) { FileWindow w = (FileWindow)getFileWindow(fileName); if(w != null) { SetFilePosition action = new SetFilePosition(this, w, line); swingInvoke(action); } else { Vector v = (Vector)sourceNames.get(fileName); String source = ((SourceEntry)v.elementAt(0)).source.toString(); CreateFileWindow action = new CreateFileWindow(this, fileName, source, line); swingInvoke(action); } } else { if(console.isVisible()) { final JSInternalConsole finalConsole = console; swingInvoke(new Runnable() { public void run() { finalConsole.show(); } }); } } swingInvoke(new EnterInterrupt(this, cx)); swingInvoke(new UpdateContext(this, cx)); int returnValue; if(!isDispatchThread) { synchronized(monitor) { this.returnValue = -1; try { while(this.returnValue == -1) { monitor.wait(); } returnValue = this.returnValue; } catch(InterruptedException exc) { break; } } } else { java.awt.EventQueue eventQ = java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue(); this.returnValue = -1; while(this.returnValue == -1) { try { AWTEvent event = eventQ.getNextEvent(); if(event instanceof ActiveEvent) { ((ActiveEvent)event).dispatch(); } else { Object source = event.getSource(); if(source instanceof Component) { Component comp = (Component)source; // Suppress Window/InputEvent's that aren't // directed to the Debugger // if(!(event instanceof InputEvent || //event instanceof WindowEvent)|| // shouldDispatchTo(comp)) { //comp.dispatchEvent(event); //} comp.dispatchEvent(event); } else if(source instanceof MenuComponent) { ((MenuComponent)source).dispatchEvent(event); } } } catch(InterruptedException exc) { } } returnValue = this.returnValue; } swingInvoke(new ExitInterrupt(this)); if(!isDispatchThread) { // reattach cx to its thread Context current; if((current = Context.enter(cx)) != cx) { System.out.println("debugger error: cx = " + cx + " current = " + current); } while(enterCount > 0) { Context.enter(); enterCount--; } } switch(returnValue) { case STEP_OVER: engine.setBreakNextLine(true); stopAtFrameDepth = engine.getFrameCount(); if(state == null) { state = new ThreadState(); } state.stopAtFrameDepth = stopAtFrameDepth; threadState.put(thread, state); break; case STEP_INTO: engine.setBreakNextLine(true); if(state != null) { state.stopAtFrameDepth = -1; } break; case STEP_OUT: stopAtFrameDepth = engine.getFrameCount() -1; if(stopAtFrameDepth > 0) { engine.setBreakNextLine(true); if(state == null) { state = new ThreadState(); } state.stopAtFrameDepth = stopAtFrameDepth; threadState.put(thread, state); } break; case RUN_TO_CURSOR: engine.setBreakNextLine(true); if(state != null) { state.stopAtFrameDepth = -1; } break; } } while(false); synchronized(swingMonitor) { isInterrupted = false; if(java.awt.EventQueue.isDispatchThread()) { dispatcherIsWaiting--; } else { nonDispatcherWaiting = false; } swingMonitor.notifyAll(); } } | 19000 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/19000/bebd557da53b74c60ab8525aa96904d4cee6224c/Main.java/buggy/toolsrc/org/mozilla/javascript/tools/debugger/Main.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
918,
15711,
12,
1042,
9494,
13,
288,
3639,
3852,
12,
5328,
310,
7187,
13,
288,
5411,
309,
12,
6290,
18,
2219,
88,
18,
1133,
3183,
18,
291,
5325,
3830,
10756,
288,
7734,
7393,
2520,
1594... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
15711,
12,
1042,
9494,
13,
288,
3639,
3852,
12,
5328,
310,
7187,
13,
288,
5411,
309,
12,
6290,
18,
2219,
88,
18,
1133,
3183,
18,
291,
5325,
3830,
10756,
288,
7734,
7393,
2520,
1594... |
+ dItemHeight + insCA.getRight( ) + maxValueHeight; | + insCA.getBottom( ) + dMaxH + dVerticalSpacing; dX = bo.getLeft( ) + insCA.getLeft( ); | public void renderLegend( IPrimitiveRenderer ipr, Legend lg, Map htRenderers ) throws ChartException { if ( !lg.isVisible( ) ) // CHECK VISIBILITY { return; } renderBlock( ipr, lg, StructureSource.createLegend( lg ) ); final IDisplayServer xs = getDevice( ).getDisplayServer( ); final double dScale = xs.getDpiResolution( ) / 72d; Bounds bo = lg.getBounds( ).scaledInstance( dScale ); Size sz = null; double dX, dY; if ( lg.getPosition( ) != Position.INSIDE_LITERAL ) { try { sz = lg.getPreferredSize( xs, cm, rtc ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, ex ); } sz.scale( dScale ); // USE ANCHOR IN POSITIONING THE LEGEND CLIENT AREA WITHIN THE BLOCK // SLACK SPACE dX = bo.getLeft( ) + ( bo.getWidth( ) - sz.getWidth( ) ) / 2; dY = 0; if ( lg.isSetAnchor( ) ) { final int iAnchor = lg.getAnchor( ).getValue( ); switch ( iAnchor ) { case Anchor.NORTH : case Anchor.NORTH_EAST : case Anchor.NORTH_WEST : dY = bo.getTop( ); break; case Anchor.SOUTH : case Anchor.SOUTH_EAST : case Anchor.SOUTH_WEST : dY = bo.getTop( ) + bo.getHeight( ) - sz.getHeight( ); break; default : // CENTERED dY = bo.getTop( ) + ( bo.getHeight( ) - sz.getHeight( ) ) / 2; break; } switch ( iAnchor ) { case Anchor.WEST : case Anchor.NORTH_WEST : dX = bo.getLeft( ); break; case Anchor.EAST : case Anchor.SOUTH_EAST : dX = bo.getLeft( ) + bo.getWidth( ) - sz.getWidth( ); break; default : // CENTERED dX = bo.getLeft( ) + ( bo.getWidth( ) - sz.getWidth( ) ) / 2; break; } } else { dX = bo.getLeft( ) + ( bo.getWidth( ) - sz.getWidth( ) ) / 2; dY = bo.getTop( ) + ( bo.getHeight( ) - sz.getHeight( ) ) / 2; } } else // USE PREVIOUSLY COMPUTED POSITION IN THE GENERATOR FOR LEGEND 'INSIDE' // PLOT { dX = bo.getLeft( ); dY = bo.getTop( ); sz = SizeImpl.create( bo.getWidth( ), bo.getHeight( ) ); // 'bo' // ALREADY // SCALED } // consider legend title size. Label lgTitle = lg.getTitle( ); double lgTitleWidth = 0, lgTitleHeight = 0; double yOffset = 0, xOffset = 0, wOffset = 0, hOffset = 0; if ( lgTitle != null && lgTitle.isSetVisible( ) && lgTitle.isVisible( ) ) { lgTitle = (Label) EcoreUtil.copy( lgTitle ); // handle external resource string final String sPreviousValue = lgTitle.getCaption( ).getValue( ); lgTitle.getCaption( ) .setValue( rtc.externalizedMessage( sPreviousValue ) ); BoundingBox bb = null; try { bb = Methods.computeBox( xs, IConstants.ABOVE, lgTitle, 0, 0 ); } catch ( IllegalArgumentException uiex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, uiex ); } lgTitleWidth = bb.getWidth( ); lgTitleHeight = bb.getHeight( ); switch ( lg.getTitlePosition( ).getValue( ) ) { case Position.ABOVE : yOffset = lgTitleHeight; hOffset = -yOffset; break; case Position.BELOW : hOffset = -lgTitleHeight; break; case Position.LEFT : xOffset = lgTitleWidth; wOffset = -xOffset; break; case Position.RIGHT : wOffset = -lgTitleWidth; break; } } // RENDER THE LEGEND CLIENT AREA final ClientArea ca = lg.getClientArea( ); LineAttributes lia = ca.getOutline( ); bo = BoundsImpl.create( dX, dY, sz.getWidth( ), sz.getHeight( ) ); bo = bo.adjustedInstance( lg.getInsets( ).scaledInstance( dScale ) ); // SHRINK // BY // INSETS dX = bo.getLeft( ); dY = bo.getTop( ); // Adjust bounds. bo.delta( xOffset, yOffset, wOffset, hOffset ); dX = bo.getLeft( ); dY = bo.getTop( ); final RectangleRenderEvent rre = (RectangleRenderEvent) ( (EventObjectCache) ir ).getEventObject( StructureSource.createLegend( lg ), RectangleRenderEvent.class ); // render client area shadow. if ( ca.getShadowColor( ) != null ) { rre.setBounds( bo.translateInstance( 3, 3 ) ); rre.setBackground( ca.getShadowColor( ) ); ipr.fillRectangle( rre ); } // render client area rre.setBounds( bo ); rre.setOutline( lia ); rre.setBackground( ca.getBackground( ) ); ipr.fillRectangle( rre ); ipr.drawRectangle( rre ); lia = (LineAttributes) EcoreUtil.copy( lia ); lia.setVisible( true ); // SEPARATOR LINES MUST BE VISIBLE final SeriesDefinition[] seda = cm.getSeriesForLegend( ); // INITIALIZATION OF VARS USED IN FOLLOWING LOOPS final Orientation o = lg.getOrientation( ); final Direction d = lg.getDirection( ); final Label la = LabelImpl.create( ); la.setCaption( (Text) EcoreUtil.copy( lg.getText( ) ) ); la.getCaption( ).setValue( "X" ); //$NON-NLS-1$ final ITextMetrics itm = xs.getTextMetrics( la ); double dItemHeight = itm.getFullHeight( ); final double dHorizontalSpacing = 4; final double dVerticalSpacing = 4; double dSeparatorThickness = lia.getThickness( ); Insets insCA = ca.getInsets( ) .scaledInstance( xs.getDpiResolution( ) / 72d ); Series seBase; ArrayList al; LegendItemRenderingHints lirh; Palette pa; int iPaletteCount; EList elPaletteEntries; Fill fPaletteEntry; final boolean bPaletteByCategory = ( cm.getLegend( ) .getItemType( ) .getValue( ) == LegendItemType.CATEGORIES ); // Calculate if minSlice applicable. boolean bMinSliceDefined = false; double dMinSlice = 0; boolean bPercentageMinSlice = false; String sMinSliceLabel = null; boolean bMinSliceApplied = false; if ( cm instanceof ChartWithoutAxes ) { bMinSliceDefined = ( (ChartWithoutAxes) cm ).isSetMinSlice( ); dMinSlice = ( (ChartWithoutAxes) cm ).getMinSlice( ); bPercentageMinSlice = ( (ChartWithoutAxes) cm ).isMinSlicePercent( ); sMinSliceLabel = ( (ChartWithoutAxes) cm ).getMinSliceLabel( ); if ( sMinSliceLabel == null || sMinSliceLabel.length( ) == 0 ) { sMinSliceLabel = IConstants.UNDEFINED_STRING; } else { sMinSliceLabel = rtc.externalizedMessage( sMinSliceLabel ); } } // calculate if need an extra legend item when minSlice defined. if ( bMinSliceDefined && bPaletteByCategory && cm instanceof ChartWithoutAxes ) { if ( !( (ChartWithoutAxes) cm ).getSeriesDefinitions( ).isEmpty( ) ) { // OK TO ASSUME THAT 1 BASE SERIES DEFINITION EXISTS SeriesDefinition sdBase = (SeriesDefinition) ( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .get( 0 ); SeriesDefinition[] sdOrtho = (SeriesDefinition[]) sdBase.getSeriesDefinitions( ) .toArray( ); DataSetIterator dsiOrtho = null; double dCurrentMinSlice = 0; for ( int i = 0; i < sdOrtho.length && !bMinSliceApplied; i++ ) { try { dsiOrtho = new DataSetIterator( ( (Series) sdOrtho[i].getRunTimeSeries( ) .get( 0 ) ).getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, ex ); } // TODO Check dataset type, throw exception or ignore?. if ( bPercentageMinSlice ) { double total = 0; while ( dsiOrtho.hasNext( ) ) { Object obj = dsiOrtho.next( ); if ( obj instanceof Number ) { total += ( (Number) obj ).doubleValue( ); } } dsiOrtho.reset( ); dCurrentMinSlice = total * dMinSlice / 100d; } else { dCurrentMinSlice = dMinSlice; } while ( dsiOrtho.hasNext( ) ) { Object obj = dsiOrtho.next( ); if ( obj instanceof Number ) { double val = ( (Number) obj ).doubleValue( ); if ( val < dCurrentMinSlice ) { bMinSliceApplied = true; break; } } } } } } // COMPUTATIONS HERE MUST BE IN SYNC WITH THE ACTUAL RENDERER if ( o.getValue( ) == Orientation.VERTICAL ) { if ( bPaletteByCategory ) { SeriesDefinition sdBase = null; FormatSpecifier fs = null; if ( cm instanceof ChartWithAxes ) { // ONLY SUPPORT 1 BASE AXIS FOR NOW final Axis axPrimaryBase = ( (ChartWithAxes) cm ).getBaseAxes( )[0]; if ( axPrimaryBase.getSeriesDefinitions( ).isEmpty( ) ) { return; // NOTHING TO RENDER (BASE AXIS HAS NO SERIES // DEFINITIONS) } // OK TO ASSUME THAT 1 BASE SERIES DEFINITION EXISTS sdBase = (SeriesDefinition) axPrimaryBase.getSeriesDefinitions( ) .get( 0 ); } else if ( cm instanceof ChartWithoutAxes ) { if ( ( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .isEmpty( ) ) { return; // NOTHING TO RENDER (BASE AXIS HAS NO SERIES // DEFINITIONS) } // OK TO ASSUME THAT 1 BASE SERIES DEFINITION EXISTS sdBase = (SeriesDefinition) ( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .get( 0 ); } // OK TO ASSUME THAT 1 BASE RUNTIME SERIES EXISTS seBase = (Series) sdBase.getRunTimeSeries( ).get( 0 ); pa = sdBase.getSeriesPalette( ); elPaletteEntries = pa.getEntries( ); iPaletteCount = elPaletteEntries.size( ); DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( seBase.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, ex ); } if ( sdBase != null ) { fs = sdBase.getFormatSpecifier( ); } int i = 0; while ( dsiBase.hasNext( ) ) { Object obj = dsiBase.next( ); // TODO filter the not-used legend. // render legend item. dY += insCA.getTop( ); String lgtext = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, getRunTimeContext( ).getLocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la ); // RECYCLED fPaletteEntry = (Fill) elPaletteEntries.get( i++ % iPaletteCount ); // CYCLE THROUGH THE PALETTE lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); renderLegendItem( ipr, lg, la, null, dX, dY, itm.getFullWidth( ), dItemHeight, itm.getFullHeight( ), 0, 0, insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); dY += itm.getFullHeight( ) + insCA.getBottom( ); } // render the extra MinSlice legend item if applicable. if ( bMinSliceDefined && bMinSliceApplied ) { dY += insCA.getTop( ); la.getCaption( ).setValue( sMinSliceLabel ); itm.reuse( la ); // RECYCLED fPaletteEntry = (Fill) elPaletteEntries.get( dsiBase.size( ) % iPaletteCount ); // CYCLE THROUGH THE PALETTE lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); renderLegendItem( ipr, lg, la, null, dX, dY, itm.getFullWidth( ), dItemHeight, itm.getFullHeight( ), 0, 0, insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); dY += itm.getFullHeight( ) + insCA.getBottom( ); } } else if ( d.getValue( ) == Direction.TOP_BOTTOM ) { dSeparatorThickness += dVerticalSpacing; for ( int j = 0; j < seda.length; j++ ) { al = seda[j].getRunTimeSeries( ); pa = seda[j].getSeriesPalette( ); elPaletteEntries = pa.getEntries( ); iPaletteCount = elPaletteEntries.size( ); FormatSpecifier fs = seda[j].getFormatSpecifier( ); for ( int i = 0; i < al.size( ); i++ ) { dY += insCA.getTop( ); seBase = (Series) al.get( i ); lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); Object obj = seBase.getSeriesIdentifier( ); String lgtext = rtc.externalizedMessage( String.valueOf( obj ) ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, getRunTimeContext( ).getLocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la ); // RECYCLED double dFWidth = itm.getFullWidth( ); double dFHeight = itm.getFullHeight( ); Label valueLa = null; double valueHeight = 0; if ( lg.isShowValue( ) ) { DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( seBase.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, ex ); } // Use first value for each series. if ( dsiBase.hasNext( ) ) { obj = dsiBase.next( ); String valueText = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, Locale.getDefault( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } valueLa = (Label) EcoreUtil.copy( seBase.getLabel( ) ); valueLa.getCaption( ).setValue( valueText ); itm.reuse( valueLa ); dFWidth = Math.max( dFWidth, itm.getFullWidth( ) ); valueHeight = itm.getFullHeight( ); } } fPaletteEntry = (Fill) elPaletteEntries.get( i % iPaletteCount ); // CYCLE THROUGH THE PALETTE renderLegendItem( ipr, lg, la, valueLa, dX, dY, dFWidth, dItemHeight, dFHeight, valueHeight, bo.getWidth( ) - 2 * insCA.getLeft( ), insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); dY += dItemHeight + insCA.getBottom( ) + valueHeight; } if ( j < seda.length - 1 ) { renderSeparator( ipr, lg, lia, dX, dY + dSeparatorThickness / 2, bo.getWidth( ), Orientation.HORIZONTAL_LITERAL ); dY += dSeparatorThickness; } } } else if ( d.getValue( ) == Direction.LEFT_RIGHT ) { double dMaxW; dSeparatorThickness += dHorizontalSpacing; for ( int j = 0; j < seda.length; j++ ) { dMaxW = 0; al = seda[j].getRunTimeSeries( ); pa = seda[j].getSeriesPalette( ); elPaletteEntries = pa.getEntries( ); iPaletteCount = elPaletteEntries.size( ); FormatSpecifier fs = seda[j].getFormatSpecifier( ); for ( int i = 0; i < al.size( ); i++ ) { dY += insCA.getTop( ); seBase = (Series) al.get( i ); lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); Object obj = seBase.getSeriesIdentifier( ); String lgtext = rtc.externalizedMessage( String.valueOf( obj ) ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, getRunTimeContext( ).getLocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la ); // RECYCLED dMaxW = Math.max( dMaxW, itm.getFullWidth( ) ); double dFWidth = itm.getFullWidth( ); double dFHeight = itm.getFullHeight( ); Label valueLa = null; double valueHeight = 0; if ( lg.isShowValue( ) ) { DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( seBase.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, ex ); } // Use first value for each series. if ( dsiBase.hasNext( ) ) { obj = dsiBase.next( ); String valueText = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, Locale.getDefault( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } valueLa = (Label) EcoreUtil.copy( seBase.getLabel( ) ); valueLa.getCaption( ).setValue( valueText ); itm.reuse( valueLa ); dFWidth = Math.max( dFWidth, itm.getFullWidth( ) ); dMaxW = Math.max( dMaxW, dFWidth ); valueHeight = itm.getFullHeight( ); } } fPaletteEntry = (Fill) elPaletteEntries.get( i % iPaletteCount ); // CYCLE THROUGH THE PALETTE renderLegendItem( ipr, lg, la, valueLa, dX, dY, dFWidth, dItemHeight, dFHeight, valueHeight, bo.getWidth( ) - 2 * insCA.getLeft( ), insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); dY += dItemHeight + insCA.getBottom( ) + valueHeight; } // LEFT INSETS + LEGEND ITEM WIDTH + HORIZONTAL SPACING + // MAX ITEM WIDTH + RIGHT INSETS dX += insCA.getLeft( ) + ( 3 * dItemHeight / 2 ) + dHorizontalSpacing + dMaxW + insCA.getRight( ); dY = bo.getTop( ); // SETUP VERTICAL SEPARATOR SPACING if ( j < seda.length - 1 ) { renderSeparator( ipr, lg, lia, dX + dSeparatorThickness / 2, dY, bo.getHeight( ), Orientation.VERTICAL_LITERAL ); dX += dSeparatorThickness; } } } else { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, "exception.illegal.legend.direction", //$NON-NLS-1$ new Object[]{ d.getName( ) }, ResourceBundle.getBundle( Messages.ENGINE, rtc.getLocale( ) ) ); } } else if ( o.getValue( ) == Orientation.HORIZONTAL ) { if ( bPaletteByCategory ) { SeriesDefinition sdBase = null; FormatSpecifier fs = null; if ( cm instanceof ChartWithAxes ) { final Axis axPrimaryBase = ( (ChartWithAxes) cm ).getBaseAxes( )[0]; // ONLY // SUPPORT // 1 // BASE // AXIS // FOR // NOW if ( axPrimaryBase.getSeriesDefinitions( ).isEmpty( ) ) { return; // NOTHING TO RENDER (BASE AXIS HAS NO SERIES // DEFINITIONS) } // OK TO ASSUME THAT 1 BASE SERIES DEFINITION EXISTS sdBase = (SeriesDefinition) axPrimaryBase.getSeriesDefinitions( ) .get( 0 ); } else if ( cm instanceof ChartWithoutAxes ) { if ( ( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .isEmpty( ) ) { return; // NOTHING TO RENDER (BASE AXIS HAS NO SERIES // DEFINITIONS) } // OK TO ASSUME THAT 1 BASE SERIES DEFINITION EXISTS sdBase = (SeriesDefinition) ( (ChartWithoutAxes) cm ).getSeriesDefinitions( ) .get( 0 ); } // OK TO ASSUME THAT 1 BASE RUNTIME SERIES EXISTS seBase = (Series) sdBase.getRunTimeSeries( ).get( 0 ); pa = sdBase.getSeriesPalette( ); elPaletteEntries = pa.getEntries( ); iPaletteCount = elPaletteEntries.size( ); DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( seBase.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, ex ); } if ( sdBase != null ) { fs = sdBase.getFormatSpecifier( ); } int i = 0; dY += insCA.getTop( ); while ( dsiBase.hasNext( ) ) { Object obj = dsiBase.next( ); // TODO filter the not-used legend. dX += insCA.getLeft( ); String lgtext = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, getRunTimeContext( ).getLocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la ); // RECYCLED fPaletteEntry = (Fill) elPaletteEntries.get( i++ % iPaletteCount ); // CYCLE THROUGH THE PALETTE lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); renderLegendItem( ipr, lg, la, null, dX, dY, itm.getFullWidth( ), dItemHeight, itm.getFullHeight( ), 0, 0, insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); dX += itm.getFullWidth( ) + ( 3 * dItemHeight ) / 2 + dHorizontalSpacing + insCA.getRight( ); } // render the extra MinSlice legend item if applicable. if ( bMinSliceDefined && bMinSliceApplied ) { dX += insCA.getLeft( ); la.getCaption( ).setValue( sMinSliceLabel ); itm.reuse( la ); // RECYCLED fPaletteEntry = (Fill) elPaletteEntries.get( dsiBase.size( ) % iPaletteCount ); // CYCLE THROUGH THE PALETTE lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); renderLegendItem( ipr, lg, la, null, dX, dY, itm.getFullWidth( ), dItemHeight, itm.getFullHeight( ), 0, 0, insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); dX += itm.getFullWidth( ) + ( 3 * dItemHeight ) / 2 + dHorizontalSpacing + insCA.getRight( ); } } else if ( d.getValue( ) == Direction.TOP_BOTTOM ) { double maxValueHeight = 0; dSeparatorThickness += dVerticalSpacing; for ( int j = 0; j < seda.length; j++ ) { dY += insCA.getTop( ); al = seda[j].getRunTimeSeries( ); pa = seda[j].getSeriesPalette( ); elPaletteEntries = pa.getEntries( ); iPaletteCount = elPaletteEntries.size( ); FormatSpecifier fs = seda[j].getFormatSpecifier( ); for ( int i = 0; i < al.size( ); i++ ) { seBase = (Series) al.get( i ); lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); Object obj = seBase.getSeriesIdentifier( ); String lgtext = rtc.externalizedMessage( String.valueOf( obj ) ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, getRunTimeContext( ).getLocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la ); // RECYCLED double dFWidth = itm.getFullWidth( ); double dFHeight = itm.getFullHeight( ); Label valueLa = null; double valueHeight = 0; if ( lg.isShowValue( ) ) { DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( seBase.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, ex ); } // Use first value for each series. if ( dsiBase.hasNext( ) ) { obj = dsiBase.next( ); String valueText = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, Locale.getDefault( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } valueLa = (Label) EcoreUtil.copy( seBase.getLabel( ) ); valueLa.getCaption( ).setValue( valueText ); itm.reuse( valueLa ); dFWidth = Math.max( dFWidth, itm.getFullWidth( ) ); valueHeight = itm.getFullHeight( ); maxValueHeight = Math.max( maxValueHeight, valueHeight ); } } fPaletteEntry = (Fill) elPaletteEntries.get( i % iPaletteCount ); // CYCLE THROUGH THE PALETTE renderLegendItem( ipr, lg, la, valueLa, dX, dY, dFWidth, dItemHeight, dFHeight, valueHeight, dFWidth + 3 * dItemHeight / 2, insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); // LEFT INSETS + LEGEND ITEM WIDTH + HORIZONTAL SPACING // + MAX ITEM WIDTH + RIGHT INSETS dX += insCA.getLeft( ) + ( 3 * dItemHeight ) / 2 + dHorizontalSpacing + dFWidth + insCA.getRight( ); } dY += insCA.getTop( ) + dItemHeight + insCA.getRight( ) + maxValueHeight; // LINE // FEED // SETUP HORIZONTAL SEPARATOR SPACING if ( j < seda.length - 1 ) { dX = bo.getLeft( ); // CARRIAGE RETURN renderSeparator( ipr, lg, lia, dX, dY + dSeparatorThickness / 2, bo.getWidth( ), Orientation.HORIZONTAL_LITERAL ); dY += dSeparatorThickness; } } } else if ( d.getValue( ) == Direction.LEFT_RIGHT ) { dSeparatorThickness += dHorizontalSpacing; dY += insCA.getTop( ); for ( int j = 0; j < seda.length; j++ ) { al = seda[j].getRunTimeSeries( ); pa = seda[j].getSeriesPalette( ); elPaletteEntries = pa.getEntries( ); iPaletteCount = elPaletteEntries.size( ); FormatSpecifier fs = seda[j].getFormatSpecifier( ); for ( int i = 0; i < al.size( ); i++ ) { seBase = (Series) al.get( i ); lirh = (LegendItemRenderingHints) htRenderers.get( seBase ); Object obj = seBase.getSeriesIdentifier( ); String lgtext = rtc.externalizedMessage( String.valueOf( obj ) ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, getRunTimeContext( ).getLocale( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } la.getCaption( ).setValue( lgtext ); itm.reuse( la ); // RECYCLED double dFWidth = itm.getFullWidth( ); double dFHeight = itm.getFullHeight( ); Label valueLa = null; double valueHeight = 0; if ( lg.isShowValue( ) ) { DataSetIterator dsiBase = null; try { dsiBase = new DataSetIterator( seBase.getDataSet( ) ); } catch ( Exception ex ) { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, ex ); } // Use first value for each series. if ( dsiBase.hasNext( ) ) { obj = dsiBase.next( ); String valueText = String.valueOf( obj ); if ( fs != null ) { try { lgtext = ValueFormatter.format( obj, fs, Locale.getDefault( ), null ); } catch ( ChartException e ) { // ignore, use original text. } } valueLa = (Label) EcoreUtil.copy( seBase.getLabel( ) ); valueLa.getCaption( ).setValue( valueText ); itm.reuse( valueLa ); dFWidth = Math.max( dFWidth, itm.getFullWidth( ) ); valueHeight = itm.getFullHeight( ); } } fPaletteEntry = (Fill) elPaletteEntries.get( i % iPaletteCount ); // CYCLE THROUGH THE PALETTE renderLegendItem( ipr, lg, la, valueLa, dX, dY, dFWidth, dItemHeight, dFHeight, valueHeight, dFWidth + 3 * dItemHeight / 2, insCA.getLeft( ), dHorizontalSpacing, seBase, fPaletteEntry, lirh ); // LEFT INSETS + LEGEND ITEM WIDTH + HORIZONTAL SPACING // + MAX ITEM WIDTH + RIGHT INSETS dX += insCA.getLeft( ) + ( 3 * dItemHeight ) / 2 + dHorizontalSpacing + dFWidth + insCA.getRight( ); } // SETUP VERTICAL SEPARATOR SPACING if ( j < seda.length - 1 ) { renderSeparator( ipr, lg, lia, dX + dSeparatorThickness / 2, dY, bo.getHeight( ), Orientation.VERTICAL_LITERAL ); dX += dSeparatorThickness; } } } else { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, "exception.illegal.legend.direction", //$NON-NLS-1$ new Object[]{ d.getName( ) }, ResourceBundle.getBundle( Messages.ENGINE, rtc.getLocale( ) ) ); // i18n_CONCATENATIONS_REMOVED } } else { throw new ChartException( ChartEnginePlugin.ID, ChartException.RENDERING, "exception.illegal.legend.orientation", //$NON-NLS-1$ new Object[]{ o.getName( ) }, ResourceBundle.getBundle( Messages.ENGINE, rtc.getLocale( ) ) ); // i18n_CONCATENATIONS_REMOVED } // Render legend title if defined. if ( lgTitle != null && lgTitle.isSetVisible( ) && lgTitle.isVisible( ) ) { double lX = bo.getLeft( ); double lY = bo.getTop( ); switch ( lg.getTitlePosition( ).getValue( ) ) { case Position.ABOVE : lX = bo.getLeft( ) + ( bo.getWidth( ) - lgTitleWidth ) / 2d; lY = bo.getTop( ) - lgTitleHeight; break; case Position.BELOW : lX = bo.getLeft( ) + ( bo.getWidth( ) - lgTitleWidth ) / 2d; lY = bo.getTop( ) + bo.getHeight( ); break; case Position.LEFT : lX = bo.getLeft( ) - lgTitleWidth; lY = bo.getTop( ) + ( bo.getHeight( ) - lgTitleHeight ) / 2d; break; case Position.RIGHT : lX = bo.getLeft( ) + bo.getWidth( ); lY = bo.getTop( ) + ( bo.getHeight( ) - lgTitleHeight ) / 2d; break; } final TextRenderEvent tre = (TextRenderEvent) ( (EventObjectCache) ir ).getEventObject( WrappedStructureSource.createLegendTitle( lg, lgTitle ), TextRenderEvent.class ); tre.setBlockBounds( BoundsImpl.create( lX, lY, lgTitleWidth, lgTitleHeight ) ); TextAlignment ta = TextAlignmentImpl.create( ); ta.setHorizontalAlignment( HorizontalAlignment.CENTER_LITERAL ); ta.setVerticalAlignment( VerticalAlignment.CENTER_LITERAL ); tre.setBlockAlignment( ta ); tre.setLabel( lgTitle ); tre.setAction( TextRenderEvent.RENDER_TEXT_IN_BLOCK ); ipr.drawText( tre ); } itm.dispose( ); // DISPOSE RESOURCES AFTER USE } | 12803 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12803/2d2a611b1bd993e5b8997aa31f661b8486b93a43/BaseRenderer.java/buggy/chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/render/BaseRenderer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1743,
16812,
12,
467,
9840,
6747,
277,
683,
16,
17167,
409,
15266,
16,
1635,
14049,
3420,
414,
262,
1082,
202,
15069,
14804,
503,
202,
95,
202,
202,
430,
261,
401,
23623,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1743,
16812,
12,
467,
9840,
6747,
277,
683,
16,
17167,
409,
15266,
16,
1635,
14049,
3420,
414,
262,
1082,
202,
15069,
14804,
503,
202,
95,
202,
202,
430,
261,
401,
23623,
... |
Name = RandomHelper.getRandom(Name, String.class); | if (_depth < MAX_DEPTH && RandomHelper.flip(0.6)) { rootData = new Root(_depth); ((CastorTestable)rootData).randomizeFields(); } else { rootData = null; } | public void randomizeFields() throws InstantiationException, IllegalAccessException { Name = RandomHelper.getRandom(Name, String.class); if (RandomHelper.flip(0.6)) { RootData = new Root(); ((CastorTestable)RootData).randomizeFields(); } else RootData = null; if (RandomHelper.flip(0.7)) { Data = new Data(); ((CastorTestable)Data).randomizeFields(); } else Data = null; } | 3614 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/3614/ffef88113cc57805ff3b42afb68e4dc94bf0eac1/Root.java/clean/castor/trunk/src/tests/xml/MasterTestSuite/introspection/ComplexType-DirectAccess/Root.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
2744,
554,
2314,
1435,
540,
1216,
19248,
16,
11900,
288,
3639,
309,
261,
67,
5979,
411,
4552,
67,
27479,
597,
8072,
2276,
18,
12357,
12,
20,
18,
26,
3719,
288,
1365,
751,
273... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
2744,
554,
2314,
1435,
540,
1216,
19248,
16,
11900,
288,
3639,
309,
261,
67,
5979,
411,
4552,
67,
27479,
597,
8072,
2276,
18,
12357,
12,
20,
18,
26,
3719,
288,
1365,
751,
273... |
if (task.isActive() || task.isOverdue()) { | if (contentTaskFilter.shouldAlwaysShow(task)) { | private List<Object> getFilteredChildrenFor(Object parent) { if (containsNoFilterText(((Text) this.view.tree.getFilterControl()).getText()) || ((Text) this.view.tree.getFilterControl()).getText().startsWith(TaskListView.FILTER_LABEL)) { List<Object> children = new ArrayList<Object>(); if (parent instanceof ITaskCategory) { if (((ITaskCategory) parent).isArchive()) { for (ITask task : ((ITaskCategory) parent).getChildren()) { if (task.isActive() || task.isOverdue()) { ITask t = MylarTaskListPlugin.getTaskListManager().getTaskForHandle( task.getHandleIdentifier(), false); if (t == null) children.add(task); } } return children; } List<? extends ITaskListElement> list = ((ITaskCategory) parent).getChildren(); for (int i = 0; i < list.size(); i++) { if (!filter(list.get(i))) { children.add(list.get(i)); } } return children; } else if (parent instanceof IQuery) { List<? extends ITaskListElement> list = ((IQuery) parent).getChildren(); for (int i = 0; i < list.size(); i++) { if (!filter(list.get(i))) { children.add(list.get(i)); } } return children; } else if (parent instanceof Task) { List<ITask> subTasks = ((Task) parent).getChildren(); for (ITask t : subTasks) { if (!filter(t)) { children.add(t); } } return children; } } else { List<Object> children = new ArrayList<Object>(); if (parent instanceof ITaskCategory) { children.addAll(((ITaskCategory) parent).getChildren()); return children; } else if (parent instanceof IQuery) { children.addAll(((IQuery) parent).getChildren()); return children; } else if (parent instanceof Task) { children.addAll(((Task) parent).getChildren()); return children; } } return new ArrayList<Object>(); } | 51151 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51151/d7ea8d231a6e8752aa825ec14511e824f2132892/TasklistContentProvider.java/buggy/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/TasklistContentProvider.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
987,
32,
921,
34,
12267,
329,
4212,
1290,
12,
921,
982,
13,
288,
202,
202,
430,
261,
12298,
2279,
1586,
1528,
12443,
12,
1528,
13,
333,
18,
1945,
18,
3413,
18,
588,
1586,
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,
225,
202,
1152,
987,
32,
921,
34,
12267,
329,
4212,
1290,
12,
921,
982,
13,
288,
202,
202,
430,
261,
12298,
2279,
1586,
1528,
12443,
12,
1528,
13,
333,
18,
1945,
18,
3413,
18,
588,
1586,
3... |
throw new Exception("Couldn't match \"" + m.pattern().pattern() + "\" in string \"" + create + "\""); | throw new Exception("For stored procedure in file '" + list[i].getName() + "' couldn't match \"" + m.pattern().pattern() + "\" in string \"" + create + "\""); | public void addStoredProcedures() throws Exception { Statement st = m_dbconnection.createStatement(); m_out.print("- adding stored procedures... "); FileFilter sqlFilter = new FileFilter() { public boolean accept(File pathname) { return (pathname.getName().startsWith("get") && pathname.getName().endsWith(".sql")) || pathname.getName().endsWith("Trigger.sql"); } }; File[] list = new File(m_sql_dir).listFiles(sqlFilter); for (int i = 0; i < list.length; i++) { LinkedList<String> drop = new LinkedList<String>(); StringBuffer create = new StringBuffer(); String line; m_out.print("\n - " + list[i].getName() + "... "); BufferedReader r = new BufferedReader(new FileReader(list[i])); while ((line = r.readLine()) != null) { line = line.trim(); if (line.matches("--.*")) { continue; } if (line.toLowerCase().startsWith("drop function")) { drop.add(line); } else { create.append(line); create.append("\n"); } } r.close(); Matcher m = Pattern.compile( "(?is)\\b(CREATE(?: OR REPLACE)? FUNCTION\\s+" + "(\\w+)\\s*\\((.*?)\\)\\s+" + "RETURNS\\s+(\\S+)\\s+AS\\s+" + "(.+? language ['\"]?\\w+['\"]?);)").matcher( create.toString()); if (!m.find()) { throw new Exception("Couldn't match \"" + m.pattern().pattern() + "\" in string \"" + create + "\""); } String createSql = m.group(1); String function = m.group(2); String columns = m.group(3); String returns = m.group(4); // String rest = m.group(5); if (functionExists(function, columns, returns)) { if (m_force) { st.execute("DROP FUNCTION " + function + "(" + columns + ")"); st.execute(createSql); m_out.print("OK (dropped and re-added)"); } else { m_out.print("EXISTS"); } } else { st.execute(createSql); m_out.print("OK"); } Pattern p = Pattern.compile("(?i)" + "(CREATE TRIGGER (\\S+)\\s+" + "BEFORE INSERT OR UPDATE\\s+" + "ON (\\S+) FOR EACH ROW\\s+" + "EXECUTE PROCEDURE (\\S+)\\(\\));"); m = p.matcher(create.toString()); if (m.find()) { String triggerSql = m.group(1); String triggerName = m.group(2); String triggerTable = m.group(3); String triggerProc = m.group(4); m_out.print(" - checking trigger '" + triggerName + "' ..."); if (triggerExists(triggerName, triggerTable, triggerProc)) { m_out.println("EXISTS"); } else { st.execute(triggerSql); m_out.println("ADDED"); } } } m_out.println(""); } | 47678 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47678/28ec8d0f53c305460681fe922d064c060141774d/Installer.java/buggy/opennms-install/src/main/java/org/opennms/install/Installer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
527,
18005,
626,
23382,
1435,
1216,
1185,
288,
3639,
8056,
384,
273,
312,
67,
1966,
4071,
18,
2640,
3406,
5621,
3639,
312,
67,
659,
18,
1188,
2932,
17,
6534,
4041,
450,
23382,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
527,
18005,
626,
23382,
1435,
1216,
1185,
288,
3639,
8056,
384,
273,
312,
67,
1966,
4071,
18,
2640,
3406,
5621,
3639,
312,
67,
659,
18,
1188,
2932,
17,
6534,
4041,
450,
23382,
... |
return s.substring( 0, zoneIndex ); | return s.substring( 0, zoneIndex ).trim( ); | private static String cleanDate( String s ) { s = s.trim( ); if ( s.indexOf( 'T' ) < 12 ) { s = s.replaceFirst( "T", " " ); } int zoneIndex = s.indexOf( "GMT" ); if( zoneIndex > 0 ) { return s.substring( 0, zoneIndex ); } zoneIndex = s.indexOf( 'Z' ); if ( zoneIndex == s.length( ) - 1 ) { return s.substring( 0, zoneIndex ); } zoneIndex = s.indexOf( '+' ); if ( zoneIndex > 0 ) { return s.substring( 0, zoneIndex ); } return s; } | 15160 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/15160/0e9e93607489de40d14fffe6279d29a2e5d9eda4/DateFormatISO8601.java/buggy/core/org.eclipse.birt.core/src/org/eclipse/birt/core/data/DateFormatISO8601.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
760,
514,
2721,
1626,
12,
514,
272,
262,
202,
95,
202,
202,
87,
273,
272,
18,
5290,
12,
11272,
202,
202,
430,
261,
272,
18,
31806,
12,
296,
56,
11,
262,
411,
2593,
262,
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,
1152,
760,
514,
2721,
1626,
12,
514,
272,
262,
202,
95,
202,
202,
87,
273,
272,
18,
5290,
12,
11272,
202,
202,
430,
261,
272,
18,
31806,
12,
296,
56,
11,
262,
411,
2593,
262,
2... |
Logger.minor(this, "Stored persistent requests"); | public void storePersistentRequests() { Logger.minor(this, "Storing persistent requests"); ClientRequest[] persistentRequests = getPersistentRequests(); Logger.minor(this, "Persistent requests count: "+persistentRequests.length); synchronized(persistenceSync) { try { File compressedTemp = new File(persistentDownloadsTempFile+".gz"); File compressedFinal = new File(persistentDownloadsFile.toString()+".gz"); FileOutputStream fos = new FileOutputStream(compressedTemp); BufferedOutputStream bos = new BufferedOutputStream(fos); GZIPOutputStream gos = new GZIPOutputStream(bos); OutputStreamWriter osw = new OutputStreamWriter(gos); BufferedWriter w = new BufferedWriter(osw); w.write(Integer.toString(persistentRequests.length)+"\n"); for(int i=0;i<persistentRequests.length;i++) persistentRequests[i].write(w); w.close(); if(!compressedTemp.renameTo(compressedFinal)) { Logger.minor(this, "Rename failed"); compressedFinal.delete(); if(!compressedTemp.renameTo(compressedFinal)) { Logger.error(this, "Could not rename persisted requests temp file "+persistentDownloadsTempFile+".gz to "+persistentDownloadsFile); } } } catch (IOException e) { Logger.error(this, "Cannot write persistent requests to disk: "+e); } } Logger.minor(this, "Stored persistent requests"); } | 8026 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8026/a547979f963f81a958d0283dfe08cd4387e82e23/FCPServer.java/clean/src/freenet/node/fcp/FCPServer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1707,
11906,
6421,
1435,
288,
202,
202,
3328,
18,
17364,
12,
2211,
16,
315,
510,
6053,
9195,
3285,
8863,
202,
202,
1227,
691,
8526,
9195,
6421,
273,
1689,
6572,
6421,
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,
1707,
11906,
6421,
1435,
288,
202,
202,
3328,
18,
17364,
12,
2211,
16,
315,
510,
6053,
9195,
3285,
8863,
202,
202,
1227,
691,
8526,
9195,
6421,
273,
1689,
6572,
6421,
5621,... | |
selectNode(rootNode); | selectNode( rootNode ); | protected void populateAvailableDbObjects() { DataSetDesign dataSetDesign = getDataSetDesign( ); DataSourceDesign curDataSourceDesign = dataSetDesign.getDataSourceDesign( ); if ( curDataSourceDesign == prevDataSourceDesign ) { if ( ( cachedSearchTxt == searchTxt.getText( ) || ( cachedSearchTxt != null && cachedSearchTxt.equals( searchTxt.getText( ) ) ) ) && ( cachedDbType == getSelectedDbType( ) || ( cachedDbType != null && cachedDbType.equals( getSelectedDbType( ) ) ) ) ) { if ( schemaList != null && schemaList.size( ) > 0 ) { if ( cachedSchemaComboIndex == schemaCombo.getSelectionIndex( ) ) { return; } } else return; } } // Clear of the Old values in the Available Db objects // in the tree RemoveAllAvailableDbObjects( ); setRootElement( ); setRefreshInfo( ); if ( isSchemaSupported ) { populateSchemaList( ); } else { populateTableList( ); } addFetchDbObjectListener( ); // Set the focus on the root node if( rootNode != null ) { selectNode(rootNode); } } | 46013 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46013/cb59eec61fac3f70118834d4b7418d08c64f26a0/SQLDataSetEditorPage.java/buggy/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/editors/SQLDataSetEditorPage.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
918,
6490,
5268,
4331,
4710,
1435,
202,
95,
202,
202,
13676,
15478,
14837,
15478,
273,
4303,
694,
15478,
12,
11272,
202,
202,
8597,
15478,
662,
8597,
15478,
273,
14837,
15478,
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,
225,
202,
1117,
918,
6490,
5268,
4331,
4710,
1435,
202,
95,
202,
202,
13676,
15478,
14837,
15478,
273,
4303,
694,
15478,
12,
11272,
202,
202,
8597,
15478,
662,
8597,
15478,
273,
14837,
15478,
18... |
message.setMessage( 250, 14, 62 ); } catch( InvalidMidiDataException e ) { } assertTrue( message.getChannel() == 10 ); | message.setMessage(250, 14, 62); } catch (InvalidMidiDataException e) {} assertEquals(10, message.getChannel()); | public void test_getChannel() { ShortMessage message = new ShortMessage(); assertTrue( message.getChannel() == 0 ); ShortMessage1 message1 = new ShortMessage1( new byte[] { 23, 16, 35 } ); assertTrue( message1.getChannel() == 7 ); ShortMessage1 message2 = new ShortMessage1( null ); assertTrue( message2.getChannel() == 0 ); try { message.setMessage( 249 ); } catch( InvalidMidiDataException e ) { } assertTrue( message.getChannel() == 9 ); try { message.setMessage( 250, 14, 62 ); } catch( InvalidMidiDataException e ) { } assertTrue( message.getChannel() == 10 ); try { message.setMessage( 234, 15, 14, 62 ); } catch( InvalidMidiDataException e ) { } assertTrue( message.getChannel() == 15 ); } | 54769 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54769/13c78752ef33d683595b41e42ed24e8a84c3a418/ShortMessageTest.java/clean/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/ShortMessageTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
67,
588,
2909,
1435,
565,
288,
3639,
7925,
1079,
883,
273,
394,
7925,
1079,
5621,
3639,
1815,
5510,
12,
883,
18,
588,
2909,
1435,
422,
374,
11272,
7734,
7925,
1079,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
67,
588,
2909,
1435,
565,
288,
3639,
7925,
1079,
883,
273,
394,
7925,
1079,
5621,
3639,
1815,
5510,
12,
883,
18,
588,
2909,
1435,
422,
374,
11272,
7734,
7925,
1079,
21,
... |
if( ( !written ) && typedefd ) | if ((!written) && typedefd) | public void print( PrintWriter _ps ) { if( included && !generateIncluded() ) return; // no code generation try { // print the element type, may be a locally defined member type, e.g. // a struct member type type_spec.print( _ps ); // only generate class files for explicitly // defined sequence types, i.e. for typedef'd ones if( ( !written ) && typedefd ) { // write holder file String className = className(); String path = parser.out_dir + fileSeparator + pack_name.replace( '.', fileSeparator ); File dir = new File( path ); if( !dir.exists() ) { if( !dir.mkdirs() ) { org.jacorb.idl.parser.fatal_error( "Unable to create " + path, null ); } } String fname = className + "Holder.java"; PrintWriter ps = new PrintWriter( new java.io.FileWriter( new File( dir, fname ) ) ); printHolderClass( className, ps ); ps.close(); fname = className + "Helper.java"; ps = new PrintWriter( new java.io.FileWriter( new File( dir, fname ) ) ); printHelperClass( className, ps ); ps.close(); written = true; } } catch( java.io.IOException i ) { System.err.println( "File IO error" ); i.printStackTrace(); } } | 46355 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/46355/278f3c155857731fd66af3fde55ccb06f7e8c3b6/ArrayTypeSpec.java/buggy/src/org/jacorb/idl/ArrayTypeSpec.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1172,
12,
14071,
389,
1121,
262,
565,
288,
3639,
309,
12,
5849,
597,
401,
7163,
19323,
1435,
262,
5411,
327,
31,
368,
1158,
981,
9377,
3639,
775,
3639,
288,
5411,
368,
1172,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1172,
12,
14071,
389,
1121,
262,
565,
288,
3639,
309,
12,
5849,
597,
401,
7163,
19323,
1435,
262,
5411,
327,
31,
368,
1158,
981,
9377,
3639,
775,
3639,
288,
5411,
368,
1172,
... |
public void setConf(NutchConf conf) { this.nutchConf = conf; | public void setConf(Configuration conf) { this.conf = conf; | public void setConf(NutchConf conf) { this.nutchConf = conf; } | 57484 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57484/25437bc825d50715dcc9a289a1b4c8fbbc6aced1/TextParser.java/buggy/src/plugin/parse-text/src/java/org/apache/nutch/parse/text/TextParser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
918,
444,
3976,
12,
50,
322,
343,
3976,
2195,
13,
288,
565,
333,
18,
82,
322,
343,
3976,
273,
2195,
31,
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,
1071,
918,
444,
3976,
12,
50,
322,
343,
3976,
2195,
13,
288,
565,
333,
18,
82,
322,
343,
3976,
273,
2195,
31,
225,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return (EAttribute)boundsEClass.getEStructuralFeatures().get(3); | return (EAttribute) boundsEClass.getEStructuralFeatures().get(3); | public EAttribute getBounds_Height() { return (EAttribute)boundsEClass.getEStructuralFeatures().get(3); } | 12803 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12803/e5c78f0e8317166d02fa384e14c3dd7aa1796f2c/AttributePackageImpl.java/buggy/chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/model/attribute/impl/AttributePackageImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
512,
1499,
22107,
67,
2686,
1435,
565,
288,
3639,
327,
261,
41,
1499,
13,
4972,
5720,
18,
588,
41,
14372,
8696,
7675,
588,
12,
23,
1769,
565,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
512,
1499,
22107,
67,
2686,
1435,
565,
288,
3639,
327,
261,
41,
1499,
13,
4972,
5720,
18,
588,
41,
14372,
8696,
7675,
588,
12,
23,
1769,
565,
289,
2,
-100,
-100,
-100,
-100,
-100,... |
parent.setLayout(new GridLayout()); | public void createPartControl(Composite parent) { parent.setLayout(new GridLayout()); super.createPartControl(parent); final Button dirtyToggle = new Button(parent, SWT.CHECK); dirtyToggle.setText("Dirty"); dirtyToggle.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { setDirty(dirtyToggle.getSelection()); } }); dirtyToggle.setSelection(isDirty()); final Button saveNeededToggle = new Button(parent, SWT.CHECK); saveNeededToggle.setText("Save on close"); saveNeededToggle.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { setSaveNeeded(saveNeededToggle.getSelection()); } }); saveNeededToggle.setSelection(saveNeeded); final Button saveAsToggle = new Button(parent, SWT.CHECK); saveAsToggle.setText("Save as allowed"); saveAsToggle.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { setSaveAsAllowed(saveAsToggle.getSelection()); } }); saveAsToggle.setSelection(saveAsAllowed); } | 58148 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58148/54532dbf350a8597a32c3325d699ca741a40ef83/MockEditorPart.java/buggy/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/api/MockEditorPart.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
752,
1988,
3367,
12,
9400,
982,
13,
288,
8227,
2240,
18,
2640,
1988,
3367,
12,
2938,
1769,
3639,
727,
12569,
9603,
17986,
273,
394,
12569,
12,
2938,
16,
348,
8588,
18,
10687,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
752,
1988,
3367,
12,
9400,
982,
13,
288,
8227,
2240,
18,
2640,
1988,
3367,
12,
2938,
1769,
3639,
727,
12569,
9603,
17986,
273,
394,
12569,
12,
2938,
16,
348,
8588,
18,
10687,
... | |
throws DOMException { throw new DOMException( DOMException.INVALID_ACCESS_ERR, "This is a color" ); | throws DOMException { throw new DOMException(DOMException.INVALID_ACCESS_ERR, "This is a color"); | public Counter getCounterValue() throws DOMException { throw new DOMException( DOMException.INVALID_ACCESS_ERR, "This is a color" ); } | 52947 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52947/a02f21737e5cac245dc17710370c9c1eda2116b3/DefaultCSSPrimitiveValue.java/buggy/src/java/org/xhtmlrenderer/css/impl/DefaultCSSPrimitiveValue.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
2398,
1071,
9354,
31107,
620,
1435,
7734,
1216,
4703,
503,
288,
7734,
604,
394,
4703,
503,
12,
4703,
503,
18,
9347,
67,
13204,
67,
9712,
16,
315,
2503,
353,
279,
2036,
6,
11272,
5411,
289,
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,
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,
2398,
1071,
9354,
31107,
620,
1435,
7734,
1216,
4703,
503,
288,
7734,
604,
394,
4703,
503,
12,
4703,
503,
18,
9347,
67,
13204,
67,
9712,
16,
315,
2503,
353,
279,
2036,
6,
11272,
5411,
289,
2... |
byte bits[] = new byte[8]; | public static String JS_dtobasestr(int base, double d) { char[] buffer; /* The output string */ int p; /* index to current position in the buffer */ int pInt; /* index to the beginning of the integer part of the string */ int q; int digit; double di; /* d truncated to an integer */ double df; /* The fractional part of d */// JS_ASSERT(base >= 2 && base <= 36); buffer = new char[DTOBASESTR_BUFFER_SIZE]; p = 0; if (d < 0.0) { buffer[p++] = '-'; d = -d; } /* Check for Infinity and NaN */ if (Double.isNaN(d)) return "NaN"; else if (Double.isInfinite(d)) return "Infinity"; /* Output the integer part of d with the digits in reverse order. */ pInt = p; di = (int)d; BigInteger b = new BigInteger(byteValue((long)di)); String intDigits = b.toString(base); intDigits.getChars(0, intDigits.length(), buffer, p); p += intDigits.length(); df = d - di; if (df != 0.0) { /* We have a fraction. */ byte bits[] = new byte[8]; buffer[p++] = '.'; long dBits = Double.doubleToLongBits(d); int word0 = (int)(dBits >> 32); int word1 = (int)(dBits); int e = d2b(df, bits); b = new BigInteger(bits);// JS_ASSERT(e < 0); /* At this point df = b * 2^e. e must be less than zero because 0 < df < 1. */ int s2 = -(word0 >>> Exp_shift1 & Exp_mask >> Exp_shift1); if (s2 == 0) s2 = -1; s2 += Bias + P; /* 1/2^s2 = (nextDouble(d) - d)/2 */// JS_ASSERT(-s2 < e); bits = new byte[1]; bits[0] = 1; BigInteger mlo = new BigInteger(bits); BigInteger mhi = mlo; if ((word1 == 0) && ((word0 & Bndry_mask) == 0) && ((word0 & (Exp_mask & Exp_mask << 1)) != 0)) { /* The special case. Here we want to be within a quarter of the last input significant digit instead of one half of it when the output string's value is less than d. */ s2 += Log2P; bits[0] = 1<<Log2P; mhi = new BigInteger(bits); } b = b.shiftLeft(e + s2); bits[0] = 1; BigInteger s = new BigInteger(bits); s = s.shiftLeft(s2); /* At this point we have the following: * s = 2^s2; * 1 > df = b/2^s2 > 0; * (d - prevDouble(d))/2 = mlo/2^s2; * (nextDouble(d) - d)/2 = mhi/2^s2. */ bits[0] = (byte)base; // s'ok since base < 36 BigInteger bigBase = new BigInteger(bits); System.out.println("s2 = " + s2 + ", e = " + e + ", b = " + b.toString()); System.out.println("mhi = " + mhi.toString()); System.out.println("mlo = " + mlo.toString()); boolean done = false; do { b = b.multiply(bigBase); BigInteger[] divResult = b.divideAndRemainder(s); b = divResult[1]; digit = (char)(divResult[0].intValue()); if (mlo == mhi) mlo = mhi = mlo.multiply(bigBase); else { mlo = mlo.multiply(bigBase); mhi = mhi.multiply(bigBase); } /* Do we yet have the shortest string that will round to d? */ int j = b.compareTo(mlo); /* j is b/2^s2 compared with mlo/2^s2. */ BigInteger delta = s.subtract(mhi); int j1 = (delta.signum() <= 0) ? 1 : b.compareTo(delta); /* j1 is b/2^s2 compared with 1 - mhi/2^s2. */ if (j1 == 0 && ((word1 & 1) == 0)) { if (j > 0) digit++; done = true; } else if (j < 0 || (j == 0 && ((word1 & 1) == 0))) { if (j1 > 0) { /* Either dig or dig+1 would work here as the least significant digit. Use whichever would produce an output value closer to d. */ b = b.shiftLeft(1); j1 = b.compareTo(s); if (j1 > 0) /* The even test (|| (j1 == 0 && (digit & 1))) is not here because it messes up odd base output * such as 3.5 in base 3. */ digit++; } done = true; } else if (j1 > 0) { digit++; done = true; }// JS_ASSERT(digit < (uint32)base); buffer[p++] = BASEDIGIT(digit); } while (!done); } return new String(buffer, 0, p); } | 19000 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/19000/be6d0c85ffa6f2cc645c0516ebad8777e902b1af/DToA.java/buggy/src/org/mozilla/javascript/DToA.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
514,
6756,
67,
72,
869,
18602,
313,
12,
474,
1026,
16,
1645,
302,
13,
565,
288,
3639,
1149,
8526,
1613,
31,
4202,
1748,
1021,
876,
533,
1195,
3639,
509,
293,
31,
9079,
1748,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
760,
514,
6756,
67,
72,
869,
18602,
313,
12,
474,
1026,
16,
1645,
302,
13,
565,
288,
3639,
1149,
8526,
1613,
31,
4202,
1748,
1021,
876,
533,
1195,
3639,
509,
293,
31,
9079,
1748,
... | |
if(log.isInfoEnabled()) log.info("created a pool of " + MAX_NUM + " threads"); | if(log.isDebugEnabled()) log.debug("created a pool of " + MAX_NUM + " threads"); | public ThreadPool(int max_num) { MAX_NUM=max_num; pool=new ReusableThread[MAX_NUM]; available_threads=new boolean[MAX_NUM]; for(int i=0; i < pool.length; i++) { pool[i]=null; available_threads[i]=true; } if(log.isInfoEnabled()) log.info("created a pool of " + MAX_NUM + " threads"); } | 51463 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51463/85b7a7c351493f88f1d6a3045b9cbd0b817f95cd/ThreadPool.java/buggy/src/org/jgroups/util/ThreadPool.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
27359,
12,
474,
943,
67,
2107,
13,
288,
3639,
4552,
67,
6069,
33,
1896,
67,
2107,
31,
3639,
2845,
33,
2704,
868,
16665,
3830,
63,
6694,
67,
6069,
15533,
3639,
2319,
67,
12495,
33,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
27359,
12,
474,
943,
67,
2107,
13,
288,
3639,
4552,
67,
6069,
33,
1896,
67,
2107,
31,
3639,
2845,
33,
2704,
868,
16665,
3830,
63,
6694,
67,
6069,
15533,
3639,
2319,
67,
12495,
33,... |
int result = -1; if (this.deactivated_) return -1; try { if (tv == null) notFullCondition_.timedWait (); else notFullCondition_.timedWait (tv); } catch (TimeoutException e) { return -1; } if (this.deactivated_) return -1; else result = this.enqueueHeadInternal (newItem); this.notEmptyCondition_.broadcast (); return result; | return this.enqueueHead (newItem, null); | public synchronized int enqueueHead (MessageBlock newItem, TimeValue tv) throws InterruptedException { int result = -1; if (this.deactivated_) return -1; try { if (tv == null) // Need to do a blocking wait notFullCondition_.timedWait (); else // Need to do a timed wait notFullCondition_.timedWait (tv); } catch (TimeoutException e) { return -1; } // Check again if queue is still active if (this.deactivated_) return -1; else result = this.enqueueHeadInternal (newItem); // Tell any blocked threads that the queue has a new item! this.notEmptyCondition_.broadcast (); return result; } | 1867 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1867/d46ee033e1ca7e2552e4cd3e165af3416345b815/MessageQueue.java/buggy/java/src/MessageQueue.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
3852,
509,
12850,
1414,
261,
1079,
1768,
26536,
16,
6862,
4202,
2647,
620,
13521,
13,
1216,
7558,
225,
288,
565,
509,
563,
273,
300,
21,
31,
565,
309,
261,
2211,
18,
323,
18836,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3852,
509,
12850,
1414,
261,
1079,
1768,
26536,
16,
6862,
4202,
2647,
620,
13521,
13,
1216,
7558,
225,
288,
565,
509,
563,
273,
300,
21,
31,
565,
309,
261,
2211,
18,
323,
18836,
6... |
public void orderRows(OrderBy ob){ if (ob != null && rows != null){ ob.setColumnMD(columnMD); Collections.sort(rows,ob); goTop(); } } | public void orderRows(OrderBy ob) { if (ob != null && rows != null) { ob.setColumnMD(columnMD); Collections.sort(rows, ob); goTop(); } } | public void orderRows(OrderBy ob){ if (ob != null && rows != null){ ob.setColumnMD(columnMD); Collections.sort(rows,ob); goTop(); } } | 8836 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/8836/73647f36b9ada99ead4f9d0f67e459369342ca74/DataSet.java/buggy/PZFileReader/com/pz/reader/DataSet.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1353,
4300,
12,
15658,
3768,
15329,
202,
565,
309,
261,
947,
480,
446,
597,
2595,
480,
446,
15329,
202,
3639,
3768,
18,
542,
1494,
6188,
12,
2827,
6188,
1769,
202,
3639,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
1353,
4300,
12,
15658,
3768,
15329,
202,
565,
309,
261,
947,
480,
446,
597,
2595,
480,
446,
15329,
202,
3639,
3768,
18,
542,
1494,
6188,
12,
2827,
6188,
1769,
202,
3639,
... |
mb.setMessage("Can't load this job. Please connect to the correct repository first."); mb.setText("Error!"); | mb.setMessage(Messages.getString("Chef.Dialog.CanNotLoadJobConnectToRepositoryFirst.Message")); mb.setText(Messages.getString("Chef.Dialog.CanNotLoadJobConnectToRepositoryFirst.Title")); | private void addMenuLast() { int idx = msFile.indexOf(miFileSep3); int max = msFile.getItemCount(); // Remove everything until end... for (int i=max-1;i>idx;i--) { MenuItem mi = msFile.getItem(i); mi.dispose(); } // Previously loaded files... String lf[] = props.getLastFiles(); String ld[] = props.getLastDirs(); boolean lt[] = props.getLastTypes(); String lr[] = props.getLastRepositories(); for (int i=0;i<lf.length;i++) { MenuItem miFileLast = new MenuItem(msFile, SWT.CASCADE); char chr = (char)('1'+i ); int accel = SWT.CTRL | chr; String repository = ( lr[i]!=null && lr[i].length()>0 ) ? ( "["+lr[i]+"] " ) : ""; String filename = RepositoryDirectory.DIRECTORY_SEPARATOR + lf[i]; if (!lt[i]) filename = lf[i]; if (!ld[i].equals(RepositoryDirectory.DIRECTORY_SEPARATOR)) { filename=ld[i]+filename; } if (i<9) { miFileLast.setAccelerator(accel); miFileLast.setText("&"+chr+" "+repository+filename+ "\tCTRL-"+chr); } else { miFileLast.setText(" "+repository+filename); } final String fn = lf[i]; // filename final String fd = ld[i]; // Repository directory ... final boolean ft = lt[i]; // type: true=repository, false=file final String fr = lr[i]; // repository name Listener lsFileLast = new Listener() { public void handleEvent(Event e) { if (showChangedWarning()) { // If the file comes from a repository and it's not the same as // the one we're connected to, ask for a username/password! // boolean noRepository=false; if (ft && (rep==null || !rep.getRepositoryInfo().getName().equalsIgnoreCase(fr) )) { int perms[] = new int[] { PermissionMeta.TYPE_PERMISSION_JOB }; RepositoriesDialog rd = new RepositoriesDialog(disp, SWT.NONE, perms, APP_NAME); rd.setRepositoryName(fr); if (rd.open()) { // Close the previous connection... if (rep!=null) rep.disconnect(); rep = new Repository(log, rd.getRepository(), rd.getUser()); if (!rep.connect(APP_NAME)) { rep=null; MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage("I was unable to connect to this repository!"); mb.setText("Error!"); mb.open(); } } else { noRepository=true; } } if (ft) { if (!noRepository && rep!=null && rep.getRepositoryInfo().getName().equalsIgnoreCase(fr)) { // OK, we're connected to the new repository... // Load the job... RepositoryDirectory fdRepdir = rep.getDirectoryTree().findDirectory(fd); try { if (fdRepdir!=null) { jobMeta = new JobMeta(log, rep, fn, fdRepdir); } else { throw new KettleException("The directory specified doesn't exist: "+fd); } } catch(KettleException ke) { jobMeta.clear(); new ErrorDialog(shell, props, "Error loading job", "I was unable to load this job from the repository!", ke); } } else { jobMeta.clear(); MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage("Can't load this job. Please connect to the correct repository first."); mb.setText("Error!"); mb.open(); } } else // Load from XML! { try { jobMeta = new JobMeta(log, fn); } catch(KettleException ke) { jobMeta.clear(); new ErrorDialog(shell, props, "Error loading job", "I was unable to load this job from the XML file!", ke); } } refreshTree(true); refreshGraph(); } } }; miFileLast.addListener(SWT.Selection, lsFileLast); } } | 58146 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/58146/de88a78f183a1d633bde85cdc58e0fc4c0ee4e56/Chef.java/buggy/kettle/src/be/ibridge/kettle/chef/Chef.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
527,
4599,
3024,
1435,
202,
95,
202,
202,
474,
2067,
273,
4086,
812,
18,
31806,
12,
9197,
812,
5097,
23,
1769,
202,
202,
474,
943,
273,
4086,
812,
18,
588,
30687,
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,
918,
527,
4599,
3024,
1435,
202,
95,
202,
202,
474,
2067,
273,
4086,
812,
18,
31806,
12,
9197,
812,
5097,
23,
1769,
202,
202,
474,
943,
273,
4086,
812,
18,
588,
30687,
5621,
... |
if( bestFn.isTemplateInstance() && currFn.isTemplateInstance() ){ | boolean bestIsTemplate = bestFn.getContainingSymbol() instanceof ITemplateSymbol; boolean currIsTemplate = currFn.getContainingSymbol() instanceof ITemplateSymbol; if( bestIsTemplate && currIsTemplate ) { | static protected IParameterizedSymbol resolveFunction( LookupData data, List functions ) throws ParserSymbolTableException{ if( functions == null ){ return null; } reduceToViable( data, functions ); if( data.exactFunctionsOnly ){ if( functions.size() == 1 ){ return (IParameterizedSymbol) functions.get( 0 ); } else if( functions.size() == 0 ){ return null; } else { throw new ParserSymbolTableException( ParserSymbolTableException.r_Ambiguous ); } } int numSourceParams = ( data.parameters == null ) ? 0 : data.parameters.size(); int numFns = functions.size(); if( numSourceParams == 0 ){ //no parameters //if there is only 1 viable function, return it, if more than one, its ambiguous if( numFns == 0 ){ return null; } else if ( numFns == 1 ){ return (IParameterizedSymbol)functions.iterator().next(); } else if ( numFns == 2 ){ Iterator iter = functions.iterator(); while( iter.hasNext() ){ IParameterizedSymbol fn = (IParameterizedSymbol) iter.next(); if( fn.getTypeInfo().isForwardDeclaration() && fn.getTypeSymbol() != null ){ if( functions.contains( fn.getTypeSymbol() ) ){ return (IParameterizedSymbol) fn.getTypeSymbol(); } } } } if( data.parameters == null ) throw new ParserSymbolTableException( ParserSymbolTableException.r_Ambiguous ); } IParameterizedSymbol bestFn = null; //the best function IParameterizedSymbol currFn = null; //the function currently under consideration Cost [] bestFnCost = null; //the cost of the best function Cost [] currFnCost = null; //the cost for the current function Iterator iterFns = functions.iterator(); Iterator sourceParams = null; Iterator targetParams = null; int comparison; Cost cost = null; Cost temp = null; TypeInfo source = null; TypeInfo target = null; boolean hasWorse = false; boolean hasBetter = false; boolean ambiguous = false; boolean currHasAmbiguousParam = false; boolean bestHasAmbiguousParam = false; List parameters = null; if( numSourceParams == 0 ){ parameters = new LinkedList(); parameters.add( new TypeInfo( TypeInfo.t_void, 0, null ) ); numSourceParams = 1; } else { parameters = data.parameters; } for( int i = numFns; i > 0; i-- ){ currFn = (IParameterizedSymbol) iterFns.next(); if( bestFn != null ){ if( bestFn.isForwardDeclaration() && bestFn.getTypeSymbol() == currFn ){ bestFn = currFn; continue; } else if( currFn.isForwardDeclaration() && currFn.getTypeSymbol() == bestFn ){ continue; } } sourceParams = parameters.iterator(); List parameterList = null; if( currFn.getParameterList().isEmpty() && !currFn.hasVariableArgs() ){ //the only way we get here and have no parameters, is if we are looking //for a function that takes void parameters ie f( void ) parameterList = new LinkedList(); parameterList.add( currFn.getSymbolTable().newSymbol( "", TypeInfo.t_void ) ); //$NON-NLS-1$ } else { parameterList = currFn.getParameterList(); } targetParams = parameterList.iterator(); if( currFnCost == null ){ currFnCost = new Cost [ numSourceParams ]; } comparison = 0; boolean varArgs = false; for( int j = 0; j < numSourceParams; j++ ){ source = (TypeInfo) sourceParams.next(); if( targetParams.hasNext() ) target = ((ISymbol)targetParams.next()).getTypeInfo(); else varArgs = true; if( varArgs ){ cost = new Cost( source, null ); cost.rank = Cost.ELLIPSIS_CONVERSION; } else if ( target.getHasDefault() && source.isType( TypeInfo.t_void ) && !source.hasPtrOperators() ){ //source is just void, ie no parameter, if target had a default, then use that cost = new Cost( source, target ); cost.rank = Cost.IDENTITY_RANK; } else if( source.equals( target ) ){ cost = new Cost( source, target ); cost.rank = Cost.IDENTITY_RANK; //exact match, no cost } else { cost = checkStandardConversionSequence( source, target ); //12.3-4 At most one user-defined conversion is implicitly applied to //a single value. (also prevents infinite loop) if( cost.rank == Cost.NO_MATCH_RANK && !data.forUserDefinedConversion ){ temp = checkUserDefinedConversionSequence( source, target ); if( temp != null ){ cost = temp; } } } currFnCost[ j ] = cost; } hasWorse = false; hasBetter = false; //In order for this function to be better than the previous best, it must //have at least one parameter match that is better that the corresponding //match for the other function, and none that are worse. for( int j = 0; j < numSourceParams; j++ ){ if( currFnCost[ j ].rank < 0 ){ hasWorse = true; hasBetter = false; break; } //an ambiguity in the user defined conversion sequence is only a problem //if this function turns out to be the best. currHasAmbiguousParam = ( currFnCost[ j ].userDefined == 1 ); if( bestFnCost != null ){ comparison = currFnCost[ j ].compare( bestFnCost[ j ] ); hasWorse |= ( comparison < 0 ); hasBetter |= ( comparison > 0 ); } else { hasBetter = true; } } //If function has a parameter match that is better than the current best, //and another that is worse (or everything was just as good, neither better nor worse). //then this is an ambiguity (unless we find something better than both later) ambiguous |= ( hasWorse && hasBetter ) || ( !hasWorse && !hasBetter ); if( !hasWorse ){ if( !hasBetter ){ //if they are both template functions, we can order them that way if( bestFn.isTemplateInstance() && currFn.isTemplateInstance() ){ ITemplateSymbol t1 = (ITemplateSymbol) bestFn.getInstantiatedSymbol().getContainingSymbol(); ITemplateSymbol t2 = (ITemplateSymbol) currFn.getInstantiatedSymbol().getContainingSymbol(); int order = TemplateEngine.orderTemplateFunctions( t1, t2 ); if ( order < 0 ){ hasBetter = true; } else if( order > 0 ){ ambiguous = false; } } //we prefer normal functions over template functions, unless the specified template arguments else if( bestFn.isTemplateInstance() && !currFn.isTemplateInstance() ){ if( data.templateParameters == null ) hasBetter = true; else ambiguous = false; } else if( !bestFn.isTemplateInstance() && currFn.isTemplateInstance() ){ if( data.templateParameters == null ) ambiguous = false; else hasBetter = true; } } if( hasBetter ){ //the new best function. ambiguous = false; bestFnCost = currFnCost; bestHasAmbiguousParam = currHasAmbiguousParam; currFnCost = null; bestFn = currFn; } } } if( ambiguous || bestHasAmbiguousParam ){ throw new ParserSymbolTableException( ParserSymbolTableException.r_Ambiguous ); } return bestFn; } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/63bc5b00d213af472378e76eef2393de6785ba86/ParserSymbolTable.java/clean/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParserSymbolTable.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
3845,
4750,
467,
15696,
5335,
2245,
2083,
12,
8834,
751,
501,
16,
987,
4186,
262,
1216,
6783,
5335,
1388,
503,
95,
202,
202,
430,
12,
4186,
422,
446,
262,
95,
1082,
202,
2463,
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,
225,
202,
3845,
4750,
467,
15696,
5335,
2245,
2083,
12,
8834,
751,
501,
16,
987,
4186,
262,
1216,
6783,
5335,
1388,
503,
95,
202,
202,
430,
12,
4186,
422,
446,
262,
95,
1082,
202,
2463,
446,... |
new NoViableAltException("956:1: word returns [String word] : (id= ID | \'import\' | \'use\' | \'rule\' | \'query\' | \'salience\' | \'no-loop\' | \'when\' | \'then\' | \'end\' | str= STRING );", 62, 0, input); | new NoViableAltException("950:1: word returns [String word] : (id= ID | \'import\' | \'use\' | \'rule\' | \'query\' | \'salience\' | \'no-loop\' | \'when\' | \'then\' | \'end\' | str= STRING );", 62, 0, input); | public String word() throws RecognitionException { String word; Token id=null; Token str=null; word = null; try { // /Users/bob/checkouts/jbossrules/drools-compiler/src/main/resources/org/drools/lang/drl.g:960:17: (id= ID | 'import' | 'use' | 'rule' | 'query' | 'salience' | 'no-loop' | 'when' | 'then' | 'end' | str= STRING ) int alt62=11; switch ( input.LA(1) ) { case ID: alt62=1; break; case 17: alt62=2; break; case 57: alt62=3; break; case 28: alt62=4; break; case 26: alt62=5; break; case 33: alt62=6; break; case 34: alt62=7; break; case 29: alt62=8; break; case 31: alt62=9; break; case 27: alt62=10; break; case STRING: alt62=11; break; default: NoViableAltException nvae = new NoViableAltException("956:1: word returns [String word] : (id= ID | \'import\' | \'use\' | \'rule\' | \'query\' | \'salience\' | \'no-loop\' | \'when\' | \'then\' | \'end\' | str= STRING );", 62, 0, input); throw nvae; } switch (alt62) { case 1 : // /Users/bob/checkouts/jbossrules/drools-compiler/src/main/resources/org/drools/lang/drl.g:960:17: id= ID { id=(Token)input.LT(1); match(input,ID,FOLLOW_ID_in_word2737); word=id.getText(); } break; case 2 : // /Users/bob/checkouts/jbossrules/drools-compiler/src/main/resources/org/drools/lang/drl.g:961:17: 'import' { match(input,17,FOLLOW_17_in_word2749); word="import"; } break; case 3 : // /Users/bob/checkouts/jbossrules/drools-compiler/src/main/resources/org/drools/lang/drl.g:962:17: 'use' { match(input,57,FOLLOW_57_in_word2758); word="use"; } break; case 4 : // /Users/bob/checkouts/jbossrules/drools-compiler/src/main/resources/org/drools/lang/drl.g:963:17: 'rule' { match(input,28,FOLLOW_28_in_word2770); word="rule"; } break; case 5 : // /Users/bob/checkouts/jbossrules/drools-compiler/src/main/resources/org/drools/lang/drl.g:964:17: 'query' { match(input,26,FOLLOW_26_in_word2781); word="query"; } break; case 6 : // /Users/bob/checkouts/jbossrules/drools-compiler/src/main/resources/org/drools/lang/drl.g:965:17: 'salience' { match(input,33,FOLLOW_33_in_word2791); word="salience"; } break; case 7 : // /Users/bob/checkouts/jbossrules/drools-compiler/src/main/resources/org/drools/lang/drl.g:966:17: 'no-loop' { match(input,34,FOLLOW_34_in_word2799); word="no-loop"; } break; case 8 : // /Users/bob/checkouts/jbossrules/drools-compiler/src/main/resources/org/drools/lang/drl.g:967:17: 'when' { match(input,29,FOLLOW_29_in_word2807); word="when"; } break; case 9 : // /Users/bob/checkouts/jbossrules/drools-compiler/src/main/resources/org/drools/lang/drl.g:968:17: 'then' { match(input,31,FOLLOW_31_in_word2818); word="then"; } break; case 10 : // /Users/bob/checkouts/jbossrules/drools-compiler/src/main/resources/org/drools/lang/drl.g:969:17: 'end' { match(input,27,FOLLOW_27_in_word2829); word="end"; } break; case 11 : // /Users/bob/checkouts/jbossrules/drools-compiler/src/main/resources/org/drools/lang/drl.g:970:17: str= STRING { str=(Token)input.LT(1); match(input,STRING,FOLLOW_STRING_in_word2843); word=getString(str); } break; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return word; } | 6736 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6736/d5f13d3fd7dfa914ff0c982ef4e7b3e9027d4eb1/RuleParser.java/buggy/drools-compiler/src/main/java/org/drools/lang/RuleParser.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
2076,
1435,
1216,
9539,
288,
6647,
514,
2076,
31,
3639,
3155,
612,
33,
2011,
31,
3639,
3155,
609,
33,
2011,
31,
540,
202,
202,
1095,
273,
446,
31,
540,
202,
3639,
775,
288,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
2076,
1435,
1216,
9539,
288,
6647,
514,
2076,
31,
3639,
3155,
612,
33,
2011,
31,
3639,
3155,
609,
33,
2011,
31,
540,
202,
202,
1095,
273,
446,
31,
540,
202,
3639,
775,
288,
... |
if (index >= inputBuffer.size()) { index = inputBuffer.size(); | if (index >= outputQueue.size()) { index = outputQueue.size(); | private void insertSpeechStart() { // "index" is where we should insert the SPEECH_START int index = inputBuffer.indexOf(lastStartLowFrame); // Go back startOffset frames, but check if we have hit // an UTTERANCE_START, in which case we should stop going back. if (index > -1) { int i = 0; for (ListIterator iterator = inputBuffer.listIterator(index); i < startOffset && iterator.hasNext(); i++) { Cepstrum cepstrum = (Cepstrum) iterator.next(); if (cepstrum.getSignal().equals(Signal.UTTERANCE_START)) { break; } } index += i; } if (index >= inputBuffer.size()) { index = inputBuffer.size(); } else if (index < 0) { // This probably means that there weren't any frames // below startLow so far for this Utterance. We just // go back and find the UTTERANCE_START. index = 0; System.out.println("Cannot find lastStartLowFrame"); for (ListIterator i = inputBuffer.listIterator(); i.hasNext();) { Cepstrum cepstrum = (Cepstrum) i.next(); if (cepstrum.getSignal().equals(Signal.UTTERANCE_START)) { index = inputBuffer.indexOf(cepstrum); } } } inputBuffer.add(index, (new Cepstrum(Signal.SPEECH_START))); } | 52185 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52185/a3fa2a9e07b2fc5ba48c88ee1905ac8d0add821b/EnergyEndpointer.java/clean/edu/cmu/sphinx/frontend/EnergyEndpointer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
2243,
22334,
1685,
1435,
288,
3639,
368,
315,
1615,
6,
353,
1625,
732,
1410,
2243,
326,
348,
1423,
41,
1792,
67,
7570,
3639,
509,
770,
273,
810,
1892,
18,
31806,
12,
2722,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
2243,
22334,
1685,
1435,
288,
3639,
368,
315,
1615,
6,
353,
1625,
732,
1410,
2243,
326,
348,
1423,
41,
1792,
67,
7570,
3639,
509,
770,
273,
810,
1892,
18,
31806,
12,
2722,
16... |
public void handleExceptionThrown(Context cx, Object e) { if(breakOnExceptions) { DebuggableEngine engine = cx.getDebuggableEngine(); DebugFrame frame = engine.getFrame(0); String sourceName = frame.getSourceName(); int lineNumber = frame.getLineNumber(); FileWindow w = null; if(sourceName == null) { if(lineNumber == -1) { sourceName = "<eval>"; } else { sourceName = "<stdin>"; } } else { w = getFileWindow(sourceName); } if(e instanceof NativeJavaObject) { e = ((NativeJavaObject)e).unwrap(); } String msg = e.toString(); if(msg == null || msg.length() == 0) { msg = e.getClass().toString(); } msg += " (" + sourceName + ", line " + lineNumber + ")"; if(w != null) { swingInvoke(new SetFilePosition(this, w, lineNumber)); } MessageDialogWrapper.showMessageDialog(this, msg, "Exception in Script", JOptionPane.ERROR_MESSAGE); //if(w != null) { //swingInvoke(new SetFilePosition(this, w, -1)); //} interrupted(cx); } } | 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,
1071,
918,
20879,
29591,
12,
1042,
9494,
16,
1033,
425,
13,
288,
3639,
309,
12,
8820,
1398,
11416,
13,
288,
5411,
4015,
8455,
4410,
4073,
273,
9494,
18,
588,
2829,
8455,
4410,
5621,
5411,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
20879,
29591,
12,
1042,
9494,
16,
1033,
425,
13,
288,
3639,
309,
12,
8820,
1398,
11416,
13,
288,
5411,
4015,
8455,
4410,
4073,
273,
9494,
18,
588,
2829,
8455,
4410,
5621,
5411,... | ||
bindColumn(grailsProp, column); | bindColumn(grailsProp, column, table); | private static void bindSimpleValue(GrailsDomainClassProperty grailsProp, SimpleValue simpleValue,Mappings mappings) { // set type simpleValue.setTypeName(grailsProp.getType().getName()); Table table = simpleValue.getTable(); Column column = new Column(); if(grailsProp.isManyToOne()) column.setNullable(false); column.setValue(simpleValue); bindColumn(grailsProp, column); if(table != null) table.addColumn(column); simpleValue.addColumn(column); } | 6460 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6460/6c47cbe485713fe8d2b500632651590033abed59/GrailsDomainBinder.java/clean/src/persistence/org/codehaus/groovy/grails/orm/hibernate/cfg/GrailsDomainBinder.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
760,
918,
1993,
5784,
620,
12,
14571,
14573,
3748,
797,
1396,
3087,
14573,
4658,
16,
4477,
620,
4143,
620,
16,
7742,
7990,
13,
288,
202,
202,
759,
444,
618,
202,
202,
9647,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
760,
918,
1993,
5784,
620,
12,
14571,
14573,
3748,
797,
1396,
3087,
14573,
4658,
16,
4477,
620,
4143,
620,
16,
7742,
7990,
13,
288,
202,
202,
759,
444,
618,
202,
202,
9647,
6... |
if (isAlwaysShowPlus(descriptor)) return; Object element = descriptor.getElement(); if (myTreeStructure.isToBuildChildrenInBackground(element)) return; Object[] children = myTreeStructure.getChildElements(descriptor.getElement()); if (children.length == 0) { for (int i = 0; i < node.getChildCount(); i++) { if (node.getChildAt(i) instanceof LoadingNode) { myTreeModel.removeNodeFromParent((MutableTreeNode)node.getChildAt(i)); break; } } myUnbuiltNodes.remove(node); } | processUnbuilt(node, descriptor); | private void updateNodeChildren(final DefaultMutableTreeNode node) { myTreeStructure.commit(); boolean wasExpanded = myTree.isExpanded(new TreePath(node.getPath())); final boolean wasLeaf = node.getChildCount() == 0; final NodeDescriptor descriptor = (NodeDescriptor)node.getUserObject(); if (descriptor == null) return; if (myUnbuiltNodes.contains(node)) { if (isAlwaysShowPlus(descriptor)) return; // check for isAlwaysShowPlus is important for e.g. changing Show Members state! Object element = descriptor.getElement(); if (myTreeStructure.isToBuildChildrenInBackground(element)) return; //? Object[] children = myTreeStructure.getChildElements(descriptor.getElement()); if (children.length == 0) { for (int i = 0; i < node.getChildCount(); i++) { if (node.getChildAt(i) instanceof LoadingNode) { myTreeModel.removeNodeFromParent((MutableTreeNode)node.getChildAt(i)); break; } } myUnbuiltNodes.remove(node); } return; } Object element = descriptor.getElement(); if (myTreeStructure.isToBuildChildrenInBackground(element)) { Runnable updateRunnable = new Runnable() { public void run() { descriptor.update(); Object element = descriptor.getElement(); if (element == null) return; myTreeStructure.getChildElements(element); // load children } }; Runnable postRunnable = new Runnable() { public void run() { descriptor.update(); Object element = descriptor.getElement(); if (element != null) { myUnbuiltNodes.remove(node); myUpdater.addSubtreeToUpdateByElement(element); myUpdater.performUpdate(); for (int i = 0; i < node.getChildCount(); i++) { TreeNode child = node.getChildAt(i); if (child instanceof LoadingNode) { if (TreeBuilderUtil.isNodeOrChildSelected(myTree, node)) { myTree.addSelectionPath(new TreePath(myTreeModel.getPathToRoot(node))); } myTreeModel.removeNodeFromParent((MutableTreeNode)child); break; } } } } }; String text = " searching..."; for (int i = 0; i < node.getChildCount(); i++) { TreeNode child = node.getChildAt(i); if (child instanceof LoadingNode && text.equals(((LoadingNode)child).getUserObject())) { return; } } LoadingNode loadingNode = new LoadingNode(text); myTreeModel.insertNodeInto(loadingNode, node, node.getChildCount()); // 2 loading nodes - only one will be removed addTaskToWorker(updateRunnable, true, postRunnable); return; } Object[] children = myTreeStructure.getChildElements(descriptor.getElement()); Map<Object,Integer> elementToIndexMap = new LinkedHashMap<Object, Integer>(); for (int i = 0; i < children.length; i++) { Object child = children[i]; elementToIndexMap.put(child, new Integer(i)); } ArrayList<TreeNode> childNodes = TreeUtil.childrenToArray(node); for (int i = 0; i < childNodes.size(); i++) { DefaultMutableTreeNode childNode = (DefaultMutableTreeNode)childNodes.get(i); if (childNode instanceof LoadingNode) continue; NodeDescriptor childDescr = (NodeDescriptor)childNode.getUserObject(); if (childDescr == null) { boolean isInMap = myElementToNodeMap.containsValue(childNode); LOG.error("childDescr == null, builder=" + this + ", childNode=" + childNode.getClass() + ", isInMap = " + isInMap + ", node = " + node); continue; } Object oldElement = childDescr.getElement(); if (oldElement == null){ LOG.error("oldElement == null, builder=" + this + ", childDescr=" + childDescr); continue; } boolean changes = childDescr.update(); Object newElement = childDescr.getElement(); Integer index = newElement != null ? elementToIndexMap.get(newElement) : null; if (index != null) { if (childDescr.getIndex() != index.intValue()) { changes = true; } childDescr.setIndex(index.intValue()); } if (newElement != null && changes) { updateNodeImageAndPosition(childNode); } if (!oldElement.equals(newElement)) { removeMapping(oldElement, childNode); if (newElement != null) { createMapping(newElement, childNode); } } if (index == null) { int selectedIndex = -1; if (TreeBuilderUtil.isNodeOrChildSelected(myTree, childNode)) { selectedIndex = node.getIndex(childNode); } myTreeModel.removeNodeFromParent(childNode); disposeNode(childNode); if (selectedIndex >= 0) { if (node.getChildCount() > 0) { if (node.getChildCount() > selectedIndex) { TreeNode newChildNode = node.getChildAt(selectedIndex); myTree.addSelectionPath(new TreePath(myTreeModel.getPathToRoot(newChildNode))); } else { TreeNode newChild = node.getChildAt(node.getChildCount() - 1); myTree.addSelectionPath(new TreePath(myTreeModel.getPathToRoot(newChild))); } } else { myTree.addSelectionPath(new TreePath(myTreeModel.getPathToRoot(node))); } } } else { elementToIndexMap.remove(newElement); updateNodeChildren(childNode); } if (node.equals(myRootNode)) { myTreeModel.nodeChanged(myRootNode); } } ArrayList<TreeNode> nodesToInsert = new ArrayList<TreeNode>(); for (Iterator<Object> iterator = elementToIndexMap.keySet().iterator(); iterator.hasNext();) { Object child = iterator.next(); Integer index = elementToIndexMap.get(child); final NodeDescriptor childDescr = myTreeStructure.createDescriptor(child, descriptor); if (childDescr == null) { LOG.error("childDescr == null, treeStructure = " + myTreeStructure + ", child = " + child); continue; } childDescr.setIndex(index.intValue()); childDescr.update(); if (childDescr.getElement() == null) { LOG.error("childDescr.getElement() == null, child = " + child + ", builder = " + this); continue; } final DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(childDescr); nodesToInsert.add(childNode); createMapping(child, childNode); } insertNodesInto(nodesToInsert, node); for (int i = 0; i < nodesToInsert.size(); i++) { DefaultMutableTreeNode childNode = (DefaultMutableTreeNode)nodesToInsert.get(i); addLoadingNode(childNode); updateNodeChildren(childNode); } if (wasExpanded) { myTree.expandPath(new TreePath(node.getPath())); } if (wasExpanded || wasLeaf) { final Alarm alarm = new Alarm(Alarm.ThreadToUse.SHARED_THREAD); alarm.addRequest( new Runnable() { public void run() { myTree.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); } }, WAIT_CURSOR_DELAY ); if (wasLeaf && isAutoExpandNode(descriptor)) { myTree.expandPath(new TreePath(node.getPath())); } ArrayList<TreeNode> nodes = TreeUtil.childrenToArray(node); for (int i = 0; i < nodes.size(); i++) { DefaultMutableTreeNode childNode = (DefaultMutableTreeNode)nodes.get(i); if (childNode instanceof LoadingNode) continue; NodeDescriptor childDescr = (NodeDescriptor)childNode.getUserObject(); if (isAutoExpandNode(childDescr)) { myTree.expandPath(new TreePath(childNode.getPath())); } } int n = alarm.cancelAllRequests(); if (n == 0) { myTree.setCursor(Cursor.getDefaultCursor()); } } } | 17306 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/17306/100def6e9fe26bba3206e24fd68301c8585501e0/AbstractTreeBuilder.java/buggy/source/com/intellij/ide/util/treeView/AbstractTreeBuilder.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
3238,
918,
1089,
907,
4212,
12,
6385,
2989,
19536,
12513,
756,
13,
288,
565,
3399,
2471,
6999,
18,
7371,
5621,
565,
1250,
1703,
17957,
273,
3399,
2471,
18,
291,
17957,
12,
2704,
4902,
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,
1089,
907,
4212,
12,
6385,
2989,
19536,
12513,
756,
13,
288,
565,
3399,
2471,
6999,
18,
7371,
5621,
565,
1250,
1703,
17957,
273,
3399,
2471,
18,
291,
17957,
12,
2704,
4902,
743... |
_nsNamesArray = (String[])in.readObject(); | _uriArray = (String[])in.readObject(); | public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { _treeNodeLimit = in.readInt(); _type = (short[])in.readObject(); _namespace = (short[])in.readObject(); _parent = (int[])in.readObject(); _nextSibling = (int[])in.readObject(); _offsetOrChild = (int[])in.readObject(); _lengthOrAttr = (int[])in.readObject(); _text = (char[])in.readObject(); _namesArray = (String[])in.readObject(); _nsNamesArray = (String[])in.readObject(); _whitespace = (BitArray)in.readObject(); _types = setupMapping(_namesArray); } | 2723 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2723/b49d8887b2fd85f8d0792533d90234dfe84e004b/DOMImpl.java/buggy/src/org/apache/xalan/xsltc/dom/DOMImpl.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
855,
6841,
12,
921,
1210,
316,
13,
202,
15069,
1860,
16,
10403,
288,
202,
67,
3413,
907,
3039,
273,
316,
18,
896,
1702,
5621,
202,
67,
723,
1850,
273,
261,
6620,
63,
5717,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
855,
6841,
12,
921,
1210,
316,
13,
202,
15069,
1860,
16,
10403,
288,
202,
67,
3413,
907,
3039,
273,
316,
18,
896,
1702,
5621,
202,
67,
723,
1850,
273,
261,
6620,
63,
5717,
... |
private void openEditor(IEditorInput input, String editorId, String perspectiveId) { if (getWorkbenchWindowCount() == 0) { // Something is wrong, there should be at least // one workbench window open by now. return; } IWorkbenchWindow win = null; if(perspectiveId == null) { win = getActiveWorkbenchWindow(); } else { IContainer root = WorkbenchPlugin.getPluginWorkspace().getRoot(); try { win = openWorkbenchWindow(perspectiveId,root); } catch (WorkbenchException e) { if (WorkbenchPlugin.DEBUG) // only report ini problems if the -debug command line argument is used WorkbenchPlugin.log("Error opening window in Workbench.openEditor(..)"); return; } } if (win == null) win = getWorkbenchWindows()[0]; WorkbenchPage page = (WorkbenchPage)win.getActivePage(); String id = perspectiveId; if (id == null) id = WorkbenchPlugin.getDefault().getPerspectiveRegistry().getDefaultPerspective(); if (page == null) { // Create the page. try { IContainer root = WorkbenchPlugin.getPluginWorkspace().getRoot(); page = (WorkbenchPage)getActiveWorkbenchWindow().openPage(id, root); } catch (WorkbenchException e) { ErrorDialog.openError( win.getShell(), WorkbenchMessages.getString("Problems_Opening_Page"), //$NON-NLS-1$ e.getMessage(), e.getStatus()); } } if (page == null) return; if (page.getActivePerspective() == null) { try { page = (WorkbenchPage)showPerspective(id, win); } catch (WorkbenchException e) { IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 1, WorkbenchMessages.getString("QuickStartAction.openEditorException"), e); //$NON-NLS-1$ ErrorDialog.openError( win.getShell(), WorkbenchMessages.getString("Workbench.openEditorErrorDialogTitle"), //$NON-NLS-1$ WorkbenchMessages.getString("Workbench.openEditorErrorDialogMessage"), //$NON-NLS-1$ status); return; } } page.setEditorAreaVisible(true); // see if we already have an editor IEditorPart editor = page.findEditor(input); if (editor != null) { page.activate(editor); return; } try { page.openEditor(input, editorId); } catch (PartInitException e) { IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 1, WorkbenchMessages.getString("QuickStartAction.openEditorException"), e); //$NON-NLS-1$ ErrorDialog.openError( win.getShell(), WorkbenchMessages.getString("Workbench.openEditorErrorDialogTitle"), //$NON-NLS-1$ WorkbenchMessages.getString("Workbench.openEditorErrorDialogMessage"), //$NON-NLS-1$ status); } return; } | 55805 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/55805/25425fe3505bc6f62e9021f3f79e33d77a752241/Workbench.java/buggy/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
1696,
6946,
12,
45,
6946,
1210,
810,
16,
514,
4858,
548,
16,
514,
26651,
548,
13,
288,
202,
202,
430,
261,
588,
2421,
22144,
3829,
1380,
1435,
422,
374,
13,
288,
1082,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1696,
6946,
12,
45,
6946,
1210,
810,
16,
514,
4858,
548,
16,
514,
26651,
548,
13,
288,
202,
202,
430,
261,
588,
2421,
22144,
3829,
1380,
1435,
422,
374,
13,
288,
1082,
... | ||
fw.close(); | public void actionPerformed(ActionEvent ae) { try { File f = new File(SETTINGS_FILE_NAME); FileWriter fw = new FileWriter(f); fw.write(codeEditorPane.getText()); fw.close(); } catch (IOException ioe) { } } | 45569 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45569/0aa87bb9947c772ffd4f06135ad65cc0879261ac/ASTViewer.java/clean/pmd/src/net/sourceforge/pmd/util/ASTViewer.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
540,
1071,
918,
26100,
12,
1803,
1133,
14221,
13,
288,
5411,
775,
288,
7734,
1387,
284,
273,
394,
1387,
12,
19428,
67,
3776,
67,
1985,
1769,
7734,
24639,
7600,
273,
394,
24639,
12,
74,
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,
540,
1071,
918,
26100,
12,
1803,
1133,
14221,
13,
288,
5411,
775,
288,
7734,
1387,
284,
273,
394,
1387,
12,
19428,
67,
3776,
67,
1985,
1769,
7734,
24639,
7600,
273,
394,
24639,
12,
74,
1769,
... | |
public Integer getDefaultGroup(CmsObject cms, CmsXmlLanguageFile lang, Vector names, Vector values, Hashtable parameters) throws CmsException { CmsRequestContext reqCont = cms.getRequestContext(); I_CmsSession session = cms.getRequestContext().getSession(true); String group = null; // Get a vector of all of the user's groups by asking the request context CmsGroup currentGroup = reqCont.currentUser().getDefaultGroup(); Vector allGroups = cms.getGroupsOfUser(reqCont.currentUser().getName()); // try to get an existing value for the default value Hashtable startSettings = null; startSettings = (Hashtable)session.getValue("STARTSETTINGS"); // if this fails, get the settings from the user obeject if(startSettings == null) { startSettings = (Hashtable)reqCont.currentUser().getAdditionalInfo(C_ADDITIONAL_INFO_STARTSETTINGS); } if(startSettings != null) { group = (String)startSettings.get(C_START_DEFAULTGROUP); } if(group == null) { group = currentGroup.getName(); } // Now loop through all groups and fill the result vectors int numGroups = allGroups.size(); int currentGroupNum = 0; for(int i = 0;i < numGroups;i++) { CmsGroup loopGroup = (CmsGroup)allGroups.elementAt(i); String loopGroupName = loopGroup.getName(); values.addElement(loopGroupName); names.addElement(loopGroupName); if(loopGroup.getName().equals(group)) { // Fine. The group of this loop is the user's current group. Save it! currentGroupNum = i; } } return new Integer(currentGroupNum); } | 51784 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51784/e4f91e520eaf4e85154410f66713717665141a5b/CmsPreferencesPanels.java/clean/src/com/opencms/workplace/CmsPreferencesPanels.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
2144,
4829,
1114,
12,
4747,
921,
6166,
16,
16084,
3779,
812,
3303,
16,
5589,
1257,
16,
2398,
5589,
924,
16,
18559,
1472,
13,
1216,
11228,
288,
3639,
2149,
21426,
1111,
660,
273,
616... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2144,
4829,
1114,
12,
4747,
921,
6166,
16,
16084,
3779,
812,
3303,
16,
5589,
1257,
16,
2398,
5589,
924,
16,
18559,
1472,
13,
1216,
11228,
288,
3639,
2149,
21426,
1111,
660,
273,
616... | ||
if( cls instanceof ICPPInternalBinding ){ IASTNode [] nds = ((ICPPInternalBinding)cls).getDeclarations(); if( nds != null && nds.length > 0 ) return nds[0]; | IASTNode node= ASTInternal.getPhysicalNodeOfScope(scope); if (node != null) { return node; | public IASTNode getPhysicalNode() throws DOMException { ICPPClassType cls = getOriginalClass(); ICPPClassScope scope = (ICPPClassScope)cls.getCompositeScope(); if( scope != null ) return scope.getPhysicalNode(); if( cls instanceof ICPPInternalBinding ){ IASTNode [] nds = ((ICPPInternalBinding)cls).getDeclarations(); if( nds != null && nds.length > 0 ) return nds[0]; } return null; } | 54911 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54911/f5a4ba1d7638b16bde80c2f1086c78aa03af1f90/CPPClassInstanceScope.java/buggy/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassInstanceScope.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
467,
9053,
907,
21735,
7046,
907,
1435,
1216,
4703,
503,
288,
202,
202,
2871,
6584,
18328,
2028,
273,
18354,
797,
5621,
202,
202,
2871,
6584,
797,
3876,
2146,
273,
261,
2871,
65... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
467,
9053,
907,
21735,
7046,
907,
1435,
1216,
4703,
503,
288,
202,
202,
2871,
6584,
18328,
2028,
273,
18354,
797,
5621,
202,
202,
2871,
6584,
797,
3876,
2146,
273,
261,
2871,
65... |
"expectedTypesSignatures=null\n" + "expectedTypesKeys=null", | "expectedTypesSignatures={Ljava.lang.Object;}\n" + "expectedTypesKeys={Ljava/lang/Object;}", | public void test0192() throws JavaModelException { CompletionResult result = complete( "/Completion/src3/test0192/Test.java", "package test0192;\n" + "class ZZClass1<X,Y> {\n" + "}\n" + "public class Test {\n" + " ZZClass1<\n" + "}", "ZZClass1<"); assertResults( "expectedTypesSignatures=null\n" + "expectedTypesKeys=null", result.context); assertResults( "ZZClass1<X,Y>[TYPE_REF]{, test0192, Ltest0192.ZZClass1<TX;TY;>;, null, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_EXACT_NAME+ R_UNQUALIFIED + + R_NON_RESTRICTED) + "}", result.proposals);} | 10698 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/10698/d100192f697f326dff66b368f9d71d16adde29e2/CompletionTests_1_5.java/clean/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1071,
918,
1842,
1611,
9975,
1435,
1216,
5110,
1488,
503,
288,
565,
20735,
1253,
563,
273,
3912,
12,
5411,
2206,
11238,
19,
4816,
23,
19,
3813,
1611,
9975,
19,
4709,
18,
6290,
3113,
5411,
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,
8585,
326,
22398,
316,
326,
981,
30,
1071,
918,
1842,
1611,
9975,
1435,
1216,
5110,
1488,
503,
288,
565,
20735,
1253,
563,
273,
3912,
12,
5411,
2206,
11238,
19,
4816,
23,
19,
3813,
1611,
9975,
19,
4709,
18,
6290,
3113,
5411,
315,... |
if (tool.buildsFileType(srcExt)) { return true; | try { switch (tool.getNatureFilter()) { case ITool.FILTER_C: if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) { return tool.buildsFileType(srcExt); } break; case ITool.FILTER_CC: if (project.hasNature(CCProjectNature.CC_NATURE_ID)) { return tool.buildsFileType(srcExt); } break; case ITool.FILTER_BOTH: return tool.buildsFileType(srcExt); } } catch (CoreException e) { continue; | public boolean buildsFileType(String srcExt) { // Check to see if there is a rule to build a file with this extension IConfiguration config = getDefaultConfiguration(getDefaultTarget()); ITool[] tools = config.getTools(); for (int index = 0; index < tools.length; index++) { ITool tool = tools[index]; if (tool.buildsFileType(srcExt)) { return true; } } return false; } | 6192 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6192/cc6084024dd2af4d5b3c4287f5e9fbae20d84a2a/ManagedBuildInfo.java/buggy/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1250,
10736,
28941,
12,
780,
1705,
2482,
13,
288,
202,
202,
759,
2073,
358,
2621,
309,
1915,
353,
279,
1720,
358,
1361,
279,
585,
598,
333,
2710,
202,
202,
45,
1750,
642,
273,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
1250,
10736,
28941,
12,
780,
1705,
2482,
13,
288,
202,
202,
759,
2073,
358,
2621,
309,
1915,
353,
279,
1720,
358,
1361,
279,
585,
598,
333,
2710,
202,
202,
45,
1750,
642,
273,... |
Query q1 = new Query("select table1.field1 from table1 where table1.field1 < table1.field2"); Query q2 = new Query(); | q1 = new Query("select table1.field1 from table1 where table1.field1 < table1.field2"); q2 = new Query(); | public void testWhereFieldLessThanField() throws Exception { Query q1 = new Query("select table1.field1 from table1 where table1.field1 < table1.field2"); Query q2 = new Query(); Table t1 = new Table("table1"); Field f1 = new Field("field1", t1); Field f2 = new Field("field2", t1); SelectValue sv1 = new SelectValue(f1, null); q2.addSelect(sv1); q2.addFrom(t1); q2.addWhere(new Constraint(f1, Constraint.LT, f2)); assertEquals(q2, q1); } | 29158 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/29158/a5e9331f55149bdc78aa8770ceaec1bc56d8e9dd/QueryTest.java/buggy/intermine/src/test/org/intermine/sql/query/QueryTest.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
5262,
974,
30899,
974,
1435,
1216,
1185,
288,
3639,
2770,
1043,
21,
273,
394,
2770,
2932,
4025,
1014,
21,
18,
1518,
21,
628,
1014,
21,
1625,
1014,
21,
18,
1518,
21,
411... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
918,
1842,
5262,
974,
30899,
974,
1435,
1216,
1185,
288,
3639,
2770,
1043,
21,
273,
394,
2770,
2932,
4025,
1014,
21,
18,
1518,
21,
628,
1014,
21,
1625,
1014,
21,
18,
1518,
21,
411... |
item.reindex(null, null); | item.reindex(null, deleteFirst, null); | synchronized public void reIndexItem(Mailbox mbox, int msgId, byte type) throws ServiceException { initAnalyzer(mbox); MailItem item = null; try { item = mbox.getItemById(null, msgId, type); ParsedMessage pm = null; if (item instanceof Message) { Message msg = (Message)item; // force the pm's received-date to be the correct one long msgDate = item.getDate(); pm = new ParsedMessage(msg.getMimeMessage(), msgDate, mbox.attachmentsIndexingEnabled()); // because of bug 8263, we sometimes have fragments that are incorrect: // check them here and correct them if necessary if (pm.getFragment().compareTo(msg.getFragment()) != 0) { mbox.reanalyze(msg.getId(), msg.getType(), pm); } item.reindex(null, pm); } else if (item.getType() == MailItem.TYPE_DOCUMENT || item.getType() == MailItem.TYPE_WIKI) { com.zimbra.cs.mailbox.Document doc = (com.zimbra.cs.mailbox.Document) item; try { byte[] buf = ByteUtil.getContent(doc.getRawDocument(), 0); ParsedDocument pd = new ParsedDocument(buf, doc.getDigest(), doc.getName(), doc.getContentType(), doc.getChangeDate()); item.reindex(null, pd); } catch (IOException ioe) { throw ServiceException.FAILURE("reIndexItem caught IOException", ioe); } } else { item.reindex(null, null); } } catch (java.lang.RuntimeException e) { throw ServiceException.FAILURE("Error re-indexing message "+msgId, e); } } | 6965 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6965/34e60d3b24566058ca0cac751af676e219debfbe/MailboxIndex.java/buggy/ZimbraServer/src/java/com/zimbra/cs/index/MailboxIndex.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3852,
1071,
918,
283,
1016,
1180,
12,
30239,
312,
2147,
16,
509,
1234,
548,
16,
1160,
618,
13,
1216,
16489,
565,
288,
3639,
1208,
12803,
12,
81,
2147,
1769,
7734,
11542,
1180,
761,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3852,
1071,
918,
283,
1016,
1180,
12,
30239,
312,
2147,
16,
509,
1234,
548,
16,
1160,
618,
13,
1216,
16489,
565,
288,
3639,
1208,
12803,
12,
81,
2147,
1769,
7734,
11542,
1180,
761,
273,
... |
int edgeLength = getEdgeLength(edge); int minimumEdgeLength = getMinimumEdgeLength(edge); if (edgeLength != minimumEdgeLength) | int slack = getSlack(edge); if (slack != 0) | protected boolean tightenEdge(Object edge, Set sourceSet, Set targetSet) { assert (sourceSet != targetSet); assert (sourceSet != null); assert (targetSet != null); int edgeLength = getEdgeLength(edge); int minimumEdgeLength = getMinimumEdgeLength(edge); if (edgeLength != minimumEdgeLength) { int sourceMove = 0; int targetMove = 0; int distance = edgeLength - minimumEdgeLength; if (distance < 0) { // Edge too short, try to move source set away to compensate sourceMove = Math.max(distance, getMaxRankMove(sourceSet, true)); targetMove = Math.min(sourceMove - distance, getMaxRankMove(targetSet, false)); } else { // Edge too long, try to move target set closer to compensate targetMove = Math.max(-distance, getMaxRankMove(targetSet, true)); sourceMove = Math.min(distance + targetMove, getMaxRankMove(sourceSet, false)); } if (sourceMove - targetMove != distance) { return false; } moveNodes(sourceSet, sourceMove); moveNodes(targetSet, targetMove); edgeLength = getEdgeLength(edge); // assert getEdgeLength(edge) == minimumEdgeLength : edge; } return true; } | 7616 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/7616/1b3622d98ec41573b97302b74e810698b477b3ba/GraphSpanningTree.java/buggy/trunk/taverna1.0/src/org/embl/ebi/escience/scuflui/graph/GraphSpanningTree.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
1250,
26066,
275,
6098,
12,
921,
3591,
16,
1000,
1084,
694,
16,
1000,
1018,
694,
13,
202,
95,
202,
202,
11231,
261,
3168,
694,
480,
1018,
694,
1769,
202,
202,
11231,
261,
316... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1117,
1250,
26066,
275,
6098,
12,
921,
3591,
16,
1000,
1084,
694,
16,
1000,
1018,
694,
13,
202,
95,
202,
202,
11231,
261,
3168,
694,
480,
1018,
694,
1769,
202,
202,
11231,
261,
316... |
if(null == countMatchPattern) | if (null == countMatchPattern) | XPath getCountMatchPattern(XPathContext support, Node contextNode) throws org.xml.sax.SAXException { XPath countMatchPattern = m_countMatchPattern; if(null == countMatchPattern) { switch( contextNode.getNodeType()) { case Node.ELEMENT_NODE: // countMatchPattern = m_stylesheet.createMatchPattern(contextNode.getNodeName(), this); countMatchPattern = new XPath(contextNode.getNodeName(), this, this, XPath.MATCH); break; case Node.ATTRIBUTE_NODE: // countMatchPattern = m_stylesheet.createMatchPattern("@"+contextNode.getNodeName(), this); countMatchPattern = new XPath("@"+contextNode.getNodeName(), this, this, XPath.MATCH); break; case Node.CDATA_SECTION_NODE: case Node.TEXT_NODE: // countMatchPattern = m_stylesheet.createMatchPattern("text()", this); countMatchPattern = new XPath("text()", this, this, XPath.MATCH); break; case Node.COMMENT_NODE: // countMatchPattern = m_stylesheet.createMatchPattern("comment()", this); countMatchPattern = new XPath("comment()", this, this, XPath.MATCH); break; case Node.DOCUMENT_NODE: // countMatchPattern = m_stylesheet.createMatchPattern("/", this); countMatchPattern = new XPath("/", this, this, XPath.MATCH); break; case Node.PROCESSING_INSTRUCTION_NODE: // countMatchPattern = m_stylesheet.createMatchPattern("pi("+contextNode.getNodeName()+")", this); countMatchPattern = new XPath("pi("+contextNode.getNodeName()+")", this, this, XPath.MATCH); break; default: countMatchPattern = null; } } return countMatchPattern; } | 2723 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2723/77ad973f1d6ad8f28fd358f2ba4d4c63da65d953/ElemNumber.java/buggy/src/org/apache/xalan/templates/ElemNumber.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
10172,
14155,
2060,
3234,
12,
14124,
1042,
2865,
16,
2029,
819,
907,
13,
565,
1216,
2358,
18,
2902,
18,
87,
651,
18,
55,
2501,
503,
225,
288,
565,
10172,
1056,
2060,
3234,
273,
312,
67,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
10172,
14155,
2060,
3234,
12,
14124,
1042,
2865,
16,
2029,
819,
907,
13,
565,
1216,
2358,
18,
2902,
18,
87,
651,
18,
55,
2501,
503,
225,
288,
565,
10172,
1056,
2060,
3234,
273,
312,
67,... |
public void statesIntoStringBuffer(int ic, int it, StringBuffer sb, boolean forDisplay){ statesIntoStringBuffer(ic,it,sb, forDisplay, true, true); | public void statesIntoStringBuffer(int ic, int it, StringBuffer sb, boolean forDisplay, boolean includeInapplicable, boolean includeUnassigned){ if (notInStorage(ic, it)) return; long s = getStateRaw(ic, it); statesIntoStringBufferCore(ic,s,sb, forDisplay, includeInapplicable, includeUnassigned); | public void statesIntoStringBuffer(int ic, int it, StringBuffer sb, boolean forDisplay){ statesIntoStringBuffer(ic,it,sb, forDisplay, true, true); } | 57538 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57538/1de61b890a5ad0ef33fb67069028ba79c44bce8f/CategoricalData.java/buggy/trunk/Mesquite Project/Source/mesquite/categ/lib/CategoricalData.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
5493,
5952,
780,
1892,
12,
474,
13579,
16,
509,
518,
16,
6674,
2393,
16,
1250,
364,
4236,
15329,
202,
202,
7992,
5952,
780,
1892,
12,
335,
16,
305,
16,
18366,
16,
364,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
918,
5493,
5952,
780,
1892,
12,
474,
13579,
16,
509,
518,
16,
6674,
2393,
16,
1250,
364,
4236,
15329,
202,
202,
7992,
5952,
780,
1892,
12,
335,
16,
305,
16,
18366,
16,
364,
... |
flags, "org.eclipse.mylar.tasklist", title, | flags, "org.eclipse.mylar.tasklist." + title, title, | public static void openUrl(String title, String tooltip, String url) { try { IWebBrowser b = null; int flags = 0; if (WorkbenchBrowserSupport.getInstance() .isInternalWebBrowserAvailable()) { flags = WorkbenchBrowserSupport.AS_EDITOR | WorkbenchBrowserSupport.LOCATION_BAR | WorkbenchBrowserSupport.NAVIGATION_BAR; } else { flags = WorkbenchBrowserSupport.AS_EXTERNAL | WorkbenchBrowserSupport.LOCATION_BAR | WorkbenchBrowserSupport.NAVIGATION_BAR; } b = WorkbenchBrowserSupport.getInstance().createBrowser( flags, "org.eclipse.mylar.tasklist", title, tooltip); b.openURL(new URL(url)); } catch (PartInitException e) { MessageDialog.openError( Display.getDefault().getActiveShell(), "Browser init error", "Browser could not be initiated"); } catch (MalformedURLException e) { MessageDialog.openError( Display.getDefault().getActiveShell(), "URL not found", "URL Could not be opened"); } } | 51151 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/51151/c61edd12b8ce1dce215ce819cee97e0434e54a1a/BugzillaUITools.java/buggy/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaUITools.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
760,
918,
1696,
1489,
12,
780,
2077,
16,
514,
11915,
16,
514,
880,
13,
288,
202,
202,
698,
288,
1082,
202,
45,
4079,
9132,
324,
273,
446,
31,
1082,
202,
474,
2943,
273,
374,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
760,
918,
1696,
1489,
12,
780,
2077,
16,
514,
11915,
16,
514,
880,
13,
288,
202,
202,
698,
288,
1082,
202,
45,
4079,
9132,
324,
273,
446,
31,
1082,
202,
474,
2943,
273,
374,... |
VM.sysWrite(right(decimal(d) + "[" + GPR_NAMES[R1] + "]", SOURCE_AREA_SIZE) + " | "); asm.writeLastInstruction(i); VM.sysWrite("\n"); | VM.sysWrite(right(decimal(d) + "[" + GPR_NAMES[R1] + "]", SOURCE_AREA_SIZE)); end(i); | final void RRD (int i, String op, byte R0, byte R1, int d) { VM.sysWrite(right(hex(i),6) + "| "); VM.sysWrite(right("", PREFIX_AREA_SIZE) + " "); VM.sysWrite( left(op, OP_AREA_SIZE)); VM.sysWrite(right(isFP(op)?FPR_NAMES[R0]:GPR_NAMES[R0] + " ", DEST_AREA_SIZE)); VM.sysWrite(right(decimal(d) + "[" + GPR_NAMES[R1] + "]", SOURCE_AREA_SIZE) + " | "); asm.writeLastInstruction(i); VM.sysWrite("\n"); } | 49871 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49871/29b10a8056b3781b5fe29732137068e962ff1954/VM_Lister.java/clean/rvm/src/vm/arch/intel/assembler/VM_Lister.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
727,
918,
534,
20403,
261,
474,
277,
16,
514,
1061,
16,
1160,
534,
20,
16,
1160,
534,
21,
16,
509,
302,
13,
288,
565,
8251,
18,
9499,
3067,
12,
4083,
12,
7118,
12,
77,
3631,
26,
13,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
727,
918,
534,
20403,
261,
474,
277,
16,
514,
1061,
16,
1160,
534,
20,
16,
1160,
534,
21,
16,
509,
302,
13,
288,
565,
8251,
18,
9499,
3067,
12,
4083,
12,
7118,
12,
77,
3631,
26,
13,... |
return descriptor.getDisplayName(); } | return descriptor.getDisplayName(); } | public String getDisplayName() { return descriptor.getDisplayName(); } | 56152 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/56152/1ccb6f8ddf35b3b40ebd3ebe3e7982aa947ec045/PropertySheetEntry.java/clean/bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheetEntry.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
22055,
1435,
288,
3639,
327,
4950,
18,
588,
20524,
5621,
565,
289,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
514,
22055,
1435,
288,
3639,
327,
4950,
18,
588,
20524,
5621,
565,
289,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
throw new UnknownCPUException("Unknown CPU type: '"+getCPUVendorID()+"'"); | throw new UnknownCPUException("Unknown CPU type: '"+getCPUVendorID()+ '\''); | public static CPUInfo getInfo() throws UnknownCPUException { if(!_nativeOk) throw new UnknownCPUException("Failed to read CPU information from the system. Please verify the existence of the jcpuid dll/so."); if(!isX86) throw new UnknownCPUException("Failed to read CPU information from the system. The CPUID instruction exists on x86 CPU's only"); if(getCPUVendorID().equals("AuthenticAMD")) return new AMDInfoImpl(); if(getCPUVendorID().equals("GenuineIntel")) return new IntelInfoImpl(); throw new UnknownCPUException("Unknown CPU type: '"+getCPUVendorID()+"'"); } | 50653 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50653/62fd59041864b4ed1f43adc676de6bfb5ea977f3/CPUID.java/buggy/src/freenet/support/CPUInformation/CPUID.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
760,
12154,
966,
17142,
1435,
1216,
9077,
15222,
503,
202,
95,
202,
202,
430,
12,
5,
67,
13635,
8809,
13,
1082,
202,
12849,
394,
9077,
15222,
503,
2932,
2925,
358,
855,
12154,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12154,
966,
17142,
1435,
1216,
9077,
15222,
503,
202,
95,
202,
202,
430,
12,
5,
67,
13635,
8809,
13,
1082,
202,
12849,
394,
9077,
15222,
503,
2932,
2925,
358,
855,
12154,
... |
handleEvent(SVNEventFactory.createLockEvent(path, SVNEventAction.UNLOCK_FAILED, null, null), | handleEvent(SVNEventFactory.createLockEvent(path, SVNEventAction.UNLOCK_FAILED, null, error.getMessage()), | public void handleUnlock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { if (error != null) { handleEvent(SVNEventFactory.createLockEvent(path, SVNEventAction.UNLOCK_FAILED, null, null), ISVNEventHandler.UNKNOWN); } else { handleEvent(SVNEventFactory.createLockEvent(path, SVNEventAction.UNLOCKED, null, error.getMessage()), ISVNEventHandler.UNKNOWN); } } | 2776 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/2776/1491f124f981924ec1c5d3ec1b6523808cc3f493/SVNWCClient.java/clean/javasvn/src/org/tmatesoft/svn/core/wc/SVNWCClient.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
2398,
1071,
918,
1640,
7087,
12,
780,
589,
16,
29537,
50,
2531,
2176,
16,
29537,
50,
14935,
555,
13,
1216,
29537,
50,
503,
288,
7734,
309,
261,
1636,
480,
446,
13,
288,
10792,
1640,
1133,
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,
2398,
1071,
918,
1640,
7087,
12,
780,
589,
16,
29537,
50,
2531,
2176,
16,
29537,
50,
14935,
555,
13,
1216,
29537,
50,
503,
288,
7734,
309,
261,
1636,
480,
446,
13,
288,
10792,
1640,
1133,
12... |
void setClipboardContent(int start, int length) throws SWTError { | void setClipboardContent(int start, int length, int clipboardType) throws SWTError { | void setClipboardContent(int start, int length) throws SWTError { RTFTransfer rtfTransfer = RTFTransfer.getInstance(); TextTransfer plainTextTransfer = TextTransfer.getInstance(); RTFWriter rtfWriter = new RTFWriter(start, length); TextWriter plainTextWriter = new TextWriter(start, length); String rtfText = getPlatformDelimitedText(rtfWriter); String plainText = getPlatformDelimitedText(plainTextWriter); clipboard.setContents( new String[]{rtfText, plainText}, new Transfer[]{rtfTransfer, plainTextTransfer});} | 12413 /local/tlutelli/issta_data/temp/all_java1context/java/2006_temp/2006/12413/69bc765c863b954d1086dd0eab4e02d8aa145d81/StyledText.java/clean/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
918,
11440,
3169,
3752,
1350,
12,
474,
787,
16,
509,
769,
13,
1216,
348,
8588,
668,
288,
202,
12185,
42,
5912,
436,
6632,
5912,
273,
13060,
42,
5912,
18,
588,
1442,
5621,
202,
1528,
5912,
73... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
918,
11440,
3169,
3752,
1350,
12,
474,
787,
16,
509,
769,
13,
1216,
348,
8588,
668,
288,
202,
12185,
42,
5912,
436,
6632,
5912,
273,
13060,
42,
5912,
18,
588,
1442,
5621,
202,
1528,
5912,
73... |
buf.append(String.valueOf((int) curr.charAt(k))); | if (k > 0) buf.append(' '); buf.append((int)curr.charAt(k)); | private void validateLineDelimiters(String contents) { if (fLegalLineDelimiters == null) { // collect all line delimiters in the document HashSet existingDelimiters= new HashSet(); for (int i= fDocument.getNumberOfLines() - 1; i >= 0; i-- ) { try { String curr= fDocument.getLineDelimiter(i); if (curr != null) { existingDelimiters.add(curr); } } catch (BadLocationException e) { JavaPlugin.log(e); } } if (existingDelimiters.isEmpty()) { return; // first insertion of a line delimiter: no test } fLegalLineDelimiters= existingDelimiters; } DefaultLineTracker tracker= new DefaultLineTracker(); tracker.set(contents); int lines= tracker.getNumberOfLines(); if (lines <= 1) return; for (int i= 0; i < lines; i++) { try { String curr= tracker.getLineDelimiter(i); if (curr != null && !fLegalLineDelimiters.contains(curr)) { StringBuffer buf= new StringBuffer("New line delimiter added to new code: "); //$NON-NLS-1$ for (int k= 0; k < curr.length(); k++) { buf.append(String.valueOf((int) curr.charAt(k))); } JavaPlugin.log(new Exception(buf.toString())); } } catch (BadLocationException e) { JavaPlugin.log(e); } } } | 9698 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/9698/a8cda78286ae7fe262a58830f9ea0f08ec4cdd21/DocumentAdapter.java/buggy/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/DocumentAdapter.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
1152,
918,
1954,
1670,
23531,
414,
12,
780,
2939,
13,
288,
202,
202,
430,
261,
74,
30697,
1670,
23531,
414,
422,
446,
13,
288,
1082,
202,
759,
3274,
777,
980,
18374,
316,
326,
1668... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1954,
1670,
23531,
414,
12,
780,
2939,
13,
288,
202,
202,
430,
261,
74,
30697,
1670,
23531,
414,
422,
446,
13,
288,
1082,
202,
759,
3274,
777,
980,
18374,
316,
326,
1668... |
synchronized(head_) { return head_.next == null; | synchronized (head_) { return head_.next == null; } | public boolean isEmpty() { synchronized(head_) { return head_.next == null; } } | 4082 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4082/a6a25004fd5e24a1bc5f053aa539d01dc2553fbf/BoundedLinkedQueue.java/buggy/src/java/org/logicalcobwebs/concurrent/BoundedLinkedQueue.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
1250,
2709,
1435,
288,
565,
3852,
12,
1978,
67,
13,
288,
1377,
327,
910,
27799,
4285,
422,
446,
31,
565,
289,
225,
289,
377,
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,
282,
1071,
1250,
2709,
1435,
288,
565,
3852,
12,
1978,
67,
13,
288,
1377,
327,
910,
27799,
4285,
422,
446,
31,
565,
289,
225,
289,
377,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
.getStationTable() .extractAll(stmt.executeQuery()); | .getStationTable() .extractAll(stmt.executeQuery()); | private Station[] executeGetStationsOfStatus(PreparedStatement stmt, int status, EventAccessOperations ev) throws SQLException { int evDbId; try { evDbId = eventTable.getDBId(ev); } catch(NotFound e) { GlobalExceptionHandler.handle("Extracting a dbid for an event returned not found when the event is known to be in the db! Zoinks!", e); return new Station[] {}; } stmt.setInt(1, evDbId); stmt.setInt(2, status); return chanTable.getSiteTable() .getStationTable() .extractAll(stmt.executeQuery()); } | 45996 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45996/57a76f303905e9c0df3def95f30e8943b0ff327c/JDBCEventChannelStatus.java/clean/src/edu/sc/seis/sod/database/waveform/JDBCEventChannelStatus.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
934,
367,
8526,
24673,
510,
1012,
951,
1482,
12,
29325,
3480,
16,
4766,
1171,
509,
1267,
16,
4766,
1171,
2587,
1862,
9343,
2113,
13,
5411,
1216,
6483,
288,
3639,
509,
2113,
4331,
54... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
934,
367,
8526,
24673,
510,
1012,
951,
1482,
12,
29325,
3480,
16,
4766,
1171,
509,
1267,
16,
4766,
1171,
2587,
1862,
9343,
2113,
13,
5411,
1216,
6483,
288,
3639,
509,
2113,
4331,
54... |
} | void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); // Create a document fragment to hold the name DocumentFragment fragment = doc.createDocumentFragment(); // Apply name to the fragment name.apply(stylesheet, mode, context, pos, len, fragment, null); // Use XPath string-value of fragment String nameValue = Expr.stringValue(fragment); String namespaceValue = null; if (namespace != null) { // Create a document fragment to hold the namespace fragment = doc.createDocumentFragment(); // Apply namespace to the fragment namespace.apply(stylesheet, mode, context, pos, len, fragment, null); // Use XPath string-value of fragment namespaceValue = Expr.stringValue(fragment); if (namespaceValue.length() == 0) { namespaceValue = null; } } String prefix = getPrefix(nameValue); if (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix)) { int ci = nameValue.indexOf(':'); nameValue = nameValue.substring(ci + 1); } else { // Namespace aliasing if (prefix == null) { prefix = "#default"; } String resultPrefix = (String) stylesheet.namespaceAliases.get(prefix); if (resultPrefix != null) { if ("#default".equals(resultPrefix)) { resultPrefix = null; } namespaceValue = source.lookupNamespaceURI(resultPrefix); } if (prefix == "#default") { prefix = null; } // Look up ordinary namespace for this prefix if (namespaceValue == null) { if (XMLConstants.XML_NS_PREFIX.equals(prefix)) { namespaceValue = XMLConstants.XML_NS_URI; } else { // Resolve namespace for this prefix namespaceValue = source.lookupNamespaceURI(prefix); } } /*if (prefix == null) { // Resolve prefix for this namespace prefix = parent.lookupPrefix(namespaceValue); if (prefix != null) { nameValue = prefix + ":" + nameValue; } }*/ } // Create element Element element = (namespaceValue != null) ? doc.createElementNS(namespaceValue, nameValue) : doc.createElement(nameValue); if (nextSibling != null) { parent.insertBefore(element, nextSibling); } else { parent.appendChild(element); } stylesheet.addNamespaceNodes(source, element, doc, elementExcludeResultPrefixes); if (uas != null) { StringTokenizer st = new StringTokenizer(uas, " "); while (st.hasMoreTokens()) { addAttributeSet(stylesheet, mode, context, pos, len, element, null, st.nextToken()); } } if (children != null) { children.apply(stylesheet, mode, context, pos, len, element, null); } if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } } | 50763 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50763/27e9978154ebcb2e4d9c4e05e11bf17d1b8e1ef5/ElementNode.java/buggy/core/src/classpath/gnu/gnu/xml/transform/ElementNode.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
918,
741,
7001,
12,
24656,
13820,
16,
16723,
1965,
16,
2398,
2029,
819,
16,
509,
949,
16,
509,
562,
16,
2398,
2029,
982,
16,
2029,
19419,
13,
565,
1216,
21684,
225,
288,
565,
4319,
997,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
918,
741,
7001,
12,
24656,
13820,
16,
16723,
1965,
16,
2398,
2029,
819,
16,
509,
949,
16,
509,
562,
16,
2398,
2029,
982,
16,
2029,
19419,
13,
565,
1216,
21684,
225,
288,
565,
4319,
997,... | |
byte breaks = BREAK; | byte breaks = Rule.BREAK; | RuleListBuilder addLine(String line) { // dumb parsing for now int relationPosition = line.indexOf('='); if (relationPosition >= 0) { addVariable(line.substring(0,relationPosition).trim(), line.substring(relationPosition+1).trim()); return this; } relationPosition = line.indexOf(')'); Float order; try { order = new Float(Float.parseFloat(line.substring(0,relationPosition).trim())); } catch (Exception e) { throw new IllegalArgumentException("Rule must be of form '1)...'"); } line = line.substring(relationPosition + 1).trim(); relationPosition = line.indexOf(''); byte breaks = BREAK; if (relationPosition < 0) { relationPosition = line.indexOf(''); if (relationPosition < 0) throw new IllegalArgumentException("Couldn't find =, , or "); breaks = NO_BREAK; } addRule(order, line.substring(0,relationPosition).trim(), breaks, line.substring(relationPosition + 1).trim()); return this; } | 27800 /local/tlutelli/issta_data/temp/all_java2context/java/2006_temp/2006/27800/5331ac57657f626f7a9d2c07f1242187b365b779/TestSegments.java/buggy/tools/java/org/unicode/cldr/test/TestSegments.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
3196,
202,
2175,
682,
1263,
26772,
12,
780,
980,
13,
288,
1082,
202,
759,
302,
3592,
5811,
364,
2037,
1082,
202,
474,
2533,
2555,
273,
980,
18,
31806,
2668,
2218,
1769,
1082,
202,
430,
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,
3196,
202,
2175,
682,
1263,
26772,
12,
780,
980,
13,
288,
1082,
202,
759,
302,
3592,
5811,
364,
2037,
1082,
202,
474,
2533,
2555,
273,
980,
18,
31806,
2668,
2218,
1769,
1082,
202,
430,
261,
... |
super (color); | public LineBorderUIResource(Color color) { } | 45163 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/45163/aa02dd93620b2e2adc36b239c79543906d0e6565/BorderUIResource.java/clean/libjava/javax/swing/plaf/BorderUIResource.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
9565,
261,
3266,
1769,
5377,
8107,
5370,
1420,
12,
12570,
416,
264,
261,
3266,
1769,
2036,
13,
202,
95,
202,
9565,
261,
3266,
1769,
2240,
261,
3266,
1769,
2240,
261,
3266,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
202,
482,
9565,
261,
3266,
1769,
5377,
8107,
5370,
1420,
12,
12570,
416,
264,
261,
3266,
1769,
2036,
13,
202,
95,
202,
9565,
261,
3266,
1769,
2240,
261,
3266,
1769,
2240,
261,
3266,
1769,... | |
omOutput.setCharSetEncoding(charSetEnc); | format.setCharSetEncoding(charSetEnc); | public synchronized void invoke(MessageContext msgContext) throws AxisFault { try { String charSetEnc = (String) msgContext.getProperty( MessageContext.CHARACTER_SET_ENCODING); if (charSetEnc != null) { omOutput.setCharSetEncoding(charSetEnc); } else { OperationContext opctx = msgContext.getOperationContext(); if (opctx != null) { charSetEnc = (String) opctx.getProperty(MessageContext.CHARACTER_SET_ENCODING); } } /** * If the char set enc is still not found use the default */ if (charSetEnc == null) { charSetEnc = MessageContext.DEFAULT_CHAR_SET_ENCODING; } msgContext.setDoingMTOM(HTTPTransportUtils.doWriteMTOM(msgContext)); omOutput.setSoap11(msgContext.isSOAP11()); omOutput.setDoOptimize(msgContext.isDoingMTOM()); omOutput.setCharSetEncoding(charSetEnc); // Trasnport URL can be different from the WSA-To. So processing that now. EndpointReference epr = null; String transportURL = (String) msgContext.getProperty(MessageContextConstants.TRANSPORT_URL); if (transportURL != null) { epr = new EndpointReference(transportURL); } else if (msgContext.getTo() != null && !AddressingConstants.Submission.WSA_ANONYMOUS_URL.equals( msgContext.getTo().getAddress()) && !AddressingConstants.Final.WSA_ANONYMOUS_URL.equals( msgContext.getTo().getAddress())) { epr = msgContext.getTo(); } //Check for the REST behaviour, if you desire rest beahaviour //put a <parameter name="doREST" value="true"/> at the // server.xml/client.xml file // ###################################################### //Change this place to change the wsa:toepr //epr = something // ###################################################### OMElement dataOut; /** * Figuringout the REST properties/parameters */ msgContext.setDoingREST(HTTPTransportUtils.isDoingREST(msgContext)); msgContext.setRestThroughPOST(HTTPTransportUtils.isDoingRESTThoughPost(msgContext)); boolean isRest = msgContext.isDoingREST(); if (isRest) { dataOut = msgContext.getEnvelope().getBody().getFirstElement(); } else { dataOut = msgContext.getEnvelope(); } //TODO timeout, configuration if (epr != null) { writeMessageWithCommons(msgContext, epr, dataOut); } else { OutputStream out = (OutputStream) msgContext.getProperty( MessageContext.TRANSPORT_OUT); if (msgContext.isServerSide()) { HTTPOutTransportInfo transportInfo = (HTTPOutTransportInfo) msgContext.getProperty( HTTPConstants.HTTPOutTransportInfo); if (transportInfo != null) { omOutput.setSoap11(msgContext.isSOAP11()); //this is the servlet2.3 way of setting encodings String contentType = findContentType(isRest, msgContext); String encoding = contentType + "; charset=" + omOutput.getCharSetEncoding(); transportInfo.setContentType(encoding); } else { throw new AxisFault(HTTPConstants.HTTPOutTransportInfo + " does not set"); } } omOutput.setOutputStream(out, msgContext.isDoingMTOM()); ((OMNodeEx)dataOut).serializeAndConsume(omOutput); omOutput.flush(); } if (msgContext.getOperationContext() != null) { msgContext.getOperationContext().setProperty( Constants.RESPONSE_WRITTEN, Constants.VALUE_TRUE); } } catch (XMLStreamException e) { throw new AxisFault(e); } catch (FactoryConfigurationError e) { throw new AxisFault(e); } catch (IOException e) { throw new AxisFault(e); } } | 49300 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/49300/34cdf78e77a599d494426811466cb28d9f27626a/CommonsHTTPTransportSender.java/clean/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
3852,
918,
4356,
12,
1079,
1042,
1234,
1042,
13,
1216,
15509,
7083,
288,
3639,
775,
288,
5411,
514,
1149,
694,
4280,
273,
10792,
261,
780,
13,
1234,
1042,
18,
588,
1396,
12,
18701,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
1071,
3852,
918,
4356,
12,
1079,
1042,
1234,
1042,
13,
1216,
15509,
7083,
288,
3639,
775,
288,
5411,
514,
1149,
694,
4280,
273,
10792,
261,
780,
13,
1234,
1042,
18,
588,
1396,
12,
18701,
... |
Vector inetAddresses = new Vector(netif.addresses); | Vector<InetAddress> inetAddresses = new Vector<InetAddress>(netif.addresses); | public Enumeration<InetAddress> getInetAddresses() { SecurityManager s = System.getSecurityManager(); Vector inetAddresses = new Vector(netif.addresses); if (s == null) return inetAddresses.elements(); Vector<InetAddress> tmpInetAddresses = new Vector<InetAddress>(1, 1); for (Enumeration<InetAddress> addresses = inetAddresses.elements(); addresses.hasMoreElements();) { InetAddress addr = addresses.nextElement(); try { s.checkConnect(addr.getHostAddress(), -1); tmpInetAddresses.add(addr); } catch (SecurityException e) { // Ignore. } } return tmpInetAddresses.elements(); } | 47947 /local/tlutelli/issta_data/temp/all_java4context/java/2006_temp/2006/47947/9b4f597b755f9a4a660b972e8994dc2ebbd7b4e9/NetworkInterface.java/buggy/java/net/NetworkInterface.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
13864,
32,
382,
278,
1887,
34,
7854,
278,
7148,
1435,
225,
288,
565,
6036,
1318,
272,
273,
2332,
18,
588,
4368,
1318,
5621,
565,
5589,
32,
382,
278,
1887,
34,
17661,
7148,
273,
39... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1071,
13864,
32,
382,
278,
1887,
34,
7854,
278,
7148,
1435,
225,
288,
565,
6036,
1318,
272,
273,
2332,
18,
588,
4368,
1318,
5621,
565,
5589,
32,
382,
278,
1887,
34,
17661,
7148,
273,
39... |
error(file, "unknown <attr> type: "+attr.getValue()); | error(name, file, "unknown <attr> type: " + attr.getValue()); | private void loadAttrs(InputStream attrsFile, String file) throws DocumentException { SAXReader reader = new SAXReader(); Document doc = reader.read(attrsFile); Element root = doc.getRootElement(); if (!root.getName().equals(E_ATTRS)) { error(file, "root tag is not " + E_ATTRS); return; } NEXT_ATTR: for (Iterator iter = root.elementIterator(); iter.hasNext();) { Element eattr = (Element) iter.next(); if (!eattr.getName().equals(E_ATTR)) { error(file, "unknown element: " + eattr.getName()); continue; } String canonicalName = null; AttributeCallback callback = null; AttributeType type = null; String value = null; long min = Long.MIN_VALUE; long max = Long.MAX_VALUE; boolean immutable = false; boolean ignore = false; int id = -1; AttributeCardinality cardinality = null; Set<AttributeClass> requiredIn = null; Set<AttributeClass> optionalIn = null; Set<AttributeFlag> flags = null; String name = null; for (Iterator attrIter = eattr.attributeIterator(); attrIter.hasNext();) { Attribute attr = (Attribute) attrIter.next(); String aname = attr.getName(); if (aname.equals(A_NAME)) { name = attr.getValue(); canonicalName = attr.getValue().toLowerCase(); } else if (aname.equals(A_CALLBACK)) { callback = loadCallback(attr.getValue()); } else if (aname.equals(A_IMMUTABLE)) { immutable = "1".equals(attr.getValue()); } else if (aname.equals(A_MAX)) { max = AttributeInfo.parseLong(attr.getValue(), Integer.MAX_VALUE); } else if (aname.equals(A_MIN)) { min = AttributeInfo.parseLong(attr.getValue(), Integer.MIN_VALUE); } else if (aname.equals(A_TYPE)) { type = AttributeType.getType(attr.getValue()); if (type == null) { error(file, "unknown <attr> type: "+attr.getValue()); continue NEXT_ATTR; } } else if (aname.equals(A_VALUE)) { value = attr.getValue(); } else if (aname.equals(A_ID)) { try { id = Integer.parseInt(attr.getValue()); } catch (NumberFormatException nfe) { error(file, aname + " is not a number: " + attr.getValue()); } } else if (aname.equals(A_CARDINALITY)) { try { cardinality = AttributeCardinality.valueOf(attr.getValue()); } catch (IllegalArgumentException iae) { error(file, aname + " is not valid: " + attr.getValue()); } } else if (aname.equals(A_REQUIRED_IN)) { requiredIn = parseClasses(file, name, attr.getValue()); } else if (aname.equals(A_OPTIONAL_IN)) { optionalIn = parseClasses(file, name, attr.getValue()); } else if (aname.equals(A_FLAGS)) { flags = parseFlags(file, name, attr.getValue()); } else { error(file, "unknown <attr> attr: "+aname); } } if (name == null) { error(file, "no name specified for attr"); continue; } List<String> globalConfigValues = new LinkedList<String>(); List<String> defaultCOSValues = new LinkedList<String>(); String description = null; for (Iterator elemIter = eattr.elementIterator(); elemIter.hasNext();) { Element elem = (Element)elemIter.next(); if (elem.getName().equals(E_GLOBAL_CONFIG_VALUE)) { globalConfigValues.add(elem.getText()); } else if (elem.getName().equals(E_DEFAULT_COS_VALUE)) { defaultCOSValues.add(elem.getText()); } else if (elem.getName().equals(E_DESCRIPTION)) { if (description != null) { error(file, "more than one description element for attr: " + name); } description = elem.getText(); } else { error(file, "unknown element: " + elem.getName() + " in attr: " + name); } } AttributeInfo info = new AttributeInfo(name, id, callback, type, value, immutable, min, max, cardinality, requiredIn, optionalIn, flags, globalConfigValues, defaultCOSValues); if (mAttrs.get(canonicalName) != null) { error(file, "duplicate attr definiton: " + name); } mAttrs.put(canonicalName, info); } } | 6965 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/6965/c6be06dfc6aefc19ca054243699c732e4d9b5a71/AttributeManager.java/clean/ZimbraServer/src/java/com/zimbra/cs/account/AttributeManager.java | [
1,
8585,
326,
22398,
316,
326,
981,
30,
377,
3238,
918,
1262,
8262,
12,
4348,
3422,
812,
16,
514,
585,
13,
1216,
4319,
503,
288,
3639,
10168,
2514,
2949,
273,
394,
10168,
2514,
5621,
3639,
4319,
997,
273,
2949,
18,
896,
12,
7039,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1262,
8262,
12,
4348,
3422,
812,
16,
514,
585,
13,
1216,
4319,
503,
288,
3639,
10168,
2514,
2949,
273,
394,
10168,
2514,
5621,
3639,
4319,
997,
273,
2949,
18,
896,
12,
7039,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.