auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public HelixParticipantTest() throws Exception { List<com.github.ambry.utils.TestUtils.ZkInfo> zkInfoList = new ArrayList<>(); zkInfoList.add(new com.github.ambry.utils.TestUtils.ZkInfo(null, "DC0", (byte) 0, 2199, false)); JSONObject zkJson = constructZkLayoutJSON(zkInfoList); props = new Properties(); props.setProperty("clustermap.host.name", "localhost"); props.setProperty("clustermap.port", "2200"); props.setProperty("clustermap.cluster.name", clusterName); props.setProperty("clustermap.datacenter.name", "DC0"); props.setProperty("clustermap.dcs.zk.connect.strings", zkJson.toString(2)); <START> propsDummy = new Properties(props); <END> propsDummy.setProperty("clustermap.host.name", "dummyHost"); propsDummy.setProperty("clustermap.port", "2200"); propsDummy.setProperty("clustermap.cluster.name", clusterName); propsDummy.setProperty("clustermap.datacenter.name", "DC0"); propsDummy.setProperty("clustermap.dcs.zk.connect.strings", zkJson.toString(2)); helixManagerFactory = new MockHelixManagerFactory(); }</code><technical_language>this is in test, this created in test? I prefer</technical_language>

Target:
public HelixParticipantTest() throws Exception { List<com.github.ambry.utils.TestUtils.ZkInfo> zkInfoList = new ArrayList<>(); zkInfoList.add(new com.github.ambry.utils.TestUtils.ZkInfo(null, "DC0", (byte) 0, 2199, false)); zkJson = constructZkLayoutJSON(zkInfoList); props = new Properties(); props.setProperty("clustermap.host.name", "localhost"); props.setProperty("clustermap.port", "2200"); props.setProperty("clustermap.cluster.name", clusterName); props.setProperty("clustermap.datacenter.name", "DC0"); props.setProperty("clustermap.dcs.zk.connect.strings", zkJson.toString(2)); helixManagerFactory = new MockHelixManagerFactory(); }
Source:
<code>public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException { <START> return wrapped.createSocket(s, host, port, autoClose); <END> }</code><technical_language>returning it, pass created socket setSslParams(Socket) method, other variants do. While this, I (aka IDE) noticed this variant recurses infinitely: public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException { Socket socket = createSocket(address, port, localAddress, localPort); setSslParams(socket); return socket; } call createSocket call changed wrapped.createSocket(...) Do mind fixing in this pull request</technical_language>

Target:
public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException { Socket socket = wrapped.createSocket(s, host, port, autoClose); setSslParams(socket); return socket; }
Source:
<code>public PID fetchContainer(PID child, Resource membershipRelation) { Resource relationship = (membershipRelation != null) ? membershipRelation : PcdmModels.hasMember; String queryString = String.format( "select ?pid where { ?pid <%1$s> <%2$s> }", relationship, child.getURI()); Query query = QueryFactory.create(queryString); <START> try (QueryExecution qexec = QueryExecutionFactory.sparqlService("http://localhost:8080/fuseki/test/query", query)) { <END> ResultSet results = qexec.execSelect(); for (; results.hasNext();) { QuerySolution soln = results.nextSolution(); Resource res = soln.getResource("pid"); if (res != null) { return PIDs.get(res.getURI()); } } } return null; }</code><technical_language>sparql endpoint uri instance variable for class</technical_language>

Target:
public PID fetchContainer(PID child, Resource membershipRelation) { Resource relationship = (membershipRelation != null) ? membershipRelation : PcdmModels.hasMember; String queryString = String.format( "select ?pid where { ?pid <%1$s> <%2$s> }", relationship, child.getURI()); Query query = QueryFactory.create(queryString); try (QueryExecution qexec = QueryExecutionFactory.sparqlService(fusekiQueryURL, query)) { ResultSet results = qexec.execSelect(); for (; results.hasNext();) { QuerySolution soln = results.nextSolution(); Resource res = soln.getResource("pid"); if (res != null) { return PIDs.get(res.getURI()); } } } return null; }
Source:
<code>private void checkObjectCollision(PackedObjectInfo obj) throws IOException { ObjectTypeAndSize info = openDatabase(obj, new ObjectTypeAndSize()); final byte[] readBuffer = buffer(); final byte[] curBuffer = new byte[readBuffer.length]; long sz = info.size; long szForRecord = sz; try (ObjectStream cur = readCurs.open(obj, info.type).openStream()) { if (cur.getSize() != sz) { throw new IOException(MessageFormat.format( JGitText.get().collisionOn, obj.name())); } try (InputStream pck = inflate(Source.DATABASE, sz)) { while (0 < sz) { int n = (int) Math.min(readBuffer.length, sz); IO.readFully(cur, curBuffer, 0, n); IO.readFully(pck, readBuffer, 0, n); for (int i = 0; i < n; i++) { if (curBuffer[i] != readBuffer[i]) { throw new IOException(MessageFormat.format( JGitText.get().collisionOn, obj.name())); } } sz -= n; } } <START> stats.increaseNumBytesDuplicated(szForRecord); <END> stats.incrementObjectsDuplicated(); } catch (MissingObjectException notLocal) { } }</code><technical_language>nit: info.size avoid a local. Actually... sz is inflated size, want compressed size of data wire redundant. I this require instrumenting InflaterStream</technical_language>

Target:
private void checkObjectCollision(PackedObjectInfo obj) throws IOException { ObjectTypeAndSize info = openDatabase(obj, new ObjectTypeAndSize()); final byte[] readBuffer = buffer(); final byte[] curBuffer = new byte[readBuffer.length]; long sz = info.size; try (ObjectStream cur = readCurs.open(obj, info.type).openStream()) { if (cur.getSize() != sz) { throw new IOException(MessageFormat.format( JGitText.get().collisionOn, obj.name())); } try (InputStream pck = inflate(Source.DATABASE, sz)) { while (0 < sz) { int n = (int) Math.min(readBuffer.length, sz); IO.readFully(cur, curBuffer, 0, n); IO.readFully(pck, readBuffer, 0, n); for (int i = 0; i < n; i++) { if (curBuffer[i] != readBuffer[i]) { throw new IOException(MessageFormat.format( JGitText.get().collisionOn, obj.name())); } } sz -= n; } } stats.incrementObjectsDuplicated(); stats.increaseNumBytesDuplicated(obj.getSize()); } catch (MissingObjectException notLocal) { } }
Source:
<code>public void testGettingOfSpecialFields() throws Exception { <START> RulesetManagementInterface underTest = new RulesetManagement(); <END> underTest.load(new File("src/test/resources/testAnExtensiveRulesetCanBeLoaded.xml")); assertThat(underTest.getIdsOfKeysForSpecialField(SpecialField.TITLE), contains("TitleDocMain")); assertThat(underTest.getIdsOfKeysForSpecialField(SpecialField.AUTHOR_LAST_NAME), contains("Person/LastName")); }</code><technical_language>suggestion RulesetManagement rulesetManagement= new RulesetManagement();</technical_language>

Target:
public void testGettingOfSpecialFields() throws Exception { RulesetManagement rulesetManagement= new RulesetManagement(); rulesetManagement.load(new File("src/test/resources/testAnExtensiveRulesetCanBeLoaded.xml")); assertThat("TitleDocMain was not found!", rulesetManagement.getFunctionalKeys(FunctionalMetadata.TITLE), contains("TitleDocMain")); assertThat("Person@LastName was not found!", rulesetManagement.getFunctionalKeys(FunctionalMetadata.AUTHOR_LAST_NAME), contains("Person@LastName")); assertThat("Something was found!", rulesetManagement.getFunctionalKeys(FunctionalMetadata.DATA_SOURCE), is(empty())); assertThat("shelfmarksource was not found!", rulesetManagement.getFunctionalKeys(FunctionalMetadata.RECORD_IDENTIFIER), contains("shelfmarksource")); assertThat("shelfmarksource was not found!", rulesetManagement.getFunctionalKeys(FunctionalMetadata.HIGHERLEVEL_IDENTIFIER), contains("shelfmarksource")); }
Source:
<code>protected int doWork() { try { <START> final ReferenceSequenceFile refSeq = ReferenceSequenceFileFactory.getReferenceSequenceFile(REFERENCE_SEQUENCE); <END> final ExtendedIlluminaManifest manifest = new ExtendedIlluminaManifest(EXTENDED_ILLUMINA_MANIFEST); final VCFHeader vcfHeader = createVCFHeader(manifest, infiniumGTCFile, gtcGender, CLUSTER_FILE, REFERENCE_SEQUENCE, refSeq.getSequenceDictionary()); final SortingCollection<VariantContext> contexts = SortingCollection.newInstance( VariantContext.class, new VCFRecordCodec(vcfHeader), new VariantContextComparator(refSeq.getSequenceDictionary()), MAX_RECORDS_IN_RAM, TMP_DIR); fillContexts(contexts, infiniumGTCFile, manifest, infiniumEGTFile); writeVcf(contexts, OUTPUT, refSeq.getSequenceDictionary(), vcfHeader); } catch (final IOException ioe) { throw new RuntimeIOException(ioe); } return 0; }</code><technical_language>put a try-with-resources block ensure closing</technical_language>

Target:
protected int doWork() { final Build37ExtendedIlluminaManifest manifest = setupAndGetManifest(); final VCFHeader vcfHeader = createVCFHeader(manifest, infiniumGTCFile, gtcGender, CLUSTER_FILE, REFERENCE_SEQUENCE, refSeq.getSequenceDictionary()); final SortingCollection<VariantContext> contexts = SortingCollection.newInstance( VariantContext.class, new VCFRecordCodec(vcfHeader), new VariantContextComparator(refSeq.getSequenceDictionary()), MAX_RECORDS_IN_RAM, TMP_DIR.stream().map(File::toPath).toArray(Path[]::new)); fillContexts(contexts, infiniumGTCFile, manifest, infiniumEGTFile); writeVcf(contexts, OUTPUT, refSeq.getSequenceDictionary(), vcfHeader); return 0; }
Source:
<code>void forceResize () { long topHandle = topHandle (); GtkRequisition requisition = new GtkRequisition (); GtkAllocation allocation = new GtkAllocation (); OS.gtk_widget_get_allocation(topHandle, allocation); <START> gtk_widget_size_request (topHandle, requisition); <END> OS.gtk_widget_size_allocate (topHandle, allocation); }</code><technical_language>this line moved purpose accident</technical_language>

Target:
void forceResize () { long topHandle = topHandle (); GtkRequisition requisition = new GtkRequisition (); gtk_widget_size_request (topHandle, requisition); GtkAllocation allocation = new GtkAllocation (); OS.gtk_widget_get_allocation(topHandle, allocation); OS.gtk_widget_size_allocate (topHandle, allocation); }
Source:
<code>public void getTokenForEmbedCodes(List<String> embedCodes, EmbedTokenGeneratorCallback callback) { String embedCodesString = ""; for (String ec : embedCodes) { <START> if(ec.equals("")) embedCodesString += ","; <END> embedCodesString += ec; } HashMap<String, String> params = new HashMap<String, String>(); params.put("account_id", ACCOUNT_ID); String uri = "/sas/embed_token/" + PCODE + "/" + embedCodesString; EmbeddedSecureURLGenerator urlGen = new EmbeddedSecureURLGenerator(APIKEY, SECRET); URL tokenUrl = urlGen.secureURL("<LINK_0>", uri, params); callback.setEmbedToken(tokenUrl.toString()); }</code><technical_language>please separate this out lines braces</technical_language>

Target:
public void getTokenForEmbedCodes(List<String> embedCodes, EmbedTokenGeneratorCallback callback) { String embedCodesString = ""; for (String ec : embedCodes) { if (ec.equals("")) { embedCodesString += ","; } embedCodesString += ec; } HashMap<String, String> params = new HashMap<String, String>(); params.put("account_id", ACCOUNT_ID); String uri = "/sas/embed_token/" + PCODE + "/" + embedCodesString; EmbeddedSecureURLGenerator urlGen = new EmbeddedSecureURLGenerator(APIKEY, SECRET); URL tokenUrl = urlGen.secureURL("<LINK_0>", uri, params); callback.setEmbedToken(tokenUrl.toString()); }
Source:
<code>public boolean onInterceptTouchEvent(MotionEvent e) { int x = Math.round(e.getRawX()); int y = Math.round(e.getRawY()); try { scrollView.getGlobalVisibleRect(scrollViewRect); boolean touchedScrollView = x > scrollViewRect.left && x < scrollViewRect.right && y > scrollViewRect.top && y < scrollViewRect.bottom; boolean emptyTruncateText = songTruncated.isEmpty(); boolean isTextTruncated = songTruncated.endsWith("…"); switch (e.getAction()) { case MotionEvent.ACTION_DOWN: if (!touchedScrollView || (!emptyTruncateText && !isTextTruncated)){ scrollView.cancelPendingInputEvents(); return false; } startX = e.getX(); startY = e.getY(); isTap = true; onTouchEvent(e); break; case MotionEvent.ACTION_MOVE: float distanceY = Math.abs(e.getY() - startY); if (touchedScrollView) { float distance = Math.abs(e.getX() - startX); if (distance > MAX_CLICK_DISTANCE) { if (!emptyTruncateText){ textView.setText(song); }else{ Log.e("E/TouchInterceptFL","songTruncated is empty or null. Did you remember " + "to set the song string when setting the song name in your text view?"); } <START> cancelPendingInputEvents(); <END> cancelLongPress(); scrollView.cancelLongPress(); scrollView.cancelPendingInputEvents(); isTap = false; } } if (distanceY > MAX_VERTICAL_DISTANCE) { cancelLongPress(); cancelPendingInputEvents(); scrollView.cancelLongPress(); scrollView.cancelPendingInputEvents(); isTap = false; } break; case MotionEvent.ACTION_UP: if (touchedScrollView) { if (isTap) onTouchEvent(e); } break; } return false; }catch (NullPointerException exception) { Log.e(TAG, NULL_VIEWS_EXCEPTION_MESSAGE); Log.e(TAG, exception.toString()); onTouchEvent(e); return false; } }</code><technical_language>This chunk of code is identical block of code for handling vertical scrolling below. pull out a private method something</technical_language>

Target:
public boolean onInterceptTouchEvent(MotionEvent e) { int x = Math.round(e.getRawX()); int y = Math.round(e.getRawY()); scrollView = getTouchInterceptHorizontalScrollView(); scrollView.getGlobalVisibleRect(scrollViewRect); boolean touchedScrollView = x > scrollViewRect.left && x < scrollViewRect.right && y > scrollViewRect.top && y < scrollViewRect.bottom; if (scrollView.isScrollable()) { switch (e.getAction() & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: if (!touchedScrollView) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { scrollView.cancelPendingInputEvents(); } else { scrollView.cancelLongPress(); } return false; } startX = e.getX(); isTap = true; onTouchEvent(e); break; case MotionEvent.ACTION_MOVE: if (touchedScrollView) { float distance = Math.abs(e.getX() - startX); if (distance > MAX_CLICK_DISTANCE) { isTap = false; cancelLongClick(); } } break; case MotionEvent.ACTION_CANCEL: if (e.getX() != 0) { cancelLongClick(); } break; case MotionEvent.ACTION_UP: if (touchedScrollView && isTap) { onTouchEvent(e); } break; } return false; } if (touchedScrollView) { if (e.getAction() == MotionEvent.ACTION_CANCEL && e.getX() != 0) { cancelLongClick(); } onTouchEvent(e); } return false; }
Source:
<code>public void init(ServletConfig config) throws ServletException { <START> AuthenticationHandler.setSystemProperties("krb5.conf"); <END> try { AuthenticationHandler.initialize(); } catch (GSSException | LoginException | PrivilegedActionException e) { log.error("Error when creating gss credentials ." + e); } }</code><technical_language>constants</technical_language>

Target:
public void init(ServletConfig config) throws ServletException { AuthenticationHandlerUtil.setSystemProperties("krb5.conf"); try { AuthenticationHandlerUtil.initialize(); } catch (GSSException | LoginException | PrivilegedActionException e) { log.error("Error when creating gss credentials .", e); throw new ServletException("Error when creating gss credentials ."); } }
Source:
<code>public ThreadPoolBulkheadConfig build() { if (config.maxThreadPoolSize < config.coreThreadPoolSize) { throw new IllegalArgumentException( "maxThreadPoolSize must be a greater than or equals to coreThreadPoolSize"); } if (contextPropagatorClasses.length > 0) { config.contextPropagators = stream(contextPropagatorClasses) .map(c -> instantiateClassDefConstructor(c)) .collect(toList()); } <START> if (contextPropagators.size() > 0){ <END> config.contextPropagators = this.contextPropagators; } return config; }</code><technical_language>this a combined/merged list of ContextPropagators configured Class<? extends ContextPropagator> ContextPropagator. ContextPropagators overwritten, or? do think</technical_language>

Target:
public ThreadPoolBulkheadConfig build() { if (config.maxThreadPoolSize < config.coreThreadPoolSize) { throw new IllegalArgumentException( "maxThreadPoolSize must be a greater than or equals to coreThreadPoolSize"); } if (contextPropagatorClasses.length > 0) { config.contextPropagators.addAll((List)stream(contextPropagatorClasses) .map(c -> instantiateClassDefConstructor(c)) .collect(toList())); } if (contextPropagators.size() > 0){ config.contextPropagators.addAll((List)this.contextPropagators); } return config; }
Source:
<code>public List<IpAddressOrRange> ipRules() { <START> return this.innerModel().ipRules(); <END> }</code><technical_language>Collections.unmodifiableList</technical_language>

Target:
public List<IpAddressOrRange> ipRules() { return Collections.unmodifiableList(this.innerModel().ipRules()); }
Source:
<code>protected void setState(ServerState newState) { boolean updated = false; while(!updated){ ServerState currState = getState(); if (currState == ServerState.SHUTDOWN && newState != ServerState.SHUTDOWN) { throw new IllegalStateException("Server is in SHUTDOWN state. Can't be changed"); } <START> updated = state.compareAndSet(currState, newState); <END> } }</code><technical_language>updateAndGet. removes boilerplate code</technical_language>

Target:
protected void setState(ServerState newState) { state.updateAndGet(currState -> { if (currState == ServerState.SHUTDOWN && newState != ServerState.SHUTDOWN) { throw new IllegalStateException("Server is in SHUTDOWN state. Can't be changed"); } return newState; }); }
Source:
<code>public void getAllTickersShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); <START> return null; <END> } }).build(); final TickerService tickerService = adapter.create(TickerService.class); tickerService.getAllTickers(new RetrofitPromise<List<Ticker>>()); latch.await(); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/ticker", MOCK_URL)); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); }</code><technical_language>Add newline return</technical_language>

Target:
public void getAllTickersShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final TickerService tickerService = adapter.create(TickerService.class); tickerService.getAllTickers(new RetrofitPromise<List<Ticker>>()); latch.await(); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/ticker", MOCK_URL)); }
Source:
<code>public void setUp() throws Exception { for (int i = 1; i <= NB_JOBS; i++) { String user = DEFAULT_USER_NAME; if (i <= NB_JOBS_AS_DEMO_USER) { user = DEMO_USERNAME; } InternalJob job = insertNewJob(user); InternalTask task = job.getITasks().get(0); job.setStatus(JobStatus.FINISHED); job.setNumberOfFinishedTasks(1); job.setRemovedTime(-1L); task.setStatus(TaskStatus.FINISHED); dbManager.updateJobAndTasksState(job); long startTime = getTimeRelativeToReference(-i - 1); long endTime = getTimeRelativeToReference(-i); dbManager.updateStartTime( job.getId().longValue(), task.getId().longValue(), startTime); dbManager.updateFinishedTime( job.getId().longValue(), task.getId().longValue(),endTime); <START> if (i == NTH_JOB_TO_BE_CROND) { <END> dbManager.updateScheduledTime( job.getId().longValue(), task.getId().longValue(), SCHEDULED_TIME); } log.info("Job " + job.getId() + " with task " + task.getId() + " has startTime=" + startTime + " and finishedTime=" + endTime); } }</code><technical_language>change i variable in better</technical_language>

Target:
public void setUp() throws Exception { for (int jobCount = 1; jobCount <= NB_JOBS; jobCount++) { String user = DEFAULT_USER_NAME; if (jobCount <= NB_JOBS_AS_DEMO_USER) { user = DEMO_USERNAME; } InternalJob job = insertNewJob(user); InternalTask task = job.getITasks().get(0); job.setStatus(JobStatus.FINISHED); job.setNumberOfFinishedTasks(1); job.setRemovedTime(-1L); task.setStatus(TaskStatus.FINISHED); dbManager.updateJobAndTasksState(job); long startTime = getTimeRelativeToReference(-jobCount - 1); long endTime = getTimeRelativeToReference(-jobCount); dbManager.updateStartTime( job.getId().longValue(), task.getId().longValue(), startTime); dbManager.updateFinishedTime( job.getId().longValue(), task.getId().longValue(),endTime); if (jobCount == JOB_TO_BE_CROND) { dbManager.updateScheduledTime( job.getId().longValue(), task.getId().longValue(), SCHEDULED_TIME); } log.info("Job " + job.getId() + " with task " + task.getId() + " has startTime=" + startTime + " and finishedTime=" + endTime); } }
Source:
<code>public int compareTo(@Nullable ITmfStateValue object) { <START> if (!(object instanceof LongStateValue)) { <END> return -1; } LongStateValue other = (LongStateValue) object; return Long.compare(this.value, other.value); }</code><technical_language>compare similar types</technical_language>

Target:
public int compareTo(@Nullable ITmfStateValue object) { if (object == null) { return 1; } int result = 0; switch (object.getType()) { case INTEGER: long otherLongValue = ((IntegerStateValue) object).unboxInt(); result = Long.compare(this.value, otherLongValue); break; case DOUBLE: double otherDoubleValue = ((DoubleStateValue) object).unboxDouble(); result = Double.compare(this.value, otherDoubleValue); break; case LONG: otherLongValue = ((LongStateValue) object).unboxLong(); result = Long.compare(this.value, otherLongValue); break; case NULL: result = 1; break; case STRING: result = -1; break; default: break; } return result; }
Source:
<code>public void setupLayout() { Form mainForm = Form.create(this, Form.MAIN); mainForm.addRow(Widget.widget(sourceType).setWidgetType(Widget.RADIO_WIDGET_TYPE)); mainForm.addRow(Widget.widget(moduleName).setWidgetType(Widget.DATALIST_WIDGET_TYPE)); mainForm.addRow(Widget.widget(query).setWidgetType(Widget.TEXT_AREA_WIDGET_TYPE)); mainForm.addRow(Widget.widget(selectColumnIds).setWidgetType(Widget.MULTIPLE_VALUE_SELECTOR_WIDGET_TYPE)); <START> selectColumnIds.setDisplayName("Column Selection"); <END> mainForm.getWidget(selectColumnIds).setVisible(false); selectColumnIds.setRequired(false); }</code><technical_language>Please move display Name i18n files</technical_language>

Target:
public void setupLayout() { Form mainForm = Form.create(this, Form.MAIN); mainForm.addRow(Widget.widget(sourceType).setWidgetType(Widget.RADIO_WIDGET_TYPE)); mainForm.addRow(Widget.widget(moduleName).setWidgetType(Widget.DATALIST_WIDGET_TYPE)); mainForm.addRow(Widget.widget(query).setWidgetType(Widget.TEXT_AREA_WIDGET_TYPE)); mainForm.addRow(Widget.widget(selectColumnIds).setWidgetType(Widget.MULTIPLE_VALUE_SELECTOR_WIDGET_TYPE)); mainForm.getWidget(selectColumnIds).setVisible(false); selectColumnIds.setRequired(false); }
Source:
<code>public void shouldExecuteAlltests() { projectExplorer.openItemByPath(PATH_TO_ANOTHER_TEST_CLASS); editor.waitActive(); editor.goToCursorPositionVisible(26, 17); menu.runCommand(RUN_MENU, TEST, TEST_NG_TEST_DROP_DAWN_ITEM); try { notifications.waitExpectedMessageOnProgressPanelAndClosed( "Test runner executed successfully."); <START> } catch (WebDriverException ex) { <END> fail("Known issue <LINK_0>"); } try { pluginConsole.waitMethodMarkedAsPassed("shouldSuccessOfAppAnother"); } catch (TimeoutException ex) { fail("Known issue <LINK_1>", ex); } assertTrue(pluginConsole.getAllNamesOfMethodsMarkedDefinedStatus(PASSED).size() == 1); editor.goToCursorPositionVisible(31, 17); menu.runCommand(RUN_MENU, TEST, TEST_NG_TEST_DROP_DAWN_ITEM); pluginConsole.waitMethodMarkedAsFailed("shouldFailOfAppAnother"); assertTrue(pluginConsole.getAllNamesOfMethodsMarkedDefinedStatus(FAILED).size() == 1); String testErrorMessage = pluginConsole.getTestErrorMessage(); assertTrue( testErrorMessage.startsWith(APP_TEST_ANOTHER_FAIL_OUTPUT_TEMPLATE), "Actual message was: " + testErrorMessage); assertTrue( testErrorMessage.endsWith(END_OF_FAILED_TEST), "Actual message was: " + testErrorMessage); }</code><technical_language>**WebDriverException** general here. catch real exception encountered here</technical_language>

Target:
public void shouldExecuteAlltests() { projectExplorer.openItemByPath(PATH_TO_ANOTHER_TEST_CLASS); editor.waitActive(); editor.goToCursorPositionVisible(26, 17); menu.runCommand(RUN_MENU, TEST, TEST_NG_TEST_DROP_DAWN_ITEM); try { notifications.waitExpectedMessageOnProgressPanelAndClosed( "Test runner executed successfully."); } catch (TimeoutException ex) { fail("Known issue <LINK_0>"); } try { pluginConsole.waitMethodMarkedAsPassed("shouldSuccessOfAppAnother"); } catch (TimeoutException ex) { fail("Known issue <LINK_1>", ex); } assertTrue(pluginConsole.getAllNamesOfMethodsMarkedDefinedStatus(PASSED).size() == 1); editor.goToCursorPositionVisible(31, 17); menu.runCommand(RUN_MENU, TEST, TEST_NG_TEST_DROP_DAWN_ITEM); pluginConsole.waitMethodMarkedAsFailed("shouldFailOfAppAnother"); assertTrue(pluginConsole.getAllNamesOfMethodsMarkedDefinedStatus(FAILED).size() == 1); String testErrorMessage = pluginConsole.getTestErrorMessage(); assertTrue( testErrorMessage.startsWith(APP_TEST_ANOTHER_FAIL_OUTPUT_TEMPLATE), "Actual message was: " + testErrorMessage); assertTrue( testErrorMessage.endsWith(END_OF_FAILED_TEST), "Actual message was: " + testErrorMessage); }
Source:
<code>public String computeTimePattern(Map<String, String> prefsMap) { String dateTimeFormat = prefsMap.get(DATIME); if (dateTimeFormat == null) { dateTimeFormat = DEFAULT_TIME_PATTERN; } String dateFormat; String timeFormat; int index = dateTimeFormat.indexOf(' '); if (index != -1) { dateFormat = dateTimeFormat.substring(0, dateTimeFormat.indexOf(' ') + 1); timeFormat = dateTimeFormat.substring(dateFormat.length()); } else { dateFormat = ""; timeFormat = dateTimeFormat; } String dateFieldSep = prefsMap.get(DATE_DELIMITER); String timeFieldSep = prefsMap.get(TIME_DELIMITER); String dateFmt = dateFormat.replaceAll("-", dateFieldSep); String timeFmt = timeFormat.replaceAll(":", timeFieldSep); String ssecFmt = computeSubSecFormat(prefsMap); <START> return dateFmt + timeFmt + "." + ssecFmt; END> }</code><technical_language>if ssecFmt.equals(SUBSEC_NO_FMT) (empty string) is a . end. This in tests, fix it. Change e.g. return dateFmt + timeFmt + (ssecFmt.equals(SUBSEC_NO_FMT) ? "" : '.' + ssecFmt); //$NON-NLS-1$;</technical_language>

Target:
public String computeTimePattern(Map<String, String> prefsMap) { String dateTimeFormat = prefsMap.get(DATIME); if (dateTimeFormat == null) { dateTimeFormat = DEFAULT_TIME_PATTERN; } String dateFormat; String timeFormat; int index = dateTimeFormat.indexOf(' '); if (index != -1) { dateFormat = dateTimeFormat.substring(0, dateTimeFormat.indexOf(' ') + 1); timeFormat = dateTimeFormat.substring(dateFormat.length()); } else { dateFormat = ""; timeFormat = dateTimeFormat; } String dateFieldSep = prefsMap.get(DATE_DELIMITER); String timeFieldSep = prefsMap.get(TIME_DELIMITER); String dateFmt = dateFormat.replaceAll("-", dateFieldSep); String timeFmt = timeFormat.replaceAll(":", timeFieldSep); String ssecFmt = computeSubSecFormat(prefsMap); return dateFmt + timeFmt + (ssecFmt.equals(SUBSEC_NO_FMT) ? "" : '.' + ssecFmt); }
Source:
<code>public void onMetadataChanged(@NonNull MediaItem item) { final MediaSessionImplBase session = getSession(); if (session == null) { return; } SessionPlayer player = session.getPlayer(); if (player.getCurrentMediaItem() == item) { boolean <START> notified = <END> updateCurrentMediaItemMetadataWithDuration(player); if (!notified) { notifyCurrentMediaItemChanged(item); } } }</code><technical_language>updated</technical_language>

Target:
public void onMetadataChanged(@NonNull MediaItem item) { final MediaSessionImplBase session = getSession(); if (session == null) { return; } SessionPlayer player = session.getPlayer(); if (player.getCurrentMediaItem() == item) { boolean notifyingPended = updateCurrentMediaItemMetadataWithDuration(player); if (!notifyingPended) { notifyCurrentMediaItemChanged(item); } } }
Source:
<code>public void prepare(KubernetesEnvironment k8sEnv, String workspaceId) throws InfrastructureException { if (ephemeralWorkspaceAdapter.isEphemeral(k8sEnv.getAttributes())) { return; } final Collection<PersistentVolumeClaim> claims = k8sEnv.getPersistentVolumeClaims().values(); if (!claims.isEmpty()) { <START> LOG.debug("Preparing PVC started for ws {}", workspaceId); <END> final KubernetesNamespace namespace = factory.create(workspaceId); final KubernetesPersistentVolumeClaims pvcs = namespace.persistentVolumeClaims(); final Set<String> existing = pvcs.get().stream().map(p -> p.getMetadata().getName()).collect(toSet()); for (PersistentVolumeClaim pvc : claims) { final String[] subpaths = (String[]) pvc.getAdditionalProperties().remove(format(SUBPATHS_PROPERTY_FMT, workspaceId)); if (!existing.contains(pvc.getMetadata().getName())) { pvcs.create(pvc); } if (preCreateDirs && subpaths != null) { pvcSubPathHelper.createDirs(workspaceId, subpaths); } } LOG.debug("Preparing PVC done for ws {}", workspaceId); } }</code><technical_language>Please workspace instead of ws</technical_language>

Target:
public void prepare(KubernetesEnvironment k8sEnv, String workspaceId) throws InfrastructureException { if (ephemeralWorkspaceAdapter.isEphemeral(k8sEnv.getAttributes())) { return; } final Collection<PersistentVolumeClaim> claims = k8sEnv.getPersistentVolumeClaims().values(); if (!claims.isEmpty()) { LOG.debug("Preparing PVC started for workspace '{}'", workspaceId); final KubernetesNamespace namespace = factory.create(workspaceId); final KubernetesPersistentVolumeClaims pvcs = namespace.persistentVolumeClaims(); final Set<String> existing = pvcs.get().stream().map(p -> p.getMetadata().getName()).collect(toSet()); for (PersistentVolumeClaim pvc : claims) { final String[] subpaths = (String[]) pvc.getAdditionalProperties().remove(format(SUBPATHS_PROPERTY_FMT, workspaceId)); if (!existing.contains(pvc.getMetadata().getName())) { pvcs.create(pvc); } if (preCreateDirs && subpaths != null) { pvcSubPathHelper.createDirs(workspaceId, subpaths); } } LOG.debug("Preparing PVC done for workspace '{}'", workspaceId); } }
Source:
<code><START> public String toString() { <END> StringBuilder builder = new StringBuilder(); builder.append("[proxy=").append(proxy).append(", proxycreds=") .append(creds).append(", proxyBypass=").append(proxyBypass).append("]"); return builder.toString(); }</code><technical_language>this is a part of pull request, this toString() method overly complicated</technical_language>

Target:
public String toString() { return "[proxy=" + proxy + ", proxyCredential=" + creds + ", proxyBypass=" + proxyBypass + ", proxyProfileMap=" + proxyProfileMap + "]"; }
Source:
<code>protected void doExecute() { if (monitor == null) { monitor = new NullProgressMonitor(); } if (semanticResource != null && session != null) { Collection<Resource> semanticResources = new ArrayList<Resource>(session.getSemanticResources()); if (session instanceof <START> DAnalysisSessionImpl) <END> semanticResources.addAll(((DAnalysisSessionEObject) session).getControlledResources()); if (semanticResources.contains(semanticResource)) { if (session instanceof DAnalysisSessionImpl) ((DAnalysisSessionImpl) session).removeSemanticResource(semanticResource, monitor, removeReferencingResources); else session.removeSemanticResource(semanticResource, monitor); } } }</code><technical_language>add missing bracket</technical_language>

Target:
protected void doExecute() { if (monitor == null) { monitor = new NullProgressMonitor(); } if (semanticResource != null && session != null) { Collection<Resource> semanticResources = new ArrayList<Resource>(session.getSemanticResources()); if (session instanceof DAnalysisSessionImpl) { semanticResources.addAll(((DAnalysisSessionEObject) session).getControlledResources()); } if (semanticResources.contains(semanticResource)) { if (session instanceof DAnalysisSessionImpl) { ((DAnalysisSessionImpl) session).removeSemanticResource(semanticResource, monitor, removeReferencingResources); } else { session.removeSemanticResource(semanticResource, monitor); } } } }
Source:
<code>public DB2QuarterDiffFunction() { <START> super("(select sign(i1) * floor(abs(i1)) from lateral(values (trunc(-months_between(?1, ?2))/3)) as temp(i1))"); <END> }</code><technical_language>a cast int enough</technical_language>

Target:
public DB2QuarterDiffFunction() { super("-int(months_between(cast(?1 as timestamp),cast(?2 as timestamp))/3)"); }
Source:
<code>public static StreamApplication createStreamApplication(Config config) { if (config.get(StreamApplication.APP_CLASS_CONFIG) != null && !config.get(StreamApplication.APP_CLASS_CONFIG).isEmpty()) { TaskConfig taskConfig = new TaskConfig(config); if (taskConfig.getTaskClass() != null && !taskConfig.getTaskClass().isEmpty()) { throw new ConfigException("High level StreamApplication API cannot be used together with low-level API using task.class."); } String appClassName = config.get(StreamApplication.APP_CLASS_CONFIG); try { Class<?> builderClass = Class.forName(appClassName); return (StreamApplication) builderClass.newInstance(); } catch (Throwable t) { log.error("Failed to validate StreamApplication class from the config. {}={}", StreamApplication.APP_CLASS_CONFIG, appClassName); throw new ConfigException(String.format("%s is not a StreamApplication.", appClassName)); } } else { <START> return null; <END> } }</code><technical_language>weird this throws exception returns null, throw in else case too. Also, need log throw exception - throw exception informative message caught logged upstream</technical_language>

Target:
public static StreamApplication createStreamApplication(Config config) { if (config.get(StreamApplication.APP_CLASS_CONFIG) != null && !config.get(StreamApplication.APP_CLASS_CONFIG).isEmpty()) { TaskConfig taskConfig = new TaskConfig(config); if (taskConfig.getTaskClass() != null && !taskConfig.getTaskClass().isEmpty()) { throw new ConfigException("High level StreamApplication API cannot be used together with low-level API using task.class."); } String appClassName = config.get(StreamApplication.APP_CLASS_CONFIG); try { Class<?> builderClass = Class.forName(appClassName); return (StreamApplication) builderClass.newInstance(); } catch (Throwable t) { throw new ConfigException(String.format("%s is not a StreamApplication.", appClassName)); } } else { return null; } }
Source:
<code>protected void testAccessControl_studentAccessOtherTeam_inaccessible() { ______TS("Student intends to access other team's response, should not be accessible"); loginAsStudent(student5InCourse1.getGoogleId()); assertEquals(FeedbackParticipantType.TEAMS, logic.getFeedbackQuestion(typicalResponse2.getFeedbackQuestionId()).getGiverType()); assertNotEquals(student5InCourse1.getTeam(), typicalResponse2.getGiver()); FeedbackResponseUpdateRequest updateRequest = new FeedbackResponseUpdateRequest(); updateRequest.setQuestionType(FeedbackQuestionType.MCQ); updateRequest.setRecipientIdentifier(student5InCourse1.getEmail()); FeedbackMcqResponseDetails newDetails = new FeedbackMcqResponseDetails(); newDetails.setAnswer("TEAM_NOT_EXIST"); updateRequest.setResponseDetails(newDetails); String[] studentAccessOtherTeamParams = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse2.getId(), }; UpdateFeedbackResponseAction a = getAction(updateRequest, studentAccessOtherTeamParams); <START> assertThrows(UnauthorizedAccessException.class, a::checkAccessControl); <END> }</code><technical_language>verifyCannotAccess(studentAccessOtherTeamParams)</technical_language>

Target:
protected void testAccessControl_studentAccessOtherTeam_inaccessible() { ______TS("Student intends to access other team's response, should not be accessible"); StudentAttributes student5InCourse1 = typicalBundle.students.get("student5InCourse1"); StudentAttributes student4inCourse1 = typicalBundle.students.get("student4InCourse1"); FeedbackSessionAttributes session2 = typicalBundle.feedbackSessions.get("session2InCourse1"); FeedbackQuestionAttributes question2 = logic.getFeedbackQuestion( session2.getFeedbackSessionName(), session2.getCourseId(), 1); FeedbackResponseAttributes student4ResponseToTeam = logic.getFeedbackResponse(question2.getId(), student4inCourse1.getEmail(), "Team 1.2"); loginAsStudent(student5InCourse1.getGoogleId()); assertEquals(FeedbackParticipantType.TEAMS, logic.getFeedbackQuestion(student4ResponseToTeam.getFeedbackQuestionId()).getGiverType()); assertNotEquals(student5InCourse1.getTeam(), student4ResponseToTeam.getGiver()); FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(student5InCourse1.getEmail()); String[] studentAccessOtherTeamParams = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, student4ResponseToTeam.getId(), }; verifyCannotAccess(updateRequest, studentAccessOtherTeamParams); }
Source:
<code>protected void addContextResolver(ContextResolver provider, Class providerClass, boolean builtin) { if (providerClass.getName().contains("$$Lambda$")) { <START> throw new ResteasyProviderFactoryException("Registering a context resolver doesn't support lambdas."); <END> } Type parameter = Types.getActualTypeArgumentsOfAnInterface(providerClass, ContextResolver.class)[0]; addContextResolver(provider, parameter, providerClass, builtin); }</code><technical_language>message i18n one</technical_language>

Target:
protected void addContextResolver(ContextResolver provider, Class providerClass, boolean builtin) { if (providerClass.getName().contains("$$Lambda$")) { throw new RuntimeException(Messages.MESSAGES.registeringContextResolverAsLambda()); } Type parameter = Types.getActualTypeArgumentsOfAnInterface(providerClass, ContextResolver.class)[0]; addContextResolver(provider, parameter, providerClass, builtin); }
Source:
<code>public static AnyValue multiply( AnyValue lhs, AnyValue rhs ) { if ( lhs == NO_VALUE || rhs == NO_VALUE ) { return NO_VALUE; } if ( lhs instanceof NumberValue && rhs instanceof NumberValue ) { return ((NumberValue) lhs).times( (NumberValue) rhs ); } if ( lhs instanceof DurationValue ) { if ( rhs instanceof NumberValue ) { return ((DurationValue) lhs).mul( (NumberValue) rhs ); } } if ( rhs instanceof DurationValue ) { if ( lhs instanceof NumberValue ) { return ((DurationValue) rhs).mul( (NumberValue) lhs ); } } throw new CypherTypeException( <START> String.format( "Don't know how to subtract `%s` and `%s`", lhs, rhs ), null ); <END> }</code><technical_language>~subtract~ multiply</technical_language>

Target:
public static AnyValue multiply( AnyValue lhs, AnyValue rhs ) { if ( lhs == NO_VALUE || rhs == NO_VALUE ) { return NO_VALUE; } if ( lhs instanceof NumberValue && rhs instanceof NumberValue ) { return ((NumberValue) lhs).times( (NumberValue) rhs ); } if ( lhs instanceof DurationValue ) { if ( rhs instanceof NumberValue ) { return ((DurationValue) lhs).mul( (NumberValue) rhs ); } } if ( rhs instanceof DurationValue ) { if ( lhs instanceof NumberValue ) { return ((DurationValue) rhs).mul( (NumberValue) lhs ); } } throw new CypherTypeException( String.format( "Don't know how to multiply `%s` and `%s`", lhs, rhs ), null ); }
Source:
<code>public void remove_unsupportedTypeIgnored() { final int initialSize = list.size(); final List<Object> unsupportedValues = Arrays.<Object>asList( new int[] {0}, new StringBuilder("0") ); realm.executeTransaction(new Realm.Transaction() { @Override public void execute(Realm realm) { for (Object unsupportedValue : unsupportedValues) { <START> list.remove(unsupportedValue); <END> } } }); assertEquals(initialSize, list.size()); }</code><technical_language>check this returns false. for other methods test remove(obj)/removeAll(). API docs method return true if is removed, false if not</technical_language>

Target:
public void remove_unsupportedTypeIgnored() { final int initialSize = list.size(); final List<Object> unsupportedValues = Arrays.<Object>asList( new int[] {0}, new StringBuilder("0") ); realm.executeTransaction(new Realm.Transaction() { @Override public void execute(Realm realm) { for (Object unsupportedValue : unsupportedValues) { assertFalse(list.remove(unsupportedValue)); } } }); assertEquals(initialSize, list.size()); }
Source:
<code>public void setBackground(Color color) { checkWidget(); <START> Color disabledBg = getDisplay().getSystemColor(SWT.COLOR_TEXT_DISABLED_BACKGROUND); <END> boolean backgroundDisabled = false; if (!this.enabled && color == null) { if (background != null) { if (background.equals(disabledBg)) { return; } else { color = new Color (getDisplay(), disabledBg.getRGBA()); backgroundDisabled = true; } } } customBackground = color != null && !this.enableDisableCall && !backgroundDisabled; background = color; super.setBackground(color); resetCache(0, content.getLineCount()); setCaretLocation(); super.redraw(); }</code><technical_language>disabledBg Color variable created needed. i.e. condition is met: if (background != null) {</technical_language>

Target:
public void setBackground(Color color) { checkWidget(); boolean backgroundDisabled = false; if (!this.enabled && color == null) { if (background != null) { Color disabledBg = getDisplay().getSystemColor(SWT.COLOR_TEXT_DISABLED_BACKGROUND); if (background.equals(disabledBg)) { return; } else { color = new Color (getDisplay(), disabledBg.getRGBA()); backgroundDisabled = true; } } } customBackground = color != null && !this.insideSetEnableCall && !backgroundDisabled; background = color; super.setBackground(color); resetCache(0, content.getLineCount()); setCaretLocation(); super.redraw(); }
Source:
<code>public void testDouble() { assertQueryUsingH2Cte("SELECT count(*) FROM lineitem_ex WHERE ship_day is null"); assertQueryUsingH2Cte("SELECT count(ship_day) FROM lineitem_ex"); assertQueryUsingH2Cte("SELECT sum(quantity), sum(striking_factories) FROM lineitem_ex WHERE ship_by_air is null"); assertQueryUsingH2Cte("SELECT quantity * (1 - discount) * (1 + tax), striking_factories * quantity FROM lineitem_ex WHERE is_returned = true"); assertQuery("SELECT quantity, extendedprice, discount, tax from lineitem"); <START> assertQuery("SELECT quantity, extendedprice, discount, tax from lineitem WHERE quantity = 4"); <END> assertQuery("SELECT quantity, extendedprice, discount, tax from lineitem WHERE quantity = 4 AND discount = 0"); assertQueryUsingH2Cte("SELECT quantity, extendedprice, discount, tax, striking_factories from lineitem_ex WHERE quantity = 4 AND discount = 0 AND tax=.05"); assertQueryUsingH2Cte("SELECT quantity, extendedprice, discount, striking_factories, orderkey, partkey, suppkey from lineitem_ex WHERE quantity = 4 AND discount = 0 AND tax=.05"); assertQuery("SELECT quantity, extendedprice, discount, tax, orderkey, partkey, suppkey from lineitem WHERE quantity > 4 AND discount = 0 AND tax=.05"); assertQueryUsingH2Cte("SELECT quantity, striking_factories, discount, tax, orderkey, partkey, suppkey from lineitem_ex WHERE quantity > 4 AND discount > 0 AND tax<.05"); assertQueryUsingH2Cte("SELECT quantity, extendedprice, striking_factories, tax, orderkey, partkey, suppkey from lineitem_ex WHERE (discount + tax) < (quantity / 10) AND striking_factories != 1.0"); assertQueryUsingH2Cte("SELECT quantity, extendedprice, discount, striking_factories, orderkey, partkey, suppkey from lineitem_ex WHERE (discount + tax) < (quantity / 10) OR orderkey * 1.0 / partkey % suppkey < (tax + discount) * 100"); }</code><technical_language>uppercase SQL keywords: -></technical_language>

Target:
public void testDouble() { assertQuery("SELECT quantity, extendedprice, discount, tax FROM lineitem"); assertQueryUsingH2Cte("SELECT count(discount) FROM lineitem_ex"); assertFilterProject("discount IS NULL", "count(*)"); assertFilterProject("discount IS NOT NULL", "sum(quantity), sum(discount)"); assertFilterProject("is_returned = true", "quantity, extendedprice, discount"); assertFilterProject("quantity = 4", "orderkey, tax"); assertFilterProject("quantity = 4 AND discount = 0", "extendedprice, discount"); assertFilterProject("quantity = 4 AND discount = 0 AND tax = .05", "orderkey"); assertFilterProject("(discount + tax) < (quantity / 10)", "tax"); assertFilterProject("doubles[1] > 0.01", "count(*)"); assertFilterProject("discount + tax > .05 AND discount > .01 AND tax > .01", "tax"); assertFilterProject("is_returned AND doubles[2] = .01 AND doubles[1] + discount > 0.10", "count(*)"); }
Source:
<code>public Date getEndDate() { <START> return endDate == null ? null : _responseBuilder.startOfNextDay(endDate); <END> }</code><technical_language>Dates mutable, endDate copied passed _responseBuilder.startOfNextDay avoid downstream side-effects</technical_language>

Target:
public Date getEndDate() { return endDate == null ? null : _responseBuilder.startOfNextDay(endDate == null ? null : new Date(endDate.getTime())); }
Source:
<code>public void testVersionComparison() { Version version1 = new Version("15.09"); Version version2 = new Version("15.09"); assertTrue(version1.compareTo(version2) == 0); version1 = new Version("15.09"); version2 = new Version("1.09"); System.out.println(version1.compareTo(version2)); assertTrue(version1.compareTo(version2) < 0); assertTrue(version2.compareTo(version1) > 0); version1 = new Version("15.09"); version2 = new Version("15.09.01"); <START> assertTrue(version1.compareTo(version2) > 0); <END> }</code><technical_language>I remember some special handling done for rc I test cases for that</technical_language>

Target:
public void testVersionComparison() { Version version1 = new Version("15.09"); Version version2 = new Version("15.09"); assertTrue(version1.compareTo(version2) == 0); version1 = new Version("15.09"); version2 = new Version("1.09"); assertTrue(version1.compareTo(version2) < 0); assertTrue(version2.compareTo(version1) > 0); version1 = new Version("15.09"); version2 = new Version("15.09.01"); assertTrue(version1.compareTo(version2) > 0); ______TS("Test rc versions will come first when the rest are similar"); version1 = new Version("15.09"); version2 = new Version("15.09rc"); assertTrue(version2.compareTo(version1) < 0); }
Source:
<code>public EventGridSasCredential(String sas) { if (CoreUtils.isNullOrEmpty(sas)) { <START> throw new IllegalArgumentException("the access signature cannot be null or empty"); <END> } this.sas = sas; }</code><technical_language>Log throw</technical_language>

Target:
public EventGridSasCredential(String sas) { if (sas == null) { throw logger.logExceptionAsError(new IllegalArgumentException("the access signature cannot be null")); } if (sas.isEmpty()) { throw logger.logExceptionAsError(new IllegalArgumentException("the access signature cannot be empty")); } this.sas = sas; }
Source:
<code>public void setCamelContext(CamelContext camelContext) { this.camelContext = camelContext; <START> ExecutorServiceManager executorServiceManager = camelContext.getExecutorServiceManager(); <END> executorService = executorServiceManager.newFixedThreadPool(this, "KafkaIdempotentRepository", 1); executorService.submit(topicPoller); log.info("Warming up cache"); try { if (cacheReadyLatch.await(30, TimeUnit.SECONDS)) { log.info("Cache OK"); } else { log.warn("Timeout waiting for cache warm-up from topic {}. Proceeding anyway. " + "Duplicate records may not be detected.", topic); } } catch (InterruptedException e) { e.printStackTrace(); } }</code><technical_language>dont do this in a setter!!! Place startup logic in doStart is for</technical_language>

Target:
public void setCamelContext(CamelContext camelContext) { this.camelContext = camelContext; ExecutorServiceManager executorServiceManager = camelContext.getExecutorServiceManager(); executorService = executorServiceManager.newSingleThreadExecutor(this, "KafkaIdempotentRepository"); executorService.submit(topicPoller); log.info("Warming up cache"); try { if (cacheReadyLatch.await(30, TimeUnit.SECONDS)) { log.info("Cache OK"); } else { log.warn("Timeout waiting for cache warm-up from topic {}. Proceeding anyway. " + "Duplicate records may not be detected.", topic); } } catch (InterruptedException e) { log.error("Interrupted: {}", e.getMessage()); } }