input
stringlengths
205
73.3k
output
stringlengths
64
73.2k
instruction
stringclasses
1 value
#vulnerable code @Generated("com.github.javaparser.generator.core.visitor.HashCodeVisitorGenerator") public Integer visit(final ConstructorDeclaration n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getModifiers().hashCode()) * 31 + (n.getName().accept(...
#fixed code @Generated("com.github.javaparser.generator.core.visitor.HashCodeVisitorGenerator") public Integer visit(final ConstructorDeclaration n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getModifiers().hashCode()) * 31 + (n.getName().accept(this, ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfInterfaceQualifiedSamePackage() throws IOException { File src = new File("src/test/resources/internalClassInInterface"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "b...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfInterfaceQualifiedSamePackage() throws IOException { File src = new File("src/test/resources/internalClassInInterface"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "bar" ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfInterfaceUnqualifiedDifferentPackage() throws IOException { File src = new File("src/test/resources/internalClassInInterface"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separat...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfInterfaceUnqualifiedDifferentPackage() throws IOException { File src = new File("src/test/resources/internalClassInInterface"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Override public SymbolReference<TypeDeclaration> solveType(String name, TypeSolver typeSolver) { return JavaParserFactory.getContext(wrappedNode.getParentNode(), typeSolver).solveType(name, typeSolver); } #location 3 ...
#fixed code @Override public SymbolReference<TypeDeclaration> solveType(String name, TypeSolver typeSolver) { return JavaParserFactory.getContext(getParentNode(wrappedNode), typeSolver).solveType(name, typeSolver); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Override public Optional<MethodUsage> solveMethodAsUsage(String name, List<TypeUsage> parameterTypes, TypeSolver typeSolver) { // TODO consider call of static methods if (wrappedNode.getScope() != null) { try { TypeUsage ...
#fixed code @Override public Optional<MethodUsage> solveMethodAsUsage(String name, List<TypeUsage> parameterTypes, TypeSolver typeSolver) { // TODO consider call of static methods if (wrappedNode.getScope() != null) { try { TypeUsage typeOf...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Override public SymbolReference<ResolvedTypeDeclaration> solveType(String name, TypeSolver typeSolver) { if (wrappedNode.getTypes() != null) { for (TypeDeclaration<?> type : wrappedNode.getTypes()) { if (type.getName().getId().eq...
#fixed code @Override public SymbolReference<ResolvedTypeDeclaration> solveType(String name, TypeSolver typeSolver) { if (wrappedNode.getTypes() != null) { for (TypeDeclaration<?> type : wrappedNode.getTypes()) { if (type.getName().getId().equals(n...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfInterfaceQualifiedDifferentPackage() throws IOException { File src = new File("src/test/resources/internalClassInInterface"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfInterfaceQualifiedDifferentPackage() throws IOException { File src = new File("src/test/resources/internalClassInInterface"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "ba...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void saveAll() throws FileNotFoundException, UnsupportedEncodingException { for (CompilationUnit cu : compilationUnits) { Path filename = cu.getData(ORIGINAL_LOCATION); System.out.println("Saving " + filename); filename...
#fixed code public void saveAll() throws FileNotFoundException, UnsupportedEncodingException { saveAll(root); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfClassUnqualifiedSamePackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + ...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfClassUnqualifiedSamePackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "bar" ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Override public SymbolReference<MethodDeclaration> solveMethod(String name, List<Type> parameterTypes) { return getContext().solveMethod(name, parameterTypes, typeSolver()); } #location 3 #vulnerability type NU...
#fixed code @Override public SymbolReference<MethodDeclaration> solveMethod(String name, List<Type> parameterTypes) { Context ctx = getContext(); return ctx.solveMethod(name, parameterTypes, typeSolver); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void solveMethodCalls(Path path) throws IOException { File file = path.toFile(); if (file.isDirectory()) { for (File f : file.listFiles()) { solveMethodCalls(f.toPath()); } } else { if (f...
#fixed code public void solveMethodCalls(Path path) throws IOException { Files.walkFileTree(path, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (file...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfInterfaceQualifiedSamePackage() throws IOException { File src = new File("src/test/resources/internalClassInInterface"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "b...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfInterfaceQualifiedSamePackage() throws IOException { File src = new File("src/test/resources/internalClassInInterface"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "bar" ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfClassQualifiedSamePackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "b...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfClassQualifiedSamePackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "bar" ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfInterfaceQualifiedDifferentPackage() throws IOException { File src = new File("src/test/resources/internalClassInInterface"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfInterfaceQualifiedDifferentPackage() throws IOException { File src = new File("src/test/resources/internalClassInInterface"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "ba...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Override public Type getType() { if (wrappedNode instanceof Parameter) { Parameter parameter = (Parameter) wrappedNode; if (wrappedNode.getParentNode() instanceof LambdaExpr) { int pos = getParamPos(parameter); ...
#fixed code @Override public Type getType() { if (wrappedNode instanceof Parameter) { Parameter parameter = (Parameter) wrappedNode; if (getParentNode(wrappedNode) instanceof LambdaExpr) { int pos = getParamPos(parameter); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Override public List<ReferenceTypeUsage> getAllAncestors() { List<ReferenceTypeUsage> ancestors = new LinkedList<>(); if (getSuperClass(typeSolver) != null) { ancestors.add(new ReferenceTypeUsage(getSuperClass(typeSolver), typeSolver)); ...
#fixed code @Override public List<ReferenceTypeUsage> getAllAncestors() { List<ReferenceTypeUsage> ancestors = new LinkedList<>(); if (getSuperClass(typeSolver) != null) { ReferenceTypeUsage superClass = getSuperClass(typeSolver); ancestors.add...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private void parse(String fileName) throws IOException { Path sourceFile = properSrc.resolve( fileName + ".java"); SourceFileInfoExtractor sourceFileInfoExtractor = getSourceFileInfoExtractor(); OutputStream outErrStream = new ByteArrayOutputStre...
#fixed code private void parse(String fileName) throws IOException { Path sourceFile = properSrc.resolve( fileName + ".java"); SourceFileInfoExtractor sourceFileInfoExtractor = getSourceFileInfoExtractor(); OutputStream outErrStream = new ByteArrayOutputStream(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfInterfaceQualifiedDifferentPackage() throws IOException { File src = new File("src/test/resources/internalClassInInterface"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfInterfaceQualifiedDifferentPackage() throws IOException { File src = new File("src/test/resources/internalClassInInterface"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "ba...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Override public SymbolReference<ResolvedTypeDeclaration> solveType(String name, TypeSolver typeSolver) { if (wrappedNode.getTypes() != null) { for (TypeDeclaration<?> type : wrappedNode.getTypes()) { if (type.getName().getId().eq...
#fixed code @Override public SymbolReference<ResolvedTypeDeclaration> solveType(String name, TypeSolver typeSolver) { if (wrappedNode.getTypes() != null) { for (TypeDeclaration<?> type : wrappedNode.getTypes()) { if (type.getName().getId().equals(n...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfClassUnqualifiedDifferentPackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separat...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfClassUnqualifiedDifferentPackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Override public Optional<Value> solveSymbolAsValue(String name, TypeSolver typeSolver) { return JavaParserFactory.getContext(wrappedNode.getParentNode()).solveSymbolAsValue(name, typeSolver); } #location 3 ...
#fixed code @Override public Optional<Value> solveSymbolAsValue(String name, TypeSolver typeSolver) { return getParent().solveSymbolAsValue(name, typeSolver); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private ParseResult parseSample(String sampleName) { InputStream is = this.getClass().getResourceAsStream( "/com/github/javaparser/issue_samples/" + sampleName + ".java.txt"); Provider p = Providers.provider(is, Charsets.UTF_8); r...
#fixed code private ParseResult parseSample(String sampleName) { Provider p = Providers.resourceProvider( "com/github/javaparser/issue_samples/" + sampleName + ".java.txt"); return new JavaParser().parse(ParseStart.COMPILATION_UNIT, p); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Override public SymbolReference<? extends ValueDeclaration> solveSymbol(String name, TypeSolver typeSolver) { if (wrappedNode.getFieldExpr().toString().equals(name)) { if (wrappedNode.getScope() instanceof ThisExpr) { Type typeOf...
#fixed code @Override public SymbolReference<? extends ValueDeclaration> solveSymbol(String name, TypeSolver typeSolver) { if (wrappedNode.getFieldExpr().toString().equals(name)) { if (wrappedNode.getScope() instanceof ThisExpr) { Type typeOfThis =...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public Optional<Value> solveSymbolAsValue(String name, Node node) { return solveSymbolAsValue(name, JavaParserFactory.getContext(node)); } #location 2 #vulnerability type NULL_DEREFERENCE
#fixed code public Optional<Value> solveSymbolAsValue(String name, Node node) { Context context = JavaParserFactory.getContext(node); return solveSymbolAsValue(name, context); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfClassUnqualifiedSamePackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + ...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfClassUnqualifiedSamePackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "bar" ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfInterfaceUnqualifiedSamePackage() throws IOException { File src = new File("src/test/resources/internalClassInInterface"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + ...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfInterfaceUnqualifiedSamePackage() throws IOException { File src = new File("src/test/resources/internalClassInInterface"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "bar" ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfClassQualifiedSamePackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "b...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfClassQualifiedSamePackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "bar" ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfClassUnqualifiedDifferentPackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separat...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfClassUnqualifiedDifferentPackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfClassUnqualifiedDifferentPackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separat...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfClassUnqualifiedDifferentPackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfClassUnqualifiedSamePackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + ...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfClassUnqualifiedSamePackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "bar" ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfInterfaceUnqualifiedDifferentPackage() throws IOException { File src = new File("src/test/resources/internalClassInInterface"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separat...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfInterfaceUnqualifiedDifferentPackage() throws IOException { File src = new File("src/test/resources/internalClassInInterface"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void issue506() throws IOException { InputStream is = this.getClass().getResourceAsStream("/com/github/javaparser/SourcesHelperOldVersion.java.txt"); ParseResult<CompilationUnit> res = new JavaParser().parse(ParseStart.COMPILATION_UNIT, ...
#fixed code @Test public void issue506() throws IOException { ensureAllNodesHaveValidBeginPosition( "SourcesHelperOldVersion.java.txt" ); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Generated("com.github.javaparser.generator.core.visitor.NoCommentHashCodeVisitorGenerator") public Integer visit(final ConstructorDeclaration n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getModifiers().hashCode()) * 31 + (n.getName(...
#fixed code @Generated("com.github.javaparser.generator.core.visitor.NoCommentHashCodeVisitorGenerator") public Integer visit(final ConstructorDeclaration n, final Void arg) { return (n.getBody().accept(this, arg)) * 31 + (n.getModifiers().hashCode()) * 31 + (n.getName().acce...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public CommentsCollection parse(final InputStream in, final String encoding) throws IOException, UnsupportedEncodingException { boolean lastWasASlashR = false; BufferedReader br = new BufferedReader(new InputStreamReader(in)); CommentsCollection ...
#fixed code public CommentsCollection parse(final InputStream in, final String encoding) throws IOException, UnsupportedEncodingException { boolean lastWasASlashR = false; BufferedReader br = new BufferedReader(new InputStreamReader(in)); CommentsCollection commen...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void solve(Path path) throws IOException { File file = path.toFile(); if (file.isDirectory()) { for (File f : file.listFiles()) { solve(f.toPath()); } } else { if (file.getName().endsWith...
#fixed code public void solve(Path path) throws IOException { Files.walkFileTree(path, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (file.toString()...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test void resolveFieldOfEnumAsInternalClassOfClassQualifiedSamePackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "b...
#fixed code @Test void resolveFieldOfEnumAsInternalClassOfClassQualifiedSamePackage() throws IOException { File src = new File("src/test/resources/enumLiteralsInAnnotatedClass"); File aClass = new File(src.getPath() + File.separator + "foo" + File.separator + "bar" ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void handleAllFieldsMappingSettingAndTheMappingsProvided() { List<DbTableColumn> columns = Lists.newArrayList( new DbTableColumn("col1", true, false, 1), new DbTableColumn("col2", false, false, 1), new DbTableColumn("col3", false...
#fixed code @Test public void handleAllFieldsMappingSettingAndTheMappingsProvided() { List<DbTableColumn> columns = Lists.newArrayList( new DbTableColumn("col1", true, false, 1), new DbTableColumn("col2", false, false, 1), new DbTableColumn("col3", false, fals...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void returnAllFieldsAndApplyMappings() { Schema schema = SchemaBuilder.struct().name("com.example.Person") .field("firstName", Schema.STRING_SCHEMA) .field("lastName", Schema.STRING_SCHEMA) .field("age", Schema.INT3...
#fixed code @Test public void returnAllFieldsAndApplyMappings() { Schema schema = SchemaBuilder.struct().name("com.example.Person") .field("firstName", Schema.STRING_SCHEMA) .field("lastName", Schema.STRING_SCHEMA) .field("age", Schema.INT32_SCHE...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void shouldReturnThePrimaryKeysAtTheEndWhenMultipleFieldsFormThePrimaryKey() { Schema schema = SchemaBuilder.struct().name("com.example.Person") .field("firstName", Schema.STRING_SCHEMA) .field("lastName", Schema.STRING_SCHEMA) ...
#fixed code @Test public void shouldReturnThePrimaryKeysAtTheEndWhenMultipleFieldsFormThePrimaryKey() { Schema schema = SchemaBuilder.struct().name("com.example.Person") .field("firstName", Schema.STRING_SCHEMA) .field("lastName", Schema.STRING_SCHEMA) ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void returnAllFieldsAndTheirBytesValue() { Schema schema = SchemaBuilder.struct().name("com.example.Person") .field("firstName", Schema.STRING_SCHEMA) .field("lastName", Schema.STRING_SCHEMA) .field("age", Schema.INT3...
#fixed code @Test public void returnAllFieldsAndTheirBytesValue() { Schema schema = SchemaBuilder.struct().name("com.example.Person") .field("firstName", Schema.STRING_SCHEMA) .field("lastName", Schema.STRING_SCHEMA) .field("age", Schema.INT32_SCHE...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void handleAllFieldsMappingSettingAndTheMappingsProvided() { List<DbTableColumn> columns = Lists.newArrayList( new DbTableColumn("col1", true, false, 1), new DbTableColumn("col2", false, false, 1), new DbTableColumn("col3", false...
#fixed code @Test public void handleAllFieldsMappingSettingAndTheMappingsProvided() { List<DbTableColumn> columns = Lists.newArrayList( new DbTableColumn("col1", true, false, 1), new DbTableColumn("col2", false, false, 1), new DbTableColumn("col3", false, fals...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void returnAllFieldsAndApplyMappings() { Schema schema = SchemaBuilder.struct().name("com.example.Person") .field("firstName", Schema.STRING_SCHEMA) .field("lastName", Schema.STRING_SCHEMA) .field("age", Schema.INT3...
#fixed code @Test public void returnAllFieldsAndApplyMappings() { Schema schema = SchemaBuilder.struct().name("com.example.Person") .field("firstName", Schema.STRING_SCHEMA) .field("lastName", Schema.STRING_SCHEMA) .field("age", Schema.INT32_SCHE...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void handleAllFieldsMappingSetting() { List<DbTableColumn> columns = Lists.newArrayList( new DbTableColumn("col1", true, false, 1), new DbTableColumn("col2", false, false, 1), new DbTableColumn("col3", false, false, 1)); DbTa...
#fixed code @Test public void handleAllFieldsMappingSetting() { List<DbTableColumn> columns = Lists.newArrayList( new DbTableColumn("col1", true, false, 1), new DbTableColumn("col2", false, false, 1), new DbTableColumn("col3", false, false, 1)); DbTable ta...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test(expected = ConfigException.class) public void throwAnExceptionWhenForANewTableToCreateWhichDoesNotAllowAutoCreation() throws SQLException { Database changesExecutor = new Database(new HashSet<String>(), new HashSet<String>(), new Databa...
#fixed code @Test(expected = ConfigException.class) public void throwAnExceptionWhenForANewTableToCreateWhichDoesNotAllowAutoCreation() throws SQLException { Database changesExecutor = new Database(new HashSet<String>(), new HashSet<String>(), new DatabaseMeta...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void handleAllFieldsIncludedAndAnExistingMapping() { List<DbTableColumn> columns = Lists.newArrayList( new DbTableColumn("col1", true, false, 1), new DbTableColumn("col2", false, false, 1), new DbTableColumn("col3", false, false,...
#fixed code @Test public void handleAllFieldsIncludedAndAnExistingMapping() { List<DbTableColumn> columns = Lists.newArrayList( new DbTableColumn("col1", true, false, 1), new DbTableColumn("col2", false, false, 1), new DbTableColumn("col3", false, false, 1)); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void handleBatchedStatementPerRecordInsertingSameRecord100Times() throws SQLException { String tableName = "batched_statement_test_100"; String createTable = "CREATE TABLE " + tableName + " (" + " firstName TEXT," + " ...
#fixed code @Test public void handleBatchedStatementPerRecordInsertingSameRecord100Times() throws SQLException { String tableName = "batched_statement_test_100"; String createTable = "CREATE TABLE " + tableName + " (" + " firstName TEXT," + " lastNa...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void shouldReturnThePrimaryKeysAtTheEndWhenOneFieldIsPK() { Schema schema = SchemaBuilder.struct().name("com.example.Person") .field("firstName", Schema.STRING_SCHEMA) .field("lastName", Schema.STRING_SCHEMA) .field("...
#fixed code @Test public void shouldReturnThePrimaryKeysAtTheEndWhenOneFieldIsPK() { Schema schema = SchemaBuilder.struct().name("com.example.Person") .field("firstName", Schema.STRING_SCHEMA) .field("lastName", Schema.STRING_SCHEMA) .field("age", ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void handleAllFieldsIncludedAndAnExistingMapping() { List<DbTableColumn> columns = Lists.newArrayList( new DbTableColumn("col1", true, false, 1), new DbTableColumn("col2", false, false, 1), new DbTableColumn("col3", false, false,...
#fixed code @Test public void handleAllFieldsIncludedAndAnExistingMapping() { List<DbTableColumn> columns = Lists.newArrayList( new DbTableColumn("col1", true, false, 1), new DbTableColumn("col2", false, false, 1), new DbTableColumn("col3", false, false, 1)); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void handleBatchedStatementPerRecordInsertingSameRecord100Times() throws SQLException { String tableName = "batched_statement_test_100"; String createTable = "CREATE TABLE " + tableName + " (" + " firstName TEXT," + " ...
#fixed code @Test public void handleBatchedStatementPerRecordInsertingSameRecord100Times() throws SQLException { String tableName = "batched_statement_test_100"; String createTable = "CREATE TABLE " + tableName + " (" + " firstName TEXT," + " lastNa...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void handleAllFieldsMappingSetting() { List<DbTableColumn> columns = Lists.newArrayList( new DbTableColumn("col1", true, false, 1), new DbTableColumn("col2", false, false, 1), new DbTableColumn("col3", false, false, 1)); DbTa...
#fixed code @Test public void handleAllFieldsMappingSetting() { List<DbTableColumn> columns = Lists.newArrayList( new DbTableColumn("col1", true, false, 1), new DbTableColumn("col2", false, false, 1), new DbTableColumn("col3", false, false, 1)); DbTable ta...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void shouldReturnThePrimaryKeysAtTheEndWhenMultipleFieldsFormThePrimaryKey() { Schema schema = SchemaBuilder.struct().name("com.example.Person") .field("firstName", Schema.STRING_SCHEMA) .field("lastName", Schema.STRING_SCHEMA) ...
#fixed code @Test public void shouldReturnThePrimaryKeysAtTheEndWhenMultipleFieldsFormThePrimaryKey() { Schema schema = SchemaBuilder.struct().name("com.example.Person") .field("firstName", Schema.STRING_SCHEMA) .field("lastName", Schema.STRING_SCHEMA) ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void handleBatchStatementPerRecordInsertingWithAutoCreatedColumnForPK() throws SQLException { String tableName = "batch_100_auto_create_column"; Schema schema = SchemaBuilder.struct().name("com.example.Person") .field("firstName", Schem...
#fixed code @Test public void handleBatchStatementPerRecordInsertingWithAutoCreatedColumnForPK() throws SQLException { String tableName = "batch_100_auto_create_column"; Schema schema = SchemaBuilder.struct().name("com.example.Person") .field("firstName", Schema.OPTI...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void handleAllFieldsMappingSetting() { List<DbTableColumn> columns = Lists.newArrayList( new DbTableColumn("col1", true, false, 1), new DbTableColumn("col2", false, false, 1), new DbTableColumn("col3", false, false, 1)); DbTa...
#fixed code @Test public void handleAllFieldsMappingSetting() { List<DbTableColumn> columns = Lists.newArrayList( new DbTableColumn("col1", true, false, 1), new DbTableColumn("col2", false, false, 1), new DbTableColumn("col3", false, false, 1)); DbTable ta...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void returnAllFieldsAndTheirBytesValue() { Schema schema = SchemaBuilder.struct().name("com.example.Person") .field("firstName", Schema.STRING_SCHEMA) .field("lastName", Schema.STRING_SCHEMA) .field("age", Schema.INT3...
#fixed code @Test public void returnAllFieldsAndTheirBytesValue() { Schema schema = SchemaBuilder.struct().name("com.example.Person") .field("firstName", Schema.STRING_SCHEMA) .field("lastName", Schema.STRING_SCHEMA) .field("age", Schema.INT32_SCHE...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void connect() throws IOException { if (connected) { throw new IllegalStateException("BinaryLogClient is already connected"); } GreetingPacket greetingPacket; try { try { Socket socket = sock...
#fixed code public void connect() throws IOException { if (!connectLock.tryLock()) { throw new IllegalStateException("BinaryLogClient is already connected"); } boolean notifyWhenDisconnected = false; try { try { chan...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private void listenForEventPackets() throws IOException { ByteArrayInputStream inputStream = channel.getInputStream(); try { while (inputStream.peek() != -1) { int packetLength = inputStream.readInteger(3); inp...
#fixed code private void listenForEventPackets() throws IOException { ByteArrayInputStream inputStream = channel.getInputStream(); try { while (inputStream.peek() != -1) { int packetLength = inputStream.readInteger(3); inputStre...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void connect() throws IOException { if (connected) { throw new IllegalStateException("BinaryLogClient is already connected"); } GreetingPacket greetingPacket; try { try { Socket socket = sock...
#fixed code public void connect() throws IOException { if (!connectLock.tryLock()) { throw new IllegalStateException("BinaryLogClient is already connected"); } boolean notifyWhenDisconnected = false; try { try { chan...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private void listenForEventPackets() throws IOException { latch.countDown(); ByteArrayInputStream inputStream = channel.getInputStream(); while (channel.isOpen()) { int packetLength = inputStream.readInteger(3); inputStrea...
#fixed code private void listenForEventPackets() throws IOException { latch.countDown(); ByteArrayInputStream inputStream = channel.getInputStream(); try { while (true) { try { inputStream.peek(); } c...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void connect() throws IOException { if (connected) { throw new IllegalStateException("BinaryLogClient is already connected"); } GreetingPacket greetingPacket; try { try { Socket socket = sock...
#fixed code public void connect() throws IOException { if (!connectLock.tryLock()) { throw new IllegalStateException("BinaryLogClient is already connected"); } boolean notifyWhenDisconnected = false; try { try { chan...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void connect() throws IOException { if (connected) { throw new IllegalStateException("BinaryLogClient is already connected"); } try { try { Socket socket = socketFactory != null ? socketFactory.creat...
#fixed code public void connect() throws IOException { if (connected) { throw new IllegalStateException("BinaryLogClient is already connected"); } try { try { Socket socket = socketFactory != null ? socketFactory.createSocke...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void connect() throws IOException { if (connected) { throw new IllegalStateException("BinaryLogClient is already connected"); } GreetingPacket greetingPacket; try { try { Socket socket = sock...
#fixed code public void connect() throws IOException { if (!connectLock.tryLock()) { throw new IllegalStateException("BinaryLogClient is already connected"); } boolean notifyWhenDisconnected = false; try { try { chan...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void disconnect() throws IOException { shutdownLock.lock(); try { if (isKeepAliveThreadRunning()) { keepAliveThreadExecutor.shutdownNow(); } disconnectChannel(); } finally { s...
#fixed code public void disconnect() throws IOException { terminateKeepAliveThread(); terminateConnect(); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void connect() throws IOException { if (connected) { throw new IllegalStateException("BinaryLogClient is already connected"); } GreetingPacket greetingPacket; try { try { Socket socket = sock...
#fixed code public void connect() throws IOException { if (!connectLock.tryLock()) { throw new IllegalStateException("BinaryLogClient is already connected"); } boolean notifyWhenDisconnected = false; try { try { chan...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void connect() throws IOException { if (connected) { throw new IllegalStateException("BinaryLogClient is already connected"); } GreetingPacket greetingPacket; try { try { Socket socket = sock...
#fixed code public void connect() throws IOException { if (!connectLock.tryLock()) { throw new IllegalStateException("BinaryLogClient is already connected"); } boolean notifyWhenDisconnected = false; try { try { chan...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void connect() throws IOException { if (connected) { throw new IllegalStateException("BinaryLogClient is already connected"); } GreetingPacket greetingPacket; try { try { Socket socket = sock...
#fixed code public void connect() throws IOException { if (!connectLock.tryLock()) { throw new IllegalStateException("BinaryLogClient is already connected"); } boolean notifyWhenDisconnected = false; try { try { chan...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void connect() throws IOException { if (connected) { throw new IllegalStateException("BinaryLogClient is already connected"); } GreetingPacket greetingPacket; try { try { Socket socket = sock...
#fixed code public void connect() throws IOException { if (!connectLock.tryLock()) { throw new IllegalStateException("BinaryLogClient is already connected"); } boolean notifyWhenDisconnected = false; try { try { chan...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void connect() throws IOException { if (connected) { throw new IllegalStateException("BinaryLogClient is already connected"); } GreetingPacket greetingPacket; try { try { Socket socket = sock...
#fixed code public void connect() throws IOException { if (!connectLock.tryLock()) { throw new IllegalStateException("BinaryLogClient is already connected"); } boolean notifyWhenDisconnected = false; try { try { chan...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void connect() throws IOException { if (connected) { throw new IllegalStateException("BinaryLogClient is already connected"); } GreetingPacket greetingPacket; try { try { Socket socket = sock...
#fixed code public void connect() throws IOException { if (!connectLock.tryLock()) { throw new IllegalStateException("BinaryLogClient is already connected"); } boolean notifyWhenDisconnected = false; try { try { chan...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void connect() throws IOException { if (connected) { throw new IllegalStateException("BinaryLogClient is already connected"); } GreetingPacket greetingPacket; try { try { Socket socket = sock...
#fixed code public void connect() throws IOException { if (!connectLock.tryLock()) { throw new IllegalStateException("BinaryLogClient is already connected"); } boolean notifyWhenDisconnected = false; try { try { chan...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void connect() throws IOException { if (connected) { throw new IllegalStateException("BinaryLogClient is already connected"); } GreetingPacket greetingPacket; try { try { Socket socket = sock...
#fixed code public void connect() throws IOException { if (!connectLock.tryLock()) { throw new IllegalStateException("BinaryLogClient is already connected"); } boolean notifyWhenDisconnected = false; try { try { chan...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void connect() throws IOException { if (connected) { throw new IllegalStateException("BinaryLogClient is already connected"); } GreetingPacket greetingPacket; try { try { Socket socket = sock...
#fixed code public void connect() throws IOException { if (!connectLock.tryLock()) { throw new IllegalStateException("BinaryLogClient is already connected"); } boolean notifyWhenDisconnected = false; try { try { chan...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void testChecksumNONE() throws Exception { EventDeserializer eventDeserializer = new EventDeserializer(); BinaryLogFileReader reader = new BinaryLogFileReader(new GZIPInputStream( new FileInputStream("src/test/resources/m...
#fixed code @Test public void testChecksumNONE() throws Exception { EventDeserializer eventDeserializer = new EventDeserializer(); BinaryLogFileReader reader = new BinaryLogFileReader( new FileInputStream("src/test/resources/mysql-bin.checksum-none"), ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void disconnect() throws IOException { try { connected = false; if (channel != null) { channel.close(); } } finally { synchronized (lifecycleListeners) { for (Lifecycl...
#fixed code public void disconnect() throws IOException { shutdownLock.lock(); try { if (isKeepAliveThreadRunning()) { keepAliveThreadExecutor.shutdownNow(); } disconnectChannel(); } finally { shutdow...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private List<WordFrequency> loadFrequencies(final String input) { try { final FrequencyAnalyzer frequencyAnalyzer = new FrequencyAnalyzer(); frequencyAnalyzer.setWordFrequenciesToReturn(cliParameters.getWordCount()); frequency...
#fixed code private List<WordFrequency> loadFrequencies(final String input) { try { final FrequencyAnalyzer frequencyAnalyzer = new FrequencyAnalyzer(); frequencyAnalyzer.setWordFrequenciesToReturn(cliParameters.getWordCount()); frequencyAnalyz...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code protected void preOperation(AipRequest request) { if (needAuth()) { getAccessToken(); } request.setHttpMethod(HttpMethodName.POST); request.addHeader(Headers.CONTENT_TYPE, HttpContentType.FORM_URLENCODE_DATA); request...
#fixed code protected void preOperation(AipRequest request) { if (needAuth()) { getAccessToken(config); } request.setHttpMethod(HttpMethodName.POST); request.addHeader(Headers.CONTENT_TYPE, HttpContentType.FORM_URLENCODE_DATA); request...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void testSyncHandleTimeout() throws Exception { RpcFuture rpcFuture = new RpcFuture<String>(timeout, methodInfo, null, channelInfo, rpcClient); Response resp = rpcFuture.get(100, TimeUnit.MILLISECONDS); assertThat(resp.getExcepti...
#fixed code @Test public void testSyncHandleTimeout() throws Exception { RpcFuture<String> rpcFuture = new RpcFuture<String>(timeout, methodInfo, null, channelInfo, rpcClient); try { rpcFuture.get(100, TimeUnit.MILLISECONDS); } catch (RpcException ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Override public Response decodeResponse(Object msg, ChannelHandlerContext ctx) { FullHttpResponse httpResponse = (FullHttpResponse) msg; try { ChannelInfo channelInfo = ChannelInfo.getClientChannelInfo(ctx.channel()); Long lo...
#fixed code @Override public Response decodeResponse(Object msg, ChannelHandlerContext ctx) { FullHttpResponse httpResponse = (FullHttpResponse) msg; try { ChannelInfo channelInfo = ChannelInfo.getClientChannelInfo(ctx.channel()); Long correlat...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void testSyncHandleSuccessfulResponse() throws Exception { RpcFuture rpcFuture = new RpcFuture<String>(timeout, methodInfo, null, channelInfo, rpcClient); RpcResponse response = new RpcResponse(); response.setResult("hello world"...
#fixed code @Test public void testSyncHandleSuccessfulResponse() throws Exception { RpcFuture<String> rpcFuture = new RpcFuture<String>(timeout, methodInfo, null, channelInfo, rpcClient); RpcResponse response = new RpcResponse(); response.setResult("hello worl...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public Channel getChannel(String clientName) { if (log.isDebugEnabled()) { for (Map.Entry<String, List<Channel>> entry : channelMap.entrySet()) { log.debug("participantName={}, channelNum={}", entry.getKey(), ...
#fixed code public Channel getChannel(String clientName) { if (log.isDebugEnabled()) { for (Map.Entry<String, List<Channel>> entry : innerStoreManager.getChannelMap().entrySet()) { log.debug("participantName={}, channelNum={}", ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public ThreadPool getOrCreateClientWorkThreadPool(String serviceName, boolean isSharing, int threadNum) { if (isSharing) { if (defaultWorkThreadPool == null) { synchronized (BrpcThreadPoolManager.class) { if (defau...
#fixed code public ThreadPool getOrCreateClientWorkThreadPool(String serviceName, boolean isSharing, int threadNum) { if (isSharing) { if (defaultWorkThreadPool == null) { synchronized (BrpcThreadPoolManager.class) { if (defaultWork...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private void parseRpcExporterAnnotation(RpcExporter rpcExporter, ConfigurableListableBeanFactory beanFactory, Object bean) { Class<?> serviceClass = AopUtils.getTargetClass(b...
#fixed code private void parseRpcExporterAnnotation(RpcExporter rpcExporter, ConfigurableListableBeanFactory beanFactory, Object bean) { Class<?> serviceClass = AopUtils.getTargetClass(bean); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public EventLoopGroup getOrCreateClientIoThreadPool(String serviceName, boolean isSharing, int threadNum, int ioEventType) { if (isSharing) { if (defaultIoThreadPool == null) { synchro...
#fixed code public EventLoopGroup getOrCreateClientIoThreadPool(String serviceName, boolean isSharing, int threadNum, int ioEventType) { if (isSharing) { if (defaultIoThreadPool == null) { synchronized ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Override public ByteBuf encodeResponse(Request request, Response response) { FullHttpRequest httpRequest = (FullHttpRequest) request.getMsg(); FullHttpResponse httpResponse = null; try { if (response.getException() != null) { ...
#fixed code @Override public ByteBuf encodeResponse(Request request, Response response) { FullHttpRequest httpRequest = (FullHttpRequest) request.getMsg(); FullHttpResponse httpResponse = null; try { byte[] responseBytes; if (response....
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public Response executeWithRetry(Request request) { Response response = null; RpcException exception = null; int currentTryTimes = 0; int maxTryTimes = rpcClient.getRpcClientOptions().getMaxTryTimes(); while (currentTryTimes < max...
#fixed code public Response executeWithRetry(Request request) { Response response = null; RpcException exception = null; int currentTryTimes = 0; int maxTryTimes = rpcClient.getRpcClientOptions().getMaxTryTimes(); while (currentTryTimes < maxTryTim...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void testSyncHandleFailResponse() throws Exception { RpcFuture rpcFuture = new RpcFuture<String>(timeout, methodInfo, null, channelInfo, rpcClient); RpcResponse response = new RpcResponse(); RuntimeException ex = new RuntimeExcep...
#fixed code @Test public void testSyncHandleFailResponse() throws Exception { RpcFuture<String> rpcFuture = new RpcFuture<String>(timeout, methodInfo, null, channelInfo, rpcClient); RpcResponse response = new RpcResponse(); RuntimeException ex = new RuntimeExc...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public VerbalExpression replace(String source, String value) { this.add(""); this.source.replaceAll(pattern,value); return this; } #location 3 #vulnerability type NULL_DEREFERENCE
#fixed code public VerbalExpression replace(String source, String value) { this.updatePattern(); this.source.replaceAll(pattern,value); return this; }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private void collectLibraryInputFiles() { if ( parsedIncludeJdkLibs ) { final String slash = File.separator; // we have to add the Java framework classes to the library JARs, since they are not // distributed with ...
#fixed code private void collectLibraryInputFiles() { if ( parsedIncludeJdkLibs ) { final String slash = File.separator; // we have to add the Java framework classes to the library JARs, since they are not // distributed with the JA...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public File getPlatform() { assertPathIsDirectory( sdkPath ); final File platformsDirectory = new File( sdkPath, PLATFORMS_FOLDER_NAME ); assertPathIsDirectory( platformsDirectory ); final File platformDirectory; if ( platfo...
#fixed code public File getPlatform() { assertPathIsDirectory( sdkPath ); final File platformsDirectory = new File( sdkPath, PLATFORMS_FOLDER_NAME ); assertPathIsDirectory( platformsDirectory ); final File platformDirectory; if ( androidTarge...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void execute() throws MojoExecutionException, MojoFailureException { CommandExecutor executor = CommandExecutor.Factory.createDefaultCommmandExecutor(); executor.setLogger(this.getLog()); if (androidManifestFile == null) { an...
#fixed code public void execute() throws MojoExecutionException, MojoFailureException { CommandExecutor executor = CommandExecutor.Factory.createDefaultCommmandExecutor(); executor.setLogger(this.getLog()); if (androidManifestFile == null) { androidM...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private void collectLibraryInputFiles() { if ( parsedIncludeJdkLibs ) { final String slash = File.separator; // we have to add the Java framework classes to the library JARs, since they are not // distributed with ...
#fixed code private void collectLibraryInputFiles() { if ( parsedIncludeJdkLibs ) { // we have to add the Java framework classes to the library JARs, since they are not // distributed with the JAR on Central, and since we'll strip them out of t...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private void runLint() { IssueRegistry registry = new BuiltinIssueRegistry(); LintCliFlags flags = new LintCliFlags(); flags.setQuiet( false ); LintCliClient client = new LintCliClient( flags ); File outHtmlFile = new File( ...
#fixed code private void runLint() throws MojoExecutionException { IssueRegistry registry = new BuiltinIssueRegistry(); LintCliFlags flags = new LintCliFlags(); flags.setQuiet( false ); LintCliClient client = new LintCliClient( flags ); try ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public MakefileHolder createMakefileFromArtifacts( File outputDir, Set<Artifact> artifacts, String ndkArchitecture, boolean useHeaderArchives ) ...
#fixed code public MakefileHolder createMakefileFromArtifacts( File outputDir, Set<Artifact> artifacts, String ndkArchitecture, boolean useHeaderArchives ) ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private void generateBuildConfig() throws MojoExecutionException { getLog().debug( "Generating BuildConfig file" ); // Create the BuildConfig for our package. String packageName = extractPackageNameFromAndroidManifest( androidManifestFile );...
#fixed code private void generateBuildConfig() throws MojoExecutionException { getLog().debug( "Generating BuildConfig file" ); // Create the BuildConfig for our package. String packageName = extractPackageNameFromAndroidManifest( androidManifestFile ); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public MakefileHolder createMakefileFromArtifacts( File outputDir, Set<Artifact> artifacts, String ndkArchitecture, boolean useHeaderArchives ) ...
#fixed code public MakefileHolder createMakefileFromArtifacts( File outputDir, Set<Artifact> artifacts, String ndkArchitecture, boolean useHeaderArchives ) ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private void performVersionCodeUpdateFromVersion( Element manifestElement ) { String verString = project.getVersion(); getLog().debug( "Generating versionCode for " + verString ); ArtifactVersion artifactVersion = new DefaultArtifactVersion( ...
#fixed code private void performVersionCodeUpdateFromVersion( Element manifestElement ) { String verString = project.getVersion(); getLog().debug( "Generating versionCode for " + verString ); String verCode = generateVersionCodeFromVersionName( verString ); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private void updateWithMetaInf( ZipOutputStream zos, File jarFile, Set<String> entries, boolean metaInfOnly ) throws ZipException, IOException { ZipFile zin = new ZipFile( jarFile ); for( Enumeration<? extends ZipEntry> en = zin.entries(); en.hasMoreElements(); ) { ...
#fixed code private void updateWithMetaInf( ZipOutputStream zos, File jarFile, Set<String> entries, boolean metaInfOnly ) throws ZipException, IOException { ZipFile zin = new ZipFile( jarFile ); for( Enumeration<? extends ZipEntry> en = zin.entries(); en.hasMoreElements(); ) { Zip...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void testTokenFilter() throws IOException{ StringReader sr = new StringReader("刘德华"); Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_36); PinyinTokenFilter filter = new PinyinTokenFilter(analyzer.tokenStream("f",sr),"","...
#fixed code @Test public void testTokenFilter() throws IOException{ StringReader sr = new StringReader("刘德华"); Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_41); PinyinTokenFilter filter = new PinyinTokenFilter(analyzer.tokenStream("f",sr),"","none")...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public V put(K key, V value) { Packet request = createRequestPacket(); request.setTxnId(0); request.setOperation(ClusterOperation.CONCURRENT_MAP_PUT); request.setKey(Serializer.toByte(key)); request.setValue(Serializer.toByte(value)); ...
#fixed code public V put(K key, V value) { return (V)doOp(ClusterOperation.CONCURRENT_MAP_PUT, Serializer.toByte(key), Serializer.toByte(value)); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void process(Object obj) { long processStart = System.nanoTime(); if (obj instanceof Invocation) { Invocation inv = (Invocation) obj; MemberImpl memberFrom = getMember(inv.conn.getEndPoint()); if (memberFrom != null) { memberFrom.didRead(); } ...
#fixed code public void process(Object obj) { long processStart = System.nanoTime(); if (obj instanceof Invocation) { Invocation inv = (Invocation) obj; MemberImpl memberFrom = getMember(inv.conn.getEndPoint()); if (memberFrom != null) { memberFrom.didRead(); } int op...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void run() { while (running) { Object obj = null; try { lsBuffer.clear(); queue.drainTo(lsBuffer); int size = lsBuffer.size(); if (size > 0) { for (int i = 0; i < size; i++) { obj = lsBuffer.get(i); process(obj); } ...
#fixed code public void run() { while (running) { Object obj = null; try { lsBuffer.clear(); queue.drainTo(lsBuffer); int size = lsBuffer.size(); if (size > 0) { for (int i = 0; i < size; i++) { obj = lsBuffer.get(i); checkHeartbeat(); process...
Below is the vulnerable code, please generate the patch based on the following information.