nus-yam/ex-repair huggingface dataset:
Buggy code:
class OperationValidator { private final ManagementResourceRegistration root ; OperationValidator ( final ManagementResourceRegistration root ) { } void validateOperations ( final List < ModelNode > operations ) { } void validateOperation ( final ModelNode operation ) { } private Map < String , ModelNode > getDescribedRequestProperties ( final ModelNode description ) { } private Map < String , ModelNode > getActualRequestProperties ( final ModelNode operation ) { } private void checkActualOperationParamsAreDescribed ( final ModelNode description , final ModelNode operation , final Map < String , ModelNode > describedProperties , final Map < String , ModelNode > actualParams ) { } private void checkAllRequiredPropertiesArePresent ( final ModelNode description , final ModelNode operation , final Map < String , ModelNode > describedProperties , final Map < String , ModelNode > actualParams ) { } private void checkParameterTypes ( final ModelNode description , final ModelNode operation , final Map < String , ModelNode > describedProperties , final Map < String , ModelNode > actualParams ) { } private void checkRange ( final ModelNode operation , final String paramName , final ModelType modelType , final ModelNode describedProperty , final ModelNode value ) { } private void checkType ( final ModelType modelType , final ModelNode value ) { } private void checkList ( final ModelNode operation , final String paramName , final ModelType modelType , final ModelNode describedProperty , final ModelNode value ) { if ( ( describedProperty . get ( TYPE ) . asType ( ) ) == ( ModelType . LIST ) ) { <START_BUG> if ( describedProperty . hasDefined ( VALUE_TYPE ) ) { <END_BUG> ModelType elementType = describedProperty . get ( VALUE_TYPE ) . asType ( ) ; for ( ModelNode element : value . asList ( ) ) { try { checkType ( elementType , element ) ; } catch ( IllegalArgumentException e ) { Assert . fail ( ( ( ( ( paramName + "<seq2seq4repair_space>is<seq2seq4repair_space>expected<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>list<seq2seq4repair_space>of<seq2seq4repair_space>" ) + elementType ) + "<seq2seq4repair_space>" ) + operation ) ) ; } } } } } DescriptionProvider getDescriptionProvider ( final ModelNode operation ) { } static boolean hasAlternative ( final Set < String > keys , Collection < ModelNode > alternatives ) { } }

Fix:
if ( ( describedProperty . hasDefined ( VALUE_TYPE ) ) && ( ( describedProperty . get ( VALUE_TYPE ) . getType ( ) ) == ( ModelType . TYPE ) ) ) {
Buggy code:
public class UnitnHttpClient { private static final Logger logger = Logger . getLogger ( UnitnHttpClient . class . getName ( ) ) ; static String urlEvento ( int id , Date start , Date end ) { } static String urlDettaglioAttivita ( int id ) { } public static String placeFromDetails ( String line ) { final Pattern aulaPattern = Pattern . compile ( "\\s*Aula\\s*(.*)\\<seq2seq4repair_space>\\s*<br<seq2seq4repair_space>//>" ) ; final Matcher aulaMatcher = aulaPattern . matcher ( line ) ; if ( aulaMatcher . matches ( ) ) { <START_BUG> return aulaMatcher . group ( 1 ) ; <END_BUG> } else { final Pattern labPovoPattern = Pattern . compile ( "\\s*(LD\\<seq2seq4repair_space>.*)\\<seq2seq4repair_space>\\s*<br<seq2seq4repair_space>//>" ) ; final Matcher labPovoMatcher = labPovoPattern . matcher ( line ) ; if ( labPovoMatcher . matches ( ) ) { return labPovoMatcher . group ( 1 ) ; } else { final Pattern labMesianoPattern = Pattern . compile ( "\\s*(EALAB\\<seq2seq4repair_space>.*)\\<seq2seq4repair_space>\\s*<br<seq2seq4repair_space>//>" ) ; final Matcher labMesianoMatcher = labMesianoPattern . matcher ( line ) ; return labMesianoMatcher . matches ( ) ? labMesianoMatcher . group ( 1 ) : null ; } } } public static Pair < String , String > parsePlace ( String place ) { } public static Pair < String , String > parseTitle ( String title ) { } public static long saveAll ( Date start , Date end ) throws IOException { } }

Fix:
return aulaMatcher . group ( 1 ) . replace ( "(SALA<seq2seq4repair_space>CONFERENZE)<seq2seq4repair_space>" , "" ) ;
Buggy code:
public class User { private String name ; private int age ; private char sex ; private boolean isMarried ; private String location ; public User ( ) { } public User ( String name , int age , char sex , String location ) { } public String getName ( ) { } public void setName ( String name ) { } public int getAge ( ) { } public void setAge ( int age ) { } public char getSex ( ) { } public void setSex ( char sex ) { } public boolean isMarried ( ) { } public void setMarried ( boolean isMarried ) { } public String getLocation ( ) { } public void setLocation ( String location ) { } @ Override public String toString ( ) { <START_BUG> return ( ( ( ( ( ( ( ( ( "User<seq2seq4repair_space>[name=" + ( name ) ) + ",<seq2seq4repair_space>age=" ) + ( age ) ) + ",<seq2seq4repair_space>sex=" ) + ( sex ) ) + ",<seq2seq4repair_space>isMarried=" ) + ( isMarried ) ) + ",<seq2seq4repair_space>location=" ) + ( location ) ) + "]" ; <END_BUG> } }

Fix:
return ( ( ( ( ( ( ( ( ( ( ( System . currentTimeMillis ( ) ) + "User<seq2seq4repair_space>[name=" ) + ( name ) ) + ",<seq2seq4repair_space>age=" ) + ( age ) ) + ",<seq2seq4repair_space>sex=" ) + ( sex ) ) + ",<seq2seq4repair_space>isMarried=" ) + ( isMarried ) ) + ",<seq2seq4repair_space>location=" ) + ( location ) ) + "]" ;
Buggy code:
public class Mouse_move extends TranslatorBlock { public Mouse_move ( Long blockId , Translator translator , String codePrefix , String codeSuffix , String label ) { } public String toCode ( ) throws SocketNullException , SubroutineNotDeclaredException { String Xaxis ; String Yaxis ; TranslatorBlock translatorBlock = this . getRequiredTranslatorBlockAtSocket ( 0 ) ; Xaxis = translatorBlock . toCode ( ) ; translatorBlock = this . getRequiredTranslatorBlockAtSocket ( 1 ) ; Yaxis = translatorBlock . toCode ( ) ; translator . addSetupCommand ( "Mouse.begin();" ) ; <START_BUG> String ret = ( ( ( "Mouse.move(" + Xaxis ) + "," ) + Yaxis ) + ",O);\n" ; <END_BUG> return ret ; } }

Fix:
String ret = ( ( ( "Mouse.move(" + Xaxis ) + "," ) + Yaxis ) + ",0);\n" ;
Buggy code:
public class PerlParserUitl extends GeneratedParserUtilBase implements PerlElementTypes { public static PsiBuilder adapt_builder_ ( IElementType root , PsiBuilder builder , PsiParser parser , TokenSet [ ] extendsSets ) { } public static boolean parseCallParameters ( PsiBuilder b , int l ) { } public static boolean parseArrowSmart ( PsiBuilder b , int l ) { IElementType tokenType = b . getTokenType ( ) ; if ( ( b . getTokenType ( ) ) == ( PERL_DEREFERENCE ) ) { return consumeToken ( b , PERL_DEREFERENCE ) ; } else { assert b instanceof PerlBuilder ; PerlTokenData prevToken = ( ( PerlBuilder ) ( b ) ) . lookupToken ( ( - 1 ) ) ; IElementType prevTokenType = ( prevToken == null ) ? null : prevToken . getTokenType ( ) ; <START_BUG> if ( ( ( prevTokenType == ( PERL_RBRACE ) ) || ( prevTokenType == ( PERL_RBRACK ) ) ) && ( ( tokenType == ( PERL_LBRACE ) ) || ( tokenType == ( PERL_LBRACK ) ) ) ) <END_BUG> return true ; } return false ; } public static boolean parseExpressionLevel ( PsiBuilder b , int l , int g ) { } public static boolean parseSubPrototype ( PsiBuilder b , int l ) { } public static boolean parseSubAttributes ( PsiBuilder b , int l ) { } public static boolean parseSubSignature ( PsiBuilder b , int l ) { } public static boolean statementSemi ( PsiBuilder b , int l ) { } }

Fix:
if ( ( ( prevTokenType == ( PERL_RBRACE ) ) || ( prevTokenType == ( PERL_RBRACK ) ) ) && ( ( ( tokenType == ( PERL_LBRACE ) ) || ( tokenType == ( PERL_LBRACK ) ) ) || ( tokenType == ( PERL_LPAREN ) ) ) )
Buggy code:
public class BasicMarkov { SimpleMatrix transitionMatrix ; private static int matrixSize = ( Note . DURATIONMAX ) * ( Note . PITCHMAX ) ; public BasicMarkov ( ) { } public void train ( List < List < Note > > data ) { int [ ] counter = new int [ BasicMarkov . matrixSize ] ; int a = 0 ; int b = 0 ; for ( List < Note > song : data ) { Note prev = song . get ( 0 ) ; for ( int i = 1 ; i < ( song . size ( ) ) ; i ++ ) { a = prev . getmatrixPosition ( ) ; b = song . get ( i ) . getmatrixPosition ( ) ; <START_BUG> transitionMatrix . set ( b , a , transitionMatrix . get ( b , a ) ) ; <END_BUG> ( counter [ a ] ) ++ ; prev = song . get ( i ) ; } } for ( int i = 0 ; i < ( BasicMarkov . matrixSize ) ; i ++ ) { for ( int j = 0 ; j < ( BasicMarkov . matrixSize ) ; j ++ ) { if ( ( counter [ i ] ) == 0 ) { counter [ i ] = 1 ; } transitionMatrix . set ( i , j , ( ( transitionMatrix . get ( i , j ) ) // ( counter [ i ] ) ) ) ; } } } private Note getNote ( int matrixNumber ) { } public List < Note > generateSong ( int length ) { } public static void main ( String [ ] args ) { } }

Fix:
transitionMatrix . set ( b , a , ( ( transitionMatrix . get ( b , a ) ) + 1 ) ) ;
Buggy code:
public class PackageReferencePattern extends AndPattern { private static char [ ] [ ] TAGS = new char [ ] [ ] { IIndexConstants . REF } ; private char [ ] pkgName ; private char [ ] [ ] segments ; private int currentSegment ; private char [ ] decodedSegment ; public PackageReferencePattern ( char [ ] pkgName , int matchMode , boolean isCaseSensitive ) { } public void decodeIndexEntry ( IEntryResult entryResult ) { } public void feedIndexRequestor ( IIndexSearchRequestor requestor , int detailLevel , int [ ] references , IndexInput input , IJavaSearchScope scope ) throws IOException { } protected char [ ] [ ] getPossibleTags ( ) { } protected boolean hasNextQuery ( ) { } public char [ ] indexEntryPrefix ( ) { } protected int matchContainer ( ) { } private boolean matches ( char [ ] [ ] tokens ) { } protected boolean matchIndexEntry ( ) { } protected void matchReportReference ( AstNode reference , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { } protected void resetQuery ( ) { } public String toString ( ) { } public int matchLevel ( AstNode node , boolean resolve ) { } private int matchLevel ( ImportReference importRef , boolean resolve ) { } private int matchLevel ( QualifiedNameReference qNameRef , boolean resolve ) { } private int matchLevel ( QualifiedTypeReference typeRef , boolean resolve ) { if ( ! resolve ) { if ( ( this . pkgName ) == null ) { return this . needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH ; } else { switch ( this . matchMode ) { case EXACT_MATCH : case PREFIX_MATCH : if ( CharOperation . prefixEquals ( this . pkgName , CharOperation . concatWith ( typeRef . tokens , '.' ) , this . isCaseSensitive ) ) { return this . needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH ; } else { return IMPOSSIBLE_MATCH ; } case PATTERN_MATCH : char [ ] pattern = ( ( this . pkgName [ ( ( this . pkgName . length ) - 1 ) ] ) == '*' ) ? this . pkgName : CharOperation . concat ( this . pkgName , ".*" . toCharArray ( ) ) ; if ( CharOperation . match ( pattern , CharOperation . concatWith ( typeRef . tokens , '.' ) , this . isCaseSensitive ) ) { return this . needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH ; } else { return IMPOSSIBLE_MATCH ; } default : return IMPOSSIBLE_MATCH ; } } } else { TypeBinding typeBinding = typeRef . binding ; <START_BUG> if ( typeBinding == null ) { <END_BUG> return INACCURATE_MATCH ; } else { if ( typeBinding instanceof ArrayBinding ) { typeBinding = ( ( ArrayBinding ) ( typeBinding ) ) . leafComponentType ; } if ( typeBinding == null ) { return INACCURATE_MATCH ; } else if ( typeBinding instanceof ReferenceBinding ) { PackageBinding pkgBinding = ( ( ReferenceBinding ) ( typeBinding ) ) . fPackage ; if ( this . matches ( pkgBinding . compoundName ) ) { return ACCURATE_MATCH ; } else { return IMPOSSIBLE_MATCH ; } } else { return IMPOSSIBLE_MATCH ; } } } } }

Fix:
if ( ( typeBinding == null ) || ( typeBinding instanceof ProblemReferenceBinding ) ) {
Buggy code:
final class HttpServletRequestFacade implements HttpServletRequest { private static StringManager sm = StringManager . getManager ( "org.apache.tomcat.resources" ) ; private Request request ; HttpSessionFacade sessionFacade ; ServletInputStreamFacade isFacade = new ServletInputStreamFacade ( ) ; boolean isFacadeInitialized = false ; BufferedReader reader ; private boolean usingStream = false ; private boolean usingReader = false ; HttpServletRequestFacade ( Request request ) { } void recycle ( ) { } Request getRealRequest ( ) { } void setRequest ( Request req ) { } public Object getAttribute ( String name ) { } public Enumeration getAttributeNames ( ) { } public void setAttribute ( String name , Object value ) { } public void removeAttribute ( String name ) { } public String getCharacterEncoding ( ) { } public int getContentLength ( ) { } public String getContentType ( ) { } public Cookie [ ] getCookies ( ) { } public long getDateHeader ( String name ) { } public String getHeader ( String name ) { } public Enumeration getHeaders ( String name ) { } public Enumeration getHeaderNames ( ) { } public ServletInputStream getInputStream ( ) throws IOException { } public int getIntHeader ( String name ) throws NumberFormatException { } public String getMethod ( ) { } public String getParameter ( String name ) { } public String [ ] getParameterValues ( String name ) { } public Enumeration getParameterNames ( ) { } public String getPathInfo ( ) { } public String getPathTranslated ( ) { } public String getProtocol ( ) { } public String getQueryString ( ) { } public String getRemoteUser ( ) { } public String getScheme ( ) { } public String getServerName ( ) { <START_BUG> return request . getServerName ( ) ; <END_BUG> } public int getServerPort ( ) { } public BufferedReader getReader ( ) throws IOException { } public String getRemoteAddr ( ) { } public String getRemoteHost ( ) { } public String getRequestURI ( ) { } public RequestDispatcher getRequestDispatcher ( String path ) { } public Locale getLocale ( ) { } public Enumeration getLocales ( ) { } public String getContextPath ( ) { } public String getServletPath ( ) { } public String getRealPath ( String name ) { } public String getAuthType ( ) { } public boolean isSecure ( ) { } public boolean isUserInRole ( String role ) { } public Principal getUserPrincipal ( ) { } public HttpSession getSession ( ) { } public HttpSession getSession ( boolean create ) { } public String getRequestedSessionId ( ) { } public boolean isRequestedSessionIdValid ( ) { } public boolean isRequestedSessionIdFromCookie ( ) { } public boolean isRequestedSessionIdFromUrl ( ) { } public boolean isRequestedSessionIdFromURL ( ) { } }

Fix:
return request . serverName ( ) . toString ( ) ;
Buggy code:
public class ExceptionHandler { public static void process ( Throwable ex ) { } public static void log ( String message ) { } public static void process ( Throwable ex , Priority priority ) { CommonExceptionHandler . process ( ex , priority ) ; <START_BUG> if ( priority == ( Level . FATAL ) ) { <END_BUG> ExceptionService service = CommonsPlugin . getDefault ( ) . getExceptionService ( ) ; if ( service != null ) { service . showExceptionInMessgeBox ( ex ) ; } } } public static void processForSchemaImportXml ( Throwable ex ) { } }

Fix:
if ( ( priority == ( Level . FATAL ) ) && ( ! ( CommonsPlugin . isHeadless ( ) ) ) ) {
Buggy code:
public class PrefixHandler extends CommandHandlerWithHelp { private final ArgumentWithValue nodePath ; public PrefixHandler ( ) { } public PrefixHandler ( String command ) { } @ Override protected void doHandle ( CommandContext ctx ) { <START_BUG> final String nodePath = this . nodePath . getValue ( ctx . getParsedArguments ( ) ) ; <END_BUG> OperationRequestAddress prefix = ctx . getPrefix ( ) ; if ( nodePath == null ) { ctx . printLine ( ctx . getPrefixFormatter ( ) . format ( prefix ) ) ; return ; } OperationRequestParser . CallbackHandler handler = new org . jboss . as . cli . operation . impl . DefaultOperationCallbackHandler ( prefix ) ; try { ctx . getOperationRequestParser ( ) . parse ( ctx . getArgumentsString ( ) , handler ) ; } catch ( CommandFormatException e ) { ctx . printLine ( e . getLocalizedMessage ( ) ) ; } } }

Fix:
final String nodePath = this . nodePath . getValue ( ctx . getParsedCommandLine ( ) ) ;
Buggy code:
public abstract class AbstractViewSourceOnGitHubMenu extends AbstractMenu { @ Override protected String getConfiguredText ( ) { } @ Override protected void execAction ( ) throws ProcessingException { String canonicalName = provideSourceClass ( ) . getCanonicalName ( ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "https:////github.com//BSI-Business-Systems-Integration-AG//org.eclipsescout.demo//tree//" ) ; sb . append ( ConfigUtility . getProperty ( "git.branch" ) ) ; sb . append ( "//widgets//" ) ; if ( canonicalName . contains ( "widgets.client.old" ) ) { sb . append ( "org.eclipsescout.demo.widgets.client.old" ) ; } else { sb . append ( "org.eclipsescout.demo.widgets.client" ) ; } sb . append ( "//src//" ) ; sb . append ( canonicalName . replace ( "." , "//" ) ) ; sb . append ( ".java" ) ; <START_BUG> ClientSession . get ( ) . getDesktop ( ) . openUri ( sb . toString ( ) ) ; <END_BUG> } protected abstract Class < ? > provideSourceClass ( ) { } }

Fix:
ClientSession . get ( ) . getDesktop ( ) . openUri ( sb . toString ( ) , null ) ;
Buggy code:
public class RayoCPATest extends RayoBasedIntegrationTest { @ Test public void testBeep ( ) throws Exception { } @ Test public void testMultiplePossibleSignals ( ) throws Exception { } @ Test public void testSit ( ) throws Exception { } @ Test public void testFax ( ) throws Exception { } @ Test public void testMultipleIncomingEvents ( ) throws Exception { } @ Test public void testStop ( ) throws Exception { } @ Test public void testCpaWithMultipleGrammars ( ) throws Exception { } @ Test public void testSendDtmf ( ) throws Exception { } @ Test public void testInvalidDtmf ( ) throws Exception { } @ Test public void testDtmfSignal ( ) throws Exception { } @ Test public void testMultipleDtmfSignals ( ) throws Exception { } @ Test public void testMachineSpeech ( ) throws Exception { } @ Test public void testMaxTime ( ) throws Exception { } @ Test public void testHuman ( ) throws Exception { } private void beepTest ( String ... signals ) throws Exception { } @ Test public void testBadSignal ( ) throws Exception { } @ Test public void testSignalTermination ( ) throws Exception { } @ Test public void testMultipleSignalsTermination ( ) throws Exception { } @ Test public void testDtmfSignalTermination ( ) throws Exception { } @ Test public void testDtmfWithDtmfGrammarTermination ( ) throws Exception { String outgoingCallId = dial ( ) . getCallId ( ) ; String incomingCallId = getIncomingCall ( ) . getCallId ( ) ; assertNotNull ( incomingCallId ) ; rayoClient . answer ( incomingCallId ) ; waitForEvents ( 200 ) ; Input cpaInput = new Input ( ) ; CpaData cpaData = new CpaData ( "dtmf" ) ; cpaInput . setCpaData ( cpaData ) ; cpaInput . setMode ( DTMF ) ; Grammar grammar = rayoClient . new Grammar ( "[2<seq2seq4repair_space>DIGITS]" , "application//grammar+voxeo" ) ; rayoClient . input ( cpaInput , incomingCallId , grammar ) ; waitForEvents ( ) ; IQ result = rayoClient . dtmf ( "12" , outgoingCallId ) ; assertNotNull ( result ) ; assertTrue ( result . isResult ( ) ) ; waitForEvents ( 300 ) ; SignalEvent signal1 = assertReceived ( SignalEvent . class , incomingCallId ) ; assertTrue ( signal1 . getType ( ) . equalsIgnoreCase ( "dtmf" ) ) ; assertEquals ( signal1 . getTone ( ) , "1" ) ; assertNotReceived ( SignalEvent . class , incomingCallId ) ; InputCompleteEvent complete = assertReceived ( InputCompleteEvent . class , incomingCallId ) ; assertEquals ( complete . getReason ( ) , MATCH ) ; <START_BUG> assertEquals ( complete . getInterpretation ( ) , "dtmf-1<seq2seq4repair_space>dtmf-2" ) ; <END_BUG> } @ Test public void testHumanTermination ( ) throws Exception { } @ Test public void testMachineTermination ( ) throws Exception { } }

Fix:
assertEquals ( complete . getInterpretation ( ) , "12" ) ;
Buggy code:
public class MatrixIndexExceptionTest extends TestCase { public void testConstructorMessage ( ) { String msg = "message" ; <START_BUG> MatrixIndexException ex = new MatrixIndexException ( msg , null ) ; <END_BUG> assertEquals ( msg , ex . getMessage ( ) ) ; } }

Fix:
MatrixIndexException ex = new MatrixIndexException ( msg ) ;
Buggy code:
@ SuppressWarnings ( { "PMD.TooManyMethods" , "PMD.TooManyFields" , "PMD.CyclomaticComplexity" } ) public final class GameDisplay { private static Stage currentStage ; private static Scene currentScene ; private static BorderPane currentLayout ; private static Group renderGroup ; private static StepTimer currentTimer ; private static double endStepsSnapShot ; private static Game currentGame ; private static Canvas staticCanvas ; private static Canvas dynamicCanvas ; private static GraphicsContext staticContext ; private static GraphicsContext dynamicContext ; private static Label scoreLabel ; private static Label highScoreLabel ; private static Label levelLabel ; private static Label powerUpLabel ; private static String advanceLabel ; private static Long chiliTracker ; private static Long tacoTracker ; private static AnimationTimer animationTimer = new AnimationTimer ( ) { public void handle ( long currentNanoTime ) { } } ; private GameDisplay ( ) { } public static void createGame ( GameFactory factory , Stage passedStage ) { } private static void launchGame ( ) { } private static void prepareGame ( ) { } @ SuppressWarnings ( "PMD.AvoidDuplicateLiterals" ) private static void prepareInterfaceTop ( ) { } private static void prepareInterfaceBottom ( ) { } private static void mapStartStopButton ( final Button passedButton ) { } private static void mapSettingsButton ( Button passedButton , final Button startStopButton ) { } private static void mapExitButton ( Button passedButton ) { } private static void playerStatus ( ) { } public static void triggerChiliLabel ( ) { } public static void triggerTacoLabel ( ) { <START_BUG> GameDisplay . tacoTracker = 3000000000L ; <END_BUG> } private static void levelStatus ( ) { } private static void winDialog ( ) { } private static void prepareRenderer ( ) { } private static void renderStatic ( ) { } private static void renderDynamic ( ) { } private static void renderLevelElements ( List < LevelElement > elements , GraphicsContext context ) { } private static void removeSpacebarFunctionality ( ) { } }

Fix:
GameDisplay . tacoTracker = 2750000000L ;
Buggy code:
public class Model { public Model ( View view ) throws JAXBException { } private void loadPlugins ( ) { <START_BUG> pluginList = pluginLoader . loadPlugins ( ) ; <END_BUG> } public List < Sample > getSensordata ( String id , int time ) { } public void getTaggedSensors ( List < String > tags ) { } private View view ; private Collection < Sensor > sensor ; public Collection < Sensor > getSensor ( ) { } private Database datenbank ; public Database getDatenbank ( ) { } public void setDatenbank ( Database datenbank ) { } private Update update ; public Update getUpdate ( ) { } public void setUpdate ( Update update ) { } public void setSensor ( Collection < Sensor > sensor ) { } private PluginLoader pluginLoader = new vision . model . PluginLoader ( ) ; private List < Plugin > pluginList = Collections . EMPTY_LIST ; public List < Plugin > getPluginList ( ) { } public void setPluginList ( List < Plugin > pluginList ) { } private int getAllSensors ( ) { } private Groundplan groundplan ; public Groundplan getGroundplan ( ) { } public void setGroundplan ( Groundplan groundplan ) { } public View getView ( ) { } public void setView ( View view ) { } public PluginLoader getPluginLoader ( ) { } public void setPluginLoader ( PluginLoader pluginLoader ) { } public List < Geometry > getStaticGeometry ( ) { } }

Fix:
pluginList = pluginLoader . loadPlugins ( this , view ) ;
Buggy code:
public class TestGermanNormalizationFilter extends BaseTokenStreamTestCase { private Analyzer analyzer = new Analyzer ( ) { @ Override protected TokenStreamComponents createComponents ( String field , Reader reader ) { } } ; public void testBasicExamples ( ) throws IOException { } public void testUHeuristic ( ) throws IOException { } public void testSpecialFolding ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , analyzer , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testEmptyTerm ( ) throws IOException { } }

Fix:
checkRandomData ( random ( ) , analyzer , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class LoadLib extends AbstractTask { private boolean importAll ; private URL url ; public void setURL ( URL url ) throws ExecutionException { } public void setFile ( File file ) throws ExecutionException { } public void setDir ( File dir ) throws ExecutionException { } public void setImportAll ( boolean importAll ) { } public void validateComponent ( ) throws ExecutionException { } public void execute ( ) throws ExecutionException { <START_BUG> AntContext context = getContext ( ) ; <END_BUG> ComponentService componentService = ( ( ComponentService ) ( context . getCoreService ( ComponentService . class ) ) ) ; componentService . loadLib ( url . toString ( ) , importAll ) ; } private void checkNullURL ( ) throws ExecutionException { } }

Fix:
AntContext context = getAntContext ( ) ;
Buggy code:
public class CounterServlet extends ContextAwareServlet { private static final long serialVersionUID = 5963079326497177021L ; private static final Logger LOG = Logger . getLogger ( CounterServlet . class . getName ( ) ) ; private static final CounterService counterService = new CounterService ( ) ; @ Override protected void doPost ( ) throws IOException , ServletException { } @ Override protected void doGet ( ) throws IOException , ServletException { } public static void enqueue ( String name , Long index ) { long now = new Date ( ) . getTime ( ) ; Queue queue = QueueFactory . getQueue ( "counter" ) ; int seconds = 1 ; <START_BUG> TaskOptions options = Builder . withUrl ( "//counter" ) . taskName ( String . format ( "%s-%d-%d" , name , ( now // 30L ) , index . intValue ( ) ) ) . etaMillis ( ( now + ( seconds * 1000 ) ) ) . param ( "counterName" , name ) . param ( "index" , index . toString ( ) ) ; <END_BUG> options . method ( GET ) ; try { queue . add ( options ) ; } catch ( TransientFailureException ex ) { if ( CounterServlet . LOG . isLoggable ( Level . WARNING ) ) { CounterServlet . LOG . warning ( String . format ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>queue<seq2seq4repair_space>a<seq2seq4repair_space>message<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>[%s]<seq2seq4repair_space>-<seq2seq4repair_space>will<seq2seq4repair_space>retry<seq2seq4repair_space>it<seq2seq4repair_space>once" , ex . toString ( ) ) ) ; } try { queue . add ( options ) ; } catch ( TransientFailureException reEx ) { if ( CounterServlet . LOG . isLoggable ( Level . SEVERE ) ) { CounterServlet . LOG . log ( Level . SEVERE , String . format ( "Retry<seq2seq4repair_space>to<seq2seq4repair_space>insert<seq2seq4repair_space>into<seq2seq4repair_space>[%s]<seq2seq4repair_space>failed<seq2seq4repair_space>twice" , queue . getQueueName ( ) ) , reEx ) ; } } } } }

Fix:
TaskOptions options = Builder . withUrl ( "//counter" ) . taskName ( String . format ( "%s-%d-%d" , name , ( now // 30L ) , index . intValue ( ) ) ) . etaMillis ( ( now + ( seconds * 1000 ) ) ) . param ( "name" , name ) . param ( "index" , index . toString ( ) ) ;
Buggy code:
public class ArgumentsPanel extends AbstractConfigGui implements ActionListener { private static final long serialVersionUID = 240L ; private JLabel tableLabel ; private transient JTable table ; protected transient ObjectTableModel tableModel ; private JButton add ; private JButton delete ; private Color background ; private boolean standalone = true ; private JButton up ; private JButton down ; private static final String ADD = "add" ; private static final String DELETE = "delete" ; private static final String UP = "up" ; private static final String DOWN = "down" ; public static final String COLUMN_RESOURCE_NAMES_0 = "name" ; public static final String COLUMN_RESOURCE_NAMES_1 = "value" ; public ArgumentsPanel ( ) { } public ArgumentsPanel ( String label ) { } public ArgumentsPanel ( String label , Color bkg ) { } @ Override public Collection < String > getMenuCategories ( ) { } public String getLabelResource ( ) { } public TestElement createTestElement ( ) { } public void modifyTestElement ( TestElement args ) { } @ Override public void configure ( TestElement el ) { } protected JTable getTable ( ) { } protected JLabel getTableLabel ( ) { } protected JButton getDeleteButton ( ) { } protected JButton getAddButton ( ) { } protected void checkDeleteStatus ( ) { } @ Override public void clearGui ( ) { } public void clear ( ) { } public void actionPerformed ( ActionEvent e ) { } private void cancelEditing ( ) { } private void moveDown ( ) { cancelEditing ( ) ; int rowSelected = table . getSelectedRow ( ) ; <START_BUG> if ( rowSelected < ( ( table . getRowCount ( ) ) - 1 ) ) { <END_BUG> tableModel . moveRow ( rowSelected , ( rowSelected + 1 ) , ( rowSelected + 1 ) ) ; table . setRowSelectionInterval ( ( rowSelected + 1 ) , ( rowSelected + 1 ) ) ; } } private void moveUp ( ) { } protected void deleteArgument ( ) { } protected void addArgument ( ) { } protected Argument makeNewArgument ( ) { } protected void stopTableEditing ( ) { } protected void initializeTableModel ( ) { } public static boolean testFunctors ( ) { } protected void sizeColumns ( JTable _table ) { } private Component makeMainPanel ( ) { } protected Component makeLabelPanel ( ) { } private JPanel makeButtonPanel ( ) { } private void init ( ) { } }

Fix:
if ( ( rowSelected >= 0 ) && ( rowSelected < ( ( table . getRowCount ( ) ) - 1 ) ) ) {
Buggy code:
public class Files { private Files ( ) { } public static String basePath ( final String path , final String extension ) { } public static String extension ( final String path ) { } public static String filename ( final String path ) { } public static boolean remove ( final File file ) { if ( ! ( file . delete ( ) ) ) { System . gc ( ) ; try { Thread . sleep ( 100 ) ; <START_BUG> } catch ( InterruptedException e ) { <END_BUG> } return file . delete ( ) ; } return true ; } public static final int writeTo ( final File file , final InputStream input ) throws IOException { } public static byte [ ] readBytes ( final File file ) throws IOException { } public static final int writeTo ( final File file , final InputStream input , final int bufSize ) throws IOException { } private static String FORBIDDEN_IN_NAME = "\"*//:<>?\\|," ; public static final String cleanupFilename ( final String filename ) { } public static void copy ( final File sourceFile , final File targetFile ) throws IOException { } }

Fix:
} catch ( InterruptedException ignored ) {
Buggy code:
public class GameScreen implements KeyInputManager . KeyListener , MouseInputManager . MouseListener , IScreen { public static final Color BackgroundColor = new Color ( 8 , 8 , 64 ) ; private SpacyClient spacyClient ; private Image background ; private Vector2f lastMousePos ; private Vector2f viewPort ; private SpriteSheet spriteSheet ; public GameScreen ( IScreen prevScreen , SpacyClient spacyClient ) { } @ Override public void init ( GameContainer gc ) { } @ Override public void update ( GameContainer gc , int delta ) { } @ Override public void draw ( GameContainer gc , Graphics g ) { } public void onDisconnect ( ) { } public void onRecv ( Object o ) { } public void onConnected ( ) { } @ Override public void onKeyDown ( int key ) { } @ Override public void onKeyUp ( int key ) { } @ Override public void onKeyPressed ( int key ) { } @ Override public void onButtonDown ( int button ) { } @ Override public void onButtonUp ( int button ) { } @ Override public void onButtonPressed ( int button ) { Vector2f pos = MouseInputManager . getInstance ( ) . getPosition ( ) ; SpacyClient . getInstance ( ) . getShip ( ) . rotateToMouse ( pos ) ; SpacyClient . getInstance ( ) . getClient ( ) . sendTCP ( new de . kryptondev . spacy . share . PlayerRotate ( instance . getShip ( ) . direction ) ) ; if ( button == 1 ) { SpacyClient . getInstance ( ) . getClient ( ) . sendTCP ( new Move ( true ) ) ; System . out . println ( "Start<seq2seq4repair_space>moving" ) ; } if ( button == 0 ) { Ship ship = instance . getShip ( ) ; <START_BUG> SpacyClient . getInstance ( ) . getClient ( ) . sendTCP ( new Projectile ( DamageType . balistic , ship . entityId , ship . direction , ship . position ) ) ; <END_BUG> } } }

Fix:
SpacyClient . getInstance ( ) . getClient ( ) . sendTCP ( new Projectile ( DamageType . balistic , ship . id , ship . direction , ship . position ) ) ;
Buggy code:
public class SalesCommissionActionController extends BaseController { private InvoiceService invoiceService ; private InvoiceExpenseService ieService ; public SalesCommissionActionController ( ) { } @ Override public Navigation run ( ) throws Exception { String [ ] invoiceKeys = paramValues ( "invoiceKey" ) ; String [ ] amts = paramValues ( "amt" ) ; String [ ] notes = paramValues ( "note" ) ; for ( int i = 0 ; i < ( invoiceKeys . length ) ; i ++ ) { System . out . println ( ( "index<seq2seq4repair_space>is<seq2seq4repair_space>" + i ) ) ; System . out . println ( ( "key<seq2seq4repair_space>is<seq2seq4repair_space>" + ( invoiceKeys [ i ] ) ) ) ; System . out . println ( ( "amount<seq2seq4repair_space>is<seq2seq4repair_space>" + ( amts [ i ] ) ) ) ; System . out . println ( ( "note<seq2seq4repair_space>is<seq2seq4repair_space>" + ( notes [ i ] ) ) ) ; if ( ! ( amts [ i ] . equals ( "0" ) ) ) { Key invoiceKey = Datastore . stringToKey ( invoiceKeys [ i ] ) ; Invoice invoice = invoiceService . get ( invoiceKey ) ; Double amt = Double . valueOf ( amts [ i ] ) ; InvoiceReport ir = invoice . getInvoiceReportRef ( ) . getModel ( ) ; ir . setSalesCommission ( amt ) ; invoiceService . saveInvoiceReport ( ir ) ; InvoiceExpense ie = new InvoiceExpense ( ) ; ie . setExpense ( amt ) ; ie . setNote ( notes [ i ] ) ; <START_BUG> ie . getInvoiceRef ( ) . setKey ( invoiceKey ) ; <END_BUG> ie . setForSalesCommission ( "on" ) ; ieService . save ( ie ) ; } } requestScope ( "msg" , "have<seq2seq4repair_space>successfully<seq2seq4repair_space>saved<seq2seq4repair_space>commissions" ) ; return forward ( "..//common//msg.jsp" ) ; } }

Fix:
ie . getInvoiceRef ( ) . setModel ( invoice ) ;
Buggy code:
public abstract class MatchingTask extends Task { protected boolean useDefaultExcludes = true ; protected FileSet fileset = new FileSet ( ) ; public void setDefaultexcludes ( boolean useDefaultExcludes ) { } public void setExcludes ( String excludes ) throws TaskException { } public void setExcludesfile ( File excludesfile ) throws TaskException { } public void setIncludes ( String includes ) throws TaskException { } public void setIncludesfile ( File includesfile ) throws TaskException { } public NameEntry createExclude ( ) throws TaskException { } public NameEntry createExcludesFile ( ) throws TaskException { } public NameEntry createInclude ( ) throws TaskException { } public NameEntry createIncludesFile ( ) throws TaskException { } public PatternSet createPatternSet ( ) throws TaskException { } protected DirectoryScanner getDirectoryScanner ( File baseDir ) throws TaskException { fileset . setDir ( baseDir ) ; fileset . setDefaultexcludes ( useDefaultExcludes ) ; <START_BUG> return fileset . getDirectoryScanner ( getProject ( ) ) ; <END_BUG> } }

Fix:
return fileset . getDirectoryScanner ( ) ;
Buggy code:
public class XpandComponent extends AbstractExpressionsUsingWorkflowComponent { private String _genPath = null ; private String _srcPath = null ; private String _expand = null ; private String _fileEncoding = null ; private boolean _automaticHyphens = false ; private Output _output = null ; private final List < Outlet > _outlets = new ArrayList < Outlet > ( ) ; private List < PostProcessor > _postprocessors = new ArrayList < PostProcessor > ( ) ; private List < Outlet > _initializedOutlets = new ArrayList < Outlet > ( ) ; private String _ignoreList ; private boolean _defaultExcludes ; private boolean _useBase64 ; public List < PostProcessor > getBeautifier ( ) { } public void addBeautifier ( PostProcessor beautifier ) { } public List < PostProcessor > getPostprocessors ( ) { } public void addPostprocessor ( PostProcessor postprocessor ) { } public void setAutomaticHyphens ( boolean automaticHyphens ) { } @ Override public String getLogMessage ( ) { } public void setFileEncoding ( final String fileEncoding ) { } public String getFileEncoding ( ) { } public void setExpand ( String invoke ) { } @ Deprecated public void setGenPath ( final String genPath ) { } @ Deprecated public void setSrcPath ( final String srcPath ) { } public void setIgnoreList ( String ignoreList ) { } public void setDefaultExcludes ( boolean defaultExcludes ) { } public void setUseBase64 ( boolean useBase64 ) { } private String fixPath ( final String p ) { } @ Override protected void invokeInternal2 ( WorkflowContext wfContext , ProgressMonitor monitor , Issues issues ) { } public void addOutlet ( Outlet outlet ) { } public void setOutput ( Output output ) { } private Output getOutput ( ) { } private List < Outlet > getInitializedOutlets ( ) { if ( _initializedOutlets . isEmpty ( ) ) { final List < Outlet > result = new ArrayList < Outlet > ( _outlets ) ; if ( result . isEmpty ( ) ) { if ( ( _genPath ) != null ) { result . add ( new Outlet ( false , _fileEncoding , null , true , _genPath ) ) ; result . add ( new Outlet ( true , _fileEncoding , "APPEND" , true , _genPath ) ) ; } if ( ( _srcPath ) != null ) result . add ( new Outlet ( false , _fileEncoding , "ONCE" , false , _srcPath ) ) ; } for ( Outlet o : result ) { if ( o . postprocessors . isEmpty ( ) ) for ( PostProcessor pp : _postprocessors ) o . addPostprocessor ( pp ) ; <START_BUG> if ( ( o . hasDefaultEncoding ( ) ) && ( ( _fileEncoding ) != null ) ) <END_BUG> o . setFileEncoding ( _fileEncoding ) ; } } return _initializedOutlets ; } private ExpandStatement getStatement ( ) { } @ Override public void checkConfigurationInternal ( final Issues issues ) { } }

Fix:
if ( ( _fileEncoding ) != null )
Buggy code:
public class ExternalToolsWizardLauncher { protected DataModel data ; protected ExternalToolsWizardModelListener listener ; public void launchWizard ( final String pluginID , boolean firstTime ) { final AbstractExternalToolsPlugin plugin ; IExtensionHandler handler = null ; try { <START_BUG> handler = PluginManager . getInstance ( ) . getHandler ( ORG_COLUMBA_CORE_EXTERNALTOOLS ) ; <END_BUG> } catch ( PluginHandlerNotFoundException e ) { e . printStackTrace ( ) ; } try { IExtension extension = handler . getExtension ( pluginID ) ; plugin = ( ( AbstractExternalToolsPlugin ) ( extension . instanciateExtension ( null ) ) ) ; } catch ( Exception e1 ) { e1 . printStackTrace ( ) ; return ; } data = new DataModel ( ) ; data . registerDataLookup ( "id" , new DataLookup ( ) { public Object lookupData ( ) { return pluginID ; } } ) ; data . registerDataLookup ( "Plugin" , new DataLookup ( ) { public Object lookupData ( ) { return plugin ; } } ) ; WizardModel model ; if ( firstTime ) { model = new net . javaprog . ui . wizard . DefaultWizardModel ( new Step [ ] { new DescriptionStep ( data ) , new LocationStep ( data ) } ) ; } else { model = new net . javaprog . ui . wizard . DefaultWizardModel ( new Step [ ] { new InfoStep ( ) , new DescriptionStep ( data ) , new LocationStep ( data ) } ) ; } listener = new ExternalToolsWizardModelListener ( data ) ; model . addWizardModelListener ( listener ) ; Wizard wizard = new Wizard ( model , "External<seq2seq4repair_space>Tools<seq2seq4repair_space>Configuration" , ImageLoader . getSmallIcon ( PREFERENCES ) ) ; wizard . setStepListRenderer ( null ) ; CSH . setHelpIDString ( wizard , "extending_columba_2" ) ; JavaHelpSupport . enableHelp ( wizard , HelpManager . getInstance ( ) . getHelpBroker ( ) ) ; wizard . pack ( ) ; wizard . setLocationRelativeTo ( null ) ; wizard . setVisible ( true ) ; } public boolean isFinished ( ) { } public DataModel getData ( ) { } }

Fix:
handler = PluginManager . getInstance ( ) . getExtensionHandler ( ORG_COLUMBA_CORE_EXTERNALTOOLS ) ;
Buggy code:
public final class Image extends Resource implements Drawable { public int type ; public int handle ; int transparentPixel = - 1 ; GC memGC ; byte [ ] alphaData ; int alpha = - 1 ; ImageData data ; int width = - 1 ; int height = - 1 ; static final int DEFAULT_SCANLINE_PAD = 4 ; Image ( ) { } public Image ( Device device , int width , int height ) { } public Image ( Device device , Image srcImage , int flag ) { } public Image ( Device device , Rectangle bounds ) { } public Image ( Device device , ImageData data ) { } public Image ( Device device , ImageData source , ImageData mask ) { } public Image ( Device device , InputStream stream ) { } public Image ( Device device , String filename ) { } int createDIBFromDDB ( int hDC , int hBitmap , int width , int height ) { } int [ ] createGdipImage ( ) { } public void dispose ( ) { } public boolean equals ( Object object ) { } public Color getBackground ( ) { } public Rectangle getBounds ( ) { } public ImageData getImageData ( ) { } public int hashCode ( ) { } void init ( Device device , int width , int height ) { } static int createDIB ( int width , int height , int depth ) { } static void GetIconInfo ( Image image , ICONINFO info ) { } static int [ ] init ( Device device , Image image , ImageData i ) { } static int [ ] init ( Device device , Image image , ImageData source , ImageData mask ) { } void init ( Device device , ImageData i ) { } public int internal_new_GC ( GCData data ) { if ( ( handle ) == 0 ) SWT . error ( ERROR_GRAPHIC_DISPOSED ) ; if ( ( ( type ) != ( SWT . BITMAP ) ) || ( ( memGC ) != null ) ) { SWT . error ( ERROR_INVALID_ARGUMENT ) ; } int hDC = device . internal_new_GC ( null ) ; int imageDC = OS . CreateCompatibleDC ( hDC ) ; device . internal_dispose_GC ( hDC , null ) ; if ( imageDC == 0 ) SWT . error ( ERROR_NO_HANDLES ) ; if ( data != null ) { int mask = ( SWT . LEFT_TO_RIGHT ) | ( SWT . RIGHT_TO_LEFT ) ; if ( ( ( data . style ) & mask ) != 0 ) { data . layout = ( ( ( data . style ) & ( SWT . RIGHT_TO_LEFT ) ) != 0 ) ? OS . LAYOUT_RTL : 0 ; } else { data . style |= SWT . LEFT_TO_RIGHT ; } data . device = device ; data . image = this ; <START_BUG> data . hFont = device . systemFont ; <END_BUG> } return imageDC ; } public void internal_dispose_GC ( int hDC , GCData data ) { } public boolean isDisposed ( ) { } public void setBackground ( Color color ) { } public String toString ( ) { } public static Image win32_new ( Device device , int type , int handle ) { } }

Fix:
data . font = device . systemFont ;
Buggy code:
public class Snippet156 { static BufferedImage convertToAWT ( ImageData data ) { } static ImageData convertToSWT ( BufferedImage bufferedImage ) { } static ImageData createSampleImage ( Display display ) { } public static void main ( String [ ] args ) { Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; shell . setText ( "SWT<seq2seq4repair_space>Image" ) ; ImageData data ; if ( ( args . length ) > 0 ) { String fileName = args [ 0 ] ; data = new ImageData ( fileName ) ; } else { data = Snippet156 . createSampleImage ( display ) ; } final Image swtImage = new Image ( display , data ) ; final BufferedImage awtImage = Snippet156 . convertToAWT ( data ) ; final Image swtImage2 = new Image ( display , Snippet156 . convertToSWT ( awtImage ) ) ; shell . addListener ( Paint , new Listener ( ) { public void handleEvent ( Event e ) { int y = 10 ; if ( swtImage != null ) { e . gc . drawImage ( swtImage , 10 , y ) ; y += ( swtImage . getBounds ( ) . height ) + 10 ; } if ( swtImage2 != null ) { e . gc . drawImage ( swtImage2 , 10 , y ) ; } } } ) ; Frame frame = new Frame ( ) { public void paint ( Graphics g ) { Insets insets = getInsets ( ) ; if ( awtImage != null ) { g . drawImage ( awtImage , ( 10 + ( insets . left ) ) , ( 10 + ( insets . top ) ) , null ) ; } } } ; frame . setTitle ( "AWT<seq2seq4repair_space>Image" ) ; shell . setLocation ( 50 , 50 ) ; Rectangle bounds = swtImage . getBounds ( ) ; shell . setSize ( ( ( bounds . width ) + 50 ) , ( ( ( bounds . height ) * 2 ) + 100 ) ) ; Point size = shell . getSize ( ) ; Point location = shell . getLocation ( ) ; Insets insets = frame . getInsets ( ) ; frame . setLocation ( ( ( ( location . x ) + ( size . x ) ) + 10 ) , location . y ) ; frame . setSize ( ( ( size . x ) - ( ( insets . left ) + ( insets . right ) ) ) , ( ( size . y ) - ( ( insets . top ) + ( insets . bottom ) ) ) ) ; frame . setVisible ( true ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } if ( swtImage != null ) swtImage . dispose ( ) ; if ( swtImage2 != null ) swtImage . dispose ( ) ; frame . dispose ( ) ; <START_BUG> System . exit ( 0 ) ; <END_BUG> } }

Fix:
display . dispose ( ) ;
Buggy code:
public class TextFileQuickSort { private final Comparator < String [ ] > sorter ; private int maxChunkSize = 100000000 ; private List < File > outputs = new ArrayList < > ( ) ; private String tempDirectory = "" ; private final String delimiter ; private final int [ ] colOrder ; private static final Logger log = Logger . getLogger ( TextFileQuickSort . class . getName ( ) ) ; private Path tempFile ; public TextFileQuickSort ( String delimiter , int [ ] colOrder , String tmpoutbase ) { } public TextFileQuickSort ( Comparator < String [ ] > sorter , String delimiter , int [ ] colOrder , String tmpoutbase ) { } public void setTempDirectory ( String temp ) { } public void setMaximumChunkSize ( int size ) { } public void splitChunks ( InputStream in , String identifier ) { } private void writeOut ( List < String [ ] > list , OutputStream os ) throws IOException { BufferedWriter writer = null ; try { writer = new BufferedWriter ( new OutputStreamWriter ( os ) ) ; for ( String [ ] s : list ) { writer . write ( StrArray . Join ( s , delimiter ) ) ; <START_BUG> writer . write ( "\n" ) ; <END_BUG> } writer . flush ( ) ; } catch ( IOException io ) { TextFileQuickSort . log . log ( Level . SEVERE , ( "[TXTFILESORT]<seq2seq4repair_space>Error<seq2seq4repair_space>writing<seq2seq4repair_space>to<seq2seq4repair_space>outputstream:<seq2seq4repair_space>" + ( os . toString ( ) ) ) , io ) ; } finally { if ( writer != null ) { try { writer . close ( ) ; } catch ( Exception e ) { } } } } public void mergeChunks ( ) throws IOException { } public Path getTemp ( ) { } private void createTemp ( Path path ) { } public class ComparatorDelegate implements Comparator < String [ ] > { private final int [ ] cols ; public ComparatorDelegate ( int [ ] cols ) { } @ Override public int compare ( String [ ] t , String [ ] t1 ) { } } private class StringWrapper implements Comparable < TextFileQuickSort . StringWrapper > { public final String [ ] string ; private final int [ ] cols ; public StringWrapper ( String [ ] line , int [ ] cols ) { } @ Override public int compareTo ( TextFileQuickSort . StringWrapper t ) { } } }

Fix:
writer . write ( System . lineSeparator ( ) ) ;
Buggy code:
public class ResourceReference implements Serializable { private Locale locale ; private final String name ; private transient Resource resource ; private final Class scope ; private String style ; public ResourceReference ( final Class scope , final String name ) { } public ResourceReference ( final String name ) { } public final void bind ( final Application application ) { } public final Locale getLocale ( ) { } public final String getName ( ) { } public final String getPath ( ) { final StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( "resources//" ) ; <START_BUG> buffer . append ( SharedResources . path ( scope , name , locale , style ) ) ; <END_BUG> return buffer . toString ( ) ; } public final Resource getResource ( ) { } public final Class getScope ( ) { } public final String getStyle ( ) { } public final void invalidate ( ) { } public final void setLocale ( Locale locale ) { } public final void setStyle ( String style ) { } public String toString ( ) { } protected Resource newResource ( ) { } }

Fix:
buffer . append ( SharedResources . path ( RequestCycle . get ( ) . getApplication ( ) , scope , name , locale , style ) ) ;