auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected final List<HtmlIssue> verify() { File file = new File(filename); FileReader fileReader; try { <START> fileReader = new FileReader(file); <END> } catch (FileNotFoundException e) { throw Throwables.propagate(e); } HtmlSourceCode result = new HtmlSourceCode( new TestInputFileBuilder("key", file.getPath()) .setLanguage(HtmlConstants.LANGUAGE_KEY) .setType(InputFile.Type.MAIN) .setModuleBaseDir(new File(".").toPath()) .setCharset(StandardCharsets.UTF_8) .build() ); HtlScanner scanner = new HtlScanner(); HtmlCheckVerifier htmlCheckVerifier = new HtmlCheckVerifier(); scanner.addVisitor(new ExpectedIssueCollector(htmlCheckVerifier)); if (check != null) { Class<? extends HtlCheck> htlCheck = check.getClass(); Rule rule = HtlCheckClasses.getRule(htlCheck); RuleKey ruleKey = RuleKey.of(HtlCheckClasses.REPOSITORY_KEY, rule.key()); check.setRuleKey(ruleKey); } scanner.addVisitor(check); scanner.scan(new HtlLexer().parse(fileReader), result); htmlCheckVerifier.checkIssues(result.getIssues()); return result.getIssues(); }</code><technical_language>Good practice is close FileReader</technical_language>

Target:
protected final List<HtmlIssue> verify() { File file = new File(filename); HtmlSourceCode result = createSourceCode(file); HtmlCheckVerifier htmlCheckVerifier = new HtmlCheckVerifier(); HtlScanner scanner = setupScanner(check, htmlCheckVerifier); try (FileReader fileReader = new FileReader(file)) { scanner.scan(new HtlLexer().parse(fileReader), result); } catch (IOException e) { throw Throwables.propagate(e); } htmlCheckVerifier.checkIssues(result.getIssues()); return result.getIssues(); }
Source:
<code>public boolean accepts(@NotNull T element, ProcessingContext context) { ErlangQAtom argument = element instanceof ErlangQAtom ? (ErlangQAtom) element : null; if (argument == null) return false; <START> ErlangFunctionCallExpression call = PsiTreeUtil.getParentOfType(argument, ErlangFunctionCallExpression.class); <END> ErlangFunction function = resolveToFunction(call); if (function == null) return false; int position = getPositionOfArgument(argument); if (position == -1) return false; for (ErlangFunctionClause clause : function.getFunctionClauseList()) { List<ErlangArgumentDefinition> definitions = clause.getArgumentDefinitionList().getArgumentDefinitionList(); ErlangArgumentDefinition definition = definitions.size() > position ? definitions.get(position) : null; ErlangQVar var = PsiTreeUtil.findChildOfType(definition, ErlangQVar.class); if (var != null && NAMES.contains(var.getName())) { return true; } } return false; }</code><technical_language>for function call expression recursively - wrong, bad performance-wise</technical_language>

Target:
public boolean accepts(@NotNull T element, ProcessingContext context) { ErlangQAtom argument = element instanceof ErlangQAtom ? (ErlangQAtom) element : null; if (argument == null) return false; int position = getPositionOfArgument(argument); if (position == -1) return false; ErlangFunctionCallExpression call = getFunctionCallExpression(argument); List<ErlangFunction> functions = resolveToFunctions(call); for (ErlangFunction function : functions) { for (ErlangFunctionClause clause : function.getFunctionClauseList()) { List<ErlangArgumentDefinition> definitions = clause.getArgumentDefinitionList().getArgumentDefinitionList(); ErlangArgumentDefinition definition = definitions.size() > position ? definitions.get(position) : null; ErlangMaxExpression maxExpression = PsiTreeUtil.getChildOfType(definition, ErlangMaxExpression.class); ErlangQVar var = PsiTreeUtil.getChildOfType(maxExpression, ErlangQVar.class); if (var != null && NAMES.contains(var.getName())) { return true; } } } return false; }
Source:
<code>public void testInjectArtifactReference() throws Exception { File basedir = getBasedir("projects/iuWithPayloadButNoArtifactReference"); File platform = new File("src/test/resources/eclipse"); List<MavenProject> projects = getSortedProjects(basedir, platform); MavenProject project = getProject(projects, "iuWithPayloadButNoArtifactReference"); MavenSession session = newMavenSession(project, projects); lookupMojoWithDefaultConfiguration(project, session, "build-qualifier").execute(); PackageIUMojo mojo = (PackageIUMojo) lookupConfiguredMojo(project, "package-iu"); setVariableValueToObject(mojo, "artifactContentFolder", new File(basedir, "src/main/resources").getAbsolutePath()); mojo.execute(); IU iu = IU.loadIU(new File(basedir, "target")); Element artifact = iu.getSelfArtifact(); assertNotNull(artifact); assertThat(artifact.getAttributeValue("classifier"), <START> equalTo("binary")); <END> assertThat(artifact.getAttributeValue("id"), equalTo("iuWithPayloadButNoArtifactReference")); assertThat(artifact.getAttributeValue("version"), equalTo("1.0.0")); }</code><technical_language>Interesting, this matcher. "is" same, is more common AFAIK one</technical_language>

Target:
public void testInjectArtifactReference() throws Exception { File basedir = getBasedir("projects/iuWithPayloadButNoArtifactReference"); File platform = new File("src/test/resources/eclipse"); List<MavenProject> projects = getSortedProjects(basedir, platform); MavenProject project = getProject(projects, "iuWithPayloadButNoArtifactReference"); MavenSession session = newMavenSession(project, projects); lookupMojoWithDefaultConfiguration(project, session, "build-qualifier").execute(); PackageIUMojo mojo = (PackageIUMojo) lookupConfiguredMojo(project, "package-iu"); setVariableValueToObject(mojo, "artifactContentFolder", new File(basedir, "src/main/resources").getAbsolutePath()); mojo.execute(); IU iu = IU.loadIU(new File(basedir, "target")); Element artifact = iu.getSelfArtifact(); assertNotNull(artifact); assertThat(artifact.getAttributeValue("classifier"), is("binary")); assertThat(artifact.getAttributeValue("id"), is("iuWithPayloadButNoArtifactReference")); assertThat(artifact.getAttributeValue("version"), is("1.0.0")); }
Source:
<code>public byte[] getBytes() { byte[] bytes = new byte[value.remaining()]; value.mark(); value.get(bytes).reset(); <START> cachedBytes = bytes; <END> return bytes; }</code><technical_language>bytes cached if backing buffer reused. If is reused, backing buffer change cachedBytes stale</technical_language>

Target:
public byte[] getBytes() { byte[] bytes = new byte[value.remaining()]; value.mark(); value.get(bytes).reset(); if (!isBackingBytesReused) { cachedBytes = bytes; } return bytes; }
Source:
<code>private RefreshItem getRefreshToken(final AuthenticationRequest request) { RefreshItem refreshItem = null; if (mTokenCacheStore != null) { boolean multiResource = false; Logger.v(TAG, "Looking for regular refresh token" + getCorrelationLogInfo()); String userId = request.getUserId(); if (StringExtensions.IsNullOrBlank(userId)) { userId = request.getLoginHint(); } String keyUsed = CacheKey.createCacheKey(request, userId); TokenCacheItem item = mTokenCacheStore.getItem(keyUsed); if (item == null || StringExtensions.IsNullOrBlank(item.getRefreshToken())) { Logger.v(TAG, "Looking for Multi Resource Refresh token" + getCorrelationLogInfo()); keyUsed = CacheKey.createMultiResourceRefreshTokenKey(request, userId); item = mTokenCacheStore.getItem(keyUsed); multiResource = true; } if (item != null && !StringExtensions.IsNullOrBlank(item.getRefreshToken())) { String refreshTokenHash = getTokenHash(item.getRefreshToken()); Logger.v(TAG, "Refresh token is available and id:" + refreshTokenHash + " Key used:" + keyUsed + getCorrelationLogInfo()); String keyWithUserId = ""; String keyWithDisplayableId = ""; if(item.getUserInfo() != null){ <START> keyWithUserId = CacheKey.createCacheKey(request, item.getUserInfo().getUserId()); <END> keyWithDisplayableId = CacheKey.createCacheKey(request, item.getUserInfo().getDisplayableId()); } refreshItem = new RefreshItem(keyUsed, item.getRefreshToken(), multiResource, item.getUserInfo(), item.getRawIdToken(), keyWithUserId, keyWithDisplayableId); } } return refreshItem; }</code><technical_language>If source of additional parameters is item.getUserInfo, move methods RefreshItem constructor well</technical_language>

Target:
private RefreshItem getRefreshToken(final AuthenticationRequest request) { RefreshItem refreshItem = null; if (mTokenCacheStore != null) { boolean multiResource = false; Logger.v(TAG, "Looking for regular refresh token" + getCorrelationLogInfo()); String userId = request.getUserId(); if (StringExtensions.IsNullOrBlank(userId)) { userId = request.getLoginHint(); } String keyUsed = CacheKey.createCacheKey(request, userId); TokenCacheItem item = mTokenCacheStore.getItem(keyUsed); if (item == null || StringExtensions.IsNullOrBlank(item.getRefreshToken())) { Logger.v(TAG, "Looking for Multi Resource Refresh token" + getCorrelationLogInfo()); keyUsed = CacheKey.createMultiResourceRefreshTokenKey(request, userId); item = mTokenCacheStore.getItem(keyUsed); multiResource = true; } if (item != null && !StringExtensions.IsNullOrBlank(item.getRefreshToken())) { String refreshTokenHash = getTokenHash(item.getRefreshToken()); Logger.v(TAG, "Refresh token is available and id:" + refreshTokenHash + " Key used:" + keyUsed + getCorrelationLogInfo()); refreshItem = new RefreshItem(keyUsed, request, item, multiResource); } } return refreshItem; }
Source:
<code>public void run() { try { Collection<MemberImpl> membersToRemove = partialDisconnectionHandler.resolve(disconnections); clusterServiceLock.lock(); try { for (MemberImpl member : membersToRemove) { if (getMember(member.getAddress(), member.getUuid()) == null) { logger.warning("Won't remove partially disconnected members: " + membersToRemove); return; } } for (MemberImpl member : membersToRemove) { String reason = format("Removing %s because it has disconnected from some of the members!", member); logger.warning(reason); suspectMember(member, reason, true); } } finally { clusterServiceLock.unlock(); } } catch (Exception e) { <START> logger.severe("Partial disconnection resolution algorithm failed.", e); <END> clusterServiceLock.lock(); try { partialDisconnectionHandler.reset(); } finally { clusterServiceLock.unlock(); } } }</code><technical_language>filter out algorithm timeout? Due understanding, this is a severe failure..</technical_language>

Target:
public void run() { try { Collection<MemberImpl> membersToRemove = partialDisconnectionHandler.resolve(disconnections); clusterServiceLock.lock(); try { if (!clusterService.isMaster()) { if (suspectedMembers.size() > 0) { logger.warning("Won't remove partially disconnected members: " + membersToRemove + " because I am no longer the master!"); } return; } for (MemberImpl member : membersToRemove) { if (getMember(member.getAddress(), member.getUuid()) == null) { logger.warning("Won't remove partially disconnected members: " + membersToRemove + " because " + member + " is not in the cluster member list anymore!"); return; } } for (MemberImpl member : membersToRemove) { String reason = format("Removing %s because it has disconnected from some of the members!", member); logger.warning(reason); suspectMember(member, reason, true); } } finally { clusterServiceLock.unlock(); } } catch (TimeoutException e) { if (logger.isFineEnabled()) { logger.severe("Partial disconnection resolution algorithm timed out!"); } resetPartialDisconnectionHandler(); } catch (Exception e) { logger.severe("Partial disconnection resolution algorithm failed!", e); resetPartialDisconnectionHandler(); } }
Source:
<code>public void testGetAuthorization() throws PayPalRESTException { Payment payment = getPaymentAgainstAuthorization(); <START> Payment authPayment = payment.create(TestConstants.SANDBOXCONTEXT); <END> authorizationId = authPayment.getTransactions().get(0) .getRelatedResources().get(0).getAuthorization().getId(); authorization = Authorization.get(TestConstants.SANDBOXCONTEXT, authorizationId); Assert.assertEquals(authorization.getId(), authPayment.getTransactions().get(0) .getRelatedResources().get(0).getAuthorization().getId()); logger.info("Authorization State: " + authorization.getState()); }</code><technical_language>Generally constant multiple words SANDBOX_CONTEXT</technical_language>

Target:
public void testGetAuthorization() throws PayPalRESTException { Payment payment = getPaymentAgainstAuthorization(); Payment authPayment = payment.create(TestConstants.SANDBOX_CONTEXT); authorizationId = authPayment.getTransactions().get(0) .getRelatedResources().get(0).getAuthorization().getId(); authorization = Authorization.get(TestConstants.SANDBOX_CONTEXT, authorizationId); Assert.assertEquals(authorization.getId(), authPayment.getTransactions().get(0) .getRelatedResources().get(0).getAuthorization().getId()); logger.info("Authorization State: " + authorization.getState()); }
Source:
<code>protected KeyManager[] engineGetKeyManagers() { <START> ObjectUtil.checkNotNull(km, "KeyManagerFactoryWrapper is created with null KeyManager value"); <END> return new KeyManager[] {km}; }</code><technical_language>remove this do check in constructor fail fast</technical_language>

Target:
protected KeyManager[] engineGetKeyManagers() { return new KeyManager[] {km}; }
Source:
<code>void init(SortedKeyValueIterator<K,V> source, Map<String,String> options, IteratorEnvironment env) throws IOException; boolean hasTop(); void next() throws IOException; void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException; K getTopKey(); V getTopValue(); SortedKeyValueIterator<K,V> deepCopy(IteratorEnvironment env); @Override <START> default void close() throws Exception { <END> }</code><technical_language>Is useful Exception generic, narrow Exception type interface</technical_language>

Target:
void init(SortedKeyValueIterator<K,V> source, Map<String,String> options, IteratorEnvironment env) throws IOException; boolean hasTop(); void next() throws IOException; void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException; K getTopKey(); V getTopValue(); SortedKeyValueIterator<K,V> deepCopy(IteratorEnvironment env); @Override default void close() { }
Source:
<code>private void setLastUsedBranch() { String lastBranch = settings.get(lastBranchKey); <START> if (lastBranch != null) { <END> branchText.setText(lastBranch); } }</code><technical_language>braces here, more occurrences in this file</technical_language>

Target:
private void setLastUsedBranch() { String lastBranch = settings.get(lastBranchKey); if (lastBranch != null) branchText.setText(lastBranch); }
Source:
<code>public void directoryNullFilterTest() throws IOException { <START> List<File> files = new ArrayList<File>(); <END> File temp1 = tempDirectory.newFile(); files.add(temp1); File temp2 = tempDirectory.newFile(); files.add(temp2); DirectorySampleStream stream = new DirectorySampleStream(tempDirectory.getRoot(), null, false); File file = stream.read(); assertTrue(files.contains(file)); file = stream.read(); assertTrue(files.contains(file)); file = stream.read(); assertNull(file); stream.close(); }</code><technical_language>need define type RHS, replace diamond <></technical_language>

Target:
public void directoryNullFilterTest() throws IOException { List<File> files = new ArrayList<>(); File temp1 = tempDirectory.newFile(); files.add(temp1); File temp2 = tempDirectory.newFile(); files.add(temp2); DirectorySampleStream stream = new DirectorySampleStream(tempDirectory.getRoot(), null, false); File file = stream.read(); Assert.assertTrue(files.contains(file)); file = stream.read(); Assert.assertTrue(files.contains(file)); file = stream.read(); Assert.assertNull(file); stream.close(); }
Source:
<code>public void startBucket(String bucketKey) { BulkCommand command = getCurrentCommand(); <START> description = (String) command.getParam(PARAM_DESC); <END> }</code><technical_language>cast is needed</technical_language>

Target:
public void startBucket(String bucketKey) { BulkCommand command = getCurrentCommand(); description = command.getParam(PARAM_DESC); }
Source:
<code>public void batchingOfWritesShouldNotAffectCompressedDataSize() throws Exception { byte[] orig = CalgaryTest.readFile("alice29.txt"); byte[] expectedCompressedData = compressAsChunks(orig, Integer.MAX_VALUE); <START> assertTrue(String.format("unexpected compressed data size (%d)", expectedCompressedData.length), <END> (expectedCompressedData.length == 91013 || expectedCompressedData.length == 90943)); int[] chunkSizes = new int[] {1, 100, 1023, 1024, 10000}; for (int chunkSize : chunkSizes) { byte[] compressedData = compressAsChunks(orig, chunkSize); assertEquals(String.format("when chunk size = %,d", chunkSize), expectedCompressedData.length, compressedData.length); assertArrayEquals(expectedCompressedData, compressedData); } }</code><technical_language>ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN check big-endian platform</technical_language>

Target:
public void batchingOfWritesShouldNotAffectCompressedDataSize() throws Exception { byte[] orig = CalgaryTest.readFile("alice29.txt"); byte[] expectedCompressedData = compressAsChunks(orig, Integer.MAX_VALUE); if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN) assertEquals(90943, expectedCompressedData.length); else assertEquals(91013, expectedCompressedData.length); int[] chunkSizes = new int[] {1, 100, 1023, 1024, 10000}; for (int chunkSize : chunkSizes) { byte[] compressedData = compressAsChunks(orig, chunkSize); assertEquals(String.format("when chunk size = %,d", chunkSize), expectedCompressedData.length, compressedData.length); assertArrayEquals(expectedCompressedData, compressedData); } }
Source:
<code>public VersionNumber getNeededDependenciesRequiredCore() { VersionNumber versionNumber = null; try { versionNumber = requiredCore == null ? null : new VersionNumber(requiredCore); } catch (NumberFormatException nfe) { } for (Plugin p: getAllDependencies()) { <START> VersionNumber v = new VersionNumber(p.version); <END> if (versionNumber == null || v.isNewerThan(versionNumber)) versionNumber = v; } return versionNumber; }</code><technical_language>This wrong, needs a core version, a plugin version, right? I replaced new VersionNumber(p.requiredCore)</technical_language>

Target:
public VersionNumber getNeededDependenciesRequiredCore() { VersionNumber versionNumber = null; try { versionNumber = requiredCore == null ? null : new VersionNumber(requiredCore); } catch (NumberFormatException nfe) { } for (Plugin p: getAllDependencies()) { VersionNumber v = new VersionNumber(p.requiredCore); if (versionNumber == null || v.isNewerThan(versionNumber)) versionNumber = v; } return versionNumber; }
Source:
<code>protected void awaitConsistency() { <START> Uninterruptibles.sleepUninterruptibly(5, TimeUnit.SECONDS); <END> }</code><technical_language>this test.blobstore.await-consistency-timeout-seconds property BaseBlobStoreIntegrationTest</technical_language>

Target:
protected void awaitConsistency() { Uninterruptibles.sleepUninterruptibly(AWAIT_CONSISTENCY_TIMEOUT_SECONDS, TimeUnit.SECONDS); }
Source:
<code>public HornetqEventDispatcher(ObjectMapper mapper, Config config) { this.mapper = mapper; try { largeMsgSize = config.getInt(ConfigProperties.HORNETQ_LARGE_MSG_SIZE); factory = createClientSessionFactory(); } catch (HornetQException e) { throw new RuntimeException(e); } catch (Exception e) { throw new RuntimeException(e); <START> } <END> }</code><technical_language>consolidate catch clauses? is HornetQException a RuntimeException</technical_language>

Target:
public HornetqEventDispatcher(ObjectMapper mapper, Config config) { this.mapper = mapper; try { largeMsgSize = config.getInt(ConfigProperties.HORNETQ_LARGE_MSG_SIZE); factory = createClientSessionFactory(); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>public void callsActOnProperMethods() throws Exception { final String method = "WHATEVER"; final Take take = Mockito.mock(Take.class); <START> final RqFake propreq = new RqFake(method); <END> new TkMethods(take, method).act(propreq); Mockito.verify( take, Mockito.times(1) ).act( Matchers.argThat( CoreMatchers.equalTo(propreq) ) ); }</code><technical_language>req</technical_language>

Target:
public void callsActOnProperMethods() throws Exception { final String method = "WHATEVER"; final Take take = Mockito.mock(Take.class); final RqFake req = new RqFake(method); new TkMethods(take, method).act(req); Mockito.verify(take).act( Matchers.argThat( CoreMatchers.equalTo(req) ) ); }
Source:
<code><START> public HttpRequest filterSAS(HttpRequest request, String credential) throws HttpException { <END> String containerName = ""; String blobName = ""; String requestLine = request.getRequestLine(); String[] containerBlob = cutUri(requestLine); if (containerBlob[0] != null) { containerName = containerBlob[0]; } if (containerBlob[1] != null) { blobName = containerBlob[1]; } request = request.toBuilder().endpoint(Uris.uriBuilder(storageUrl).appendPath(containerName).appendPath(blobName).query(credential).build()).build(); request = replaceDateHeader(request); request = removeAuthorizationHeader(request); return request; }</code><technical_language>Fix indentation. Note jclouds 3-space indents tabs</technical_language>

Target:
public HttpRequest filterSAS(HttpRequest request, String credential) throws HttpException, IllegalArgumentException { URI requestUri = request.getEndpoint(); String formattedCredential = credential.startsWith("?") ? credential.substring(1) : credential; String initialQuery = requestUri.getQuery(); String finalQuery = initialQuery == null ? formattedCredential : initialQuery + "&" + formattedCredential; String[] parametersArray = cutUri(requestUri); String containerName = parametersArray[1]; UriBuilder endpoint = Uris.uriBuilder(storageUrl).appendPath(containerName); if (parametersArray.length == 3) { endpoint.appendPath(parametersArray[2]).query(finalQuery); } else { endpoint.query("restype=container&" + finalQuery); } return removeAuthorizationHeader( replaceDateHeader(request.toBuilder() .endpoint(endpoint.build()) .build())); }
Source:
<code>public static Block intersect( @TypeParameter("E") Type type, @SqlType("array(E)") Block leftArray, @SqlType("array(E)") Block rightArray) { int leftPositionCount = leftArray.getPositionCount(); int rightPositionCount = rightArray.getPositionCount(); if (rightPositionCount == 0) { return rightArray; } TypedSet leftTypedSet = new TypedSet(type, leftPositionCount, "array_intersect"); <START> for (int i = 0; i < leftPositionCount; i++) { <END> leftTypedSet.add(leftArray, i); } TypedSet rightTypedSet = new TypedSet(type, rightPositionCount, "array_intersect"); BlockBuilder blockBuilder = type.createBlockBuilder(null, rightPositionCount); for (int i = 0; i < rightPositionCount; i++) { if (leftTypedSet.contains(rightArray, i) && rightTypedSet.add(rightArray, i)) { type.appendTo(rightArray, i, blockBuilder); } } return blockBuilder.build(); }</code><technical_language>This helpful right? reverse logic. left shorter one</technical_language>

Target:
public static Block intersect( @TypeParameter("E") Type type, @SqlType("array(E)") Block leftArray, @SqlType("array(E)") Block rightArray) { if (leftArray.getPositionCount() < rightArray.getPositionCount()) { Block tempArray = leftArray; leftArray = rightArray; rightArray = tempArray; } int leftPositionCount = leftArray.getPositionCount(); int rightPositionCount = rightArray.getPositionCount(); if (rightPositionCount == 0) { return rightArray; } TypedSet rightTypedSet = new TypedSet(type, rightPositionCount, "array_intersect"); for (int i = 0; i < rightPositionCount; i++) { rightTypedSet.add(rightArray, i); } BlockBuilder blockBuilder = type.createBlockBuilder(null, Math.min(leftPositionCount, rightPositionCount)); TypedSet intersectTypedSet = new TypedSet(type, blockBuilder, rightPositionCount, "array_intersect"); for (int i = 0; i < leftPositionCount; i++) { if (rightTypedSet.contains(leftArray, i)) { intersectTypedSet.add(leftArray, i); } } return blockBuilder.build(); }
Source:
<code>RouterNetworkComponents getRouterNetworkComponents() <START> throws Exception { <END> Selector selector = new Selector(networkMetrics, time, sslFactory); ConnectionManager connectionManager = new NonBlockingConnectionManager(selector, networkConfig, maxConnectionsPerPortPlainText, maxConnectionsPerPortSsl, time); return new RouterNetworkComponents(selector, connectionManager); }</code><technical_language>is Exception here? I SSLFactory constructor throws Exception I other IOException this function</technical_language>

Target:
RouterNetworkComponents getRouterNetworkComponents() throws IOException { Selector selector = new Selector(networkMetrics, time, sslFactory); ConnectionManager connectionManager = new NonBlockingConnectionManager(selector, networkConfig, maxConnectionsPerPortPlainText, maxConnectionsPerPortSsl, time); return new RouterNetworkComponents(selector, connectionManager); }
Source:
<code>public String toString() { return "PrefixFilteredDimensionSpec{" + <START> "Prefix='" + NullHandling.nullToEmptyIfNeeded(prefix) + '\'' + <END> '}'; }</code><technical_language>"prefix" a null check in constructor, nullToEmpty call is needed</technical_language>

Target:
public String toString() { return "PrefixFilteredDimensionSpec{" + "Prefix='" + prefix + '\'' + '}'; }
Source:
<code>public synchronized void merge( IndexWriter writer, MergeTrigger trigger, boolean newMergesFound ) throws IOException { while ( true ) { MergePolicy.OneMerge merge = writer.getNextMerge(); if ( merge == null ) { return; } boolean success = false; try { MergeThread mergeThread = getMergeThread( writer, merge ); writerTaskCounter.incrementAndGet(); PooledConcurrentMergePool.mergeThreadsPool.submit( mergeTask( mergeThread ) ); success = true; } finally { if ( !success ) { <START> writerTaskCounter.decrementAndGet(); <END> writer.mergeFinish( merge ); } } } }</code><technical_language>decrement happen mergeFinish waitForAllTasks observe finished merges</technical_language>

Target:
public synchronized void merge( IndexWriter writer, MergeTrigger trigger, boolean newMergesFound ) throws IOException { while ( true ) { MergePolicy.OneMerge merge = writer.getNextMerge(); if ( merge == null ) { return; } boolean success = false; try { MergeThread mergeThread = getMergeThread( writer, merge ); writerTaskCounter.incrementAndGet(); PooledConcurrentMergePool.mergeThreadsPool.submit( mergeTask( mergeThread ) ); success = true; } finally { if ( !success ) { writer.mergeFinish( merge ); writerTaskCounter.decrementAndGet(); } } } }
Source:
<code>private void rmFile(Resource r, CommandInvocation commandInvocation) { Shell shell = commandInvocation.getShell(); if (r.exists()) { if (r.isLeaf()) { if (interactive) { shell.out().println("remove regular file '" + r.getName() + "' ? (y/n)"); CommandOperation operation = null; try { operation = commandInvocation.getInput(); } catch (InterruptedException e) { <START> } <END> if (operation.getInputKey() == Key.y) { r.delete(); } } else { r.delete(); } if (verbose) { shell.out().println("removed '" + r.getName() + "'"); } } else if (r.isDirectory()) { shell.out().println("cannot remove '" + r.getName() + "': Is a directory"); } } }</code><technical_language>catch interrupted exception catch if presses ctrl-c/etc want abort. method throw interruptedexception, execut method throw interruptedexception</technical_language>

Target:
private void rmFile(Resource r, CommandInvocation commandInvocation) throws InterruptedException { Shell shell = commandInvocation.getShell(); if (r.exists()) { if (r.isLeaf()) { if (interactive) { shell.out().println("remove regular file '" + r.getName() + "' ? (y/n)"); CommandOperation operation = commandInvocation.getInput();; if (operation.getInputKey() == Key.y) { r.delete(); } } else { r.delete(); } if (verbose) { shell.out().println("removed '" + r.getName() + "'"); } } else if (r.isDirectory()) { shell.out().println("cannot remove '" + r.getName() + "': Is a directory"); } } }
Source:
<code>@Override public String toString() { final StringBuilder outputStreamStats = new StringBuilder( "OutputStream Statistics{"); <START> outputStreamStats.append(", BYTES_UPLOAD=").append(bytesToUpload); <END> outputStreamStats.append(", BYTES_UPLOAD_SUCCESSFUL=") .append(bytesUploadSuccessful); outputStreamStats.append(", BYTES_UPLOAD_FAILED=") .append(bytesUploadFailed); outputStreamStats.append(", TIME_SPEND_WAIT_TASK=") .append(timeSpendOnTaskWait); outputStreamStats.append(", QUEUE_SHRINK=").append(queueShrunkOps); outputStreamStats.append(", WRITE_CURRENT_BUFFER=") .append(writeCurrentBufferOperations); outputStreamStats.append("}"); return outputStreamStats.toString(); }</code><technical_language>need capitals</technical_language>

Target:
@Override public String toString() { final StringBuilder outputStreamStats = new StringBuilder( "OutputStream Statistics{"); outputStreamStats.append(", bytes_upload=").append(bytesToUpload); outputStreamStats.append(", bytes_upload_successfully=") .append(bytesUploadSuccessful); outputStreamStats.append(", bytes_upload_failed=") .append(bytesUploadFailed); outputStreamStats.append(", time_spent_task_wait=") .append(timeSpentOnTaskWait); outputStreamStats.append(", queue_shrunk_ops=").append(queueShrunkOps); outputStreamStats.append(", write_current_buffer_ops=") .append(writeCurrentBufferOperations); outputStreamStats.append("}"); return outputStreamStats.toString(); }
Source:
<code>public synchronized void setAfterAckCallback(java.util.function.Consumer<Channel> callback) { <START> if (getPendingConfirmsCount() == 0) { <END> callback.accept(this); } else { this.afterAckCallback = callback; } }</code><technical_language>Assert.notNull() for callback</technical_language>

Target:
public synchronized void setAfterAckCallback(java.util.function.Consumer<Channel> callback) { if (getPendingConfirmsCount() == 0 && callback != null) { callback.accept(this); } else { this.afterAckCallback = callback; } }
Source:
<code>public T head() { <START> if (elements != 0) { <END> return fromInt.apply(Long.numberOfTrailingZeros(elements)); } throw new NoSuchElementException("head of empty BitSet"); }</code><technical_language>please invert if, guard is in branch codebase :)</technical_language>

Target:
public T head() { if (elements == 0) { throw new NoSuchElementException("head of empty BitSet"); } else { return fromInt.apply(Long.numberOfTrailingZeros(elements)); } }
Source:
<code>protected boolean canDoAction() { if (getParameters().getParametersList().isEmpty()) { return failCanDoAction(EngineMessage.ACTION_TYPE_FAILED_NO_DISKS_SPECIFIED); } <START> for (MoveDiskParameters moveDiskParameters : getParameters().getParametersList()) { <END> Disk disk = getDiskDao().get(moveDiskParameters.getImageGroupID()); if (disk.getDiskStorageType() == DiskStorageType.LUN) { return failCanDoAction(EngineMessage.ACTION_TYPE_FAILED_LUN_DISK); } } return true; }</code><technical_language>for readability, consider extracting a method.</technical_language>

Target:
protected boolean canDoAction() { if (getParameters().getParametersList().isEmpty()) { return failCanDoAction(EngineMessage.ACTION_TYPE_FAILED_NO_DISKS_SPECIFIED); } return verifyNoLunDisks(); }
Source:
<code>public void testSecureObserveServerAddressChangedWithResume() throws Exception { createSecureServer(DtlsMode.STRICT); createNat(); CoapClient client = new CoapClient(uri); CountingHandler handler = new CountingHandler(); CoapObserveRelation rel = client.observeAndWait(handler); assertFalse("Observe relation not established!", rel.isCanceled()); assertTrue(handler.waitForLoadCalls(1, 1000, TimeUnit.MILLISECONDS)); assertFalse("Response not received", rel.isCanceled()); assertNotNull("Response not received", rel.getCurrent()); assertEquals("\"resource says hi for the 1 time\"", rel.getCurrent().getResponseText()); for (int i = 0; i < REPEATS; ++i) { resource.changed("client"); Thread.sleep(50); } assertTrue("Missing notifies", handler.waitForLoadCalls(REPEATS + 1, 1000, TimeUnit.MILLISECONDS)); nat.setChangeServerAddress(true); serverConnector.forceResumeAllSessions(); <START> <END> for (int i = 0; i < REPEATS; ++i) { resource.changed("client"); Thread.sleep(50); } assertTrue("Missing notifies after address changed", handler.waitForLoadCalls(REPEATS + REPEATS + 1, 1000, TimeUnit.MILLISECONDS)); }</code><technical_language>This test show STRICT mode is ok, if respect strictly specification resuming session allowed. spirit of rfc is epoch/same connection</technical_language>

Target:
public void testSecureObserveServerAddressChangedWithResume() throws Exception { createSecureServer(DtlsMode.STRICT); createNat(); CoapClient client = new CoapClient(uri); CountingHandler handler = new CountingHandler(); CoapObserveRelation rel = client.observeAndWait(handler); assertFalse("Observe relation not established!", rel.isCanceled()); assertTrue(handler.waitForLoadCalls(1, TIMEOUT_IN_MILLIS, TimeUnit.MILLISECONDS)); assertFalse("Response not received", rel.isCanceled()); assertNotNull("Response not received", rel.getCurrent()); assertEquals("\"resource says hi for the 1 time\"", rel.getCurrent().getResponseText()); for (int i = 0; i < REPEATS; ++i) { resource.changed("client"); Thread.sleep(50); } assertTrue("Missing notifies", handler.waitForLoadCalls(REPEATS + 1, TIMEOUT_IN_MILLIS, TimeUnit.MILLISECONDS)); nat.setChangeServerAddress(true); serverConnector.forceResumeAllSessions(); for (int i = 0; i < REPEATS; ++i) { resource.changed("client"); Thread.sleep(50); } assertTrue("Missing notifies after address changed", handler.waitForLoadCalls(REPEATS + REPEATS + 1, TIMEOUT_IN_MILLIS, TimeUnit.MILLISECONDS)); }
Source:
<code>public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { boolean sendToErrorRow = false; String errorMessage = null; Object[] r = getRow(); if ( r == null ) { setOutputDone(); return false; } <START> final DatabaseJoinMeta meta = (DatabaseJoinMeta) smi; <END> final DatabaseJoinData data = (DatabaseJoinData) sdi; try { lookupValues( meta, data, getInputRowMeta(), r ); if ( checkFeedback( getLinesRead() ) ) { if ( log.isBasic() ) { logBasic( BaseMessages.getString( PKG, "DatabaseJoin.Log.LineNumber" ) + getLinesRead() ); } } } catch ( KettleException e ) { if ( getStepMeta().isDoingErrorHandling() ) { sendToErrorRow = true; errorMessage = e.toString(); } else { logError( BaseMessages.getString( PKG, "DatabaseJoin.Log.ErrorInStepRunning" ) + e.getMessage(), e ); setErrors( 1 ); stopAll(); setOutputDone(); return false; } if ( sendToErrorRow ) { putError( getInputRowMeta(), r, 1, errorMessage, null, "DBJOIN001" ); } } return true; }</code><technical_language>creating new pointers smi sdi</technical_language>

Target:
public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { boolean sendToErrorRow = false; String errorMessage = null; Object[] r = getRow(); if ( r == null ) { setOutputDone(); return false; } try { lookupValues( (DatabaseJoinMeta) smi, (DatabaseJoinData) sdi, getInputRowMeta(), r ); if ( checkFeedback( getLinesRead() ) ) { if ( log.isBasic() ) { logBasic( BaseMessages.getString( PKG, "DatabaseJoin.Log.LineNumber" ) + getLinesRead() ); } } } catch ( KettleException e ) { if ( getStepMeta().isDoingErrorHandling() ) { sendToErrorRow = true; errorMessage = e.toString(); } else { logError( BaseMessages.getString( PKG, "DatabaseJoin.Log.ErrorInStepRunning" ) + e.getMessage(), e ); setErrors( 1 ); stopAll(); setOutputDone(); return false; } if ( sendToErrorRow ) { putError( getInputRowMeta(), r, 1, errorMessage, null, "DBJOIN001" ); } } return true; }
Source:
<code>protected org.ovirt.engine.core.common.businessentities.Disk getEntity(int index, boolean noSD) { DiskImage entity = new DiskImage(); entity.setId(GUIDS[index]); entity.setvolume_format(VolumeFormat.RAW); entity.setDiskInterface(DiskInterface.VirtIO); <START> entity.setImageStatus(ImageStatus.OK); <END> entity.setvolume_type(VolumeType.Sparse); entity.setBoot(false); entity.setShareable(false); entity.setPropagateErrors(PropagateErrors.On); ArrayList<Guid> storages = new ArrayList<Guid>(); if (!noSD) { for (int i = 0; i < GUIDS.length; i++) { storages.add(GUIDS[i]); } } entity.setstorage_ids(storages); return setUpStatisticalEntityExpectations(entity); }</code><technical_language>This disappear rebase</technical_language>

Target:
protected org.ovirt.engine.core.common.businessentities.Disk getEntity(int index, boolean noSD) { DiskImage entity = new DiskImage(); entity.setId(GUIDS[index]); entity.setvolumeFormat(VolumeFormat.RAW); entity.setDiskInterface(DiskInterface.VirtIO); entity.setImageStatus(ImageStatus.OK); entity.setVolumeType(VolumeType.Sparse); entity.setBoot(false); entity.setShareable(false); entity.setPropagateErrors(PropagateErrors.On); ArrayList<Guid> storages = new ArrayList<Guid>(); if (!noSD) { for (int i = 0; i < GUIDS.length; i++) { storages.add(GUIDS[i]); } } entity.setStorageIds(storages); return setUpStatisticalEntityExpectations(entity); }
Source:
<code>public void testMergeAppFromConfigAndAppPackage() throws Exception { ApexCli.LaunchCommandLineInfo commandLineInfo = ApexCli.getLaunchCommandLineInfo(new String[]{"-conf", configFile.getAbsolutePath(), appFile.getAbsolutePath(), "-useConfigApps", "inclusive"}); Assert.assertEquals("configApps", "inclusive", commandLineInfo.useConfigApps); ApexCli apexCli = new ApexCli(); apexCli.init(); try { apexCli.getLaunchAppPackageArgs(ap, cp, commandLineInfo, new ConsoleReader()); <START> } catch (Throwable throwable ) { <END> return; } Assert.fail("Cli failed throw multiple apps exception."); }</code><technical_language>catching throwable instead of exception expect throw? Also, is extra space closing paren</technical_language>

Target:
public void testMergeAppFromConfigAndAppPackage() throws Exception { ApexCli.LaunchCommandLineInfo commandLineInfo = ApexCli .getLaunchCommandLineInfo(new String[]{"-conf", configFile.getAbsolutePath(), appFile.getAbsolutePath(), "-useConfigApps", "inclusive"}); Assert.assertEquals("configApps", "inclusive", commandLineInfo.useConfigApps); ApexCli apexCli = new ApexCli(); apexCli.init(); try { apexCli.getLaunchAppPackageArgs(ap, cp, commandLineInfo, new ConsoleReader()); } catch (ApexCli.CliException cliException) { return; } Assert.fail("Cli failed throw multiple apps exception."); }
Source:
<code>public Object[] getElements(Object inputElement) { List<RepositoryTreeNode> nodes = new ArrayList<>(); <START> List<String> directories <END> = new ArrayList<>(); RepositoryUtil repositoryUtil = Activator.getDefault() .getRepositoryUtil(); RepositoryGroups groups = new RepositoryGroups(); if (inputElement instanceof Collection) { for (Object next : ((Collection) inputElement)) { if (next instanceof RepositoryTreeNode) { nodes.add((RepositoryTreeNode) next); } else if (next instanceof String) { directories.add((String) next); } } } else if (inputElement instanceof IWorkspaceRoot) { directories.addAll(repositoryUtil.getConfiguredRepositories()); } nodes.addAll( getRepositoryNodes(repositoryUtil, groups, null, directories)); if (showRepositoryGroups) { for (RepositoryGroup group : groups.getGroups()) { nodes.add(new RepositoryGroupNode(group)); } } Collections.sort(nodes); return nodes.toArray(); }</code><technical_language>File</technical_language>

Target:
public Object[] getElements(Object inputElement) { List<RepositoryTreeNode> nodes = new ArrayList<>(); List<File> directories = new ArrayList<>(); RepositoryUtil repositoryUtil = Activator.getDefault() .getRepositoryUtil(); RepositoryGroups groupsUtil = RepositoryGroups.getInstance(); if (inputElement instanceof Collection) { for (Object next : ((Collection) inputElement)) { if (next instanceof RepositoryTreeNode) { nodes.add((RepositoryTreeNode) next); } else if (next instanceof String) { directories.add(new File((String) next)); } } } else if (inputElement instanceof IWorkspaceRoot) { directories.addAll(repositoryUtil.getConfiguredRepositories() .stream().map(File::new).collect(Collectors.toList())); } nodes.addAll( getRepositoryNodes(repositoryUtil, groupsUtil, null, directories)); if (showRepositoryGroups) { for (RepositoryGroup group : groupsUtil.getGroups()) { nodes.add(new RepositoryGroupNode(group)); } } Collections.sort(nodes); return nodes.toArray(); }
Source:
<code>private void fetchIssue() throws IOException { if (!fetchedIssueDetails) { <START> root.retrieve().method("GET").withUrlPath(getIssuesApiRoute()).to(this); <END> fetchedIssueDetails = true; } }</code><technical_language>redundant method("GET")</technical_language>

Target:
private void fetchIssue() throws IOException { if (!fetchedIssueDetails) { root.createRequest().withUrlPath(getIssuesApiRoute()).fetchInto(this); fetchedIssueDetails = true; } }
Source:
<code>protected void syncStreamUnsafe(ISMRStream stream, long timestamp) { log.trace("Sync[{}] {}", this, (timestamp == Address.OPTIMISTIC) ? "Optimistic" : "to " + timestamp); long syncTo = (timestamp == Address.OPTIMISTIC) ? Address.MAX : timestamp; <START> Timer timer = VloMetricsHelper.metrics.timer(VloMetricsHelper.VLO_SYNC_STREAM + stream.getID()); Histogram histogram = VloMetricsHelper.metrics.histogram(VloMetricsHelper.VLO_SYNC_COUNT + stream.getID()); AtomicLong counter = new AtomicLong(); <END> try (Timer.Context context = MetricsUtils.getConditionalContext(timer)) { stream.streamUpTo(syncTo) .forEachOrdered(entry -> { try { counter.getAndIncrement(); Object res = applyUpdateUnsafe(entry, timestamp); if (timestamp == Address.OPTIMISTIC) { entry.setUpcallResult(res); } else if (pendingUpcalls.contains(entry.getGlobalAddress())) { log.debug("Sync[{}] Upcall Result {}", this, entry.getGlobalAddress()); upcallResults.put(entry.getGlobalAddress(), res == null ? NullValue.NULL_VALUE : res); pendingUpcalls.remove(entry.getGlobalAddress()); } entry.setUpcallResult(res); } catch (Exception e) { log.error("Sync[{}] Error: Couldn't execute upcall due to {}", this, e); throw new UnrecoverableCorfuError(e); } }); } histogram.update(counter.longValue()); }</code><technical_language>If move this string concatenation outside, do access</technical_language>

Target:
protected void syncStreamUnsafe(ISMRStream stream, long timestamp) { log.trace("Sync[{}] {}", this, (timestamp == Address.OPTIMISTIC) ? "Optimistic" : "to " + timestamp); long syncTo = (timestamp == Address.OPTIMISTIC) ? Address.MAX : timestamp; Histogram histogram = VloMetricsHelper.metrics.histogram(syncStreamCount); Counter counter = new Counter(); try (Timer.Context context = getVloStreamSyncContext(timestamp, syncStreamTimer)) { stream.streamUpTo(syncTo) .forEachOrdered(entry -> { try { counter.count++; Object res = applyUpdateUnsafe(entry, timestamp); if (timestamp == Address.OPTIMISTIC) { entry.setUpcallResult(res); } else if (pendingUpcalls.contains(entry.getGlobalAddress())) { log.debug("Sync[{}] Upcall Result {}", this, entry.getGlobalAddress()); upcallResults.put(entry.getGlobalAddress(), res == null ? NullValue.NULL_VALUE : res); pendingUpcalls.remove(entry.getGlobalAddress()); } entry.setUpcallResult(res); } catch (Exception e) { log.error("Sync[{}] Error: Couldn't execute upcall due to {}", this, e); throw new UnrecoverableCorfuError(e); } }); } if (timestamp != Address.OPTIMISTIC) { histogram.update(counter.count); } }
Source:
<code><START> public SqlSessionTemplate umpSqlSessionTemplate(@Qualifier("umpSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception { <END> return new SqlSessionTemplate(sqlSessionFactory); }</code><technical_language>remove exception</technical_language>

Target:
public SqlSessionTemplate umpSqlSessionTemplate(@Qualifier("umpSqlSessionFactory") SqlSessionFactory sqlSessionFactory) { return new SqlSessionTemplate(sqlSessionFactory); }
Source:
<code>public void shouldUploadIdentifiersFromFile() throws Exception { String uploadIdentifiers = <START> "{\"identifiersToUpload\": \"1,2,3,4\"}"; <END> MockHttpServletRequest postRequest = newPostRequest(getURI() + "/" + POOL_SOURCE_UUID, uploadIdentifiers); SimpleObject identifiersAfterUpload = deserialize(handle(postRequest)); assertThat(identifiersAfterUpload.get("identifiers").toString(), allOf( containsString("Test Identifier Pool: 1"), containsString("Test Identifier Pool: 2"), containsString("Test Identifier Pool: 3"), containsString("Test Identifier Pool: 4") )); }</code><technical_language>intentionally decide a name of actual identifiers property</technical_language>

Target:
public void shouldUploadIdentifiersFromFile() throws Exception { String uploadIdentifiers = "{\"identifiers\": \"1,2,3,4\"," + "\"operation\": \"uploadFromFile\"}"; MockHttpServletRequest postRequest = newPostRequest(getURI() + "/" + POOL_SOURCE_UUID, uploadIdentifiers); SimpleObject uploadResult = deserialize(handle(postRequest)); assertThat( uploadResult.toString(), containsString(POOL_SOURCE_UUID) ); MockHttpServletRequest getRequestAfterUpload = newGetRequest(getURI() + "/" + POOL_SOURCE_UUID); getRequestAfterUpload.addParameter("v", "custom:(identifiers)"); SimpleObject identifiersAfterUpload = deserialize(handle(getRequestAfterUpload)); assertThat( identifiersAfterUpload.get("identifiers").toString(), allOf( containsString("Test Identifier Pool: 1"), containsString("Test Identifier Pool: 2"), containsString("Test Identifier Pool: 3"), containsString("Test Identifier Pool: 4") )); }
Source:
<code>private RevisionInfo toRevisionInfo(ChangeData cd, PatchSet in) throws OrmException { RevisionInfo out = new RevisionInfo(); out.isCurrent = in.getId().equals(cd.change(db).currentPatchSetId()); out._number = in.getId().get(); out.draft = in.isDraft() ? true : null; out.fetch = makeFetchMap(cd, in); if (has(ALL_COMMITS) || (out.isCurrent && has(CURRENT_COMMIT))) { try { out.commit = toCommit(in); } catch (PatchSetInfoNotAvailableException e) { log.warn("Cannot load PatchSetInfo " + in.getId(), e); } } if (has(ALL_FILES) || (out.isCurrent && has(CURRENT_FILES))) { try { out.files = fileInfoJson.toFileInfoMap(cd.change(db), in); out.files.remove(Patch.COMMIT_MSG); } catch (PatchListNotAvailableException e) { log.warn("Cannot load PatchList " + in.getId(), e); } } <START> if ((out.isCurrent || out.draft != null) <END> && has(CURRENT_ACTIONS) && userProvider.get().isIdentifiedUser()) { out.actions = Maps.newTreeMap(); for (UiAction.Description d : UiActions.from( revisions, new RevisionResource(new ChangeResource(control(cd)), in), userProvider)) { out.actions.put(d.getId(), new ActionInfo(d)); } } return out; }</code><technical_language>This check pass if out.draft is set false. I is safer check out.draft is true (when null): if ((out.isCurrent || out.draft != null && out.draft)</technical_language>

Target:
private RevisionInfo toRevisionInfo(ChangeData cd, PatchSet in) throws OrmException { RevisionInfo out = new RevisionInfo(); out.isCurrent = in.getId().equals(cd.change(db).currentPatchSetId()); out._number = in.getId().get(); out.draft = in.isDraft() ? true : null; out.fetch = makeFetchMap(cd, in); if (has(ALL_COMMITS) || (out.isCurrent && has(CURRENT_COMMIT))) { try { out.commit = toCommit(in); } catch (PatchSetInfoNotAvailableException e) { log.warn("Cannot load PatchSetInfo " + in.getId(), e); } } if (has(ALL_FILES) || (out.isCurrent && has(CURRENT_FILES))) { try { out.files = fileInfoJson.toFileInfoMap(cd.change(db), in); out.files.remove(Patch.COMMIT_MSG); } catch (PatchListNotAvailableException e) { log.warn("Cannot load PatchList " + in.getId(), e); } } if ((out.isCurrent || (out.draft != null && out.draft)) && has(CURRENT_ACTIONS) && userProvider.get().isIdentifiedUser()) { out.actions = Maps.newTreeMap(); for (UiAction.Description d : UiActions.from( revisions, new RevisionResource(new ChangeResource(control(cd)), in), userProvider)) { out.actions.put(d.getId(), new ActionInfo(d)); } } return out; }
Source:
<code>public void close() { this.bean.close(); if (!this.bean.isValid()) { InfinispanBeanManager.this.cancel(this.bean); } else { InfinispanBeanManager.this.schedule(this.bean); } <START> } <END></code><technical_language>I sense schedule expiration/passivation release. access time updated close(), schedule for expiration/passivation then</technical_language>

Target:
public void close() { this.bean.close(); if (!this.bean.isValid()) { InfinispanBeanManager.this.cancel(this.getId()); } else { InfinispanBeanManager.this.schedule(this.getId(), this.entry); } }
Source:
<code>public DateTimeFormatter getFormatter(Formatter type) { <START> throw new RE("This method should not be invoked for this granularity type"); <END> }</code><technical_language>UnsupportedOperationException is intended for this situation (also some places below)</technical_language>

Target:
public DateTimeFormatter getFormatter(Formatter type) { throw new UnsupportedOperationException("This method should not be invoked for this granularity type"); }