auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Parser(ProblemReporter problemReporter, boolean optimizeStringLiterals) { this.problemReporter = problemReporter; this.options = problemReporter.options; this.optimizeStringLiterals = optimizeStringLiterals; initializeScanner(); this.parsingJava8Plus = this.options.sourceLevel >= ClassFileConstants.JDK1_8; this.parsingJava9Plus = this.options.sourceLevel >= ClassFileConstants.JDK9; this.parsingJava11Plus = this.options.sourceLevel >= ClassFileConstants.JDK11; <START> this.parsingJava12Plus = this.options.sourceLevel >= ClassFileConstants.JDK12; <END> this.parsingJava13Plus = this.options.sourceLevel >= ClassFileConstants.JDK13; this.astLengthStack = new int[50]; this.expressionLengthStack = new int[30]; this.typeAnnotationLengthStack = new int[30]; this.intStack = new int[50]; this.identifierStack = new char[30][]; this.identifierLengthStack = new int[30]; this.nestedMethod = new int[30]; this.realBlockStack = new int[30]; this.identifierPositionStack = new long[30]; this.variablesCounter = new int[30]; this.javadocParser = createJavadocParser(); }</code><technical_language>This is unnecessary. I history intact bother order</technical_language>

Target:
public Parser(ProblemReporter problemReporter, boolean optimizeStringLiterals) { this.problemReporter = problemReporter; this.options = problemReporter.options; this.optimizeStringLiterals = optimizeStringLiterals; initializeScanner(); this.parsingJava8Plus = this.options.sourceLevel >= ClassFileConstants.JDK1_8; this.parsingJava9Plus = this.options.sourceLevel >= ClassFileConstants.JDK9; this.parsingJava14Plus = this.options.sourceLevel >= ClassFileConstants.JDK14; this.parsingJava11Plus = this.options.sourceLevel >= ClassFileConstants.JDK11; this.astLengthStack = new int[50]; this.patternLengthStack = new int[20]; this.expressionLengthStack = new int[30]; this.typeAnnotationLengthStack = new int[30]; this.intStack = new int[50]; this.identifierStack = new char[30][]; this.identifierLengthStack = new int[30]; this.nestedMethod = new int[30]; this.realBlockStack = new int[30]; this.identifierPositionStack = new long[30]; this.variablesCounter = new int[30]; this.recordNestedMethodLevels = new HashMap<>(); this.javadocParser = createJavadocParser(); }
Source:
<code>private void toFront(float delta) { ComeToFrontAction mComeToFrontAction = new ComeToFrontAction(); mComeToFrontAction.setSprite(sprite); <START> mComeToFrontAction.update(delta); <END> }</code><technical_language>create action, sprite.getActionFactory().createComeToFrontAction(sprite) instead</technical_language>

Target:
private void toFront(float delta) { Action comeToFrontAction = sprite.getActionFactory().createComeToFrontAction(sprite); comeToFrontAction.act(delta); }
Source:
<code>public Optional<String> getOpenArgString() { <START> return Optional.ofNullable(openArg); <END> }</code><technical_language>this</technical_language>

Target:
public String getOpenArgString() { return this.openArg; }
Source:
<code>EWAHCompressedBitmap getBitmap() { Object r = bitmapContainer; if (r instanceof EWAHCompressedBitmap) return (EWAHCompressedBitmap) r; EWAHCompressedBitmap out = ((XorCompressedBitmap) r).bitmap; StoredBitmap sb = this; <START> while ((sb = sb.xorBitmap()) != null) <END> out = out.xor(sb.bitmap()); bitmapContainer = out; return out; }</code><technical_language>is a race condition this corrupt. If thread enters this method sets out = r.bitmap XOR compressed bitmap. This a valid bitmap return caller, type is correct. thread sleep immediately executing while test condition. Another thread enters this method sees bitmapContainer needs expanded. full expansion process stores bitmapContainer = out, full bitmap. thread wakes up. calls this.xorBitmap() returns null 2nd thread set bitmapContainer expanded bitmap. thread breaks loop immediately, overwrites good expanded bitmap XOR version (which is garbage!), returns XOR version caller. PackIndexVE003 is replaced a new instance (e.g. due GC falling out of cache) bitmap corrupt inverted results. attempt a bitmap result in a pack incomplete</technical_language>

Target:
EWAHCompressedBitmap getBitmap() { Object r = bitmapContainer; if (r instanceof EWAHCompressedBitmap) return (EWAHCompressedBitmap) r; XorCompressedBitmap xb = (XorCompressedBitmap) r; EWAHCompressedBitmap out = xb.bitmap; while (true) { r = xb.xorBitmap.bitmapContainer; if (r instanceof EWAHCompressedBitmap) { bitmapContainer = out = out.xor((EWAHCompressedBitmap) r); return out; } xb = (XorCompressedBitmap) r; out = out.xor(xb.bitmap); } }
Source:
<code>static Node getFirstGetterMatchingKey(Node n, String keyName) { <START> Preconditions.checkState(n.isClassMembers()); <END> for (Node keyNode : n.children()) { if (keyNode.isGetterDef() && keyNode.getString().equals(keyName)) { return keyNode; } } return null; }</code><technical_language>For generality, this work object literals too. Tyler a Node.isObjectLiteral() something</technical_language>

Target:
static Node getFirstGetterMatchingKey(Node n, String keyName) { Preconditions.checkState(n.isClassMembers() || n.isObjectLit()); for (Node keyNode : n.children()) { if (keyNode.isGetterDef() && keyNode.getString().equals(keyName)) { return keyNode; } } return null; }
Source:
<code>public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) { SoulNetwork network = NetworkHelper.getSoulNetwork(player); if (!world.isRemote) if (player.isSneaking()) { network.setCurrentEssence(Integer.MAX_VALUE); <START> player.sendMessage(new TextComponentTranslation("commands.bloodmagic.network.fill.success", player.getDisplayName().getFormattedText())); <END> } else { network.setCurrentEssence(NetworkHelper.getMaximumForTier(network.getOrbTier())); player.sendMessage(new TextComponentTranslation("commands.bloodmagic.network.cap.success", player.getDisplayName().getFormattedText())); } return new ActionResult<>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); }</code><technical_language>TextComponentTranslation allows ITextComponents passed it, user's name remain ITextComponent</technical_language>

Target:
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) { SoulNetwork network = NetworkHelper.getSoulNetwork(player); if (!world.isRemote) if (player.isSneaking()) { network.setCurrentEssence(Integer.MAX_VALUE); player.sendMessage(new TextComponentTranslation("commands.bloodmagic.network.fill.success", player.getDisplayName())); } else { network.setCurrentEssence(NetworkHelper.getMaximumForTier(network.getOrbTier())); player.sendMessage(new TextComponentTranslation("commands.bloodmagic.network.cap.success", player.getDisplayName())); } return new ActionResult<>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); }
Source:
<code>private boolean _doCookieLogin(String encryptedId, HttpServletRequest request, HttpServletResponse response) { try { String decryptedId = PublicEncryptionFactory.decryptString(encryptedId); User user = null; if (Validator.isEmailAddress(decryptedId)) user = userAPI.loadByUserByEmail(decryptedId, systemUser, false); else user = userAPI.loadUserById(decryptedId, systemUser, false); try { String userName = (authByEmail) ? user.getEmailAddress() : user.getUserId(); return _doLogin(userName, null, true, request, response, true); } catch (Exception e) { SecurityLogger.logInfo(this.getClass(), "An invalid attempt to login (No user found) from IP: " + request.getRemoteAddr() + " : " + e); return false; } } catch (Exception e) { SecurityLogger.logInfo(this.getClass(), "Auto login failed (No user found) from IP: " + request.getRemoteAddr() + " : " + e); if (useCASLoginFilter) { String decryptedId = PublicEncryptionFactory.decryptString(encryptedId); Logger.info(this.getClass(), "Try to retrieve user from LDAP/CAS with id: " + decryptedId); User newUser = CASAuthUtils.loadUserFromLDAP(decryptedId); if (UtilMethods.isSet(newUser)) { User user = null; try { user = (authByEmail) ? userAPI.loadByUserByEmail(decryptedId, systemUser, false) : userAPI.loadUserById(decryptedId, systemUser, false); String userIdFromCAS = (String) request.getSession(false) .getAttribute("edu.yale.its.tp.cas.client.filter.user"); if (UtilMethods.isSet(userIdFromCAS)) { CASAuthUtils.setUserValuesOnSession(user, request, response, true); } return true; } catch (Exception ex) { return false; } <START> } else <END> Logger.info(this.getClass(), "Unable to retrieve user from LDAP/CAS with id: " + decryptedId); } doLogout(request, response); return false; } }</code><technical_language>![MINOR](<LINK_2> 'Severity: MINOR') Missing curly brace. [![rule](<LINK_1>](<LINK_0></technical_language>

Target:
private boolean _doCookieLogin(String encryptedId, HttpServletRequest request, HttpServletResponse response) { try { String decryptedId = PublicEncryptionFactory.decryptString(encryptedId); User user = null; if (Validator.isEmailAddress(decryptedId)) user = userAPI.loadByUserByEmail(decryptedId, systemUser, false); else user = userAPI.loadUserById(decryptedId, systemUser, false); try { String userName = (authByEmail) ? user.getEmailAddress() : user.getUserId(); return _doLogin(userName, null, true, request, response, true); } catch (Exception e) { SecurityLogger.logInfo(this.getClass(), "An invalid attempt to login (No user found) from IP: " + request.getRemoteAddr() + " : " + e); return false; } } catch (Exception e) { SecurityLogger.logInfo(this.getClass(), "Auto login failed (No user found) from IP: " + request.getRemoteAddr() + " : " + e); doLogout(request, response); return false; } }
Source:
<code>public void lock() { this.delegate.lock(); while (true) { try { while (!doLock()) { Thread.sleep(100); } break; } catch (CannotSerializeTransactionException e) { } <START> catch (TransactionTimedOutException | QueryTimeoutException e) { <END> } catch (InterruptedException e) { } catch (Exception e) { this.delegate.unlock(); rethrowAsLockException(e); } } }</code><technical_language>missed similar fix in lockInterruptibly() tryLock()</technical_language>

Target:
public void lock() { this.delegate.lock(); while (true) { try { while (!doLock()) { Thread.sleep(100); } break; } catch (CannotSerializeTransactionException e) { } catch (TransactionTimedOutException e) { } catch (QueryTimeoutException e) { } catch (InterruptedException e) { } catch (Exception e) { this.delegate.unlock(); rethrowAsLockException(e); } } }
Source:
<code>private List<WebElement> getShadowRoots(final SearchContext host, String sh, final int limit) { if (null == sh) sh = ""; final StringBuilder sb = new StringBuilder(); sb.append("const sh=arguments[1].replace(/\\/{3,}/g,' sb.append("ptn=/(^[^\\/]*)\\/?(.*$)/,es=[],doc=arguments[0],lmt=arguments[2],f1=function(e,s){"); sb.append(" const rt=e.shadowRoot;"); sb.append(" if(rt&&(0>=lmt||lmt>es.length))0==s.length?(es[es.length]=e):f2(rt,s);"); sb.append("},f2=function(rt,s){"); sb.append(" const p1=s.match(ptn),p2=p1[2].match(ptn);"); sb.append(" if(''==p1[1]){"); sb.append(" rt.querySelectorAll(p2[1]).forEach(function(c){f1(c,p2[2])});"); sb.append(" rt.querySelectorAll('*').forEach(function(c){f1(c,s)});"); sb.append(" }else{"); sb.append(" rt.querySelectorAll(p1[1]).forEach(function(c){f1(c,p1[2])});"); sb.append(" }"); sb.append("};"); sb.append("(doc.shadowRoot?f1:f2)(doc,sh);"); sb.append("return es;"); return (List<WebElement>) getJavascriptExecutor(host).executeScript(sb.toString(), host, sh, limit); }</code><technical_language>personally, hard maintain this JS snippet in future</technical_language>

Target:
private List<WebElement> getShadowRoots(final SearchContext host, String sh, final int limit) { if (null == sh) sh = ""; sh = sh.replace(" ArrayList<WebElement> elems = new ArrayList<WebElement>(); ShadowRootFinder.find(host, sh, (elem) ->{ elems.add((WebElement)elem); return 0<limit && limit <= elems.size(); }); System.out.println("elems.size:"+elems.size()); return elems; }
Source:
<code>public static void main(String[] args ) { <START> try <END> { String apiKey = "You GitHub client id"; String apiSecret = "You Git client secret"; OAuthService service = new ServiceBuilder() .provider(GitHubApi.class) .apiKey(apiKey) .apiSecret(apiSecret) .callback("You github's redirect uri") .build(); Scanner in = new Scanner(System.in); System.out.println("Fetching the Authorization URL..."); String authorizationUrl = service.getAuthorizationUrl(null); System.out.println("Got the Authorization URL!"); System.out.println("Now go and authorize Scribe here:"); System.out.println(authorizationUrl); System.out.println("And paste the authorization code here"); System.out.print(">>"); String nextLine = ""; nextLine = in.nextLine(); Verifier verifier = new Verifier(nextLine); System.out.println(); System.out.println("Trading the Request Token for an Access Token..."); Token accessToken = service.getAccessToken(null, verifier); System.out.println("Got the Access Token!"); System.out.println("(if your curious it looks like this: " + accessToken + " )"); System.out.println(); OAuthRequest request = new OAuthRequest(Verb.GET, "<LINK_0>"); service.signRequest(accessToken, request); Response response = request.send(); System.out.println("Got it! Lets see what we found..."); System.out.println(); System.out.println(response.getCode()); System.out.println(response.getBody()); System.out.println(); System.out.println("Thats it man! Go and build something awesome with Scribe! :)"); } catch(Exception ex) { ex.printStackTrace(); } }</code><technical_language>indentation is screwed again. remove try need for this example</technical_language>

Target:
public static void main(String[] args) { String apiKey = "You GitHub client id"; String apiSecret = "You Git client secret"; OAuthService service = new ServiceBuilder().provider(GitHubApi.class) .apiKey(apiKey) .apiSecret(apiSecret) .callback("You github's redirect uri") .build(); Scanner in = new Scanner(System.in); System.out.println("Fetching the Authorization URL..."); String authorizationUrl = service.getAuthorizationUrl(null); System.out.println("Got the Authorization URL!"); System.out.println("Now go and authorize Scribe here:"); System.out.println(authorizationUrl); System.out.println("And paste the authorization code here"); System.out.print(">>"); String nextLine = ""; nextLine = in.nextLine(); Verifier verifier = new Verifier(nextLine); System.out.println(); System.out.println("Trading the Request Token for an Access Token..."); Token accessToken = service.getAccessToken(null, verifier); System.out.println("Got the Access Token!"); System.out.println("(if your curious it looks like this: "+ accessToken + " )"); System.out.println(); OAuthRequest request = new OAuthRequest(Verb.GET, "<LINK_0>"); service.signRequest(accessToken, request); Response response = request.send(); System.out.println("Got it! Lets see what we found..."); System.out.println(); System.out.println(response.getCode()); System.out.println(response.getBody()); System.out.println(); System.out.println("Thats it man! Go and build something awesome with Scribe! :)"); }
Source:
<code>protected void onDestroy() { SyncthingService mSyncthingService = getService(); if (mSyncthingService != null) { <START> mSyncthingService.registeronServiceStateChangeListener(this); <END> } mWebView.destroy(); mWebView = null; super.onDestroy(); }</code><technical_language>do register onDestroy</technical_language>

Target:
protected void onDestroy() { SyncthingService mSyncthingService = getService(); if (mSyncthingService != null) { mSyncthingService.unregisterOnServiceStateChangeListener(this); } mWebView.destroy(); mWebView = null; super.onDestroy(); }
Source:
<code>private void encodeAltSequences(final Collection<String> alternativeSequences) { <START> <END> List<String> orderedAltSeqs = new ArrayList<>(alternativeSequences); orderedAltSeqs.sort(String::compareTo); setAttribute(ALTERNATIVE_SEQUENCE_NAME_TAG, StringUtil.join(ALTERNATIVE_SEQUENCE_NAME_SEPARATOR, orderedAltSeqs)); }</code><technical_language>I save a bunch of code/ potential error paths if error checking / deduplication is done here. like: encoded == alternativeSequences.isEmpty() ? null : alternativeSequences.stream() .sorted() .distinct() .peek(SAMSequenceRecord::validateAltRegExp) .collect(Collectors.joining(ALTERNATIVE_SEQUENCE_NAME_SEPARATOR));</technical_language>

Target:
private void encodeAltSequences(final Collection<String> alternativeSequences) { setAttribute(ALTERNATIVE_SEQUENCE_NAME_TAG, alternativeSequences.isEmpty() ? null : alternativeSequences.stream() .sorted() .distinct() .peek(SAMSequenceRecord::validateAltRegExp) .collect(Collectors.joining(ALTERNATIVE_SEQUENCE_NAME_SEPARATOR))); }
Source:
<code>private void dismissPreparingDialog() { <START> PrepareDialogFragment fragment = (PrepareDialogFragment) getSupportFragmentManager().findFragmentByTag(getString(R.string.preparedialog)); <END> if (fragment != null && fragment.isAdded()) { fragment.dismiss(); } }</code><technical_language>here, in constant class</technical_language>

Target:
private void dismissPreparingDialog() { PrepareDialogFragment fragment = (PrepareDialogFragment) getSupportFragmentManager().findFragmentByTag("prepare_dialog"); if (fragment != null && fragment.isAdded()) { fragment.dismiss(); } }
Source:
<code>public Object getValue(int index) throws IndexOutOfBoundsException { final List<SelectItem> scalarFunctionSelectItems = _scalarFunctionDataSet .getScalarFunctionSelectItemsToEvaluate(); final int scalarFunctionCount = scalarFunctionSelectItems.size(); if (index >= scalarFunctionCount) { return _row.getValue(index - scalarFunctionCount); } final SelectItem selectItem = scalarFunctionSelectItems.get(index); <START> if (selectItem.getScalarFunction().equals(FunctionType.CONCAT)) { <END> Object[] parameters = selectItem.getFunctionParameters(); StringBuilder strBuilder = new StringBuilder(); for (Object parameter: parameters) { if (parameter instanceof String) { strBuilder.append(parameter); } else { SelectItem[] items = ((DefaultRow) _row).getHeader().getSelectItems(); String parameterName = ((Column) parameter).getName(); int i = 0; boolean found = false; while (i < items.length && !found) { String columnName = items[i].getColumn().getName(); if (parameterName.equals(columnName)) { strBuilder.append(_row.getValue(i)); found = true; } i++; } } } return strBuilder.toString(); } else { final SelectItem selectItemWithoutFunction = selectItem.replaceFunction(null); return selectItem.getScalarFunction().evaluate(_row, selectItem.getFunctionParameters(), selectItemWithoutFunction); } }</code><technical_language>Another "if concat" ... I prefer get rid of a function pluggable require code changes in "framework" if will</technical_language>

Target:
public Object getValue(int index) throws IndexOutOfBoundsException { final List<SelectItem> scalarFunctionSelectItems = _scalarFunctionDataSet .getScalarFunctionSelectItemsToEvaluate(); final int scalarFunctionCount = scalarFunctionSelectItems.size(); if (index >= scalarFunctionCount) { return _row.getValue(index - scalarFunctionCount); } final SelectItem selectItem = scalarFunctionSelectItems.get(index); final SelectItem selectItemWithoutFunction = selectItem.replaceFunction(null); return selectItem.getScalarFunction().evaluate(_row, selectItem.getFunctionParameters(), selectItemWithoutFunction); }
Source:
<code>protected IStructuredSelection getSelection() { ISelection selection; IHandlerService hsr = (IHandlerService) PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getService(IHandlerService.class); <START> IEvaluationContext ctx = hsr.createContextSnapshot(true); <END> selection = (ISelection) ctx .getVariable(ISources.ACTIVE_MENU_SELECTION_NAME); if (selection instanceof IStructuredSelection) return (IStructuredSelection) selection; return new StructuredSelection(); }</code><technical_language>do need a snapshot of world? getCurrentState() get selection</technical_language>

Target:
protected IStructuredSelection getSelection() { ISelection selection; IHandlerService hsr = (IHandlerService) PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getService(IHandlerService.class); IEvaluationContext ctx = hsr.getCurrentState(); selection = (ISelection) ctx .getVariable(ISources.ACTIVE_MENU_SELECTION_NAME); if (selection instanceof IStructuredSelection) return (IStructuredSelection) selection; return new StructuredSelection(); }
Source:
<code>private boolean plugNic() { PlugUnplugVmNicParameters plugParameters = createPlugUnPlugParameters(); VdcReturnValueBase plugVmNicReturnValue = Backend.getInstance().runInternalAction(VdcActionType.PlugUnplugVmNic, plugParameters, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (!plugVmNicReturnValue.getSucceeded()) { getReturnValue().getExecuteFailedMessages().add("Failed hot-plugging nic to VM"); getReturnValue().getCanDoActionMessages().addAll(plugVmNicReturnValue.getCanDoActionMessages()); <START> getReturnValue().getCanDoActionMessages().remove(VdcBllMessages.VAR__ACTION__ADD.toString()); <END> getReturnValue().setCanDoAction(false); } return plugVmNicReturnValue.getSucceeded(); }</code><technical_language>name() in other places, toString overridden</technical_language>

Target:
private boolean plugNic() { PlugUnplugVmNicParameters plugParameters = createPlugUnPlugParameters(); VdcReturnValueBase plugVmNicReturnValue = Backend.getInstance().runInternalAction(VdcActionType.PlugUnplugVmNic, plugParameters, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (!plugVmNicReturnValue.getSucceeded()) { getReturnValue().getExecuteFailedMessages().add("Failed hot-plugging nic to VM"); getReturnValue().getCanDoActionMessages().addAll(plugVmNicReturnValue.getCanDoActionMessages()); getReturnValue().getCanDoActionMessages().remove(VdcBllMessages.VAR__ACTION__ADD.name()); getReturnValue().setCanDoAction(false); } return plugVmNicReturnValue.getSucceeded(); }
Source:
<code>public void after() { <START> LRALogger.logger.debugf("Finised test %s", testName); <END> lraClient.close(); }</code><technical_language>suggestion LRALogger.logger.debugf("Finished test %s", testName);</technical_language>

Target:
public void after() { LRALogger.logger.debugf("Finished test %s", testName); lraClient.close(); }
Source:
<code>private void updateObjectProperties(ObjectVersionReference version, FedoraObject object, QuadAcc triplesToRemove, QuadDataAcc triplesToInsert) { if (version.isLastVersion()) { for (ObjectProperty p : version.getObjectProperties().listProperties()) { String pred = p.getName(); String obj = p.getValue(); if (pred.equals("info:fedora/fedora-system:def/model#createdDate")) { <START> pred = "<LINK_4>"; <END> } else if (pred.equals("info:fedora/fedora-system:def/model#state")) { pred = "<LINK_0>"; } else if (pred.equals("info:fedora/fedora-system:def/view#lastModifiedDate")) { pred = "<LINK_2>"; updateTriple(triplesToRemove, triplesToInsert, "<LINK_1>", "migration"); } if (isDateProperty(p.getName())) { updateDateTriple(triplesToRemove, triplesToInsert, pred, obj); } else { updateTriple(triplesToRemove, triplesToInsert, pred, obj); } } } if (!triplesToInsert.getQuads().isEmpty() && !triplesToRemove.getQuads().isEmpty()) { updateResourceProperties(object, triplesToRemove, triplesToInsert); } }</code><technical_language>ultimately configurable, step mapping encapsulated in a data structure single method</technical_language>

Target:
protected void updateObjectProperties(ObjectVersionReference version, FedoraObject object, QuadAcc triplesToRemove, QuadDataAcc triplesToInsert) { if (version.isFirstVersion()) { String now = getCurrentTimeInXSDDateTime(); if (now != null) { addDateEvent(triplesToInsert, "<LINK_3>", getCurrentTimeInXSDDateTime()); } } if (version.isLastVersion()) { for (ObjectProperty p : version.getObjectProperties().listProperties()) { mapObjectProperty(p, triplesToRemove, triplesToInsert); } } if (!triplesToInsert.getQuads().isEmpty() && !triplesToRemove.getQuads().isEmpty()) { updateResourceProperties(object, triplesToRemove, triplesToInsert); } }
Source:
<code>public void layoutIfNecessary() { if (dirtySize != null && control != null && control instanceof Composite) { if (control.getSize().equals(dirtySize)) { <START> ((Composite) control).layout(); <END> flushChildren = false; } } dirtySize = null; }</code><technical_language>this change do</technical_language>

Target:
public void layoutIfNecessary() { if (dirtySize != null && control != null && control instanceof Composite) { if (control.getSize().equals(dirtySize)) { ((Composite)control).layout(flushChildren); flushChildren = false; } } dirtySize = null; }
Source:
<code>protected Observable<HealthStatusUpdate<EurekaHealthStatusAggregator>> connect() { Observable<HealthStatusUpdate<EurekaHealthStatusAggregator>> updateObservable = registry.healthStatusProviders() .flatMap(new Func1<List<HealthStatusProvider<?>>, Observable<Status>>() { @Override public Observable<Status> call(List<HealthStatusProvider<?>> healthStatusProviders) { List<Observable<HealthStatusUpdate<?>>> healthObservables = new ArrayList<>(healthStatusProviders.size()); for (final HealthStatusProvider provider : healthStatusProviders) { Observable<HealthStatusUpdate<?>> updateObservable = provider.healthStatus(); healthObservables.add(updateObservable); } return Observable.combineLatest(healthObservables, new FuncN<Status>() { @Override public Status call(Object... updates) { Status aggregate = Status.UP; for (Object update : updates) { Status next = ((HealthStatusUpdate<?>) update).getStatus(); if (STATUS_PRIORITY_MAP.get(next) < STATUS_PRIORITY_MAP.get(aggregate)) { aggregate = next; } } return aggregate; } }); } }) <START> .distinct() <END> .map(new Func1<Status, HealthStatusUpdate<EurekaHealthStatusAggregator>>() { @Override public HealthStatusUpdate<EurekaHealthStatusAggregator> call(Status status) { return new HealthStatusUpdate<EurekaHealthStatusAggregator>(status, DESCRIPTOR); } }); BehaviorSubject<HealthStatusUpdate<EurekaHealthStatusAggregator>> subject = BehaviorSubject.create(); updateObservable.subscribe(subject); return subject; }</code><technical_language>Do want distinct distinctUntilChanged</technical_language>

Target:
protected Observable<HealthStatusUpdate<EurekaHealthStatusAggregator>> connect() { Observable<HealthStatusUpdate<EurekaHealthStatusAggregator>> updateObservable = registry.healthStatusProviders() .flatMap(new Func1<List<HealthStatusProvider<?>>, Observable<Status>>() { @Override public Observable<Status> call(List<HealthStatusProvider<?>> healthStatusProviders) { List<Observable<HealthStatusUpdate<?>>> healthObservables = new ArrayList<>(healthStatusProviders.size()); for (final HealthStatusProvider provider : healthStatusProviders) { Observable<HealthStatusUpdate<?>> updateObservable = provider.healthStatus(); healthObservables.add(updateObservable); } return Observable.combineLatest(healthObservables, new FuncN<Status>() { @Override public Status call(Object... updates) { Status aggregate = Status.UP; for (Object update : updates) { Status next = ((HealthStatusUpdate<?>) update).getStatus(); if (STATUS_PRIORITY_MAP.get(next) < STATUS_PRIORITY_MAP.get(aggregate)) { aggregate = next; } } return aggregate; } }); } }) .distinctUntilChanged() .map(new Func1<Status, HealthStatusUpdate<EurekaHealthStatusAggregator>>() { @Override public HealthStatusUpdate<EurekaHealthStatusAggregator> call(Status status) { return new HealthStatusUpdate<EurekaHealthStatusAggregator>(status, DESCRIPTOR); } }); BehaviorSubject<HealthStatusUpdate<EurekaHealthStatusAggregator>> subject = BehaviorSubject.create(); updateObservable.subscribe(subject); return subject; }
Source:
<code>public static SimpleTableDef[] detectSchema(Client client) { List<String> indexNames = new ArrayList<>(); ClusterStateResponse clusterStateResponse = client.admin().cluster().prepareState().execute().actionGet(); ImmutableOpenMap<String,IndexMetaData> indexes = clusterStateResponse.getState().getMetaData().getIndices(); for (ObjectCursor<String> typeCursor : indexes.keys()) indexNames.add(typeCursor.value); List<SimpleTableDef> result = new ArrayList<>(); for (String indexName : indexNames) { ClusterState cs = client.admin().cluster().prepareState().setIndices(indexName).execute().actionGet().getState(); IndexMetaData imd = cs.getMetaData().index(indexName); ImmutableOpenMap<String, MappingMetaData> mappings = imd.getMappings(); ObjectLookupContainer types = mappings.keys(); for (Object type: types) { String typeName = ((ObjectCursor) type).value.toString(); typeAndIndexes.put(typeName, indexName); try { SimpleTableDef table = detectTable(client, indexName, typeName); result.add(table); <START> } catch(Exception e) <END> } } SimpleTableDef[] tableDefArray = (SimpleTableDef[]) result.toArray(new SimpleTableDef[result.size()]); return tableDefArray; }</code><technical_language>Swallowing exception here. log it</technical_language>

Target:
public static SimpleTableDef[] detectSchema(Client client) { List<String> indexNames = new ArrayList(); ClusterStateResponse clusterStateResponse = client.admin().cluster().prepareState().execute().actionGet(); ImmutableOpenMap<String,IndexMetaData> indexes = clusterStateResponse.getState().getMetaData().getIndices(); for (ObjectCursor<String> typeCursor : indexes.keys()) indexNames.add(typeCursor.value); List<SimpleTableDef> result = new ArrayList(); for (String indexName : indexNames) { ClusterState cs = client.admin().cluster().prepareState().setIndices(indexName).execute().actionGet().getState(); IndexMetaData imd = cs.getMetaData().index(indexName); ImmutableOpenMap<String, MappingMetaData> mappings = imd.getMappings(); ObjectLookupContainer indexTypes = mappings.keys(); for (Object indexType: indexTypes) { String typeName = ((ObjectCursor) indexType).value.toString(); try { SimpleTableDef table = detectTable(cs, indexName, typeName); result.add(table); } catch(Exception e) { logger.error("Unexpected error during detectSchema for table: "+typeName, e); } } } SimpleTableDef[] tableDefArray = (SimpleTableDef[]) result.toArray(new SimpleTableDef[result.size()]); return tableDefArray; }
Source:
<code>public void testJoinerConfigWithoutRequiredInputs() { Schema outputSchema = Schema.recordOf( "joined", Schema.Field.of("film_id", Schema.of(Schema.Type.STRING)), Schema.Field.of("film_name", Schema.of(Schema.Type.STRING)), Schema.Field.of("renamed_actor", Schema.nullableOf(Schema.of(Schema.Type.STRING))), Schema.Field.of("renamed_category", Schema.nullableOf(Schema.of(Schema.Type.STRING)))); Map<String, Map<String, String>> selectedFields = new HashMap<>(); selectedFields.put("film", com.google.common.collect.ImmutableMap.of("film_id", "film_id", "film_name", "film_name")); selectedFields.put("filmActor", com.google.common.collect.ImmutableMap.of("actor_name", "renamed_actor")); selectedFields.put("filmCategory", com.google.common.collect.ImmutableMap.of("category_name", "renamed_category")); JoinerConfig config = new JoinerConfig("film.film_id=filmActor.film_id=filmCategory.film_id&" + "film.film_name=filmActor.film_name=filmCategory.film_name", GSON.toJson(selectedFields), "film"); MockPipelineConfigurer pipelineConfigurer = new MockPipelineConfigurer( <START> ImmutableMap.<String, Schema>of("film", filmSchema, "filmActor", filmActorSchema, <END> "filmCategory", filmCategorySchema)); Joiner joiner = new Joiner(config); joiner.configurePipeline(pipelineConfigurer); Assert.assertEquals(outputSchema, pipelineConfigurer.getOutputSchema()); }</code><technical_language>String, Schema implicit? (Diamond syntax)</technical_language>

Target:
public void testJoinerConfigWithoutRequiredInputs() { Schema outputSchema = Schema.recordOf( "joined", Schema.Field.of("film_id", Schema.of(Schema.Type.STRING)), Schema.Field.of("film_name", Schema.of(Schema.Type.STRING)), Schema.Field.of("renamed_actor", Schema.nullableOf(Schema.of(Schema.Type.STRING))), Schema.Field.of("renamed_category", Schema.nullableOf(Schema.of(Schema.Type.STRING)))); JoinerConfig config = new JoinerConfig("film.film_id=filmActor.film_id=filmCategory.film_id&" + "film.film_name=filmActor.film_name=filmCategory.film_name", selectedFields, "film"); MockPipelineConfigurer pipelineConfigurer = new MockPipelineConfigurer( ImmutableMap.of("film", filmSchema, "filmActor", filmActorSchema, "filmCategory", filmCategorySchema)); Joiner joiner = new Joiner(config); joiner.configurePipeline(pipelineConfigurer); Assert.assertEquals(outputSchema, pipelineConfigurer.getOutputSchema()); }
Source:
<code>private LookupRef lowestIdFromPrecedentSource( Set<LookupRef> selectedEquivs, Application application ) { LookupRef lowestId = null; <START> for (LookupRef lookupRef : Iterables.filter(selectedEquivs, fromSource(application.getConfiguration().getEnabledReadSources().asList().get(0)))) { <END> lowestId = nullSafeRefById.min(lowestId, lookupRef); } return lowestId; }</code><technical_language>getEnabledReadSources() give sources in precedence order. a set. making guarantees of ordering. If need precedent need sort set .getReadPrecedenceOrdering() get</technical_language>

Target:
private LookupRef lowestIdFromPrecedentSource( Set<LookupRef> selectedEquivs, Application application ) { LookupRef lowestId = null; Publisher publisher = application.getConfiguration() .getReadPrecedenceOrdering() .sortedCopy(application.getConfiguration().getEnabledReadSources()) .get(0); Iterable<LookupRef> lookupRefs = selectedEquivs.stream() .filter(fromSource(publisher)::apply) .collect(Collectors.toList()); for (LookupRef lookupRef : lookupRefs) { lowestId = nullSafeRefById.min(lowestId, lookupRef); } return lowestId; }
Source:
<code>public void acceptAST(ICompilationUnit source, CompilationUnit ast) { String cuKey; IJavaElement parent = source.getParent(); if (parent == null) cuKey = source.getElementName(); else cuKey = String.format("%s/%s", parent.getElementName().replace('.', '/'), source.getElementName()); context.getUnprocessed().remove(cuKey); ProjectState state = context.getState(); <START> HashMap<String, String> dsKeys = new HashMap<String, String>(); <END> HashSet<DSAnnotationProblem> problems = new HashSet<DSAnnotationProblem>(); ast.accept(new AnnotationVisitor(this, state, dsKeys, problems)); Collection<String> oldDSKeys = state.updateMappings(cuKey, dsKeys); if (oldDSKeys != null) { oldDSKeys.removeAll(dsKeys.values()); context.getAbandoned().addAll(oldDSKeys); } if (!problems.isEmpty()) { char[] filename = source.getResource().getFullPath().toString().toCharArray(); for (DSAnnotationProblem problem : problems) { problem.setOriginatingFileName(filename); if (problem.getSourceStart() >= 0) problem.setSourceLineNumber(ast.getLineNumber(problem.getSourceStart())); } BuildContext buildContext = fileMap.get(source); if (buildContext != null) buildContext.recordNewProblems(problems.toArray(new CategorizedProblem[problems.size()])); } }</code><technical_language>I suggest remove this redundant type declaration. set in project properties this error in Java Compiler -> Errors/Warnings -> Enable project specific settings Redundant type arguments</technical_language>

Target:
public void acceptAST(ICompilationUnit source, CompilationUnit ast) { String cuKey; IJavaElement parent = source.getParent(); if (parent == null) cuKey = source.getElementName(); else cuKey = String.format("%s/%s", parent.getElementName().replace('.', '/'), source.getElementName()); context.getUnprocessed().remove(cuKey); ProjectState state = context.getState(); HashMap<String, String> dsKeys = new HashMap<>(); HashSet<DSAnnotationProblem> problems = new HashSet<>(); ast.accept(new AnnotationVisitor(this, state, dsKeys, problems)); Collection<String> oldDSKeys = state.updateMappings(cuKey, dsKeys); if (oldDSKeys != null) { oldDSKeys.removeAll(dsKeys.values()); context.getAbandoned().addAll(oldDSKeys); } if (!problems.isEmpty()) { char[] filename = source.getResource().getFullPath().toString().toCharArray(); for (DSAnnotationProblem problem : problems) { problem.setOriginatingFileName(filename); if (problem.getSourceStart() >= 0) problem.setSourceLineNumber(ast.getLineNumber(problem.getSourceStart())); } BuildContext buildContext = fileMap.get(source); if (buildContext != null) buildContext.recordNewProblems(problems.toArray(new CategorizedProblem[problems.size()])); } }
Source:
<code>public OutputColumns getOutputColumns() { <START> return new OutputColumns(String.class, baseColumn.getName() + " (subtracted)"); <END> }</code><technical_language>updating this: "column name (substring removed)"</technical_language>

Target:
public OutputColumns getOutputColumns() { return new OutputColumns(String.class, baseColumn.getName() + " (substring removed)"); }
Source:
<code>public void GIICompletesSuccessfullyWhenRunningDuringClearWithThirdDatastore() { initDataStores(NUM_SERVERS + 1); configureServers(regionShortcut); verifyRegionSizes(DATA_SIZE); <START> dataStores[1].invoke(new SerializableRunnable() { <END> @Override public void run() { PauseDuringGIICallback myAfterReceivedImageReply = new PauseDuringGIICallback( InitialImageOperation.GIITestHookType.AfterReceivedRequestImage, "_B__testPR_9"); InitialImageOperation.setGIITestHook(myAfterReceivedImageReply); } }); cluster.stop(2); createDelta(50); restartServerOnVM(2); AsyncInvocation async = createRegionAsync(dataStores[1]); invokeClear(dataStores[0]); dataStores[1].invoke(() -> InitialImageOperation.resetGIITestHook( InitialImageOperation.GIITestHookType.AfterReceivedRequestImage, true)); try { async.getResult(30000); } catch (InterruptedException ex) { Assert.fail("Async create interupted" + ex.getMessage()); } verifyRegionSizes(0); }</code><technical_language>lamda</technical_language>

Target:
public void GIICompletesSuccessfullyWhenRunningDuringClearWithThirdDatastore() { startServers(NUM_SERVERS + 1); verifyRegionSizes(DATA_SIZE); serverVMs[1].invoke(() -> { PauseDuringGIICallback myAfterReceivedImageReply = new PauseDuringGIICallback( InitialImageOperation.GIITestHookType.AfterReceivedRequestImage, "_B__testPR_9"); InitialImageOperation.setGIITestHook(myAfterReceivedImageReply); }); cluster.stop(2); createDelta(50); restartServerOnVM(2); AsyncInvocation async = createRegionAsync(serverVMs[1]); invokeClear(serverVMs[0]); serverVMs[1].invoke(() -> InitialImageOperation.resetGIITestHook( InitialImageOperation.GIITestHookType.AfterReceivedRequestImage, true)); try { async.getResult(30000); } catch (InterruptedException ex) { Assert.fail("Async create interupted" + ex.getMessage()); } verifyRegionSizes(0); }
Source:
<code>private static void downloadAndExtractArtifacts(List<URLChecksumEntity> artifactDetails) { LOGGER.fine("Current Platform: " + Platform.getCurrent()); for (Iterator<URLChecksumEntity> iterator = artifactDetails.iterator(); iterator.hasNext();) { URLChecksumEntity entity = (URLChecksumEntity) iterator.next(); String url = entity.getUrl().getValue(); String checksum = entity.getChecksum().getValue(); StringBuilder msg = new StringBuilder(); msg.append("Downloading from URL: ").append(url).append("..."); msg.append("[").append(checksum).append("] will be used for checksum validation."); LOGGER.fine(msg.toString()); String result; while ((result = downloadFile(url, checksum)) == null) { LOGGER.warning("Error downloading the file " + url + ". Retrying...."); } files.add(result); if(result.endsWith(".msi")){ String extractedExeFile = FileExtractor.extractMsi(result); files.add(extractedExeFile); } <START> if (!result.endsWith(".jar") && !result.endsWith(".msi") ) { <END> List<String> extractedFileList = FileExtractor.extractArchive(result); files.addAll(extractedFileList); } } LOGGER.fine("Files after download and extract: " + files.toString()); }</code><technical_language>"else if" cleaner here..</technical_language>

Target:
private static void downloadAndExtractArtifacts(List<URLChecksumEntity> artifactDetails) { LOGGER.fine("Current Platform: " + Platform.getCurrent()); for (Iterator<URLChecksumEntity> iterator = artifactDetails.iterator(); iterator.hasNext();) { URLChecksumEntity entity = (URLChecksumEntity) iterator.next(); String url = entity.getUrl().getValue(); String checksum = entity.getChecksum().getValue(); StringBuilder msg = new StringBuilder(); msg.append("Downloading from URL: ").append(url).append("..."); msg.append("[").append(checksum).append("] will be used for checksum validation."); LOGGER.fine(msg.toString()); String result; while ((result = downloadFile(url, checksum)) == null) { LOGGER.warning("Error downloading the file " + url + ". Retrying...."); } files.add(result); if (result.endsWith(".msi")) { String extractedExeFile = FileExtractor.extractMsi(result); files.add(extractedExeFile); } else if (!result.endsWith(".jar") && !result.endsWith(".msi")) { List<String> extractedFileList = FileExtractor.extractArchive(result); files.addAll(extractedFileList); } } LOGGER.fine("Files after download and extract: " + files.toString()); }
Source:
<code>public T getAckCheckpoint() { <START> if (Objects.equals(_currentCheckpoint, _inFlight.peek())) { <END> return _prevCheckpoint; } return _currentCheckpoint; }</code><technical_language>assumption added, checkpoint unique, this condition false. remove it</technical_language>

Target:
public T getAckCheckpoint() { return _currentCheckpoint; }
Source:
<code>public InvertingProxy awaitReadyInvertingProxyForAccount(String requestId, String accountId) { return getRetryTemplate().execute( retryContext -> { LOGGER.debug("Retrieving InvertingProxy Config for accountId '{}'", accountId); <START> return Optional.ofNullable(grpcCcmV2Client.getOrCreateInvertingProxy(requestId, accountId, ThreadBasedUserCrnProvider.getUserCrn())) .filter(invertingProxy -> InvertingProxy.Status.READY.equals(invertingProxy.getStatus())) <END> .orElseThrow(() -> new RuntimeException(String.format("InvertingProxy not found in ready state for accountId '%s'", accountId))); }, retryExhausted -> { LOGGER.error("Error retrieving InvertingProxy for accountId '{}', retryCount '{}'", accountId, retryExhausted.getRetryCount()); throw new RuntimeException("Error Retrieving CCM InvertingProxy Config", retryExhausted.getLastThrowable()); }); }</code><technical_language>while this is a compact form I prefer if split this multiple lines log of grpcCcmV2Client.getOrCreateInvertingProxy. This able if is null state is wrong</technical_language>

Target:
public InvertingProxy awaitReadyInvertingProxyForAccount(String requestId, String accountId) { return getRetryTemplate().execute( retryContext -> { LOGGER.debug("Retrieving InvertingProxy for accountId '{}'", accountId); InvertingProxy invertingProxy = grpcCcmV2Client.getOrCreateInvertingProxy(requestId, accountId, ThreadBasedUserCrnProvider.getUserCrn()); LOGGER.debug("Retrieved InvertingProxy with status '{}' for accountId '{}'", invertingProxy.getStatus(), accountId); if (!InvertingProxy.Status.READY.equals(invertingProxy.getStatus())) { throw new CcmV2Exception(String.format("InvertingProxy is not available in 'READY' state for accountId '%s'", accountId)); } return invertingProxy; }, retryExhausted -> { LOGGER.error("Error Retrieving InvertingProxy for accountId '{}', retryCount '{}'", accountId, retryExhausted.getRetryCount()); throw new CcmV2Exception("Error Retrieving CCM InvertingProxy", retryExhausted.getLastThrowable()); }); }
Source:
<code>protected ListGroups(final GroupCache groupCache, final GroupControl.Factory groupControlFactory, final GroupControl.GenericFactory genericGroupControlFactory, final Provider<IdentifiedUser> identifiedUser, final IdentifiedUser.GenericFactory userFactory, final Provider<GetGroups> accountGetGroups, GroupJson json) { this.groupCache = groupCache; this.groupControlFactory = groupControlFactory; this.genericGroupControlFactory = genericGroupControlFactory; this.identifiedUser = identifiedUser; this.userFactory = userFactory; <START> this.accountGetGroups = accountGetGroups; <END> this.json = json; }</code><technical_language>If want o option in query string work need setup @Option() annotation parsed passed GroupJson</technical_language>

Target:
protected ListGroups(final GroupCache groupCache, final GroupControl.Factory groupControlFactory, final GroupControl.GenericFactory genericGroupControlFactory, final Provider<IdentifiedUser> identifiedUser, final IdentifiedUser.GenericFactory userFactory, final Provider<GetGroups> accountGetGroups, GroupJson json) { this.groupCache = groupCache; this.groupControlFactory = groupControlFactory; this.genericGroupControlFactory = genericGroupControlFactory; this.identifiedUser = identifiedUser; this.userFactory = userFactory; this.accountGetGroups = accountGetGroups; this.json = json; this.options = EnumSet.noneOf(ListGroupsOption.class); }
Source:
<code>public BigtableInstanceName(String projectId, String instanceId) { Preconditions.checkArgument(!Strings.isNullOrEmpty(projectId), "projectId must be supplied"); <START> Preconditions.checkArgument(!Strings.isNullOrEmpty(instanceId), "instnaceId must be supplied"); <END> this.InstanceName = String.format(BIGTABLE_V1_INSTANCE_FMT, instanceId); }</code><technical_language>instnaceId -> instanceId</technical_language>

Target:
public BigtableInstanceName(String projectId, String instanceId) { Preconditions.checkArgument(!Strings.isNullOrEmpty(projectId), "projectId must be supplied"); Preconditions.checkArgument(!Strings.isNullOrEmpty(instanceId), "instanceId must be supplied"); this.instanceName = String.format(BIGTABLE_V2_INSTANCE_FMT, instanceId); }
Source:
<code>private void addContent(ProductDTO product, ContentDTO update) { if (update == null || update.getId() == null) { throw new IllegalArgumentException("update references incomplete content"); } <START> Set<ProductContentDTO> productContent = product.getProductContent(); <END> ProductContentDTO oldContent = findContent(productContent, update.getId()); ProductContentDTO content = new ProductContentDTO(); content.setContent(update); boolean enabled = oldContent != null && oldContent.getEnabled(); content.setEnabled(enabled); if (oldContent != null) { productContent.remove(oldContent); } productContent.add(content); }</code><technical_language>violating encapsulation principles here. want modify collection assume retained. building content throwing a new collection DTO, figuring out a return addContent method OpenAPI DTOs</technical_language>

Target:
private void addContent(ProductDTO product, ContentDTO update) { if (product == null) { throw new IllegalArgumentException("Cannot add content to null product"); } if (update == null || update.getId() == null) { throw new IllegalArgumentException("update references incomplete content"); } Set<ProductContentDTO> productContent; if (product.getProductContent() == null) { productContent = new HashSet<>(); } else { productContent = new HashSet<>(product.getProductContent()); } ProductContentDTO oldContent = findContent(productContent, update.getId()); ProductContentDTO content = new ProductContentDTO(); content.setContent(update); boolean enabled = oldContent != null && oldContent.getEnabled(); content.setEnabled(enabled); if (oldContent != null) { productContent.remove(oldContent); } productContent.add(content); product.setProductContent(productContent); }
Source:
<code>public MemcachedClient createMemcachedClient() throws IOException { try { log.info("Starting an instance of memcache client towards elasticache cluster"); return new MemcachedClient(new InetSocketAddress(hostname, port)); } catch (IOException e) { log.error("Could not initilise connection to elasticache cluster", e); <START> e.printStackTrace(); <END> return null; } }</code><technical_language>I suggest removing this line, logging is covered previous one</technical_language>

Target:
public MemcachedClient createMemcachedClient() throws IOException { try { log.info("Starting an instance of memcache client towards elasticache cluster"); return new MemcachedClient(new InetSocketAddress(hostname, port)); } catch (IOException e) { log.error("Could not initilise connection to elasticache cluster", e); return null; } }
Source:
<code><START> public static QueryBy of(String value) <END> { if (value != null) { return QueryBy.valueOf(value.toUpperCase()); } else { return null; } }</code><technical_language>needed check null, of QueryBy.valueOf internal check if item is of enum items, exception thrown, changed like: @JsonCreator public static QueryBy of(String value) { return QueryBy.valueOf(value.toUpperCase()); }</technical_language>

Target:
public static QueryBy of(String value) { return QueryBy.valueOf(value.toUpperCase()); }