auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public AVideo(String name, InputStream isdata) throws IOException { if (isdata == null) throw new IllegalArgumentException("null stream"); _name = name; _isdata = isdata; _data = null; _url = null; _file = null; }

Target:
public AVideo(String name, InputStream isdata) throws IOException { if (isdata == null) throw new IllegalArgumentException("stream cannot be null"); _name = name; _isdata = isdata; _data = null; _url = null; _file = null; }
Source:
public void testModuleWizard() throws Throwable { ComponentWizard connectionWizard = getComponentService() .getComponentWizard(SalesforceConnectionWizardDefinition.COMPONENT_WIZARD_NAME, "nodeSalesforce"); List<Form> forms = connectionWizard.getForms(); Form connectionWizardForm = forms.get(0); SalesforceConnectionProperties connProps = (SalesforceConnectionProperties) connectionWizardForm.getProperties(); ComponentWizard[] subWizards = getComponentService().getComponentWizardsForProperties(connProps, "location") .toArray(new ComponentWizard[2]); Arrays.sort(subWizards, new WizardNameComparator()); assertEquals(2, subWizards.length); assertFalse(subWizards[1].getDefinition().isTopLevel()); assertEquals("Salesforce Modules", subWizards[1].getDefinition().getMenuItemName()); assertTrue(subWizards[0].getDefinition().isTopLevel()); assertEquals("Salesforce Connection", subWizards[0].getDefinition().getMenuItemName()); }

Target:
public void testModuleWizard() throws Throwable { ComponentWizard connectionWizard = getComponentService() .getComponentWizard(SalesforceConnectionWizardDefinition.COMPONENT_WIZARD_NAME, "nodeSalesforce"); List<Form> forms = connectionWizard.getForms(); Form connectionWizardForm = forms.get(0); SalesforceConnectionProperties connProps = (SalesforceConnectionProperties) connectionWizardForm.getProperties(); ComponentWizard[] subWizards = getComponentService().getComponentWizardsForProperties(connProps, "location") .toArray(new ComponentWizard[2]); Arrays.sort(subWizards, new WizardNameComparator()); assertEquals(2, subWizards.length); assertTrue(subWizards[0].getDefinition().isTopLevel()); assertEquals("Salesforce Connection", subWizards[0].getDefinition().getMenuItemName()); assertFalse(subWizards[1].getDefinition().isTopLevel()); assertEquals("Salesforce Modules", subWizards[1].getDefinition().getMenuItemName()); }
Source:
public boolean remove(ChannelInterceptor interceptor) { this.size--; return this.interceptors.remove(interceptor); }

Target:
public boolean remove(ChannelInterceptor interceptor) { if (this.interceptors.remove(interceptor)) { this.size--; return true; } else { return false; } }
Source:
public void onRotateEntryLog() { if (null != checkpointer) { Checkpoint checkpoint = checkpointSource.newCheckpoint(); checkpointer.startCheckpoint(checkpoint); } }

Target:
public void onRotateEntryLog() { Checkpoint checkpoint = checkpointSource.newCheckpoint(); checkpointer.startCheckpoint(checkpoint); }
Source:
private List<JoinNode.EquiJoinClause> flippedCriteria(JoinNode node) { return node.getCriteria().stream() .map(criteria -> new JoinNode.EquiJoinClause(criteria.getRight(), criteria.getLeft())) .collect(toImmutableList()); }

Target:
private List<JoinNode.EquiJoinClause> flippedCriteria(JoinNode node) { return node.getCriteria().stream() .map(EquiJoinClause::flip) .collect(toImmutableList()); }
Source:
public void setReloadingConfigs(boolean reloadingConfigs) { if (reloadingConfigs && !this.reloadingConfigs) { this.reloadingConfigs = true; synchronized (files) { for (String fileName : files.keySet()) { if (null == files.get(fileName)) { try { monitorFile(new URL(fileName)); } catch (MalformedURLException e) { LOG.warn("Error creating URL from [{}]!", fileName, e); } } } } } this.reloadingConfigs = reloadingConfigs; }

Target:
public void setReloadingConfigs(boolean reloadingConfigs) { if (reloadingConfigs && !this.reloadingConfigs) { this.reloadingConfigs = true; synchronized (lazyMonitoredFilesCache) { for (URL fileUrl : lazyMonitoredFilesCache) { monitorFile(fileUrl); } lazyMonitoredFilesCache.clear(); } } this.reloadingConfigs = reloadingConfigs; }
Source:
public final static Map<String,String> asNodeSettingsMap(DeploymentType depl) { PathsType paths = depl.getPaths(); return ImmutableMap.<String,String>builder() .put(NodeSettings.VOLTDBROOT_PATH_KEY, paths.getVoltdbroot().getPath()) .put(NodeSettings.CL_PATH_KEY, paths.getCommandlog().getPath()) .put(NodeSettings.CL_SNAPSHOT_PATH_KEY, paths.getCommandlogsnapshot().getPath()) .put(NodeSettings.SNAPTHOT_PATH_KEY, paths.getSnapshots().getPath()) .put(NodeSettings.EXPORT_OVERFLOW_PATH_KEY, paths.getExportoverflow().getPath()) .put(NodeSettings.DR_OVERFLOW_PATH_KEY, paths.getDroverflow().getPath()) .build(); }

Target:
public final static Map<String,String> asNodeSettingsMap(DeploymentType depl) { PathsType paths = depl.getPaths(); return ImmutableMap.<String,String>builder() .put(NodeSettings.VOLTDBROOT_PATH_KEY, paths.getVoltdbroot().getPath()) .put(NodeSettings.CL_PATH_KEY, paths.getCommandlog().getPath()) .put(NodeSettings.CL_SNAPSHOT_PATH_KEY, paths.getCommandlogsnapshot().getPath()) .put(NodeSettings.SNAPTHOT_PATH_KEY, paths.getSnapshots().getPath()) .put(NodeSettings.EXPORT_OVERFLOW_PATH_KEY, paths.getExportoverflow().getPath()) .put(NodeSettings.DR_OVERFLOW_PATH_KEY, paths.getDroverflow().getPath()) .put(NodeSettings.LOCAL_SITES_COUNT_KEY, Integer.toString(depl.getCluster().getSitesperhost())) .build(); }
Source:
public void testErrorForwarding() throws Exception { new Context() {{ runTest(() -> { final Exception testException = new Exception("test leader Exeption"); testingLeaderElectionDriver.getFatalErrorHandler().onFatalError(testException); testingContender.waitForError(timeout); assertThat(testingContender.getError(), is(notNullValue())); assertThat(testingContender.getError().getMessage(), containsString(testException.getMessage())); }); }}; }

Target:
public void testErrorForwarding() throws Exception { new Context() {{ runTest(() -> { final Exception testException = new Exception("test leader exception"); testingLeaderElectionDriver.onFatalError(testException); testingContender.waitForError(timeout); assertThat(testingContender.getError(), is(notNullValue())); assertThat(testingContender.getError(), FlinkMatchers.containsCause(testException)); }); }}; }
Source:
protected boolean irrelevant(EStructuralFeature feat) { boolean irrelevantFeature = feat.isDerived() || feat.isTransient(); if (!irrelevantFeature && feat instanceof EReference) { EReference ref = (EReference)feat; irrelevantFeature = ref.isContainment() || ref.isContainer(); } return irrelevantFeature; }

Target:
protected boolean irrelevant(EStructuralFeature feat) { if (feat instanceof EAttribute) { return feat.isDerived() || feat.isTransient(); } else { EReference ref = (EReference)feat; return ref.isDerived() || ref.isTransient() || ref.isContainment() || ref.isContainer(); } }
Source:
protected InputStream onSuccessfulProxyRepositoryResponse(InputStream is, String storageId, String repositoryId, String path) throws IOException, NoSuchAlgorithmException, ProviderImplementationException { final Path tempPath = Files.createTempFile("strongbox", ".tmp"); try (final OutputStream tempPathOs = Files.newOutputStream(tempPath)) { final Storage storage = getConfiguration().getStorage(storageId); final Repository repository = storage.getRepository(repositoryId); final LayoutProvider layoutProvider = layoutProviderRegistry.getProvider(repository.getLayout()); final RepositoryPath artifactPath = layoutProvider.resolve(repository).resolve(path); artifactByteStreamsCopyStrategyDeterminator.determine(repository).copy(is, tempPathOs, artifactPath); } IOUtils.closeQuietly(is); return Files.newInputStream(tempPath); }

Target:
protected InputStream onSuccessfulProxyRepositoryResponse(InputStream is, String storageId, String repositoryId, String path) throws IOException, NoSuchAlgorithmException, ProviderImplementationException { final Path tempDir = Paths.get(ConfigurationResourceResolver.getTempDirectory()); final Path tempPath = Files.createTempFile(tempDir, "strongbox", ".tmp"); try (final OutputStream tempPathOs = Files.newOutputStream(tempPath)) { final Storage storage = getConfiguration().getStorage(storageId); final Repository repository = storage.getRepository(repositoryId); final LayoutProvider layoutProvider = layoutProviderRegistry.getProvider(repository.getLayout()); final RepositoryPath artifactPath = layoutProvider.resolve(repository).resolve(path); artifactByteStreamsCopyStrategyDeterminator.determine(repository).copy(is, tempPathOs, artifactPath); } ResourceCloser.close(is, logger); return Files.newInputStream(tempPath); }
Source:
public static boolean copyFile(InputStream inputStream, OutputStream out) { Logger.log(TAG, "File server copying file"); if (inputStream == null) { Logger.log(TAG, "Input stream null"); return false; } byte buf[] = new byte[1024]; int len; try { while ((len = inputStream.read(buf)) != -1) { out.write(buf, 0, len); } out.close(); inputStream.close(); } catch (IOException e) { Logger.log(TAG, "Copy in File Server failed with exception " + e); return false; } Logger.log(TAG, "Copy in File Server successful"); return true; }

Target:
public static void copyFile(InputStream inputStream, OutputStream out) throws IOException { Logger.log(TAG, "File server copying file"); if (inputStream == null) { Logger.log(TAG, "Input stream null"); throw new IOException("Got null input stream"); } byte buf[] = new byte[1024]; int len; try { while ((len = inputStream.read(buf)) != -1) { out.write(buf, 0, len); } out.close(); inputStream.close(); } catch (IOException e) { Logger.exception("Copy in File Server failed with exception " + e, e); throw e; } Logger.log(TAG, "Copy in File Server successful"); }
Source:
private Class<?> compile(String src, String name) throws Exception { File directory = createTempDir().toFile(); File srcFile = new File(directory, name + ".java"); try (PrintWriter pw = new PrintWriter(new FileWriter(srcFile))) { pw.append(src); } JavaCompiler javac = ToolProvider.getSystemJavaCompiler(); assertEquals(0, javac.run(null, null, null, srcFile.getCanonicalPath())); srcFile.delete(); File classFile = new File(directory, name + ".class"); byte[] bytes; try (DataInputStream dis = new DataInputStream(new FileInputStream(classFile))) { bytes = new byte[dis.available()]; dis.readFully(bytes); } classFile.delete(); return defineClass(name, bytes, 0, bytes.length); }

Target:
private Class<?> compile(String src, String name) throws Exception { File directory = createTempDir().toFile(); File srcFile = new File(directory, name + ".java"); Files.write(srcFile.toPath(), src.getBytes(), StandardOpenOption.CREATE_NEW); JavaCompiler javac = ToolProvider.getSystemJavaCompiler(); assertEquals(0, javac.run(null, null, null, srcFile.getCanonicalPath())); srcFile.delete(); File classFile = new File(directory, name + ".class"); byte[] bytes = Files.readAllBytes(classFile.toPath()); classFile.delete(); return defineClass(name, bytes, 0, bytes.length); }
Source:
public void testConnectionsByClientMetric() throws Exception { String node = "0"; Map<String, String> unknownNameAndVersion = softwareNameAndVersionTags("unknown", "unknown"); Map<String, String> knownNameAndVersion = softwareNameAndVersionTags("A", "B"); try (ServerSocketChannel ss = ServerSocketChannel.open()) { ss.bind(new InetSocketAddress(0)); InetSocketAddress serverAddress = (InetSocketAddress) ss.getLocalAddress(); Thread sender = createSender(serverAddress, randomPayload(1)); sender.start(); SocketChannel channel = ss.accept(); channel.configureBlocking(false); selector.register(node, channel); assertEquals(1, getMetric("connections", unknownNameAndVersion).metricValue()); assertEquals(ClientInformation.EMPTY, selector.channel(node).channelMetadataRegistry().clientInformation()); ClientInformation clientInformation = new ClientInformation("A", "B"); selector.channel(node).channelMetadataRegistry() .registerClientInformation(clientInformation); assertEquals(clientInformation, selector.channel(node).channelMetadataRegistry().clientInformation()); assertEquals(0, getMetric("connections", unknownNameAndVersion).metricValue()); assertEquals(1, getMetric("connections", knownNameAndVersion).metricValue()); selector.close(node); assertEquals(0, getMetric("connections", knownNameAndVersion).metricValue()); } }

Target:
public void testConnectionsByClientMetric() throws Exception { String node = "0"; Map<String, String> unknownNameAndVersion = softwareNameAndVersionTags( ClientInformation.UNKNOWN_NAME_OR_VERSION, ClientInformation.UNKNOWN_NAME_OR_VERSION); Map<String, String> knownNameAndVersion = softwareNameAndVersionTags("A", "B"); try (ServerSocketChannel ss = ServerSocketChannel.open()) { ss.bind(new InetSocketAddress(0)); InetSocketAddress serverAddress = (InetSocketAddress) ss.getLocalAddress(); Thread sender = createSender(serverAddress, randomPayload(1)); sender.start(); SocketChannel channel = ss.accept(); channel.configureBlocking(false); selector.register(node, channel); assertEquals(1, getMetric("connections", unknownNameAndVersion).metricValue()); assertEquals(ClientInformation.EMPTY, selector.channel(node).channelMetadataRegistry().clientInformation()); ClientInformation clientInformation = new ClientInformation("A", "B"); selector.channel(node).channelMetadataRegistry() .registerClientInformation(clientInformation); assertEquals(clientInformation, selector.channel(node).channelMetadataRegistry().clientInformation()); assertEquals(0, getMetric("connections", unknownNameAndVersion).metricValue()); assertEquals(1, getMetric("connections", knownNameAndVersion).metricValue()); selector.close(node); assertEquals(0, getMetric("connections", knownNameAndVersion).metricValue()); } }
Source:
private static Archive<?> getDeployment() { WebArchive war = ShrinkWrap.create(WebArchive.class, DEPLOYMENT_NAME); war.addPackage(AsyncServlet.class.getPackage()); war.setWebXML(SimpleServlet.class.getPackage(), "web.xml"); war.addAsWebInfResource(DistributableTestCase.class.getPackage(), "jboss-all_fine.xml", "jboss-all.xml"); return war; }

Target:
private static Archive<?> getDeployment() { WebArchive war = ShrinkWrap.create(WebArchive.class, DEPLOYMENT_NAME); war.addPackage(AsyncServlet.class.getPackage()); war.setWebXML(SimpleServlet.class.getPackage(), "web.xml"); war.addAsWebInfResource(AsyncServletTestCase.class.getPackage(), "jboss-all.xml", "jboss-all.xml"); return war; }
Source:
public void registerRecipeSerialziers(RegistryEvent.Register<IRecipeSerializer<?>> event) { CraftingHelper.register(AndCondition.Serializer.INSTANCE); CraftingHelper.register(FalseCondition.Serializer.INSTANCE); CraftingHelper.register(ItemExistsCondition.Serializer.INSTANCE); CraftingHelper.register(ModLoadedCondition.Serializer.INSTANCE); CraftingHelper.register(NotCondition.Serializer.INSTANCE); CraftingHelper.register(OrCondition.Serializer.INSTANCE); CraftingHelper.register(TrueCondition.Serializer.INSTANCE); CraftingHelper.register(new ResourceLocation("forge", "compound"), IngredientNBT.Serializer.INSTANCE); CraftingHelper.register(new ResourceLocation("forge", "nbt"), CompoundIngredient.Serializer.INSTANCE); CraftingHelper.register(new ResourceLocation("minecraft", "item"), VanillaIngredientSerializer.INSTANCE); event.getRegistry().register(new ConditionalRecipe.Serializer<IRecipe<?>>().setRegistryName(new ResourceLocation("forge", "conditional"))); }

Target:
public void registerRecipeSerialziers(RegistryEvent.Register<IRecipeSerializer<?>> event) { CraftingHelper.register(AndCondition.Serializer.INSTANCE); CraftingHelper.register(FalseCondition.Serializer.INSTANCE); CraftingHelper.register(ItemExistsCondition.Serializer.INSTANCE); CraftingHelper.register(ModLoadedCondition.Serializer.INSTANCE); CraftingHelper.register(NotCondition.Serializer.INSTANCE); CraftingHelper.register(OrCondition.Serializer.INSTANCE); CraftingHelper.register(TrueCondition.Serializer.INSTANCE); CraftingHelper.register(TagEmptyCondition.Serializer.INSTANCE); CraftingHelper.register(new ResourceLocation("forge", "compound"), CompoundIngredient.Serializer.INSTANCE); CraftingHelper.register(new ResourceLocation("forge", "nbt"), IngredientNBT.Serializer.INSTANCE); CraftingHelper.register(new ResourceLocation("minecraft", "item"), VanillaIngredientSerializer.INSTANCE); event.getRegistry().register(new ConditionalRecipe.Serializer<IRecipe<?>>().setRegistryName(new ResourceLocation("forge", "conditional"))); }
Source:
public TmfExperiment(final Class<? extends ITmfEvent> type, final String path, final ITmfTrace[] traces, final int indexPageSize, final @Nullable IResource resource) { initExperiment(type, path, traces, indexPageSize, resource, null); }

Target:
public TmfExperiment(final Class<? extends ITmfEvent> type, final String path, final ITmfTrace[] traces, final int indexPageSize, final @Nullable IResource resource) { initExperiment(type, path, traces, indexPageSize, resource); }
Source:
public static TransitiveClosureGraph accessClosureGraph(final ISearchContext context, final CallOperationHelper helper) { String id = TransitiveClosureGraph.class.getSimpleName() + "::" + helper.getCalledQuery().getFullyQualifiedName(); return context.accessBackendLevelCache(id, TransitiveClosureGraph.class, new IProvider<TransitiveClosureGraph>() { @Override public TransitiveClosureGraph get() { try { return new TransitiveClosureGraph(helper, context); } catch (LocalSearchException e) { throw new RuntimeException(e); } } }); }

Target:
public static TransitiveClosureGraph accessClosureGraph(final ISearchContext context, final CallOperationHelper helper) { return context.accessBackendLevelCache(new TransitiveClosureGraphKey(helper.getCalledQuery()), TransitiveClosureGraph.class, new IProvider<TransitiveClosureGraph>() { @Override public TransitiveClosureGraph get() { try { return new TransitiveClosureGraph(helper, context); } catch (LocalSearchException e) { throw new RuntimeException(e); } } }); }
Source:
public static KinesisRegion fromString(String value) { return EnumSet.allOf(KinesisRegion.class) .stream() .filter(x -> x.toString().equals(value)) .findFirst() .orElseThrow(() -> new IAE("Region must be one of: %s", getNames())); }

Target:
public static KinesisRegion fromString(String value) { return EnumSet.allOf(KinesisRegion.class) .stream() .filter(x -> x.serialize().equals(value)) .findFirst() .orElseThrow(() -> new IAE("Invalid region %s, region must be one of: %s", value, getNames())); }
Source:
private static FileDialog createNewFileDialog(Shell parent, int style) { String desiredPath = fOverridePath; fOverride = false; return new FileDialog(parent, style) { @Override public String open() { return desiredPath; } @Override public String getFileName() { return desiredPath != null ? desiredPath.substring(FILE_SEPARATOR + 1) : null; } @Override public String[] getFilterNames() { return desiredPath == null ? null : desiredPath.split(LIST_SEPARATOR); } }; }

Target:
private static FileDialog createNewFileDialog(Shell parent, int style) { String[] desiredPath = fOverridePath; fOverride = false; return new FileDialog(parent, style) { @Override public String open() { return desiredPath != null ? desiredPath[0] : null; } @Override protected void checkSubclass() { } @Override public String getFileName() { return desiredPath != null ? desiredPath[0].substring(desiredPath[0].lastIndexOf(FILE_SEPARATOR) + 1) : null; } @Override public String[] getFileNames() { return desiredPath; } }; }
Source:
void refreshPoolsForMasterPool(Pool pool, boolean updateStackDerived, boolean lazy, Map<String, Product> changedProducts) { List<Pool> subscriptionPools; pool.setLocked(true); if (pool.getSubscriptionId() != null) { subscriptionPools = this.poolCurator.getPoolsBySubscriptionId(pool.getSubscriptionId()).list(); } else { subscriptionPools = pool.getId() != null ? Collections.<Pool>singletonList(this.poolCurator.get(pool.getId())) : Collections.<Pool>singletonList(pool); } log.debug("Found pools for subscription {}", subscriptionPools.size(), pool.getSubscriptionId()); if (log.isDebugEnabled()) { for (Pool p : subscriptionPools) { log.debug(" owner={} - {}", p.getOwner().getKey(), p); } } for (Pool subPool : subscriptionPools) { Product product = subPool.getProduct(); if (product != null) { Product update = changedProducts.get(product.getId()); if (update != null) { subPool.setProduct(update); } } product = subPool.getDerivedProduct(); if (product != null) { Product update = changedProducts.get(product.getId()); if (update != null) { subPool.setDerivedProduct(update); } } } removeAndDeletePoolsOnOtherOwners(subscriptionPools, pool); Long originalQuantity = pool.getQuantity(); createAndEnrichPools(pool, subscriptionPools); Set<String> updatedMasterPools = updatePoolsForMasterPool( subscriptionPools, pool, originalQuantity, updateStackDerived, changedProducts); regenerateCertificatesByEntIds(updatedMasterPools, lazy); }

Target:
void refreshPoolsForMasterPool(Pool pool, boolean updateStackDerived, boolean lazy, Map<String, Product> changedProducts) { List<Pool> subscriptionPools; if (pool.getSubscriptionId() != null) { subscriptionPools = this.poolCurator.getPoolsBySubscriptionId(pool.getSubscriptionId()).list(); } else { subscriptionPools = pool.getId() != null ? Collections.<Pool>singletonList(this.poolCurator.get(pool.getId())) : Collections.<Pool>singletonList(pool); } log.debug("Found pools for subscription {}", subscriptionPools.size(), pool.getSubscriptionId()); if (log.isDebugEnabled()) { for (Pool p : subscriptionPools) { log.debug(" owner={} - {}", p.getOwner().getKey(), p); } } for (Pool subPool : subscriptionPools) { Product product = subPool.getProduct(); if (product != null) { Product update = changedProducts.get(product.getId()); if (update != null) { subPool.setProduct(update); } } product = subPool.getDerivedProduct(); if (product != null) { Product update = changedProducts.get(product.getId()); if (update != null) { subPool.setDerivedProduct(update); } } if (pool.isLocked()) { subPool.setLocked(true); } } removeAndDeletePoolsOnOtherOwners(subscriptionPools, pool); Long originalQuantity = pool.getQuantity(); createAndEnrichPools(pool, subscriptionPools); Set<String> updatedMasterPools = updatePoolsForMasterPool( subscriptionPools, pool, originalQuantity, updateStackDerived, changedProducts); regenerateCertificatesByEntIds(updatedMasterPools, lazy); }
Source:
public ZkBaseDataAccessor<byte[]> getByteArrayZkBaseDataAccessor() { ZkBaseDataAccessor<byte[]> byteArrayZkBaseDataAccessor = _byteArrayZkBaseDataAccessor; if (byteArrayZkBaseDataAccessor != null) { return byteArrayZkBaseDataAccessor; } synchronized (this) { if (_byteArrayZkBaseDataAccessor == null) { _byteArrayZkBaseDataAccessor = new ZkBaseDataAccessor<>(_zkAddr, new ZkSerializer() { @Override public byte[] serialize(Object o) throws ZkMarshallingError { throw new UnsupportedOperationException("serialize() is not supported yet!"); } @Override public Object deserialize(byte[] bytes) throws ZkMarshallingError { return bytes; } }); } return _byteArrayZkBaseDataAccessor; } }

Target:
public ZkBaseDataAccessor<byte[]> getByteArrayZkBaseDataAccessor() { ZkBaseDataAccessor<byte[]> byteArrayZkBaseDataAccessor = _byteArrayZkBaseDataAccessor; if (byteArrayZkBaseDataAccessor != null) { return byteArrayZkBaseDataAccessor; } synchronized (this) { if (_byteArrayZkBaseDataAccessor == null) { _byteArrayZkBaseDataAccessor = new ZkBaseDataAccessor<>(_zkAddr, new ZkSerializer() { @Override public byte[] serialize(Object o) throws ZkMarshallingError { throw new UnsupportedOperationException("serialize() is not supported."); } @Override public Object deserialize(byte[] bytes) throws ZkMarshallingError { return bytes; } }); } return _byteArrayZkBaseDataAccessor; } }
Source:
public void init() throws Exception { final File file = new File("src/test/resources/com/puppycrawl/tools/" + "checkstyle/xpath/InputXpathQueryGenerator.java"); rootAst = TestUtils.parseFile(file); }

Target:
public void init() throws Exception { final File file = new File(getPath("InputXpathQueryGenerator.java")); rootAst = TestUtils.parseFile(file); }
Source:
public String printMatchingStats() { String stats = ""; for (int i = 0; i<fTraces.length; i++) { stats += "Trace " + i + ": " + fUnmatched[i].size() + " unmatched events"; } return stats; }

Target:
public String printMatchingStats() { StringBuilder b = new StringBuilder(); for (int i = 0; i < fTraces.length; i++) { b.append("Trace " + i + ": " + fUnmatched[i].size() + " unmatched events"); } return b.toString(); }
Source:
public void onLocationChanged(Location l) { boolean firstFix = false; if (mLastLocation == null) { firstFix = true; } mLastLocation = l; if (mListener != null) { mListener.onLocationChanged(l); } if (firstFix) { setMyLocation(true, false); onFocusChanged(null,null,l); } }

Target:
public void onLocationChanged(Location l) { boolean firstFix = false; if (mLastLocation == null) { firstFix = true; } mLastLocation = l; if (mListener != null) { mListener.onLocationChanged(l); } if (firstFix) { setMyLocation(true, false); } }
Source:
public XmlResponseQueueTransformer( Parser parser, PrintWriterProvider pwp, MetacardMarshaller mcm, MimeType mimeType) { super(parser); this.fjp = new ForkJoinPool( Math.min(0x7fff, Runtime.getRuntime().availableProcessors()), new ForkJoinPoolFactory(), null, false); geometryTransformer = new GeometryTransformer(parser); this.printWriterProvider = pwp; this.metacardMarshaller = mcm; this.mimeType = mimeType; try { mimeType.setPrimaryType("text"); mimeType.setSubType("xml"); } catch (MimeTypeParseException e) { LOGGER.info("Failure creating MIME type", e); throw new ExceptionInInitializerError(e); } }

Target:
public XmlResponseQueueTransformer( Parser parser, PrintWriterProvider pwp, MetacardMarshaller mcm, MimeType mimeType) { super(parser); this.fjp = ForkJoinPoolFactory.getNewForkJoinPool(null, false); geometryTransformer = new GeometryTransformer(parser); this.printWriterProvider = pwp; this.metacardMarshaller = mcm; this.mimeType = mimeType; try { mimeType.setPrimaryType("text"); mimeType.setSubType("xml"); } catch (MimeTypeParseException e) { LOGGER.info("Failure creating MIME type", e); throw new ExceptionInInitializerError(e); } }
Source:
public void testEarlySubscribe() { PublishSubscribeChannel channel = new PublishSubscribeChannel(mock(Executor.class)); try { channel.subscribe(mock(MessageHandler.class)); fail("expected Exception"); } catch (IllegalStateException e) { assertThat(e.getMessage(), equalTo("When providing an Executor, you cannot subscribe() until the channel " + "bean is fully initialized by the framework. Do not subscribe in a @Bean definition")); } channel.setBeanFactory(mock(BeanFactory.class)); channel.afterPropertiesSet(); channel.subscribe(mock(MessageHandler.class)); }

Target:
public void testEarlySubscribe() { PublishSubscribeChannel channel = new PublishSubscribeChannel(mock(Executor.class)); try { channel.subscribe(m -> { }); channel.setBeanFactory(mock(BeanFactory.class)); channel.afterPropertiesSet(); fail("expected Exception"); } catch (IllegalStateException e) { assertThat(e.getMessage(), equalTo("When providing an Executor, you cannot subscribe() until the channel " + "bean is fully initialized by the framework. Do not subscribe in a @Bean definition")); } }
Source:
public static Filter createFilterFromFilterSpec(Description description, String filterSpec) throws FilterFactoryNotCreatedException { if (filterSpec.contains("=")) { String[] tuple = filterSpec.split("=", 2); return createFilter(tuple[0], new FilterFactoryParams(description, tuple[1])); } else { return createFilter(filterSpec, new FilterFactoryParams(description)); } }

Target:
public static Filter createFilterFromFilterSpec(Description description, String filterSpec) throws FilterFactory.FilterNotCreatedException { String[] tuple; if (filterSpec.contains("=")) { tuple = filterSpec.split("=", 2); } else { tuple = new String[]{ filterSpec, "" }; } return createFilter(tuple[0], new FilterFactoryParams(tuple[1])); }
Source:
Observable<Output> play( Observable<String> words, Observable<String> letters) { return Observable .combineLatest( words, letters.startWith(""), (word, letter) -> new AbstractMap.SimpleEntry<>(word, letter)) .scan( new Output( null, null, Collections.emptySet(), Collections.emptySet(), Collections.emptyList(), null), (state, entry) -> { System.out.println(state + " -> " + entry); if (state == null || state.status != Status.PLAYING) { return createNewGame(entry.getKey()); } else { return processNewLetter(state, entry.getValue()); } }) .skip(1); }

Target:
Observable<Output> play( Observable<String> words, Observable<String> letters) { return Observable .combineLatest( words, letters.startWith(""), (word, letter) -> new AbstractMap.SimpleEntry<>(word, letter)) .scan( Output.empty(), (state, entry) -> { System.out.println(state + " -> " + entry); if (state == null || state.status != Status.PLAYING) { return createNewGame(entry.getKey()); } else { return processNewLetter(state, entry.getValue()); } }) .skip(1); }
Source:
public void testPrefixHeaderArgsHandlesNestedHeaderFilePaths() { String headerPathStr = "include/subdir/stdafx.h"; Path headerPath = Paths.get(headerPathStr); assertThat(windowsPreprocessor.prefixHeaderArgs(headerPath), contains("/Yc", headerPathStr)); }

Target:
public void testPrefixHeaderArgsHandlesNestedHeaderFilePaths() { Assume.assumeThat(Platform.detect(), is(WINDOWS)); String headerPathStr = "include\\subdir\\stdafx.h"; Path headerPath = Paths.get(headerPathStr); assertThat(windowsPreprocessor.prefixHeaderArgs(headerPath), contains("/Yc", headerPathStr)); }
Source:
public org.json.simple.JSONObject getMetadataJson(LayerDescriptor layerDescriptor) { Object obj = null; String wmsUrl = null; try { wmsUrl = getWmsUrl(layerDescriptor, null); } catch (Exception e) { LOGGER.log(Level.SEVERE, String.format("Error retreiving getWmsUrl: '%s'", e.getStackTrace())); e.printStackTrace(); } String metadataUrl = String.format("%s?service=WMS&version=1.3.0&request=GetMetadata&item=layerDetails&layerName=%s", wmsUrl, layerDescriptor.getVariableName() ); JSONParser parser = new JSONParser(); try { obj = parser.parse(readUrl(metadataUrl)); } catch (Exception e) { LOGGER.log(Level.SEVERE, String.format("Error retreiving metadataUrl: '%s'", e.getMessage())); } return (JSONObject) obj; }

Target:
public JSONObject getMetadataJson(LayerDescriptor layerDescriptor) { String wmsUrl; try { wmsUrl = getWmsUrl(layerDescriptor, null); } catch (Exception e) { LOGGER.log(Level.SEVERE, String.format("Error retreiving getWmsUrl: '%s'", e.getStackTrace())); e.printStackTrace(); return null; } String metadataUrl = String.format("%s?service=WMS&version=1.3.0&request=GetMetadata&item=layerDetails&layerName=%s", wmsUrl, layerDescriptor.getNetCDFVariableName() ); JSONParser parser = new JSONParser(); try { return (JSONObject) parser.parse(readUrl(metadataUrl)); } catch (Exception e) { LOGGER.log(Level.SEVERE, String.format("Error retreiving metadataUrl: '%s'", e.getMessage())); return null; } }
Source:
public void onClick(View v) { AddUserBrickFragment addUserBrickFragment = AddUserBrickFragment.newInstance(); String tag = AddUserBrickFragment.ADD_USER_BRICK_FRAGMENT_TAG; getFragmentManager().beginTransaction() .add(R.id.fragment_container, addUserBrickFragment, tag) .addToBackStack(null) .commit(); }

Target:
public void onClick(View v) { AddUserBrickFragment addUserBrickFragment = AddUserBrickFragment.newInstance(); String tag = AddUserBrickFragment.ADD_USER_BRICK_FRAGMENT_TAG; FragmentManager fragmentManager = getFragmentManager(); if (fragmentManager != null) { getFragmentManager().beginTransaction() .add(R.id.fragment_container, addUserBrickFragment, tag) .addToBackStack(null) .commit(); } }
Source:
public void testLegacyUnnestArrayRows() { QueryAssertions assertions = new QueryAssertions(testSessionBuilder().build(), new FeaturesConfig().setLegacyUnnestArrayRows(true)); assertions.assertQuery( "SELECT * FROM UNNEST(ARRAY[ROW(1, 1.1), ROW(3, 3.3)], ARRAY[ROW('a', true), ROW('b', false)])", "VALUES ((1, 1.1), ('a', true)), ((3, 3.3), ('b', false))"); }

Target:
public void testLegacyUnnestArrayRows() { try (QueryAssertions assertions = new QueryAssertions(testSessionBuilder().setSystemProperty(LEGACY_UNNEST, "true").build())) { assertions.assertQuery( "SELECT * FROM UNNEST(ARRAY[ROW(1, 1.1), ROW(3, 3.3)], ARRAY[ROW('a', true), ROW('b', false)])", "VALUES ((1, 1.1), ('a', true)), ((3, 3.3), ('b', false))"); } }
Source:
public void shouldThrowExceptionJsonUtils() throws Exception { Map<String, String> params = new HashMap<>(); UUID uuid = UUID.randomUUID(); params.put("uuid", uuid.toString()); String json = "not json"; InputStream inputStream = new ByteArrayInputStream(json.getBytes()); when(rapidProHttpClient.executeGet("/contacts", MediaFormat.JSON, params)).thenReturn(inputStream); Contact fromWebservice = contactWebService.getContactByUUID(uuid); }

Target:
public void shouldThrowExceptionJsonUtils() throws Exception { Map<String, String> params = new HashMap<>(); UUID uuid = UUID.randomUUID(); params.put("uuid", uuid.toString()); String json = "not json"; InputStream inputStream = new ByteArrayInputStream(json.getBytes()); when(rapidProHttpClient.executeGet("/contacts", MediaFormat.JSON, params)).thenReturn(inputStream); contactWebService.getContactByUUID(uuid); }
Source:
public EncryptedBlobClientBuilder pipeline(HttpPipeline httpPipeline) { if (this.httpPipeline != null && httpPipeline == null) { logger.info("HttpPipeline is being set to 'null' when it was previously configured."); } checkValidEncryptionParameters(); HttpPipeline pipeline = null; if (httpPipeline != null) { List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(new BlobDecryptionPolicy(keyWrapper, keyResolver)); for (int i = 0; i < httpPipeline.getPolicyCount(); i++) { HttpPipelinePolicy currPolicy = httpPipeline.getPolicy(i); policies.add(currPolicy); } pipeline = new HttpPipelineBuilder() .httpClient(httpPipeline.getHttpClient()) .policies(policies.toArray(new HttpPipelinePolicy[0])) .build(); } this.httpPipeline = pipeline; return this; }

Target:
public EncryptedBlobClientBuilder pipeline(HttpPipeline httpPipeline) { if (this.httpPipeline != null && httpPipeline == null) { logger.info("HttpPipeline is being set to 'null' when it was previously configured."); } checkValidEncryptionParameters(); HttpPipeline pipeline = null; if (httpPipeline != null) { List<HttpPipelinePolicy> policies = new ArrayList<>(); boolean decryptionPolicyPresent = false; for (int i = 0; i < httpPipeline.getPolicyCount(); i++) { HttpPipelinePolicy currPolicy = httpPipeline.getPolicy(i); decryptionPolicyPresent |= currPolicy instanceof BlobDecryptionPolicy; policies.add(currPolicy); } if (!decryptionPolicyPresent) { policies.add(0, new BlobDecryptionPolicy(keyWrapper, keyResolver)); } pipeline = new HttpPipelineBuilder() .httpClient(httpPipeline.getHttpClient()) .policies(policies.toArray(new HttpPipelinePolicy[0])) .build(); } this.httpPipeline = pipeline; return this; }
Source:
public void testLabelCDataEnd() throws Exception { StyleBuilder sb = new StyleBuilder(); TextSymbolizer ts = sb.createTextSymbolizer(); ts.setLabel(ff.function("strConcat", ff.literal("abc "), ff.property("myProperty"))); StyledLayerDescriptor sld = buildSLDAroundSymbolizer(ts); String xml = transformer.transform(sld); assertTrue(xml.contains("<sld:Label>")); assertTrue(xml.contains("<![CDATA[abc ]]>")); assertTrue(xml.contains("<ogc:PropertyName>myProperty</ogc:PropertyName>")); assertTrue(xml.contains("</sld:Label>")); assertTrue(xml.indexOf("<sld:Label>") < xml.indexOf("<![CDATA[abc ]]>")); assertTrue(xml.indexOf("<![CDATA[abc ]]>") < xml.indexOf("<ogc:PropertyName>myProperty</ogc:PropertyName>")); assertTrue(xml.indexOf("<ogc:PropertyName>myProperty</ogc:PropertyName>") < xml.indexOf("</sld:Label>")); }

Target:
public void testLabelCDataEnd() throws Exception { StyleBuilder sb = new StyleBuilder(); TextSymbolizer ts = sb.createTextSymbolizer(); ts.setLabel(ff.function("strConcat", ff.literal("abc "), ff.property("myProperty"))); StyledLayerDescriptor sld = buildSLDAroundSymbolizer(ts); String xml = transformer.transform(sld); Document doc = buildTestDocument(xml); assertXpathEvaluatesTo("abc", "normalize-space( assertXpathEvaluatesTo("myProperty", " assertTrue(xml.contains("<![CDATA[abc ]]>")); }
Source:
public StrongholdConfessor(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.CLERIC); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(new MenaceAbility()); this.addAbility(new KickerAbility("{3}")); this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), KickedCondition.instance, "If Stronghold Confessor was kicked, it enters the battlefield with two +1/+1 counters on it.", "")); }

Target:
public StrongholdConfessor(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.CLERIC); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(new MenaceAbility()); this.addAbility(new KickerAbility("{3}")); this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), KickedCondition.instance, "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it.", "")); }
Source:
private void addAndDismiss(final ReadingList readingList, final List<PageTitle> titles) { if ((readingList.pages().size() + titles.size()) > SiteInfoClient.getMaxPagesPerReadingList()) { String message = getString(R.string.reading_list_article_limit_message, readingList.title(), SiteInfoClient.getMaxPagesPerReadingList()); FeedbackUtil.makeSnackbar(getActivity(), message, FeedbackUtil.LENGTH_DEFAULT).show(); dismiss(); return; } if (titles.size() == 1) { addAndDismiss(readingList, titles.get(0)); return; } execute(readingList, titles); }

Target:
private void addAndDismiss(final ReadingList readingList, final List<PageTitle> titles) { if ((readingList.pages().size() + titles.size()) > SiteInfoClient.getMaxPagesPerReadingList()) { String message = getString(R.string.reading_list_article_limit_message, readingList.title(), SiteInfoClient.getMaxPagesPerReadingList()); FeedbackUtil.makeSnackbar(getActivity(), message, FeedbackUtil.LENGTH_DEFAULT).show(); dismiss(); return; } run(readingList, titles); }
Source:
public void changeScene() { Pane root2 = new Pane(); Scene scene2 = new Scene(root2, 800, 600); root2.setPrefSize(Constants.ScreenHeight, Constants.ScreenWidht); root2.getChildren().addAll(Constants.imageView, gameMenu); scene2.setRoot(root2); Constants.stage.setScene(scene2); step=1; }

Target:
public void changeScene() { Pane rootMenu = new Pane(); Scene sceneMenu = new Scene(rootMenu, SCREEN_HEIGHT, SCREEN_WIDTH); rootMenu.setPrefSize(SCREEN_HEIGHT, SCREEN_WIDTH); rootMenu.getChildren().addAll(GlobalVariables.imageView, gameMenu); sceneMenu.setRoot(rootMenu); GlobalVariables.stage.setScene(sceneMenu); step = 1; }
Source:
public void await() throws InfrastructureException { try { result.get(resultTimeoutSeconds, TimeUnit.SECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new InfrastructureException("Machine " + machineName + " start is interrupted"); } catch (TimeoutException e) { throw new InfrastructureException("Servers readiness check of machine " + machineName + " timed out"); } catch (ExecutionException e) { try { throw e.getCause(); } catch (InfrastructureException rethrow) { throw rethrow; } catch (Throwable thr) { throw new InternalInfrastructureException( "Machine " + machineName + " servers readiness check failed. Error: " + thr.getMessage(), thr); } } }

Target:
public void await() throws InfrastructureException, InterruptedException { try { result.get(resultTimeoutSeconds, TimeUnit.SECONDS); } catch (TimeoutException e) { throw new InfrastructureException("Servers readiness check of machine " + machineName + " timed out"); } catch (ExecutionException e) { try { throw e.getCause(); } catch (InfrastructureException rethrow) { throw rethrow; } catch (Throwable thr) { throw new InternalInfrastructureException( "Machine " + machineName + " servers readiness check failed. Error: " + thr.getMessage(), thr); } } }
Source:
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException { TransactionalEditingDomain domain = (TransactionalEditingDomain) EMFHelper.resolveEditingDomain(targetEditPart); CreateElementRequest createElementRequest = new CreateElementRequest(domain, activity, typeToCreate); ICommand slotCreationCommand; slotCreationCommand = new CreateElementCommand(createElementRequest); slotCreationCommand.execute(new NullProgressMonitor(), null); CommandResult commandResult = slotCreationCommand.getCommandResult(); if (commandResult != null) { if (!commandResult.getStatus().isOK()) { return commandResult; } } T newCallBehaviorAction = getNewEObject(commandResult); if (newCallBehaviorAction == null) { newCallBehaviorAction = getNewEObject(createElementRequest); } if (newCallBehaviorAction != null) { updateNewlyCreatedEObjectWithEObjectDragged(newCallBehaviorAction, behavior); } else { return CommandResult.newErrorCommandResult("Could not create the calloperation for operation"); } return CommandResult.newOKCommandResult(); }

Target:
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException { TransactionalEditingDomain domain = (TransactionalEditingDomain) EMFHelper.resolveEditingDomain(targetEditPart); CreateElementRequest createElementRequest = new CreateElementRequest(domain, targetElementDiagram, typeToCreate); ICommand creationElementCommand; creationElementCommand = new CreateElementCommand(createElementRequest); creationElementCommand.execute(new NullProgressMonitor(), null); CommandResult commandResult = creationElementCommand.getCommandResult(); if (commandResult != null) { if (!commandResult.getStatus().isOK()) { return commandResult; } } T newCallBehaviorAction = getNewEObject(commandResult); if (newCallBehaviorAction == null) { newCallBehaviorAction = getNewEObject(createElementRequest); } if (newCallBehaviorAction != null) { updateNewlyCreatedEObjectWithEObjectDragged(newCallBehaviorAction, sourceElement); } else { return CommandResult.newErrorCommandResult("Could not create the calloperation for operation"); } return CommandResult.newOKCommandResult(); }
Source:
public StaxParser(XmlStreamHandler streamHandler) { this.streamHandler = streamHandler; WstxInputFactory xmlFactory = (WstxInputFactory) XMLInputFactory.newInstance(); xmlFactory.configureForLowMemUsage(); xmlFactory.setProperty(XMLInputFactory.IS_VALIDATING, false); xmlFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false); xmlFactory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, false); inf = new SMInputFactory(xmlFactory); }

Target:
public StaxParser(XmlStreamHandler streamHandler) { this.streamHandler = streamHandler; WstxInputFactory xmlFactory = (WstxInputFactory) XMLInputFactory.newInstance(); xmlFactory.configureForLowMemUsage(); xmlFactory.getConfig().setUndeclaredEntityResolver(new UndeclaredEntitiesXMLResolver()); xmlFactory.setProperty(XMLInputFactory.IS_VALIDATING, false); xmlFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false); xmlFactory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, false); inf = new SMInputFactory(xmlFactory); }
Source:
public void getRadiologyReports_shouldReturnAEmptyListIfNoRadiologyReportMatchesTheCriteria() throws Exception { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); RadiologyReportSearchCriteria radiologyReportSearchCriteria = new RadiologyReportSearchCriteria.Builder().setFromDate(format.parse("2016-04-25")) .setToDate(format.parse("2016-05-27")) .build(); List<RadiologyReport> radiologyReports = radiologyReportService.getRadiologyReports(radiologyReportSearchCriteria); assertThat(radiologyReports.size(), is(0)); }

Target:
public void getRadiologyReports_shouldReturnAEmptyListIfNoRadiologyReportMatchesTheCriteria() throws Exception { final DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); RadiologyReportSearchCriteria radiologyReportSearchCriteria = new RadiologyReportSearchCriteria.Builder().setFromDate(format.parse("2016-04-25")) .setToDate(format.parse("2016-05-27")) .build(); List<RadiologyReport> radiologyReports = radiologyReportService.getRadiologyReports(radiologyReportSearchCriteria); assertThat(radiologyReports.size(), is(0)); }
Source:
private void assertDeploymentExists(String deploymentName, boolean shouldExist) throws IOException, OperationException { Assert.assertEquals("Deployment exists", shouldExist, ops.exists(Address.of("deployment", deploymentName))); }

Target:
private void assertDeploymentExists(String deploymentName, boolean shouldExist) throws IOException, OperationException { boolean exists = ops.exists(Address.deployment(deploymentName)); if (shouldExist) { Assert.assertTrue("Deployment should exist!", exists); } else { Assert.assertFalse("Deployment shouldn't exist!", exists); } }
Source:
private ServerErrorCode handleAddStoreRequest(PartitionId partitionId) { ServerErrorCode errorCode = ServerErrorCode.No_Error; ReplicaId replicaToAdd = clusterMap.getNewReplica(partitionId.toPathString(), currentNode); if (replicaToAdd != null) { if (storeManager.addBlobStore(replicaToAdd)) { if (((ReplicationManager) replicationEngine).addReplica(replicaToAdd)) { if (statsManager.addReplica(replicaToAdd)) { logger.info("{} is successfully added into storage manager, replication manager and stats manager.", partitionId); localPartitionToReplicaMap.put(partitionId, replicaToAdd); } else { errorCode = ServerErrorCode.Unknown_Error; logger.debug("Failed to add into stats manager", partitionId); } } else { errorCode = ServerErrorCode.Unknown_Error; logger.debug("Failed to add into replication manager", partitionId); } } else { errorCode = ServerErrorCode.Unknown_Error; logger.debug("Failed to add into storage manager", partitionId); } } else { errorCode = ServerErrorCode.Replica_Unavailable; logger.error("No new replica found for in cluster map", partitionId); } return errorCode; }

Target:
private ServerErrorCode handleAddStoreRequest(PartitionId partitionId) { ServerErrorCode errorCode = ServerErrorCode.No_Error; ReplicaId replicaToAdd = clusterMap.getBootstrapReplica(partitionId.toPathString(), currentNode); if (replicaToAdd == null) { logger.error("No new replica found for in cluster map", partitionId); return ServerErrorCode.Replica_Unavailable; } if (!storeManager.addBlobStore(replicaToAdd)) { logger.debug("Failed to add into storage manager", partitionId); return ServerErrorCode.Unknown_Error; } if (!((ReplicationManager) replicationEngine).addReplica(replicaToAdd)) { logger.debug("Failed to add into replication manager", partitionId); return ServerErrorCode.Unknown_Error; } if (statsManager.addReplica(replicaToAdd)) { logger.info("{} is successfully added into storage manager, replication manager and stats manager.", partitionId); localPartitionToReplicaMap.put(partitionId, replicaToAdd); } else { errorCode = ServerErrorCode.Unknown_Error; logger.debug("Failed to add into stats manager", partitionId); } return errorCode; }