auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void setContextClassLoaderOnThread(CommandLine cl, final Shell shellState) throws IOException { final String contextName = cl.getOptionValue(context.getOpt()); ClassLoader classLoader; if (contextName != null && !contextName.equals("")) { try { AccumuloVFSClassLoader.getContextManager() .setContextConfig(new ContextManager.DefaultContextsConfig() { @Override public Map<String,String> getVfsContextClasspathProperties() { try { return shellState.getConnector().instanceOperations().getSystemConfiguration(); } catch (AccumuloException e) { <START> throw new RuntimeException(e); <END> } catch (AccumuloSecurityException e) { throw new RuntimeException(e); } } }); } catch (IllegalStateException e) { shellState.printException(e); } classLoader = AccumuloVFSClassLoader.getContextManager().getClassLoader(contextName); } else { classLoader = AccumuloVFSClassLoader.getClassLoader(); } Thread.currentThread().setContextClassLoader(classLoader); }</code><technical_language>throw a more specific RTE, RuntimeException</technical_language>

Target:
private void setContextClassLoaderOnThread(CommandLine cl, final Shell shellState) throws IOException { final String contextName = cl.getOptionValue(context.getOpt()); ClassLoader classLoader; if (contextName != null && !contextName.equals("")) { try { AccumuloVFSClassLoader.getContextManager() .setContextConfig(new ContextManager.DefaultContextsConfig() { @Override public Map<String,String> getVfsContextClasspathProperties() { try { return shellState.getConnector().instanceOperations().getSystemConfiguration(); } catch (AccumuloException e) { throw new IllegalStateException(e); } catch (AccumuloSecurityException e) { throw new IllegalStateException(e); } } }); } catch (IllegalStateException e) { shellState.printException(e); throw e; } classLoader = AccumuloVFSClassLoader.getContextManager().getClassLoader(contextName); } else { classLoader = AccumuloVFSClassLoader.getClassLoader(); } Thread.currentThread().setContextClassLoader(classLoader); }
Source:
<code>public Deduplicator createDeduplicator(final NetworkConfig config) { String type = config.getString(NetworkConfig.Keys.DEDUPLICATOR, NetworkConfig.Keys.NO_DEDUPLICATOR); <START> if (type.equals(NetworkConfig.Keys.DEDUPLICATOR_MARK_AND_SWEEP)) { <END> return new SweepDeduplicator(config); } else if (type.equals(NetworkConfig.Keys.DEDUPLICATOR_CROP_ROTATION)) { return new CropRotation(config); } else if (type.equals(NetworkConfig.Keys.NO_DEDUPLICATOR)) { return new NoDeduplicator(); } else { LOGGER.warning("configuration contains unsupported deduplicator type, duplicate detection will be turned off"); return new NoDeduplicator(); } }</code><technical_language>replacing switch if/else if ? <LINK_0></technical_language>

Target:
public Deduplicator createDeduplicator(final NetworkConfig config) { String type = config.getString(NetworkConfig.Keys.DEDUPLICATOR, NetworkConfig.Keys.NO_DEDUPLICATOR); switch(type) { case NetworkConfig.Keys.DEDUPLICATOR_MARK_AND_SWEEP: return new SweepDeduplicator(config); case NetworkConfig.Keys.DEDUPLICATOR_CROP_ROTATION: return new CropRotation(config); case NetworkConfig.Keys.NO_DEDUPLICATOR: return new NoDeduplicator(); default: LOGGER.warning("configuration contains unsupported deduplicator type, duplicate detection will be turned off"); return new NoDeduplicator(); } }
Source:
<code>public static HostRequirement getTargetServerType(String targetServerType) { <START> String allowSlave = targetServerType.replaceFirst("slave", targetServerType); <END> return valueOf(allowSlave); }</code><technical_language>I suggest targetServerType.replace('lave', 'econdary') support slave preferSlave in go</technical_language>

Target:
public static HostRequirement getTargetServerType(String targetServerType) { String allowSlave = targetServerType.replace("lave", "econdary"); return valueOf(allowSlave); }
Source:
<code>public SdxClusterDetailResponse(SdxClusterResponse sdxClusterResponse, StackV4Response stackV4Response) { super(sdxClusterResponse.getCrn(), sdxClusterResponse.getName(), sdxClusterResponse.getStatus(), sdxClusterResponse.getStatusReason(), sdxClusterResponse.getEnvironmentName(), sdxClusterResponse.getEnvironmentCrn(), sdxClusterResponse.getStackCrn(), sdxClusterResponse.getClusterShape(), sdxClusterResponse.getCloudStorageBaseLocation(), sdxClusterResponse.getCloudStorageFileSystemType(), sdxClusterResponse.getRuntime(), <START> sdxClusterResponse.getRangerRazEnabled(), <END> sdxClusterResponse.getMediumDutyHAEnabled()); this.stackV4Response = stackV4Response; }</code><technical_language>Yea this need part of response. Remove for other files</technical_language>

Target:
public SdxClusterDetailResponse(SdxClusterResponse sdxClusterResponse, StackV4Response stackV4Response) { super(sdxClusterResponse.getCrn(), sdxClusterResponse.getName(), sdxClusterResponse.getStatus(), sdxClusterResponse.getStatusReason(), sdxClusterResponse.getEnvironmentName(), sdxClusterResponse.getEnvironmentCrn(), sdxClusterResponse.getStackCrn(), sdxClusterResponse.getClusterShape(), sdxClusterResponse.getCloudStorageBaseLocation(), sdxClusterResponse.getCloudStorageFileSystemType(), sdxClusterResponse.getRuntime(), sdxClusterResponse.getRangerRazEnabled()); this.stackV4Response = stackV4Response; }
Source:
<code>private ShutdownThread() { <START> super("ShutdownThread"); <END> }</code><technical_language>add some "Jetty" naming here, shutdown threads registered other components (e.g. Spring) name "ShutdownThread" -- a common name</technical_language>

Target:
private ShutdownThread() { super("JettyShutdownThread"); }
Source:
<code>public void pidWrite(double speed) { double newSpeed = speedModifier.modify(speed); lastSpeed = newSpeed; <START> for (CustomSpeedController motor : motors) { <END> motor.pidWrite(newSpeed); } }</code><technical_language>SpeedController CustomSpeedController</technical_language>

Target:
public void pidWrite(double speed) { double newSpeed = speedModifier.modify(speed); lastSpeed = newSpeed; for (SpeedController motor : motors) { motor.set(newSpeed); } }
Source:
<code>@Test public void malformedParameterRelativeUrlThrows() { class Example { @GET Call<ResponseBody> get(@Url String relativeUrl) { return null; } } try { buildRequest(Example.class, "ftp://example.org"); <START> } catch (IllegalArgumentException e) { <END> assertThat(e).hasMessage( "Malformed URL. Base: <LINK_0>, Relative: ftp://example.org"); } }</code><technical_language>fail</technical_language>

Target:
@Test public void malformedParameterRelativeUrlThrows() { class Example { @GET Call<ResponseBody> get(@Url String relativeUrl) { return null; } } try { buildRequest(Example.class, "ftp://example.org"); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessage( "Malformed URL. Base: <LINK_0>, Relative: ftp://example.org"); } }
Source:
<code>public void testSearchUserByVariable() { Map<String, OrganizationalEntity> roleAssignments = new HashMap<>(); roleAssignments.put("owner", new UserImpl(USER)); Map<String, Object> data = new HashMap<>(); data.put("name", "my first case"); CaseFileInstance caseFile = caseService.newCaseFileInstance(deploymentUnit.getIdentifier(), USER_TASK_CASE_P_ID, data, roleAssignments); String caseId = caseService.startCase(deploymentUnit.getIdentifier(), USER_TASK_CASE_P_ID, caseFile); List<UserTaskInstanceWithPotOwnerDesc> process = advanceCaseRuntimeDataService.queryUserTasksByVariables(emptyMap(), emptyMap(), emptyMap(), emptyList(), new QueryContext()); assertEquals(1, process.size()); assertEquals(process.get(0).getExtraData().get("name"), "my first case"); assertNotNull(caseId); assertEquals(HR_CASE_ID, caseId); <START> if (caseId != null) { <END> caseService.cancelCase(caseId); } }</code><technical_language>If statement is needed. assertNotNull this happens</technical_language>

Target:
public void testSearchUserByVariable() { Map<String, OrganizationalEntity> roleAssignments = new HashMap<>(); roleAssignments.put("owner", new UserImpl(USER)); Map<String, Object> data = new HashMap<>(); data.put("name", "my first case"); CaseFileInstance caseFile = caseService.newCaseFileInstance(deploymentUnit.getIdentifier(), USER_TASK_CASE_P_ID, data, roleAssignments); String caseId = caseService.startCase(deploymentUnit.getIdentifier(), USER_TASK_CASE_P_ID, caseFile); List<UserTaskInstanceWithPotOwnerDesc> process = advanceCaseRuntimeDataService.queryUserTasksByVariables(emptyList(), emptyList(), emptyList(), emptyList(), new QueryContext()); assertEquals(1, process.size()); assertEquals("my first case", process.get(0).getExtraData().get("name")); assertNotNull(caseId); assertEquals(HR_CASE_ID, caseId); caseService.cancelCase(caseId); }
Source:
<code>public PBDSegmentReader openForRead(String cursorId) throws IOException { <START> if (m_readCursors.containsKey(cursorId) || m_closedCursors.containsKey(cursorId)) { <END> throw new IOException("Segment is already open for reading for cursor " + cursorId); } if (m_closed) { open(false, false); } SegmentReader reader = new SegmentReader(cursorId); m_readCursors.put(cursorId, reader); return reader; }</code><technical_language>Do cursors maps need synchronization assumption this is thread safe</technical_language>

Target:
public PBDSegmentReader openForRead(String cursorId) throws IOException { Preconditions.checkNotNull(cursorId, "Reader id must be non-null"); if (m_readCursors.containsKey(cursorId) || m_closedCursors.containsKey(cursorId)) { throw new IOException("Segment is already open for reading for cursor " + cursorId); } if (m_closed) { open(false, false); } SegmentReader reader = new SegmentReader(cursorId); m_readCursors.put(cursorId, reader); return reader; }
Source:
<code><START> public void unregSwitch(boolean synch) { <END> super.unregisterDP(synch); }</code><technical_language>this method for? is public</technical_language>

Target:
protected void unregSwitch(boolean synch) { super.unregisterDP(synch); }
Source:
<code>private String[] getInternalValues(String name) throws GitException { ConfigKey key = parseName(name); String[] values = repository.getConfig().getStringList(key.section, key.subsection, key.name); if (values == null || values.length == 0) { <START> throw new GitException(""); <END> } return values; }</code><technical_language>Fix message</technical_language>

Target:
private String[] getInternalValues(String name) throws GitException { ConfigKey key = parseName(name); String[] values = repository.getConfig().getStringList(key.section, key.subsection, key.name); if (values == null || values.length == 0) { throw new GitException("Can not find property '" + name + "' in repository configuration"); } return values; }
Source:
<code>public void verifyMapOpened() { waitForElementVisibleByElement(mapFrame); scrollToElement(mapFrame); <START> driver.switchTo().frame(mapFrame); <END> driver.switchTo().defaultContent(); }</code><technical_language>Add Pagelogging</technical_language>

Target:
public void verifyMapOpened() { waitForElementVisibleByElement(mapFrame); scrollToElement(mapFrame); driver.switchTo().frame(mapFrame); driver.switchTo().defaultContent(); PageObjectLogging.log("verifyMapOpened", "Map was opened", true); }
Source:
<code>protected @Nullable List<@NonNull ITimeGraphRowModel> getRowModel(@NonNull ITmfStateSystem ss, @NonNull SelectionTimeQueryFilter filter, @Nullable IProgressMonitor monitor) throws StateSystemDisposedException { <START> try (ScopeLog scope = new ScopeLog(LOCAL_LOGGER, Level.FINE, "AbstractTimeGraphDataProvider#fetchRowModel", getClass().getSimpleName())) { <END> Set<ITmfStateInterval> intervals = new HashSet<>(); Map<Integer, String[]> paths = new HashMap<>(); Collection<Long> times = getTimes(filter, ss.getStartTime(), ss.getCurrentEndTime()); Set<Integer> quarks = new HashSet<>(); for (Integer quark : getSelectedQuarks(filter)) { quarks.addAll(ss.getSubAttributes(quark, true)); } for (Integer quark : quarks) { paths.put(quark, ss.getFullAttributePathArray(quark)); } for (ITmfStateInterval interval : ss.query2D(quarks, times)) { if (monitor != null && monitor.isCanceled()) { return Collections.emptyList(); } if (interval.getValue() instanceof Integer) { intervals.add(interval); } } if (monitor != null && monitor.isCanceled()) { return Collections.emptyList(); } List<ITimeGraphState> markerList = new ArrayList<>(); for (ITmfStateInterval interval : intervals) { long startTime = interval.getStartTime(); long duration = interval.getEndTime() - startTime + 1; markerList.add(new MarkerModel(startTime, duration, paths.get(interval.getAttribute()))); } return Collections.singletonList(new TimeGraphRowModel(getId(ITmfStateSystem.ROOT_ATTRIBUTE), markerList)); } }</code><technical_language>redundant scope in parent class</technical_language>

Target:
protected @Nullable List<@NonNull ITimeGraphRowModel> getRowModel(@NonNull ITmfStateSystem ss, @NonNull SelectionTimeQueryFilter filter, @Nullable IProgressMonitor monitor) throws StateSystemDisposedException { Map<Integer, String[]> paths = new HashMap<>(); List<ITimeGraphState> markerList = new ArrayList<>(); Collection<Long> times = getTimes(filter, ss.getStartTime(), ss.getCurrentEndTime()); Set<Integer> quarks = new HashSet<>(); for (Integer quark : getSelectedQuarks(filter)) { quarks.addAll(ss.getSubAttributes(quark, true)); } for (Integer quark : quarks) { paths.put(quark, ss.getFullAttributePathArray(quark)); } for (ITmfStateInterval interval : ss.query2D(quarks, times)) { if (monitor != null && monitor.isCanceled()) { return Collections.emptyList(); } if (interval.getValue() instanceof Integer) { long startTime = interval.getStartTime(); long duration = interval.getEndTime() - startTime + 1; markerList.add(new MarkerModel(startTime, duration, paths.get(interval.getAttribute()))); } } if (monitor != null && monitor.isCanceled()) { return Collections.emptyList(); } return Collections.singletonList(new TimeGraphRowModel(getId(ITmfStateSystem.ROOT_ATTRIBUTE), markerList)); }
Source:
<code>protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { StringBuilder sb = new StringBuilder(); for (UUID uuid : user._getIgnoredPlayers()) { User curUser = ess.getUser(uuid); if (curUser != null && curUser.getName() != null && !curUser.getName().trim().isEmpty()) { sb.append(curUser.getName()).append(" "); } } String ignoredList = sb.toString().trim(); user.sendMessage(ignoredList.length() > 0 ? tl("ignoredList", ignoredList) : tl("noIgnored")); } else { User player; try { player = getPlayer(server, args, 0, true, true); } catch (PlayerNotFoundException ex) { player = ess.getOfflineUser(args[0]); } if (player == null) { throw new PlayerNotFoundException(); } if (player.isIgnoreExempt()) { user.sendMessage(tl("ignoreExempt")); } else if (user.isIgnoredPlayer(player)) { user.setIgnoredPlayer(player, false); user.sendMessage(tl("unignorePlayer", player.getName())); } else { user.setIgnoredPlayer(player, true); <START> if (args.length > 1) { <END> long ignoreTimestamp = 0; final String time = args[1]; ignoreTimestamp = DateUtil.parseDateDiff(time, true); user.setIgnoredPlayerTimeout(player, ignoreTimestamp); user.sendMessage(tl("ignorePlayerFor", player.getName(), time)); } else { user.sendMessage(tl("ignorePlayer", player.getName())); } } } }</code><technical_language>requires argument suggestion if (args.length > 0) {</technical_language>

Target:
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { StringBuilder sb = new StringBuilder(); for (UUID uuid : user._getIgnoredPlayers()) { User curUser = ess.getUser(uuid); if (curUser != null && curUser.getName() != null && !curUser.getName().trim().isEmpty()) { sb.append(curUser.getName()).append(" "); } } String ignoredList = sb.toString().trim(); user.sendMessage(ignoredList.length() > 0 ? tl("ignoredList", ignoredList) : tl("noIgnored")); } else { User player; try { player = getPlayer(server, args, 0, true, true); } catch (PlayerNotFoundException ex) { player = ess.getOfflineUser(args[0]); } if (player == null) { throw new PlayerNotFoundException(); } if (player.isIgnoreExempt()) { user.sendMessage(tl("ignoreExempt")); } else if (user.isIgnoredPlayer(player)) { user.setIgnoredPlayer(player, false); user.sendMessage(tl("unignorePlayer", player.getName())); } else { user.setIgnoredPlayer(player, true); if (args.length > 1) { long ignoreTimestamp = DateUtil.parseDateDiff(args[1], true); user.setIgnoredPlayerTimeout(player, ignoreTimestamp); user.sendMessage(tl("ignorePlayerFor", player.getName(), DateUtil.formatDateDiff(ignoreTimestamp))); } else { user.sendMessage(tl("ignorePlayer", player.getName())); } } } }
Source:
<code>public void performApply(ILaunchConfigurationWorkingCopy configuration) { configuration.setAttribute( IRunDockerImageLaunchConfigurationConstants.CONNECTION_NAME, <START> connectionSelectionCombo.getText()); <END> configuration.setAttribute( IRunDockerImageLaunchConfigurationConstants.IMAGE_NAME, imageSelectionCombo.getText()); configuration.setAttribute( IRunDockerImageLaunchConfigurationConstants.COMMAND, commandText.getText()); if (!entrypointText.getText().isEmpty()) configuration.setAttribute( IRunDockerImageLaunchConfigurationConstants.ENTRYPOINT, entrypointText.getText()); if (!containerNameText.getText().isEmpty()) configuration.setAttribute( IRunDockerImageLaunchConfigurationConstants.CONTAINER_NAME, containerNameText.getText()); configuration.setAttribute( IRunDockerImageLaunchConfigurationConstants.ALLOCATE_PSEUDO_CONSOLE, allocatePseudoTTY.getSelection()); configuration.setAttribute( IRunDockerImageLaunchConfigurationConstants.AUTO_REMOVE, removeWhenExitsButton.getSelection()); configuration.setAttribute( IRunDockerImageLaunchConfigurationConstants.INTERACTIVE, interactiveButton.getSelection()); }</code><technical_language>configuration attributes model, widgets</technical_language>

Target:
public void performApply(ILaunchConfigurationWorkingCopy configuration) { configuration.setAttribute( IRunDockerImageLaunchConfigurationConstants.CONNECTION_NAME, model.getSelectedConnectionName()); configuration.setAttribute( IRunDockerImageLaunchConfigurationConstants.IMAGE_NAME, model.getSelectedImageName()); configuration.setAttribute( IRunDockerImageLaunchConfigurationConstants.COMMAND, model.getCommand()); configuration.setAttribute( IRunDockerImageLaunchConfigurationConstants.ENTRYPOINT, "".equals(model.getEntrypoint()) ? null : model.getEntrypoint()); configuration.setAttribute( IRunDockerImageLaunchConfigurationConstants.CONTAINER_NAME, "".equals(model.getContainerName()) ? null : model.getContainerName()); configuration.setAttribute( IRunDockerImageLaunchConfigurationConstants.ALLOCATE_PSEUDO_CONSOLE, model.isAllocatePseudoTTY()); configuration.setAttribute( IRunDockerImageLaunchConfigurationConstants.AUTO_REMOVE, model.isRemoveWhenExits()); configuration.setAttribute( IRunDockerImageLaunchConfigurationConstants.INTERACTIVE, model.isInteractiveMode()); }
Source:
<code>public int compareTo(PhoenixJson o) { if (o == null) { return 1; <START> } else if (this.equals(o)) { <END> return 0; } else { return this.toString().compareTo(o.toString()); } }</code><technical_language>Checking JsonNode.equals a string compare string representation is good. JSON concept of < > comparison? rely string equality node equality? break down? If works, consistently check for equality hashcode, etc. If work, need introduce concept of a type support comparison, = !=</technical_language>

Target:
public int compareTo(PhoenixJson o) { throw new EqualityNotSupportedException(PJson.INSTANCE); }
Source:
<code>private void addWorkbenchDependencyIfRequired( WorkspaceBundlePluginModel fModel) throws CoreException { IPluginImport[] imports = fModel.getPluginBase().getImports(); final String WORKBENCH_IMPORT_ID = "org.eclipse.e4.ui.model.workbench"; for (IPluginImport iPluginImport : imports) { if (WORKBENCH_IMPORT_ID.equalsIgnoreCase(iPluginImport.getId())) return; } String version = ""; IPluginModelBase findModel = PluginRegistry .findModel(WORKBENCH_IMPORT_ID); if (findModel != null) { BundleDescription bundleDescription = findModel .getBundleDescription(); <START> if (bundleDescription != null) <END> version = bundleDescription.getVersion().toString(); } IPluginImport workbenchImport = fModel.getPluginFactory() .createImport(); workbenchImport.setId(WORKBENCH_IMPORT_ID); workbenchImport.setVersion(version); workbenchImport.setMatch(IMatchRules.GREATER_OR_EQUAL); fModel.getPluginBase().add(workbenchImport); fModel.save(); }</code><technical_language>care of ".qualifer" in version. stripped</technical_language>

Target:
private void addWorkbenchDependencyIfRequired( WorkspaceBundlePluginModel fModel) throws CoreException { IPluginImport[] imports = fModel.getPluginBase().getImports(); final String WORKBENCH_IMPORT_ID = "org.eclipse.e4.ui.model.workbench"; for (IPluginImport iPluginImport : imports) { if (WORKBENCH_IMPORT_ID.equalsIgnoreCase(iPluginImport.getId())) return; } String version = ""; IPluginModelBase findModel = PluginRegistry .findModel(WORKBENCH_IMPORT_ID); if (findModel != null) { BundleDescription bundleDescription = findModel .getBundleDescription(); if (bundleDescription != null) version = bundleDescription.getVersion().toString() .replaceFirst("\\.qualifier$", ""); } IPluginImport workbenchImport = fModel.getPluginFactory() .createImport(); workbenchImport.setId(WORKBENCH_IMPORT_ID); workbenchImport.setVersion(version); workbenchImport.setMatch(IMatchRules.GREATER_OR_EQUAL); fModel.getPluginBase().add(workbenchImport); fModel.save(); }
Source:
<code>public void addBreakpoint(final VirtualFile file, final int lineNumber) { if (isConnected()) { String fqn = pathToFqn(file); if (fqn == null) { return; } <START> String fileProjectPath = file.getProject().getProjectConfig().getPath(); <END> LocationDto locationDto = dtoFactory.createDto(LocationDto.class).withLineNumber(lineNumber + 1) .withTarget(fqn) .withResourcePath(file.getPath()) .withResourceProjectPath(fileProjectPath); BreakpointDto breakpointDto = dtoFactory.createDto(BreakpointDto.class).withLocation(locationDto).withEnabled(true); Promise<Void> promise = service.addBreakpoint(debugSessionDto.getId(), breakpointDto); promise.then(new Operation<Void>() { @Override public void apply(Void arg) throws OperationException { Breakpoint breakpoint = new Breakpoint(Breakpoint.Type.BREAKPOINT, lineNumber, file.getPath(), file, true); for (DebuggerObserver observer : observers) { observer.onBreakpointAdded(breakpoint); } } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { Log.error(AbstractDebugger.class, arg.getMessage()); } }); } else { Breakpoint breakpoint = new Breakpoint(Breakpoint.Type.BREAKPOINT, lineNumber, file.getPath(), file, false); for (DebuggerObserver observer : observers) { observer.onBreakpointAdded(breakpoint); } } }</code><technical_language>is need declare a variable, simply: .withResourceProjectPath(file.getProject().getProjectConfig().getPath());</technical_language>

Target:
public void addBreakpoint(final VirtualFile file, final int lineNumber) { if (isConnected()) { String fqn = pathToFqn(file); if (fqn == null) { return; } final String filePath = file.getLocation().toString(); LocationDto locationDto = dtoFactory.createDto(LocationDto.class) .withLineNumber(lineNumber + 1) .withTarget(fqn) .withResourcePath(filePath) .withResourceProjectPath(getProject(file).getPath()); BreakpointDto breakpointDto = dtoFactory.createDto(BreakpointDto.class).withLocation(locationDto).withEnabled(true); Promise<Void> promise = service.addBreakpoint(debugSessionDto.getId(), breakpointDto); promise.then(new Operation<Void>() { @Override public void apply(Void arg) throws OperationException { Breakpoint breakpoint = new Breakpoint(Breakpoint.Type.BREAKPOINT, lineNumber, filePath, file, true); for (DebuggerObserver observer : observers) { observer.onBreakpointAdded(breakpoint); } } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { Log.error(AbstractDebugger.class, arg.getMessage()); } }); } else { Breakpoint breakpoint = new Breakpoint(Breakpoint.Type.BREAKPOINT, lineNumber, file.getPath(), file, false); for (DebuggerObserver observer : observers) { observer.onBreakpointAdded(breakpoint); } } }
Source:
<code>public void putAll(Map<? extends K, ? extends V> m) { <START> <END> }</code><technical_language>implementation is missing protected doWithWriteLock</technical_language>

Target:
public void putAll(Map<? extends K, ? extends V> m) { doWithWriteLock(c -> { c.putAll(m); return null; }); }
Source:
<code>public void onEventMainThread(UploadService.UploadMediaSuccessEvent event) { AnalyticsTracker.track(Stat.MY_SITE_ICON_UPLOADED); EventBus.getDefault().removeStickyEvent(event); SiteModel site = getSelectedSite(); if (site != null) { <START> if (isMediaUploadInProgress()) { <END> if (event.mediaModelList.size() > 0) { MediaModel media = event.mediaModelList.get(0); mBlavatarImageView.setImageUrl(media.getUrl(), ImageType.BLAVATAR); mSiteSettings.setSiteIconMediaId((int) media.getMediaId()); mSiteSettings.saveSettings(); } } else { if (event.mediaModelList != null && !event.mediaModelList.isEmpty()) { UploadUtils.onMediaUploadedSnackbarHandler(getActivity(), getActivity().findViewById(R.id.coordinator), false, event.mediaModelList, site, event.successMessage); } } } }</code><technical_language>Do need showSiteIconProgressBar(false) statement upload succeeds upload progress is shown (i.e. isMediaUploadInProgress())</technical_language>

Target:
public void onEventMainThread(UploadService.UploadMediaSuccessEvent event) { AnalyticsTracker.track(Stat.MY_SITE_ICON_UPLOADED); EventBus.getDefault().removeStickyEvent(event); SiteModel site = getSelectedSite(); if (site != null) { if (isMediaUploadInProgress()) { if (event.mediaModelList.size() > 0) { MediaModel media = event.mediaModelList.get(0); mBlavatarImageView.setImageUrl(PhotonUtils.getPhotonImageUrl( media.getUrl(), mBlavatarSz, mBlavatarSz, PhotonUtils.Quality.HIGH), ImageType.BLAVATAR); mSiteSettings.setSiteIconMediaId((int) media.getMediaId()); mSiteSettings.saveSettings(); } else { AppLog.w(T.MAIN, "Site icon upload completed, but mediaList is empty."); } showSiteIconProgressBar(false); } else { if (event.mediaModelList != null && !event.mediaModelList.isEmpty()) { UploadUtils.onMediaUploadedSnackbarHandler(getActivity(), getActivity().findViewById(R.id.coordinator), false, event.mediaModelList, site, event.successMessage); } } } }
Source:
<code><START> private void registerJXPathPropertyHandlers() { <END> EPackage[] packages = new EPackage[] { EcorePackage.eINSTANCE, ApplicationPackageImpl.eINSTANCE, CommandsPackageImpl.eINSTANCE, BasicPackageImpl.eINSTANCE, UiPackageImpl.eINSTANCE, AdvancedPackageImpl.eINSTANCE, org.eclipse.e4.ui.model.application.ui.basic.impl.BasicPackageImpl.eINSTANCE, MenuPackageImpl.eINSTANCE, FragmentPackageImpl.eINSTANCE }; for (EPackage ePackage : packages) { for (EClassifier eClassifier : ePackage.getEClassifiers()) { if (!(eClassifier instanceof EClass)) { continue; } EClass eClass = (EClass) eClassifier; if (eClass.isAbstract()) { continue; } EFactory eFactory = EPackage.Registry.INSTANCE.getEFactory(ePackage.getNsURI()); Class<? extends EObject> implClass = eFactory.create(eClass).getClass(); JXPathIntrospector.registerDynamicClass(implClass, EDynamicPropertyHandler.class); } } }</code><technical_language>static</technical_language>

Target:
private static void registerJXPathPropertyHandlers() { EPackage[] packages = new EPackage[] { EcorePackage.eINSTANCE, ApplicationPackageImpl.eINSTANCE, CommandsPackageImpl.eINSTANCE, BasicPackageImpl.eINSTANCE, UiPackageImpl.eINSTANCE, AdvancedPackageImpl.eINSTANCE, org.eclipse.e4.ui.model.application.ui.basic.impl.BasicPackageImpl.eINSTANCE, MenuPackageImpl.eINSTANCE, FragmentPackageImpl.eINSTANCE }; for (EPackage ePackage : packages) { for (EClassifier eClassifier : ePackage.getEClassifiers()) { if (!(eClassifier instanceof EClass)) { continue; } EClass eClass = (EClass) eClassifier; if (eClass.isAbstract()) { continue; } EFactory eFactory = EPackage.Registry.INSTANCE.getEFactory(ePackage.getNsURI()); Class<? extends EObject> implClass = eFactory.create(eClass).getClass(); JXPathIntrospector.registerDynamicClass(implClass, EDynamicPropertyHandler.class); } } }
Source:
<code>public HandlerResult handle(ProcessState state, ProcessInstance process) { Instance instance = (Instance)state.getResource(); if (!InstanceConstants.CONTAINER_LIKE.contains(instance.getKind())) { return null; } Image image = objectManager.loadResource(Image.class, instance.getImageId()); if (image == null) { dockerStorageDao.createImageForInstance(instance); } Map<Object, Object> data = new HashMap<>(); String mode = networkService.getNetworkMode(DataUtils.getFields(instance)); data.put(DockerInstanceConstants.FIELD_NETWORK_MODE, mode); Network network = networkService.resolveNetwork(instance.getAccountId(), mode); if (network != null) { data.put(InstanceConstants.FIELD_NETWORK_IDS, Arrays.asList(network.getId())); } Map<String, Object> labels = DataAccessor.fieldMap(instance, InstanceConstants.FIELD_LABELS); Object ip = labels.get(SystemLabels.LABEL_REQUESTED_IP); if (ip != null) { data.put(InstanceConstants.FIELD_REQUESTED_IP_ADDRESS, ip.toString()); } return new HandlerResult(data).withShouldContinue(true); }</code><technical_language>add a check do this for instance.isNativeContainer. if backported leave is, deployed rancher delete. need this check a container deploy for ipsec/vxlan network network created</technical_language>

Target:
public HandlerResult handle(ProcessState state, ProcessInstance process) { Instance instance = (Instance)state.getResource(); if (!InstanceConstants.CONTAINER_LIKE.contains(instance.getKind())) { return null; } Image image = objectManager.loadResource(Image.class, instance.getImageId()); if (image == null) { dockerStorageDao.createImageForInstance(instance); } Map<Object, Object> data = new HashMap<>(); String mode = networkService.getNetworkMode(DataUtils.getFields(instance)); data.put(DockerInstanceConstants.FIELD_NETWORK_MODE, mode); Network network = networkService.resolveNetwork(instance.getAccountId(), mode); if (network == null && StringUtils.isNotBlank(mode) && !instance.getNativeContainer()) { objectProcessManager.scheduleProcessInstance(InstanceConstants.PROCESS_REMOVE, instance, null); throw new ExecutionException(String.format("Failed to find network for networkMode %s", mode), null, state.getResource()); } if (network != null) { data.put(InstanceConstants.FIELD_NETWORK_IDS, Arrays.asList(network.getId())); } Map<String, Object> labels = DataAccessor.fieldMap(instance, InstanceConstants.FIELD_LABELS); Object ip = labels.get(SystemLabels.LABEL_REQUESTED_IP); if (ip != null) { data.put(InstanceConstants.FIELD_REQUESTED_IP_ADDRESS, ip.toString()); } return new HandlerResult(data).withShouldContinue(true); }
Source:
<code>@Test public void testShardSyncIdempotency() throws Exception { shardSyncTaskManager.syncShardAndLeaseInfo(new ArrayList<>()); <START> Thread.sleep(SHARDSYNCER_INVOCATION_WAIT_SLEEP_MILLIS); END> verify(mockShardSyncer, times(1)) .checkAndCreateLeasesForNewShards(Matchers.any(), Matchers.any(), Matchers.any(), anyBoolean(), anyBoolean(), Matchers.any()); int count = 0; while (count++ < 5) { shardSyncTaskManager.syncShardAndLeaseInfo(new ArrayList<>()); } verify(mockShardSyncer, times(1)) .checkAndCreateLeasesForNewShards(Matchers.any(), Matchers.any(), Matchers.any(), anyBoolean(), anyBoolean(), Matchers.any()); }</code><technical_language>avoid sleep another latch. Applicable places</technical_language>

Target:
@Test public void testShardSyncIdempotency() throws Exception { shardSyncTaskManager.syncShardAndLeaseInfo(new ArrayList<>()); pausableNoOpShardSyncer.waitForShardSyncerInitializationLatch.await(); verify(mockShardSyncer, times(1)) .checkAndCreateLeasesForNewShards(Matchers.any(), Matchers.any(), Matchers.any(), anyBoolean(), anyBoolean(), Matchers.any()); int count = 0; while (count++ < 5) { shardSyncTaskManager.syncShardAndLeaseInfo(new ArrayList<>()); } verify(mockShardSyncer, times(1)) .checkAndCreateLeasesForNewShards(Matchers.any(), Matchers.any(), Matchers.any(), anyBoolean(), anyBoolean(), Matchers.any()); pausableNoOpShardSyncer.blockShardSyncLatch.countDown(); }
Source:
<code>private void initialize() { initializeFields(); fAppearanceColorTableViewer.setContentProvider(ArrayContentProvider.getInstance()); fAppearanceColorTableViewer.setInput(fAppearanceColorTableModel); <START> fAppearanceColorTable.getDisplay().asyncExec(() -> { <END> if (fAppearanceColorTable != null && !fAppearanceColorTable.isDisposed()) { fAppearanceColorTable.select(0); handleAppearanceColorListSelection(); } }); }</code><technical_language>problem is solved making this section run later</technical_language>

Target:
private void initialize() { initializeFields(); fAppearanceColorTableViewer.setContentProvider(ArrayContentProvider.getInstance()); fAppearanceColorTableViewer.setInput(fAppearanceColorTableModel); fAppearanceColorTableViewer.setSelection(new StructuredSelection(fAppearanceColorTableViewer.getElementAt(0)), true); }
Source:
<code>public void processRecords(ProcessRecordsInput records) { if (records.getRecords().isEmpty()) { return; } BigInteger seq = BigInteger.ZERO; m_gapTracker.allocate(records.getRecords().size()); int offset = 0; for (Record record : records.getRecords()) { m_submitCount.incrementAndGet(); BigInteger seqNum = new BigInteger(record.getSequenceNumber()); if (seqNum.compareTo(m_lastFetchCommittedSequenceNumber) < 0) { continue; } if (isDebugEnabled()) { debug(null, "last committed seq: %s, current seq:%s shard %s", m_lastFetchCommittedSequenceNumber.toString(), record.getSequenceNumber(), m_shardId); if (seqNum.compareTo(seq) < 0) { debug(null, "Record %d is out of sequence on shard %s", seqNum, m_shardId); } else { seq = seqNum; } } String data = null; try { <START> data = new String(record.getData().array(), "UTF-8"); <END> Invocation invocation = new Invocation(m_config.getProcedure(), m_formatter.transform(data)); StreamProcedureCallback cb = new StreamProcedureCallback(m_gapTracker, offset, seqNum, m_cbcnt); if (!callProcedure(invocation, cb)) { rateLimitedLog(Level.ERROR, null, "Call procedure error on shard %s", m_shardId); m_gapTracker.commit(offset, seqNum); } } catch (UnsupportedEncodingException | FormatException e) { rateLimitedLog(Level.ERROR, e, "Data error on shard %s, data: %s", m_shardId, data); m_gapTracker.commit(offset, seqNum); } catch (Exception e) { rateLimitedLog(Level.ERROR, e, "Call procedure error with data %s on shard %s", data, m_shardId); break; } if (!shouldRun()) { break; } offset++; } commitCheckPoint(records.getCheckpointer()); }</code><technical_language>StandardEncodings.UTF_8 need handle UnsupportedEncodingException</technical_language>

Target:
public void processRecords(ProcessRecordsInput records) { if (records.getRecords().isEmpty()) { return; } BigInteger seq = BigInteger.ZERO; m_gapTracker.allocate(records.getRecords().size()); int offset = 0; for (Record record : records.getRecords()) { m_submitCount.incrementAndGet(); BigInteger seqNum = new BigInteger(record.getSequenceNumber()); if (seqNum.compareTo(m_lastFetchCommittedSequenceNumber) < 0) { continue; } if (isDebugEnabled()) { debug(null, "last committed seq: %s, current seq:%s shard %s", m_lastFetchCommittedSequenceNumber.toString(), record.getSequenceNumber(), m_shardId); if (seqNum.compareTo(seq) < 0) { debug(null, "Record %d is out of sequence on shard %s", seqNum, m_shardId); } else { seq = seqNum; } } String data = null; try { data = new String(record.getData().array(), StandardCharsets.UTF_8); Invocation invocation = new Invocation(m_config.getProcedure(), m_formatter.transform(data)); StreamProcedureCallback cb = new StreamProcedureCallback(m_gapTracker, offset, seqNum, m_cbcnt); if (!callProcedure(invocation, cb)) { rateLimitedLog(Level.ERROR, null, "Call procedure error on shard %s", m_shardId); m_gapTracker.commit(offset, seqNum); } } catch (FormatException e) { rateLimitedLog(Level.ERROR, e, "Data error on shard %s, data: %s", m_shardId, data); m_gapTracker.commit(offset, seqNum); } if (!shouldRun()) { break; } offset++; } commitCheckPoint(records.getCheckpointer()); }
Source:
<code>public void bridgeOverwriteConfig(int retries, int waitIntervalInMSecs) { logger.trace( "bridgeOverwriteConfig(): parameters requested: retries = times, initial wait interval = msecs.", retries, waitIntervalInMSecs); if ((retries < 0) || (waitIntervalInMSecs < 0)) { <START> logger.info("bridgeOverwriteConfig(): settings ignore due to invalid values."); <END> } else { this.bridgeInstance.veluxBridgeConfiguration().retries = retries; this.bridgeInstance.veluxBridgeConfiguration().timeoutMsecs = waitIntervalInMSecs; } logger.trace("bridgeOverwriteConfig(): config set to retries = times, initial wait interval = msecs.", this.bridgeInstance.veluxBridgeConfiguration().retries, this.bridgeInstance.veluxBridgeConfiguration().timeoutMsecs); }</code><technical_language>"ignored"</technical_language>

Target:
public void bridgeOverwriteConfig(int retries, int waitIntervalInMSecs) { logger.trace( "bridgeOverwriteConfig(): parameters requested: retries = times, initial wait interval = msecs.", retries, waitIntervalInMSecs); if ((retries < 0) || (waitIntervalInMSecs < 0)) { logger.info("bridgeOverwriteConfig(): settings ignored due to invalid values."); VeluxBridgeConfiguration defaultConfiguration = new VeluxBridgeConfiguration(); bridgeInstance.veluxBridgeConfiguration().retries = defaultConfiguration.retries; bridgeInstance.veluxBridgeConfiguration().timeoutMsecs = defaultConfiguration.timeoutMsecs; } else { bridgeInstance.veluxBridgeConfiguration().retries = retries; bridgeInstance.veluxBridgeConfiguration().timeoutMsecs = waitIntervalInMSecs; } logger.trace("bridgeOverwriteConfig(): config set to retries = times, initial wait interval = ms.", bridgeInstance.veluxBridgeConfiguration().retries, bridgeInstance.veluxBridgeConfiguration().timeoutMsecs); }
Source:
<code>private boolean isAustraliaFipsCountryCode (String countryCode) { return (StringUtils.isNotBlank(countryCode) && <START> StringUtils.equalsIgnoreCase(countryCode, PaymentWorksConstants.COUNTRY_CODE_AUSTRALIA)); <END> }</code><technical_language>Another spot simplified due null-safe equalsIgnoreCase method</technical_language>

Target:
private boolean isAustraliaFipsCountryCode (String countryCode) { return (StringUtils.equalsIgnoreCase(countryCode, PaymentWorksConstants.FIPS_COUNTRY_CODE_AUSTRALIA)); }
Source:
<code>public void should_create_AssertionError_if_created_ComparisonFailure_and_AssertionFailedError_is_null() throws Exception { <START> when(constructorInvoker.newInstance(any(String.class), any(Class[].class), anyVararg())).thenReturn(null); <END> AssertionError error = factory.newAssertionError(description, new StandardRepresentation()); check(error); }</code><technical_language>anyVararg is deprecated, is else</technical_language>

Target:
public void should_create_AssertionError_if_created_ComparisonFailure_and_AssertionFailedError_is_null() throws Exception { when(constructorInvoker.newInstance(any(String.class), any(Class[].class), any(Object[].class))).thenReturn(null); AssertionError error = factory.newAssertionError(description, new StandardRepresentation()); check(error); }
Source:
<code>public void addPeer(String peerId, ReplicationPeerConfig peerConfig, boolean enabled) throws ReplicationException { if (peers.containsKey(peerId)) { return; } ReplicationPeerConfig updatedPeerConfig = ReplicationPeerConfigUtil. <START> addBasePeerConfigsIfNotPresent(conf,peerConfig); <END> peerConfig = updatedPeerConfig; ReplicationPeerConfig copiedPeerConfig = ReplicationPeerConfig.newBuilder(peerConfig).build(); SyncReplicationState syncReplicationState = copiedPeerConfig.isSyncReplication() ? SyncReplicationState.DOWNGRADE_ACTIVE : SyncReplicationState.NONE; peerStorage.addPeer(peerId, copiedPeerConfig, enabled, syncReplicationState); peers.put(peerId, new ReplicationPeerDescription(peerId, enabled, copiedPeerConfig, syncReplicationState)); }</code><technical_language>nit: config, peerConfig (space)</technical_language>

Target:
public void addPeer(String peerId, ReplicationPeerConfig peerConfig, boolean enabled) throws ReplicationException { if (peers.containsKey(peerId)) { return; } peerConfig = ReplicationPeerConfigUtil.addBasePeerConfigsIfNotPresent(conf, peerConfig); ReplicationPeerConfig copiedPeerConfig = ReplicationPeerConfig.newBuilder(peerConfig).build(); SyncReplicationState syncReplicationState = copiedPeerConfig.isSyncReplication() ? SyncReplicationState.DOWNGRADE_ACTIVE : SyncReplicationState.NONE; peerStorage.addPeer(peerId, copiedPeerConfig, enabled, syncReplicationState); peers.put(peerId, new ReplicationPeerDescription(peerId, enabled, copiedPeerConfig, syncReplicationState)); }
Source:
<code>protected void run() throws Exception { if (all) { Map<String, Ref> allRefs = db.getRefDatabase().getRefs(ALL); for (final Ref r : allRefs.values()) outw.println(r.getObjectId().name()); } else { <START> if(verify <END> && commits.size() > 1) throw new CmdLineException(CLIText.get().needSingleRevision); for (final ObjectId o : commits) outw.println(o.name()); } }</code><technical_language>style nit: missing space 'if'</technical_language>

Target:
protected void run() throws Exception { if (all) { Map<String, Ref> allRefs = db.getRefDatabase().getRefs(ALL); for (final Ref r : allRefs.values()) { outw.println(r.getObjectId().name()); } } else { if (verify && commits.size() > 1) { throw new CmdLineException(CLIText.get().needSingleRevision); } for (final ObjectId o : commits) { outw.println(o.name()); } } }
Source:
<code><START> private static boolean isStar(ExpressionTree expressionTree) { <END> String value = ExpressionsHelper.getConstantValueAsString(expressionTree).value(); return value != null && value.equals("*"); }</code><technical_language>I change isStar method containsStar rule cover: java @CrossOrigin(origins = {"*"}) // Noncompliant java @CrossOrigin(origins = {"http://localhost:7777", "*"}) // Noncompliant</technical_language>

Target:
private static boolean isStar(ExpressionTree expressionTree) { if (expressionTree.is(Tree.Kind.NEW_ARRAY)) { return ((NewArrayTree) expressionTree).initializers().stream().anyMatch(CORSCheck::isStar); } else { String value = ExpressionsHelper.getConstantValueAsString(expressionTree).value(); return value != null && value.equals("*"); } }
Source:
<code>public Set<Long> findChildTaskExecutionIds(Set<Long> taskExecutionIds) { final MapSqlParameterSource queryParameters = new MapSqlParameterSource() .addValue("parentTaskExecutionIds", taskExecutionIds); Set<Long> childTaskExecutionIds; try { childTaskExecutionIds = this.jdbcTemplate.query( getQuery(SELECT_CHILD_TASK_EXECUTION_IDS), queryParameters, new ResultSetExtractor<Set<Long>>() { @Override public Set<Long> extractData(ResultSet resultSet) throws SQLException, DataAccessException { <START> Set<Long> jobExecutionIds = new TreeSet<>(); <END> while (resultSet.next()) { jobExecutionIds .add(resultSet.getLong("TASK_EXECUTION_ID")); } return jobExecutionIds; } }); } catch (DataAccessException e) { childTaskExecutionIds = Collections.emptySet(); } if (!childTaskExecutionIds.isEmpty()) { childTaskExecutionIds.addAll(this.findChildTaskExecutionIds(childTaskExecutionIds)); } return childTaskExecutionIds; }</code><technical_language>taskExecutionIds</technical_language>

Target:
public Set<Long> findChildTaskExecutionIds(Set<Long> taskExecutionIds) { final MapSqlParameterSource queryParameters = new MapSqlParameterSource() .addValue("parentTaskExecutionIds", taskExecutionIds); Set<Long> childTaskExecutionIds; try { childTaskExecutionIds = this.jdbcTemplate.query( getQuery(SELECT_CHILD_TASK_EXECUTION_IDS), queryParameters, new ResultSetExtractor<Set<Long>>() { @Override public Set<Long> extractData(ResultSet resultSet) throws SQLException, DataAccessException { final Set<Long> taskExecutionIds = new TreeSet<>(); while (resultSet.next()) { taskExecutionIds .add(resultSet.getLong("TASK_EXECUTION_ID")); } return taskExecutionIds; } }); } catch (DataAccessException e) { childTaskExecutionIds = Collections.emptySet(); } if (!childTaskExecutionIds.isEmpty()) { childTaskExecutionIds.addAll(this.findChildTaskExecutionIds(childTaskExecutionIds)); } return childTaskExecutionIds; }
Source:
<code><START> static boolean createCluster(String destZkString, String destClusterName) { <END> HelixZkClient destZkClient = DedicatedZkClientFactory.getInstance().buildZkClient(new HelixZkClient.ZkConnectionConfig(destZkString)); destZkClient.setZkSerializer(new ZNRecordSerializer()); HelixAdmin destAdmin = new ZKHelixAdmin(destZkClient); if (destAdmin.getClusters().contains(destClusterName)) { System.out.println("Create cluster failed. " + destClusterName + " already exist."); return false; } ClusterSetup clusterSetup = new ClusterSetup(destZkString); clusterSetup.addCluster(destClusterName, true); HelixConfigScope configScope = new HelixConfigScopeBuilder(HelixConfigScope.ConfigScopeProperty.CLUSTER). forCluster(destClusterName).build(); Map<String, String> helixClusterProperties = new HashMap<>(); helixClusterProperties.put(ZKHelixManager.ALLOW_PARTICIPANT_AUTO_JOIN, String.valueOf(true)); destAdmin.setConfig(configScope, helixClusterProperties); ConfigAccessor configAccessor = new ConfigAccessor(destZkClient); ClusterConfig clusterConfig = configAccessor.getClusterConfig(destClusterName); clusterConfig.setPersistBestPossibleAssignment(true); configAccessor.setClusterConfig(destClusterName, clusterConfig); System.out.println("Cluster " + destClusterName + " create done."); return true; }</code><technical_language>return is need for createCluster method, checked if duplicate cluster exists this method return is used</technical_language>

Target:
static void createCluster(String destZkString, String destClusterName) { HelixZkClient destZkClient = DedicatedZkClientFactory.getInstance().buildZkClient(new HelixZkClient.ZkConnectionConfig(destZkString)); destZkClient.setZkSerializer(new ZNRecordSerializer()); HelixAdmin destAdmin = new ZKHelixAdmin(destZkClient); if (destAdmin.getClusters().contains(destClusterName)) { System.out.println("Failed to create cluster becuase " + destClusterName + " already exist."); return; } ClusterSetup clusterSetup = new ClusterSetup(destZkString); clusterSetup.addCluster(destClusterName, true); HelixConfigScope configScope = new HelixConfigScopeBuilder(HelixConfigScope.ConfigScopeProperty.CLUSTER). forCluster(destClusterName).build(); Map<String, String> helixClusterProperties = new HashMap<>(); helixClusterProperties.put(ZKHelixManager.ALLOW_PARTICIPANT_AUTO_JOIN, String.valueOf(true)); destAdmin.setConfig(configScope, helixClusterProperties); ConfigAccessor configAccessor = new ConfigAccessor(destZkClient); ClusterConfig clusterConfig = configAccessor.getClusterConfig(destClusterName); clusterConfig.setPersistBestPossibleAssignment(true); configAccessor.setClusterConfig(destClusterName, clusterConfig); System.out.println("Cluster " + destClusterName + " is created successfully!"); return; }
Source:
<code>public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { <START> String authorizationValue = this.credential.generateAuthorizationHeader(context.getHttpRequest().getUrl(), <END> context.getHttpRequest().getHeaders().toMap()); context.getHttpRequest().setHeader("Authorization", authorizationValue); return next.process(); }</code><technical_language>Remove this</technical_language>

Target:
public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { String authorizationValue = credential.generateAuthorizationHeader(context.getHttpRequest().getUrl(), context.getHttpRequest().getHeaders().toMap()); context.getHttpRequest().setHeader("Authorization", authorizationValue); return next.process(); }
Source:
<code>public EnumFacing getFacing() { <START> return EnumFacing.getFront(getBlockMetadata()); <END> }</code><technical_language>I this done more properly blockstate properties. Block metadata is in 1.13 avoid if possible</technical_language>

Target:
public EnumFacing getFacing() { return getWorld().getBlockState(getPos()).getValue(BlockBase.FACING); }