auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private TopologyActions getTopologyActionsImpl () { <START> String className = (String) config.get("topologyActionsImpl"); <END> String jar = (String) config.get("iotasStormJar"); TopologyActions topologyActions; try { topologyActions = ReflectionHelper.newInstance(className); } catch (Exception ex) { throw new RuntimeException(ex); } Map<String, String> conf = new HashMap<>(); conf.put(StormTopologyLayoutConstants.STORM_JAR_LOCATION_KEY, jar); conf.put(StormTopologyLayoutConstants.YAML_KEY_CATALOG_ROOT_URL, (String) config.get("catalogRootUrl")); conf.put(StormTopologyLayoutConstants.STORM_HOME_DIR, (String) config.get("stormHomeDir")); conf.put(TopologyLayoutConstants.JAVA_JAR_COMMAND, (String) config.get("javaJarCommand")); topologyActions.init(conf); return topologyActions; }</code><technical_language>Lets create constants for strings</technical_language>

Target:
private TopologyActions getTopologyActionsImpl () { String className = (String) config.get(com.hortonworks.iotas.streams.common.Constants.CONFIG_TOPOLOGY_ACTIONS_IMPL); String jar = (String) config.get(StormTopologyLayoutConstants.STORM_JAR_LOCATION_KEY); TopologyActions topologyActions; try { topologyActions = ReflectionHelper.newInstance(className); } catch (Exception ex) { throw new RuntimeException(ex); } Map<String, String> conf = new HashMap<>(); conf.put(StormTopologyLayoutConstants.STORM_JAR_LOCATION_KEY, jar); conf.put(StormTopologyLayoutConstants.YAML_KEY_CATALOG_ROOT_URL, (String) config.get(Constants.CONFIG_CATALOG_ROOT_URL)); conf.put(StormTopologyLayoutConstants.STORM_HOME_DIR, (String) config.get(StormTopologyLayoutConstants.STORM_HOME_DIR)); conf.put(TopologyLayoutConstants.JAVA_JAR_COMMAND, (String) config.get(TopologyLayoutConstants.JAVA_JAR_COMMAND)); topologyActions.init(conf); return topologyActions; }
Source:
<code>public Builder toBuilder() { <START> return new Builder<Builder<?>>().setConfiguration(configuration); <END> }</code><technical_language>In general, a good idea pass a mutable map around. ImmutableMap.copOf()</technical_language>

Target:
public Builder toBuilder() { return new Builder(getConfiguration()); }
Source:
<code>public MetadataResource(SessionFactory sessionFactory, DockstoreWebserviceConfiguration config) { this.toolDAO = new ToolDAO(sessionFactory); this.workflowDAO = new WorkflowDAO(sessionFactory); this.organizationDAO = new OrganizationDAO(sessionFactory); this.collectionDAO = new CollectionDAO(sessionFactory); this.config = config; <START> MetadataResourceHelper.setConfig(config); <END> }</code><technical_language>set this in DockstoreWebserviceApplication. other helpers in this pattern exists in file follow</technical_language>

Target:
public MetadataResource(SessionFactory sessionFactory, DockstoreWebserviceConfiguration config) { this.toolDAO = new ToolDAO(sessionFactory); this.workflowDAO = new WorkflowDAO(sessionFactory); this.organizationDAO = new OrganizationDAO(sessionFactory); this.collectionDAO = new CollectionDAO(sessionFactory); this.config = config; }
Source:
<code>public static <T> T callMethod(Object object, String methodName, Object... args) { Validate.notNull(object, "null class name"); Method method = null; boolean isAccessible = true; try { Class[] argTypes = new Class[args.length]; IntStream.range(0, args.length).forEach(i -> argTypes[i] = args[i].getClass()); method = object.getClass().getDeclaredMethod(methodName, argTypes); isAccessible = method.isAccessible(); method.setAccessible(true); return (T)method.invoke(object, args); } catch (Exception e) { LOG.warn("Failed to invoke method: " + methodName, e); <START> return null; <END> } finally { if (method != null) { method.setAccessible(isAccessible); } } }</code><technical_language>throw exception logging</technical_language>

Target:
public static <T> T callMethod(Object object, String methodName, Object... args) throws Exception { Validate.notNull(object, "null class name"); Method method = null; boolean isAccessible = true; try { Class[] argTypes = new Class[args.length]; IntStream.range(0, args.length).forEach(i -> argTypes[i] = args[i].getClass()); method = object.getClass().getDeclaredMethod(methodName, argTypes); isAccessible = method.isAccessible(); method.setAccessible(true); return (T)method.invoke(object, args); } catch (Exception e) { LOG.warn("Failed to invoke method: " + methodName, e); throw e; } finally { if (method != null) { method.setAccessible(isAccessible); } } }
Source:
<code>protected void executeQueryCommand() { List<Disk> diskList = DbFacade.getInstance() .getDiskDao() .getAllAttachableDisksByPoolId(getParameters().getStoragePoolId(), getParameters().getVmId(), getUserID(), getParameters().isFiltered()); <START> if (diskList == null || diskList.isEmpty()) { <END> setReturnValue(Collections.emptyList()); return; } ArrayList<Disk> filteredDiskList = new ArrayList<Disk>(); VM vm = DbFacade.getInstance().getVmDao().get(getParameters().getVmId(), getUserID(), getParameters().isFiltered()); if (vm == null) { setReturnValue(Collections.emptyList()); return; } List<String> supportedDiskInterfaceNames = getOsRepository().getDiskInterfaces(vm.getOs(), vm.getVdsGroupCompatibilityVersion()); HashSet<DiskInterface> supportedDiskInterfaces = new HashSet<DiskInterface>(); for (String interfaceName : supportedDiskInterfaceNames) { try { supportedDiskInterfaces.add(DiskInterface.valueOf(interfaceName)); } catch (IllegalArgumentException e) { LOG.errorFormat("Can't find the value {0} in the enum DiskInterface. Error: {1}", ((interfaceName == null) ? "null" : interfaceName), e.toString()); } } for (Disk disk : diskList) { if (supportedDiskInterfaces.contains(disk.getDiskInterface())) { filteredDiskList.add(disk); } } setReturnValue(filteredDiskList); }</code><technical_language>diskList is guaranteed null - remove null check if rebase this patch</technical_language>

Target:
protected void executeQueryCommand() { List<Disk> diskList = DbFacade.getInstance() .getDiskDao() .getAllAttachableDisksByPoolId(getParameters().getStoragePoolId(), getParameters().getVmId(), getUserID(), getParameters().isFiltered()); if (CollectionUtils.isEmpty(diskList)) { setReturnValue(Collections.emptyList()); return; } VM vm = DbFacade.getInstance().getVmDao().get(getParameters().getVmId(), getUserID(), getParameters().isFiltered()); if (vm == null) { setReturnValue(Collections.emptyList()); return; } List<String> supportedDiskInterfaceNames = getOsRepository().getDiskInterfaces(vm.getOs(), vm.getVdsGroupCompatibilityVersion()); Collection<DiskInterface> supportedDiskInterfaces = new HashSet<DiskInterface>(); for (String interfaceName : supportedDiskInterfaceNames) { try { supportedDiskInterfaces.add(DiskInterface.valueOf(interfaceName)); } catch (IllegalArgumentException e) { LOG.errorFormat("Can't find the value {0} in the enum DiskInterface. Error: {1}", ((interfaceName == null) ? "null" : interfaceName), e.toString()); } } List<Disk> filteredDiskList = new ArrayList<Disk>(); for (Disk disk : diskList) { if (supportedDiskInterfaces.contains(disk.getDiskInterface())) { filteredDiskList.add(disk); } } setReturnValue(filteredDiskList); }
Source:
<code>protected void onCreate(Bundle stateBundle) { super.onCreate(stateBundle); setContentView(R.layout.search_activity_main); queryHandler = new AsyncQueryHandler(getContentResolver()) {}; findViewById(R.id.search_activity_main).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setEditState(EditState.WAITING); } }); editText = (ClearableEditText) findViewById(R.id.search_edit_text); editText.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setEditState(EditState.EDITING); } }); editText.setTextListener(new ClearableEditText.TextListener() { @Override public void onChange(String text) { if (editState == EditState.EDITING) { <START> ((SuggestionsFragment) getSupportFragmentManager().findFragmentById(R.id.suggestions)) <END> .loadSuggestions(text); } } @Override public void onSubmit(String text) { final String trimmedQuery = text.trim(); if (!TextUtils.isEmpty(trimmedQuery)) { onSearch(text); } } }); preSearch = findViewById(R.id.presearch); postSearch = findViewById(R.id.postsearch); suggestions = findViewById(R.id.suggestions); animationText = (TextView) findViewById(R.id.animation_text); animationCard = findViewById(R.id.animation_card); cardPaddingX = getResources().getDimensionPixelSize(R.dimen.card_background_padding_x); cardPaddingY = getResources().getDimensionPixelSize(R.dimen.card_background_padding_y); textEndY = getResources().getDimensionPixelSize(R.dimen.animation_text_translation_y); }</code><technical_language>avoid calling findFragmentById character typed</technical_language>

Target:
protected void onCreate(Bundle stateBundle) { super.onCreate(stateBundle); setContentView(R.layout.search_activity_main); queryHandler = new AsyncQueryHandler(getContentResolver()) {}; editText = (ClearableEditText) findViewById(R.id.search_edit_text); editText.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setEditState(EditState.EDITING); } }); editText.setTextListener(new ClearableEditText.TextListener() { @Override public void onChange(String text) { if (editState == EditState.EDITING) { suggestionsFragment.loadSuggestions(text); } } @Override public void onSubmit(String text) { final String trimmedQuery = text.trim(); if (!TextUtils.isEmpty(trimmedQuery)) { onSearch(trimmedQuery); } } }); preSearch = findViewById(R.id.presearch); postSearch = findViewById(R.id.postsearch); suggestionsContainer = findViewById(R.id.suggestions_container); suggestionsFragment = (SuggestionsFragment) getSupportFragmentManager().findFragmentById(R.id.suggestions); findViewById(R.id.suggestions_container).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setEditState(EditState.WAITING); } }); animationText = (TextView) findViewById(R.id.animation_text); animationCard = findViewById(R.id.animation_card); cardPaddingX = getResources().getDimensionPixelSize(R.dimen.card_background_padding_x); cardPaddingY = getResources().getDimensionPixelSize(R.dimen.card_background_padding_y); textEndY = getResources().getDimensionPixelSize(R.dimen.animation_text_translation_y); }
Source:
<code>public void send(OteEventMessage message) { if(debug){ System.out.printf("[%s] sending: [%s] to [%s] [%d]\n", new Date(), message.getHeader().TOPIC.getValue(), address.toString(), message.getData().length); } <START> message.getData(); <END> AddressBuffer obj = buffers.getObject(); obj.getBuffer().clear(); obj.getBuffer().put(message.getData()); obj.getBuffer().flip(); obj.setAddress(address); try { toSend.put(obj); } catch (InterruptedException e) { throw new OTEException(e); } }</code><technical_language>this do anything</technical_language>

Target:
public void send(OteEventMessage message) { if(debug){ System.out.printf("[%s] sending: [%s] to [%s] [%d]\n", new Date(), message.getHeader().TOPIC.getValue(), address.toString(), message.getData().length); } AddressBuffer obj = buffers.getObject(); obj.getBuffer().clear(); obj.getBuffer().put(message.getData()); obj.getBuffer().flip(); obj.setAddress(address); try { toSend.put(obj); } catch (InterruptedException e) { throw new OTEException(e); } }
Source:
<code>private Node createNodeForElement(Object element, DocumentView view) { NodeDescriptor descriptor = mDocument.getNodeDescriptor(element); Node node = new DOM.Node(); node.nodeId = mDocument.getNodeIdForElement(element); node.nodeType = descriptor.getNodeType(element); node.nodeName = descriptor.getNodeName(element); node.localName = descriptor.getLocalName(element); node.nodeValue = descriptor.getNodeValue(element); Document.AttributeListAccumulator accumulator = new Document.AttributeListAccumulator(); <START> mDocument.getNodeDescriptor(element).getAttributes(element, accumulator); <END> node.attributes = accumulator; ElementInfo elementInfo = view.getElementInfo(element); List<Node> childrenNodes = (elementInfo.children.size() == 0) ? Collections.<Node>emptyList() : new ArrayList<Node>(elementInfo.children.size()); for (int i = 0, N = elementInfo.children.size(); i < N; ++i) { final Object childElement = elementInfo.children.get(i); Node childNode = createNodeForElement(childElement, view); childrenNodes.add(childNode); } node.children = childrenNodes; node.childNodeCount = childrenNodes.size(); return node; }</code><technical_language>retrieving node descriptor again</technical_language>

Target:
private Node createNodeForElement(Object element, DocumentView view) { NodeDescriptor descriptor = mDocument.getNodeDescriptor(element); Node node = new DOM.Node(); node.nodeId = mDocument.getNodeIdForElement(element); node.nodeType = descriptor.getNodeType(element); node.nodeName = descriptor.getNodeName(element); node.localName = descriptor.getLocalName(element); node.nodeValue = descriptor.getNodeValue(element); Document.AttributeListAccumulator accumulator = new Document.AttributeListAccumulator(); descriptor.getAttributes(element, accumulator); node.attributes = accumulator; ElementInfo elementInfo = view.getElementInfo(element); List<Node> childrenNodes = (elementInfo.children.size() == 0) ? Collections.<Node>emptyList() : new ArrayList<Node>(elementInfo.children.size()); for (int i = 0, N = elementInfo.children.size(); i < N; ++i) { final Object childElement = elementInfo.children.get(i); Node childNode = createNodeForElement(childElement, view); childrenNodes.add(childNode); } node.children = childrenNodes; node.childNodeCount = childrenNodes.size(); return node; }
Source:
<code>public void doFilter(ServletRequest req, ServletResponse rsp, FilterChain chain) throws IOException, ServletException { findNegotiatingProfiles(req); if (profiles.isEmpty()) { chain.doFilter(req, rsp); <START> return; <END> } doFilter((HttpServletRequest) req, (HttpServletResponse) rsp, chain); }</code><technical_language>please do return middle</technical_language>

Target:
public void doFilter(ServletRequest req, ServletResponse rsp, FilterChain chain) throws IOException, ServletException { findNegotiatingProfiles(req); if (profiles.isEmpty()) { chain.doFilter(req, rsp); return; } doAuth((HttpServletRequest) req, (HttpServletResponse) rsp, chain); }
Source:
<code>protected void configureServlets() { serve("/say-hello/*").with(HelloWorldServlet.class); DynamicSet.bind(binder(), WebUiPlugin.class) .toInstance(new JavaScriptPlugin("hello-project.js")); DynamicSet.bind(binder(), WebUiPlugin.class) .toInstance(new JavaScriptPlugin("hello-revision.js")); DynamicSet.bind(binder(), WebUiPlugin.class) .toInstance(new <START> GwtPlugin("cookbook-plugin")); <END> }</code><technical_language>s/cookbook-plugin/cookbook This match module name in HelloForm.gwt.xml: <module rename-to="cookbook"></technical_language>

Target:
protected void configureServlets() { serve("/say-hello/*").with(HelloWorldServlet.class); DynamicSet.bind(binder(), WebUiPlugin.class) .toInstance(new JavaScriptPlugin("hello-project.js")); DynamicSet.bind(binder(), WebUiPlugin.class) .toInstance(new JavaScriptPlugin("hello-revision.js")); DynamicSet.bind(binder(), WebUiPlugin.class) .toInstance(new GwtPlugin("cookbook")); }
Source:
<code>private void verifyStatusInput() { if (asyncRestore || (status && StringUtils.isBlank(requestId))) { <START> throw new IllegalArgumentException(SEE_COMMAND_USAGE_MESSAGE); <END> } }</code><technical_language>I expand this verify statement match other 3</technical_language>

Target:
private void verifyStatusInput() { if (status && StringUtils.isBlank(requestId)) { throw new IllegalArgumentException( "Status request is missing requestId." + SEE_COMMAND_USAGE_MESSAGE); } if (asyncRestore) { throw new IllegalArgumentException( "asyncRestore passed to status request." + SEE_COMMAND_USAGE_MESSAGE); } }
Source:
<code>public void loadCenterDetails(String format, String locale, String meetingDate, int officeId, int staffId) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscription.add(collectionDataManager.fetchCenterDetails(format, locale, meetingDate, officeId, staffId) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<List<CenterDetail>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); <START> try { <END> if (e instanceof HttpException) { String errorMessage = ((HttpException) e).response().errorBody() .string(); getMvpView().showError(MFErrorParser.parseError(errorMessage) .getErrors().get(0).getDefaultUserMessage()); } } catch (Throwable throwable) { RxJavaPlugins.getInstance().getErrorHandler().handleError(e); } } @Override public void onNext(List<CenterDetail> centerDetails) { getMvpView().showProgressbar(false); getMvpView().onCenterLoadSuccess(centerDetails); } })); }</code><technical_language>this utils method show error <LINK_0></technical_language>

Target:
public void loadCenterDetails(String format, String locale, String meetingDate, int officeId, int staffId) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscription.add(collectionDataManager.fetchCenterDetails(format, locale, meetingDate, officeId, staffId) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<List<CenterDetail>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); getMvpView().showError(MFErrorParser.errorMessage(e)); } @Override public void onNext(List<CenterDetail> centerDetails) { getMvpView().showProgressbar(false); getMvpView().onCenterLoadSuccess(centerDetails); } })); }
Source:
<code>boolean equivalent(QuantileDigest other) { return (getNodeCount() == other.getNodeCount() && min == other.min && max == other.max && <START> weightedCount == other.weightedCount); <END> }</code><technical_language>check alpha</technical_language>

Target:
boolean equivalent(QuantileDigest other) { return (getNodeCount() == other.getNodeCount() && min == other.min && max == other.max && weightedCount == other.weightedCount && alpha == other.alpha); }
Source:
<code>private boolean clearLocally0(K key, boolean readers) { MvccUtils.verifyMvccOperationSupport(ctx, "Clear"); ctx.checkSecurity(SecurityPermission.CACHE_REMOVE); <START> ctx.shared().cache().checkReadOnlyState("clear", ctx.config()); <END> if (keyCheck) validateCacheKey(key); GridCacheVersion obsoleteVer = ctx.versions().next(); ctx.shared().database().checkpointReadLock(); try { KeyCacheObject cacheKey = ctx.toCacheKeyObject(key); GridCacheEntryEx entry = ctx.isNear() ? peekEx(cacheKey) : entryEx(cacheKey); if (entry != null) return entry.clear(obsoleteVer, readers); } catch (GridDhtInvalidPartitionException ignored) { } catch (IgniteCheckedException ex) { U.error(log, "Failed to clearLocally entry for key: " + key, ex); } finally { ctx.shared().database().checkpointReadUnlock(); } return false; }</code><technical_language>I suppose neet check mvcc security permissions in readonly cluster ? need move upper</technical_language>

Target:
private boolean clearLocally0(K key, boolean readers) { ctx.shared().cache().checkReadOnlyState("clear", ctx.config()); MvccUtils.verifyMvccOperationSupport(ctx, "Clear"); ctx.checkSecurity(SecurityPermission.CACHE_REMOVE); if (keyCheck) validateCacheKey(key); GridCacheVersion obsoleteVer = ctx.versions().next(); ctx.shared().database().checkpointReadLock(); try { KeyCacheObject cacheKey = ctx.toCacheKeyObject(key); GridCacheEntryEx entry = ctx.isNear() ? peekEx(cacheKey) : entryEx(cacheKey); if (entry != null) return entry.clear(obsoleteVer, readers); } catch (GridDhtInvalidPartitionException ignored) { } catch (IgniteCheckedException ex) { U.error(log, "Failed to clearLocally entry for key: " + key, ex); } finally { ctx.shared().database().checkpointReadUnlock(); } return false; }
Source:
<code>private static IterableStream<FormContent> setReferenceElements(List<String> elements, List<ReadResult> readResults, Integer pageNumber) { List<FormContent> formContentList = new ArrayList<>(); elements.forEach(elementString -> { <START> String[] indices = COMPILE.matcher(elementString).replaceAll(" ").trim().split(" "); <END> int readResultIndex, lineIndex; if (indices.length >= 1) { readResultIndex = Integer.parseInt(indices[0]); lineIndex = Integer.parseInt(indices[1]); } else { throw LOGGER.logExceptionAsError(new RuntimeException("Reference Elements not found")); } if (indices.length == 3) { int wordIndex = Integer.parseInt(indices[2]); TextWord textWord = readResults.get(readResultIndex).getLines().get(lineIndex).getWords() .get(wordIndex); FormWord wordElement = new FormWord(textWord.getText(), toBoundingBox(textWord.getBoundingBox()), pageNumber, textWord.getConfidence()); formContentList.add(wordElement); } else { TextLine textLine = readResults.get(readResultIndex).getLines().get(lineIndex); FormLine lineElement = new FormLine(textLine.getText(), toBoundingBox(textLine.getBoundingBox()), pageNumber, toWords(textLine.getWords(), pageNumber)); formContentList.add(lineElement); } }); return new IterableStream<>(formContentList); }</code><technical_language>renamed Pattern reflects purpose</technical_language>

Target:
private static IterableStream<FormContent> setReferenceElements(List<String> elements, List<ReadResult> readResults, Integer pageNumber) { if (CoreUtils.isNullOrEmpty(elements)) { return IterableStream.of(null); } List<FormContent> formContentList = new ArrayList<>(); elements.forEach(elementString -> { String[] indices = NON_DIGIT_PATTERN.matcher(elementString).replaceAll(" ").trim().split(" "); if (indices.length < 2) { throw LOGGER.logExceptionAsError(new RuntimeException("Cannot find corresponding reference elements " + "for the field value.")); } int readResultIndex = Integer.parseInt(indices[0]); int lineIndex = Integer.parseInt(indices[1]); if (indices.length == 3) { int wordIndex = Integer.parseInt(indices[2]); TextWord textWord = readResults.get(readResultIndex).getLines().get(lineIndex).getWords().get(wordIndex); FormWord wordElement = new FormWord(textWord.getText(), toBoundingBox(textWord.getBoundingBox()), pageNumber, setDefaultConfidenceValue(textWord.getConfidence())); formContentList.add(wordElement); } else { TextLine textLine = readResults.get(readResultIndex).getLines().get(lineIndex); FormLine lineElement = new FormLine(textLine.getText(), toBoundingBox(textLine.getBoundingBox()), pageNumber, toWords(textLine.getWords(), pageNumber)); formContentList.add(lineElement); } }); return new IterableStream<>(formContentList); }
Source:
<code>public Object getPropertyValue(Object id) { if (id == null) { return null; } if (HOST.equals(id)) { return this.connection.toString(); } if (USERNAME.equals(id)) { return this.connection.getUsername(); } if (connection instanceof IOpenShiftConnection) { IOpenShiftConnection openshiftConnection = (IOpenShiftConnection) this.connection; if (OPENSHIFT_MASTER_VERSION.equals(id)) { return openshiftConnection.getOpenShiftMasterVersion(); } if (KUBERNETES_MASTER_VERSION.equals(id)) { return openshiftConnection.getKubernetesMasterVersion(); } if (OC_VERSION.equals(id)) { String path = OCBinary.getInstance().getLocation(openshiftConnection); OCBinaryVersionValidator validator = new OCBinaryVersionValidator(path); <START> return validator.getVersion(new NullProgressMonitor()).toString(); <END> } Object result = openshiftConnection.getExtendedProperties().get(id); return result == null ? "" : result.toString(); } return null; }</code><technical_language>run #getVersion in UI thread launches a process, a heavy operation</technical_language>

Target:
public Object getPropertyValue(Object id) { if (id == null) { return null; } if (HOST.equals(id)) { return this.connection.toString(); } if (USERNAME.equals(id)) { return this.connection.getUsername(); } if (connection instanceof IOpenShiftConnection) { IOpenShiftConnection openshiftConnection = (IOpenShiftConnection) this.connection; if (OPENSHIFT_MASTER_VERSION.equals(id)) { return openshiftConnection.getOpenShiftMasterVersion(); } if (KUBERNETES_MASTER_VERSION.equals(id)) { return openshiftConnection.getKubernetesMasterVersion(); } if (OC_CLIENT.equals(id)) { return OCBinary.getInstance().getLocation(openshiftConnection); } Object result = openshiftConnection.getExtendedProperties().get(id); return result == null ? "" : result.toString(); } return null; }
Source:
<code>public Response getAccountAuditLogs(@PathParam("accountId") final UUID accountId, @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException { final TenantContext tenantContext = context.createTenantContextWithAccountId(accountId, request); <START> final Account account = accountUserApi.getAccountById(accountId, tenantContext); <END> final AccountAuditLogs accountAuditLogs = auditUserApi.getAccountAuditLogs(account.getId(), AuditLevel.FULL, tenantContext); return Response.status(Status.OK).entity(getAuditLogs(accountAuditLogs)).build(); }</code><technical_language>Do need fetch account</technical_language>

Target:
public Response getAccountAuditLogs(@PathParam("accountId") final UUID accountId, @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException { final TenantContext tenantContext = context.createTenantContextWithAccountId(accountId, request); final AccountAuditLogs accountAuditLogs = auditUserApi.getAccountAuditLogs(accountId, AuditLevel.FULL, tenantContext); return Response.status(Status.OK).entity(getAuditLogs(accountAuditLogs)).build(); }
Source:
<code>public Node apply(@Nonnull Node node) { for (Rule rule : rules) { if (!rule.matches(node)) { return rule.apply(node); } } for (Rule rule : rules) { node = rule.apply(node); if (isErrorResult(node)) <START> return createNodeUsingFactory(node); <END> } return createNodeUsingFactory(node); }</code><technical_language>do return a new node instead of failing one</technical_language>

Target:
public Node apply(@Nonnull Node node) { for (Rule rule : rules) { if (!rule.matches(node)) { return rule.apply(node); } } for (Rule rule : rules) { node = rule.apply(node); if (isErrorResult(node)) return node; } return createNodeUsingFactory(node); }
Source:
<code>protected PhoneNumberClientBuilder getClientBuilder(HttpClient httpClient) { if (getTestMode() == TestMode.PLAYBACK) { httpClient = interceptorManager.getPlaybackClient(); } PhoneNumberClientBuilder builder = new PhoneNumberClientBuilder(); builder.httpClient(httpClient).endpoint(ENV_ENDPOINT).accessKey(ENV_ACCESS_KEY); if (getTestMode() == TestMode.RECORD) { List<Function<String, String>> redactors = new ArrayList<>(); redactors.add(data -> redact(data, JSON_PROPERTY_VALUE_REDACTION_PATTERN.matcher(data), "REDACTED")); <START> builder.addPolicy(interceptorManager.getRecordPolicy()); <END> } return builder; }</code><technical_language>passing redactors anymore, in line 76? need sanitize recordings</technical_language>

Target:
protected PhoneNumberClientBuilder getClientBuilder(HttpClient httpClient) { if (getTestMode() == TestMode.PLAYBACK) { httpClient = interceptorManager.getPlaybackClient(); } PhoneNumberClientBuilder builder = new PhoneNumberClientBuilder(); builder.httpClient(httpClient).endpoint(ENV_ENDPOINT).accessKey(ENV_ACCESS_KEY); if (getTestMode() == TestMode.RECORD) { interceptorManager.addTextReplacementRule(String.valueOf(JSON_PROPERTY_VALUE_REDACTION_PATTERN), "REDACTED"); builder.addPolicy(interceptorManager.getRecordPolicy()); } return builder; }
Source:
<code>private Command getSnapCommand(Request request) { List editparts = null; if (request instanceof GroupRequest) { editparts = ((GroupRequest) request).getEditParts(); } else if (request instanceof ArrangeRequest) { editparts = ((ArrangeRequest) request).getPartsToArrange(); } TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain(); if (editparts != null && <START> !isDoNotHandleSnapTo(editparts)) <END> { return new ICommandProxy(new SnapCommand(editingDomain, editparts)); } return null; }</code><technical_language>shouldLaunchSnapTo</technical_language>

Target:
private Command getSnapCommand(Request request) { List editparts = null; if (request instanceof GroupRequest) { editparts = ((GroupRequest) request).getEditParts(); } else if (request instanceof ArrangeRequest) { editparts = ((ArrangeRequest) request).getPartsToArrange(); } TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain(); if (editparts != null && !shouldLaunchSnapTo(editparts)) { return new ICommandProxy(new SnapCommand(editingDomain, editparts)); } return null; }
Source:
<code><START> private static void validateBoundingBoxData(List<Float> expectedBoundingBox, BoundingBox actualBoundingBox) { <END> List<Point> expectedPointList = new ArrayList<>(); for (int i = 0; i < expectedBoundingBox.size(); i++) { expectedPointList.add(new Point(expectedBoundingBox.get(i), expectedBoundingBox.get(++i))); } assertEquals(new BoundingBox(expectedPointList), actualBoundingBox); }</code><technical_language>this a Double instead of Float</technical_language>

Target:
private static void validateBoundingBoxData(List<Float> expectedBoundingBox, BoundingBox actualBoundingBox) { if ((actualBoundingBox != null && actualBoundingBox.getPoints() != null) && (!CoreUtils.isNullOrEmpty(expectedBoundingBox))) { List<Point> expectedPointList = new ArrayList<>(); for (int i = 0; i < expectedBoundingBox.size(); i++) { expectedPointList.add(new Point(expectedBoundingBox.get(i), expectedBoundingBox.get(++i))); } assertEquals(new BoundingBox(expectedPointList), actualBoundingBox); } }
Source:
<code>public Iterable<ITmfEventAspect> getEventAspects() { ImmutableSet.Builder<ITmfEventAspect> builder = ImmutableSet.builder(); builder.addAll(super.getEventAspects()); builder.add(KernelTidAspect.INSTANCE); builder.add(ThreadPriorityAspect.INSTANCE); return <START> NonNullUtils.checkNotNull(builder.build()); <END> }</code><technical_language>This method external annotation now</technical_language>

Target:
public Iterable<ITmfEventAspect> getEventAspects() { ImmutableSet.Builder<ITmfEventAspect> builder = ImmutableSet.builder(); builder.addAll(super.getEventAspects()); builder.add(KernelTidAspect.INSTANCE); builder.add(ThreadPriorityAspect.INSTANCE); return builder.build(); }
Source:
<code>public String getAddress() { <START> return address; <END> }</code><technical_language>check if address is empty return? compute address address is empty</technical_language>

Target:
public String getAddress() { if (address == null) { address = getAddress(host, port); } return address; }
Source:
<code>public Workflow upsertServiceVersion(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "Repository path", required = true) @FormParam("repository") String repository, @ApiParam(value = "Name of user on GitHub", required = true) @FormParam("username") String username, @ApiParam(value = "Git reference for new GitHub tag", required = true) @FormParam("gitReference") String gitReference, @ApiParam(value = "GitHub installation ID", required = true) @FormParam("installationId") String installationId) { <START> User sendingUser = GitHubHelper.findUserByGitHubUsername(this.tokenDAO, this.userDAO, username, false); <END> String installationAccessToken = gitHubAppSetup(installationId); String dockstoreServicePath = upsertVersionHelper(repository, gitReference, null, SERVICE, installationAccessToken); Workflow service = workflowDAO.findByPath(dockstoreServicePath, false, Service.class).get(); if (sendingUser != null && !service.getUsers().contains(sendingUser)) { service.getUsers().add(sendingUser); } return service; }</code><technical_language>I if enough moved abstract class. I feel a workflow equivalent of upsertVersion do similar finding user, a token, adding user, etc</technical_language>

Target:
public Service upsertServiceVersion(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "Repository path", required = true) @FormParam("repository") String repository, @ApiParam(value = "Name of user on GitHub", required = true) @FormParam("username") String username, @ApiParam(value = "Git reference for new GitHub tag", required = true) @FormParam("gitReference") String gitReference, @ApiParam(value = "GitHub installation ID", required = true) @FormParam("installationId") String installationId) { return upsertVersion(repository, username, gitReference, installationId, SERVICE); }
Source:
<code>private void validateBondMode(boolean isVmNetwork){ Bond bond = new Bond(); bond.setNetworkName(null); bond.setName("bondName"); bond.setNetworkName("networkName"); Network network = createNetworkWithName("networkName"); network.setVmNetwork(isVmNetwork); NetworkAttachment vmNetworkNetworkAttachment = createNetworkAttachment(network, bond); HostSetupNetworksValidator validator = new HostSetupNetworksValidatorBuilder() .setParams(new ParametersBuilder().addBonds(new Bond[]{bond})) .addNetworks(network) .addExistingInterfaces(bond) .build(); for (BondMode bondMode : BondMode.values()){ bond.setBondOptions(bondMode.getConfigurationValue()); ValidationResult result = validator.validateBondModeVsNetworksAttachedToIt(Arrays.asList(vmNetworkNetworkAttachment)); if (!isVmNetwork || BondMode.isBondModeValidForVmNetwork(bondMode.getValue())){ assertThat(result, isValid()); } else { <START> assertThat(result, <END> failsWith(EngineMessage.INVALID_BOND_MODE_FOR_BOND_WITH_VM_NETWORK, ReplacementUtils.createSetVariableString(HostSetupNetworksValidator.VAR_BOND_NAME, "bondName"), ReplacementUtils.createSetVariableString(HostSetupNetworksValidator.VAR_NETWORK_NAME, "networkName") )); } } }</code><technical_language>format</technical_language>

Target:
private void validateBondMode(boolean isVmNetwork){ Bond bond = new Bond(); bond.setNetworkName(null); bond.setName("bondName"); bond.setNetworkName("networkName"); Network network = createNetworkWithName("networkName"); network.setVmNetwork(isVmNetwork); NetworkAttachment vmNetworkNetworkAttachment = createNetworkAttachment(network, bond); HostSetupNetworksValidator validator = new HostSetupNetworksValidatorBuilder() .setParams(new ParametersBuilder().addBonds(new Bond[]{bond})) .addNetworks(network) .addExistingInterfaces(bond) .build(); for (BondMode bondMode : BondMode.values()){ bond.setBondOptions(bondMode.getConfigurationValue()); ValidationResult result = validator.validateBondModeVsNetworksAttachedToIt(Arrays.asList(vmNetworkNetworkAttachment)); if (!isVmNetwork || bondMode.isBondModeValidForVmNetwork()){ assertThat(result, isValid()); } else { assertThat(result, failsWith(EngineMessage.INVALID_BOND_MODE_FOR_BOND_WITH_VM_NETWORK, ReplacementUtils.createSetVariableString(HostSetupNetworksValidator.VAR_BOND_NAME, "bondName"), ReplacementUtils.createSetVariableString(HostSetupNetworksValidator.VAR_NETWORK_NAME, "networkName") )); } } }
Source:
<code>public boolean isAtLeastOneSettingsEnabled( JSONObject settingsJson, String[] settingsArray, String[] settingsValues ) { boolean atLeastOneOptionEnabled = false; if (settingsJson != null && settingsArray.length == settingsValues.length) { for (int i = 0; i < settingsArray.length; i++) { String settingValue = settingsValues[i]; boolean isChecked = JSONUtils.queryJSON(settingsJson, settingValue, true); if (isChecked) { <START> atLeastOneOptionEnabled = true; <END> } } } return atLeastOneOptionEnabled; }</code><technical_language>NIT: return true this point return false end of this method</technical_language>

Target:
public boolean isAtLeastOneSettingsEnabled( JSONObject settingsJson, String[] settingsArray, String[] settingsValues ) { if (settingsJson != null && settingsArray.length == settingsValues.length) { for (int i = 0; i < settingsArray.length; i++) { String settingValue = settingsValues[i]; boolean isChecked = JSONUtils.queryJSON(settingsJson, settingValue, true); if (isChecked) { return true; } } } return false; }
Source:
<code>public LocalCryptographyAsyncClient buildAsyncClient() { <START> if (jsonWebKey == null) { throw logger.logExceptionAsError(new IllegalStateException( "Json Web Key is required to create local cryptography client")); } <END> return new LocalCryptographyAsyncClient(jsonWebKey); }</code><technical_language>If input is null is expected non-null, throw NullPointerException Java guidelines</technical_language>

Target:
public LocalCryptographyAsyncClient buildAsyncClient() { if (jsonWebKey == null) { throw logger.logExceptionAsError(new NullPointerException( "Json Web Key is required to create local cryptography client")); } return new LocalCryptographyAsyncClient(jsonWebKey); }
Source:
<code>public double getBaseMaxOutput() { <START> return powerToAdd; <END> }</code><technical_language>return output tier, actual values is generating. internal buffer supply diff gen output</technical_language>

Target:
public double getBaseMaxOutput() { if (this.panel != null) { return this.panel.generationRateD; } return 0; }
Source:
<code>public void activateTheme(String themeId) { ThemeModel theme = new ThemeModel(); theme.setThemeId(themeId); ThemeStore.ActivateThemePayload payload = new ThemeStore.ActivateThemePayload(mSite, theme); <START> if (mSite.isJetpackConnected() && mThemeStore.getInstalledThemeByThemeId(themeId) == null) { <END> mDispatcher.dispatch(ThemeActionBuilder.newInstallThemeAction(payload)); } else { mDispatcher.dispatch(ThemeActionBuilder.newActivateThemeAction(payload)); } }</code><technical_language>check for isJetpackConnected isUsingWpComRestApi start of this method? need for newActivateThemeAction dispatch</technical_language>

Target:
public void activateTheme(String themeId) { if (!mSite.isUsingWpComRestApi()) { AppLog.i(T.THEMES, "Theme activation requires a site using WP.com REST API. Aborting request."); return; } ThemeModel theme = mThemeStore.getInstalledThemeByThemeId(themeId); if (theme == null) { theme = mThemeStore.getWpComThemeByThemeId(themeId); if (theme == null) { AppLog.w(T.THEMES, "Theme unavailable to activate. Fetch it and try again."); return; } if (mSite.isJetpackConnected()) { mDispatcher.dispatch(ThemeActionBuilder.newInstallThemeAction(new ActivateThemePayload(mSite, theme))); return; } } mDispatcher.dispatch(ThemeActionBuilder.newActivateThemeAction(new ActivateThemePayload(mSite, theme))); }
Source:
<code>public void getContentObjectFolderTest() throws Exception { PID pid = repository.mintContentPid(); String etag = "\"etag\""; mockFcrepoResponse(pid, etag, Cdr.Folder); <START> etag = etag = etag.substring(1, etag.length() - 1); <END> mockLoadTypes(Arrays.asList(Cdr.Folder.getURI())); ContentObject obj = repository.getContentObject(pid); assertTrue("Incorrect type of object returned", obj instanceof FolderObject); assertEquals(pid, obj.getPid()); assertEquals("Etag was not present or didn't match", etag, obj.getEtag()); assertTrue(obj.getResource().hasProperty(RDF.type, Cdr.Folder)); }</code><technical_language>etag is double assigned here, in other tests. easier set constants for test class, etag etagHeader, quotes other without, handle</technical_language>

Target:
public void getContentObjectFolderTest() throws Exception { PID pid = repository.mintContentPid(); mockFcrepoResponse(pid, ETAG_HEADER, Cdr.Folder); mockLoadTypes(Arrays.asList(Cdr.Folder.getURI())); ContentObject obj = repository.getContentObject(pid); assertTrue("Incorrect type of object returned", obj instanceof FolderObject); assertEquals(pid, obj.getPid()); assertEquals("Etag was not present or didn't match", ETAG, obj.getEtag()); assertTrue(obj.getResource().hasProperty(RDF.type, Cdr.Folder)); }
Source:
<code><START> private Map<String, Type> buildBigIntTypeProviderMap(String... variables) <END> { ImmutableMap.Builder<String, Type> builder = ImmutableMap.builder(); Arrays.stream(variables).forEach(variable -> builder.put(variable, BIGINT)); return builder.build(); }</code><technical_language>static</technical_language>

Target:
private static Map<String, Type> buildBigIntTypeProviderMap(String... variables) { ImmutableMap.Builder<String, Type> builder = ImmutableMap.builder(); Arrays.stream(variables).forEach(variable -> builder.put(variable, BIGINT)); return builder.build(); }
Source:
<code>public void setCommand(IDropCommand command) { super.setCommand(command); IHTMLLibraryVersion vName = ((PaletteItemDropCommand)command).getPaletteItem().getCategory().getVersionGroup().getVersion(); for (IonicVersion v: IonicVersion.ALL_VERSIONS) { if(v.equals(vName)) { version = v; } } <START> <END> preferredVersions = new PreferredJSLibVersions(getFile(), getVersion()); preferredVersions.updateLibEnablementAndSelection(); }</code><technical_language>version = (IonicVersion)((PaletteItemDropCommand)command).getPaletteItem().getCategory().getVersionGroup().getVersion(); check for instance of, NewIonicWidgetWizard initialized other version IonicVersion, is error failure. done in NewJQueryWidgetWizard.setCommand</technical_language>

Target:
public void setCommand(IDropCommand command) { super.setCommand(command); version = (IonicVersion)((PaletteItemDropCommand)command).getPaletteItem().getCategory().getVersionGroup().getVersion(); preferredVersions = new PreferredJSLibVersions(getFile(), getVersion()); preferredVersions.updateLibEnablementAndSelection(); }
Source:
<code>public void return_Error_extracted_form_StatusException_metadata() { final Error expectedError = Error.getDefaultInstance(); final Metadata metadata = MetadataConverter.toMetadata(expectedError); <START> final StatusException statusException = Status.INVALID_ARGUMENT.asException(metadata); <END> assertEquals(expectedError, Errors.fromStreamError(statusException) .get()); }</code><technical_language>Please Status.INVALID_ARGUMENT statically imported</technical_language>

Target:
public void return_Error_extracted_form_StatusException_metadata() { final Error expectedError = Error.getDefaultInstance(); final Metadata metadata = MetadataConverter.toMetadata(expectedError); final StatusException statusException = INVALID_ARGUMENT.asException(metadata); assertEquals(expectedError, Errors.fromStreamError(statusException) .get()); }
Source:
<code>public void updateLastEditorEmailOfFeedbackResponseComments(String courseId, String oldEmail, String updatedEmail) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, courseId); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, oldEmail); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, updatedEmail); if (oldEmail.equals(updatedEmail)) { return; } List<FeedbackResponseComment> responseComments = this.getFeedbackResponseCommentEntitiesForLastEditorInCourse(courseId, oldEmail); for (FeedbackResponseComment responseComment : responseComments) { responseComment.setLastEditorEmail(updatedEmail); } <START> log.info(Const.SystemParams.COURSE_BACKUP_LOG_MSG + courseId); <END> getPm().close(); }</code><technical_language>This log useful, log more information courseId</technical_language>

Target:
public void updateLastEditorEmailOfFeedbackResponseComments(String courseId, String oldEmail, String updatedEmail) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, courseId); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, oldEmail); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, updatedEmail); if (oldEmail.equals(updatedEmail)) { return; } List<FeedbackResponseComment> responseComments = this.getFeedbackResponseCommentEntitiesForLastEditorInCourse(courseId, oldEmail); for (FeedbackResponseComment responseComment : responseComments) { responseComment.setLastEditorEmail(updatedEmail); } log.info("updating last editor email from: " + oldEmail + " to: " + updatedEmail + " for feedback response comments in the course: " + courseId); getPm().close(); }
Source:
<code>public void testCollect_testFail() throws IOException, DeviceNotAvailableException, ConfigurationException { OptionSetter options = new OptionSetter(mCollector); options.setOptionValue("per-run", "false"); <START> mCollector.init(mContext, mListener); mCollector.testRunStarted("collect-metrics", 2); mCollector.testStarted(mTest); mCollector.testEnded(mTest, mMetrics); mCollector.testStarted(mTest); mCollector.testFailed(mTest, "Test Failed"); mCollector.testEnded(mTest, mMetrics); mCollector.testRunEnded(0L, mMetrics); <END> for (ITestDevice device : mDevices) { verify(mCollector, times(2)).pushBinaryStatsConfig(eq(device), any(File.class)); verify(mCollector, times(1)).getReportByteStream(eq(device), anyLong()); verify(mCollector, times(1)).removeConfig(eq(device), anyLong()); } }</code><technical_language>Note if test in this order, test pass if remove resetting of mTestFail in onTestEnd()</technical_language>

Target:
public void testCollect_testFail() throws IOException, DeviceNotAvailableException, ConfigurationException { OptionSetter options = new OptionSetter(mCollector); options.setOptionValue("per-run", "false"); mCollector.init(mContext, mListener); mCollector.testRunStarted("collect-metrics", 2); mCollector.testStarted(mTest); mCollector.testFailed(mTest, "Test Failed"); mCollector.testEnded(mTest, mMetrics); mCollector.testStarted(mTest); mCollector.testEnded(mTest, mMetrics); mCollector.testRunEnded(0L, mMetrics); for (ITestDevice device : mDevices) { verify(mCollector, times(2)).pushBinaryStatsConfig(eq(device), any(File.class)); verify(mCollector, times(2)).getReportByteStream(eq(device), anyLong()); verify(mCollector, times(2)).removeConfig(eq(device), anyLong()); assertEquals(1, mCollector.numberOfReportsProcessedOnDevice(device)); } }
Source:
<code>public void visit(Object context, Stack<ExecutionBlockId> stack, ExecutionBlockId currentId) { ExecutionBlock current = plan.getExecBlock(currentId); if (!plan.isTerminal(current)) { if (isFullyBroadcastable(current)) { List<ScanNode> broadcastCandidates = new ArrayList<>(); <START> broadcastCandidates.addAll(current.getBroadcastRelations()); <END> Collections.sort(broadcastCandidates, relSizeComparator); current.removeBroadcastRelation(broadcastCandidates.remove(broadcastCandidates.size()-1)); } } }</code><technical_language>rewritten a single constructor call</technical_language>

Target:
public void visit(Object context, Stack<ExecutionBlockId> stack, ExecutionBlockId currentId) { ExecutionBlock current = plan.getExecBlock(currentId); if (!plan.isTerminal(current)) { if (isFullyBroadcastable(current)) { List<ScanNode> broadcastCandidates = new ArrayList<>(current.getBroadcastRelations()); Collections.sort(broadcastCandidates, relSizeComparator); current.removeBroadcastRelation(broadcastCandidates.remove(broadcastCandidates.size()-1)); } } }
Source:
<code>private void purgeOldMessages() { Calendar deadline = Calendar.getInstance(); deadline.add(Calendar.YEAR, ONE_YEAR_AGO); log.info("Starting scan for Message entries older than: " + deadline.getTime()); MessageDao messageDao = new MessageDao(); List<Key> purgable = new ArrayList<>(); String cursor = ""; do { <START> List<Message> messageList = messageDao.listCreatedBefore(deadline.getTime(), cursor, 1000); <END> if (messageList == null || messageList.size() == 0) break; cursor = MessageDao.getCursor(messageList); for (Message message : messageList) { purgable.add(message.getKey()); } } while (true); log.fine("Deleting " + purgable.size() + " old Message entries"); messageDao.deleteByKeys(purgable); }</code><technical_language>retrieve message keys? if is</technical_language>

Target:
private void purgeOldMessages() { Calendar deadline = Calendar.getInstance(); deadline.add(Calendar.YEAR, ONE_YEAR_AGO); log.info("Starting scan for Message entries older than: " + deadline.getTime()); MessageDao messageDao = new MessageDao(); List<Key> purgable = messageDao.listKeysCreatedBefore(deadline.getTime()); log.fine("Deleting " + purgable.size() + " old Message entries"); messageDao.deleteByKeys(purgable); }
Source:
<code>public int hashCode() { int result = super.hashCode(); result = 31 * result + center.hashCode(); <START> result = 31 * result + new Double(scale.getResolution()).hashCode(); <END> return result; }</code><technical_language>implement hashCode in Scale</technical_language>

Target:
public int hashCode() { int result = super.hashCode(); result = 31 * result + (this.center != null ? this.center.hashCode() : 0); result = 31 * result + (this.scale != null ? this.scale.hashCode() : 0); return result; }
Source:
<code>public Map<String,String> getArgs() { <START> return args; <END> }</code><technical_language>Please add lazy initialization is done in other classes</technical_language>

Target:
public Map<String,String> getArgs() { if (args == null) { args = new HashMap<>(); } return args; }