auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void setDenyRootedJailBroken(Boolean newValue) throws Throwable { if (sourceImmutablePolicy == null) { <START> throw new Throwable("Source Policy is null cannot set deny rooted jailbroken"); <END> } if (sourceImmutablePolicy instanceof MethodAmountPolicy) { sourceImmutablePolicy = new MethodAmountPolicy(newValue, sourceImmutablePolicy.getDenyEmulatorSimulator(), sourceImmutablePolicy.getFences(), ((MethodAmountPolicy) sourceImmutablePolicy).getAmount()); } else if (sourceImmutablePolicy instanceof FactorsPolicy) { FactorsPolicy factorsPolicy = (FactorsPolicy) sourceImmutablePolicy; sourceImmutablePolicy = new FactorsPolicy(newValue, sourceImmutablePolicy.getDenyEmulatorSimulator(), sourceImmutablePolicy.getFences(), factorsPolicy.isInherenceRequired(), factorsPolicy.isKnowledgeRequired(), factorsPolicy.isPossessionRequired()); } else if (sourceImmutablePolicy instanceof ConditionalGeoFencePolicy) { sourceImmutablePolicy = new ConditionalGeoFencePolicy(newValue, sourceImmutablePolicy.getDenyEmulatorSimulator(), sourceImmutablePolicy.getFences(), ((ConditionalGeoFencePolicy) sourceImmutablePolicy).getInPolicy(), ((ConditionalGeoFencePolicy) sourceImmutablePolicy).getOutPolicy()); } else { throw new Throwable("Source Policy is of unknown type"); } }</code><technical_language>a error messages in this file lack punctuation -- I feel adding some punctuation improve readability. For example: Source Policy is null, set deny rooted jailbroken Source Policy is ConditionalGeoFence type, hold policies</technical_language>

Target:
public void setDenyRootedJailBroken(Boolean newValue) throws Throwable { if (sourceImmutablePolicy == null) { throw new Throwable("Source Policy is null and therefore unable to deny rooted jailbroken devices."); } if (sourceImmutablePolicy instanceof MethodAmountPolicy) { sourceImmutablePolicy = new MethodAmountPolicy(newValue, sourceImmutablePolicy.getDenyEmulatorSimulator(), sourceImmutablePolicy.getFences(), ((MethodAmountPolicy) sourceImmutablePolicy).getAmount()); } else if (sourceImmutablePolicy instanceof FactorsPolicy) { FactorsPolicy factorsPolicy = (FactorsPolicy) sourceImmutablePolicy; sourceImmutablePolicy = new FactorsPolicy(newValue, sourceImmutablePolicy.getDenyEmulatorSimulator(), sourceImmutablePolicy.getFences(), factorsPolicy.isInherenceRequired(), factorsPolicy.isKnowledgeRequired(), factorsPolicy.isPossessionRequired()); } else if (sourceImmutablePolicy instanceof ConditionalGeoFencePolicy) { sourceImmutablePolicy = new ConditionalGeoFencePolicy(newValue, sourceImmutablePolicy.getDenyEmulatorSimulator(), sourceImmutablePolicy.getFences(), ((ConditionalGeoFencePolicy) sourceImmutablePolicy).getInside(), ((ConditionalGeoFencePolicy) sourceImmutablePolicy).getOutside()); } else { throw new Throwable("Source Policy is of unknown type"); } }
Source:
<code>public String evaluate(TransactionContext txnCtx, Input<Object>[] args) { assert args.length == 2 : "repeat takes exactly two arguments"; var text = (String) args[0].value(); if (text == null) { return null; } <START> var repetitions = (int) args[1].value(); <END> if (repetitions <= 0) { return ""; } else { return text.repeat(repetitions); } }</code><technical_language>This fail null</technical_language>

Target:
public String evaluate(TransactionContext txnCtx, Input<Object>[] args) { assert args.length == 2 : "repeat takes exactly two arguments"; var text = (String) args[0].value(); var repetitions = (Integer) args[1].value(); if (text == null || repetitions == null) { return null; } if (repetitions <= 0) { return ""; } else { return text.repeat(repetitions); } }
Source:
<code>private void processOutput() { CallContext callContext = getCallContext(); if(callContext != null) { <START> while (processOutput((CallContextImpl) callContext)); <END> } }</code><technical_language>remove need cast CallContext changing field getter setter CallContextImpl? way, a guarded cast assigning field. unrelated note, getters setters override interface method package instead of public visibility</technical_language>

Target:
private void processOutput() { CallContextImpl callContext = getCallContext(); if(callContext != null) { while (processOutput(callContext)); } }
Source:
<code>public void setDeclarator(IASTDeclarator declarator) { assertNotFrozen(); fDeclarator = declarator; <START> fDeclarator.setParent(this); <END> }</code><technical_language>adding ICPPASTInitCapture.DECLARATOR property I suggested, this do fDeclarator.setPropertyInParent(DECLARATOR)</technical_language>

Target:
public void setDeclarator(IASTDeclarator declarator) { assertNotFrozen(); fDeclarator = declarator; if (declarator != null) { declarator.setParent(this); declarator.setPropertyInParent(DECLARATOR); } }
Source:
<code>void incrementCommittedTransactions(long duration) { TxCommitStatistic prev, next; if (duration == 0) duration = 1; do { prev = commitStatistic.get(); <START> long prevCount = prev.getNumberOfCommittedTransactions(); <END> long newCount = prevCount + 1; long newAvg = (duration + prevCount * prev.getAverageCommitTime()); newAvg = (newAvg + newCount - 1) / newCount; next = new TxCommitStatistic(newCount, newAvg); } while (!commitStatistic.compareAndSet(prev, next)); }</code><technical_language>good in general - call getNumberOfCommittedTransactions instead of storing in TxCommitStatistic? atomicreference a long new TxCommitStatistic. question is need for TxCommitStatistic instead of averageCommitTime stored a long</technical_language>

Target:
void incrementCommittedTransactions(long duration) { TxCommitStatistic prev, next; do { prev = commitStatistic.get(); long prevCount = prev.getNumberOfCommittedTransactions(); long nextAvg = nextAverage(duration, prevCount, prev.getAverageCommitTime()); next = new TxCommitStatistic(prevCount + 1, nextAvg); } while (!commitStatistic.compareAndSet(prev, next)); }
Source:
<code>private void checkStatement(Tree parentStart, Tree parentEnd, StatementTree firstInnerStatement, int nestingStatementNum, List<StatementTree> statements) { if (firstInnerStatement.is(Kind.BLOCK)) { return; } <START> int parentLine = ((PHPTree) parentEnd).getLastToken().line(); <END> int parentColumn = ((PHPTree) parentStart).getFirstToken().column(); StatementBlock statementBlock = findBlock(parentLine, parentColumn, firstInnerStatement, nestingStatementNum, statements); if (!statementBlock.otherStatement.isEmpty()) { boolean isIfStatement = statements.get(nestingStatementNum).is(Kind.IF_STATEMENT); String message = String.format(isIfStatement ? MESSAGE_IF : MESSAGE_LOOP, statementBlock.size()); PreciseIssue issue = context().newIssue(this, statementBlock.otherStatement.get(0), message); issue.secondary(firstInnerStatement, isIfStatement ? "Executed conditionally" : "Executed in a loop"); String secondaryMessage = isIfStatement ? "Always executed" : "Executed once"; statementBlock.otherStatement.stream().skip(1).forEach(statement -> issue.secondary(statement, secondaryMessage)); } }</code><technical_language>methods line() column() class, extracting them</technical_language>

Target:
private void checkStatement(Tree parentStart, Tree parentEnd, StatementTree firstInnerStatement, int nestingStatementNum, List<StatementTree> statements) { if (firstInnerStatement.is(Kind.BLOCK)) { return; } int parentLine = lastTokenLine(parentEnd); int parentColumn = column(parentStart); StatementBlock statementBlock = findBlock(parentLine, parentColumn, firstInnerStatement, nestingStatementNum, statements); if (!statementBlock.otherStatement.isEmpty()) { boolean isIfStatement = statements.get(nestingStatementNum).is(Kind.IF_STATEMENT); String message = String.format(isIfStatement ? MESSAGE_IF : MESSAGE_LOOP, statementBlock.size()); PreciseIssue issue = context().newIssue(this, statementBlock.otherStatement.get(0), message); issue.secondary(firstInnerStatement, isIfStatement ? "Executed conditionally" : "Executed in a loop"); String secondaryMessage = isIfStatement ? "Always executed" : "Executed once"; statementBlock.otherStatement.stream().skip(1).forEach(statement -> issue.secondary(statement, secondaryMessage)); } }
Source:
<code>public int compare(CompressedWishlistInfo wish1, CompressedWishlistInfo wish2) { int retVal = 0; for (SortOption option : options) { try { switch (option.getKey()) { case CardDbAdapter.KEY_NAME: { retVal = wish1.mCard.mName.compareTo(wish2.mCard.mName); break; } case CardDbAdapter.KEY_COLOR: { retVal = wish1.mCard.mColor.compareTo(wish2.mCard.mColor); break; } case CardDbAdapter.KEY_SUPERTYPE: { retVal = wish1.mCard.mType.compareTo(wish2.mCard.mType); break; } case CardDbAdapter.KEY_CMC: { retVal = wish1.mCard.mCmc - wish2.mCard.mCmc; break; } case CardDbAdapter.KEY_POWER: { retVal = Float.compare(wish1.mCard.mPower, wish2.mCard.mPower); break; } case CardDbAdapter.KEY_TOUGHNESS: { retVal = Float.compare(wish1.mCard.mToughness, wish2.mCard.mToughness); break; } case CardDbAdapter.KEY_SET: { retVal = wish1.mCard.mExpansion.compareTo(wish2.mCard.mExpansion); break; } case SortOrderDialogFragment.KEY_PRICE: { retVal = Double.compare(wish1.getTotalPrice(mPriceSetting), wish2.getTotalPrice(mPriceSetting)); break; } case SortOrderDialogFragment.KEY_ORDER: { <START> retVal = SortOrderDialogFragment.compareInt(wish1.getIndex(), wish2.getIndex()); <END> break; } } } catch (NullPointerException e) { retVal = 0; } if (!option.getAscending()) { retVal = -retVal; } if (retVal != 0) { return retVal; } } return retVal; }</code><technical_language>Replace retVal = wish1.getIndex().compareTo(wish2.getIndex());</technical_language>

Target:
public int compare(CompressedWishlistInfo wish1, CompressedWishlistInfo wish2) { int retVal = 0; for (SortOption option : options) { try { switch (option.getKey()) { case CardDbAdapter.KEY_NAME: { retVal = wish1.mCard.mName.compareTo(wish2.mCard.mName); break; } case CardDbAdapter.KEY_COLOR: { retVal = wish1.mCard.mColor.compareTo(wish2.mCard.mColor); break; } case CardDbAdapter.KEY_SUPERTYPE: { retVal = wish1.mCard.mType.compareTo(wish2.mCard.mType); break; } case CardDbAdapter.KEY_CMC: { retVal = wish1.mCard.mCmc - wish2.mCard.mCmc; break; } case CardDbAdapter.KEY_POWER: { retVal = Float.compare(wish1.mCard.mPower, wish2.mCard.mPower); break; } case CardDbAdapter.KEY_TOUGHNESS: { retVal = Float.compare(wish1.mCard.mToughness, wish2.mCard.mToughness); break; } case CardDbAdapter.KEY_SET: { retVal = wish1.mCard.mExpansion.compareTo(wish2.mCard.mExpansion); break; } case SortOrderDialogFragment.KEY_PRICE: { retVal = Double.compare(wish1.getTotalPrice(mPriceSetting), wish2.getTotalPrice(mPriceSetting)); break; } case SortOrderDialogFragment.KEY_ORDER: { retVal = Integer.valueOf(wish1.getIndex()).compareTo(wish2.getIndex()); break; } } } catch (NullPointerException e) { retVal = 0; } if (!option.getAscending()) { retVal = -retVal; } if (retVal != 0) { return retVal; } } return retVal; }
Source:
<code><START> public void setUp() throws Exception { <END> }</code><technical_language>removed if empty</technical_language>

Target:
public void setUp() throws Exception { super.setUp(); TasksUiPlugin.getDefault() .getPreferenceStore() .setValue(ITasksUiPreferenceConstants.REPOSITORY_SYNCH_SCHEDULE_ENABLED, false); TaskTestUtil.resetTaskListAndRepositories(); mockRepositoryConnector = new MockRepositoryConnectorWithTaskDataHandler(); TasksUiPlugin.getRepositoryManager().addRepositoryConnector(mockRepositoryConnector); mockRepository = new TaskRepository(MockRepositoryConnector.CONNECTOR_KIND, MockRepositoryConnector.REPOSITORY_URL); TasksUiPlugin.getRepositoryManager().addRepository(mockRepository); }
Source:
<code>public String locate(String name, StatementContext ctx) { final String cache_key; if (ctx.getSqlObjectType() != null) { cache_key = '/' + mungify(ctx.getSqlObjectType().getName() + '.' + name) + ".sql"; } else { cache_key = name; } if (found.containsKey(cache_key)) { return found.get(cache_key); } if (looksLikeSql(name)) { return name; } final ClassLoader loader = selectClassLoader(); BufferedReader reader = null; try { InputStream in_stream = loader.getResourceAsStream(name); if (in_stream == null) { in_stream = loader.getResourceAsStream(name + ".sql"); } if (in_stream == null && ctx.getSqlObjectType() != null) { String filename = '/' + mungify(ctx.getSqlObjectType().getName() + '.' + name) + ".sql"; in_stream = loader.getResourceAsStream(filename); if (in_stream == null) { in_stream = ctx.getSqlObjectType().getResourceAsStream(filename); } } if (in_stream == null) { found.put(cache_key, name == cache_key ? new String(name) : name); return name; } StringBuilder sb = new StringBuilder(); try { SqlScriptLexer lexer = new SqlScriptLexer(new ANTLRInputStream(in_stream)); while (true) { <START> Token t = lexer.nextToken(); <END> int type = t.getType(); if (type == SqlScriptLexer.EOF) { break; } else if (type == SqlScriptLexer.LITERAL || type == SqlScriptLexer.QUOTED_TEXT || type == SqlScriptLexer.SEMICOLON || type == SqlScriptLexer.OTHER) { sb.append(t.getText()); } else if (type == SqlScriptLexer.NEWLINE) { if (sb.length() > 0) { sb.append(t.getText()); } } } }catch (IOException e){ throw new UnableToCreateStatementException(e.getMessage(), e, ctx); } String sql = sb.toString(); found.put(cache_key, sql); return sql; } finally { try { if (reader != null) { reader.close(); } } catch (IOException e) { } } }</code><technical_language>This logic combined similar structure in Script a helper class, a SqlStatementSplitter perhaps</technical_language>

Target:
public String locate(String name, StatementContext ctx) { final String cache_key; if (ctx.getSqlObjectType() != null) { cache_key = '/' + mungify(ctx.getSqlObjectType().getName() + '.' + name) + ".sql"; } else { cache_key = name; } if (found.containsKey(cache_key)) { return found.get(cache_key); } if (looksLikeSql(name)) { return name; } final ClassLoader loader = selectClassLoader(); InputStream in_stream = null; try { in_stream = loader.getResourceAsStream(name); if (in_stream == null) { in_stream = loader.getResourceAsStream(name + ".sql"); } if (in_stream == null && ctx.getSqlObjectType() != null) { String filename = '/' + mungify(ctx.getSqlObjectType().getName() + '.' + name) + ".sql"; in_stream = loader.getResourceAsStream(filename); if (in_stream == null) { in_stream = ctx.getSqlObjectType().getResourceAsStream(filename); } } if (in_stream == null) { found.put(cache_key, name == cache_key ? new String(name) : name); return name; } String sql; try { sql = SQL_SCRIPT_PARSER.parse(new ANTLRInputStream(in_stream)); } catch (IOException e) { throw new UnableToCreateStatementException(e.getMessage(), e, ctx); } found.put(cache_key, sql); return sql; } finally { try { if (in_stream != null) { in_stream.close(); } } catch (IOException e) { } } }
Source:
<code>MockVoltPort(VoltNetwork vn, InputHandler handler) throws UnknownHostException { <START> super (vn, handler, new InetSocketAddress(InetAddress.getByName("127.0.0.1"), 21212), vn.m_pool, null); <END> }</code><technical_language>SSL in tests</technical_language>

Target:
MockVoltPort(VoltNetwork vn, InputHandler handler) throws UnknownHostException { super (vn, handler, new InetSocketAddress(InetAddress.getByName("127.0.0.1"), 21212), vn.m_pool); }
Source:
<code>public Response buildLinkedAccountURI(@PathParam("providerId") String providerId, @QueryParam("redirectUri") String redirectUri) { if (redirectUri == null) { ErrorResponse.error(Messages.INVALID_REDIRECT_URI, Response.Status.BAD_REQUEST); <START> } <END> String errorMessage = checkCommonPreconditions(providerId); if (errorMessage != null) { return ErrorResponse.error(errorMessage, Response.Status.BAD_REQUEST); } try { String nonce = UUID.randomUUID().toString(); MessageDigest md = MessageDigest.getInstance("SHA-256"); String input = nonce + auth.getSession().getId() + client.getClientId() + providerId; byte[] check = md.digest(input.getBytes(StandardCharsets.UTF_8)); String hash = Base64Url.encode(check); URI linkUri = Urls.identityProviderLinkRequest(this.session.getContext().getUri().getBaseUri(), providerId, realm.getName()); linkUri = UriBuilder.fromUri(linkUri) .queryParam("nonce", nonce) .queryParam("hash", hash) .queryParam("client_id", client.getClientId()) .queryParam("redirect_uri", redirectUri) .build(); AccountLinkUriRepresentation rep = new AccountLinkUriRepresentation(); rep.setAccountLinkUri(linkUri); rep.setHash(hash); rep.setNonce(nonce); return Cors.add(request, Response.ok(rep)).auth().allowedOrigins(auth.getToken()).build(); } catch (Exception spe) { spe.printStackTrace(); return ErrorResponse.error(Messages.FAILED_TO_PROCESS_RESPONSE, Response.Status.INTERNAL_SERVER_ERROR); } }</code><technical_language>I add a check for manage-account here, prevent abuse of this endpoint</technical_language>

Target:
public Response buildLinkedAccountURI(@PathParam("providerId") String providerId, @QueryParam("redirectUri") String redirectUri) { auth.require(AccountRoles.MANAGE_ACCOUNT); if (redirectUri == null) { ErrorResponse.error(Messages.INVALID_REDIRECT_URI, Response.Status.BAD_REQUEST); } String errorMessage = checkCommonPreconditions(providerId); if (errorMessage != null) { return ErrorResponse.error(errorMessage, Response.Status.BAD_REQUEST); } try { String nonce = UUID.randomUUID().toString(); MessageDigest md = MessageDigest.getInstance("SHA-256"); String input = nonce + auth.getSession().getId() + client.getClientId() + providerId; byte[] check = md.digest(input.getBytes(StandardCharsets.UTF_8)); String hash = Base64Url.encode(check); URI linkUri = Urls.identityProviderLinkRequest(this.session.getContext().getUri().getBaseUri(), providerId, realm.getName()); linkUri = UriBuilder.fromUri(linkUri) .queryParam("nonce", nonce) .queryParam("hash", hash) .queryParam("client_id", client.getClientId()) .queryParam("redirect_uri", redirectUri) .build(); AccountLinkUriRepresentation rep = new AccountLinkUriRepresentation(); rep.setAccountLinkUri(linkUri); rep.setHash(hash); rep.setNonce(nonce); return Cors.add(request, Response.ok(rep)).auth().allowedOrigins(auth.getToken()).build(); } catch (Exception spe) { spe.printStackTrace(); return ErrorResponse.error(Messages.FAILED_TO_PROCESS_RESPONSE, Response.Status.INTERNAL_SERVER_ERROR); } }
Source:
<code>public void idle() { Iterator<DispatchAttempt> iterator = sendQueue.iterator(); while (iterator.hasNext()) { DispatchAttempt attempt = iterator.next(); try { doDispatch(attempt); notifyObservers(DispatchResult.success(attempt.event, attempt.address, EventNotificationMethod.EMAIL)); iterator.remove(); <START> } catch (Exception ex) { <END> attempt.attempts++; if (attempt.attempts >= ATTEMPTS) { notifyObservers(DispatchResult.failure(attempt.event, attempt.address, EventNotificationMethod.EMAIL, ex.getMessage())); iterator.remove(); } } } }</code><technical_language>print exception log in case</technical_language>

Target:
public void idle() { Iterator<DispatchAttempt> iterator = sendQueue.iterator(); while (iterator.hasNext()) { DispatchAttempt attempt = iterator.next(); try { doDispatch(attempt); notifyObservers(DispatchResult.success(attempt.event, attempt.address, EventNotificationMethod.EMAIL)); iterator.remove(); } catch (Exception ex) { attempt.retries++; if (attempt.retries >= retries) { notifyObservers(DispatchResult.failure(attempt.event, attempt.address, EventNotificationMethod.EMAIL, ex.getMessage())); iterator.remove(); } } } }
Source:
<code>public ContentAuditLogExecutorImpl() { final Function<ThreadFactory, ExecutorService> executorServiceSupplier = <START> ( threadFactory ) -> new ThreadPoolExecutor( 0, Runtime.getRuntime().availableProcessors(), 60L, TimeUnit.SECONDS, <END> new LinkedBlockingQueue<>( 100 ) ); this.simpleExecutor = new SimpleExecutor( executorServiceSupplier, "content-audit-log-thread-%d", e -> LOG.error( "Audit log failed", e ) ); }</code><technical_language>threadFactory in ThreadPoolExecutor construction CallerRunsPolicy before. it, please</technical_language>

Target:
public ContentAuditLogExecutorImpl() { final Function<ThreadFactory, ExecutorService> executorServiceSupplier = ( threadFactory ) -> new ThreadPoolExecutor( 0, Runtime.getRuntime().availableProcessors(), 60L, TimeUnit.SECONDS, new LinkedBlockingQueue<>( 100 ), threadFactory, new ThreadPoolExecutor.CallerRunsPolicy() ); this.simpleExecutor = new SimpleExecutor( executorServiceSupplier, "content-audit-log-thread-%d", e -> LOG.error( "Audit log failed", e ) ); }
Source:
<code>public OAuth2AuthorizeRespDTO authorize(OAuth2AuthorizeReqDTO oAuth2AuthorizeReqDTO) { if (log.isDebugEnabled()) { log.debug("Authorization Request received for user : " + oAuth2AuthorizeReqDTO.getUsername() + ", Client ID : " + oAuth2AuthorizeReqDTO.getConsumerKey() + ", Authorization Response Type : " + oAuth2AuthorizeReqDTO.getResponseType() + ", Requested callback URI : " + oAuth2AuthorizeReqDTO.getCallbackUrl() + ", Requested Scope : " + OAuth2Util.buildScopeString( oAuth2AuthorizeReqDTO.getScopes())); } try { AuthorizationHandlerManager authzHandlerManager = AuthorizationHandlerManager.getInstance(); OAuth2AuthorizeRespDTO oAuth2AuthorizeRespDTO = authzHandlerManager.handleAuthorization(oAuth2AuthorizeReqDTO); <START> oAuth2AuthorizeRespDTO.setTokenType(BEARER_TOKEN_TYPE); <END> return oAuth2AuthorizeRespDTO; } catch (Exception e) { log.error("Error occurred when processing the authorization request. " + "Returning an error back to client.", e); OAuth2AuthorizeRespDTO authorizeRespDTO = new OAuth2AuthorizeRespDTO(); authorizeRespDTO.setErrorCode(OAuth2ErrorCodes.SERVER_ERROR); authorizeRespDTO.setErrorMsg("Error occurred when processing the authorization " + "request. Returning an error back to client."); authorizeRespDTO.setCallbackURI(oAuth2AuthorizeReqDTO.getCallbackUrl()); return authorizeRespDTO; } }</code><technical_language>This needs done issue() method of AuthorizationHandlers. AuthorizationHandlers extensible andiIf fix of handlers set overwriting here</technical_language>

Target:
public OAuth2AuthorizeRespDTO authorize(OAuth2AuthorizeReqDTO oAuth2AuthorizeReqDTO) { if (log.isDebugEnabled()) { log.debug("Authorization Request received for user : " + oAuth2AuthorizeReqDTO.getUsername() + ", Client ID : " + oAuth2AuthorizeReqDTO.getConsumerKey() + ", Authorization Response Type : " + oAuth2AuthorizeReqDTO.getResponseType() + ", Requested callback URI : " + oAuth2AuthorizeReqDTO.getCallbackUrl() + ", Requested Scope : " + OAuth2Util.buildScopeString( oAuth2AuthorizeReqDTO.getScopes())); } try { AuthorizationHandlerManager authzHandlerManager = AuthorizationHandlerManager.getInstance(); return authzHandlerManager.handleAuthorization(oAuth2AuthorizeReqDTO); } catch (Exception e) { log.error("Error occurred when processing the authorization request. " + "Returning an error back to client.", e); OAuth2AuthorizeRespDTO authorizeRespDTO = new OAuth2AuthorizeRespDTO(); authorizeRespDTO.setErrorCode(OAuth2ErrorCodes.SERVER_ERROR); authorizeRespDTO.setErrorMsg("Error occurred when processing the authorization " + "request. Returning an error back to client."); authorizeRespDTO.setCallbackURI(oAuth2AuthorizeReqDTO.getCallbackUrl()); return authorizeRespDTO; } }
Source:
<code>public StreamingOutput getShield(@PathParam("id") int branchId) { Optional<RepositoryState> state = stateService.getRepositoryState(branchId); if (!state.isPresent()) { throw new IllegalArgumentException(String.format("No state for id %d", branchId)); } final String path; if (state.get().getLastBuild().isPresent()) { path = pickImage(state.get().getLastBuild().get().getState()); } else { path = "/shields/build-???-lightgrey.png"; } return new StreamingOutput() { @Override public void write(OutputStream outputStream) throws IOException, WebApplicationException { <START> InputStream imageStream = getClass().getResource(path).openStream(); <END> BufferedImage image = ImageIO.read(imageStream); ImageIO.write(image, "png", outputStream); } }; }</code><technical_language>Resources.getResource</technical_language>

Target:
public StreamingOutput getShield(@PathParam("id") int branchId) { Optional<RepositoryState> state = stateService.getRepositoryState(branchId); if (!state.isPresent()) { throw new IllegalArgumentException(String.format("No state for id %d", branchId)); } final String path; if (state.get().getLastBuild().isPresent()) { path = pickImage(state.get().getLastBuild().get().getState()); } else { path = "shields/build-???-lightgrey.png"; } return new StreamingOutput() { @Override public void write(OutputStream outputStream) throws IOException, WebApplicationException { ByteStreams.copy(Resources.getResource(path).openStream(), outputStream); } }; }
Source:
<code><START> public void setFeatureState(FeatureState featureState) { <END> featureStateProducer.send(featureState.getFeature(), wrapperForFeatureState(featureState)); }</code><technical_language>defined contract API fulfilled: "The repository implementation ensure subsequent calls {@link #getFeatureState(Feature)} return state persisted this method." A subsequent call return consumer catchup</technical_language>

Target:
public void setFeatureState(FeatureState featureState) { FeatureStateStorageWrapper storageWrapper = wrapperForFeatureState(featureState); featureStateProducer.send(featureState.getFeature(), storageWrapper); handleUpdate(featureState.getFeature().name(), storageWrapper); }
Source:
<code>private static void checkProcessResult(IProcess process) throws <START> DebugException { <END> boolean isTerminated = process.isTerminated(); if (!isTerminated) { String output = getOutput(process); Object[] errorInfo = { process.getAttribute(IProcess.ATTR_CMDLINE), output }; String errorMessage = NLS.bind("Process not finished.\n Command line arguments: {0}\nOutput: {1}", errorInfo); IllegalStateException exception = new IllegalStateException(errorMessage); LaunchingPlugin.log(exception); } else { int exitCode = process.getExitValue(); if (exitCode != 0) { String output = getOutput(process); Object[] errorInfo = { process.getAttribute(IProcess.ATTR_CMDLINE), Integer.valueOf(exitCode), output }; String errorMessage = NLS.bind("Process returned with error code \"{0}\".Command line arguments: {1}\n Output: {2}", errorInfo); IllegalStateException exception = new IllegalStateException(errorMessage); LaunchingPlugin.log(exception); } } }</code><technical_language>Do want this throwing in check* method? I wrap thrown inside</technical_language>

Target:
private static void checkProcessResult(IProcess process) throws DebugException { boolean isTerminated = process.isTerminated(); if (!isTerminated) { String output = getOutput(process); Object[] errorInfo = { process.getAttribute(IProcess.ATTR_CMDLINE), output }; String errorMessage = NLS.bind("Process not finished.\n Command line arguments: {0}\nOutput: {1}", errorInfo); IllegalStateException exception = new IllegalStateException(errorMessage); LaunchingPlugin.log(exception); } else { int exitCode = process.getExitValue(); if (exitCode != 0) { String output = getOutput(process); Object[] errorInfo = { Integer.valueOf(exitCode), process.getAttribute(IProcess.ATTR_CMDLINE), output }; String errorMessage = NLS.bind("Process returned with error code \"{0}\".\nCommand line arguments: {1}\nOutput: {2}", errorInfo); IllegalStateException exception = new IllegalStateException(errorMessage); LaunchingPlugin.log(exception); } } }
Source:
<code>@Test void testCountEqualsDeep() throws SqlParseException { SqlNode countExpression = parseExpression("count(a)"); SqlNode countDistinctExpression = parseExpression("count(distinct a)"); <START> assertThat("count(a) doesn't equals count(a)", countExpression.equalsDeep(parseExpression("count(a)"), Litmus.IGNORE)); <END> assertThat("count(distinct a) doesn't equals count(distinct a)", countDistinctExpression.equalsDeep(parseExpression("count(distinct a)"), Litmus.IGNORE)); assertThat("count(distinct a) equals count(a), unexpected", !countDistinctExpression.equalsDeep(countExpression, Litmus.IGNORE)); }</code><technical_language>Please factor this a method expression arguments. method assertThat("{" + expr1 + "}.equalsDeep({" + expr2 + "})", parseExpression(expr1).equals(parseExpression(expr2)), is(..))</technical_language>

Target:
@Test void testCountEqualsDeep() throws SqlParseException { assertEqualsDeep("count(a)", "count(a)", true); assertEqualsDeep("count(distinct a)", "count(distinct a)", true); assertEqualsDeep("count(distinct a)", "count(a)", false); }
Source:
<code>private long mapToTxId(DataValueDescriptor dataValue) throws StandardException { if(dataValue instanceof SQLTimestamp) { Timestamp ts = ((SQLTimestamp)dataValue).getTimestamp(null); SpliceLogUtils.trace(LOG,"time travel ts=%s", ts.toString()); try { return SIDriver.driver().getTxnStore().getTxnAt(ts.getTime()); } catch (IOException e) { throw Exceptions.parseException(e); } }else if(dataValue instanceof SQLTinyint || dataValue instanceof SQLSmallint || dataValue instanceof SQLInteger || dataValue instanceof SQLLongint) { return dataValue.getLong(); }else { <START> throw StandardException.newException(SQLState.NOT_IMPLEMENTED); END> } }</code><technical_language>code for SQLTimestamp above, supporting SQLTime is trivial. reason leave for now</technical_language>

Target:
private long mapToTxId(DataValueDescriptor dataValue) throws StandardException { if(dataValue instanceof SQLTimestamp) { Timestamp ts = ((SQLTimestamp)dataValue).getTimestamp(null); SpliceLogUtils.trace(LOG,"time travel ts=%s", ts.toString()); try { return SIDriver.driver().getTxnStore().getTxnAt(ts.getTime()); } catch (IOException e) { throw Exceptions.parseException(e); } }else if(dataValue instanceof SQLTinyint || dataValue instanceof SQLSmallint || dataValue instanceof SQLInteger || dataValue instanceof SQLLongint) { return dataValue.getLong(); }else { throw StandardException.newException(SQLState.NOT_IMPLEMENTED, dataValue.getClass().getSimpleName() + " can not be used with time travel query"); } }
Source:
<code>public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); app = (WikipediaApp)getActivity().getApplicationContext(); adapter = new RecentSearchesAdapter(getActivity(), null, true); recentSearchesList.setAdapter(adapter); recentSearchesList.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { RecentSearch entry = (RecentSearch) view.getTag(); <START> app.getBus().post(new ShowTitleSearchEvent(entry.getText())); <END> } }); getActivity().getSupportLoaderManager().initLoader(0, null, this); getActivity().getSupportLoaderManager().restartLoader(0, null, this); }</code><technical_language>necessary Bus for this? simply obtain a reference SearchArticlesFragment, call startSearch function</technical_language>

Target:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); adapter = new RecentSearchesAdapter(getActivity(), null, true); recentSearchesList.setAdapter(adapter); recentSearchesList.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { RecentSearch entry = (RecentSearch) view.getTag(); searchFragment.switchToTitleSearch(entry.getText()); } }); getActivity().getSupportLoaderManager().initLoader(0, null, this); getActivity().getSupportLoaderManager().restartLoader(0, null, this); }
Source:
<code>public void edit(VolumeBrickModel object) { <START> table.setRowData(new ArrayList<ListModel>()); <END> table.edit(object.getBricks()); Driver.driver.edit(object); }</code><technical_language>need this line? table.setRowData(new ArrayList<ListModel>());</technical_language>

Target:
public void edit(VolumeBrickModel object) { table.edit(object.getBricks()); Driver.driver.edit(object); }
Source:
<code>public void onPlanStatusChange(PlanInfo planInfo) { Status status = planInfo.getStatus(); <START> if (status.equals(Status.COMPLETED)) { <END> done(planInfo.getId()); } else if (status.equals(Status.CANCELED) || status.equals(Status.FAILED)) { stop(planInfo.getId(), status, planInfo.getErrorMessage()); } }</code><technical_language>this switch statement</technical_language>

Target:
public void onPlanStatusChange(PlanInfo planInfo) { Status status = planInfo.getStatus(); switch (status) { case COMPLETED: done(planInfo.getId()); break; case CANCELED: case FAILED: stop(planInfo.getId(), status, planInfo.getErrorMessage()); break; default: break; } }
Source:
<code>protected void updateIndexedObjectsWithQueries(List<?> queries, List<IndexedObjectInformation> indexedObjectInformations) { for (int i = 0; i < queries.size(); i++) { <START> Object query = queries.get(0); <END> if (query instanceof IndexQuery) { IndexQuery indexQuery = (IndexQuery) query; Object queryObject = indexQuery.getObject(); if (queryObject != null) { updateIndexedObject(queryObject, indexedObjectInformations.get(i)); } } } }</code><technical_language>if i instead of 0 works tests green</technical_language>

Target:
protected void updateIndexedObjectsWithQueries(List<?> queries, List<IndexedObjectInformation> indexedObjectInformations) { for (int i = 0; i < queries.size(); i++) { Object query = queries.get(i); if (query instanceof IndexQuery) { IndexQuery indexQuery = (IndexQuery) query; Object queryObject = indexQuery.getObject(); if (queryObject != null) { updateIndexedObject(queryObject, indexedObjectInformations.get(i)); } } } }
Source:
<code>public void should_not_fail_if_a_profile_with_same_name_is_present() throws SQLException { insertQualityGate(SONAR_WAY_OUTDATED_QUALITY_GATE, false); insertQualityGate(SONARQUBE_WAY_QUALITY_GATE, false); underTest.execute(); <START> assertThat(db.countRowsOfTable("quality_gates")).isEqualTo(2); <END> }</code><technical_language>check "Sonarqube way" exist anymore</technical_language>

Target:
public void should_not_fail_if_a_profile_with_same_name_is_present() throws SQLException { insertQualityGate(SONAR_WAY_OUTDATED_QUALITY_GATE, false); insertQualityGate(SONARQUBE_WAY_QUALITY_GATE, false); underTest.execute(); assertQualityGates( tuple(SONAR_WAY_OUTDATED_QUALITY_GATE, false, new Date(PAST), new Date(PAST)), tuple(SONAR_WAY_OUTDATED_QUALITY_GATE + " " + NOW, false, new Date(PAST), new Date(NOW)) ); }
Source:
<code>public void render(HolopadTileEntity tileEntityIn, double x, double y, double z, float partialTicks, int destroyStage) { super.render(tileEntityIn, x, y, z, partialTicks, destroyStage); if(tileEntityIn.hasCard()) { ItemStack item = tileEntityIn.getHoloItem(); float f = (float) tileEntityIn.innerRotation + partialTicks; float scale = 0.8F; GlStateManager.pushMatrix(); <START> GlStateManager.translated((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F); <END> GlStateManager.rotated(f / 20.0F * 57.295776F, 0.0F, 1.0F, 0.0F); Minecraft.getInstance().getItemRenderer().renderItem(item, ItemCameraTransforms.TransformType.GROUND); GlStateManager.popMatrix(); } }</code><technical_language>translated() casting parameters floats? Call translatef() instead, doubles instead of floats</technical_language>

Target:
public void render(HolopadTileEntity tileEntityIn, double x, double y, double z, float partialTicks, int destroyStage) { super.render(tileEntityIn, x, y, z, partialTicks, destroyStage); if(tileEntityIn.hasCard()) { ItemStack item = tileEntityIn.getHoloItem(); float f = (float) tileEntityIn.innerRotation + partialTicks; GlStateManager.pushMatrix(); GlStateManager.translatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F); GlStateManager.rotatef(f / 20.0F * 57.295776F, 0.0F, 1.0F, 0.0F); Minecraft.getInstance().getItemRenderer().renderItem(item, ItemCameraTransforms.TransformType.GROUND); GlStateManager.popMatrix(); } }
Source:
<code>public Page getOutput() { <START> if (!blocked.isDone() || state != State.FINISHING) { <END> return null; } if (!statisticAggregation.isFinished()) { Page aggregationOutput = statisticAggregation.getOutput(); if (aggregationOutput == null) { return null; } int positionCount = aggregationOutput.getPositionCount(); Block[] outputBlocks = new Block[types.size()]; for (int channel = 0; channel < types.size(); channel++) { if (channel < WRITER_CHANNELS) { outputBlocks[channel] = RunLengthEncodedBlock.create(types.get(channel), null, positionCount); } else { outputBlocks[channel] = aggregationOutput.getBlock(channel - 2); } } return new Page(positionCount, outputBlocks); } Page fragmentsPage = createFragmentsPage(); int positionCount = fragmentsPage.getPositionCount(); Block[] outputBlocks = new Block[types.size()]; for (int channel = 0; channel < types.size(); channel++) { if (channel < WRITER_CHANNELS) { outputBlocks[channel] = fragmentsPage.getBlock(channel); } else { outputBlocks[channel] = RunLengthEncodedBlock.create(types.get(channel), null, positionCount); } } state = State.FINISHED; return new Page(positionCount, outputBlocks); }</code><technical_language>check state (cheaper first)</technical_language>

Target:
public Page getOutput() { if (state != State.FINISHING || !blocked.isDone()) { return null; } if (!statisticAggregationOperator.isFinished()) { Page aggregationOutput = statisticAggregationOperator.getOutput(); if (aggregationOutput == null) { return null; } int positionCount = aggregationOutput.getPositionCount(); Block[] outputBlocks = new Block[types.size()]; for (int channel = 0; channel < types.size(); channel++) { if (channel < WRITER_CHANNELS) { outputBlocks[channel] = RunLengthEncodedBlock.create(types.get(channel), null, positionCount); } else { outputBlocks[channel] = aggregationOutput.getBlock(channel - 2); } } return new Page(positionCount, outputBlocks); } Page fragmentsPage = createFragmentsPage(); int positionCount = fragmentsPage.getPositionCount(); Block[] outputBlocks = new Block[types.size()]; for (int channel = 0; channel < types.size(); channel++) { if (channel < WRITER_CHANNELS) { outputBlocks[channel] = fragmentsPage.getBlock(channel); } else { outputBlocks[channel] = RunLengthEncodedBlock.create(types.get(channel), null, positionCount); } } state = State.FINISHED; return new Page(positionCount, outputBlocks); }
Source:
<code>private void generateNodeId() { UUID serverId; if (serverConfig.get("--node-id") != null) { serverId = UuidUtils.fromBase64(getServerConfig(String.class, "--node-id")); <START> } else { <END> serverId = UUID.randomUUID(); } String currentId = getDataStore().get(NODE_ID_RECORD); if (currentId == null) { String idString = UuidUtils.asBase64(serverId); log.info("No Node Id, setting to new Id={}", idString); getDataStore().put(NODE_ID_RECORD, idString); } else { log.info("Node Id = {}", currentId); } }</code><technical_language>this needs done if currentId is null, right? if currentId is present this computation used</technical_language>

Target:
private void generateNodeId() { Optional<String> maybeNodeIdRecord = Optional.ofNullable(getDataStore().get(NODE_ID_RECORD)); if (maybeNodeIdRecord.isPresent()) { log.info("Node Id = {}", maybeNodeIdRecord.get()); } else { UUID serverId = Optional.ofNullable(serverConfig.get("--node-id")) .map(sid -> UuidUtils.fromBase64(getServerConfig(String.class, "--node-id"))) .orElse(UUID.randomUUID()); String idString = UuidUtils.asBase64(serverId); log.info("No Node Id, setting to new Id={}", idString); getDataStore().put(NODE_ID_RECORD, idString); } }
Source:
<code>public void run() throws MetaException { while (true) { try { command.process(); break; } catch (Exception e) { <START> LOG.info("retried / max : / {}", currentRetries, maxRetries); <END> if (currentRetries >= maxRetries) { LOG.error("failed to execute Command :: ", e); throw new MetaException(e.getMessage()); } currentRetries++; try { Thread.sleep(sleepInterval); } catch (InterruptedException e1) { String msg = "error waiting for next retry " + currentRetries; LOG.error(msg, e1); throw new MetaException(msg); } } } }</code><technical_language>message show 0 / 5. set currentRetries 1? For message, log useful for user is happening. I suggest this message: - Attempting acquire DB log notification lock: 3 out of 5 retries</technical_language>

Target:
public void run() throws MetaException { while (true) { try { command.process(); break; } catch (Exception e) { LOG.info( "Attempting to acquire the DB log notification lock: " + currentRetries + " out of " + maxRetries + " retries", e); if (currentRetries >= maxRetries) { String message = "Couldn't acquire the DB log notification lock because we reached the maximum" + " # of retries: retries. If this happens too often, then is recommended to " + "increase the maximum number of retries on the" + " hive.notification.sequence.lock.max.retries configuration"; LOG.error(message, e); throw new MetaException(message + " :: " + e.getMessage()); } currentRetries++; try { Thread.sleep(sleepInterval); } catch (InterruptedException e1) { String msg = "Couldn't acquire the DB notification log lock on " + currentRetries + " retry, because the following error: "; LOG.error(msg, e1); throw new MetaException(msg + e1.getMessage()); } } } }
Source:
<code>public EncodedDoubleValue(String name, int shift, int bits, double factor, long defaultValue, int maxValue, boolean allowZero) { super(name, shift, bits, factor, defaultValue, maxValue, allowZero); double factorDivision = maxValue / factor; if (factorDivision != (int) factorDivision) { <START> throw new IllegalStateException("MaxValue needs to be divideable by factor without remainder"); <END> } }</code><technical_language>divideable -> divisible</technical_language>

Target:
public EncodedDoubleValue(String name, int shift, int bits, double factor, long defaultValue, int maxValue, boolean allowZero) { super(name, shift, bits, factor, defaultValue, maxValue, allowZero); double factorDivision = maxValue / factor; if (factorDivision != (int) factorDivision) { throw new IllegalStateException("MaxValue needs to be divisible by factor without remainder"); } }
Source:
<code>protected boolean canDoAction() { boolean retValue=true; job = getJobDao().get(getParameters().getId()); if (job != null) { if (!job.isExternal()) { retValue = false; addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_NOT_EXTERNAL); } } else { parentStep = getStepDao().get(getParameters().getId()); } if (job == null && parentStep == null) { retValue=false; addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_NO_PARENT); } <START> if (getParameters().getDescription().trim().length() == 0) { <END> retValue=false; addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_EMPTY_DESCRIPTION); } if (!retValue) { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__ADD); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__EXTERNAL_JOB); } return retValue; }</code><technical_language>Disregard question StringUtils.isEmpty in previous patch. worth adding a null check (here in patch of AddExternalJob)</technical_language>

Target:
protected boolean canDoAction() { boolean retValue=true; job = getJobDao().get(getParameters().getId()); if (job != null) { if (!job.isExternal()) { retValue = false; addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_NOT_EXTERNAL); } } else { parentStep = getStepDao().get(getParameters().getId()); } if (job == null && parentStep == null) { retValue=false; addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_NO_PARENT); } if (StringUtils.isEmpty(getParameters().getDescription())) { retValue=false; addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_EMPTY_DESCRIPTION); } if (!retValue) { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__ADD); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__EXTERNAL_JOB); } return retValue; }
Source:
<code>public NewTopicBuilder replicationFactor(short replicationFactor) { <START> if (replicationFactor == NO_REPLICATION_FACTOR) { <END> return defaultReplicationFactor(); } this.replicationFactor = replicationFactor; return this; }</code><technical_language>question</technical_language>

Target:
public NewTopicBuilder replicationFactor(short replicationFactor) { this.replicationFactor = replicationFactor; return this; }
Source:
<code>private static List<Dimension> buildExtendedTablesFromQuery(Query q) { HashSet<Dimension> selectedDims = new HashSet<>(); if(null != q.getFields()) { for (DimensionField f : q.getFields()) { selectedDims.add(f.getDimension()); } } if (null != q.getJoinTables()) { for (Dimension d : q.getJoinTables()) { selectedDims.add(d); } } Set<Dimension> filterDims = q.resolveFilterDimensions(); if(null != filterDims) { selectedDims.addAll(filterDims); } List<Dimension> orderedTables = Dimension.resolveOrderedDimensions(selectedDims); <START> <END> if (q.getAggregateMeasures() != null && q.getAggregateMeasures().size() > 0) { AggregateMeasure aggregateMeasure = q.getAggregateMeasures().get(0); MeasureSqlSerializer serializer = MeasureSqlSerializerFactory.get(aggregateMeasure.getMeasure()); Dimension table = DbMappings.TABLE_NAME_TO_DIMENSION.get(serializer.toTableName()); Dimension optionalTable = DbMappings.TABLE_NAME_TO_DIMENSION.get(serializer.optionalJoinedTable()); orderedTables.add(table); if (optionalTable != null) { orderedTables.add(optionalTable); } } for (int i = 0 ; i < orderedTables.size() ; i++) { Dimension currentDimension = orderedTables.get(i); Dimension actualDimension = PSEUDO_DIMENSION_CONVERSION_TABLE.get(currentDimension); if (actualDimension != null) { orderedTables.remove(i); orderedTables.add(i, actualDimension); } } return orderedTables; }</code><technical_language>Is this TODO active</technical_language>

Target:
private static List<Dimension> buildExtendedTablesFromQuery(Query q) { HashSet<Dimension> selectedDims = new HashSet<>(); if(null != q.getFields()) { for (DimensionField f : q.getFields()) { selectedDims.add(f.getDimension()); } } if (null != q.getJoinTables()) { for (Dimension d : q.getJoinTables()) { selectedDims.add(d); } } Set<Dimension> filterDims = q.resolveFilterDimensions(); if(null != filterDims) { selectedDims.addAll(filterDims); } List<Dimension> orderedTables = Dimension.resolveOrderedDimensions(selectedDims); if (q.getAggregateMeasures() != null && q.getAggregateMeasures().size() > 0) { AggregateMeasure aggregateMeasure = q.getAggregateMeasures().get(0); MeasureSqlSerializer serializer = MeasureSqlSerializerFactory.get(aggregateMeasure.getMeasure()); Dimension table = serializer.toTableDimension(); Dimension optionalTable = serializer.toSecondTableDimension(); orderedTables.add(table); if (optionalTable != null) { orderedTables.add(optionalTable); } } for (int i = 0 ; i < orderedTables.size() ; i++) { Dimension originalDimension = orderedTables.get(i); Dimension resolvedDimension = DbMappings.TABLE_NAME_TO_DIMENSION.get(DbMappings.DIMENSION_TO_TABLE_NAME.get(originalDimension)); if (resolvedDimension != originalDimension) { orderedTables.remove(i); orderedTables.add(i, resolvedDimension); } } return orderedTables; }
Source:
<code>public void testGetMenuLanguage() throws Exception { HdmiCecUtils hdmiCecUtils = new HdmiCecUtils(CecDevice.PLAYBACK_1, "1.0.0.0"); if (hdmiCecUtils.init()) { try { hdmiCecUtils.sendCecMessage(CecDevice.TV, CecMessage.GET_MENU_LANGUAGE); String message = hdmiCecUtils.checkExpectedOutput (CecDevice.TV, <START> CecMessage.FEATURE_ABORT); <END> } finally { hdmiCecUtils.killCecProcess(); } } }</code><technical_language>Feature abort a parameter command is aborting. verify is aborting <get menu lanaguage></technical_language>

Target:
public void testGetMenuLanguage() throws Exception { HdmiCecUtils hdmiCecUtils = new HdmiCecUtils(CecDevice.PLAYBACK_1, "1.0.0.0"); if (hdmiCecUtils.init()) { try { hdmiCecUtils.sendCecMessage(CecDevice.TV, CecMessage.GET_MENU_LANGUAGE); String message = hdmiCecUtils.checkExpectedOutput (CecDevice.TV, CecMessage.FEATURE_ABORT); String params = hdmiCecUtils.getParamsFromMessage(message, CecMessage.GET_MENU_LANGUAGE.toString().length()); assertEquals(params, CecMessage.GET_MENU_LANGUAGE.toString()); } finally { hdmiCecUtils.killCecProcess(); } } }
Source:
<code>private void removeFromImpactCache(Pattern pattern) { Set<URI> referredUris = PatternLanguageHelper.getReferencedPatternsTransitive(pattern).stream().map(p -> p.eResource().getURI()).collect(Collectors.toSet()); <START> referredUris.forEach(u -> impactCache.remove(u, pattern)); <END> }</code><technical_language>I limited reason instantiate referredUris set</technical_language>

Target:
private void removeFromImpactCache(Pattern pattern) { Set<URI> referredUris = PatternLanguageHelper.getReferencedPatternsTransitive(pattern).stream() .map(p -> p.eResource().getURI()).collect(Collectors.toSet()); referredUris.forEach(u -> dependencyCache.remove(u, pattern)); }