auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void identifyZeroCarrier(@NonNull final String xCarrierFromHeader, @NonNull final String xCarrierMetaFromHeader) { Handler wikipediaZeroHandler = new Handler(new Handler.Callback() { private WikipediaZeroTask curZeroTask; @Override public boolean handleMessage(Message msg) { WikipediaZeroTask zeroTask = new WikipediaZeroTask( app.getApiForMobileSite(app.getSite()), app.getUserAgent()) { @Override public void onFinish(ZeroConfig config) { L.d("New Wikipedia Zero config: " + config); xCarrier = xCarrierFromHeader; if (config != null) { zeroCarrierString = xCarrierFromHeader; zeroCarrierMetaString = xCarrierMetaFromHeader; zeroConfig = config; zeroEnabled = true; zeroFunnel = new WikipediaZeroUsageFunnel(app, zeroCarrierString, StringUtil.emptyIfNull(zeroCarrierMetaString)); app.getBus().post(new WikipediaZeroStateChangeEvent()); curZeroTask = null; } acquiringCarrierMessage = false; } @Override public void onCatch(Throwable caught) { <START> L.w("Wikipedia Zero eligibility check failed"); <END> curZeroTask = null; acquiringCarrierMessage = false; } }; if (curZeroTask != null) { curZeroTask.cancel(); } curZeroTask = zeroTask; curZeroTask.execute(); acquiringCarrierMessage = true; return true; } }); wikipediaZeroHandler.removeMessages(MESSAGE_ZERO_CS); Message zeroMessage = Message.obtain(); zeroMessage.what = MESSAGE_ZERO_CS; zeroMessage.obj = "zero_eligible_check"; wikipediaZeroHandler.sendMessage(zeroMessage); }</code><technical_language>Nice. If useful, consider including exception in log supply a line number other hints: L.w("Wikipedia Zero eligibility check failed", caught);</technical_language>

Target:
private void identifyZeroCarrier(@NonNull final String xCarrierFromHeader, @NonNull final String xCarrierMetaFromHeader) { Handler wikipediaZeroHandler = new Handler(new Handler.Callback() { private WikipediaZeroTask curZeroTask; @Override public boolean handleMessage(Message msg) { WikipediaZeroTask zeroTask = new WikipediaZeroTask( app.getApiForMobileSite(app.getSite()), app.getUserAgent()) { @Override public void onFinish(ZeroConfig config) { L.i("New Wikipedia Zero config: " + config); xCarrier = xCarrierFromHeader; if (config != null) { zeroCarrierString = xCarrierFromHeader; zeroCarrierMetaString = xCarrierMetaFromHeader; zeroConfig = config; zeroEnabled = true; zeroFunnel = new WikipediaZeroUsageFunnel(app, zeroCarrierString, StringUtil.emptyIfNull(zeroCarrierMetaString)); app.getBus().post(new WikipediaZeroStateChangeEvent()); curZeroTask = null; } acquiringCarrierMessage = false; } @Override public void onCatch(Throwable caught) { L.w("Wikipedia Zero eligibility check failed", caught); curZeroTask = null; acquiringCarrierMessage = false; } }; if (curZeroTask != null) { curZeroTask.cancel(); } curZeroTask = zeroTask; curZeroTask.execute(); acquiringCarrierMessage = true; return true; } }); wikipediaZeroHandler.removeMessages(MESSAGE_ZERO_CS); Message zeroMessage = Message.obtain(); zeroMessage.what = MESSAGE_ZERO_CS; zeroMessage.obj = "zero_eligible_check"; wikipediaZeroHandler.sendMessage(zeroMessage); }
Source:
<code><START> public JBlock getOnDestroyViewAfterSuperBlock() { <END> if (onDestroyViewAfterSuperBlock == null) { setContentViewRelatedMethods(); } return onDestroyViewAfterSuperBlock; }</code><technical_language>This private if move field creation holder i suggested</technical_language>

Target:
private JBlock getOnDestroyViewAfterSuperBlock() { if (onDestroyViewAfterSuperBlock == null) { setContentViewRelatedMethods(); } return onDestroyViewAfterSuperBlock; }
Source:
<code>public synchronized boolean bridgeLogout() { <START> logger.trace("bridgeLogout() called."); <END> logger.trace("bridgeLogout(): emptying authentication token."); authenticationToken = ""; Logout bcp = this.bridgeAPI().logout(); if (bridgeCommunicate(bcp, false)) { logger.trace("bridgeLogout(): communication succeeded."); if (bcp.isCommunicationSuccessful()) { logger.trace("bridgeLogout(): logout successful."); return true; } } return false; }</code><technical_language>Join this trace message it</technical_language>

Target:
public synchronized boolean bridgeLogout() { logger.trace("bridgeLogout() called: emptying authentication token."); authenticationToken = ""; Logout bcp = bridgeAPI().logout(); if (bridgeCommunicate(bcp, false)) { logger.trace("bridgeLogout(): communication succeeded."); if (bcp.isCommunicationSuccessful()) { logger.trace("bridgeLogout(): logout successful."); return true; } } return false; }
Source:
<code>protected Object fastClone(final Object o, final Map<Object, Object> clones) throws IllegalAccessException { <START> if ((o instanceof Term && !((Term) o).isMutable())) { <END> return o; } else { return super.fastClone(o, clones); } }</code><technical_language>extra parentheses for</technical_language>

Target:
protected Object fastClone(final Object o, final Map<Object, Object> clones) throws IllegalAccessException { if (o instanceof Term && !((Term) o).isMutable()) { return o; } else { return super.fastClone(o, clones); } }
Source:
<code>protected Object execute(Object data) { String userFormat; if (data == null) { throw new ExecutionPlanRuntimeException("Invalid input given to time:dayOfWeek(dateValue," + "dateFormat) function" + ". First " + "argument cannot be null"); } <START> userFormat = (String) data; <END> String source = null; FastDateFormat userSpecificFormat; Date userSpecifiedDate; try { source = (String) data; userSpecificFormat = FastDateFormat.getInstance(userFormat); userSpecifiedDate = userSpecificFormat.parse(source); return getDayOfWeek(userSpecifiedDate); } catch (ParseException e) { String errorMsg = "Provided format " + userFormat + " does not match with the timestamp " + source + e .getMessage(); throw new ExecutionPlanRuntimeException(errorMsg, e); } catch (ClassCastException e) { String errorMsg = "Provided Data type cannot be cast to desired format. " + e.getMessage(); throw new ExecutionPlanRuntimeException(errorMsg, e); } }</code><technical_language>@minudika In this method, assigning for dateFormat dateValue. this method executed for a single parameter, I dateFormat fixed dateValue considered</technical_language>

Target:
protected Object execute(Object data) { String userFormat; if (data == null) { throw new ExecutionPlanRuntimeException("Invalid input given to time:dayOfWeek(dateValue," + "dateFormat) function" + ". First " + "argument cannot be null"); } userFormat = TimeExtensionConstants.EXTENSION_TIME_DEFAULT_DATE_FORMAT; String source; try { source = (String) data; String inputData[] = source.split(" "); DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); try { Date date = format.parse(inputData[0]); return getDayOfWeek(date); } catch (ParseException e) { String errorMsg = "Provided format " + userFormat + " does not match with the timestamp " + source + e .getMessage(); throw new ExecutionPlanRuntimeException(errorMsg, e); } } catch (ClassCastException e) { String errorMsg = "Provided Data type cannot be cast to desired format. " + e.getMessage(); throw new ExecutionPlanRuntimeException(errorMsg, e); } }
Source:
<code>public void valueOfCodeCanFindByMatchingCode() { <START> final MantaErrorCode expectedLimitError = MantaErrorCode.INVALID_LIMIT_ERROR; <END> final MantaErrorCode expectedNoApiError = MantaErrorCode.NO_API_SERVERS_AVAILABLE; final MantaErrorCode expectedObjectNotFoundError = MantaErrorCode.OBJECT_NOT_FOUND_ERROR; final MantaErrorCode actualLimitError = MantaErrorCode.valueOfCode("InvalidLimit"); final MantaErrorCode actualNoApiError = MantaErrorCode.valueOfCode("NoApiServersAvailable"); final MantaErrorCode actualObjectNotFoundError = MantaErrorCode.valueOfCode("ObjectNotFoundError"); Assert.assertEquals(actualLimitError, expectedLimitError); Assert.assertEquals(actualNoApiError, expectedNoApiError); Assert.assertEquals(actualObjectNotFoundError, expectedObjectNotFoundError); }</code><technical_language>I raw enum is simpler</technical_language>

Target:
public void valueOfCodeCanFindByMatchingCode() { final MantaErrorCode actualLimitError = MantaErrorCode.valueOfCode("InvalidLimit"); final MantaErrorCode actualNoApiError = MantaErrorCode.valueOfCode("NoApiServersAvailable"); final MantaErrorCode actualObjectNotFoundError = MantaErrorCode.valueOfCode("ObjectNotFoundError"); Assert.assertEquals(actualLimitError, INVALID_LIMIT_ERROR); Assert.assertEquals(actualNoApiError, NO_API_SERVERS_AVAILABLE); Assert.assertEquals(actualObjectNotFoundError, OBJECT_NOT_FOUND_ERROR); }
Source:
<code>private static void assertSortOrdersAreEqual(final SAMFileHeader newHeader, final File inputFile) throws IOException { <START> final SAMFileHeader origHeader = SamReaderFactory.makeDefault().open(inputFile).getFileHeader(); <END> final SAMFileHeader.SortOrder newSortOrder = newHeader.getSortOrder(); if (newSortOrder != SAMFileHeader.SortOrder.unsorted && newSortOrder != origHeader.getSortOrder()) { throw new SAMException("Sort order of new header does not match the original file, needs to be " + origHeader.getSortOrder()); } }</code><technical_language>This file is closed? a convenience function</technical_language>

Target:
private static void assertSortOrdersAreEqual(final SAMFileHeader newHeader, final File inputFile) throws IOException { final SamReader reader = SamReaderFactory.makeDefault().open(inputFile); final SAMFileHeader origHeader = reader.getFileHeader(); final SAMFileHeader.SortOrder newSortOrder = newHeader.getSortOrder(); if (newSortOrder != SAMFileHeader.SortOrder.unsorted && newSortOrder != origHeader.getSortOrder()) { throw new SAMException("Sort order of new header does not match the original file, needs to be " + origHeader.getSortOrder()); } reader.close(); }
Source:
<code>private Map<PlanNodeId, SplitSource> visitScanAndFilter(TableScanNode scan, Optional<FilterNode> filter) { Set<DynamicFilter> dynamicFilters = filter .map(FilterNode::getPredicate) .map(ExpressionUtils::extractDynamicFilters) .map(ExtractDynamicFiltersResult::getDynamicFilters) .orElse(ImmutableSet.of()); SplitSource splitSource; if (!dynamicFilters.isEmpty()) { System.out.printf("[DistributedExecutionPlanner] Dynamic filters: %s\n", dynamicFilters); List<ListenableFuture<DynamicFilterDescription>> futuresList <START> = dynamicFilterDescriptionFutureSupplier.get(session.getQueryId().toString(), dynamicFilters, scan.getAssignments()); <END> splitSource = splitManager.getSplits(session, scan.getLayout().get(), Futures.allAsList(futuresList)); } else { splitSource = splitManager.getSplits(session, scan.getLayout().get()); } splitSources.add(splitSource); return ImmutableMap.of(scan.getId(), splitSource); }</code><technical_language>I pass list of futures, implemented lazily in connector</technical_language>

Target:
private Map<PlanNodeId, SplitSource> visitScanAndFilter(TableScanNode scan, Optional<FilterNode> filter) { Set<DynamicFilter> dynamicFilters = filter .map(FilterNode::getPredicate) .map(DynamicFilterUtils::extractDynamicFilters) .map(ExtractDynamicFiltersResult::getDynamicFilters) .orElse(ImmutableSet.of()); List<Future<DynamicFilterDescription>> futuresList = ImmutableList.of(); if (!dynamicFilters.isEmpty()) { log.debug("Dynamic filters: %s", dynamicFilters); futuresList = dynamicFilterDescriptionFutureSupplier.get(session.getQueryId().toString(), dynamicFilters, scan.getAssignments()); } SplitSource splitSource = splitManager.getSplits(session, scan.getLayout().get(), futuresList); splitSources.add(splitSource); return ImmutableMap.of(scan.getId(), splitSource); }
Source:
<code>public PackReverseIndex(final PackIndex packIndex) { index = packIndex; final long cnt = index.getObjectCount(); if (cnt > Integer.MAX_VALUE) throw new IllegalArgumentException( JGitText.get().hugeIndexesAreNotSupportedByJgitYet); if (cnt == 0) { bucketSize = Long.MAX_VALUE; offsetIndex = new int[1]; nth = new int[0]; return; } final long[] offsetsBySha1 = new long[(int) cnt]; long maxOffset = 0; int ith = 0; for (final MutableEntry me : index) { final long o = me.getOffset(); offsetsBySha1[ith++] = o; if (o > maxOffset) maxOffset = o; } bucketSize = maxOffset / cnt + 1; offsetIndex = new int[(int) cnt]; int[] bucketValues = new int[(int) cnt + 1]; for (int oi = 0; oi < offsetsBySha1.length; oi++) { final long o = offsetsBySha1[oi]; <START> final int bucketIndexPos = (int) (o / bucketSize); <END> final int bucketValuesPos = oi + 1; final int current = offsetIndex[bucketIndexPos]; offsetIndex[bucketIndexPos] = bucketValuesPos; bucketValues[bucketValuesPos] = current; } int nthByOffset = 0; nth = new int[offsetsBySha1.length]; for (int bi = 0; bi < offsetIndex.length; bi++) { final int start = nthByOffset; for (int vi = offsetIndex[bi]; vi > 0; vi = bucketValues[vi]) { final int nthBySha1 = vi - 1; final long o = offsetsBySha1[nthBySha1]; int insertion = nthByOffset++; for (; start < insertion; insertion--) { if (o > offsetsBySha1[nth[insertion - 1]]) break; nth[insertion] = nth[insertion - 1]; } nth[insertion] = nthBySha1; } offsetIndex[bi] = nthByOffset; } }</code><technical_language>clear this index in list of buckets. "final int bucket = ..."</technical_language>

Target:
public PackReverseIndex(final PackIndex packIndex) { index = packIndex; final long cnt = index.getObjectCount(); if (cnt > Integer.MAX_VALUE) throw new IllegalArgumentException( JGitText.get().hugeIndexesAreNotSupportedByJgitYet); if (cnt == 0) { bucketSize = Long.MAX_VALUE; offsetIndex = new int[1]; nth = new int[0]; return; } final long[] offsetsBySha1 = new long[(int) cnt]; long maxOffset = 0; int ith = 0; for (final MutableEntry me : index) { final long o = me.getOffset(); offsetsBySha1[ith++] = o; if (o > maxOffset) maxOffset = o; } bucketSize = maxOffset / cnt + 1; int[] bucketIndex = new int[(int) cnt]; int[] bucketValues = new int[(int) cnt + 1]; for (int oi = 0; oi < offsetsBySha1.length; oi++) { final long o = offsetsBySha1[oi]; final int bucket = (int) (o / bucketSize); final int bucketValuesPos = oi + 1; final int current = bucketIndex[bucket]; bucketIndex[bucket] = bucketValuesPos; bucketValues[bucketValuesPos] = current; } int nthByOffset = 0; nth = new int[offsetsBySha1.length]; offsetIndex = bucketIndex; for (int bi = 0; bi < bucketIndex.length; bi++) { final int start = nthByOffset; for (int vi = bucketIndex[bi]; vi > 0; vi = bucketValues[vi]) { final int nthBySha1 = vi - 1; final long o = offsetsBySha1[nthBySha1]; int insertion = nthByOffset++; for (; start < insertion; insertion--) { if (o > offsetsBySha1[nth[insertion - 1]]) break; nth[insertion] = nth[insertion - 1]; } nth[insertion] = nthBySha1; } offsetIndex[bi] = nthByOffset; } }
Source:
<code>public static <T extends ITmfEventAspect> Object resolveEventAspectOfClassForEvent( ITmfTrace trace, Class<T> aspectClass, @NonNull ITmfEvent event) { <START> Object obj = null; <END> for (T aspect : getEventAspectsOfClass(trace, aspectClass)) { obj = aspect.resolve(event); if (obj != null) { return obj; } } return null; }</code><technical_language>hmm, a cache. aspects necessarily "immutable" for a event. Calling resolve point yield result calling later, I cache them. class calls .resolve() call "cache" though. possibly merging methods: If case here, for example classes a TmfCpuAspect, basically do to: "Go aspects of this trace, find a TmfCpuAspect returns a valid non-null value, gimme this value". utility method that? specific a TmfCpuAspect (and derived classes) too</technical_language>

Target:
public static <T extends ITmfEventAspect> Object resolveEventAspectOfClassForEvent( ITmfTrace trace, Class<T> aspectClass, @NonNull ITmfEvent event) { Iterable<ITmfEventAspect> aspects = trace.getEventAspects(); for (ITmfEventAspect aspect : aspects) { if (aspectClass.isAssignableFrom(aspect.getClass())) { Object obj = aspect.resolve(event); if (obj != null) { return obj; } } } return null; }
Source:
<code>private static void createContainer() { if (sqsContainer == null) { sqsContainer = new GenericContainer("roribio16/alpine-sqs") <START> .withStartupTimeout(Duration.ofMinutes(3)); <END> sqsContainer.start(); } }</code><technical_language>Possibly option (not requiring waitForSQSContainerToStart) waiting strategy (reference: <LINK_1> java .withExposedPorts(80) .waitingFor(Wait.forHttp("/")); withe port exposed sqs end endpoint pointing queue interested in (<LINK_0></technical_language>

Target:
private static void createContainer() { if (sqsContainer == null) { sqsContainer = new GenericContainer("roribio16/alpine-sqs") .withExposedPorts(9324) .waitingFor(Wait.forHttp("/?Action=GetQueueUrl&QueueName=default")); sqsContainer.start(); } }
Source:
<code>public void cookieRenewal() throws Exception { final String renewalCookieValue = "AuthSession=\"RenewCookie_a2ltc3RlYmVsOjUxMzRBQTUzOtiY2_IDUIdsTJEVNEjObAbyhrgz\";"; mockWebServer.enqueue(MockWebServerResource.OK_COOKIE); mockWebServer.enqueue(new MockResponse().setResponseCode(200).addHeader("Set-Cookie", String.format(Locale.ENGLISH, "%s;", renewalCookieValue)) .setBody("{\"hello\":\"world\"}\r\n")); mockWebServer.enqueue(new MockResponse()); CloudantClient c = CloudantClientHelper.newMockWebServerClientBuilder(mockWebServer) .username("a") .password("b") .build(); c.executeRequest(Http.GET(c.getBaseUri())); mockWebServer.takeRequest(); mockWebServer.takeRequest(); c.executeRequest(Http.GET(c.getBaseUri())); <START> assertEquals("The server should have received 4 requests", 3, mockWebServer <END> .getRequestCount()); RecordedRequest request = mockWebServer.takeRequest(); String headerValue = request.getHeader("Cookie"); Assert.assertEquals("AuthSession=\"RenewCookie_a2ltc3RlYmVsOjUxMzRBQTUzOtiY2_IDUIdsTJEVNEjObAbyhrgz\"", headerValue); }</code><technical_language>takeRequest is blocking (potentially tests time out if correct number of requests exception thrown) want re-order this assert takeRequest calls</technical_language>

Target:
public void cookieRenewal() throws Exception { final String renewalCookieValue = "AuthSession=\"RenewCookie_a2ltc3RlYmVsOjUxMzRBQTUzOtiY2_IDUIdsTJEVNEjObAbyhrgz\";"; mockWebServer.enqueue(MockWebServerResource.OK_COOKIE); mockWebServer.enqueue(new MockResponse().setResponseCode(200).addHeader("Set-Cookie", String.format(Locale.ENGLISH, "%s;", renewalCookieValue)) .setBody("{\"hello\":\"world\"}\r\n")); mockWebServer.enqueue(new MockResponse()); CloudantClient c = CloudantClientHelper.newMockWebServerClientBuilder(mockWebServer) .username("a") .password("b") .build(); c.executeRequest(Http.GET(c.getBaseUri())); c.executeRequest(Http.GET(c.getBaseUri())); assertEquals("The server should have received 3 requests", 3, mockWebServer .getRequestCount()); mockWebServer.takeRequest(); mockWebServer.takeRequest(); RecordedRequest request = mockWebServer.takeRequest(); String headerValue = request.getHeader("Cookie"); Assert.assertEquals("AuthSession=\"RenewCookie_a2ltc3RlYmVsOjUxMzRBQTUzOtiY2_IDUIdsTJEVNEjObAbyhrgz\"", headerValue); }
Source:
<code>public void addSegments(Iterable<DataSegment> segments) { try { for (DataSegment segment : segments) { serverManager.loadSegment(segment); File segmentInfoCacheFile = new File(config.getSegmentInfoCacheDirectory(), segment.getIdentifier()); try { <START> jsonMapper.writeValue(segmentInfoCacheFile, segment); <END> } catch (IOException e) { removeSegment(segment); throw new SegmentLoadingException( e, "Failed to write to disk segment info cache file[%s]", segmentInfoCacheFile ); } } try { announcer.announceSegments(segments); } catch (IOException e) { removeSegments(segments); throw new SegmentLoadingException(e, "Failed to announce segments[%s]", segments); } } catch (SegmentLoadingException e) { log.makeAlert(e, "Failed to load segments for dataSource") .addData("segments", segments) .emit(); } }</code><technical_language>Hrm, write this load segment? Also, a check for if file exists, overwrite this code is doing</technical_language>

Target:
public void addSegments(Iterable<DataSegment> segments) { try { for (DataSegment segment : segments) { serverManager.loadSegment(segment); File segmentInfoCacheFile = new File(config.getSegmentInfoCacheDirectory(), segment.getIdentifier()); if (!segmentInfoCacheFile.exists()) { try { jsonMapper.writeValue(segmentInfoCacheFile, segment); } catch (IOException e) { removeSegment(segment); throw new SegmentLoadingException( e, "Failed to write to disk segment info cache file[%s]", segmentInfoCacheFile ); } } } try { announcer.announceSegments(segments); } catch (IOException e) { removeSegments(segments); throw new SegmentLoadingException(e, "Failed to announce segments[%s]", segments); } } catch (SegmentLoadingException e) { log.makeAlert(e, "Failed to load segments for dataSource") .addData("segments", segments) .emit(); } }
Source:
<code>protected AbstractXmlApplicationContext createApplicationContext() { String version = Version.getCurrentVersion(); ClassPathXmlApplicationContext applicationContext = null; <START> if (version.startsWith("2") && (version.contains("2.5") || version.contains("2.4"))) { <END> applicationContext = new ClassPathXmlApplicationContext(new String("org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml")); } else { applicationContext = new ClassPathXmlApplicationContext(new String("org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans-2.6.xml")); } emulateBeanRegistrationProgrammatically(applicationContext); return applicationContext; }</code><technical_language>This version check removed move 2.6.x</technical_language>

Target:
protected AbstractXmlApplicationContext createApplicationContext() { ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String("org/apache/camel/component/cxf/jaxrs/CxfRsSpringEndpointBeans.xml")); emulateBeanRegistrationProgrammatically(applicationContext); return applicationContext; }
Source:
<code><START> StoreIndexDescriptor( StoreIndexDescriptor indexDescriptor ) <END> { super( indexDescriptor ); this.id = indexDescriptor.id; this.owningConstraintId = indexDescriptor.owningConstraintId; this.name = indexDescriptor.name; }</code><technical_language>This constructor delegate other constructor</technical_language>

Target:
protected StoreIndexDescriptor( StoreIndexDescriptor indexDescriptor ) { super( indexDescriptor ); this.id = indexDescriptor.id; this.owningConstraintId = indexDescriptor.owningConstraintId; this.name = indexDescriptor.name; }
Source:
<code>public void initHandlers(EventBus eventBus) { if (ssoTokenHandlerRegistration != null) { ssoTokenHandlerRegistration.removeHandler(); } ssoTokenHandlerRegistration = eventBus.addHandler(SSOTokenChangeEvent.getType(), new SSOTokenChangeHandler() { @Override public void onSSOTokenChange(SSOTokenChangeEvent event) { <START> ssoToken = event.getSsoToken(); <END> checkIfInitFinished(); } } ); }</code><technical_language>Please consider "ReportInit.this.ssoToken" for readability. Also, do in case SSO token is null? If (edge) case occurs, I guess simply update some flag checkIfInitFinished method proceed raising reportsInitEvent</technical_language>

Target:
public void initHandlers(EventBus eventBus) { if (ssoTokenHandlerRegistration != null) { ssoTokenHandlerRegistration.removeHandler(); } ssoTokenHandlerRegistration = eventBus.addHandler(SSOTokenChangeEvent.getType(), new SSOTokenChangeHandler() { @Override public void onSSOTokenChange(SSOTokenChangeEvent event) { ReportInit.this.ssoToken = event.getToken(); if (ReportInit.this.ssoToken == null) { ReportInit.this.ssoToken = ""; } checkIfInitFinished(); } } ); }
Source:
<code>public boolean hasAccessLevel(String right, XWikiUser user, EntityReference entityRef) { <START> return hasAccessLevel(entityRef, EAccessLevel.getAccessLevel(right).get(), user); <END> }</code><technical_language>This a NPE, instead resolve Optionals checking present()</technical_language>

Target:
public boolean hasAccessLevel(String right, XWikiUser user, EntityReference entityRef) { Optional<EAccessLevel> eAccessLevel = EAccessLevel.getAccessLevel(right); if (eAccessLevel.isPresent()) { return hasAccessLevel(entityRef, eAccessLevel.get(), user); } return false; }
Source:
<code>public void overrideInitMainSchedulerThrowsWhenSchedulerCallableIsNull() { try { RxAndroidPlugins.initMainThreadScheduler(null); <START> fail("Should have thrown NullPointerException"); <END> } catch (NullPointerException npe) { assertEquals("Scheduler Callable can't be null", npe.getMessage()); } }</code><technical_language>Remove message fail()</technical_language>

Target:
public void overrideInitMainSchedulerThrowsWhenSchedulerCallableIsNull() { try { RxAndroidPlugins.initMainThreadScheduler(null); fail(); } catch (NullPointerException e) { assertEquals("scheduler == null", e.getMessage()); } }
Source:
<code>protected boolean hasNhinTargetHomeCommunityId( RespondingGatewayProvideAndRegisterDocumentSetSecuredResponseRequestType request) { if (request != null && request.getNhinTargetCommunities() != null && NullChecker.isNotNullish(request.getNhinTargetCommunities().getNhinTargetCommunity()) && request.getNhinTargetCommunities().getNhinTargetCommunity().get(0) != null && request.getNhinTargetCommunities().getNhinTargetCommunity().get(0).getHomeCommunity() != null <START> && NullChecker.isNotNullish(request.getNhinTargetCommunities().getNhinTargetCommunity().get(0) <END> .getHomeCommunity().getHomeCommunityId())) { return true; } return false; }</code><technical_language>This if check is redundant here. simply do a return (request != null && request.getNhinTargetCommunities() != null && NullChecker.isNotNullish(request.getNhinTargetCommunities().getNhinTargetCommunity()) && request.getNhinTargetCommunities().getNhinTargetCommunity().get(0) != null && request.getNhinTargetCommunities().getNhinTargetCommunity().get(0).getHomeCommunity() != null && NullChecker.isNotNullish(request.getNhinTargetCommunities().getNhinTargetCommunity().get(0) .getHomeCommunity().getHomeCommunityId()));</technical_language>

Target:
protected boolean hasNhinTargetHomeCommunityId( RespondingGatewayProvideAndRegisterDocumentSetSecuredResponseRequestType request) { return (request != null && request.getNhinTargetCommunities() != null && NullChecker.isNotNullish(request.getNhinTargetCommunities().getNhinTargetCommunity()) && request.getNhinTargetCommunities().getNhinTargetCommunity().get(0) != null && request.getNhinTargetCommunities().getNhinTargetCommunity().get(0).getHomeCommunity() != null && NullChecker.isNotNullish(request.getNhinTargetCommunities().getNhinTargetCommunity().get(0) .getHomeCommunity().getHomeCommunityId())); }
Source:
<code>private boolean hasLombokGeneratedAnnotation(final MethodNode methodNode) { <START> final List<AnnotationNode> list = methodNode.invisibleAnnotations; <END> if (list != null) { for (final AnnotationNode annotation : list) { if ("Llombok/Generated;".equals(annotation.desc)) { return true; } } } return false; }</code><technical_language>@marchof prefer name local variable invisibleAnnotations runtimeInvisibleAnnotations instead of list</technical_language>

Target:
private boolean hasLombokGeneratedAnnotation(final MethodNode methodNode) { final List<AnnotationNode> runtimeInvisibleAnnotations = methodNode.invisibleAnnotations; if (runtimeInvisibleAnnotations != null) { for (final AnnotationNode annotation : runtimeInvisibleAnnotations) { if ("Llombok/Generated;".equals(annotation.desc)) { return true; } } } return false; }
Source:
<code>public void registerMessageConsumer(String brokerName, MqttMessageConsumer mqttMessageConsumer) { <START> mqttMessageConsumer.setEventPublisher(eventPublisher); <END> try { MqttBrokerConnection brokerConnection = getBrokerConnection(brokerName); if (brokerConnection != null) { brokerConnection.addConsumer(mqttMessageConsumer); } } catch (MqttException e) { logger.debug("Consumer could not be activated", e); } }</code><technical_language>part of PR deprecated I guess this done in line 283 consumer added connection</technical_language>

Target:
public void registerMessageConsumer(String brokerName, MqttMessageConsumer mqttMessageConsumer) { try { MqttBrokerConnection brokerConnection = getBrokerConnection(brokerName); if (brokerConnection != null) { brokerConnection.addConsumer(mqttMessageConsumer); mqttMessageConsumer.setEventPublisher(eventPublisher); } } catch (MqttException e) { logger.debug("Consumer could not be activated", e); } }
Source:
<code><START> private AliyunDateAdapter(DateService dateService) { <END> super(dateService); }</code><technical_language>Remove private modifier properly test it</technical_language>

Target:
AliyunDateAdapter(DateService dateService) { super(dateService); }
Source:
<code><START> public void notifySuccessfullArrival(UUID player) { <END> if (isPlayerInExitTransit(player)) { PlayerEnsuredToTransitEvent e = new PlayerEnsuredToTransitEvent(player, exitTransit.get(player)); Bukkit.getPluginManager().callEvent(e); exitTransit.remove(player); } }</code><technical_language>this checking isPlayerInArrivalTransit() arrivalTransit? if throws event, a PlayerEnsuredFromTransitEvent</technical_language>

Target:
public void notifySuccessfullArrival(UUID player) { if (isPlayerInArrivalTransit(player)) { arrivalTransit.remove(player); } }
Source:
<code>public T createHosted(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "For tools, the Docker registry") @QueryParam("registry") String registry, @ApiParam(value = "name", required = true) @QueryParam("name") String name, @ApiParam(value = "Descriptor type", required = true) @QueryParam("descriptorType") String descriptorType, @ApiParam(value = "For tools, the Docker namespace") @QueryParam("namespace") String namespace) { <START> int calculatedLimit = MoreObjects.firstNonNull(this.limitConfig.getWorkflowLimit(), Integer.MAX_VALUE); <END> final long currentCount = getEntryDAO().countAllHosted(user.getId()); if (currentCount >= calculatedLimit) { throw new CustomWebApplicationException("You have " + currentCount + " workflows which is at the current limit of " + calculatedLimit, HttpStatus.SC_PAYMENT_REQUIRED); } descriptorType = checkType(descriptorType); T entry = getEntry(user, registry, name, descriptorType, namespace); checkForDuplicatePath(entry); long l = getEntryDAO().create(entry); T byId = getEntryDAO().findById(l); elasticManager.handleIndexUpdate(byId, ElasticMode.UPDATE); return byId; }</code><technical_language>1. calculated limit a field set in constructor instead of reading here. 2. If do that, I final here. 3. sense a default value, 100? of trivial necessary</technical_language>

Target:
public T createHosted(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "For tools, the Docker registry") @QueryParam("registry") String registry, @ApiParam(value = "name", required = true) @QueryParam("name") String name, @ApiParam(value = "Descriptor type", required = true) @QueryParam("descriptorType") String descriptorType, @ApiParam(value = "For tools, the Docker namespace") @QueryParam("namespace") String namespace) { final long currentCount = getEntryDAO().countAllHosted(user.getId()); if (currentCount >= calculatedEntryLimit) { throw new CustomWebApplicationException("You have " + currentCount + " workflows which is at the current limit of " + calculatedEntryLimit, HttpStatus.SC_PAYMENT_REQUIRED); } descriptorType = checkType(descriptorType); T entry = getEntry(user, registry, name, descriptorType, namespace); checkForDuplicatePath(entry); long l = getEntryDAO().create(entry); T byId = getEntryDAO().findById(l); elasticManager.handleIndexUpdate(byId, ElasticMode.UPDATE); return byId; }
Source:
<code>protected Tombstone resource() { final FedoraId resourceId = identifierConverter().pathToInternalId(externalPath); try { <START> final Tombstone resource = resourceFactory.getResource(transaction(), resourceId, Tombstone.class); <END> return resource; } catch (final PathNotFoundException e) { throw new PathNotFoundRuntimeException(e); } }</code><technical_language>return result of resourceFactory.getResource(..), no</technical_language>

Target:
protected FedoraResource resource() { final FedoraId resourceId = identifierConverter().pathToInternalId(externalPath); try { return resourceFactory.getResource(transaction(), resourceId); } catch (final PathNotFoundException e) { throw new PathNotFoundRuntimeException(e); } }
Source:
<code>private synchronized Map<ArchitectureType, Map<Version, Boolean>> getMap(ArchCapabilitiesVerb archCapabilitiesVerb) { <START> if (verbMap.containsKey(archCapabilitiesVerb)) { <END> return verbMap.get(archCapabilitiesVerb); } else { Map<ArchitectureType, Map<Version, Boolean>> supportMap = new EnumMap<ArchitectureType, Map<Version, Boolean>>(ArchitectureType.class); for (ArchitectureType arch : ArchitectureType.values()) { Map<Version, Boolean> archMap = new HashMap<Version, Boolean>(); for (Version version : Version.ALL) { boolean isSupported = isSupported(archCapabilitiesVerb, arch, version); archMap.put(version, isSupported); } supportMap.put(arch, archMap); } verbMap.put(archCapabilitiesVerb, supportMap); return supportMap; } }</code><technical_language>do handle NULL argument passed this method</technical_language>

Target:
private synchronized Map<ArchitectureType, Map<Version, Boolean>> getMap(ArchCapabilitiesVerb archCapabilitiesVerb) { if (archCapabilitiesVerb == null) { return null; } if (verbMap.containsKey(archCapabilitiesVerb)) { return verbMap.get(archCapabilitiesVerb); } else { Map<ArchitectureType, Map<Version, Boolean>> supportMap = new EnumMap<ArchitectureType, Map<Version, Boolean>>(ArchitectureType.class); for (ArchitectureType arch : ArchitectureType.values()) { Map<Version, Boolean> archMap = new HashMap<Version, Boolean>(); for (Version version : Version.ALL) { archMap.put(version, isSupported(archCapabilitiesVerb, arch, version)); } supportMap.put(arch, archMap); } verbMap.put(archCapabilitiesVerb, supportMap); return supportMap; } }
Source:
<code>public SparkStreamingPlugin(MessageBus messageBus) { <START> super(messageBus, null); <END> }</code><technical_language>I is a 1 parameter version of this constructor instead of passing null</technical_language>

Target:
public SparkStreamingPlugin(MessageBus messageBus) { super(messageBus); }
Source:
<code>SegmentIterator() { try { fileSize = writeChannel.size(); if (writeChannel.position() == 0) { LogHeader header = parseHeader(writeChannel, filePath); if (header == null) { log.warn("SegmentIterator: Couldn't find log header for {}, " + "creating new header.", filePath); writeHeader(writeChannel, logSizeQuota, VERSION, logParams.verifyChecksum); <START> hasHeader = false; <END> } } } catch (IOException e) { log.error("SegmentIterator: Error reading file: {}", filePath, e); throw new IllegalStateException(e); } }</code><technical_language>hesHeader is false writing header</technical_language>

Target:
SegmentIterator() { try { hasHeader = true; fileSize = writeChannel.size(); if (writeChannel.position() == 0) { LogHeader header = parseHeader(writeChannel, filePath); if (header == null) { hasHeader = false; log.warn("SegmentIterator: Couldn't find log header for {}, " + "creating new header.", filePath); writeHeader(writeChannel, logSizeQuota, VERSION, logParams.verifyChecksum); } } } catch (IOException e) { log.error("SegmentIterator: Error reading file: {}", filePath, e); throw new IllegalStateException(e); } }
Source:
<code>private void runLongly() { double[][] data = new double[][] { { 60323, 83.0, 234289, 2356, 1590, 107608, 1947 }, { 61122, 88.5, 259426, 2325, 1456, 108632, 1948 }, { 60171, 88.2, 258054, 3682, 1616, 109773, 1949 }, { 61187, 89.5, 284599, 3351, 1650, 110929, 1950 }, { 63221, 96.2, 328975, 2099, 3099, 112075, 1951 }, { 63639, 98.1, 346999, 1932, 3594, 113270, 1952 }, { 64989, 99.0, 365385, 1870, 3547, 115094, 1953 }, { 63761, 100.0, 363112, 3578, 3350, 116219, 1954 }, { 66019, 101.2, 397469, 2904, 3048, 117388, 1955 }, { 67857, 104.6, 419180, 2822, 2857, 118734, 1956 }, { 68169, 108.4, 442769, 2936, 2798, 120445, 1957 }, { 66513, 110.8, 444546, 4681, 2637, 121950, 1958 }, { 68655, 112.6, 482704, 3813, 2552, 123366, 1959 }, { 69564, 114.2, 502601, 3931, 2514, 125368, 1960 }, { 69331, 115.7, 518173, 4806, 2572, 127852, 1961 }, { 70551, 116.9, 554894, 4007, 2827, 130081, 1962 } }; final int nobs = 16; final int nvars = 6; <START> LinearRegressionSGDTrainer trainer = new LinearRegressionSGDTrainer(100_000, 1e-12); <END> LinearRegressionModel model = trainer.train(new DenseLocalOnHeapMatrix(data)); }</code><technical_language>this OLS Regression SGDTrainer. strange</technical_language>

Target:
private void runLongly() { double[][] data = new double[][] { { 60323, 83.0, 234289, 2356, 1590, 107608, 1947 }, { 61122, 88.5, 259426, 2325, 1456, 108632, 1948 }, { 60171, 88.2, 258054, 3682, 1616, 109773, 1949 }, { 61187, 89.5, 284599, 3351, 1650, 110929, 1950 }, { 63221, 96.2, 328975, 2099, 3099, 112075, 1951 }, { 63639, 98.1, 346999, 1932, 3594, 113270, 1952 }, { 64989, 99.0, 365385, 1870, 3547, 115094, 1953 }, { 63761, 100.0, 363112, 3578, 3350, 116219, 1954 }, { 66019, 101.2, 397469, 2904, 3048, 117388, 1955 }, { 67857, 104.6, 419180, 2822, 2857, 118734, 1956 }, { 68169, 108.4, 442769, 2936, 2798, 120445, 1957 }, { 66513, 110.8, 444546, 4681, 2637, 121950, 1958 }, { 68655, 112.6, 482704, 3813, 2552, 123366, 1959 }, { 69564, 114.2, 502601, 3931, 2514, 125368, 1960 }, { 69331, 115.7, 518173, 4806, 2572, 127852, 1961 }, { 70551, 116.9, 554894, 4007, 2827, 130081, 1962 } }; final int nobs = 16; final int nvars = 6; LinearRegressionQRTrainer trainer = new LinearRegressionQRTrainer(); LinearRegressionModel model = trainer.train(new DenseLocalOnHeapMatrix(data)); }
Source:
<code>public MeasurementsService(MeasurementFetchStrategy fetchStrategy, ExpressionEngine expressionEngine, FilterEngine filterEngine) { <START> Preconditions.checkNotNull(fetchStrategy); <END> Preconditions.checkNotNull(expressionEngine); Preconditions.checkNotNull(filterEngine); this.fetchStrategy = fetchStrategy; this.expressionEngine = expressionEngine; this.filterEngine = filterEngine; }</code><technical_language>checkNotNull returns object, lines rewritten in form of: this.fetchStrategy = Preconditions.checkNotNull(fetchStrategy);</technical_language>

Target:
public MeasurementsService(MeasurementFetchStrategy fetchStrategy, ExpressionEngine expressionEngine, FilterEngine filterEngine) { this.fetchStrategy = Preconditions.checkNotNull(fetchStrategy); this.expressionEngine = Preconditions.checkNotNull(expressionEngine); this.filterEngine = Preconditions.checkNotNull(filterEngine); }
Source:
<code>public void setVds(VDS vds) { _vds = vds; setHost(_vds.getHostName(), _vds.getSSHPort()); <START> setUser(_vds.getSSHUsername()); <END> }</code><technical_language>please move setUser setHost connect (if _vds != null)</technical_language>

Target:
public void setVds(VDS vds) { _vds = vds; if (_vds != null) { setHost(_vds.getHostName(), _vds.getSSHPort()); setUser(_vds.getSSHUsername()); } }
Source:
<code>private void stopRebalance() { if (getSelectedItem() == null) { return; } final ConfirmationModel model = new ConfirmationModel(); <START> final GlusterVolumeEntity volumeEntity = (GlusterVolumeEntity) getSelectedItem(); <END> setConfirmWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().confirmStopVolumeRebalanceTitle()); model.setHashName("volume_rebalance_stop"); model.setMessage(ConstantsManager.getInstance().getMessages().confirmStopVolumeRebalance( volumeEntity.getName())); UICommand okCommand = new UICommand("onStopRebalance", this); okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); okCommand.setIsDefault(true); model.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("CancelConfirmation", this); cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().cancel()); cancelCommand.setIsCancel(true); model.getCommands().add(cancelCommand); }</code><technical_language>need for final</technical_language>

Target:
private void stopRebalance() { if (getSelectedItem() == null) { return; } ConfirmationModel model = new ConfirmationModel(); GlusterVolumeEntity volumeEntity = (GlusterVolumeEntity) getSelectedItem(); setConfirmWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().confirmStopVolumeRebalanceTitle()); model.setHashName("volume_rebalance_stop"); model.setMessage(ConstantsManager.getInstance().getMessages().confirmStopVolumeRebalance( volumeEntity.getName())); UICommand okCommand = new UICommand("onStopRebalance", this); okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); okCommand.setIsDefault(true); model.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("CancelConfirmation", this); cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().cancel()); cancelCommand.setIsCancel(true); model.getCommands().add(cancelCommand); }
Source:
<code>public static PMMLInfo<PMMLModelInfo> from(InputStream is) throws Exception { PMML pmml = org.jpmml.model.PMMLUtil.unmarshal(is); List<PMMLModelInfo> models = new ArrayList<>(); for (Model pm : pmml.getModels()) { <START> MiningSchema miningSchema = pm.getMiningSchema(); <END> Collection<String> inputFields = new ArrayList<>(); miningSchema.getMiningFields() .stream() .filter(mf -> mf.getUsageType() == UsageType.ACTIVE) .forEach(fn -> inputFields.add(fn.getName().getValue())); Collection<String> outputFields = new ArrayList<>(); pm.getOutput().getOutputFields().forEach(of -> outputFields.add(of.getName().getValue())); models.add(new PMMLModelInfo(pm.getModelName(), inputFields, outputFields)); } Map<String, String> headerExtensions = new HashMap<>(); for (Extension ex : pmml.getHeader().getExtensions()) { headerExtensions.put(ex.getName(), ex.getValue()); } PMMLInfo<PMMLModelInfo> info = new PMMLInfo<>(models, new PMMLHeaderInfo("<LINK_0>" + pmml.getBaseVersion().replace(".", "_"), headerExtensions)); return info; }</code><technical_language>This extracted a method "createPMMLModelInfo" similar</technical_language>

Target:
public static PMMLInfo<PMMLModelInfo> from(InputStream is) throws SAXException, JAXBException { PMML pmml = org.jpmml.model.PMMLUtil.unmarshal(is); List<PMMLModelInfo> models = new ArrayList<>(); for (Model pm : pmml.getModels()) { MiningSchema miningSchema = pm.getMiningSchema(); Collection<String> inputFields = new ArrayList<>(); miningSchema.getMiningFields() .stream() .filter(mf -> mf.getUsageType() == UsageType.ACTIVE) .forEach(fn -> inputFields.add(fn.getName().getValue())); Collection<String> outputFields = new ArrayList<>(); pm.getOutput().getOutputFields().forEach(of -> outputFields.add(of.getName().getValue())); models.add(new PMMLModelInfo(pm.getModelName(), inputFields, outputFields)); } Map<String, String> headerExtensions = new HashMap<>(); for (Extension ex : pmml.getHeader().getExtensions()) { headerExtensions.put(ex.getName(), ex.getValue()); } PMMLInfo<PMMLModelInfo> info = new PMMLInfo<>(models, new PMMLHeaderInfo("<LINK_0>" + pmml.getBaseVersion().replace(".", "_"), headerExtensions)); return info; }
Source:
<code>public void read(InputStream input, Schema inputSchema, InputBuilder messageBuilder) throws ReaderException { String inputJSONMessage; try { inputJSONMessage = readFromInputStream(input); messageBuilder.notifyWithResult(inputJSONMessage); <START> } catch (IOException e) { <END> throw new ReaderException("IO Error while reading input stream. " + e.getMessage()); } catch (JSException e) { throw new ReaderException("JSException while reading input stream. " + e.getMessage()); } catch (SchemaException e) { throw new ReaderException("SchemaException while reading input stream. " + e.getMessage()); } }</code><technical_language>catch exceptions in catch clause. need modify message e.getMessage() info</technical_language>

Target:
public void read(InputStream input, Schema inputSchema, InputBuilder messageBuilder) throws ReaderException { String inputJSONMessage; try { inputJSONMessage = readFromInputStream(input); messageBuilder.notifyWithResult(inputJSONMessage); } catch (IOException | JSException | SchemaException e) { throw new ReaderException("Error while reading input stream. " + e.getMessage()); } }
Source:
<code>public void loadMetadata(AlluxioURI path, final ListStatusPOptions options) throws FileDoesNotExistException, IOException, AlluxioException { checkUri(path); rpc(client -> { ListStatusPOptions mergedOptions = FileSystemOptions.listStatusDefaults( <START> mFsContext.getPathConf(path)).toBuilder().mergeFrom(options).build(); <END> client.listStatus(path, mergedOptions); return null; }); }</code><technical_language>set added flag explicitly here</technical_language>

Target:
public void loadMetadata(AlluxioURI path, final ListStatusPOptions options) throws FileDoesNotExistException, IOException, AlluxioException { checkUri(path); rpc(client -> { ListStatusPOptions mergedOptions = FileSystemOptions.listStatusDefaults( mFsContext.getPathConf(path)).toBuilder().mergeFrom(options) .setLoadMetadataType(LoadMetadataPType.ALWAYS).setResultsRequired(false).build(); client.listStatus(path, mergedOptions); return null; }); }
Source:
<code>public void init( final Command callback ) { <START> libraryService.call( new RemoteCallback<OrganizationalUnitRepositoryInfo>() { <END> @Override public void callback( final OrganizationalUnitRepositoryInfo info ) { LibraryToolbarPresenter.this.info = info; view.init( LibraryToolbarPresenter.this ); setupOrganizationUnits( info ); setupRepositories( info ); selectedOrganizationalUnit = info.getSelectedOrganizationalUnit(); selectedRepository = info.getSelectedRepository(); callback.execute(); } } ).getDefaultOrganizationalUnitRepositoryInfo(); libraryPreferences.load( loadedLibraryPreferences -> { view.setOrganizationalUnitLabel( loadedLibraryPreferences.getOuAlias() ); }, parameter -> { } ); }</code><technical_language>Please try consistent of lamdas anonymous classes (it's forgivable refactoring a class - miss some - for a new class preferable stick style other)</technical_language>

Target:
public void init( final Command callback ) { libraryService.call( ( OrganizationalUnitRepositoryInfo info ) -> { LibraryToolbarPresenter.this.info = info; view.init( LibraryToolbarPresenter.this ); setupOrganizationUnits( info ); setupRepositories( info ); selectedOrganizationalUnit = info.getSelectedOrganizationalUnit(); selectedRepository = info.getSelectedRepository(); callback.execute(); } ).getDefaultOrganizationalUnitRepositoryInfo(); libraryPreferences.load( loadedLibraryPreferences -> { view.setOrganizationalUnitLabel( loadedLibraryPreferences.getOuAlias() ); }, parameter -> { } ); }
Source:
<code>public String receive() { Assert.isTrue(isRunning(),"Shell process is not started"); String data; try { byte[] buffer = serializer.deserialize(stdout); <START> data = new String(buffer,"UTF-8"); <END> } catch (IOException e) { throw new RuntimeException(e.getMessage(),e); } return data == null? null : data.trim(); }</code><technical_language>If this approach, encoding a module option</technical_language>

Target:
public String receive() { Assert.isTrue(isRunning(), "Shell process is not started."); String data; try { byte[] buffer = serializer.deserialize(stdout); data = new String(buffer, charset); } catch (IOException e) { throw new RuntimeException(e.getMessage(), e); } return data == null ? null : data.trim(); }
Source:
<code>public void setFontSize(int fontSize) { setFontSize(FontUtils.FontType.general, fontSize); <START> getConfig().setProperty(FONT_SIZE, fontSize); <END> }</code><technical_language>This statement removed (same for name), previous statement ends this</technical_language>

Target:
public void setFontSize(int fontSize) { setFontSize(FontUtils.FontType.general, fontSize); }
Source:
<code>protected synchronized Date getDateFromTimestamp() { if (serverTimestamps != null) { EventTimeSlice myTimeStamp = serverTimestamps.get(serverName); if (myTimeStamp != null) { <START> Date myDate = new Date(myTimeStamp.getTimeSlice()); <END> logger.info("Previous alive timestamp was: {}", myDate); return myDate; } } return new Date(); }</code><technical_language>getTimeSlice is claiming seconds, Date is ms right</technical_language>

Target:
protected synchronized Date getDateFromTimestamp() { if (serverTimestamp != null) { Date myDate = new Date(serverTimestamp.getTimeSlice()); logger.debug("Previous alive timestamp was: {}", myDate); return myDate; } return new Date(); }