auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void releaseTask(final TaskSummary task) { <START> taskService.call((Void nothing) -> { <END> view.displayNotification(constants.TaskReleased(String.valueOf(task.getId()))); refreshGrid(); }, (Message message, Throwable throwable) -> { view.displayNotification(constants.UnableToReleaseTask(String.valueOf(task.getId()), task.getName(), throwable.getMessage())); return true; }).releaseTask(getSelectedServerTemplate(), task.getDeploymentId(), task.getId()); }</code><technical_language>indentation is other methods below, code structure is same</technical_language>

Target:
public void releaseTask(final TaskSummary task) { taskService.call((Void nothing) -> { view.displayNotification(constants.TaskReleased((String.valueOf(task.getId())))); refreshGrid(); }, (Message message, Throwable throwable) -> { view.displayNotification(constants.UnableToReleaseTask(String.valueOf(task.getId()), task.getName(), throwable.getMessage())); return true; } ).releaseTask(getSelectedServerTemplate(), task.getDeploymentId(), task.getId()); }
Source:
<code>public int getType() { if (code.startsWith("abusefilter-warning")) { return TYPE_WARNING; } else if (code.startsWith("abusefilter-disallowed")) { return TYPE_ERROR; } else if (info.startsWith("Hit AbuseFilter")) { return TYPE_ERROR; } else { <START> throw new RuntimeException("Unknown abusefilter response!"); <END> } }</code><technical_language>simply return TYPE_ERROR for this "else" case, worry contents of "info"? This prevent more crashes</technical_language>

Target:
public int getType() { if (code.startsWith("abusefilter-warning")) { return TYPE_WARNING; } else if (code.startsWith("abusefilter-disallowed")) { return TYPE_ERROR; } else if (info.startsWith("Hit AbuseFilter")) { return TYPE_ERROR; } else { return TYPE_ERROR; } }
Source:
<code><START> TestShardConsumerSubscriber(RecordsPublisher recordsPublisher, ExecutorService executorService, int bufferSize, <END> ShardConsumer shardConsumer, int readTimeoutsToIgnoreBeforeWarning) { super(recordsPublisher, executorService, bufferSize, shardConsumer, readTimeoutsToIgnoreBeforeWarning); this.recordsPublisher = recordsPublisher; this.executorService = executorService; this.bufferSize = bufferSize; this.shardConsumer = shardConsumer; }</code><technical_language>I able this constructor used? is need chain constructors</technical_language>

Target:
TestShardConsumerSubscriber(RecordsPublisher recordsPublisher, ExecutorService executorService, int bufferSize, ShardConsumer shardConsumer, int readTimeoutsToIgnoreBeforeWarning) { super(recordsPublisher, executorService, bufferSize, shardConsumer, readTimeoutsToIgnoreBeforeWarning); }
Source:
<code>public void tailBeforeHeadCorrectIteration() { PrimitiveLongArrayQueue queue = createQueue(); for ( int i = 0; i < 14; i++ ) { queue.enqueue( i ); } for ( int i = 0; i < 10; i++ ) { assertEquals( i, queue.dequeue() ); } for ( int i = 14; i < 24 ; i++ ) { queue.enqueue( i ); } assertEquals( 14, queue.size() ); LongIterator iterator = queue.longIterator(); for ( int j = 10; j < 24; j++ ) { assertTrue( iterator.hasNext() ); <START> Assert.assertEquals( j, iterator.next() ); <END> } assertFalse( iterator.hasNext() ); }</code><technical_language>do need 'Assert.'</technical_language>

Target:
public void tailBeforeHeadCorrectIteration() { PrimitiveLongArrayQueue queue = createQueue(); for ( int i = 0; i < 14; i++ ) { queue.enqueue( i ); } for ( int i = 0; i < 10; i++ ) { assertEquals( i, queue.dequeue() ); } for ( int i = 14; i < 24 ; i++ ) { queue.enqueue( i ); } assertEquals( 14, queue.size() ); LongIterator iterator = queue.longIterator(); for ( int j = 10; j < 24; j++ ) { assertTrue( iterator.hasNext() ); assertEquals( j, iterator.next() ); } assertFalse( iterator.hasNext() ); }
Source:
<code>public static <T> Iterable<T[]> cartesian(final Class<T> clazz, final Iterable<T>... iterables) { return new Iterable<T[]>() { @Override public Iterator<T[]> iterator() { return new Iterator<T[]>() { private final Iterator<T>[] iterators = new Iterator[iterables.length]; private final T[] cached = (T[]) Array.newInstance(clazz, iterables.length); @Override public boolean hasNext() { return hasNext(0); } private boolean hasNext(int index) { if (iterators[index] == null) { iterators[index] = iterables[index].iterator(); } for (; hasMore(index); cached[index] = null) { if (index == iterables.length - 1 || hasNext(index + 1)) { return true; } } iterators[index] = null; return false; } private boolean hasMore(int index) { if (cached[index] == null && iterators[index].hasNext()) { cached[index] = iterators[index].next(); } return cached[index] != null; } @Override <START> public T[] next() <END> { T[] result = Arrays.copyOf(cached, cached.length); cached[cached.length - 1] = null; return result; } @Override public void remove() { throw new UnsupportedOperationException("remove"); } }; } }; }</code><technical_language>this is assuming user call hasNext() calling next() i is part of Iterator API, i missing</technical_language>

Target:
public static <T> Iterable<T[]> cartesian(final Class<T> clazz, final Iterable<T>... iterables) { return new Iterable<T[]>() { @Override public Iterator<T[]> iterator() { return new Iterator<T[]>() { private final Iterator<T>[] iterators = new Iterator[iterables.length]; private final T[] cached = (T[]) Array.newInstance(clazz, iterables.length); private final BitSet valid = new BitSet(iterables.length); @Override public boolean hasNext() { return hasNext(0); } private boolean hasNext(int index) { if (iterators[index] == null) { iterators[index] = iterables[index].iterator(); } for (; hasMore(index); valid.clear(index)) { if (index == iterables.length - 1 || hasNext(index + 1)) { return true; } } iterators[index] = null; return false; } private boolean hasMore(int index) { return valid.get(index) || iterators[index].hasNext(); } @Override public T[] next() { for (int index = 0; index < iterables.length; index++) { if (!valid.get(index)) { cached[index] = iterators[index].next(); valid.set(index); } } T[] result = Arrays.copyOf(cached, cached.length); valid.clear(cached.length - 1); return result; } @Override public void remove() { throw new UnsupportedOperationException("remove"); } }; } }; }
Source:
<code>private void handleCommitRetry(RetryEvent event) throws InterruptedException, ExecutionException { long startTimestamp = event.getStartTimestamp(); try { Optional<CommitTimestamp> commitTimestamp = commitTableClient.getCommitTimestamp(startTimestamp).get(); <START> Batch batch = new Batch(1, -1); <END> if(commitTimestamp.isPresent()) { if (commitTimestamp.get().isValid()) { LOG.trace("Valid commit TS found in Commit Table"); replyProc.addCommit(batch, startTimestamp, commitTimestamp.get().getValue(), event.getChannel(), event.getMonCtx()); } else { LOG.trace("Invalid commit TS found in Commit Table"); replyProc.addAbort(batch, startTimestamp, event.getChannel(), event.getMonCtx()); } } else { LOG.trace("No commit TS found in Commit Table"); replyProc.addAbort(batch, startTimestamp, event.getChannel(), event.getMonCtx()); } } catch (InterruptedException e) { LOG.error("Interrupted reading from commit table"); Thread.currentThread().interrupt(); } catch (ExecutionException e) { LOG.error("Error reading from commit table", e); } retriesMeter.mark(); }</code><technical_language>is meaning of "magic number" -1</technical_language>

Target:
private void handleCommitRetry(RetryEvent event) throws InterruptedException, ExecutionException { long startTimestamp = event.getStartTimestamp(); try { Optional<CommitTimestamp> commitTimestamp = commitTableClient.getCommitTimestamp(startTimestamp).get(); Batch batch = batchPool.getNextEmptyBatch(); if(commitTimestamp.isPresent()) { if (commitTimestamp.get().isValid()) { LOG.trace("Valid commit TS found in Commit Table"); replyProc.addCommit(batch, startTimestamp, commitTimestamp.get().getValue(), event.getChannel(), event.getMonCtx()); } else { LOG.trace("Invalid commit TS found in Commit Table"); replyProc.addAbort(batch, startTimestamp, event.getChannel(), event.getMonCtx()); } } else { LOG.trace("No commit TS found in Commit Table"); replyProc.addAbort(batch, startTimestamp, event.getChannel(), event.getMonCtx()); } } catch (InterruptedException e) { LOG.error("Interrupted reading from commit table"); Thread.currentThread().interrupt(); } catch (ExecutionException e) { LOG.error("Error reading from commit table", e); } retriesMeter.mark(); }
Source:
<code>public void test_starting_states() throws Exception { BytecodeEGWalker walker = new BytecodeEGWalker(new BehaviorCache(null)); <START> Symbol.MethodSymbol methodSymbol = mock(JavaSymbol.MethodJavaSymbol.class); <END> when(methodSymbol.parameterTypes()).thenReturn(ImmutableList.of()); when(methodSymbol.isStatic()).thenReturn(false); walker.methodBehavior = new MethodBehavior(methodSymbol); ProgramState startingState = Iterables.getOnlyElement(walker.startingStates(methodSymbol, ProgramState.EMPTY_STATE)); SymbolicValue thisSv = startingState.getValue(0); assertThat(thisSv).isNotNull(); assertThat(startingState.getConstraints(thisSv).get(ObjectConstraint.class)).isEqualTo(ObjectConstraint.NOT_NULL); when(methodSymbol.isStatic()).thenReturn(true); startingState = Iterables.getOnlyElement(walker.startingStates(methodSymbol, ProgramState.EMPTY_STATE)); assertThat(startingState).isEqualTo(ProgramState.EMPTY_STATE); Symbols symbols = new Symbols(new BytecodeCompleter(new SquidClassLoader(Collections.emptyList()), new ParametrizedTypeCache())); JavaType doubleType = symbols.getPrimitiveFromDescriptor('D'); JavaType intType = symbols.getPrimitiveFromDescriptor('I'); when(methodSymbol.parameterTypes()).thenReturn(ImmutableList.of(doubleType, intType)); startingState = Iterables.getOnlyElement(walker.startingStates(methodSymbol, ProgramState.EMPTY_STATE)); assertThat(startingState.getValue(0)).isNotNull(); assertThat(startingState.getValue(1)).isNull(); assertThat(startingState.getValue(2)).isNotNull(); getMethodBehavior(5); }</code><technical_language>I mock is unecessary : new MethodJavaSymbol new MethodJavaType sufficient clearer</technical_language>

Target:
public void test_starting_states() throws Exception { BytecodeEGWalker walker = new BytecodeEGWalker(new BehaviorCache(null, null)); String signature = "()V"; walker.methodBehavior = new MethodBehavior(signature); walker.methodBehavior.setStaticMethod(false); ProgramState startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE)); SymbolicValue thisSv = startingState.getValue(0); assertThat(thisSv).isNotNull(); assertThat(startingState.getConstraints(thisSv).get(ObjectConstraint.class)).isEqualTo(ObjectConstraint.NOT_NULL); walker.methodBehavior.setStaticMethod(true); startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE)); assertThat(startingState).isEqualTo(ProgramState.EMPTY_STATE); signature = "(DI)V"; walker.methodBehavior = new MethodBehavior(signature); walker.methodBehavior.setStaticMethod(true); startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE)); assertThat(startingState.getValue(0)).isNotNull(); assertThat(startingState.getValue(1)).isNull(); assertThat(startingState.getValue(2)).isNotNull(); }
Source:
<code><START> DnsHeader(int <END> id, int flags, int rcode, @NonNull int[] recordCount) { this.id = id; this.flags = flags; this.rcode = rcode; mRecordCount = recordCount; }</code><technical_language>I this private. compiler generate a synthetic accessor other classes (legal) call</technical_language>

Target:
private DnsHeader(int id, int flags, int rcode, @NonNull int[] recordCount) { this.id = id; this.flags = flags; this.rcode = rcode; mRecordCount = recordCount; }
Source:
<code>public void setUp() throws Exception { cluster = new LocalCluster( null, null, siteCount, hostCount, kfactor, clusterID, BackendTarget.NATIVE_EE_JNI, <START> FailureState.ALL_RUNNING, false, false, null); <END> cluster.setHasLocalServer(false); cluster.overrideAnyRequestForValgrind(); VoltProjectBuilder builder = new VoltProjectBuilder(); builder.setUseDDLSchema(true); cluster.compileDeploymentOnly(builder); new File(builder.getPathToDeployment()).deleteOnExit(); cluster.setExpectedToCrash(false); }</code><technical_language>I this loads classes. a false test pass if SelectStarHelloWorld is server's CLASSPATH. explain fix this</technical_language>

Target:
public void setUp() throws Exception { InMemoryJarfile classesFile = new InMemoryJarfile(); String cpath = File.createTempFile("preloaded-classes", ".jar").getCanonicalPath(); classesFile.writeToFile(new File(cpath)); cluster = new LocalCluster( null, cpath, true, siteCount, hostCount, kfactor, clusterID, BackendTarget.NATIVE_EE_JNI, FailureState.ALL_RUNNING, false, false, null); cluster.setHasLocalServer(true); cluster.overrideAnyRequestForValgrind(); VoltProjectBuilder builder = new VoltProjectBuilder(); builder.setUseDDLSchema(true); cluster.compileDeploymentOnly(builder); new File(builder.getPathToDeployment()).deleteOnExit(); cluster.setExpectedToCrash(false); }
Source:
<code>public Response deleteCloudConfig(@PathParam("clusterId") String clusterId) { <START> HelixZkClient zkClient = getHelixZkClient(); if (!ZKUtil.isClusterSetup(clusterId, zkClient)) { return notFound(); } <END> HelixAdmin admin = getHelixAdmin(); admin.removeCloudConfig(clusterId); return OK(); }</code><technical_language>Move logic configAccessor</technical_language>

Target:
public Response deleteCloudConfig(@PathParam("clusterId") String clusterId) { HelixAdmin admin = getHelixAdmin(); admin.removeCloudConfig(clusterId); return OK(); }
Source:
<code>public void logSlowQuery(String sql, long startTime) { if ( logSlowQuery < 1 ) { return; } <START> assert startTime > 0 : "startTime is invalid!"; <END> long spent = System.currentTimeMillis() - startTime; assert spent >= 0 : "startTime is invalid!"; if ( spent > logSlowQuery ) { String logData = "SlowQuery: " + spent + " milliseconds. " + sql; LOG_SLOW.info( logData ); if ( logToStdout ) { System.out.println( logData ); } } }</code><technical_language>start times invalid then</technical_language>

Target:
public void logSlowQuery(String sql, long startTime) { if ( logSlowQuery < 1 ) { return; } assert startTime > 0 : "startTime is invalid!"; long spent = System.currentTimeMillis() - startTime; assert spent >= 0 : "startTime is invalid!"; if ( spent > logSlowQuery ) { String logData = "SlowQuery: " + spent + " milliseconds. SQL: '" + sql + "'"; LOG_SLOW.info( logData ); if ( logToStdout ) { System.out.println( logData ); } } }
Source:
<code>public String toString() { <START> return "DigestThread{" + "ThreadName=" + getName() + ", digest=" <END> + digest + ", file=" + file + '}'; }</code><technical_language>need for +</technical_language>

Target:
public String toString() { return "DigestThread{ ThreadName=" + getName() + ", digest=" + digest + ", file=" + file + '}'; }
Source:
<code>private Point getPointForTime(long time) { return UIThreadRunnable.syncExec((Result<Point>) () -> { int x = widget.getXForTime(time); <START> Rectangle bounds = widget.getItemBounds(fEntry); <END> int y = bounds.y + bounds.height / 2; if (x >= bounds.x && x < bounds.width) { return new Point(x, y); } return null; }); }</code><technical_language>bounds include namespace margins..</technical_language>

Target:
private Point getPointForTime(long time) { return UIThreadRunnable.syncExec((Result<Point>) () -> { ITimeDataProvider timeDataProvider = widget.getTimeDataProvider(); if (timeDataProvider.getTime0() >= time || timeDataProvider.getTime1() <= time) { return null; } int x = widget.getXForTime(time); Rectangle bounds = widget.getItemBounds(fEntry); int y = bounds.y + bounds.height / 2; return new Point(x, y); }); }
Source:
<code><START> private List<Properties> createInternalConfigurations() { <END> List<Properties> results = new ArrayList<>(); Properties authConfig = new Properties(); authConfig.put(ExtensionManager.CLASS, "org.ovirt.extensions.builtin.ldapkerberos.LdapKerberosAuthenticator"); authConfig.put(ExtensionManager.PROVIDES, "org.ovirt.engine.core.authentication"); authConfig.put(ExtensionManager.ENABLED, true); authConfig.put(ExtensionManager.MODULE, "org.ovirt.engine.extensions.builtin"); authConfig.put(ExtensionManager.NAME, "builtin-authn-internal"); authConfig.put("org.ovirt.engine.aaa.authn.profile.name", "internal"); authConfig.put("ovirt.engine.aaa.authn.authz.plugin", "builitin-authz-internal"); results.add(authConfig); Properties dirConfig = new Properties(); dirConfig.put(ExtensionManager.CLASS, "org.ovirt.extensions.builtin.ldapkerberos.LdapKerberosDirectory"); dirConfig.put(ExtensionManager.PROVIDES, "org.ovirt.engine.core.authorization"); dirConfig.put(ExtensionManager.ENABLED, true); dirConfig.put(ExtensionManager.MODULE, "org.ovirt.engine.extensions.builtin"); dirConfig.put(ExtensionManager.NAME, "builtin-authz-internal"); dirConfig.put("org.ovirt.engine.aaa.authz.profile.name", "internal"); results.add(authConfig); return results; }</code><technical_language>need, please put in configuration file /usr</technical_language>

Target:
private List<Properties> createInternalConfigurations() { List<Properties> results = new ArrayList<>(); Properties authConfig = new Properties(); authConfig.put(ExtensionManager.CLASS, "org.ovirt.engine.extensions.aaa.builtin.internal.InternalAuthenticator"); authConfig.put(ExtensionManager.PROVIDES, "org.ovirt.engine.core.authentication"); authConfig.put(ExtensionManager.ENABLED, "true"); authConfig.put(ExtensionManager.MODULE, "org.ovirt.engine.extensions.builtin"); authConfig.put(ExtensionManager.NAME, "builtin-authn-internal"); authConfig.put("ovirt.engine.aaa.authn.profile.name", "internal"); authConfig.put("ovirt.engine.aaa.authn.authz.plugin", "builtin-authz-internal"); authConfig.put("ovirt.engine.aaa.authn.user", Config.<String> getValue(ConfigValues.AdminUser)); authConfig.put("ovirt.engine.aaa.authn.password", Config.<String> getValue(ConfigValues.AdminPassword)); results.add(authConfig); Properties dirConfig = new Properties(); dirConfig.put(ExtensionManager.CLASS, "org.ovirt.engine.extensions.aaa.builtin.internal.InternalDirectory"); dirConfig.put(ExtensionManager.PROVIDES, "org.ovirt.engine.core.authorization"); dirConfig.put(ExtensionManager.ENABLED, "true"); dirConfig.put(ExtensionManager.MODULE, "org.ovirt.engine.extensions.builtin"); dirConfig.put("ovirt.engine.aaa.authz.user", Config.<String> getValue(ConfigValues.AdminUser)); dirConfig.put(ExtensionManager.NAME, "builtin-authz-internal"); dirConfig.put("ovirt.engine.aaa.authz.profile.name", "internal"); results.add(dirConfig); return results; }
Source:
<code>private String getIdForEvent(MuleEvent event) throws Exception { if (useSecureHash) { byte[] bytes; MuleMessage message = event.getMessage(); Object payload = message.getPayload(); <START> if(Boolean.parseBoolean(System.getProperty("RollBackExceptionStrategy","false"))) <END> { byte[] payloadBytes = (byte[]) objectToByteArray.transform(payload); bytes = concat(payloadBytes, message.getUniqueId().getBytes()); } else { bytes = (byte[]) objectToByteArray.transform(payload); } if (payload instanceof InputStream) { event.getMessage().setPayload(bytes); } MessageDigest md = MessageDigest.getInstance(messageDigestAlgorithm); byte[] digestedBytes = md.digest(bytes); return (String)byteArrayToHexString.transform(digestedBytes); } else { return event.getMuleContext().getExpressionManager().parse(idExpression, event, true); } }</code><technical_language>2 corrections: 1. Static imports 2. this a constant, change entire execution (reading purposes, more importantly avoid check system property time code is executed)</technical_language>

Target:
private String getIdForEvent(MuleEvent event) throws Exception { if (useSecureHash) { byte[] bytes; MuleMessage message = event.getMessage(); Object payload = message.getPayload(); if(Boolean.parseBoolean(System.getProperty(MULE_FORCE_REDELIVERY,"false"))) { byte[] payloadBytes = (byte[]) objectToByteArray.transform(payload); bytes = concat(payloadBytes, message.getUniqueId().getBytes()); } else { bytes = (byte[]) objectToByteArray.transform(payload); } if (payload instanceof InputStream) { event.getMessage().setPayload(bytes); } MessageDigest md = MessageDigest.getInstance(messageDigestAlgorithm); byte[] digestedBytes = md.digest(bytes); return (String)byteArrayToHexString.transform(digestedBytes); } else { return event.getMuleContext().getExpressionManager().parse(idExpression, event, true); } }
Source:
<code>public Response exit(final Response res, final Identity idt) throws IOException { final String text; if (idt.equals(Identity.ANONYMOUS)) { text = ""; } else { text = new String(this.codec.encode(idt)); } return new RsWithCookie( res, this.cookie, text, "Path=/", String.format( Locale.ENGLISH, "Expires=%1$ta, %1$td %1$tb %1$tY %1$tT GMT", new Date( System.currentTimeMillis() + TimeUnit.DAYS.toMillis(this.age) ) ), <START> "HttpOnly" <END> ); }</code><technical_language>@dmzaytsev add "HttpOnly" Expires, line 121</technical_language>

Target:
public Response exit(final Response res, final Identity idt) throws IOException { final String text; if (idt.equals(Identity.ANONYMOUS)) { text = ""; } else { text = new String(this.codec.encode(idt)); } return new RsWithCookie( res, this.cookie, text, "Path=/", "HttpOnly", String.format( Locale.ENGLISH, "Expires=%1$ta, %1$td %1$tb %1$tY %1$tT GMT", new Date( System.currentTimeMillis() + TimeUnit.DAYS.toMillis(this.age) ) ) ); }
Source:
<code>public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { String failureUrlParam = StringUtil.cleanseUrlString(request.getParameter("failureUrl")); String successUrlParam = StringUtil.cleanseUrlString(request.getParameter("successUrl")); String failureUrl = failureUrlParam==null?null:failureUrlParam.trim(); boolean sessionTimeout = (Boolean) request.getAttribute("sessionTimeout"); if (StringUtils.isEmpty(failureUrl) && !sessionTimeout) { failureUrl = defaultFailureUrl; } if (sessionTimeout) { failureUrl = "?sessionTimeout=true"; } <START> <END> if (failureUrl != null) { if (!StringUtils.isEmpty(successUrlParam)) { if (!failureUrl.contains("?")) { failureUrl += "?successUrl=" + successUrlParam; } else { failureUrl += "&successUrl=" + successUrlParam; } } saveException(request, exception); getRedirectStrategy().sendRedirect(request, response, failureUrl); } else { super.onAuthenticationFailure(request, response, exception); } }</code><technical_language>Remove of spaces</technical_language>

Target:
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { String failureUrlParam = StringUtil.cleanseUrlString(request.getParameter("failureUrl")); String successUrlParam = StringUtil.cleanseUrlString(request.getParameter("successUrl")); String failureUrl = failureUrlParam==null?null:failureUrlParam.trim(); Boolean sessionTimeout = (Boolean) request.getAttribute("sessionTimeout"); if (StringUtils.isEmpty(failureUrl) && BooleanUtils.isNotTrue(sessionTimeout)) { failureUrl = defaultFailureUrl; } if (BooleanUtils.isTrue(sessionTimeout)) { failureUrl = "?sessionTimeout=true"; } successUrlParam = request.getHeader("referer"); if (failureUrl != null) { if (!StringUtils.isEmpty(successUrlParam)) { if (!failureUrl.contains("?")) { failureUrl += "?successUrl=" + successUrlParam; } else { failureUrl += "&successUrl=" + successUrlParam; } } saveException(request, exception); getRedirectStrategy().sendRedirect(request, response, failureUrl); } else { super.onAuthenticationFailure(request, response, exception); } }
Source:
<code>private Map<String, Object> runCWLCommand(String cwlFile, String jsonSettings, String outputDir, String workingDir) { String[] s = {"cwltool","--enable-dev","--non-strict","--enable-net","--outdir", outputDir, "--tmpdir-prefix", workingDir, cwlFile, jsonSettings}; <START> <END> final ArrayList<String> extraFlags = (ArrayList)config.getList("cwltool-extra-parameters"); if (extraFlags.size() > 0) { System.out.println("########### WARNING ###########"); System.out.println("You are using extra flags for CWLtool which may not be supported. Use at your own risk."); } for (int i = 0; i < extraFlags.size(); i++) { extraFlags.set(i, extraFlags.get(i).trim()); System.out.println(extraFlags.get(i)); } ArrayList<String> newCommand = new ArrayList<>(Arrays.asList(s)); newCommand.addAll(1, extraFlags); final String joined = Joiner.on(" ").join(newCommand); System.out.println("Executing: " + joined); final ImmutablePair<String, String> execute = Utilities.executeCommand(joined); String stdout = execute.getLeft().replaceAll("(?m)^", "\t"); String stderr = execute.getRight().replaceAll("(?m)^", "\t"); final String cwltool = "cwltool"; outputIntegrationOutput(outputDir, execute, stdout, stderr, cwltool); Map<String, Object> obj = (Map<String, Object>)yaml.load(execute.getLeft()); return obj; }</code><technical_language>Small nitpick, I this cleaner s newCommand Also, able clean loop a lambda <LINK_0></technical_language>

Target:
private Map<String, Object> runCWLCommand(String cwlFile, String jsonSettings, String outputDir, String workingDir) { ArrayList<String> extraFlags = (ArrayList)config.getList("cwltool-extra-parameters"); if (extraFlags.size() > 0) { System.out.println("########### WARNING ###########"); System.out.println("You are using extra flags for CWLtool which may not be supported. Use at your own risk."); } extraFlags = (ArrayList)extraFlags.stream() .map(flag -> trimAndPrintInput(flag)) .collect(Collectors.toList()); ArrayList<String> command = new ArrayList<>(Arrays.asList("cwltool","--enable-dev","--non-strict","--enable-net","--outdir", outputDir, "--tmpdir-prefix", workingDir, cwlFile, jsonSettings)); command.addAll(1, extraFlags); final String joined = Joiner.on(" ").join(command); System.out.println("Executing: " + joined); final ImmutablePair<String, String> execute = Utilities.executeCommand(joined); String stdout = execute.getLeft().replaceAll("(?m)^", "\t"); String stderr = execute.getRight().replaceAll("(?m)^", "\t"); final String cwltool = "cwltool"; outputIntegrationOutput(outputDir, execute, stdout, stderr, cwltool); Map<String, Object> obj = (Map<String, Object>)yaml.load(execute.getLeft()); return obj; }
Source:
<code>private void splitChunk(Scope chunk, int linePos) { Position chunkStart = chunk.getBodyStart(); <START> Position chunkEnd = chunk.getEnd(); <END> Position preamble = chunk.getPreamble(); String preambleLine = docDisplay_.getTextForRange(Range.create(preamble.getRow(), preamble.getColumn(), preamble.getRow() + 1, 0)); if (linePos < chunkStart.getRow()) linePos = chunkStart.getRow(); Range firstChunkRange = Range.create(chunkStart.getRow(), chunkStart.getColumn(), linePos, 0); String firstChunkContents = docDisplay_.getTextForRange(firstChunkRange); firstChunkContents = firstChunkContents.trim(); firstChunkContents = preambleLine + firstChunkContents; if (!firstChunkContents.endsWith("\n")) firstChunkContents += "\n"; firstChunkContents += "```\n\n"; Range secondChunkRange = Range.create(linePos, 0, chunkEnd.getRow(), chunkEnd.getColumn()); String secondChunkContents = docDisplay_.getTextForRange(secondChunkRange); secondChunkContents = secondChunkContents.trim(); secondChunkContents = preambleLine + secondChunkContents; Range chunkRange = Range.create(chunkStart.getRow() - 1, chunkStart.getColumn(), chunkEnd.getRow(), chunkEnd.getColumn()); docDisplay_.replaceRange(chunkRange, secondChunkContents); docDisplay_.setCursorPosition(Position.create(chunkStart.getRow() - 1, chunkStart.getColumn())); docDisplay_.insertCode(firstChunkContents, false); }</code><technical_language>need a guard for chunks closed -- in a case, I this return null</technical_language>

Target:
private void splitChunk(Scope chunk, int linePos) { Position chunkStart = chunk.getBodyStart(); Position chunkEnd = chunk.getEnd(); if (chunkEnd == null) chunkEnd = docDisplay_.getDocumentEnd(); Position preamble = chunk.getPreamble(); String preambleLine = docDisplay_.getLine(preamble.getRow()) + "\n"; if (linePos < chunkStart.getRow()) linePos = chunkStart.getRow(); Range firstChunkRange = Range.create(chunkStart.getRow(), chunkStart.getColumn(), linePos, 0); String firstChunkContents = docDisplay_.getTextForRange(firstChunkRange); firstChunkContents = firstChunkContents.trim(); firstChunkContents = preambleLine + firstChunkContents; if (!firstChunkContents.endsWith("\n")) firstChunkContents += "\n"; firstChunkContents += getChunkEnd() + "\n\n"; Range secondChunkRange = Range.create(linePos, 0, chunkEnd.getRow(), chunkEnd.getColumn()); String secondChunkContents = docDisplay_.getTextForRange(secondChunkRange); secondChunkContents = secondChunkContents.trim(); secondChunkContents = preambleLine + secondChunkContents; Range chunkRange = Range.create(chunkStart.getRow() - 1, chunkStart.getColumn(), chunkEnd.getRow(), chunkEnd.getColumn()); docDisplay_.replaceRange(chunkRange, secondChunkContents); docDisplay_.setCursorPosition(Position.create(chunkStart.getRow() - 1, chunkStart.getColumn())); docDisplay_.insertCode(firstChunkContents, false); }
Source:
<code>public void start(StartContext context) throws StartException { try { <START> httpAuthenticationFactory = checkNotNullParam("httpAuthenticationFactorySupplier", httpAuthenticationFactorySupplier).call(); <END> } catch (Exception e) { throw new IllegalStateException(e); } }</code><technical_language>'httpAuthenticationFactorySupplier' is final, validated in constructor do here. means try/catch removed</technical_language>

Target:
public void start(StartContext context) throws StartException { httpAuthenticationFactory = httpAuthenticationFactorySupplier.get(); }
Source:
<code>private void init() { setMasterVolume(new EntityModel<String>()); setSlaveVolume(new EntityModel<String>()); setSlaveHost(new EntityModel<String>()); setForce(new EntityModel<Boolean>()); <START> setMessage(""); END> getForce().setEntity(false); }</code><technical_language>This is required checking for null in view</technical_language>

Target:
private void init() { setMasterVolume(new EntityModel<String>()); setSlaveVolume(new EntityModel<String>()); setSlaveHost(new EntityModel<String>()); setForce(new EntityModel<Boolean>()); getForce().setEntity(false); }
Source:
<code>public void metadataForNewTableIsLowerCased() { TableReference userTable = TableReference.createFromFullyQualifiedName("test.xXcOoLtAbLeNaMeXx"); <START> byte[] originalMetadata = new TableMetadata( <END> new NameMetadataDescription(), new ColumnMetadataDescription(), ConflictHandler.RETRY_ON_VALUE_CHANGED, TableMetadataPersistence.LogSafety.SAFE) .persistToBytes(); keyValueService.createTable(userTable, originalMetadata); assertThat(keyValueService.getMetadataForTables().keySet().stream() .anyMatch(tableRef -> tableRef.getQualifiedName().equals(userTable.getQualifiedName().toLowerCase())), is(true)); }</code><technical_language>nit: static var avoid redundant declarations</technical_language>

Target:
public void metadataForNewTableIsLowerCased() { TableReference userTable = TableReference.createFromFullyQualifiedName("test.xXcOoLtAbLeNaMeXx"); keyValueService.createTable(userTable, originalMetadata); assertThat(keyValueService.getMetadataForTables().keySet().stream() .anyMatch(tableRef -> tableRef.getQualifiedName().equals(userTable.getQualifiedName().toLowerCase())), is(true)); }
Source:
<code>private Column<CallbackModel> createRefererColumn() { return new Column<CallbackModel>(String.class, Constant.messages.getString("callback.panel.table.column.referer")){ public Object getValue(CallbackModel model){ <START> return model.getHttpMessage().getRequestHeader().getHeader("Referer"); <END> } }; }</code><technical_language>This leverage constant HttpHeader.REFERER</technical_language>

Target:
private static CustomColumn<CallbackRequest> createRefererColumn() { return new CustomColumn<CallbackRequest>(String.class, Constant.messages.getString("callback.panel.table.column.referer")){ @Override public Object getValue(CallbackRequest model){ return model.getReferer(); } }; }
Source:
<code>public JsonResponse<T> handle(Request request, Response response) { byte[] bytes = readResponseBytes(response); String contentType = response.getHeader(CONTENT_TYPE); <START> if ((contentType == null) || !SUPPORTED_MEDIA_TYPES.contains(MediaType.parse(contentType))) { <END> return new JsonResponse<>(response.getStatusCode(), response.getStatusMessage(), response.getHeaders(), bytes); } return new JsonResponse<>(response.getStatusCode(), response.getStatusMessage(), response.getHeaders(), jsonCodec, bytes); }</code><technical_language>This right. JsonCodec in this handler supports JSON Smile, both, accept both. Also, error handling logic getJson() API (used error handling) assumes JSON. work for Smile is binary</technical_language>

Target:
public JsonResponse<T> handle(Request request, Response response) { byte[] bytes = readResponseBytes(response); String contentType = response.getHeader(CONTENT_TYPE); if ((contentType == null) || !MediaType.parse(contentType).is(MEDIA_TYPE_JSON)) { return new JsonResponse<T>(response.getStatusCode(), response.getStatusMessage(), response.getHeaders(), bytes); } return new JsonResponse(response.getStatusCode(), response.getStatusMessage(), response.getHeaders(), codec.get(), bytes); }
Source:
<code>public void readConfigFromRestApi() { Log.v(TAG, "Reading config from REST ..."); asyncQueryVersionComplete = false; asyncQueryConfigComplete = false; asyncQuerySystemInfoComplete = false; new GetRequest(mContext, mUrl, GetRequest.URI_VERSION, mApiKey, null, result -> { JsonObject json = new JsonParser().parse(result).getAsJsonObject(); mVersion = json.get("version").getAsString(); Log.i(TAG, "Syncthing version is " + mVersion); updateDebugFacilitiesCache(); asyncQueryVersionComplete = true; checkReadConfigFromRestApiCompleted(); }); new GetRequest(mContext, mUrl, GetRequest.URI_CONFIG, mApiKey, null, result -> { onReloadConfigComplete(result); asyncQueryConfigComplete = true; checkReadConfigFromRestApiCompleted(); }); getSystemInfo(info -> { mLocalDeviceId = info.myID; asyncQuerySystemInfoComplete = true; <START> checkReadConfigFromRestApiCompleted(); <END> }); }</code><technical_language>Again, 3 threads, locking atomics. code atomics, thing, potential races</technical_language>

Target:
public void readConfigFromRestApi() { Log.v(TAG, "Reading config from REST ..."); synchronized (mAsyncQueryCompleteLock) { asyncQueryVersionComplete = false; asyncQueryConfigComplete = false; asyncQuerySystemInfoComplete = false; } new GetRequest(mContext, mUrl, GetRequest.URI_VERSION, mApiKey, null, result -> { JsonObject json = new JsonParser().parse(result).getAsJsonObject(); mVersion = json.get("version").getAsString(); Log.i(TAG, "Syncthing version is " + mVersion); updateDebugFacilitiesCache(); synchronized (mAsyncQueryCompleteLock) { asyncQueryVersionComplete = true; checkReadConfigFromRestApiCompleted(); } }); new GetRequest(mContext, mUrl, GetRequest.URI_CONFIG, mApiKey, null, result -> { onReloadConfigComplete(result); synchronized (mAsyncQueryCompleteLock) { asyncQueryConfigComplete = true; checkReadConfigFromRestApiCompleted(); } }); getSystemInfo(info -> { mLocalDeviceId = info.myID; synchronized (mAsyncQueryCompleteLock) { asyncQuerySystemInfoComplete = true; checkReadConfigFromRestApiCompleted(); } }); }
Source:
<code>public void testCardinalityThreeColumns() { int blockSize = 3; <START> long uniqueElts = 10000 * blockSize; <END> String projection = getCardinalityProjection(getUniqueElements(blockSize, uniqueElts)); double error = uniqueElts * 0.05; functionAssertions.assertFunctionWithError(projection, BIGINT, uniqueElts, error); }</code><technical_language>variable name explicit, i.e. uniqueElements. I group local variables for readability</technical_language>

Target:
public void testCardinalityThreeColumns() { int blockSize = 3; long uniqueElements = 10000 * blockSize; double error = uniqueElements * 0.05; String projection = getCardinalityProjection(getUniqueElements(blockSize, uniqueElements)); functionAssertions.assertFunctionWithError(projection, BIGINT, uniqueElements, error); }
Source:
<code>public void transactionCreation() { ByteBuffer transactionId = ByteBuffer.wrap(TRANSACTION_ID); AmqpTransaction actual = new AmqpTransaction(transactionId); assertNotNull(actual); <START> actual.toString(); <END> assertArrayEquals(TRANSACTION_ID, actual.getTransactionId().array()); }</code><technical_language>This line deleted</technical_language>

Target:
public void transactionCreation() { ByteBuffer transactionId = ByteBuffer.wrap(TRANSACTION_ID); AmqpTransaction actual = new AmqpTransaction(transactionId); assertNotNull(actual); assertArrayEquals(TRANSACTION_ID, actual.getTransactionId().array()); }
Source:
<code>private void findBNodesSyntax1() { Set<Node> rejects = new HashSet<>() ; Set<Node> blankNodesInTripleTerms = new HashSet<>(); ExtendedIterator<Triple> iter = find(ANY, ANY, ANY) ; try { for ( ; iter.hasNext() ; ) { Triple t = iter.next() ; Node subj = t.getSubject() ; Node obj = t.getObject() ; <START> <END> if ( subj.isBlank() ) { int sConn = inLinks(subj) ; if ( sConn == 0 && containedInOneGraph(subj) ) freeBnodes.add(subj) ; } else if ( subj.isNodeTriple() ) { extractBlankNodes(blankNodesInTripleTerms, subj); } if ( obj.isNodeTriple() ) { extractBlankNodes(blankNodesInTripleTerms, obj); continue; } if ( ! obj.isBlank() ) continue ; if ( rejects.contains(obj) ) continue ; int connectivity = inLinks(obj) ; if ( connectivity == 1 && containedInOneGraph(obj) ) { nestedObjects.add(obj) ; } else rejects.add(obj) ; } freeBnodes.removeAll(blankNodesInTripleTerms); nestedObjects.removeAll(blankNodesInTripleTerms); } finally { iter.close() ; } }</code><technical_language>Extra spaces</technical_language>

Target:
private void findBNodesSyntax1() { Set<Node> blankNodesInTripleTerms = new HashSet<>(); Set<Node> rejects = new HashSet<>() ; ExtendedIterator<Triple> iter = find(ANY, ANY, ANY) ; try { for ( ; iter.hasNext() ; ) { Triple t = iter.next() ; Node subj = t.getSubject() ; Node obj = t.getObject() ; if ( subj.isBlank() ) { int sConn = inLinks(subj) ; if ( sConn == 0 && containedInOneGraph(subj) ) freeBnodes.add(subj) ; } else if ( subj.isNodeTriple() ) { extractBlankNodesInTripleTerms(blankNodesInTripleTerms, subj); } if ( obj.isNodeTriple() ) { extractBlankNodesInTripleTerms(blankNodesInTripleTerms, obj); continue; } if ( ! obj.isBlank() ) continue ; if ( rejects.contains(obj) ) continue ; int connectivity = inLinks(obj) ; if ( connectivity == 1 && containedInOneGraph(obj) ) { nestedObjects.add(obj) ; } else rejects.add(obj) ; } freeBnodes.removeAll(blankNodesInTripleTerms); nestedObjects.removeAll(blankNodesInTripleTerms); } finally { iter.close() ; } }
Source:
<code>private void writeObject(ObjectOutputStream out) throws IOException { writeNotNull(out, commit); writeNotNull(out, into); <START> writeVarInt32(out, submitType.ordinal()); <END> }</code><technical_language>I thought persist enums strings cache, in case cute idea delete a reorder them</technical_language>

Target:
private void writeObject(ObjectOutputStream out) throws IOException { writeNotNull(out, commit); writeNotNull(out, into); writeEnum(out, submitType); }
Source:
<code>private void startBackgroundTemperatureRefresh() { Runnable runnable = new Runnable() { @Override public void run() { try { <START> getTemprature(); <END> } catch (Exception e) { logger.debug("Exception occurred during execution: {}", e.getMessage(), e); } } }; refreshTemperatureJob = scheduler.scheduleAtFixedRate(runnable, 0, refresh.intValue(), TimeUnit.SECONDS); }</code><technical_language>typo: getTemperature</technical_language>

Target:
private void startBackgroundTemperatureRefresh() { Runnable runnable = new Runnable() { @Override public void run() { try { getTemperature(); } catch (Exception e) { logger.debug("Exception occurred during execution: {}", e.getMessage(), e); } } }; refreshTemperatureJob = scheduler.scheduleAtFixedRate(runnable, 0, refresh.intValue(), TimeUnit.SECONDS); }
Source:
<code>public ModuleDeploymentProperties setCount(int count) { <START> put(COUNT, "" + count); <END> return this; }</code><technical_language>above, String.valueOf here</technical_language>

Target:
public ModuleDeploymentProperties setCount(int count) { put(COUNT_KEY, String.valueOf(count)); return this; }
Source:
<code>public void cache_instance_of_StorageFactory_in_testing() { <START> Supplier<StorageFactory> testingSupplier = spy(inMemorySupplier); <END> storageFactorySwitch.init(inMemorySupplier, testingSupplier); Environment.getInstance().setToTests(); storageFactorySwitch.get(); storageFactorySwitch.get(); verify(testingSupplier, times(1)).get(); }</code><technical_language>final</technical_language>

Target:
public void cache_instance_of_StorageFactory_in_testing() { final Supplier<StorageFactory> testingSupplier = spy(inMemorySupplier); storageFactorySwitch.init(inMemorySupplier, testingSupplier); Environment.getInstance().setToTests(); storageFactorySwitch.get(); storageFactorySwitch.get(); verify(testingSupplier, times(1)).get(); }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_web_gui); mLoadingView = findViewById(R.id.loading); mConfig = new ConfigXml(this); loadCaCert(); mWebView = findViewById(R.id.webview); <START> setWebViewProxy(mWebView.getContext().getApplicationContext(), "", 0, "localhost|0.0.0.0|127.*|[::1]"); <END> mWebView.getSettings().setJavaScriptEnabled(true); mWebView.setWebViewClient(mWebViewClient); mWebView.clearCache(true); }</code><technical_language><LINK_0> This suggests comma separated? I confident works</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_web_gui); mLoadingView = findViewById(R.id.loading); mConfig = new ConfigXml(this); loadCaCert(); mWebView = findViewById(R.id.webview); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setDomStorageEnabled(true); mWebView.setWebViewClient(mWebViewClient); mWebView.clearCache(true); }
Source:
<code>private JobIdData submit(String sessionId, InputStream job, MediaType mediaType, Map<String, String> variables, Map<String, String> genericInfos) throws Exception { String uriTmpl = restEndpointURL + addSlashIfMissing(restEndpointURL) + "scheduler/submit"; ResteasyClient client = new ResteasyClientBuilder().httpEngine(httpEngine) .providerFactory(providerFactory) .build(); ResteasyWebTarget target = client.target(uriTmpl); if (variables != null) { for (String key : variables.keySet()) { target = target.matrixParam(key, variables.get(key)); } } if (genericInfos != null) { <START> for (String key : genericInfos.keySet()) { <END> target = target.queryParam(key, genericInfos.get(key)); } } MultipartFormDataOutput formData = new MultipartFormDataOutput(); formData.addFormData("file", job, mediaType); GenericEntity<MultipartFormDataOutput> entity = new GenericEntity<MultipartFormDataOutput>(formData) { }; Response response = target.request() .header("sessionid", sessionId) .post(Entity.entity(entity, MediaType.MULTIPART_FORM_DATA_TYPE)); if (response.getStatus() != HttpURLConnection.HTTP_OK) { if (response.getStatus() == HttpURLConnection.HTTP_UNAUTHORIZED) { throw new NotConnectedRestException("User not authenticated or session timeout."); } else { throwException(String.format("Job submission failed status code: %d", response.getStatus()), response); } } return response.readEntity(JobIdData.class); }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') Iterate "entrySet" instead of "keySet". [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
private JobIdData submit(String sessionId, InputStream job, MediaType mediaType, Map<String, String> variables, Map<String, String> genericInfos) throws NotConnectedRestException { String uriTmpl = restEndpointURL + addSlashIfMissing(restEndpointURL) + "scheduler/submit"; ResteasyClient client = new ResteasyClientBuilder().httpEngine(httpEngine) .providerFactory(providerFactory) .build(); ResteasyWebTarget target = client.target(uriTmpl); if (variables != null) { for (String key : variables.keySet()) { target = target.matrixParam(key, variables.get(key)); } } if (genericInfos != null) { for (String key : genericInfos.keySet()) { target = target.queryParam(key, genericInfos.get(key)); } } MultipartFormDataOutput formData = new MultipartFormDataOutput(); formData.addFormData("file", job, mediaType); GenericEntity<MultipartFormDataOutput> entity = new GenericEntity<MultipartFormDataOutput>(formData) { }; Response response = target.request() .header("sessionid", sessionId) .post(Entity.entity(entity, MediaType.MULTIPART_FORM_DATA_TYPE)); if (response.getStatus() != HttpURLConnection.HTTP_OK) { if (response.getStatus() == HttpURLConnection.HTTP_UNAUTHORIZED) { throw new NotConnectedRestException("User not authenticated or session timeout."); } else { throwException(String.format("Job submission failed status code: %d", response.getStatus()), response); } } return response.readEntity(JobIdData.class); }
Source:
<code>public void saveVault(Player player, Inventory inventory) { if (plugin.getInVault().containsKey(player.getUniqueId().toString())) { Inventory inv = Bukkit.createInventory(null, 6 * 9); inv.setContents(inventory.getContents().clone()); <START> if (inventory.getViewers().size() >= 1) { <END> VaultViewInfo info = plugin.getInVault().get(player.getUniqueId().toString()); vaultManager.saveVault(inv, info.getHolderUUID(), info.getNumber()); plugin.getOpenInventories().remove(info.toString()); } plugin.getInVault().remove(player.getUniqueId().toString()); } }</code><technical_language>This 1 issues if else is viewing vault a player closes inventory</technical_language>

Target:
public void saveVault(Player player, Inventory inventory) { if (plugin.getInVault().containsKey(player.getUniqueId().toString())) { Inventory inv = Bukkit.createInventory(null, 6 * 9); inv.setContents(inventory.getContents().clone()); if (inventory.getViewers().size() == 1) { VaultViewInfo info = plugin.getInVault().get(player.getUniqueId().toString()); vaultManager.saveVault(inv, info.getHolderUUID(), info.getNumber()); plugin.getOpenInventories().remove(info.toString()); } plugin.getInVault().remove(player.getUniqueId().toString()); } }
Source:
<code>private void ensureExist(String path, String prop) throws IOException { Path folder = Paths.get(path); if (Files.notExists(folder)) { Files.createDirectory(folder); } if (!Files.isDirectory(folder)) { <START> throw new IOException(String.format("Projects folder %s is invalid. Check %s configuration property.", path, prop)); <END> } }</code><technical_language>I this message is abstract, simpler understand problem if include information problem is file is **A DIRECTORY**</technical_language>

Target:
private void ensureExist(String path, String prop) throws IOException { Path folder = Paths.get(path); if (Files.notExists(folder)) { Files.createDirectory(folder); } if (!Files.isDirectory(folder)) { throw new IOException(String.format("Projects %s is not directory. Check %s configuration property.", path, prop)); } }
Source:
<code><START> @Test public void listFilesTest() throws IOException { <END> List<Object> expected = new ArrayList<>(); expectedPaths().forEach(expected::add); List<Object> actual = new ArrayList<>(); BundleGeneratorUtils.listFiles(DIRECTORY).forEach(actual::add); assert TestUtils.isMatching(expected, actual); }</code><technical_language>check formatting</technical_language>

Target:
public void listFilesTest() throws IOException { List<Object> expected = new ArrayList<>(); expectedPaths().forEach(expected::add); List<Object> actual = new ArrayList<>(); BundleGeneratorUtils.listFiles(DIRECTORY).forEach(actual::add); assert TestUtils.isMatching(expected, actual); }