auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean accepts(@NotNull T element, ProcessingContext context) { ErlangQAtom argument = element instanceof ErlangQAtom ? (ErlangQAtom) element : null; if (argument == null) return false; ErlangFunctionCallExpression call = PsiTreeUtil.getParentOfType(argument, ErlangFunctionCallExpression.class); 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; }

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:
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"), equalTo("binary")); assertThat(artifact.getAttributeValue("id"), equalTo("iuWithPayloadButNoArtifactReference")); assertThat(artifact.getAttributeValue("version"), equalTo("1.0.0")); }

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:
public byte[] getBytes() { byte[] bytes = new byte[value.remaining()]; value.mark(); value.get(bytes).reset(); cachedBytes = bytes; return bytes; }

Target:
public byte[] getBytes() { byte[] bytes = new byte[value.remaining()]; value.mark(); value.get(bytes).reset(); if (!isBackingBytesReused) { cachedBytes = bytes; } return bytes; }
Source:
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){ keyWithUserId = CacheKey.createCacheKey(request, item.getUserInfo().getUserId()); keyWithDisplayableId = CacheKey.createCacheKey(request, item.getUserInfo().getDisplayableId()); } refreshItem = new RefreshItem(keyUsed, item.getRefreshToken(), multiResource, item.getUserInfo(), item.getRawIdToken(), keyWithUserId, keyWithDisplayableId); } } return refreshItem; }

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:
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) { logger.severe("Partial disconnection resolution algorithm failed.", e); clusterServiceLock.lock(); try { partialDisconnectionHandler.reset(); } finally { clusterServiceLock.unlock(); } } }

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:
public void testGetAuthorization() throws PayPalRESTException { Payment payment = getPaymentAgainstAuthorization(); Payment authPayment = payment.create(TestConstants.SANDBOXCONTEXT); 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()); }

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:
protected KeyManager[] engineGetKeyManagers() { ObjectUtil.checkNotNull(km, "KeyManagerFactoryWrapper is created with null KeyManager value"); return new KeyManager[] {km}; }

Target:
protected KeyManager[] engineGetKeyManagers() { return new KeyManager[] {km}; }
Source:
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() throws Exception { }

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:
private void setLastUsedBranch() { String lastBranch = settings.get(lastBranchKey); if (lastBranch != null) { branchText.setText(lastBranch); } }

Target:
private void setLastUsedBranch() { String lastBranch = settings.get(lastBranchKey); if (lastBranch != null) branchText.setText(lastBranch); }
Source:
public void directoryNullFilterTest() throws IOException { List<File> files = new ArrayList<File>(); 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(); }

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:
public void startBucket(String bucketKey) { BulkCommand command = getCurrentCommand(); description = (String) command.getParam(PARAM_DESC); }

Target:
public void startBucket(String bucketKey) { BulkCommand command = getCurrentCommand(); description = command.getParam(PARAM_DESC); }
Source:
public void batchingOfWritesShouldNotAffectCompressedDataSize() throws Exception { byte[] orig = CalgaryTest.readFile("alice29.txt"); byte[] expectedCompressedData = compressAsChunks(orig, Integer.MAX_VALUE); assertTrue(String.format("unexpected compressed data size (%d)", expectedCompressedData.length), (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); } }

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:
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.version); if (versionNumber == null || v.isNewerThan(versionNumber)) versionNumber = v; } return versionNumber; }

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:
protected void awaitConsistency() { Uninterruptibles.sleepUninterruptibly(5, TimeUnit.SECONDS); }

Target:
protected void awaitConsistency() { Uninterruptibles.sleepUninterruptibly(AWAIT_CONSISTENCY_TIMEOUT_SECONDS, TimeUnit.SECONDS); }
Source:
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); } }

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:
public void callsActOnProperMethods() throws Exception { final String method = "WHATEVER"; final Take take = Mockito.mock(Take.class); final RqFake propreq = new RqFake(method); new TkMethods(take, method).act(propreq); Mockito.verify( take, Mockito.times(1) ).act( Matchers.argThat( CoreMatchers.equalTo(propreq) ) ); }

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:
public HttpRequest filterSAS(HttpRequest request, String credential) throws HttpException { 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; }

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:
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"); for (int i = 0; i < leftPositionCount; i++) { 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(); }

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:
RouterNetworkComponents getRouterNetworkComponents() throws Exception { Selector selector = new Selector(networkMetrics, time, sslFactory); ConnectionManager connectionManager = new NonBlockingConnectionManager(selector, networkConfig, maxConnectionsPerPortPlainText, maxConnectionsPerPortSsl, time); return new RouterNetworkComponents(selector, connectionManager); }

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:
public String toString() { return "PrefixFilteredDimensionSpec{" + "Prefix='" + NullHandling.nullToEmptyIfNeeded(prefix) + '\'' + '}'; }

Target:
public String toString() { return "PrefixFilteredDimensionSpec{" + "Prefix='" + prefix + '\'' + '}'; }
Source:
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 ) { writerTaskCounter.decrementAndGet(); writer.mergeFinish( merge ); } } } }

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:
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) { } 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"); } } }

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:
@Override public String toString() { final StringBuilder outputStreamStats = new StringBuilder( "OutputStream Statistics{"); outputStreamStats.append(", BYTES_UPLOAD=").append(bytesToUpload); 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(); }

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:
public synchronized void setAfterAckCallback(java.util.function.Consumer<Channel> callback) { if (getPendingConfirmsCount() == 0) { callback.accept(this); } else { this.afterAckCallback = callback; } }

Target:
public synchronized void setAfterAckCallback(java.util.function.Consumer<Channel> callback) { if (getPendingConfirmsCount() == 0 && callback != null) { callback.accept(this); } else { this.afterAckCallback = callback; } }
Source:
public T head() { if (elements != 0) { return fromInt.apply(Long.numberOfTrailingZeros(elements)); } throw new NoSuchElementException("head of empty BitSet"); }

Target:
public T head() { if (elements == 0) { throw new NoSuchElementException("head of empty BitSet"); } else { return fromInt.apply(Long.numberOfTrailingZeros(elements)); } }
Source:
protected boolean canDoAction() { if (getParameters().getParametersList().isEmpty()) { return failCanDoAction(EngineMessage.ACTION_TYPE_FAILED_NO_DISKS_SPECIFIED); } for (MoveDiskParameters moveDiskParameters : getParameters().getParametersList()) { Disk disk = getDiskDao().get(moveDiskParameters.getImageGroupID()); if (disk.getDiskStorageType() == DiskStorageType.LUN) { return failCanDoAction(EngineMessage.ACTION_TYPE_FAILED_LUN_DISK); } } return true; }

Target:
protected boolean canDoAction() { if (getParameters().getParametersList().isEmpty()) { return failCanDoAction(EngineMessage.ACTION_TYPE_FAILED_NO_DISKS_SPECIFIED); } return verifyNoLunDisks(); }
Source:
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(); 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)); }

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:
public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { boolean sendToErrorRow = false; String errorMessage = null; Object[] r = getRow(); if ( r == null ) { setOutputDone(); return false; } final DatabaseJoinMeta meta = (DatabaseJoinMeta) smi; 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; }

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:
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); entity.setImageStatus(ImageStatus.OK); 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); }

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:
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 (Throwable throwable ) { return; } Assert.fail("Cli failed throw multiple apps exception."); }

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:
public Object[] getElements(Object inputElement) { List<RepositoryTreeNode> nodes = new ArrayList<>(); List<String> directories = 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(); }

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:
private void fetchIssue() throws IOException { if (!fetchedIssueDetails) { root.retrieve().method("GET").withUrlPath(getIssuesApiRoute()).to(this); fetchedIssueDetails = true; } }

Target:
private void fetchIssue() throws IOException { if (!fetchedIssueDetails) { root.createRequest().withUrlPath(getIssuesApiRoute()).fetchInto(this); fetchedIssueDetails = true; } }
Source:
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; 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(); 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()); }

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:
public SqlSessionTemplate umpSqlSessionTemplate(@Qualifier("umpSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception { return new SqlSessionTemplate(sqlSessionFactory); }

Target:
public SqlSessionTemplate umpSqlSessionTemplate(@Qualifier("umpSqlSessionFactory") SqlSessionFactory sqlSessionFactory) { return new SqlSessionTemplate(sqlSessionFactory); }
Source:
public void shouldUploadIdentifiersFromFile() throws Exception { String uploadIdentifiers = "{\"identifiersToUpload\": \"1,2,3,4\"}"; 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") )); }

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:
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) && 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; }

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:
public void close() { this.bean.close(); if (!this.bean.isValid()) { InfinispanBeanManager.this.cancel(this.bean); } else { InfinispanBeanManager.this.schedule(this.bean); } }

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:
public DateTimeFormatter getFormatter(Formatter type) { throw new RE("This method should not be invoked for this granularity type"); }

Target:
public DateTimeFormatter getFormatter(Formatter type) { throw new UnsupportedOperationException("This method should not be invoked for this granularity type"); }
Source:
private static synchronized void loadProperties() { if (errorStrings == null) { try (InputStream fileInputStream = EventHubErrorCodeStrings.class.getClassLoader().getResource((ERROR_STRINGS_FILE_NAME)).openStream()) { errorStrings = new Properties(); errorStrings.load(fileInputStream); } catch (IOException ex) { ex.printStackTrace(); } } }

Target:
private static synchronized void loadProperties() { if (errorStrings == null) { try (InputStream fileInputStream = EventHubErrorCodeStrings.class.getClassLoader() .getResource(ERROR_STRINGS_FILE_NAME).openStream()) { errorStrings = new Properties(); errorStrings.load(fileInputStream); } catch (IOException ex) { ex.printStackTrace(); } } }
Source:
public void testExceptionHandlingINFO() throws Exception { TestAppender appender = new TestAppender(); Logger logger = LogUtil.getRootLogger(); logger.setLevel(Level.DEBUG); logger.addAppender(appender); boolean makeSureNoExceptionIsThrown = false; try { mockDatabase(true); appConstants.put("configurations."+getConfigurationName()+".reportLevel", "INFO"); ClassLoaderManager manager = new ClassLoaderManager(ibisContext); ClassLoader config = manager.get(getConfigurationName()); makeSureNoExceptionIsThrown = true; assertNull(config); } finally { logger.removeAppender(appender); } assertTrue(makeSureNoExceptionIsThrown); List<LoggingEvent> log = appender.getLog(); LoggingEvent firstLogEntry = log.get(log.size()-1); assertEquals(IbisContext.class.getCanonicalName(), firstLogEntry.getLoggerName()); assertEquals(Level.INFO, firstLogEntry.getLevel()); String msg = (String) firstLogEntry.getMessage(); assertTrue(msg.contains("error configuring ClassLoader for configuration [")); assertTrue(msg.endsWith("]")); }

Target:
public void testExceptionHandlingINFO() throws Exception { TestAppender appender = new TestAppender(); Logger logger = LogUtil.getRootLogger(); logger.setLevel(Level.DEBUG); logger.addAppender(appender); boolean makeSureNoExceptionIsThrown = false; try { mockDatabase(true); appConstants.put("configurations."+getConfigurationName()+".reportLevel", "INFO"); ClassLoaderManager manager = new ClassLoaderManager(ibisContext); ClassLoader config = manager.get(getConfigurationName()); makeSureNoExceptionIsThrown = true; assertNull(config); } finally { logger.removeAppender(appender); } assertTrue(makeSureNoExceptionIsThrown); List<LoggingEvent> log = appender.getLog(); LoggingEvent firstLogEntry = log.get(log.size()-1); assertEquals(IbisContext.class.getCanonicalName(), firstLogEntry.getLoggerName()); assertEquals(Level.INFO, firstLogEntry.getLevel()); String msg = (String) firstLogEntry.getMessage(); assertThat(msg, StringContains.containsString(ERROR_PREFIX)); assertThat(msg, Matchers.endsWith(ERROR_SUFFIX)); }
Source:
private void commonSectionFetchOnCatch(Throwable caught) { tocDrawer.setSlidingEnabled(false); searchArticlesFragment.setTocEnabled(false); if (caught instanceof SectionsFetchException) { if (((SectionsFetchException) caught).getCode().equals("missingtitle") || ((SectionsFetchException) caught).getCode().equals("invalidtitle")) { searchArticlesFragment.setTocHidden(true); ViewAnimations.crossFade(loadProgress, pageDoesNotExistError); } } else if (Utils.throwableContainsSpecificType(caught, SSLException.class)) { if (WikipediaApp.getInstance().incSslFailCount() < 2) { WikipediaApp.getInstance().setSslFallback(true); showNetworkError(); try { connectionIssueFunnel.logConnectionIssue("mdot", "commonSectionFetchOnCatch"); } catch (Exception e) { } } else { showNetworkError(); try { connectionIssueFunnel.logConnectionIssue("desktop", "commonSectionFetchOnCatch"); } catch (Exception e) { } } } else if (caught instanceof ApiException) { showNetworkError(); } else { throw new RuntimeException(caught); } }

Target:
private void commonSectionFetchOnCatch(Throwable caught) { tocDrawer.setSlidingEnabled(false); searchArticlesFragment.setTocEnabled(false); searchArticlesFragment.setTocHidden(true); if (caught instanceof SectionsFetchException) { if (((SectionsFetchException) caught).getCode().equals("missingtitle") || ((SectionsFetchException) caught).getCode().equals("invalidtitle")) { ViewAnimations.crossFade(loadProgress, pageDoesNotExistError); } } else if (Utils.throwableContainsSpecificType(caught, SSLException.class)) { if (WikipediaApp.getInstance().incSslFailCount() < 2) { WikipediaApp.getInstance().setSslFallback(true); showNetworkError(); try { connectionIssueFunnel.logConnectionIssue("mdot", "commonSectionFetchOnCatch"); } catch (Exception e) { } } else { showNetworkError(); try { connectionIssueFunnel.logConnectionIssue("desktop", "commonSectionFetchOnCatch"); } catch (Exception e) { } } } else if (caught instanceof ApiException) { showNetworkError(); } else { throw new RuntimeException(caught); } }
Source:
public void setCacheContainer(BasicCacheContainer cacheContainer) { this.cacheContainer = cacheContainer; this.setCacheFromComponent = true; System.out.println("===========<created"); }

Target:
public void setCacheContainer(BasicCacheContainer cacheContainer) { this.cacheContainer = cacheContainer; this.setCacheFromComponent = true; }
Source:
public void executeCommand(Command command, ExecutionHandlerContext context) { List<ByteArrayWrapper> commandElems = command.getProcessedCommandWrappers(); ByteArrayWrapper key = command.getKey(); ByteArrayWrapper newKey = commandElems.get(2); RedisKeyCommands redisKeyCommands = getRedisKeyCommands(context); if (key.equals(newKey)) { command.setResponse(Coder.getSimpleStringResponse(context.getByteBufAllocator(), "OK")); return; } if (!redisKeyCommands.rename(key, newKey)) { command.setResponse( Coder.getErrorResponse(context.getByteBufAllocator(), RedisConstants.ERROR_NO_SUCH_KEY)); return; } command.setResponse(Coder.getSimpleStringResponse(context.getByteBufAllocator(), "OK")); }

Target:
public RedisResponse executeCommand(Command command, ExecutionHandlerContext context) { List<ByteArrayWrapper> commandElems = command.getProcessedCommandWrappers(); ByteArrayWrapper key = command.getKey(); ByteArrayWrapper newKey = commandElems.get(2); RedisKeyCommands redisKeyCommands = getRedisKeyCommands(context); if (key.equals(newKey)) { return RedisResponse.string("OK"); } if (!redisKeyCommands.rename(key, newKey)) { return RedisResponse.error(ERROR_NO_SUCH_KEY); } return RedisResponse.string("OK"); }