auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static synchronized void notifyErrorHandler(int errorCode, String errorMessage, @Nullable String path) { if (Util.isEmptyString(path)) { for (SyncSession syncSession : sessions.values()) { try { syncSession.notifySessionError(errorCode, errorMessage); } catch (Exception exception) { RealmLog.error(exception); } } } else { SyncSession syncSession = sessions.get(path); <START> if (syncSession != null) { <END> try { syncSession.notifySessionError(errorCode, errorMessage); } catch (Exception exception) { RealmLog.error(exception); } } } }</code><technical_language>log a warning if syncSession exist</technical_language>

Target:
private static synchronized void notifyErrorHandler(int errorCode, String errorMessage, @Nullable String path) { if (Util.isEmptyString(path)) { for (SyncSession syncSession : sessions.values()) { try { syncSession.notifySessionError(errorCode, errorMessage); } catch (Exception exception) { RealmLog.error(exception); } } } else { SyncSession syncSession = sessions.get(path); if (syncSession != null) { try { syncSession.notifySessionError(errorCode, errorMessage); } catch (Exception exception) { RealmLog.error(exception); } } else { RealmLog.warn("Cannot find the SyncSession corresponding to the path: " + path); } } }
Source:
<code>void shareFreeList(final BlockRevQueue q) { <START> q.shareFreeList(pending); <END> }</code><technical_language>I implement this other around. pending is "this" (well, backing store) do: pending.shareFreeList(q); mirror intent of caller of invoking this.shareFreeList(q). a subtle issue discarding a potentially large free list bottom of stack pushing empty free list top of stack. Weird, I know. mirror caller's intent</technical_language>

Target:
void shareFreeList(final BlockRevQueue q) { pending.shareFreeList(q); }
Source:
<code>public void removeIndex( final String typeName, final String indexName ) throws IllegalStateException { final short adapterId = internalAdapterStore.getAdapterId(typeName); final AdapterToIndexMapping adapterIndexMap = indexMappingStore.getIndicesForAdapter(adapterId); if (adapterIndexMap == null) { throw new IllegalArgumentException( "No adapter with typeName " + typeName + "could be found."); } final String[] indexNames = adapterIndexMap.getIndexNames(); if (indexNames.length == 1) { throw new IllegalStateException( "Index removal failed. Adapters require at least one index."); } baseOperations.deleteAll( indexName, <START> "", <END> adapterId); Short[] adapters = getAdaptersForIndex(indexName); if (adapters.length == 1) indexStore.removeIndex(indexName); indexMappingStore.remove( adapterId, indexName); }</code><technical_language>need type name</technical_language>

Target:
public void removeIndex( final String typeName, final String indexName ) throws IllegalStateException { final short adapterId = internalAdapterStore.getAdapterId(typeName); final AdapterToIndexMapping adapterIndexMap = indexMappingStore.getIndicesForAdapter(adapterId); if (adapterIndexMap == null) { throw new IllegalArgumentException( "No adapter with typeName " + typeName + "could be found."); } final String[] indexNames = adapterIndexMap.getIndexNames(); if (indexNames.length == 1) { throw new IllegalStateException( "Index removal failed. Adapters require at least one index."); } baseOperations.deleteAll( indexName, typeName, adapterId); final Short[] adapters = getAdaptersForIndex(indexName); if (adapters.length == 1) { indexStore.removeIndex(indexName); } indexMappingStore.remove( adapterId, indexName); }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { if (drawerToggle.onOptionsItemSelected(item)) { drawerLayout.closeDrawer(GravityCompat.END); return true; } switch (item.getItemId()) { case android.R.id.home: getSupportFragmentManager().popBackStack(NARROW, FragmentManager.POP_BACK_STACK_INCLUSIVE); break; case R.id.search: if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Search Zulip"); final EditText editText = new EditText(this); builder.setView(editText); builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() { @Override public void onClick( DialogInterface dialogInterface, int i) { String query = editText.getText().toString(); doNarrow(new NarrowFilterSearch(query)); } }); builder.show(); } break; case R.id.refresh: Log.w("menu", "Refreshed manually by user. We shouldn't need this."); onRefresh(); break; case R.id.menu_realm: FragmentManager fm = getSupportFragmentManager(); RealmDialog dialogFragment = RealmDialog.newInstance(); <START> dialogFragment.show(fm, "fragment_realm"); <END> break; case R.id.logout: logout(); break; case R.id.legal: openLegal(); break; default: return super.onOptionsItemSelected(item); } return true; }</code><technical_language>check if this fragment exists</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { if (drawerToggle.onOptionsItemSelected(item)) { drawerLayout.closeDrawer(GravityCompat.END); return true; } switch (item.getItemId()) { case android.R.id.home: getSupportFragmentManager().popBackStack(NARROW, FragmentManager.POP_BACK_STACK_INCLUSIVE); break; case R.id.search: if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Search Zulip"); final EditText editText = new EditText(this); builder.setView(editText); builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() { @Override public void onClick( DialogInterface dialogInterface, int i) { String query = editText.getText().toString(); doNarrow(new NarrowFilterSearch(query)); } }); builder.show(); } break; case R.id.daynight: switch (AppCompatDelegate.getDefaultNightMode()) { case -1: case AppCompatDelegate.MODE_NIGHT_NO: setNightMode(AppCompatDelegate.MODE_NIGHT_YES); break; case AppCompatDelegate.MODE_NIGHT_YES: setNightMode(AppCompatDelegate.MODE_NIGHT_NO); break; default: setNightMode(AppCompatDelegate.MODE_NIGHT_NO); break; } break; case R.id.refresh: Log.w("menu", "Refreshed manually by user. We shouldn't need this."); onRefresh(); break; case R.id.today: doNarrow(new NarrowFilterToday()); case R.id.menu_realm: FragmentManager fm = getSupportFragmentManager(); RealmDialog dialogFragment = RealmDialog.newInstance(); dialogFragment.show(fm, "fragment_realm"); break; case R.id.logout: logout(); break; case R.id.legal: openLegal(); break; default: return super.onOptionsItemSelected(item); } return true; }
Source:
<code>private Optional<String> getGitReviewBranchName() { Optional<String> branchName = Optional.absent(); DataContext dataContext = DataManager.getInstance().getDataContext(this); Optional<Project> openedProject = dataContext != null ? Optional.fromNullable(CommonDataKeys.PROJECT.getData(dataContext)) : Optional.<Project>absent(); if (openedProject.isPresent()) { String gitReviewFilePath = Joiner.on(File.separator).join( openedProject.get().getBasePath(), GITREVIEW_FILENAME); File gitReviewFile = new File(gitReviewFilePath); if (gitReviewFile.exists() && gitReviewFile.isFile()) { FileInputStream fileInputStream = null; try { fileInputStream = new FileInputStream(gitReviewFilePath); Properties properties = new Properties(); properties.load(fileInputStream); <START> branchName = Optional.fromNullable(properties.getProperty("defaultbranch")); <END> if (branchName.isPresent() && branchName.get().isEmpty()) { return Optional.absent(); } } catch (IOException e) { } finally { if (fileInputStream != null) { try { fileInputStream.close(); } catch (IOException e) { } } } } } return branchName; }</code><technical_language>Guava Strings#emptyToNull simplify this code a bit</technical_language>

Target:
private Optional<String> getGitReviewBranchName() { Optional<String> branchName = Optional.absent(); DataContext dataContext = DataManager.getInstance().getDataContext(this); Optional<Project> openedProject = dataContext != null ? Optional.fromNullable(CommonDataKeys.PROJECT.getData(dataContext)) : Optional.<Project>absent(); if (openedProject.isPresent()) { String gitReviewFilePath = Joiner.on(File.separator).join( openedProject.get().getBasePath(), GITREVIEW_FILENAME); File gitReviewFile = new File(gitReviewFilePath); if (gitReviewFile.exists() && gitReviewFile.isFile()) { FileInputStream fileInputStream = null; try { fileInputStream = new FileInputStream(gitReviewFilePath); Properties properties = new Properties(); properties.load(fileInputStream); branchName = Optional.fromNullable(Strings.emptyToNull(properties.getProperty("defaultbranch"))); } catch (IOException e) { } finally { if (fileInputStream != null) { try { fileInputStream.close(); } catch (IOException e) { } } } } } return branchName; }
Source:
<code>public byte[] getBody() throws AuthFailureError { VolleyLog.e(mBodyContent); if (mBodyContent == null) <START> { <END> return super.getBody(); } return mBodyContent.getBytes(); }</code><technical_language>if (mBodyContent.equals("null"))</technical_language>

Target:
public byte[] getBody() throws AuthFailureError { if (mBodyContent == null) { return super.getBody(); } return mBodyContent.getBytes(); }
Source:
<code>public void onError(Throwable error) { LOGGER.error(sessionName() + " error", error); if (error instanceof MessageTooLargeException) { <START> LOGGER.error("You can set Java system property 'go.websocket.max.text.message.size' to increase limit"); <END> } }</code><technical_language>property name match in SystemEnvironment, SystemEnvironment.GO_WEBSOCKET_MAX_MESSAGE_SIZE.propertyName()</technical_language>

Target:
public void onError(Throwable error) { LOGGER.error(sessionName() + " error", error); if (error instanceof MessageTooLargeException) { LOGGER.error("You can set Java system property '" + SystemEnvironment.GO_WEBSOCKET_MAX_MESSAGE_SIZE.propertyName() + "' to increase limit"); } }
Source:
<code>private static Supplier<ClientRegistration.Builder> oidc(URI issuer) { URI uri = UriComponentsBuilder.fromUri(issuer) .replacePath(issuer.getPath() + OIDC_METADATA_PATH).build(Collections.emptyMap()); return () -> { RequestEntity<Void> request = RequestEntity.get(uri).build(); Map<String, Object> configuration = rest.exchange(request, typeReference).getBody(); OIDCProviderMetadata metadata = parse(configuration, OIDCProviderMetadata::parse); <START> validateJwksUri(metadata); <END> return withProviderConfiguration(metadata, issuer.toASCIIString()) .jwkSetUri(metadata.getJWKSetURI().toASCIIString()) .userInfoUri(metadata.getUserInfoEndpointURI().toASCIIString()); }; }</code><technical_language>pointed out, OIDCProviderMetadata constructor checks for this already, I guaranteed this point JWK set URI null, I missing something</technical_language>

Target:
private static Supplier<ClientRegistration.Builder> oidc(URI issuer) { URI uri = UriComponentsBuilder.fromUri(issuer) .replacePath(issuer.getPath() + OIDC_METADATA_PATH).build(Collections.emptyMap()); return () -> { RequestEntity<Void> request = RequestEntity.get(uri).build(); Map<String, Object> configuration = rest.exchange(request, typeReference).getBody(); OIDCProviderMetadata metadata = parse(configuration, OIDCProviderMetadata::parse); return withProviderConfiguration(metadata, issuer.toASCIIString()) .jwkSetUri(metadata.getJWKSetURI().toASCIIString()) .userInfoUri(metadata.getUserInfoEndpointURI().toASCIIString()); }; }
Source:
<code>public void testTraceSessionTree() { fProxy.setTestFile(fTestFile); fProxy.setScenario(INIT_SCENARIO_NAME); testConnectToNode(); fProxy.setScenario(CREATE_SESSION_SPECIFIC_KERNEL_EVENT_SCENARIO_NAME); testCreateSession(); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.SCHED_SWITCH_EVENT_NAME), false); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.SCHED_WAKEUP_EVENT_NAME, ControlViewSwtBotUtil.SCHED_PROCESSWAIT_EVENT_NAME), false); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.SCHED_PROCESSFORK_EVENT_NAME), true); <START> testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.ALL_TREE_NODE), true); <END> testStartStopTracing(TraceSessionState.ACTIVE); testStartStopTracing(TraceSessionState.INACTIVE); testDestroySession(); testDisconnectFromNode(); }</code><technical_language>I this test selecting event in tree</technical_language>

Target:
public void testTraceSessionTree() { fProxy.setTestFile(fTestFile); fProxy.setScenario(INIT_SCENARIO_NAME); testConnectToNode(); fProxy.setScenario(CREATE_SESSION_SPECIFIC_KERNEL_EVENT_SCENARIO_NAME); testCreateSession(); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.SCHED_SWITCH_EVENT_NAME), false, true); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.SCHED_WAKEUP_EVENT_NAME, ControlViewSwtBotUtil.SCHED_PROCESSWAIT_EVENT_NAME), false, true); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.SCHED_PROCESSFORK_EVENT_NAME), true, true); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.SCHED_PROCESSEXEC_EVENT_NAME), true, false); testEnableSpecificKernelEvent(Arrays.asList(ControlViewSwtBotUtil.ALL_TREE_NODE), true, true); testStartStopTracing(TraceSessionState.ACTIVE); testStartStopTracing(TraceSessionState.INACTIVE); testDestroySession(); testDisconnectFromNode(); }
Source:
<code>public void toStringWithExceptionContainsOnlyImageNameFuture() throws Exception { <START> Future<String> imageNameFuture = Mockito.mock(Future.class); <END> when(imageNameFuture.get()).thenThrow(new ExecutionException(new RuntimeException("arbitrary"))); RemoteDockerImage remoteDockerImage = new RemoteDockerImage(imageNameFuture); assertThat(remoteDockerImage.toString(), containsString("imageNameFuture")); }</code><technical_language>need Mockito, simple as: java CompletableFuture<String> future = new CompletableFuture<>(); future.completeExceptionally(new RuntimeException("arbitrary"));</technical_language>

Target:
public void toStringWithExceptionContainsOnlyImageNameFuture() { CompletableFuture<String> imageNameFuture = new CompletableFuture<>(); imageNameFuture.completeExceptionally(new RuntimeException("arbitrary")); RemoteDockerImage remoteDockerImage = new RemoteDockerImage(imageNameFuture); String toString = remoteDockerImage.toString(); assertThat(toString, containsString("imageName=" + RemoteDockerImage.class.getName())); }
Source:
<code>public void done() { Sources sources = null; try { sources = get(); } catch (InterruptedException | ExecutionException ex) { Throwable cause = ex.getCause(); if (cause != null) { logger.log(Level.SEVERE, cause.getMessage(), cause); } else { logger.log(Level.SEVERE, ex.getMessage(), ex); } } if (sources != null) { for (Pair<String, DataSource> source : sources.dataSources) { dsCheckboxPanel.addElement(source.getKey(), null, source.getValue()); } for (Map.Entry<ARTIFACT_TYPE, Long> entry : sources.artifactTypes.entrySet()) { String dispName = entry.getKey().getDisplayName() + " (" + entry.getValue() + ")"; <START> String iconPath = "/" + IconsUtil.getIconFilePath(entry.getKey().getTypeID()); <END> Icon icon = new ImageIcon(getClass().getResource(iconPath)); atCheckboxPanel.addElement(dispName, icon, entry.getKey()); } } GeoFilterPanel.this.firePropertyChange(INITPROPERTY, false, true); }</code><technical_language>OSs path separators, \ /. Paths.get instead</technical_language>

Target:
public void done() { Sources sources = null; try { sources = get(); } catch (InterruptedException | ExecutionException ex) { Throwable cause = ex.getCause(); if (cause != null) { logger.log(Level.SEVERE, cause.getMessage(), cause); } else { logger.log(Level.SEVERE, ex.getMessage(), ex); } } if (sources != null) { for (Pair<String, DataSource> source : sources.dataSources) { dsCheckboxPanel.addElement(source.getKey(), null, source.getValue()); } for (Map.Entry<ARTIFACT_TYPE, Long> entry : sources.artifactTypes.entrySet()) { String dispName = entry.getKey().getDisplayName() + " (" + entry.getValue() + ")"; String iconPath = IconsUtil.getIconFilePath(entry.getKey().getTypeID()); Icon icon = new ImageIcon(getClass().getResource(iconPath)); atCheckboxPanel.addElement(dispName, icon, entry.getKey()); } } GeoFilterPanel.this.firePropertyChange(INITPROPERTY, false, true); }
Source:
<code>private StringBuilder format() { <START> StringBuilder sb = new StringBuilder(String.valueOf(tip)); <END> if (distance > 0) sb.append('~').append(distance); return sb; }</code><technical_language>OK StringBuilder(null) NPEs. calling format a null tip? formatting string "null~5" a valid reference name</technical_language>

Target:
private StringBuilder format() { StringBuilder sb = new StringBuilder(tip); if (distance > 0) sb.append('~').append(distance); return sb; }
Source:
<code>private static ColumnHandle toColumnHandle(Map<Symbol, ColumnHandle> assignments, Symbol symbol) { if (symbol instanceof SymbolWithSubfieldPath) { <START> SubfieldPath path = ((SymbolWithSubfieldPath) symbol).getPath(); <END> return assignments.get(path.getColumnName()).createSubfieldColumnHandle(path); } return assignments.get(symbol); }</code><technical_language>I rename getPath getSubfieldPath for clarity</technical_language>

Target:
private static ColumnHandle toColumnHandle(Map<Symbol, ColumnHandle> assignments, Symbol symbol) { if (symbol instanceof SymbolWithSubfieldPath) { SubfieldPath path = ((SymbolWithSubfieldPath) symbol).getSubfieldPath(); return assignments.get(path.getColumnName()).createSubfieldColumnHandle(path); } return assignments.get(symbol); }
Source:
<code>public TmfXmlTraceStub() { try (InputStream in = TmfXmlTraceStub.class.getResourceAsStream(DEVELOPMENT_TRACE_PARSER_PATH);) { CustomXmlTraceDefinition[] definitions = CustomXmlTraceDefinition.loadAll(in); if (definitions.length == 0) { throw new IllegalStateException("The custom trace definition does not exist"); } fTrace = new CustomXmlTrace(definitions[0]); TmfSignalManager.deregister(fTrace); this.setParser(fTrace); <START> @SuppressWarnings("null") <END> @NonNull Collection<ITmfEventAspect> criteria = TmfTrace.BASE_ASPECTS; fAspect = criteria; } catch (IOException e) { throw new IllegalStateException("Cannot open the trace parser for development traces"); } }</code><technical_language>unnecessary now, BASE_ASPECTS is annotated. Do fAspects = directly</technical_language>

Target:
public TmfXmlTraceStub() { try (InputStream in = TmfXmlTraceStub.class.getResourceAsStream(DEVELOPMENT_TRACE_PARSER_PATH);) { CustomXmlTraceDefinition[] definitions = CustomXmlTraceDefinition.loadAll(in); if (definitions.length == 0) { throw new IllegalStateException("The custom trace definition does not exist"); } fTrace = new CustomXmlTrace(definitions[0]); TmfSignalManager.deregister(fTrace); this.setParser(fTrace); Collection<ITmfEventAspect> aspects = TmfTrace.BASE_ASPECTS; fAspects = aspects; } catch (IOException e) { throw new IllegalStateException("Cannot open the trace parser for development traces"); } }
Source:
<code>public Collector<T, ImmutableSet.Builder<T>, ImmutableSet<T>> newCollector(Class<ImmutableSet<T>> type) { <START> return Collector.of(ImmutableSet.Builder::new, ImmutableSet.Builder::add, (first, second) -> first, <END> ImmutableSet.Builder::build, Collector.Characteristics.UNORDERED); }</code><technical_language>(first, second) -> combiner is making uncomfortable. throw exception silently permit unsupported parallelism</technical_language>

Target:
public Collector<T, ImmutableSet.Builder<T>, ImmutableSet<T>> newCollector(Class<ImmutableSet<T>> type) { return Collector.of(ImmutableSet.Builder::new, ImmutableSet.Builder::add, (first, second) -> { throw new UnsupportedOperationException("Parallel collecting is not supported"); }, ImmutableSet.Builder::build, Collector.Characteristics.UNORDERED); }
Source:
<code>public void initialise() { summonOreonBuilderCommand = find("summonOreonBuilderCommand", UIButton.class); summonOreonGuardCommand = find("summonOreonGuardCommand", UIButton.class); summonOreonKingCommand = find("summonOreonKingCommand", UIButton.class); summonOreonBuilderCommand.subscribe(button -> { <START> sendOreonSpawnEvent(prefabManager.getPrefab("Oreons:OreonBuilder")); <END> }); summonOreonGuardCommand.subscribe(button -> { sendOreonSpawnEvent(prefabManager.getPrefab("Oreons:OreonGuard")); }); summonOreonKingCommand.subscribe(button -> { sendOreonSpawnEvent(prefabManager.getPrefab("Oreons:OreonKing")); }); }</code><technical_language>prefab names constants</technical_language>

Target:
public void initialise() { summonOreonBuilderCommand = find(Constants.OREON_BUILDER_UI_ID, UIButton.class); summonOreonGuardCommand = find(Constants.OREON_GUARD_UI_ID, UIButton.class); summonOreonKingCommand = find(Constants.OREON_KING_UI_ID, UIButton.class); builderResourceRequired = find(Constants.OREON_BUILDER_RESOURCES_LABEL_ID, UILabel.class); guardResourceRequired = find(Constants.OREON_GUARD_RESOURCES_LABEL_ID, UILabel.class); kingResourceRequired = find(Constants.OREON_KING_RESOURCES_LABEL_ID, UILabel.class); populateUiLabels(Constants.OREON_BUILDER_PREFAB, builderResourceRequired); populateUiLabels(Constants.OREON_GUARD_PREFAB, guardResourceRequired); populateUiLabels(Constants.OREON_KING_PREFAB, kingResourceRequired); summonOreonBuilderCommand.subscribe(button -> { sendOreonSpawnEvent(prefabManager.getPrefab(Constants.OREON_BUILDER_PREFAB)); }); summonOreonGuardCommand.subscribe(button -> { sendOreonSpawnEvent(prefabManager.getPrefab(Constants.OREON_GUARD_PREFAB)); }); summonOreonKingCommand.subscribe(button -> { sendOreonSpawnEvent(prefabManager.getPrefab(Constants.OREON_KING_PREFAB)); }); }
Source:
<code>private PlanNodeStatsEstimate estimateLogicalOr(Expression left, Expression right) { PlanNodeStatsEstimate leftEstimate = process(left); if (leftEstimate.isOutputRowCountUnknown()) { return PlanNodeStatsEstimate.unknown(); } PlanNodeStatsEstimate rightEstimate = process(right); if (rightEstimate.isOutputRowCountUnknown()) { return PlanNodeStatsEstimate.unknown(); } PlanNodeStatsEstimate andEstimate = new FilterExpressionStatsCalculatingVisitor(leftEstimate, session, types).process(right); if (andEstimate.isOutputRowCountUnknown()) { return PlanNodeStatsEstimate.unknown(); } <START> return capStats( <END> subtractStats( addStatsAndSumDistinctValues(leftEstimate, rightEstimate), andEstimate), input); }</code><technical_language>nice! Thank you. appreciate I for good</technical_language>

Target:
private PlanNodeStatsEstimate estimateLogicalOr(Expression left, Expression right) { PlanNodeStatsEstimate leftEstimate = process(left); if (leftEstimate.isOutputRowCountUnknown()) { return PlanNodeStatsEstimate.unknown(); } PlanNodeStatsEstimate rightEstimate = process(right); if (rightEstimate.isOutputRowCountUnknown()) { return PlanNodeStatsEstimate.unknown(); } PlanNodeStatsEstimate andEstimate = new FilterExpressionStatsCalculatingVisitor(leftEstimate, session, types).process(right); if (andEstimate.isOutputRowCountUnknown()) { return PlanNodeStatsEstimate.unknown(); } return capStats( subtractSubsetStats( addStatsAndSumDistinctValues(leftEstimate, rightEstimate), andEstimate), input); }
Source:
<code>void onExecute() throws Exception { result.setTestName("readTable"); PreparedStatement ps = connection.prepareStatement("SELECT * FROM " + FQ_TABLE_NAME+" WHERE INSERT_DATE = ?"); ps.setTimestamp(1,timestamp); ResultSet rs = ps.executeQuery(); int totalRows = 0; while (rs.next()) { totalRows += 1; Integer myKey = rs.getInt(1); String myColumn = rs.getString(2); if (myKey != 1 || !myColumn.equals("Hello World")) { throw new Exception("Retrieved values do not " + "match the inserted " + "values"); } <START> } <END> if (totalRows != 1) { throw new Exception(totalRows + " rows fetched instead of just one."); } ps.close(); rs.close(); }</code><technical_language>nit: need "+" concatenation</technical_language>

Target:
void onExecute() throws Exception { result.setTestName("readTable"); PreparedStatement ps = connection.prepareStatement("SELECT * FROM " + FQ_TABLE_NAME+" WHERE INSERT_DATE = ?"); ps.setTimestamp(1,timestamp); ResultSet rs = ps.executeQuery(); int totalRows = 0; while (rs.next()) { totalRows += 1; Integer myKey = rs.getInt(1); String myColumn = rs.getString(2); if (myKey != 1 || !myColumn.equals("Hello World")) { throw new Exception("Retrieved values do not " + "match the inserted values"); } } if (totalRows != 1) { throw new Exception(totalRows + " rows fetched instead of just one."); } ps.close(); rs.close(); }
Source:
<code>private int removeModule(IModule[] module, IProgressMonitor monitor) throws CoreException { <START> IControllableServerBehavior beh = JBossServerBehaviorUtils.getControllableBehavior(getServer()); <END> if( beh != null ) { IPublishController pc = (IPublishController)beh.getController(IPublishController.SYSTEM_ID); if( pc instanceof IPrimaryPublishController) { return ((IPrimaryPublishController)pc).removeModule(module, monitor); } } return IServer.PUBLISH_STATE_UNKNOWN; }</code><technical_language>reuse server instance collected in publishModule()</technical_language>

Target:
private int removeModule(IModule[] module, IProgressMonitor monitor) throws CoreException { IPrimaryPublishController pc = JBossServerBehaviorUtils.getController(getServer(), IPublishController.SYSTEM_ID, IPrimaryPublishController.class); if( pc != null) { return pc.removeModule(module, monitor); } return IServer.PUBLISH_STATE_UNKNOWN; }
Source:
<code>private @Nullable RetryHolder getNextRerun() { long cursor = outSubSequence.next(); if (cursor < 0) { return null; } try { return outQueue.get(cursor); } finally { <START> outSubSequence.done(cursor); <END> } }</code><technical_language>This is a race condition. done() releases slot, written right done() right RetryHolder is retried. This lead unpredictable results. RetryHolder needs copied releasing queue slot</technical_language>

Target:
private @Nullable Retry getNextRerun() { long cursor = outSubSequence.next(); if (cursor < 0) { return null; } RetryHolder retryHolder = outQueue.get(cursor); Retry r = retryHolder.retry; retryHolder.retry = null; outSubSequence.done(cursor); return r; }
Source:
<code>public void setup() { <START> try { <END> testFieldDefinition = DummyFieldDefinitions.getComplexRecordDefinition(); testRecordReader = new DummyRecordReader(10); } catch(Exception e) { Assert.fail("Test setup failed with error: " + e.getMessage()); } }</code><technical_language>apply format template new code</technical_language>

Target:
public void setup() { try { testFieldDefinition = TestFieldDefinitions.getComplexRecordDefinition(); testRecordReader = new TestRecordReader(10); } catch (Exception e) { Assert.fail("Test setup failed with error: " + e.getMessage()); } }
Source:
<code>public void paint(Graphics g) { <START> if (System.currentTimeMillis() - lastCheck > 1000L) { <END> lastCheck = System.currentTimeMillis(); cached = GroundItems.getGroundItems().length; } PaintDebugger p = Context.getInstance().getPaintDebugger(); p.addLine("Close Ground Items: " + cached); }</code><technical_language>Paint reloaded anyways, is this required</technical_language>

Target:
public void paint(Graphics g) { PaintDebugger p = Context.getInstance().getPaintDebugger(); p.addLine("Close Ground Items: " + GroundItems.getGroundItems().length); }
Source:
<code>private IAction createHierarchicalAction() { IAction action = new Action(Messages.ControlFlowView_hierarchicalViewLabel, <START> IAction.AS_PUSH_BUTTON) { <END> @Override public void run() { ITmfTrace parentTrace = getTrace(); for (ITmfTrace trace : TmfTraceManager.getTraceSet(parentTrace)) { final ITmfStateSystem ss = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysisModule.ID); List<ControlFlowEntry> currentRootList = (List<ControlFlowEntry>)(Object)getEntryList(ss); addEntriesToHierarchicalTree(currentRootList, parentTrace, ss); refresh(); } } }; action.setToolTipText(Messages.ControlFlowView_hierarchicalViewToolTip); action.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(IControlflowImageConstants.IMG_UI_HIERARCHICAL_VIEW)); return action; }</code><technical_language>I if radio buttons. issue found? a get work correctly, a common pattern all..</technical_language>

Target:
private IAction createHierarchicalAction() { IAction action = new Action(Messages.ControlFlowView_hierarchicalViewLabel, IAction.AS_RADIO_BUTTON) { @Override public void run() { ITmfTrace parentTrace = getTrace(); fFlatTraces.remove(parentTrace); for (ITmfTrace trace : TmfTraceManager.getTraceSet(parentTrace)) { final ITmfStateSystem ss = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysisModule.ID); List<ControlFlowEntry> currentRootList = (List<ControlFlowEntry>) (Object) getEntryList(ss); addEntriesToHierarchicalTree(currentRootList, parentTrace, ss); refresh(); } } }; action.setChecked(true); action.setToolTipText(Messages.ControlFlowView_hierarchicalViewToolTip); action.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(IControlflowImageConstants.IMG_UI_HIERARCHICAL_VIEW)); return action; }
Source:
<code><START> public static Schema getAttributeKeySchema(final Set<Integer> keys, final Schema schema) { <END> Schema keySchema = Schema.EMPTY_SCHEMA; for (int key : keys) { keySchema = Schema.appendColumn(keySchema, schema.getColumnType(key), schema.getColumnName(key)); } return keySchema; }</code><technical_language>return schema.getSubSchema(Ints.toArray(keys));</technical_language>

Target:
public static Schema getAttributeKeySchema(final Set<Integer> keys, final Schema schema) { return schema.getSubSchema(Ints.toArray(keys)); }
Source:
<code>public void testProcessQueryJsonApi() { String query = "/group?sort=commonName&fields%5Bgroup%5D=commonName,description"; ElideResponse response = mock(ElideResponse.class); when(queryObj.getQuery()).thenReturn(query); when(queryObj.getQueryType()).thenReturn(QueryType.JSONAPI_V1_0); when(elide.get(anyString(), any(), any(), anyString())).thenReturn(response); when(response.getResponseCode()).thenReturn(200); String testStr = "{\"data\": []}"; <START> String testStr1 = "responseBody"; <END> when(response.getBody()).thenReturn(testStr); queryThread.processQuery(); verify(asyncQueryDao, times(1)).updateStatus(queryObj, QueryStatus.PROCESSING); verify(asyncQueryDao, times(1)).updateStatus(queryObj, QueryStatus.COMPLETE); verify(asyncQueryDao, times(1)).updateAsyncQueryResult(any(), any()); }</code><technical_language>testStr1 is in test case anywhere</technical_language>

Target:
public void testProcessQueryJsonApi() { String query = "/group?sort=commonName&fields%5Bgroup%5D=commonName,description"; ElideResponse response = mock(ElideResponse.class); when(queryObj.getQuery()).thenReturn(query); when(queryObj.getQueryType()).thenReturn(QueryType.JSONAPI_V1_0); when(elide.get(anyString(), any(), any(), anyString())).thenReturn(response); when(response.getResponseCode()).thenReturn(200); when(response.getBody()).thenReturn("responseBody"); queryThread.processQuery(); verify(asyncQueryDao, times(1)).updateStatus(queryObj, QueryStatus.PROCESSING); verify(asyncQueryDao, times(1)).updateStatus(queryObj, QueryStatus.COMPLETE); verify(asyncQueryDao, times(1)).updateAsyncQueryResult(any(), any()); }
Source:
<code>public boolean supports(List<String> uriList, String method) { if (!allowedRequestMethods.contains(RequestMethod.valueOf(method))) { return false; } for (String string : uriList) { <START> if (!(StringUtils.contains(string, "api/integration/externalsources") && <END> StringUtils.contains(string, "entryValues"))) { return false; } } return true; }</code><technical_language>hardcoding this string path, ExternalSourceRest.CATEGORY ExternalSourceRest.PLURAL_NAME</technical_language>

Target:
public boolean supports(List<String> uriList, String method) { if (!allowedRequestMethods.contains(RequestMethod.valueOf(method))) { return false; } for (String string : uriList) { if (!(StringUtils.contains(string, ExternalSourceRest.CATEGORY + "/" + ExternalSourceRest.PLURAL_NAME) && StringUtils.contains(string, "entryValues"))) { return false; } } return true; }
Source:
<code>public void shouldCreateCorrectPayload() { String payload = stripeTransferInRequest.getGatewayOrder().getPayload(); assertThat(payload, containsString("destination=" + stripePlatformAccountId)); assertThat(payload, containsString("amount=" + refundAmount)); <START> assertThat(payload, containsString("transfer_group=" + chargeExternalId)); <END> }</code><technical_language>check currency ? Fine verify expand[] properties if is real case, good for test completeness</technical_language>

Target:
public void shouldCreateCorrectPayload() { String payload = stripeTransferInRequest.getGatewayOrder().getPayload(); assertThat(payload, containsString("destination=" + stripePlatformAccountId)); assertThat(payload, containsString("amount=" + refundAmount)); assertThat(payload, containsString("transfer_group=" + chargeExternalId)); assertThat(payload, containsString("expand%5B%5D=balance_transaction")); assertThat(payload, containsString("expand%5B%5D=destination_payment")); assertThat(payload, containsString("currency=GBP")); }
Source:
<code>public boolean equals(final Object obj) { <START> if (this == obj) { <END> return true; } if (!super.equals(obj)) { return false; } if (this.getClass() != obj.getClass()) { return false; } final DeviceConverter other = (DeviceConverter) obj; if (this.helper == null) { if (other.helper != null) { return false; } } else if (!this.helper.equals(other.helper)) { return false; } return true; }</code><technical_language>java.util.Objects.equals</technical_language>

Target:
public boolean equals(final Object obj) { return super.equals(obj) && Objects.equals(this.helper, ((DeviceConverter) obj).helper); }
Source:
<code>public void simplePoll() throws Exception { DefaultSchedulerMessageSource schedulerMessageSource = createMessageSource(); SensingNullMessageProcessor flow = getSensingNullMessageProcessor(); schedulerMessageSource.setListener(flow); schedulerMessageSource.setAnnotations(singletonMap(LOCATION_KEY, TEST_CONNECTOR_LOCATION)); doAnswer(invocationOnMock -> { CoreEvent inputEvent = invocationOnMock.getArgument(0); flow.process(inputEvent); return null; }).when(sourcePolicy).process(any(CoreEvent.class), any(), any()); schedulerMessageSource.trigger(); <START> new PollingProber(120000, 100).check(new Probe() { <END> @Override public boolean isSatisfied() { return flow.event != null; } @Override public String describeFailure() { return "flow event never set by the source flow"; } }); }</code><technical_language>is RECEIVE_TIMEOUT low</technical_language>

Target:
public void simplePoll() throws Exception { DefaultSchedulerMessageSource schedulerMessageSource = createMessageSource(); SensingNullMessageProcessor flow = getSensingNullMessageProcessor(); schedulerMessageSource.setListener(flow); schedulerMessageSource.setAnnotations(singletonMap(LOCATION_KEY, TEST_CONNECTOR_LOCATION)); doAnswer(invocationOnMock -> { CoreEvent inputEvent = invocationOnMock.getArgument(0); flow.process(inputEvent); return null; }).when(sourcePolicy).process(any(CoreEvent.class), any(), any()); schedulerMessageSource.trigger(); new PollingProber(RECEIVE_TIMEOUT, 100).check(new Probe() { @Override public boolean isSatisfied() { return flow.event != null; } @Override public String describeFailure() { return "flow event never set by the source flow"; } }); }
Source:
<code>public void initialize() { <START> channelListView.setOnMouseClicked(event -> { <END> preferencesService.getPreferences().getChat().removeAutoJoinChannel((channelListView.getSelectionModel().getSelectedItem())); channelListView.getSelectionModel().clearSelection(); preferencesService.storeInBackground(); }); channelListView.setItems(preferencesService.getPreferences().getChat().getAutoJoinChannels()); }</code><technical_language>convention, define onMouseClicked method called in FXML</technical_language>

Target:
public void initialize() { channelListView.setItems(preferencesService.getPreferences().getChat().getAutoJoinChannels()); removeButton.visibleProperty().bind(channelListView.getSelectionModel().selectedItemProperty().isNotNull()); }
Source:
<code>byte[] toBytes() { <START> int size = VERSION_SIZE + STORE_ID_SIZE + storeId.length() + INCARNATION_ID_SIZE + <END> ((incarnationId == null) ? 0 : incarnationId.toString().getBytes().length); byte[] buf = new byte[size]; ByteBuffer bufWrap = ByteBuffer.wrap(buf); bufWrap.putShort((short) VERSION); bufWrap.putInt(storeId.length()); bufWrap.put(storeId.getBytes()); byte[] incarnationIdInBytes = incarnationId == null ? null : incarnationId.toString().getBytes(); bufWrap.putInt(incarnationIdInBytes == null ? 0 : incarnationIdInBytes.length); if (incarnationIdInBytes != null) { bufWrap.put(incarnationIdInBytes); } return buf; }</code><technical_language>storeId.getBytes().length</technical_language>

Target:
private byte[] toBytes() { byte[] incarnationIdBytes = incarnationId.toString().getBytes(); int size = VERSION_SIZE + INCARNATION_ID_LENGTH_SIZE + incarnationIdBytes.length; byte[] buf = new byte[size]; ByteBuffer bufWrap = ByteBuffer.wrap(buf); bufWrap.putShort(VERSION_0); bufWrap.putInt(incarnationIdBytes.length); bufWrap.put(incarnationIdBytes); return buf; }
Source:
<code>public ClassAttributeLink(LineAssociation layout, Association assoc, Classifier fromClass, Classifier toClass) throws UnexpectedEndException { super(layout); type = "attribute"; name = assoc.getLabel(); from = null; to = null; for (Property end : assoc.getMemberEnds()) { Class endClass = (Class) end.getType(); if (endClass == toClass && to == null) { to = new AssociationEnd(end); } else if (endClass == fromClass && from == null) { from = new AssociationEnd(end); } else { throw new UnexpectedEndException(end.getName()); } <START> } <END> }</code><technical_language><del>Maybe member ends retrieved [getOwnedEnd](<LINK_0>,%20org.eclipse.uml2.uml.Type)) method. requires name of property.</del> <del>[Check if property names known]</del> -</technical_language>

Target:
public ClassAttributeLink(LineAssociation layout, Association assoc, Classifier fromClass, Classifier toClass) throws UnexpectedEndException { super(layout); name = assoc.getLabel(); from = null; to = null; for (Property end : assoc.getMemberEnds()) { Class endClass = (Class) end.getType(); if (endClass == toClass && to == null) { to = new AssociationEnd(end); } else if (endClass == fromClass && from == null) { from = new AssociationEnd(end); } else { throw new UnexpectedEndException(end.getName()); } } }
Source:
<code>private void addBranchItemsForRemote(String remote) throws IOException, URISyntaxException { RemoteConfig remoteConfig = new RemoteConfig(myConfig, remote); List<RefSpec> fetchSpecs = remoteConfig.getFetchRefSpecs(); if (fetchSpecs.isEmpty()) { <START> addBranchItemsForLocal(); <END> return; } Collection<Ref> allRefs = myRepository.getRefDatabase() .getRefs(Constants.R_REFS).values(); for (Ref ref : allRefs) { for (RefSpec fetchSpec : fetchSpecs) { if (fetchSpec.matchDestination(ref)) { RefSpec source = fetchSpec.expandFromDestination(ref); String refNameOnRemote = source.getSource(); branchText.add(refNameOnRemote); } } } }</code><technical_language>purpose of showing local branches for a remote</technical_language>

Target:
private void addBranchItemsForRemote(String remote) throws IOException, URISyntaxException { RemoteConfig remoteConfig = new RemoteConfig(myConfig, remote); List<RefSpec> fetchSpecs = remoteConfig.getFetchRefSpecs(); if (fetchSpecs.isEmpty()) { return; } Collection<Ref> allRefs = myRepository.getRefDatabase() .getRefs(Constants.R_REFS).values(); for (Ref ref : allRefs) { for (RefSpec fetchSpec : fetchSpecs) { if (fetchSpec.matchDestination(ref)) { RefSpec source = fetchSpec.expandFromDestination(ref); String refNameOnRemote = source.getSource(); branchText.add(refNameOnRemote); } } } }
Source:
<code>private void close(final boolean clean) { if (state() == State.CREATED || state() == State.RUNNING) { if (clean) { stateMgr.checkpoint(Collections.emptyMap()); offsetSnapshotSinceLastCommit = new HashMap<>(stateMgr.changelogOffsets()); } executeAndMaybeSwallow( clean, () -> StateManagerUtil.closeStateManager( log, logPrefix, clean, eosEnabled, stateMgr, stateDirectory, TaskType.STANDBY ), "state manager close", log ); } else if (state() == State.CLOSED) { log.trace("Skip closing since state is {}", state()); return; } else { <START> throw new IllegalStateException("Illegal state " + state() + " while closing standby task " + id); <END> } closeTaskSensor.record(); transitionTo(State.CLOSED); }</code><technical_language>Illegal state -> Unknown state</technical_language>

Target:
private void close(final boolean clean) { switch (state()) { case CREATED: case RUNNING: if (clean) { stateMgr.checkpoint(Collections.emptyMap()); offsetSnapshotSinceLastCommit = new HashMap<>(stateMgr.changelogOffsets()); } executeAndMaybeSwallow( clean, () -> StateManagerUtil.closeStateManager( log, logPrefix, clean, eosEnabled, stateMgr, stateDirectory, TaskType.STANDBY ), "state manager close", log ); break; case CLOSED: log.trace("Skip closing since state is {}", state()); return; case RESTORING: case SUSPENDED: throw new IllegalStateException("Illegal state " + state() + " while closing standby task " + id); default: throw new IllegalStateException("Unknown state " + state() + " while closing standby task " + id); } closeTaskSensor.record(); transitionTo(State.CLOSED); }
Source:
<code>private void initiateChunkDeletesIfAny(final String blobId) { Callback<GetBlobResultInternal> callback = new Callback<GetBlobResultInternal>() { @Override public void onCompletion(GetBlobResultInternal result, Exception exception) { if (exception != null) { logger.error( "Encountered exception when attempting to get chunks of a possibly composite deleted blob" + blobId, exception); } else if (result.getBlobResult != null) { logger.error("Unexpected result returned by background get operation to fetch chunk ids."); } else if (result.storeKeys != null) { <START> List<String> idsToDelete = new ArrayList<>(); <END> for (StoreKey key : result.storeKeys) { idsToDelete.add(key.getID()); } initiateBackgroundDeletes(idsToDelete); } currentBackgroundOperationsCount.decrementAndGet(); } }; currentOperationsCount.incrementAndGet(); currentBackgroundOperationsCount.incrementAndGet(); GetBlobOptionsInternal options = new GetBlobOptionsInternal(new GetBlobOptions(GetBlobOptions.OperationType.Data, GetOption.Include_All, null), true); backgroundDeleter.getBlob(blobId, options, callback); }</code><technical_language>minor: this List<StoreKey> (even PutManager array of StoreKey converts String). Keeping List<StoreKey> letting initiateBackgroundDeletes() do toID() save this operation</technical_language>

Target:
private void initiateChunkDeletesIfAny(final String blobId) { Callback<GetBlobResultInternal> callback = new Callback<GetBlobResultInternal>() { @Override public void onCompletion(GetBlobResultInternal result, Exception exception) { if (exception != null) { logger.error( "Encountered exception when attempting to get chunks of a possibly composite deleted blob" + blobId, exception); } else if (result.getBlobResult != null) { logger.error("Unexpected result returned by background get operation to fetch chunk ids."); } else if (result.storeKeys != null) { initiateBackgroundDeletes(result.storeKeys); } currentBackgroundOperationsCount.decrementAndGet(); } }; currentOperationsCount.incrementAndGet(); currentBackgroundOperationsCount.incrementAndGet(); GetBlobOptionsInternal options = new GetBlobOptionsInternal(new GetBlobOptions(GetBlobOptions.OperationType.Data, GetOption.Include_All, null), true); backgroundDeleter.getBlob(blobId, options, callback); }
Source:
<code><START> protected void addOriginEntriesForCorpCardPersonalExpenseDebitLines(Consumer<OriginEntryFull> entryConsumer) { <END> if (consolidatedCorpCardPersonalExpenseDebits.isEmpty()) { return; } KualiDecimal netCashAmount = calculateTotalCashAmountNotOffsetByCashAdvances(); KualiDecimal currentReimbursableCashAmount = netCashAmount; for (List<ConcurStandardAccountingExtractDetailLine> corpCardPersonalDebits : consolidatedCorpCardPersonalExpenseDebits.values()) { KualiDecimal totalSubGroupAmount = calculateTotalAmountForLines(corpCardPersonalDebits); if (totalSubGroupAmount.isZero()) { continue; } ConcurStandardAccountingExtractDetailLine firstDebitLine = corpCardPersonalDebits.get(0); KualiDecimal newReimbursableCashAmount = currentReimbursableCashAmount.subtract(totalSubGroupAmount); KualiDecimal cashOffsetAdjustment = totalSubGroupAmount; KualiDecimal personalOffsetAdjustment = KualiDecimal.ZERO; if (newReimbursableCashAmount.isNegative()) { if (currentReimbursableCashAmount.isPositive()) { cashOffsetAdjustment = currentReimbursableCashAmount; personalOffsetAdjustment = newReimbursableCashAmount.negated(); } else { cashOffsetAdjustment = KualiDecimal.ZERO; personalOffsetAdjustment = totalSubGroupAmount; } } if (cashOffsetAdjustment.isNonZero()) { addOriginEntryForCorpCardPersonalExpense( entryConsumer, firstDebitLine, collectorHelper.getCashOffsetObjectCode(), cashOffsetAdjustment); } if (personalOffsetAdjustment.isNonZero()) { addOriginEntryForCorpCardPersonalExpense( entryConsumer, firstDebitLine, collectorHelper.getPersonalOffsetObjectCode(), personalOffsetAdjustment); } currentReimbursableCashAmount = newReimbursableCashAmount; } }</code><technical_language>This is a pretty long function, refactored some smaller functions</technical_language>

Target:
protected void addOriginEntriesForCorpCardPersonalExpenseDebitLines(Consumer<OriginEntryFull> entryConsumer) { if (consolidatedCorpCardPersonalExpenseDebits.isEmpty()) { return; } KualiDecimal netCashAmount = calculateTotalCashAmountNotOffsetByCashAdvances(); KualiDecimal currentReimbursableCashAmount = netCashAmount; for (List<ConcurStandardAccountingExtractDetailLine> corpCardPersonalDebits : consolidatedCorpCardPersonalExpenseDebits.values()) { KualiDecimal totalSubGroupAmount = calculateTotalAmountForLines(corpCardPersonalDebits); if (totalSubGroupAmount.isZero()) { continue; } KualiDecimal newReimbursableCashAmount = currentReimbursableCashAmount.subtract(totalSubGroupAmount); KualiDecimal cashOffsetAdjustment = calculateCashOffsetAdjustmentForCorpCardPersonalExpenseSubGroup( totalSubGroupAmount, currentReimbursableCashAmount, newReimbursableCashAmount); KualiDecimal personalOffsetAdjustment = calculatePersonalOffsetAdjustmentForCorpCardPersonalExpenseSubGroup( totalSubGroupAmount, currentReimbursableCashAmount, newReimbursableCashAmount); addOriginEntriesForCorpCardPersonalExpenseDebitLinesIfNecessary( entryConsumer, corpCardPersonalDebits, cashOffsetAdjustment, personalOffsetAdjustment); currentReimbursableCashAmount = newReimbursableCashAmount; } }
Source:
<code>public List<CertificationCriterionEntity> getRetiredTestTools(Long cpId) { Query query = entityManager.createQuery( "SELECT c FROM CertificationCriterionEntity c " + "LEFT JOIN c.certificationResult cr " + "LEFT JOIN cr.certifiedProduct cp " + "LEFT JOIN cr.certificationResultTestTool crtt " + "LEFT JOIN crtt.testTool tt " + "WHERE (tt.retired = true AND cp.icsCode = '1') AND c.deleted = false AND cp.id = :cpId)" <START> , CertificationCriterionEntity.class); <END> query.setParameter("cpId", cpId); List<CertificationCriterionEntity> result = query.getResultList(); return result; }</code><technical_language>icsCode >= 1</technical_language>

Target:
public List<CertificationCriterionEntity> getRetiredTestTools(Long cpId) { Query query = entityManager.createQuery( "SELECT c FROM CertificationCriterionEntity c " + "LEFT JOIN c.certificationResult cr " + "LEFT JOIN cr.certifiedProduct cp " + "LEFT JOIN cr.certificationResultTestTool crtt " + "LEFT JOIN crtt.testTool tt " + "WHERE (tt.retired = true AND CAST(cp.icsCode as integer) >= 1) AND c.deleted = false AND cp.id = :cpId)" , CertificationCriterionEntity.class); query.setParameter("cpId", cpId); List<CertificationCriterionEntity> result = query.getResultList(); return result; }