auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void addAll(OWLOntology ontology) { Set<OWLOntology> ontologies = new HashSet<OWLOntology>(); ontologies.add(ontology); ReferencedEntitySetProvider resp = new ReferencedEntitySetProvider(ontologies); <START> OntologyHelper.getEntities(ontology); <END> for (OWLEntity entity : resp.getEntities()) { add(ontology, entity); } }</code><technical_language>This line work</technical_language>

Target:
public void addAll(OWLOntology ontology) { Set<OWLOntology> ontologies = new HashSet<>(); ontologies.add(ontology); ontologies.addAll(ontology.getImports()); ReferencedEntitySetProvider resp = new ReferencedEntitySetProvider(ontologies); for (OWLEntity entity : resp.getEntities()) { add(ontology, entity); } }
Source:
<code>public ChatUser createOrGetChatUser(User user) { ChatUser chatUser = getChatUser(user.getNick()); if(chatUser != null){ return chatUser; <START> } else { <END> return ChatUser.fromIrcUser(user); } }</code><technical_language>unneeded else</technical_language>

Target:
public ChatUser createOrGetChatUser(User user) { synchronized (chatUsersByName) { String username = user.getNick(); if (!chatUsersByName.containsKey(username)) { ChatPrefs chatPrefs = preferencesService.getPreferences().getChat(); Color color = null; if (chatPrefs.getChatColorMode().equals(CUSTOM) && chatPrefs.getUserToColor().containsKey(username)) { color = chatPrefs.getUserToColor().get(username); } else if (chatPrefs.getChatColorMode().equals(RANDOM)) { color = ColorGeneratorUtil.generateRandomHexColor(); } chatUsersByName.put(username, ChatUser.fromIrcUser(user, color)); } return chatUsersByName.get(username); } }
Source:
<code>private void recoverTimerJobInstance(EjbTimerJob ejbTimerJob, Exception e) { switch (TIMER_RETRY_POLICY) { case RETRY: logger.warn("Execution of time failed. The timer will be retried {}", ejbTimerJob.getTimerJobInstance()); Transaction<TimerJobInstance> operation = (instance) -> { ZonedDateTime nextRetry = ZonedDateTime.now().plus(TIMER_RETRY_INTERVAL, ChronoUnit.MILLIS); EjbTimerJobRetry info = null; if(ejbTimerJob instanceof EjbTimerJobRetry) { info = ((EjbTimerJobRetry) ejbTimerJob).next(); } else { info = new EjbTimerJobRetry(instance); } if (info.getRetry() > TIMER_RETRY_LIMIT) { logger.warn("The timer reached retry limit {}. It won't be retried again", instance, TIMER_RETRY_LIMIT); } TimerConfig config = new TimerConfig(info, true); timerService.createSingleActionTimer(Date.from(nextRetry.toInstant()), config); }; try { transaction(operation, ejbTimerJob.getTimerJobInstance()); } catch (Exception e1) { logger.error("Failed to executed timer recovery {}", e1.getMessage(), e1); } break; case IGNORE: logger.warn("Execution of time failed. The timer won't be retried {}", ejbTimerJob.getTimerJobInstance()); break; case PLATFORM: logger.warn("Execution of time failed. Application server policy applied {}", ejbTimerJob.getTimerJobInstance()); <START> throw new RuntimeException(e); <END> } }</code><technical_language>this differ app servers? WLS EJB timer service I know</technical_language>

Target:
private void recoverTimerJobInstance(EjbTimerJob ejbTimerJob, Exception e) { if (ejbTimerJob.getTimerJobInstance().getTrigger().hasNextFireTime() != null) { logger.warn("Execution of time failed Interval Trigger failed {}", ejbTimerJob.getTimerJobInstance()); return; } switch (TIMER_RETRY_POLICY) { case RETRY: logger.warn("Execution of time failed. The timer will be retried {}", ejbTimerJob.getTimerJobInstance()); Transaction<TimerJobInstance> operation = (instance) -> { ZonedDateTime nextRetry = ZonedDateTime.now().plus(TIMER_RETRY_INTERVAL, ChronoUnit.MILLIS); EjbTimerJobRetry info = null; if(ejbTimerJob instanceof EjbTimerJobRetry) { info = ((EjbTimerJobRetry) ejbTimerJob).next(); } else { info = new EjbTimerJobRetry(instance); } if (TIMER_RETRY_LIMIT > 0 && info.getRetry() > TIMER_RETRY_LIMIT) { logger.warn("The timer reached retry limit {}. It won't be retried again", instance, TIMER_RETRY_LIMIT); return; } TimerConfig config = new TimerConfig(info, true); timerService.createSingleActionTimer(Date.from(nextRetry.toInstant()), config); }; try { transaction(operation, ejbTimerJob.getTimerJobInstance()); } catch (Exception e1) { logger.error("Failed to executed timer recovery {}", e1.getMessage(), e1); } break; case PLATFORM: logger.warn("Execution of time failed. Application server policy applied {}", ejbTimerJob.getTimerJobInstance()); throw new RuntimeException(e); } }
Source:
<code>public void testWriteAdvHandleWithFixedLedgerId() throws Exception { Map<String, byte[]> customMetadata = new HashMap<>(); customMetadata.put("test", "test".getBytes(StandardCharsets.UTF_8)); try (WriteAdvHandle writer = result(newCreateLedgerOp() .withAckQuorumSize(1) .withWriteQuorumSize(2) .withEnsembleSize(3) .withDigestType(DigestType.MAC) .withCustomMetadata(customMetadata) .withPassword("password".getBytes(StandardCharsets.UTF_8)) .makeAdv() .withLedgerId(1234) .execute());) { assertEquals(1234, writer.getId()); long entryId = 0; <START> byte[] data = "foo".getBytes(StandardCharsets.UTF_8); <END> writer.write(entryId++, ByteBuffer.wrap(data)).get(); writer.write(entryId++, ByteBuffer.wrap(data)).get(); writer.write(entryId++, Unpooled.wrappedBuffer(data)).get(); try { result(writer.write(entryId - 1, Unpooled.wrappedBuffer(data))); } catch (BKDuplicateEntryIdException ok) { } writer.write(entryId++, ByteBuffer.wrap(data)).get(); long expectedEntryId = writer.write(entryId++, ByteBuffer.wrap(data)).get(); assertEquals(expectedEntryId, writer.getLastAddConfirmed()); } }</code><technical_language>I difference testWriteAdvHandle testWriteAdvHandleWithFixedLedgerId. I image need verify behavior ledger id. test cases do this validation</technical_language>

Target:
public void testWriteAdvHandleWithFixedLedgerId() throws Exception { setNewGeneratedLedgerId(12345); try (WriteAdvHandle writer = result(newCreateLedgerOp() .withAckQuorumSize(1) .withWriteQuorumSize(2) .withEnsembleSize(3) .withPassword(password) .makeAdv() .withLedgerId(1234) .execute());) { assertEquals(1234, writer.getId()); long entryId = 0; result(writer.write(entryId++, ByteBuffer.wrap(data))); result(writer.write(entryId++, Unpooled.wrappedBuffer(data))); long expectedEntryId = result(writer.write(entryId++, ByteBuffer.wrap(data))); assertEquals(expectedEntryId, writer.getLastAddConfirmed()); } }
Source:
<code>public void lockLeasesAreValidUntilExpiry() { AsyncResult<HeldLocks> result = new AsyncResult<>(); AsyncResult<Leased<LockToken>> asyncResult = heldLocksCollection.getExistingOrAcquire(REQUEST_ID, () -> result); result.complete(heldLocksForId(REQUEST_ID)); Lease lease = asyncResult.get().lease(); assertThat(lease.isValid(leaderClock.time())).isTrue(); <START> setTimeStatic(clock.get().plus(LockLeaseContract.CLIENT_LEASE_TIMEOUT.minus(Duration.ofNanos(1)))); <END> assertThat(lease.isValid(leaderClock.time())).isTrue(); }</code><technical_language>advance(Duration)</technical_language>

Target:
public void lockLeasesAreValidUntilExpiry() { setTime(123); AsyncResult<HeldLocks> result = new AsyncResult<>(); AsyncResult<Leased<LockToken>> asyncResult = heldLocksCollection.getExistingOrAcquire(REQUEST_ID, () -> result); result.complete(heldLocksForId(REQUEST_ID)); Lease lease = asyncResult.get().lease(); assertThat(lease.isValid(leaderClock.time())).isTrue(); advance(LockLeaseContract.CLIENT_LEASE_TIMEOUT.minus(Duration.ofNanos(1))); assertThat(lease.isValid(leaderClock.time())).isTrue(); }
Source:
<code>public void inputKeyevent(int value) { executeCommandQuietly(adbCommand("shell", "input", "keyevent", "" + value)); <START> sleep(600); <END> }</code><technical_language>extra 100 ms buy you</technical_language>

Target:
public void inputKeyevent(int value) { executeCommandQuietly(adbCommand("shell", "input", "keyevent", "" + value)); sleep(500); }
Source:
<code>public void setUp(Context context, Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener, EnvVars initialEnvironment) throws IOException, InterruptedException { FilePath configFile = workspace.createTempFile(".kube", "config"); Set<String> tempFiles = newHashSet(configFile.getRemote()); context.env("KUBECONFIG", configFile.getRemote()); context.setDisposer(new CleanupDisposer(tempFiles)); final KubernetesAuth auth; try { auth = KubernetesAuthFactory.fromCredentialsId(credentialsId, serverUrl, null, true); } catch (KubernetesAuthException e) { <START> throw new AbortException(e.getMessage()); <END> } if (auth == null) { throw new AbortException("No credentials defined to setup Kubernetes CLI"); } try (Writer w = new OutputStreamWriter(new FileOutputStream(configFile.getRemote()), "UTF-8")) { if (auth instanceof KubernetesAuthKubeconfig) { w.write(((KubernetesAuthKubeconfig) auth).getKubeconfig()); } else { w.write(buildKubeConfig(auth)); } } int status = launcher.launch().cmdAsSingleString("kubectl version").join(); if (status != 0) throw new IOException("Failed to run kubectl version " + status); }</code><technical_language>suggestion throw new AbortException("Unable get valid Kubernetes authentication credentialsId " + credentialsId,e);</technical_language>

Target:
public void setUp(Context context, Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener, EnvVars initialEnvironment) throws IOException, InterruptedException { FilePath configFile = workspace.createTempFile(".kube", "config"); Set<String> tempFiles = newHashSet(configFile.getRemote()); context.env("KUBECONFIG", configFile.getRemote()); context.setDisposer(new CleanupDisposer(tempFiles)); StandardCredentials credentials = CredentialsProvider.findCredentialById(credentialsId, StandardCredentials.class, build, Collections.emptyList()); if (credentials == null) { throw new AbortException("No credentials found for id \"" + credentialsId + "\""); } KubernetesAuth auth = AuthenticationTokens.convert(KubernetesAuth.class, credentials); if (auth == null) { throw new AbortException("Unsupported Credentials type " + credentials.getClass().getName()); } try (Writer w = new OutputStreamWriter(new FileOutputStream(configFile.getRemote()), "UTF-8")) { try { w.write(auth.buildKubeConfig(new KubernetesAuthConfig(getServerUrl(), getCaCertificate(), false))); } catch (KubernetesAuthException e) { throw new AbortException(e.getMessage()); } } int status = launcher.launch().cmdAsSingleString("kubectl version").join(); if (status != 0) throw new IOException("Failed to run kubectl version " + status); }
Source:
<code>@Test public void test_async_invoke() throws Exception { client.setAsync(true); String jorge = client.get().sayHello("jorge"); <START> Assert.assertTrue(jorge == null); <END> Object o = RpcContext.getContext().getFuture().get(); Assert.assertTrue(o != null); Span span = takeSpan(); assertThat(span.kind()) .isEqualTo(Span.Kind.CLIENT); }</code><technical_language>yes.. is true @jeqo is null</technical_language>

Target:
@Test public void test_async_invoke() throws Exception { client.setAsync(true); String jorge = client.get().sayHello("jorge"); assertThat(jorge).isNull(); Object o = RpcContext.getContext().getFuture().get(); assertThat(o).isNotNull(); Span span = takeSpan(); assertThat(span.kind()) .isEqualTo(Span.Kind.CLIENT); }
Source:
<code>public InputStream getInputStream(RepoObject repoObject){ try { return new FileInputStream(getObjectLocationString(repoObject.getBucketName(), repoObject.getChecksum())); } catch (FileNotFoundException e) { <START> return null; <END> } }</code><technical_language>add a log statement for more info on. I I feel returning null</technical_language>

Target:
public InputStream getInputStream(RepoObject repoObject){ try { return new FileInputStream(getObjectLocationString(repoObject.getBucketName(), repoObject.getChecksum())); } catch (FileNotFoundException e) { log.debug("The content for the object was not found. Object --> key , bucket name: , content checksum: , version number: ", repoObject.getKey(), repoObject.getBucketName(), repoObject.getChecksum(), repoObject.getVersionNumber()); return null; } }
Source:
<code>public static void main(String[] args) { String filename = null; <START> try { <END> filename = args[0]; if (args.length > 1) throw new Exception(); } catch (Exception e) { logger.error("usage: java edu.illinois.cs.cogcomp.lbjava.edu.illinois.cs.cogcomp.lbjava.nlp.SentenceSplitter <file name>"); System.exit(1); } SentenceSplitter splitter = new SentenceSplitter(filename); for (Sentence s = (Sentence) splitter.next(); s != null; s = (Sentence) splitter.next()) { StringBuffer buffer = new StringBuffer(s.text); for (int i = 0; i < buffer.length(); ++i) { char c = buffer.charAt(i); if (c == '\n' || c == '\r' || c == '\f') buffer.setCharAt(i, ' '); } logger.info(buffer.toString()); } }</code><technical_language>exception, STDERR</technical_language>

Target:
public static void main(String[] args) { String filename = null; try { filename = args[0]; if (args.length > 1) throw new Exception(); } catch (Exception e) { System.err.println("usage: java edu.illinois.cs.cogcomp.lbjava.edu.illinois.cs.cogcomp.lbjava.nlp.SentenceSplitter <file name>"); System.exit(1); } SentenceSplitter splitter = new SentenceSplitter(filename); for (Sentence s = (Sentence) splitter.next(); s != null; s = (Sentence) splitter.next()) { StringBuffer buffer = new StringBuffer(s.text); for (int i = 0; i < buffer.length(); ++i) { char c = buffer.charAt(i); if (c == '\n' || c == '\r' || c == '\f') buffer.setCharAt(i, ' '); } System.out.println(buffer.toString()); } }
Source:
<code>private boolean isExpectedCondition(ExpectedCondition<?> expectedCondition) { WebDriverWait wait = new WebDriverWait(browser.driver, 0); try { <START> wait.until(expectedCondition); <END> return true; } catch (TimeoutException e) { return false; } }</code><technical_language>Is a WebDriverWait necessary timeout is set 0? apply ExpectedCondition instead</technical_language>

Target:
private boolean isExpectedCondition(ExpectedCondition<?> expectedCondition) { Object value = expectedCondition.apply(browser.driver); if (value == null) { return false; } if (value.getClass() == Boolean.class) { return (boolean) value; } else { return true; } }
Source:
<code>public void iteratesPullRequestComments() throws Exception { final Pull pull = Mockito.mock(Pull.class); Mockito.doReturn(repo()).when(pull).repo(); final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple( HttpURLConnection.HTTP_OK, Json.createArrayBuilder() .add(comment("comment 3")) .add(comment("comment 4")) .build().toString() ) ).start(); final RtPullComments comments = new RtPullComments( new JdkRequest(container.home()), pull ); MatcherAssert.assertThat( comments.iterate(1, Collections.<String, String>emptyMap()), Matchers.<PullComment>iterableWithSize(2) ); <START> container.stop(); <END> }</code><technical_language>stop container in finally block guaranty is stopped in case of exception test execution</technical_language>

Target:
public void iteratesPullRequestComments() throws Exception { final Pull pull = Mockito.mock(Pull.class); Mockito.doReturn(repo()).when(pull).repo(); final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple( HttpURLConnection.HTTP_OK, Json.createArrayBuilder() .add(comment("comment 3")) .add(comment("comment 4")) .build().toString() ) ).start(); try { final RtPullComments comments = new RtPullComments( new JdkRequest(container.home()), pull ); MatcherAssert.assertThat( comments.iterate(1, Collections.<String, String>emptyMap()), Matchers.<PullComment>iterableWithSize(2) ); } finally { container.stop(); } }
Source:
<code>public void onFields(long line, ObjList<DirectByteCharSequence> values, int valuesLength) { long timestamp = 0L; if (timestampIndex != -1 && types.getQuick(timestampIndex).getType() == ColumnType.TIMESTAMP) { TimestampAdapter adapter = (TimestampAdapter) types.getQuick(timestampIndex); final DirectByteCharSequence dbcs = values.getQuick(timestampIndex); try { timestamp = adapter.getTimestamp(dbcs); } catch (NumericException e) { <START> logError(line, timestampIndex, dbcs); <END> } } final TableWriter.Row w = writer.newRow(timestamp); for (int i = 0; i < valuesLength; i++) { if (i == timestampIndex && types.getQuick(timestampIndex).getType() == ColumnType.TIMESTAMP) { continue; } final DirectByteCharSequence dbcs = values.getQuick(i); if (dbcs.length() == 0) { continue; } try { types.getQuick(i).write(w, i, dbcs); } catch (Exception ignore) { logError(line, i, dbcs); switch (atomicity) { case Atomicity.SKIP_ALL: writer.rollback(); throw CairoException.instance(0).put("bad syntax [line=").put(line).put(", col=").put(i).put(']'); case Atomicity.SKIP_ROW: w.cancel(); return; default: break; } } } w.append(); }</code><technical_language>error handling needs either: - atomicity == SKIP_ALL, throw CairoException. is need rollback row, created - do logging exit method return</technical_language>

Target:
public void onFields(long line, ObjList<DirectByteCharSequence> values, int valuesLength) { long timestamp = 0L; if (timestampAdapter != null) { final DirectByteCharSequence dbcs = values.getQuick(timestampIndex); try { timestamp = timestampAdapter.getTimestamp(dbcs); } catch (NumericException e) { logError(line, timestampIndex, dbcs); return; } } final TableWriter.Row w = writer.newRow(timestamp); for (int i = 0; i < valuesLength; i++) { if (timestampAdapter != null && i == timestampIndex) { continue; } final DirectByteCharSequence dbcs = values.getQuick(i); if (dbcs.length() == 0) { continue; } try { types.getQuick(i).write(w, i, dbcs); } catch (Exception ignore) { logError(line, i, dbcs); switch (atomicity) { case Atomicity.SKIP_ALL: writer.rollback(); throw CairoException.instance(0).put("bad syntax [line=").put(line).put(", col=").put(i).put(']'); case Atomicity.SKIP_ROW: w.cancel(); return; default: break; } } } w.append(); }
Source:
<code>public void start() { try { MediaServerConfiguration conf = configurationLoader.load(this.filepath); Injector injector = Guice.createInjector(new BootstrapModule(conf)); this.mediaServer = injector.getInstance(RestCommMediaServer.class); this.mediaServer.start(); } catch (Exception e) { <START> log.error("Bootstrap aborted."); <END> } }</code><technical_language>Print exception message understand configuration aborted</technical_language>

Target:
public void start() { try { MediaServerConfiguration conf = configurationLoader.load(this.filepath); Injector injector = Guice.createInjector(new BootstrapModule(conf)); this.mediaServer = injector.getInstance(RestCommMediaServer.class); this.mediaServer.start(); } catch (Exception e) { log.error("Bootstrap aborted. Reason: " + e.getMessage()); } }
Source:
<code>public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) { <START> return isInitialized == 1; <END> } for (int i = 0; i < getLocalTimeCount(); i++) { if (!getLocalTime(i).isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }</code><technical_language>4 spaces</technical_language>

Target:
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; for (int i = 0; i < getLocalTimeCount(); i++) { if (!getLocalTime(i).isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
Source:
<code>public void write(ItemRecord[] records, IProgressMonitor monitor) { if (monitor == null) { monitor = new NullProgressMonitor(); } try { for (ItemRecord record : records) { if (monitor.isCanceled()) { break; } Map<IPath, IPath> toImportMap = mapping(record); <START> monitor.subTask(DefaultMessagesImpl.getString("Exporting ", record.getName())); END> if (record.isValid()) { for (IPath resPath : toImportMap.keySet()) { IPath desPath = toImportMap.get(resPath); synchronized (ProxyRepositoryFactory.getInstance().getRepositoryFactoryFromProvider() .getResourceManager().resourceSet) { write(resPath, desPath); } } } else { for (String error : record.getErrors()) { log.error(error); } } monitor.worked(1); } finish(records); } catch (Exception e) { log.error(e, e); } }</code><technical_language>i want change DefaultMessagesImpl.getString("Exporting " DefaultMessagesImpl.getString("FileSystemExportWriter.Export" mind</technical_language>

Target:
public void write(ItemRecord[] records, IProgressMonitor monitor) { if (monitor == null) { monitor = new NullProgressMonitor(); } try { for (ItemRecord record : records) { if (monitor.isCanceled()) { break; } Map<IPath, IPath> toImportMap = mapping(record); monitor.subTask(DefaultMessagesImpl.getString("FileSystemExportWriter.Export", record.getName())); if (record.isValid()) { for (IPath resPath : toImportMap.keySet()) { IPath desPath = toImportMap.get(resPath); synchronized (ProxyRepositoryFactory.getInstance().getRepositoryFactoryFromProvider() .getResourceManager().resourceSet) { write(resPath, desPath); } } } else { for (String error : record.getErrors()) { log.error(error); } } monitor.worked(1); } finish(records); } catch (Exception e) { log.error(e, e); } }
Source:
<code>public Stream getStream(String streamName) throws AphroditeException{ if (streamName == null) { <START> throw new AphroditeException("stream name is null."); <END> } else { for (StreamService ss : streams) { return ss.getStream(streamName); } } throw new AphroditeException("the stream service has not been initial."); }</code><technical_language>In methods check for null Objects.requireNonNull(...); this throw a NullPointerException message if checked parameters null</technical_language>

Target:
public Stream getStream(String streamName) throws AphroditeException { checkStreamServiceExists(); Objects.requireNonNull(streamName,"stream name can not be null"); for (StreamService ss : streams) { return ss.getStream(streamName); } throw new AphroditeException("the stream service has not been initial."); }
Source:
<code><START> public void setSelection(int index) { <END> if (fTableItemCount > 0) { int i = Math.min(index, fTableItemCount - 1); i = Math.max(i, 0); fSelectedEventRank = i; fSelectedBeginRank = fSelectedEventRank; if ((i < fTableTopEventRank + fFrozenRowCount && i >= fFrozenRowCount) || (i >= fTableTopEventRank + fFullyVisibleRows)) { int lastPageTopEntryRank = Math.max(0, fTableItemCount - fFullyVisibleRows); fTableTopEventRank = Math.max(0, Math.min(lastPageTopEntryRank, i - fFrozenRowCount - fFullyVisibleRows / 2)); } if (fFullyVisibleRows < fTableItemCount) { fSlider.setSelection(fTableTopEventRank); } refreshTable(); } }</code><technical_language>this call setSelection(index, index)</technical_language>

Target:
public void setSelection(int index) { setSelectionRange(index, index); }
Source:
<code>public Result doWork() { final boolean[] result = new boolean[1]; String patientIdTobeUpdated = getInputData().getString("_id"); <START> PatientDAO patientDAO = new PatientDAO(); <END> Patient patientTobeUpdated = patientDAO.findPatientByID(patientIdTobeUpdated); updatePatient(patientTobeUpdated, new DefaultResponseCallbackListener() { @Override public void onResponse() { result[0] = true; Message msg = new Message(); msg.obj = patientTobeUpdated.getPerson().getName().getNameString(); msg.what = ON_SUCCESS; mHandler.sendMessage(msg); } @Override public void onErrorResponse(String errorMessage) { result[0] = false; Message msg = new Message(); msg.obj = patientTobeUpdated.getPerson().getName().getNameString(); msg.what = ON_FAILURE; mHandler.sendMessage(msg); } }); return result[0] ? Result.success() : Result.retry(); }</code><technical_language>@rishabh-997 application constants in place of earlier constant</technical_language>

Target:
public Result doWork() { final boolean[] result = new boolean[1]; String patientIdTobeUpdated = getInputData().getString(ApplicationConstants.PRIMARY_KEY_ID); PatientDAO patientDAO = new PatientDAO(); Patient patientTobeUpdated = patientDAO.findPatientByID(patientIdTobeUpdated); updatePatient(patientTobeUpdated, new DefaultResponseCallbackListener() { @Override public void onResponse() { result[0] = true; Message msg = new Message(); msg.obj = patientTobeUpdated.getPerson().getName().getNameString(); msg.what = ON_SUCCESS; mHandler.sendMessage(msg); } @Override public void onErrorResponse(String errorMessage) { result[0] = false; Message msg = new Message(); msg.obj = patientTobeUpdated.getPerson().getName().getNameString(); msg.what = ON_FAILURE; mHandler.sendMessage(msg); } }); return result[0] ? Result.success() : Result.retry(); }
Source:
<code>protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { if (data != null && data.getBooleanExtra(EditPostActivity.EXTRA_HAS_CHANGES, false)) { if (data.getBooleanExtra(EditPostActivity.EXTRA_SAVED_AS_LOCAL_DRAFT, false)) { Snackbar.make(findViewById(R.id.coordinator), R.string.editor_post_saved_locally, Snackbar.LENGTH_LONG).show(); } else { <START> Snackbar.make(findViewById(R.id.coordinator), R.string.editor_post_saved_online, Snackbar.LENGTH_LONG).show(); <END> } } } }</code><technical_language>of Snackbars informational only, offering actions. I recommend reverting Toast style app is for cases (ToastUtils.showToast). If this in response a relevant discussion chat, suggestion for a Snackbar more general I in mind case post is saved-on-back "publishable" Snackbar offer shortcut/action. Also, zalphaDebug least, is a popup Toast offline changes post while Visual Editor</technical_language>

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == RequestCodes.EDIT_POST) { mPostList.handleEditPostResult(resultCode, data); } }
Source:
<code>public TimestampedWindowStore<K, V> build() { WindowStore<Bytes, byte[]> store = storeSupplier.get(); if (!(store instanceof TimestampedBytesStore)) { if (store.persistent()) { store = new WindowToTimestampedWindowByteStoreAdapter(store); } else { store = new InMemoryTimestampedWindowStoreMarker(store); } } <START> if (storeSupplier.retainDuplicates()) { <END> log.warn("Disabling caching for since store was configured to retain duplicates", storeSupplier.name()); enableCaching = false; } return new MeteredTimestampedWindowStore<>( maybeWrapCaching(maybeWrapLogging(store)), storeSupplier.windowSize(), storeSupplier.metricsScope(), time, keySerde, valueSerde); }</code><technical_language>suggestion if (storeSupplier.retainDuplicates() && enableCaching) { log if changing configured caching? (Also applies below)</technical_language>

Target:
public TimestampedWindowStore<K, V> build() { WindowStore<Bytes, byte[]> store = storeSupplier.get(); if (!(store instanceof TimestampedBytesStore)) { if (store.persistent()) { store = new WindowToTimestampedWindowByteStoreAdapter(store); } else { store = new InMemoryTimestampedWindowStoreMarker(store); } } if (storeSupplier.retainDuplicates() && enableCaching) { log.warn("Disabling caching for since store was configured to retain duplicates", storeSupplier.name()); enableCaching = false; } return new MeteredTimestampedWindowStore<>( maybeWrapCaching(maybeWrapLogging(store)), storeSupplier.windowSize(), storeSupplier.metricsScope(), time, keySerde, valueSerde); }
Source:
<code><START> public RegionRedundancyStatusImpl(int configuredRedundancy, int actualRedundancy, <END> String regionName, RedundancyStatus status) { this.configuredRedundancy = configuredRedundancy; this.actualRedundancy = actualRedundancy; this.regionName = regionName; this.status = status; }</code><technical_language>non-default constructor package-private (no qualifier) annotation @VisibleForTesting</technical_language>

Target:
RegionRedundancyStatusImpl(int configuredRedundancy, int actualRedundancy, String regionName, RedundancyStatus status) { this.configuredRedundancy = configuredRedundancy; this.actualRedundancy = actualRedundancy; this.regionName = regionName; this.status = status; }
Source:
<code><START> public Boolean isRebaseTransparent() { <END> return isRebaseTransparent; }</code><technical_language>boolean Boolean</technical_language>

Target:
public boolean isRebaseTransparent() { return isRebaseTransparent; }
Source:
<code><START> protected Predicate<DetailedS3Object> getNamePredicate() throws CommandException { <END> if (Guard.isMapNullOrEmpty(this.filterParams)) { return Predicates.notNull(); } final String contains = metaLookup(CONTAINS); if (Guard.isStringNullOrEmpty(contains)) { return Predicates.notNull(); } return new Predicate<DetailedS3Object>() { @Override public boolean apply(@Nullable final DetailedS3Object input) { return input.getName().contains(contains); } }; }</code><technical_language>this needs protected private</technical_language>

Target:
private Predicate<DetailedS3Object> getNamePredicate() throws CommandException { if (Guard.isMapNullOrEmpty(this.filterParams)) { return Predicates.notNull(); } final String contains = paramLookup(CONTAINS); if (Guard.isStringNullOrEmpty(contains)) { return Predicates.notNull(); } return new Predicate<DetailedS3Object>() { @Override public boolean apply(@Nullable final DetailedS3Object input) { return input.getName().contains(contains); } }; }
Source:
<code>protected Type toPrestoType(int jdbcType, int columnSize, int decimalDigits) { switch (jdbcType) { case Types.BIT: case Types.BOOLEAN: return BOOLEAN; case Types.TINYINT: return TINYINT; case Types.SMALLINT: return SMALLINT; case Types.INTEGER: return INTEGER; case Types.BIGINT: return BIGINT; case Types.REAL: return REAL; case Types.FLOAT: case Types.DOUBLE: return DOUBLE; case Types.NUMERIC: case Types.DECIMAL: return createDecimalType(columnSize, decimalDigits); case Types.CHAR: case Types.NCHAR: return createCharType(min(columnSize, CharType.MAX_LENGTH)); <START> case Types.VARCHAR: <END> case Types.NVARCHAR: case Types.LONGVARCHAR: case Types.LONGNVARCHAR: if (columnSize > VarcharType.MAX_LENGTH) { return createUnboundedVarcharType(); } return createVarcharType(columnSize); case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY: return VARBINARY; case Types.DATE: return DATE; case Types.TIME: return TIME; case Types.TIMESTAMP: return TIMESTAMP; } return null; }</code><technical_language>case exceed precision/scale supported Presto? stay DOUBLE then</technical_language>

Target:
protected Type toPrestoType(int jdbcType, int columnSize, int decimalDigits) { switch (jdbcType) { case Types.BIT: case Types.BOOLEAN: return BOOLEAN; case Types.TINYINT: return TINYINT; case Types.SMALLINT: return SMALLINT; case Types.INTEGER: return INTEGER; case Types.BIGINT: return BIGINT; case Types.REAL: return REAL; case Types.FLOAT: case Types.DOUBLE: return DOUBLE; case Types.NUMERIC: case Types.DECIMAL: int precision = columnSize + max(-decimalDigits, 0); if (precision > Decimals.MAX_PRECISION) { return null; } return createDecimalType(precision, max(decimalDigits, 0)); case Types.CHAR: case Types.NCHAR: return createCharType(min(columnSize, CharType.MAX_LENGTH)); case Types.VARCHAR: case Types.NVARCHAR: case Types.LONGVARCHAR: case Types.LONGNVARCHAR: if (columnSize > VarcharType.MAX_LENGTH) { return createUnboundedVarcharType(); } return createVarcharType(columnSize); case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY: return VARBINARY; case Types.DATE: return DATE; case Types.TIME: return TIME; case Types.TIMESTAMP: return TIMESTAMP; } return null; }
Source:
<code>public void setStatusString(String statusString, boolean isSuccessful) { this.statusString = statusString; if (statusHistory.length() > historyMaxSize) { <START> statusHistory.delete(0, statusString.length() + 1); <END> int lineEnd = statusHistory.indexOf("\n"); if (lineEnd >= 0) { statusHistory.delete(0, lineEnd+1); } } statusHistory.append("\n"); statusHistory.append(statusString); this.isSuccessful = this.isSuccessful && isSuccessful; }</code><technical_language>a bit understand delete bounds a record -- + 1 is needed account newline new status. + 1 is lineEnd is index, a length</technical_language>

Target:
public void setStatusString(String statusString, boolean isSuccessful) { this.statusString = statusString; if (statusHistory.length() > STATUS_HISTORY_MAX_BYTES) { trimHistory(statusString.length()); } statusHistory.append("\n"); statusHistory.append(statusString); this.isSuccessful = this.isSuccessful && isSuccessful; }
Source:
<code>private ExchangeType onServerNodeEvent(boolean crd) throws IgniteCheckedException { assert !firstDiscoEvt.eventNode().isClient() : this; if (firstDiscoEvt.type() == EVT_NODE_LEFT || firstDiscoEvt.type() == EVT_NODE_FAILED) { onLeft(); exchCtx.events().warnNoAffinityNodes(cctx); <START> centralizedAff = exchCtx.baselineNodeLeft() ? <END> cctx.affinity().onBaselineNodeLeft(this, crd) : cctx.affinity().onCentralizedAffinityChange(this, crd); } else cctx.affinity().onServerJoin(this, crd); return cctx.kernalContext().clientNode() ? ExchangeType.CLIENT : ExchangeType.ALL; }</code><technical_language>centralizedAff is a part of protocol. mix new protocols, some refactoring is needed</technical_language>

Target:
private ExchangeType onServerNodeEvent(boolean crd) throws IgniteCheckedException { assert !firstDiscoEvt.eventNode().isClient() : this; if (firstDiscoEvt.type() == EVT_NODE_LEFT || firstDiscoEvt.type() == EVT_NODE_FAILED) { onLeft(); exchCtx.events().warnNoAffinityNodes(cctx); centralizedAff = cctx.affinity().onCentralizedAffinityChange(this, crd); } else cctx.affinity().onServerJoin(this, crd); return cctx.kernalContext().clientNode() ? ExchangeType.CLIENT : ExchangeType.ALL; }
Source:
<code>public int getMetaFromState(IBlockState state) { int i = 0; if (state.getValue(POWERED)) { i = 1; } <START> return i; <END> }</code><technical_language>java return state.getValue(POWERED) ? 1 : 0;</technical_language>

Target:
public int getMetaFromState(IBlockState state) { return state.getValue(POWERED) ? 1 : 0; }
Source:
<code>private synchronized void loadImpl(Properties props, File confFile) { ExtensionEntry entry = new ExtensionEntry(props, confFile); ExtensionEntry alreadyLoadedEntry = loadedEntries.get(entry.getName()); if (alreadyLoadedEntry != null) { throw new ConfigurationException(String.format( <START> "Could not load the configuration '%1$s' from file %2$s. A configuration with the same name was already loaded from file %3$s", <END> entry.getName(), getFileName(entry.file), getFileName(alreadyLoadedEntry.file)) ); } loadedEntries.put(entry.getName(), entry); entry.enabled = EngineLocalConfig.getInstance().getBoolean(ENGINE_EXTENSION_ENABLED + entry.getName(), entry.enabled); if (entry.enabled && entry.extension == null) { try { entry.extension = (Extension) lookupService( Extension.class, entry.getConfig().getProperty(CLASS), entry.getConfig().getProperty(MODULE) ).newInstance(); entry.extension.setContext(entry.context); entry.extension.init(); activatedEntries.put(entry.getName(), entry); MultiValueMapUtils.addToMap(entry.getProvides(), entry, providesEntries); } catch (Exception ex) { entry.enabled = false; log.error( String.format( "Error in activating extension %1$s. Exception message is %2$s", entry.getName(), ex.getMessage() ) ); if (log.isDebugEnabled()) { log.error("", ex); } } } }</code><technical_language>add name of loaded file null</technical_language>

Target:
private synchronized void loadImpl(Properties props, File confFile) { ExtensionEntry entry = new ExtensionEntry(props, confFile); ExtensionEntry alreadyLoadedEntry = loadedEntries.get(entry.getName()); if (alreadyLoadedEntry != null) { throw new ConfigurationException(String.format( "Could not load the configuration '%1$s' from file %2$s. A configuration with the same name was already loaded from file %3$s", entry.getName(), getFileName(entry.file), getFileName(alreadyLoadedEntry.file)) ); } loadedEntries.put(entry.getName(), entry); boolean enabled = EngineLocalConfig.getInstance().getBoolean(ENGINE_EXTENSION_ENABLED + entry.getName(), entry.enabled); if (enabled && entry.extension == null) { try { entry.extension = (Extension) lookupService( Extension.class, entry.getConfig().getProperty(CLASS), entry.getConfig().getProperty(MODULE) ).newInstance(); entry.extension.setContext(entry.context); entry.extension.init(); entry.activated = true; activatedEntries.put(entry.getName(), entry); for (String provides : entry.getProvides()) { MultiValueMapUtils.addToMap(provides, entry, providesEntries); } } catch (Exception ex) { log.error( String.format( "Error in activating extension %1$s. Exception message is %2$s", entry.getName(), ex.getMessage() ) ); if (log.isDebugEnabled()) { log.error("", ex); } } } }
Source:
<code>public Mono<ClientHttpResponse> connect(HttpMethod method, URI uri, Function<? super ClientHttpRequest, Mono<Void>> requestCallback) { if (!httpClient.isStarted()) { try { this.httpClient.start(); } catch (Exception ex) { return Mono.error(ex); } } <START> if (!uri.isAbsolute()) { <END> return Mono.error(new IllegalArgumentException("URI is not absolute: " + uri)); } JettyClientHttpRequest clientHttpRequest = new JettyClientHttpRequest(httpClient.newRequest(uri).method(method.toString())); return requestCallback.apply(clientHttpRequest).then(clientHttpRequest.getResponse()); }</code><technical_language>I suggest implement SmartLifecycle above, I this check. configure WebClient in app context, client started connect is called</technical_language>

Target:
public Mono<ClientHttpResponse> connect(HttpMethod method, URI uri, Function<? super ClientHttpRequest, Mono<Void>> requestCallback) { if (!uri.isAbsolute()) { return Mono.error(new IllegalArgumentException("URI is not absolute: " + uri)); } if (!httpClient.isStarted()) { try { this.httpClient.start(); } catch (Exception ex) { return Mono.error(ex); } } JettyClientHttpRequest clientHttpRequest = new JettyClientHttpRequest( httpClient.newRequest(uri).method(method.toString()), bufferFactory); return requestCallback.apply(clientHttpRequest).then( Mono.from(clientHttpRequest.getReactiveRequest().response((reactiveResponse, contentChunks) -> { Flux<DataBuffer> content = Flux.from(contentChunks).map(chunk -> { DataBuffer buffer = this.bufferFactory.allocateBuffer(chunk.buffer.capacity()); buffer.write(chunk.buffer); chunk.callback.succeeded(); return buffer; }); return Mono.just(new JettyClientHttpResponse(reactiveResponse, content)); }))); }
Source:
<code>public ApiFuture<List<Result>> readRowsAsync(Query request) { <START> return delegate.readRowsCallable(new ResultRowAdapter()).all().futureCall(request); <END> }</code><technical_language>Please create a single instance a constant reuse</technical_language>

Target:
public ApiFuture<List<Result>> readRowsAsync(Query request) { return delegate.readRowsCallable(RESULT_ADAPTER).all().futureCall(request); }
Source:
<code>public IBuild trigger() { IBuildRequest request = client.getResourceFactory().stub(ResourceKind.BUILD_REQUEST, resource.getName()); <START> if (commitId != null && commitId.length() > 0) <END> request.setCommitId(commitId); for (String cause : causes) { request.addBuildCause(cause); } return client.create(resource.getKind(), resource.getNamespace(), resource.getName(), subresource, request); }</code><technical_language>if(StringUtils.isNotEmpty(commitId))</technical_language>

Target:
public IBuild trigger() { IBuildRequest request = client.getResourceFactory().stub(ResourceKind.BUILD_REQUEST, resource.getName()); if(StringUtils.isNotEmpty(commitId)) request.setCommitId(commitId); causes.forEach(c->request.addBuildCause(c)); return client.create(resource.getKind(), resource.getNamespace(), resource.getName(), subresource, request); }
Source:
<code>public static void main(String[] args) throws Exception { <START> Files.write(new ClosureToDts(new Compiler(System.out)) <END> .translate(Lists.transform(asList(args).subList(1, args.length), new Function<String, SourceFile>() { @Override public SourceFile apply(String input) { return SourceFile.fromFile(input, StandardCharsets.UTF_8); } })), new File(args[0]), StandardCharsets.UTF_8); }</code><technical_language>extract some more local variables this more readable? E.g. compiler, pass, list of input files, output file</technical_language>

Target:
public static void main(String[] args) throws Exception { List<String> inputFiles = asList(args).subList(1, args.length); String dtsContent = new ClosureToDts(new Compiler(System.out)) .translate(transform(inputFiles, TO_SOURCE_FILE)); Files.write(dtsContent, new File(args[0]), StandardCharsets.UTF_8); }
Source:
<code>public String getLayoutAsJson(final Structure structure, final User user) { try { <START> String languageId = request.getParameter("languageId"); <END> if (languageId == null) { languageId = (String) request.getSession().getAttribute( com.dotmarketing.util.WebKeys.HTMLPAGE_LANGUAGE); } final StructureTransformer transformer = new StructureTransformer(structure); final ContentType contentType = transformer.from(); final boolean live = (PageMode.get(Try.of(() -> HttpServletRequestThreadLocal.INSTANCE.getRequest()).getOrNull())).showLive; final ContentTypeInternationalization contentTypeInternationalization = languageId != null ? new ContentTypeInternationalization(Long.parseLong(languageId), live, user) : null; final FieldLayout layout = APILocator.getContentTypeFieldLayoutAPI().getLayout(contentType.id(), user); layout.setContentTypeInternationalization(contentTypeInternationalization); return MAPPER.writeValueAsString(layout); } catch (DotDataException | DotSecurityException | JsonProcessingException e) { throw new DotRuntimeException(e); } }</code><technical_language>LanguageWebAPI resolve front end language</technical_language>

Target:
public String getLayoutAsJson(final Structure structure, final User user) { try { final Language language = WebAPILocator.getLanguageWebAPI().getLanguage(request); final StructureTransformer transformer = new StructureTransformer(structure); final ContentType contentType = transformer.from(); final boolean live = (PageMode.get(Try.of(() -> HttpServletRequestThreadLocal.INSTANCE.getRequest()).getOrNull())).showLive; final ContentTypeInternationalization contentTypeInternationalization = language != null ? new ContentTypeInternationalization(language.getId(), live, user) : null; final FieldLayout layout = APILocator.getContentTypeFieldLayoutAPI().getLayout(contentType.id(), user); layout.setContentTypeInternationalization(contentTypeInternationalization); return MAPPER.writeValueAsString(layout); } catch (DotDataException | DotSecurityException | JsonProcessingException e) { throw new DotRuntimeException(e); } }
Source:
<code>public void TestExist() { <START> BtfTrace fixture = (BtfTrace) BtfTestTrace.BTF_TEST.getTrace(); <END> assertNotNull(fixture); }</code><technical_language>of tests do this. a @Before instead? I assume traces get closed/disposed too</technical_language>

Target:
public void TestExist() { fixture = BtfTestTrace.BTF_TEST.getTrace(); assertNotNull(fixture); }
Source:
<code>public static Map<String, Attribute> deepCopyAttributes( EntityType entityType, EntityType entityTypeCopy, AttributeFactory attrFactory) { Map<String, Attribute> copiedAttributes = newLinkedHashMap(); <START> <END> Map<String, Attribute> ownAttrMap = stream(entityType.getOwnAllAttributes().spliterator(), false) .map( attr -> { Attribute attrCopy = Attribute.newInstance(attr, DEEP_COPY_ATTRS, attrFactory); copiedAttributes.put(attr.getIdentifier(), attrCopy); return attrCopy; }) .map(attrCopy -> attrCopy.setEntity(entityTypeCopy)) .collect(toLinkedMap(Attribute::getName, Function.identity())); ownAttrMap.forEach( (attrName, ownAttr) -> { Attribute ownAttrParent = ownAttr.getParent(); if (ownAttrParent != null) { ownAttr.setParent(ownAttrMap.get(ownAttrParent.getName())); } }); entityTypeCopy.setOwnAllAttributes(ownAttrMap.values()); return copiedAttributes; }</code><technical_language>new LinkedHashMap<>(); docs: * <p><b>Note for Java 7 later:</b> this method is unnecessary treated * deprecated. Instead, {@code ArrayList} {@linkplain ArrayList#ArrayList() constructor} * directly, advantage of new <a href="<LINK_0>">"diamond" syntax</a></technical_language>

Target:
public static Map<String, Attribute> deepCopyAttributes( EntityType entityType, EntityType entityTypeCopy, AttributeFactory attrFactory) { Map<String, Attribute> copiedAttributes = new LinkedHashMap<>(); Map<String, Attribute> ownAttrMap = stream(entityType.getOwnAllAttributes().spliterator(), false) .map( attr -> { Attribute attrCopy = Attribute.newInstance(attr, DEEP_COPY_ATTRS, attrFactory); copiedAttributes.put(attr.getIdentifier(), attrCopy); return attrCopy; }) .map(attrCopy -> attrCopy.setEntity(entityTypeCopy)) .collect(toLinkedMap(Attribute::getName, Function.identity())); ownAttrMap.forEach( (attrName, ownAttr) -> { Attribute ownAttrParent = ownAttr.getParent(); if (ownAttrParent != null) { ownAttr.setParent(ownAttrMap.get(ownAttrParent.getName())); } }); entityTypeCopy.setOwnAllAttributes(ownAttrMap.values()); return copiedAttributes; }
Source:
<code>public void combustEntity(EntityCombustByEntityEvent event) { if (!(event.getCombuster() instanceof Projectile)) return; Projectile entityProjectile = (Projectile)event.getCombuster(); ProjectileSource projectileSource = entityProjectile.getShooter(); if (MUtil.isntPlayer(projectileSource)) return; Entity entityTarget = event.getEntity(); <START> if (!EnumerationUtil.isEntityTypeEditOnDamage(entityTarget.getType())) return; <END> Block block = entityTarget.getLocation().getBlock(); protect(ProtectCase.BUILD, false, projectileSource, PS.valueOf(block), block, event); }</code><technical_language>this need a null check for entityTarget</technical_language>

Target:
public void combustEntity(EntityCombustByEntityEvent event) { if (!(event.getCombuster() instanceof Projectile)) return; Projectile entityProjectile = (Projectile)event.getCombuster(); ProjectileSource projectileSource = entityProjectile.getShooter(); if (MUtil.isntPlayer(projectileSource)) return; Entity entityTarget = event.getEntity(); if (entityTarget == null || !EnumerationUtil.isEntityTypeEditOnDamage(entityTarget.getType())) return; Block block = entityTarget.getLocation().getBlock(); protect(ProtectCase.BUILD, false, projectileSource, PS.valueOf(block), block, event); }
Source:
<code><START> public void checkDecisionServerSecondContainerAMQ() throws Exception { <END> log.info("Running test checkDecisionServerSecondContainerAMQ"); List<KieContainerResource> kieContainers = getKieJmsServiceClient().listContainers().getResult().getContainers(); Collections.sort(kieContainers, ALPHABETICAL_ORDER); Assert.assertEquals(2, kieContainers.size()); Assert.assertEquals(convertKieContainerId("AnotherContainer=org.openshift.quickstarts:decisionserver-hellorules:1.3.0.Final"), kieContainers.get(1).getContainerId()); Assert.assertEquals(org.kie.server.api.model.KieContainerStatus.STARTED, kieContainers.get(1).getStatus()); }</code><technical_language>for generic exceptions</technical_language>

Target:
public void checkDecisionServerSecondContainerAMQ() throws NamingException, UnsupportedEncodingException, NoSuchAlgorithmException { log.info("Running test checkDecisionServerSecondContainerAMQ"); List<KieContainerResource> kieContainers = getKieJmsServiceClient().listContainers().getResult().getContainers(); Collections.sort(kieContainers, ALPHABETICAL_ORDER); Assert.assertEquals(2, kieContainers.size()); Assert.assertEquals(convertKieContainerId("AnotherContainer=org.openshift.quickstarts:decisionserver-hellorules:1.3.0.Final"), kieContainers.get(1).getContainerId()); Assert.assertEquals(org.kie.server.api.model.KieContainerStatus.STARTED, kieContainers.get(1).getStatus()); }
Source:
<code>public void testDefaultDateFactory() throws Exception { DefaultDateFactory defaultDateFactory = new DefaultDateFactory(); <START> assertNotNull(defaultDateFactory); <END> }</code><technical_language>[x] Is this assertion necessary? --- removed. 598b272d2c2bfd76a99858814dbd34384e11e4cc</technical_language>

Target:
public void testDefaultDateFactory() throws Exception { DefaultDateFactory defaultDateFactory = new DefaultDateFactory(); assertThat(defaultDateFactory, notNullValue()); }