auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void scrollToListSectionByOffset(int yOffset) { yOffset = DimenUtil.roundedPxToDp(yOffset); int itemToSelect = 0; for (int i = 1; i < adapter.getCount(); i++) { Section section = adapter.getItem(i); if (adapter.getYOffset(section.getId()) < yOffset) { itemToSelect = i; } else { break; } } if (itemToSelect != currentItemSelected) { adapter.setHighlightedSection(itemToSelect); currentItemSelected = itemToSelect; } JavaScriptActionHandler.prepareToScrollTo(adapter.getItem(currentItemSelected).getAnchor(), "{ highlight: false }"); tocList.smoothScrollToPositionFromTop(currentItemSelected, scrollerViewParams.topMargin - DimenUtil.roundedDpToPx(TOC_SECTION_TOP_OFFSET_ADJUST), 0); }

Target:
private void scrollToListSectionByOffset(int yOffset) { yOffset = DimenUtil.roundedPxToDp(yOffset); int itemToSelect = 0; for (int i = 1; i < adapter.getCount(); i++) { Section section = adapter.getItem(i); if (adapter.getYOffset(section.getId()) < yOffset) { itemToSelect = i; } else { break; } } if (itemToSelect != currentItemSelected) { adapter.setHighlightedSection(itemToSelect); currentItemSelected = itemToSelect; } tocList.smoothScrollToPositionFromTop(currentItemSelected, scrollerViewParams.topMargin - DimenUtil.roundedDpToPx(TOC_SECTION_TOP_OFFSET_ADJUST), 0); }
Source:
public InfoboxBuilderPage clickBuilderBackground() { builderBackground.click(); return this; }

Target:
public InfoboxBuilderPage clickBuilderBackground() { wait.forElementClickable(builderBackground); builderBackground.click(); return this; }
Source:
public RDTCommandLauncher(IProject project) { fProcess = null; fShowCommand = false; try { if (project.hasNature(SYNC_NATURE)) { IRemoteResource remoteRes = (IRemoteResource)project.getAdapter(IRemoteResource.class); uri = remoteRes.getActiveLocationURI(); } else{ uri = project.getLocationURI(); } lineSeparator = System.getProperty("line.separator", "\n"); } catch (CoreException e) { e.printStackTrace(); } }

Target:
public RDTCommandLauncher(IProject project) { fProcess = null; fShowCommand = false; try { if (project.hasNature(Messages.SYNC_NATURE)) { IRemoteResource remoteRes = (IRemoteResource)project.getAdapter(IRemoteResource.class); uri = remoteRes.getActiveLocationURI(); } else{ uri = project.getLocationURI(); } lineSeparator = System.getProperty("line.separator", "\n"); } catch (CoreException e) { uri = project.getLocationURI(); } }
Source:
public synchronized Long getCommitTimestampIfPresent(Long startTimestamp) { Long firstCommitTimestamp = first.getCommitTimestampIfPresent(startTimestamp); Long secondCommitTimestamp = second.getCommitTimestampIfPresent(startTimestamp); if (firstCommitTimestamp == null || secondCommitTimestamp == null) { return Stream.of(firstCommitTimestamp, secondCommitTimestamp) .filter(Objects::nonNull) .findFirst() .orElse(null); } Preconditions.checkState(firstCommitTimestamp.equals(secondCommitTimestamp), "There is a bug in cache implementation"); return firstCommitTimestamp; }

Target:
public synchronized Long getCommitTimestampIfPresent(Long startTimestamp) { Long firstCommitTimestamp = first.getCommitTimestampIfPresent(startTimestamp); Long secondCommitTimestamp = second.getCommitTimestampIfPresent(startTimestamp); if (firstCommitTimestamp == null || secondCommitTimestamp == null) { return Stream.of(firstCommitTimestamp, secondCommitTimestamp) .filter(Objects::nonNull) .findFirst() .orElse(null); } Preconditions.checkState( firstCommitTimestamp.equals(secondCommitTimestamp), "There is a bug in cache implementation", SafeArg.of("startTimestamp", startTimestamp), SafeArg.of("firstCommitTimestamp", firstCommitTimestamp), SafeArg.of("secondCommitTimestamp", secondCommitTimestamp)); return firstCommitTimestamp; }
Source:
private synchronized CompletableFuture<Boolean> addEditableCapabilities(Optional<FileWrapper> sharedDirOpt, NetworkAccess network) { return CapabilityStore.getEditableCapabilityFileSize(sharedDirOpt.get(), network) .thenCompose(editCount -> { if (editCount == byteOffsetWrite) return CompletableFuture.completedFuture(true); return CapabilityStore.loadWriteAccessSharingLinksFromIndex(homeDirSupplier, sharedDirOpt.get(), ownerName, network, random, hasher, byteOffsetWrite, true) .thenApply(newWriteCaps -> { byteOffsetWrite += newWriteCaps.getBytesRead(); root = newWriteCaps.getRetrievedCapabilities().stream() .reduce(root, (root, cap) -> root.put(trimOwner(cap.path), new EntryPoint(cap.cap, ownerName)), (a, b) -> a); return true; }); }); }

Target:
private synchronized CompletableFuture<Boolean> addEditableCapabilities(Optional<FileWrapper> sharedDirOpt, NetworkAccess network) { return CapabilityStore.getEditableCapabilityFileSize(sharedDirOpt.get(), network) .thenCompose(editFilesize -> { if (editFilesize == byteOffsetWrite) return CompletableFuture.completedFuture(true); return CapabilityStore.loadWriteAccessSharingLinksFromIndex(homeDirSupplier, sharedDirOpt.get(), ownerName, network, random, hasher, byteOffsetWrite, true) .thenApply(newWriteCaps -> { byteOffsetWrite += newWriteCaps.getBytesRead(); root = newWriteCaps.getRetrievedCapabilities().stream() .reduce(root, (root, cap) -> root.put(trimOwner(cap.path), new EntryPoint(cap.cap, ownerName)), (a, b) -> a); return true; }); }); }
Source:
private void validateListingForFile(Path f, List<FileStatus> statusList, boolean nextCallAlone) { String msg = String.format("size of file list returned using %s should " + "be 1", nextCallAlone ? "next() calls alone" : "hasNext() and next() calls"); Assertions.assertThat(statusList) .describedAs(msg) .hasSize(1); Assertions.assertThat(statusList.get(0).getPath().toString()) .describedAs("path returned should match with the input path") .isEqualTo(f.toString()); Assertions.assertThat(statusList.get(0).isFile()) .describedAs("path returned should be a file") .isEqualTo(true); }

Target:
private void validateListingForFile(Path f, List<FileStatus> statusList, boolean nextCallAlone) { String msg = String.format("size of file list returned using %s should " + "be 1", nextCallAlone ? "next() calls alone" : "hasNext() and next() calls"); Assertions.assertThat(statusList) .describedAs(msg) .hasSize(1); Assertions.assertThat(statusList.get(0).getPath()) .describedAs("path returned should match with the input path") .isEqualTo(f); Assertions.assertThat(statusList.get(0).isFile()) .describedAs("path returned should be a file") .isEqualTo(true); }
Source:
public void testControllerCallback_onAllowedCommandChanged() throws Exception { prepareLooper(); final CustomAction testCustomAction1 = new CustomAction.Builder("testCustomAction1", "testName1", 1).build(); final CustomAction testCustomAction2 = new CustomAction.Builder("testCustomAction2", "testName2", 2).build(); final CountDownLatch latch = new CountDownLatch(1); final ControllerCallback callback = new ControllerCallback() { @Override public void onAllowedCommandsChanged(MediaController2 controller, SessionCommandGroup2 commands) { assertFalse(commands.hasCommand(new SessionCommand2( testCustomAction1.getAction(), testCustomAction1.getExtras()))); latch.countDown(); } }; mSession.setPlaybackState(new PlaybackStateCompat.Builder() .addCustomAction(testCustomAction1).build()); mController = createController(mSession.getSessionToken(), true, callback); mSession.setPlaybackState(new PlaybackStateCompat.Builder() .addCustomAction(testCustomAction2).build()); assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)); }

Target:
public void testControllerCallback_onAllowedCommandChanged() throws Exception { prepareLooper(); final CustomAction testCustomAction1 = new CustomAction.Builder("testCustomAction1", "testName1", 1).build(); final CustomAction testCustomAction2 = new CustomAction.Builder("testCustomAction2", "testName2", 2).build(); final CountDownLatch latch = new CountDownLatch(1); final ControllerCallback callback = new ControllerCallback() { @Override public void onAllowedCommandsChanged(MediaController2 controller, SessionCommandGroup2 commands) { assertFalse(commands.hasCommand(new SessionCommand2( testCustomAction1.getAction(), testCustomAction1.getExtras()))); assertTrue(commands.hasCommand(new SessionCommand2( testCustomAction2.getAction(), testCustomAction2.getExtras()))); latch.countDown(); } }; mSession.setPlaybackState(new PlaybackStateCompat.Builder() .addCustomAction(testCustomAction1).build()); mController = createController(mSession.getSessionToken(), true, callback); mSession.setPlaybackState(new PlaybackStateCompat.Builder() .addCustomAction(testCustomAction2).build()); assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)); }
Source:
public void testGetAccount() throws Exception { MockWebServer server = new MockWebServer(); server.play(); URL url = server.getUrl(""); server.setDispatcher(getURLReplacingQueueDispatcher(url)); server.enqueue(new MockResponse().setResponseCode(200).setBody(access)); server.enqueue(defaultAccountMockResponse()); SwiftApi api = mockSwiftApi(server.getUrl("/").toString()); try { AccountApi accountApi = api.getAccountApiForRegion("DFW"); assertEquals(accountApi.get(), mockAccount()); assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1"); assertEquals(server.takeRequest().getRequestLine(), "HEAD /v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/ HTTP/1.1"); } finally { server.shutdown(); } }

Target:
public void testGetAccount() throws Exception { MockWebServer server = new MockWebServer(); server.play(); try { URL url = server.getUrl(""); server.setDispatcher(getURLReplacingQueueDispatcher(url)); server.enqueue(new MockResponse().setResponseCode(200).setBody(access)); server.enqueue(defaultAccountMockResponse()); SwiftApi api = mockSwiftApi(server.getUrl("/").toString()); AccountApi accountApi = api.getAccountApiForRegion("DFW"); assertEquals(accountApi.get(), mockAccount()); assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1"); assertEquals(server.takeRequest().getRequestLine(), "HEAD /v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/ HTTP/1.1"); } finally { server.shutdown(); } }
Source:
public void skipsOnStream() throws IOException { final byte[] bytes = "skipsOnStream".getBytes(); final CapInputStream input = new CapInputStream( new ByteArrayInputStream(bytes), bytes.length ); final long skipped = input.skip(2); MatcherAssert.assertThat(skipped, Matchers.equalTo(2L)); }

Target:
public void skipsOnStream() throws Exception { final long skip = 25L; final InputStream stream = Mockito.mock(InputStream.class); final CapInputStream wrapper = new CapInputStream(stream, 50L); wrapper.skip(skip); Mockito.verify(stream, Mockito.times(1)).skip(skip); }
Source:
public AbstractLayoutProvider() { this.viewsToChangeBoundsRequest = new WeakHashMap<View, List<Request>>(); }

Target:
public AbstractLayoutProvider() { this.viewsToChangeBoundsRequest = new HashMap<View, List<Request>>(); }
Source:
public SimplePagesHashStrategy( List<Type> types, List<Integer> outputChannels, List<List<Block>> channels, List<Integer> hashChannels, OptionalInt precomputedHashChannel, Optional<Integer> sortChannel, FunctionRegistry functionRegistry, boolean groupByUsesEqualTo) { this.types = ImmutableList.copyOf(requireNonNull(types, "types is null")); this.outputChannels = ImmutableList.copyOf(requireNonNull(outputChannels, "outputChannels is null")); this.channels = ImmutableList.copyOf(requireNonNull(channels, "channels is null")); checkArgument(types.size() == channels.size(), "Expected types and channels to be the same length"); this.hashChannels = ImmutableList.copyOf(requireNonNull(hashChannels, "hashChannels is null")); if (precomputedHashChannel.isPresent()) { this.precomputedHashChannel = channels.get(precomputedHashChannel.getAsInt()); } else { this.precomputedHashChannel = null; } this.sortChannel = requireNonNull(sortChannel, "sortChannel is null"); this.functionRegistry = requireNonNull(functionRegistry, "functionRegistry is null"); this.groupByUsesEqualTo = groupByUsesEqualTo; ImmutableMap.Builder<Type, MethodHandle> builder = ImmutableMap.builder(); for (Type type : new HashSet<>(types)) { Signature signature = functionRegistry.resolveOperator(OperatorType.IS_DISTINCT_FROM, ImmutableList.of(type, type)); MethodHandle methodHandle = functionRegistry.getScalarFunctionImplementation(signature).getMethodHandle(); builder.put(type, methodHandle); } methodHandles = builder.build(); }

Target:
public SimplePagesHashStrategy( List<Type> types, List<Integer> outputChannels, List<List<Block>> channels, List<Integer> hashChannels, OptionalInt precomputedHashChannel, Optional<Integer> sortChannel, FunctionRegistry functionRegistry, boolean groupByUsesEqualTo) { this.types = ImmutableList.copyOf(requireNonNull(types, "types is null")); this.outputChannels = ImmutableList.copyOf(requireNonNull(outputChannels, "outputChannels is null")); this.channels = ImmutableList.copyOf(requireNonNull(channels, "channels is null")); checkArgument(types.size() == channels.size(), "Expected types and channels to be the same length"); this.hashChannels = ImmutableList.copyOf(requireNonNull(hashChannels, "hashChannels is null")); if (precomputedHashChannel.isPresent()) { this.precomputedHashChannel = channels.get(precomputedHashChannel.getAsInt()); } else { this.precomputedHashChannel = null; } this.sortChannel = requireNonNull(sortChannel, "sortChannel is null"); requireNonNull(functionRegistry, "functionRegistry is null"); this.groupByUsesEqualTo = groupByUsesEqualTo; ImmutableList.Builder<MethodHandle> distinctFromMethodHandlesBuilder = ImmutableList.builder(); for (Type type : types) { distinctFromMethodHandlesBuilder.add( functionRegistry.getScalarFunctionImplementation(functionRegistry.resolveOperator(IS_DISTINCT_FROM, ImmutableList.of(type, type))).getMethodHandle()); } distinctFromMethodHandles = distinctFromMethodHandlesBuilder.build(); }
Source:
private PortletDefinitionForm createNewPortletDefinitionForm() { PortletDefinitionForm form = new PortletDefinitionForm(); final IEntityGroup portletCategoriesGroup = GroupService.getDistinguishedGroup(GroupService.PORTLET_CATEGORIES); form.addCategory(new JsonEntityBean(portletCategoriesGroup, groupListHelper.getEntityType(portletCategoriesGroup))); final IEntityGroup everyoneGroup = GroupService.getDistinguishedGroup(GroupService.EVERYONE); form.addGroup(new JsonEntityBean(everyoneGroup, groupListHelper.getEntityType(everyoneGroup))); form.addPermission(everyoneGroup.getName() + "_" + IPermission.PORTLET_SUBSCRIBER_ACTIVITY); form.addPermission(everyoneGroup.getName() + "_" + IPermission.PORTLET_BROWSE_ACTIVITY); return form; }

Target:
private PortletDefinitionForm createNewPortletDefinitionForm() { PortletDefinitionForm form = new PortletDefinitionForm(); final IEntityGroup portletCategoriesGroup = GroupService.getDistinguishedGroup(GroupService.PORTLET_CATEGORIES); form.addCategory(new JsonEntityBean(portletCategoriesGroup, groupListHelper.getEntityType(portletCategoriesGroup))); final IEntityGroup everyoneGroup = GroupService.getDistinguishedGroup(GroupService.EVERYONE); JsonEntityBean everyoneBean = new JsonEntityBean(everyoneGroup, groupListHelper.getEntityType(everyoneGroup)); form.addPrincipal(everyoneBean); for (String activity : PORTLET_SUBSCRIBE_ACTIVITIES) { form.addPermission(everyoneBean.getTypeAndIdHash() + "_" + activity); } return form; }
Source:
public ScriptHelper failOnNonZeroResultCode(boolean val) { Predicate<Integer> onTrue = new Predicate<Integer>() { @Override public boolean apply(Integer input) { return input == 0; } }; Predicate<Integer> onFalse = new Predicate<Integer>() { @Override public boolean apply(Integer input) { return true; } }; requireResultCode(val ? onTrue : onFalse); return this; }

Target:
public ScriptHelper failOnNonZeroResultCode(boolean val) { Predicate<Integer> onTrue = Predicates.equalTo(0); Predicate<Integer> onFalse = Predicates.alwaysTrue(); requireResultCode(val ? onTrue : onFalse); return this; }
Source:
private static void ingest(String pid, Path payload) throws IOException { if (!checkObjecsExist(pid)) { String ingestURI = FEDORA_URI + "/objects/" + pid + "?format=info:fedora/fedora-system:FOXML-1.1&ignoreMime=true"; logger.debug("INGEST URI = {}", ingestURI); HttpPost ingest = new HttpPost(ingestURI); ingest.setEntity(new ByteArrayEntity(Files.readAllBytes(payload))); ingest.setHeader("Content-type", MediaType.TEXT_XML); try (CloseableHttpResponse pidRes = httpClient.execute(ingest)) { assertEquals("Failed to ingest " + pid + "!", SC_CREATED, pidRes.getStatusLine().getStatusCode()); logger.info("Ingested test object {}", EntityUtils.toString(pidRes.getEntity())); } } }

Target:
private static void ingest(String pid, Path payload) throws IOException { if (!checkObjectExist(pid)) { String ingestURI = FEDORA_URI + "/objects/" + pid + "?format=info:fedora/fedora-system:FOXML-1.1&ignoreMime=true"; logger.debug("INGEST URI = {}", ingestURI); HttpPost ingest = new HttpPost(ingestURI); ingest.setEntity(new ByteArrayEntity(Files.readAllBytes(payload))); ingest.setHeader("Content-type", MediaType.TEXT_XML); try (CloseableHttpResponse pidRes = httpClient.execute(ingest)) { assertEquals("Failed to ingest " + pid + "!", SC_CREATED, pidRes.getStatusLine().getStatusCode()); logger.info("Ingested test object {}", EntityUtils.toString(pidRes.getEntity())); } } }
Source:
public void testSelectBestPoolsShouldSelectBothPoolsInStackWhenOneOfThemProvidesTheSpecifiedAddon() { Product product69 = new Product(); product69.setId("compliant-69"); Set<String> addons = new HashSet<>(); addons.add("One Addon"); consumer.setAddOns(addons); ConsumerInstalledProduct consumerInstalledProduct = new ConsumerInstalledProduct(product69); consumer.addInstalledProduct(consumerInstalledProduct); Product prodMCT1650 = createSysPurposeProduct(null, null, "One Addon,Other Addon", null, null); prodMCT1650.setAttribute(Product.Attributes.STACKING_ID, "bob"); prodMCT1650.setAttribute("multi-entitlement", "yes"); Pool MCT1650 = TestUtil.createPool(owner, prodMCT1650); MCT1650.setId("MCT1650"); MCT1650.setQuantity(1L); Product prodMCT80 = createSysPurposeProduct(null, null, null, null, null); prodMCT80.setAttribute(Product.Attributes.STACKING_ID, "bob"); prodMCT80.setAttribute("multi-entitlement", "yes"); Pool MCT80 = TestUtil.createPool(owner, prodMCT80); MCT80.setId("MCT80"); MCT80.setQuantity(1L); MCT80.getProduct().addProvidedProduct(product69); List<Pool> pools = new ArrayList<>(); pools.add(MCT1650); pools.add(MCT80); List<PoolQuantity> bestPools = autobindRules.selectBestPools(consumer, new String[]{"compliant-69"}, pools, compliance, null, new HashSet<>(), false); assertEquals(2, bestPools.size()); assertTrue(bestPools.contains(new PoolQuantity(MCT1650, 1))); assertTrue(bestPools.contains(new PoolQuantity(MCT80, 1))); }

Target:
public void testSelectBestPoolsShouldSelectBothPoolsInStackWhenOneOfThemProvidesTheSpecifiedAddon() { Product product69 = new Product(); product69.setId("compliant-69"); Set<String> addons = new HashSet<>(); addons.add("One Addon"); consumer.setAddOns(addons); ConsumerInstalledProduct consumerInstalledProduct = new ConsumerInstalledProduct(product69); consumer.addInstalledProduct(consumerInstalledProduct); Product prodMCT1650 = createSysPurposeProduct(null, null, "One Addon,Other Addon", null, null); prodMCT1650.setAttribute(Product.Attributes.STACKING_ID, "bob"); prodMCT1650.setAttribute("multi-entitlement", "yes"); Pool MCT1650 = TestUtil.createPool(owner, prodMCT1650); MCT1650.setId("MCT1650"); MCT1650.setQuantity(1L); Product prodMCT80 = createSysPurposeProduct(null, null, null, null, null); prodMCT80.setAttribute(Product.Attributes.STACKING_ID, "bob"); prodMCT80.setAttribute("multi-entitlement", "yes"); prodMCT80.addProvidedProduct(product69); Pool MCT80 = TestUtil.createPool(owner, prodMCT80); MCT80.setId("MCT80"); MCT80.setQuantity(1L); List<Pool> pools = new ArrayList<>(); pools.add(MCT1650); pools.add(MCT80); List<PoolQuantity> bestPools = autobindRules.selectBestPools(consumer, new String[]{"compliant-69"}, pools, compliance, null, new HashSet<>(), false); assertEquals(2, bestPools.size()); assertTrue(bestPools.contains(new PoolQuantity(MCT1650, 1))); assertTrue(bestPools.contains(new PoolQuantity(MCT80, 1))); }
Source:
public static String getMatrixConstraint(UriInfo uriInfo, String constraint) { return getMatrixConstraints(uriInfo, constraint).containsKey(constraint) ? getMatrixConstraints(uriInfo, constraint).get(constraint) : null; }

Target:
public static String getMatrixConstraint(UriInfo uriInfo, String constraint) { HashMap<String, String> constraints = getMatrixConstraints(uriInfo, constraint); return constraints.containsKey(constraint) ? constraints.get(constraint) : null; }
Source:
public void send(Message<?> message, ScopeDescriptor scopeDescription) throws Exception { if (!(message instanceof EventMessage)) { String exceptionMessage = String.format( "Something else than an EventMessage was scheduled for Saga of type [%s], whilst Sagas can only handle EventMessages.", getSagaType() ); throw new IllegalArgumentException(exceptionMessage); } if (scopeDescription instanceof SagaDescriptor) { sagaRepository.load(((SagaDescriptor) scopeDescription).getIdentifier().toString()) .handle((EventMessage) message); } }

Target:
public void send(Message<?> message, ScopeDescriptor scopeDescription) throws Exception { if (!(message instanceof EventMessage)) { String exceptionMessage = String.format( "Something else than an EventMessage was scheduled for Saga of type [%s], whilst Sagas can only handle EventMessages.", getSagaType() ); throw new IllegalArgumentException(exceptionMessage); } if (canResolve(scopeDescription)) { String sagaIdentifier = ((SagaScopeDescriptor) scopeDescription).getIdentifier().toString(); Saga<T> saga = sagaRepository.load(sagaIdentifier); if (saga != null) { saga.handle((EventMessage) message); } else { logger.debug("Saga (with id: [{}]) cannot be loaded, as it most likely already ended." + " Hence, message cannot be handled.", sagaIdentifier, message); } } }
Source:
public void onCreate() { super.onCreate(); this.wifiBroadcastReceiver = new WifiBroadcastReceiver(this); com.alive_n_clickin.waft.application.NearbyBusScanner nearbyBusScanner = new com.alive_n_clickin.waft.application.NearbyBusScanner(wifiBroadcastReceiver, this.getApplicationContext()); this.manager = new com.alive_n_clickin.waft.application.Manager(nearbyBusScanner); }

Target:
public void onCreate() { super.onCreate(); this.wifiBroadcastReceiver = new WifiBroadcastReceiver(this); NearbyBusScanner nearbyBusScanner = new NearbyBusScanner(wifiBroadcastReceiver, this.getApplicationContext()); this.manager = new Manager(nearbyBusScanner); }
Source:
public TcpCommunicationMetricsListener(GridMetricManager mmgr) { this.mmgr = mmgr; mreg = mmgr.registry(COMMUNICATION_METRICS_GROUP_NAME); sentMsgsCntByTypeMetricFactory = directType -> mreg.longAdderMetric( sentMessagesByTypeMetricName(directType), SENT_MESSAGES_BY_TYPE_METRIC_DESC ); rcvdMsgsCntByTypeMetricFactory = directType -> mreg.longAdderMetric( receivedMessagesByTypeMetricName(directType), RECEIVED_MESSAGES_BY_TYPE_METRIC_DESC ); sentMsgsCntByNodeIdMetricFactory = nodeId -> mmgr.registry(COMMUNICATION_METRICS_GROUP_NAME + "." + nodeId) .longAdderMetric( SENT_MESSAGES_BY_NODE_ID_METRIC_NAME, SENT_MESSAGES_BY_NODE_ID_METRIC_DESC ); rcvdMsgsCntByNodeIdMetricFactory = nodeId -> mmgr.registry(COMMUNICATION_METRICS_GROUP_NAME + "." + nodeId) .longAdderMetric( RECEIVED_MESSAGES_BY_NODE_ID_METRIC_NAME, RECEIVED_MESSAGES_BY_NODE_ID_METRIC_DESC ); sentBytesMetric = mreg.longAdderMetric(SENT_BYTES_METRIC_NAME, SENT_BYTES_METRIC_DESC); rcvdBytesMetric = mreg.longAdderMetric(RECEIVED_BYTES_METRIC_NAME, RECEIVED_BYTES_METRIC_DESC); sentMsgsMetric = mreg.longAdderMetric(SENT_MESSAGES_METRIC_NAME, SENT_MESSAGES_METRIC_DESC); rcvdMsgsMetric = mreg.longAdderMetric(RECEIVED_MESSAGES_METRIC_NAME, RECEIVED_MESSAGES_METRIC_DESC); }

Target:
public TcpCommunicationMetricsListener(GridMetricManager mmgr) { this.mmgr = mmgr; mreg = mmgr.registry(COMMUNICATION_METRICS_GROUP_NAME); sentMsgsCntByTypeMetricFactory = directType -> mreg.longAdderMetric( sentMessagesByTypeMetricName(directType), SENT_MESSAGES_BY_TYPE_METRIC_DESC ); rcvdMsgsCntByTypeMetricFactory = directType -> mreg.longAdderMetric( receivedMessagesByTypeMetricName(directType), RECEIVED_MESSAGES_BY_TYPE_METRIC_DESC ); sentMsgsCntByNodeIdMetricFactory = nodeId -> mmgr.registry(metricName(COMMUNICATION_METRICS_GROUP_NAME, nodeId.toString())) .findMetric(SENT_MESSAGES_BY_NODE_ID_METRIC_NAME); rcvdMsgsCntByNodeIdMetricFactory = nodeId -> mmgr.registry(metricName(COMMUNICATION_METRICS_GROUP_NAME, nodeId.toString())) .findMetric(RECEIVED_MESSAGES_BY_NODE_ID_METRIC_NAME); sentBytesMetric = mreg.longAdderMetric(SENT_BYTES_METRIC_NAME, SENT_BYTES_METRIC_DESC); rcvdBytesMetric = mreg.longAdderMetric(RECEIVED_BYTES_METRIC_NAME, RECEIVED_BYTES_METRIC_DESC); sentMsgsMetric = mreg.longAdderMetric(SENT_MESSAGES_METRIC_NAME, SENT_MESSAGES_METRIC_DESC); rcvdMsgsMetric = mreg.longAdderMetric(RECEIVED_MESSAGES_METRIC_NAME, RECEIVED_MESSAGES_METRIC_DESC); mmgr.addMetricRegistryCreationListener(mreg -> { if (!mreg.name().startsWith(COMMUNICATION_METRICS_GROUP_NAME + SEPARATOR)) return; mreg.longAdderMetric(SENT_MESSAGES_BY_NODE_ID_METRIC_NAME, SENT_MESSAGES_BY_NODE_ID_METRIC_DESC); mreg.longAdderMetric(RECEIVED_MESSAGES_BY_NODE_ID_METRIC_NAME, RECEIVED_MESSAGES_BY_NODE_ID_METRIC_DESC); }); }
Source:
public void compensate() { RemoveImageParameters removeImageParams = new RemoveImageParameters(enclosingCommand.getParameters().getImageGroupID()); removeImageParams.setStorageDomainId(enclosingCommand.getParameters().getStorageDomainId()); removeImageParams.setParentCommand(VdcActionType.RemoveImage); removeImageParams.setDbOperationScope(ImageDbOperationScope.NONE); removeImageParams.setShouldLockImage(false); removeImageParams.setEntityInfo(new EntityInfo(VdcObjectType.Disk, Guid.newGuid())); VdcReturnValueBase vdcReturnValue = Backend.getInstance().runInternalAction( VdcActionType.RemoveImage, removeImageParams, ExecutionHandler.createInternalJobContext()); ExecutionHandler.setAsyncJob(enclosingCommand.getExecutionContext(), true); enclosingCommand.getReturnValue().setSucceeded(true); }

Target:
public void compensate() { revertTask(); }
Source:
public void testTriggerGCService() throws Exception { baseConf.setMetadataServiceUri(zkUtil.getMetadataServiceUri()); BookKeeper.DigestType digestType = BookKeeper.DigestType.CRC32; int numLedgers = 4; int numMsgs = 100; LedgerHandle[] lh = new LedgerHandle[numLedgers]; for (int i = 0; i < numLedgers; i++) { lh[i] = bkc.createLedger(digestType, "".getBytes()); } String content = "Apache BookKeeper is cool!"; for (int i = 0; i < numMsgs; i++) { for (int j = 0; j < numLedgers; j++) { lh[j].addEntry(content.getBytes()); } } for (int i = 0; i < numLedgers; i++) { lh[i].close(); } HttpEndpointService triggerGCService = bkHttpServiceProvider .provideHttpEndpointService(HttpServer.ApiType.GC); HttpServiceRequest request1 = new HttpServiceRequest(null, HttpServer.Method.GET, null); HttpServiceResponse response1 = triggerGCService.handle(request1); assertEquals(HttpServer.StatusCode.OK.getValue(), response1.getStatusCode()); assertTrue(response1.getBody().contains("false")); HttpServiceRequest request2 = new HttpServiceRequest(null, HttpServer.Method.PUT, null); HttpServiceResponse response2 = triggerGCService.handle(request2); assertEquals(HttpServer.StatusCode.OK.getValue(), response2.getStatusCode()); }

Target:
public void testTriggerGCService() throws Exception { baseConf.setMetadataServiceUri(zkUtil.getMetadataServiceUri()); BookKeeper.DigestType digestType = BookKeeper.DigestType.CRC32; int numLedgers = 4; int numMsgs = 100; LedgerHandle[] lh = new LedgerHandle[numLedgers]; for (int i = 0; i < numLedgers; i++) { lh[i] = bkc.createLedger(digestType, "".getBytes()); } String content = "Apache BookKeeper is cool!"; for (int i = 0; i < numMsgs; i++) { for (int j = 0; j < numLedgers; j++) { lh[j].addEntry(content.getBytes()); } } for (int i = 0; i < numLedgers; i++) { lh[i].close(); } HttpEndpointService triggerGCService = bkHttpServiceProvider .provideHttpEndpointService(HttpServer.ApiType.GC); HttpServiceRequest request1 = new HttpServiceRequest(null, HttpServer.Method.GET, null); HttpServiceResponse response1 = triggerGCService.handle(request1); assertEquals(HttpServer.StatusCode.OK.getValue(), response1.getStatusCode()); assertTrue(response1.getBody().contains("\"is_in_force_gc\" : \"false\"")); HttpServiceRequest request2 = new HttpServiceRequest(null, HttpServer.Method.PUT, null); HttpServiceResponse response2 = triggerGCService.handle(request2); assertEquals(HttpServer.StatusCode.OK.getValue(), response2.getStatusCode()); }
Source:
public String getString (String name, String def) { String value = (String)_data.get(name); return StringUtil.isBlank(value) ? def : value; }

Target:
public String getString (String name, String def) { String value = (String)_data.get(name); return value == null ? def : value; }
Source:
private HttpResponse forward(HttpClient httpclient, String verb, String uri, HttpServletRequest request, MultiValueMap<String, String> headers, MultiValueMap<String, String> params, InputStream requestEntity) throws Exception { Map<String, Object> info = this.helper.debug(verb, uri, headers, params, requestEntity); URL host = RequestContext.getCurrentContext().getRouteHost(); HttpHost httpHost = getHttpHost(host); uri = StringUtils.cleanPath((host.getPath() + uri).replaceAll("/{2,}", "/")); HttpRequest httpRequest; int contentLength = request.getContentLength(); InputStreamEntity entity = new InputStreamEntity(requestEntity, contentLength, request.getContentType() != null ? ContentType.create(request.getContentType()) : null); switch (verb.toUpperCase()) { case "POST": HttpPost httpPost = new HttpPost(uri + this.helper.getQueryString(params)); httpRequest = httpPost; httpPost.setEntity(entity); break; case "PUT": HttpPut httpPut = new HttpPut(uri + this.helper.getQueryString(params)); httpRequest = httpPut; httpPut.setEntity(entity); break; case "PATCH": HttpPatch httpPatch = new HttpPatch(uri + this.helper.getQueryString(params)); httpRequest = httpPatch; httpPatch.setEntity(entity); break; case "DELETE": BasicHttpEntityEnclosingRequest entityRequest = new BasicHttpEntityEnclosingRequest(verb, uri + this.helper.getQueryString(params)); httpRequest = entityRequest; entityRequest.setEntity(entity); break; default: httpRequest = new BasicHttpRequest(verb, uri + this.helper.getQueryString(params)); log.debug(uri + this.helper.getQueryString(params)); } try { httpRequest.setHeaders(convertHeaders(headers)); log.debug(httpHost.getHostName() + " " + httpHost.getPort() + " " + httpHost.getSchemeName()); HttpResponse zuulResponse = forwardRequest(httpclient, httpHost, httpRequest); this.helper.appendDebug(info, zuulResponse.getStatusLine().getStatusCode(), revertHeaders(zuulResponse.getAllHeaders())); return zuulResponse; } finally { } }

Target:
private HttpResponse forward(HttpClient httpclient, String verb, String uri, HttpServletRequest request, MultiValueMap<String, String> headers, MultiValueMap<String, String> params, InputStream requestEntity) throws Exception { Map<String, Object> info = this.helper.debug(verb, uri, headers, params, requestEntity); URL host = RequestContext.getCurrentContext().getRouteHost(); HttpHost httpHost = getHttpHost(host); uri = StringUtils.cleanPath((host.getPath() + uri).replaceAll("/{2,}", "/")); int contentLength = request.getContentLength(); InputStreamEntity entity = new InputStreamEntity(requestEntity, contentLength, request.getContentType() != null ? ContentType.create(request.getContentType()) : null); HttpRequest httpRequest = buildHttpRequest(verb, uri, entity, headers, params); try { log.debug(httpHost.getHostName() + " " + httpHost.getPort() + " " + httpHost.getSchemeName()); HttpResponse zuulResponse = forwardRequest(httpclient, httpHost, httpRequest); this.helper.appendDebug(info, zuulResponse.getStatusLine().getStatusCode(), revertHeaders(zuulResponse.getAllHeaders())); return zuulResponse; } finally { } }
Source:
public void processWorkbenchLog(String config, String className, String logDescription) { File logFile = Platform.getWorkbenchLog(); if(logFile != null && logFile.exists()){ try (BufferedReader br = new BufferedReader(new FileReader(Platform.getWorkbenchLog())); BufferedWriter bw = new BufferedWriter(new FileWriter(getLogFile(config, className), true))) { String line = br.readLine(); if (line != null) { bw.write(logDescription + "\n\n"); bw.write(line + "\n"); while ((line = br.readLine()) != null) { bw.write(line + "\n"); } bw.write("\n\n"); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } } else { log.debug("Log file does not exist"); } }

Target:
public void processWorkbenchLog(String config, String className, String logDescription) { if(eclipseLogFileExists()){ try (BufferedReader br = new BufferedReader(new FileReader(Platform.getWorkbenchLog())); BufferedWriter bw = new BufferedWriter(new FileWriter(getLogFile(config, className), true))) { String line = br.readLine(); if (line != null) { bw.write(logDescription + "\n\n"); bw.write(line + "\n"); while ((line = br.readLine()) != null) { bw.write(line + "\n"); } bw.write("\n\n"); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } } else { log.debug("Log file does not exist"); } }
Source:
public void testDefaults() { assertRecordedDefaults(ConfigAssertions.recordDefaults(DbResourceGroupConfig.class) .setConfigDbUrl(null) .setMaxRefreshInterval(new Duration(1, HOURS)) .setReloadRefreshInterval(new Duration(1, SECONDS)) .setExactMatchSelectorEnabled(false)); }

Target:
public void testDefaults() { assertRecordedDefaults(ConfigAssertions.recordDefaults(DbResourceGroupConfig.class) .setConfigDbUrl(null) .setMaxRefreshInterval(new Duration(1, HOURS)) .setExactMatchSelectorEnabled(false)); }
Source:
public int getEurekaServiceUrlPollIntervalSeconds() { return configInstance.getIntProperty( namespace + "serviceUrlPollIntervalSeconds", 5 * 60).get(); }

Target:
public int getEurekaServiceUrlPollIntervalSeconds() { return configInstance.getIntProperty( namespace + "serviceUrlPollIntervalMs", 5 * 60 * 1000).get() / 1000; }
Source:
protected void fetchGitHubRepository(@NonNull Integer repositoryId) { Preconditions.checkNotNull(repositoryId, "Repository Id cannot be null."); Intent intent = new Intent(); intent.putExtra("serviceUriString", GitHubService.REPOSITORY.toString()); intent.putExtra("id", repositoryId); fetcherManager.findFetcher(GitHubService.REPOSITORY).fetch(intent); }

Target:
protected void fetchGitHubRepository(@NonNull Integer repositoryId) { Preconditions.checkNotNull(repositoryId, "Repository Id cannot be null."); Intent intent = new Intent(); intent.putExtra("serviceUriString", GitHubService.REPOSITORY.toString()); intent.putExtra("id", repositoryId); Fetcher<Uri> fetcher = fetcherManager.findFetcher(GitHubService.REPOSITORY); if (fetcher != null) { fetcher.fetch(intent); } }
Source:
private static void doDropdownMenu(String redir, String page, String tableName, StringBuilder sb, SortedMap<String,String> namespaces, String namespace) { String namespaceUrl = String.format("/op?action=namespace&redir=%s&page=%s&table=%s&selected=", redir, page, tableName); sb.append("<ul id=\"namespaces\">\n"); sb.append("<li><a ").append(namespace.equals("*") ? "class=\"active\" " : "").append("href=\"").append(namespaceUrl).append("*\">*</a></li>"); for (String key : namespaces.keySet()) { if (key.equals("")) { sb.append("<li><a ").append(namespace.equals("-") ? "class=\"active\" " : "").append("href=\"").append(namespaceUrl).append("-\">-</a></li>"); } else { sb.append("<li><a ").append(namespace.equals(key) ? "class=\"active\" " : "").append("href=\"").append(namespaceUrl).append(key).append("\">") .append(key).append("</a></li>"); } } sb.append("</ul>\n"); }

Target:
private static void doDropdownMenu(String redir, String page, String tableName, StringBuilder sb, SortedMap<String,String> namespaces, String namespace) { String namespaceUrl = String.format("/op?action=namespace&redir=%s&page=%s&table=%s&selected=", redir, page, tableName); sb.append("<ul id=\"namespaces\">\n"); sb.append("<li><a ").append(namespace.equals("*") ? "class=\"active\" " : "").append("href=\"").append(namespaceUrl) .append("*\">*&nbsp;(All&nbsp;Tables)</a></li>"); for (String key : namespaces.keySet()) { if (key.equals("")) { sb.append("<li><a ").append(namespace.equals("-") ? "class=\"active\" " : "").append("href=\"").append(namespaceUrl) .append("-\">-&nbsp;(DEFAULT)</a></li>"); } else { sb.append("<li><a ").append(namespace.equals(key) ? "class=\"active\" " : "").append("href=\"").append(namespaceUrl).append(key).append("\">") .append(key).append("</a></li>"); } } sb.append("</ul>\n"); }
Source:
public void testAddPackagesToWhiteList() throws Exception { final WhiteList whiteList = new WhiteList(); grid.setDependencies( new POM(), whiteList ); final HashSet<String> packages = new HashSet<String>(); packages.add( "org.drools" ); packages.add( "org.guvnor" ); assertEquals( 0, whiteList.size() ); grid.onAddAll( packages ); }

Target:
public void testAddPackagesToWhiteList() throws Exception { final WhiteList whiteList = new WhiteList(); grid.setDependencies( new POM(), whiteList ); final HashSet<String> packages = new HashSet<String>(); packages.add( "org.drools" ); packages.add( "org.guvnor" ); assertEquals( 0, whiteList.size() ); grid.onAddAll( packages ); assertEquals( 2, whiteList.size() ); }
Source:
final <T> CompletableFuture<T> checkInvocationAllowedFuture() { ComponentStatus status = cache.getStatus(); if (!status.allowInvocations()) { return completedExceptionFuture(new CacheException("Cache is stopping or terminated: " + status)); } return null; }

Target:
final <T> CompletableFuture<T> checkInvocationAllowedFuture() { ComponentStatus status = cache.getStatus(); if (!status.allowInvocations()) { return completedExceptionFuture(new IllegalLifecycleStateException("Cache is stopping or terminated: " + status)); } return null; }
Source:
private void broadcast(String noteId, Message m) { List<NotebookSocket> socketsToBroadcast; synchronized (noteSocketMap) { broadcastToWatchers(noteId, StringUtils.EMPTY, m); List<NotebookSocket> socketLists = noteSocketMap.get(noteId); if (socketLists == null || socketLists.size() == 0) { return; } socketsToBroadcast = new ArrayList<>(socketLists); } LOG.debug("SEND >> " + m); for (NotebookSocket conn : socketsToBroadcast) { try { conn.send(serializeMessage(m)); } catch (IOException e) { LOG.error("socket error", e); } } }

Target:
private void broadcast(String noteId, Message m) { List<NotebookSocket> socketsToBroadcast = Collections.emptyList(); synchronized (noteSocketMap) { broadcastToWatchers(noteId, StringUtils.EMPTY, m); List<NotebookSocket> socketLists = noteSocketMap.get(noteId); if (socketLists == null || socketLists.size() == 0) { return; } socketsToBroadcast = new ArrayList<>(socketLists); } LOG.debug("SEND >> " + m); for (NotebookSocket conn : socketsToBroadcast) { try { conn.send(serializeMessage(m)); } catch (IOException e) { LOG.error("socket error", e); } } }
Source:
public List<HistoryMessage> getMessage(String text) { if (text == null || "".equals(text)) { for (HistoryMessage message : messages) { message.setBody(message.getBody().toLowerCase().replaceAll("#ffff00","#ffffff")); } return messages; } else { List<HistoryMessage> searchResult = new ArrayList<>(); int iter = 0; HistoryMessage previous = null; for(HistoryMessage message : messages) { iter++; if (message.getBody().toLowerCase().contains(text.toLowerCase())) { message.setBody(message.getBody().toLowerCase().replaceAll(text.toLowerCase(), "<span style=\"background-color: #ffff00\">" + text.toLowerCase() + "</span>")); if (previous != null) searchResult.add(previous); searchResult.add(message); if (iter + 1 != messages.size()) { searchResult.add(messages.get(iter + 1)); } } previous = message; } return searchResult; } }

Target:
public List<HistoryMessage> getMessage(String text) { if (text == null || "".equals(text)) { return messages; } else { List<HistoryMessage> searchResult = new ArrayList<>(); int iter = 0; HistoryMessage previous = null; for(HistoryMessage message : messages) { iter++; if (message.getBody().toLowerCase().contains(text.toLowerCase())) { if (previous != null) { searchResult.add(previous); } searchResult.add(message); if (iter + 1 != messages.size()) { searchResult.add(messages.get(iter + 1)); } } previous = message; } return searchResult; } }
Source:
public void requestHandleWithGoodInputTestWithKeepAlive() throws Exception { doRequestHandleWithKeepAliveTest(HttpMethod.POST, "POST"); doRequestHandleWithKeepAliveTest(HttpMethod.GET, "GET"); doRequestHandleWithKeepAliveTest(HttpMethod.DELETE, "DELETE"); }

Target:
public void requestHandleWithGoodInputTestWithKeepAlive() throws Exception { doRequestHandleWithKeepAliveTest(HttpMethod.POST, "POST", false); doRequestHandleWithKeepAliveTest(HttpMethod.GET, "GET", false); doRequestHandleWithKeepAliveTest(HttpMethod.DELETE, "DELETE", false); doRequestHandleWithKeepAliveTest(HttpMethod.POST, "POST", true); doRequestHandleWithKeepAliveTest(HttpMethod.GET, "GET", true); doRequestHandleWithKeepAliveTest(HttpMethod.DELETE, "DELETE", true); }
Source:
public WordEmbeddingDictionary(String indexPath) throws Exception { this.indexPath = Paths.get(indexPath); if (!Files.exists(this.indexPath)) { Files.createDirectories(this.indexPath); } this.directory = FSDirectory.open(this.indexPath); this.reader = DirectoryReader.open(directory); }

Target:
public WordEmbeddingDictionary(String indexPath) throws IOException { this.indexPath = Paths.get(indexPath); this.directory = FSDirectory.open(this.indexPath); this.reader = DirectoryReader.open(directory); this.searcher = new IndexSearcher(reader); this.analyzer = new WhitespaceAnalyzer(); }
Source:
public Relationship(final Structure parentStructure, final Structure childStructure, final String parentRelationName, final String childRelationName, final int cardinality, final boolean parentRequired, final boolean childRequired) { super(); this.setType("relationship"); final boolean isManyToOne = cardinality == MANY_TO_ONE.ordinal(); if (isManyToOne){ this.parentStructureInode = childStructure.getInode(); this.childStructureInode = parentStructure.getInode(); this.parentRelationName = childRelationName; this.childRelationName = parentRelationName; this.cardinality = ONE_TO_MANY.ordinal(); this.parentRequired = childRequired; this.childRequired = parentRequired; } else{ this.parentStructureInode = parentStructure.getInode(); this.childStructureInode = childStructure.getInode(); this.parentRelationName = isManyToOne ? childRelationName: parentRelationName; this.childRelationName = isManyToOne ? parentRelationName: childRelationName; this.cardinality = isManyToOne ? ONE_TO_MANY.ordinal() : cardinality; this.parentRequired = parentRequired; this.childRequired = childRequired; } this.relationTypeValue = parentRelationName.replaceAll(" ", "_") + "-" + childRelationName .replaceAll(" ", "_"); }

Target:
public Relationship(final Structure parentStructure, final Structure childStructure, final String parentRelationName, final String childRelationName, final int cardinality, final boolean parentRequired, final boolean childRequired) { super(); this.setType("relationship"); this.parentStructureInode = parentStructure.getInode(); this.childStructureInode = childStructure.getInode(); this.parentRelationName = parentRelationName; this.childRelationName = childRelationName; this.cardinality = cardinality; this.parentRequired = parentRequired; this.childRequired = childRequired; this.relationTypeValue = parentRelationName.replaceAll(" ", "_") + "-" + childRelationName .replaceAll(" ", "_"); final RelationshipConstructionStrategy strategy = new RelationshipStrategyFactory() .getRelationshipConstructionStrategy(cardinality == MANY_TO_ONE.ordinal()); strategy.apply(this); }
Source:
public static String readResourceFully(@Nonnull String fileName, @Nonnull String encoding) throws IOException { InputStream smaliStream = LambdaTest.class.getClassLoader(). getResourceAsStream(fileName); if (smaliStream == null) { Assert.fail("Could not load " + fileName); } return new String(ByteStreams.toByteArray(smaliStream), encoding); }

Target:
public static String readResourceFully(@Nonnull String fileName, @Nonnull String encoding) throws IOException { InputStream smaliStream = RoundtripTest.class.getClassLoader(). getResourceAsStream(fileName); if (smaliStream == null) { Assert.fail("Could not load " + fileName); } return new String(ByteStreams.toByteArray(smaliStream), encoding); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SyncNuageVspCmsIdAnswer that = (SyncNuageVspCmsIdAnswer) o; if (_success != that._success) return false; if (_nuageVspCmsId != null ? !_nuageVspCmsId.equals(that._nuageVspCmsId) : that._nuageVspCmsId != null) return false; if (_syncType != that._syncType) return false; return true; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SyncNuageVspCmsIdAnswer)) return false; if (!super.equals(o)) return false; SyncNuageVspCmsIdAnswer that = (SyncNuageVspCmsIdAnswer) o; if (_success != that._success) return false; if (_nuageVspCmsId != null ? !_nuageVspCmsId.equals(that._nuageVspCmsId) : that._nuageVspCmsId != null) return false; if (_syncType != that._syncType) return false; return true; }
Source:
public void testLiteralIf() throws Exception { final DefaultConfiguration configurationTestLiteralIf = createCheckConfig(WhitespaceAfterCheck.class); configurationTestLiteralIf.addAttribute("tokens", "LITERAL_IF"); final String[] expected = { "18:11: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "if"), }; verify(configurationTestLiteralIf, getPath("InputWhitespaceAfterConditions.java"), expected); }

Target:
public void testLiteralIf() throws Exception { final DefaultConfiguration configurationTestLiteralIf = createCheckConfig(WhitespaceAfterCheck.class); configurationTestLiteralIf.addAttribute("tokens", "LITERAL_IF"); final String[] expected = { "18:11: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "if"), }; verify(configurationTestLiteralIf, getPath("InputWhitespaceAfterLiteralIf.java"), expected); }
Source:
public List<DocumentRevision> getDocumentsWithIds(final List<String> docIds) throws DocumentStoreException { Misc.checkState(this.isOpen(), "Database is closed"); Misc.checkNotNull(docIds, "Input document id list"); try { return get (queue.submit(new GetDocumentsWithIdsCallable(docIds, attachmentsDir, attachmentStreamFactory))); } catch (ExecutionException e) { logger.log(Level.SEVERE, "Failed to get documents with ids", e); throw new DocumentStoreException("Failed to get documents with ids", e); } }

Target:
public List<DocumentRevision> getDocumentsWithIds(final List<String> docIds) throws DocumentStoreException { Misc.checkState(this.isOpen(), "Database is closed"); Misc.checkNotNull(docIds, "Input document id list"); try { return get (queue.submit(new GetDocumentsWithIdsCallable(docIds, attachmentsDir, attachmentStreamFactory))); } catch (ExecutionException e) { String message = "Failed to get documents with ids"; logger.log(Level.SEVERE, message, e); throw new DocumentStoreException(message, e); } }