auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void update(final Spec spec, final Spec drain) { try { <START> new JdkRequest(UriBuilder.fromUri(this.home).build()) <END> .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .method(Request.GET) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .rel("/page/links/link[@rel='save']/@href") .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .method(Request.POST) .body() .set( String.format( "spec=%s&drain=%s", URLEncoder.encode(spec.asText(), CharEncoding.UTF_8), URLEncoder.encode(drain.asText(), CharEncoding.UTF_8) ) ) .back() .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK); } catch (UnsupportedEncodingException ex) { throw new IllegalStateException(ex); } catch (IOException ex) { throw new IllegalStateException(ex); } }</code><technical_language>this.home work</technical_language>

Target:
public void update(final Spec spec, final Spec drain) { try { new JdkRequest(this.home) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .rel("/page/links/link[@rel='save']/@href") .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .method(Request.POST) .body() .formParam("spec", spec.asText()) .formParam("drain", drain.asText()) .back() .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK); } catch (UnsupportedEncodingException ex) { throw new IllegalStateException(ex); } catch (IOException ex) { throw new IllegalStateException(ex); } }
Source:
<code>public final void read(InputStream inputStream) throws IOException { byte[] tmp = new byte[VERSIONED_IDENTIFIER.length]; <START> int totalRead = 0; <END> while (totalRead != tmp.length) { int read = inputStream.read(tmp, totalRead, tmp.length - totalRead); if (read == -1) { break; } totalRead += read; } if (Arrays.equals(tmp, VERSIONED_IDENTIFIER)) { DataInputView inputView = new DataInputViewStreamWrapper(inputStream); super.read(inputView); read(inputView, true); } else { PushbackInputStream resetStream = new PushbackInputStream(inputStream, totalRead); resetStream.unread(tmp, 0, totalRead); read(new DataInputViewStreamWrapper(resetStream), false); } }</code><technical_language>nit: for extra readability, refactor this reading logic a separate method? call tryReadFully, returns actual number of bytes read</technical_language>

Target:
public final void read(InputStream inputStream) throws IOException { byte[] tmp = new byte[VERSIONED_IDENTIFIER.length]; int totalRead = IOUtils.readFully(inputStream, tmp); if (Arrays.equals(tmp, VERSIONED_IDENTIFIER)) { DataInputView inputView = new DataInputViewStreamWrapper(inputStream); super.read(inputView); read(inputView, true); } else { InputStream streamToRead = inputStream; if (totalRead > 0) { PushbackInputStream resetStream = new PushbackInputStream(inputStream, totalRead); resetStream.unread(tmp, 0, totalRead); streamToRead = resetStream; } read(new DataInputViewStreamWrapper(streamToRead), false); } }
Source:
<code>private void setExportConfiguration() { ConfigurationDialog dialog = ConfigurationDialog.from(exportConfiguration, true, BriefcasePreferences.getStorePasswordsConsentProperty()); <START> dialog.onOK(config -> { <END> exportConfiguration = Optional.ofNullable(config); }); dialog.open(); if (exportConfiguration.isPresent()) { changeDefaultConfigurationButton.setText("Change export configuration"); } }</code><technical_language>contract this dialog.onOK(config -> exportConfiguration = Optional.ofNullable(config));</technical_language>

Target:
private void setExportConfiguration() { ConfigurationDialog dialog = ConfigurationDialog.defaultPanel(exportConfiguration, BriefcasePreferences.getStorePasswordsConsentProperty()); dialog.onOK(config -> exportConfiguration = Optional.ofNullable(config)); dialog.open(); }
Source:
<code>public boolean shouldWait() { if (resultSet == null) { resultSet = new ReadResultSetImpl<O, O>(minSize, maxSize, getNodeEngine().getSerializationService(), filter); sequence = startSequence; } RingbufferContainer ringbuffer = getRingBufferContainer(); if (minSize == 0) { if (!ringbuffer.shouldWait(sequence)) { sequence = ringbuffer.readMany(sequence, resultSet); } return false; } if (resultSet.isMinSizeReached()) { return false; } <START> if (sequence > ringbuffer.tailSequence() + 1 <END> || (sequence < ringbuffer.headSequence() && !ringbuffer.getStore().isEnabled())) { return false; } if (sequence == ringbuffer.tailSequence() + 1) { return true; } sequence = ringbuffer.readMany(sequence, resultSet); return !resultSet.isMinSizeReached(); }</code><technical_language>Nice fix. suggest improvement - add methods: - RingbufferContainer.isStaleSequence(long sequence) - RingbufferContainer.isTooLargeSequence(long sequence) reuse methods in operations in RingbufferContainer#checkBlockableReadSequence. Otherwise, I get confused checking sequence - I check tail head, equal head strictly on</technical_language>

Target:
public boolean shouldWait() { if (resultSet == null) { resultSet = new ReadResultSetImpl<O, O>(minSize, maxSize, getNodeEngine().getSerializationService(), filter); sequence = startSequence; } RingbufferContainer ringbuffer = getRingBufferContainer(); if (minSize == 0) { if (!ringbuffer.shouldWait(sequence)) { sequence = ringbuffer.readMany(sequence, resultSet); } return false; } if (resultSet.isMinSizeReached()) { return false; } if (ringbuffer.isTooLargeSequence(sequence) || ringbuffer.isStaleSequence(sequence)) { return false; } if (sequence == ringbuffer.tailSequence() + 1) { return true; } sequence = ringbuffer.readMany(sequence, resultSet); return !resultSet.isMinSizeReached(); }
Source:
<code>public int getGlyphIndex( char c ) { int[] glyphIndexs = (int[]) getCMap( ).get( (int) c ); <START> if( glyphIndexs == null && c == NBSP ) <END> { glyphIndexs = getCMap( ).get( SPACE ); } return glyphIndexs[0]; }</code><technical_language>if c!=NBSP NPE thrown</technical_language>

Target:
public int getGlyphIndex( char c ) { int[] glyphIndexs = (int[]) getCMap( ).get( (int) c ); if( glyphIndexs == null ) { glyphIndexs = getCMap( ).get( SPACE ); } return glyphIndexs[0]; }
Source:
<code>public void validate() { cluster = loadCluster(); FailoverPriority failoverPriority = cluster.getFailoverPriority(); <START> if (failoverPriority != null && failoverPriority.getType().equals(CONSISTENCY)) { <END> int voterCount = failoverPriority.getVoters(); for (Stripe stripe : cluster.getStripes()) { int nodeCount = stripe.getNodes().size(); int sum = voterCount + nodeCount; if (sum % 2 == 0) { logger.warn(lineSeparator() + "=========================================================================================================" + lineSeparator() + "IMPORTANT: The sum (" + sum + ") of voter count (" + voterCount + ") and number of nodes " + "(" + nodeCount + ") in stripe " + stripe.getName() + lineSeparator() + "is an even number. An even-numbered configuration is more likely to experience split-brain situations." + lineSeparator() + "=========================================================================================================" + lineSeparator()); } } } runtimePeers = cluster.getEndpoints(node); new ClusterValidator(cluster).validate(); if (node != null) { if (areAllNodesActivated(runtimePeers)) { throw new IllegalStateException("Cluster is already activated"); } else { if (isActivated(node)) { throw new IllegalStateException("Node is already activated"); } runtimePeers = Collections.singletonList(getEndpoint(node)); } } }</code><technical_language>failoverPriority is optional need for null check - == instead of equals</technical_language>

Target:
public void validate() { cluster = loadCluster(); FailoverPriority failoverPriority = cluster.getFailoverPriority(); if (failoverPriority.getType() == CONSISTENCY) { int voterCount = failoverPriority.getVoters(); for (Stripe stripe : cluster.getStripes()) { int nodeCount = stripe.getNodes().size(); int sum = voterCount + nodeCount; if (sum % 2 == 0) { logger.warn(lineSeparator() + "=========================================================================================================" + lineSeparator() + "IMPORTANT: The sum (" + sum + ") of voter count (" + voterCount + ") and number of nodes " + "(" + nodeCount + ") in stripe " + stripe.getName() + lineSeparator() + "is an even number. An even-numbered configuration is more likely to experience split-brain situations." + lineSeparator() + "=========================================================================================================" + lineSeparator()); } } } runtimePeers = cluster.getEndpoints(node); new ClusterValidator(cluster).validate(); if (node != null) { if (areAllNodesActivated(runtimePeers)) { throw new IllegalStateException("Cluster is already activated"); } else { if (isActivated(node)) { throw new IllegalStateException("Node is already activated"); } runtimePeers = Collections.singletonList(getEndpoint(node)); } } }
Source:
<code>private void handleOpenPageIntent(Intent intent) { String pagePosition = intent.getStringExtra(ARG_OPEN_PAGE); if (!TextUtils.isEmpty(pagePosition)) { switch (pagePosition) { case ARG_NOTIFICATIONS: mBottomNav.setCurrentPosition(PAGE_NOTIFS); break; case ARG_READER: mBottomNav.setCurrentPosition(PAGE_READER); break; case ARG_ME: mBottomNav.setCurrentPosition(PAGE_ME); if (intent.getBooleanExtra(WPMainActivity.ARG_SHOW_ZENDESK_HINT_SNACKBAR, false)) { Snackbar.make(findViewById(R.id.coordinator), <START> R.string.support_push_notification_message_hint_snackbar, Snackbar.LENGTH_LONG).show(); <END> } break; } } else { AppLog.e(T.MAIN, "WPMainActivity.handleOpenIntent called with an invalid argument."); } }</code><technical_language>I suggest a timeout of 2 x Snackbar.LENGTH_LONG ? is bring gone, users open tickets. (feel free ignore this if current timeout real usage is long enough)</technical_language>

Target:
private void handleOpenPageIntent(Intent intent) { String pagePosition = intent.getStringExtra(ARG_OPEN_PAGE); if (!TextUtils.isEmpty(pagePosition)) { switch (pagePosition) { case ARG_NOTIFICATIONS: mBottomNav.setCurrentPosition(PAGE_NOTIFS); break; case ARG_READER: mBottomNav.setCurrentPosition(PAGE_READER); break; case ARG_ME: mBottomNav.setCurrentPosition(PAGE_ME); if (intent.getBooleanExtra(WPMainActivity.ARG_SHOW_ZENDESK_HINT_SNACKBAR, false)) { Snackbar.make(findViewById(R.id.coordinator), R.string.support_push_notification_message_hint_snackbar, 5000).show(); } break; } } else { AppLog.e(T.MAIN, "WPMainActivity.handleOpenIntent called with an invalid argument."); } }
Source:
<code>public HRavenStatsWriteService() { <START> runningJobs = new HashSet<String>(); <END> completedJobs = new HashSet<String>(); failedJobs = new HashSet<String>(); username = System.getProperty("user.name"); hRavenPool = Executors.newFixedThreadPool(1); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { shutdown(); } }); }</code><technical_language>i guava in ambrose. consider replacing Sets.newHashSet()</technical_language>

Target:
public HRavenStatsWriteService() { this.runningJobs = Sets.newHashSet(); this.completedJobs = Sets.newHashSet(); this.failedJobs = Sets.newHashSet(); this.username = System.getProperty("user.name"); this.hRavenPool = Executors.newFixedThreadPool(1); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { shutdown(); } }); }
Source:
<code>private Path getNextListResult(BlobItem blobItem) { <START> Path withoutRoot = this.path; <END> if (withoutRoot.isAbsolute()) { withoutRoot = this.path.getRoot().relativize(this.path); } String blobName = blobItem.getName(); Path relativeResult = withoutRoot.relativize( this.path.getFileSystem().getPath(blobName)); return this.path.resolve(relativeResult); }</code><technical_language>is a reason do this +next 3 lines in constructor for AzureDirectoryIterator</technical_language>

Target:
private Path getNextListResult(BlobItem blobItem) { String blobName = blobItem.getName(); Path relativeResult = this.withoutRoot.relativize( this.path.getFileSystem().getPath(blobName)); return this.path.resolve(relativeResult); }
Source:
<code>public JmsSessionProvider(Session session, Destination destination) { m_session = assertNotNull(session); m_destination = destination; m_stats = <START> new JmsSubscriptionStats(); <END> }</code><technical_language>extend this Stats-class? If yes, this instance creation extracted a method</technical_language>

Target:
public JmsSessionProvider(Session session, Destination destination) { m_session = assertNotNull(session); m_destination = destination; m_stats = createJmsSubscriptionStats(); }
Source:
<code>@Nullable public static <T> T getCallback(@NonNull Fragment fragment, @NonNull Class<T> callback) { if (callback.isInstance(fragment.getTargetFragment())) { return (T) fragment.getTargetFragment(); } if (callback.isInstance(fragment.getParentFragment())) { return (T) fragment.getParentFragment(); } <START> if (fragment.getParentFragment() != null <END> && callback.isInstance(fragment.getParentFragment().getParentFragment())) { return (T) fragment.getParentFragment().getParentFragment(); } if (callback.isInstance(fragment.getActivity())) { return (T) fragment.getActivity(); } return null; }</code><technical_language>I mixed feelings this. hand, this interfere a conventional callback. other, bad practice start Fragment C Fragment B manipulate Fragment A Activity. I prefer support this callback pattern. Is another fix this</technical_language>

Target:
@Nullable public static <T> T getCallback(@NonNull Fragment fragment, @NonNull Class<T> callback) { if (callback.isInstance(fragment.getTargetFragment())) { return (T) fragment.getTargetFragment(); } if (callback.isInstance(fragment.getParentFragment())) { return (T) fragment.getParentFragment(); } if (callback.isInstance(fragment.getActivity())) { return (T) fragment.getActivity(); } return null; }
Source:
<code>public void testGivePhysicalAddress() throws Exception { if (!HdmiCecUtils.isHdmiCecFeatureSupported(getDevice())) { CLog.v("No HDMI CEC feature running, should skip test."); return; } HdmiCecUtils hdmiCecUtils = new HdmiCecUtils(CecDevice.PLAYBACK_1, "1.0.0.0"); try { hdmiCecUtils.init(); hdmiCecUtils.sendCecMessage(CecMessage.GIVE_PHYSICAL_ADDRESS); String message = hdmiCecUtils.checkExpectedOutput(CecMessage.REPORT_PHYSICAL_ADDRESS); int <START> expectedParams = <END> (HdmiCecConstants.PHYSICAL_ADDRESS << 8) + HdmiCecConstants.PLAYBACK_DEVICE_TYPE; assertEquals(expectedParams, hdmiCecUtils.getParamsFromMessage(message)); } finally { hdmiCecUtils.killCecProcess(); } }</code><technical_language>verify parts separately assertion show logs of failed</technical_language>

Target:
public void testGivePhysicalAddress() throws Exception { final int PHYSICAL_ADDRESS = 0x1000; final int PLAYBACK_DEVICE_TYPE = 0x4; if (!HdmiCecUtils.isHdmiCecFeatureSupported(getDevice())) { CLog.v("No HDMI CEC feature running, should skip test."); return; } HdmiCecUtils hdmiCecUtils = new HdmiCecUtils(CecDevice.PLAYBACK_1, "1.0.0.0"); try { hdmiCecUtils.init(); hdmiCecUtils.sendCecMessage(CecMessage.GIVE_PHYSICAL_ADDRESS); String message = hdmiCecUtils.checkExpectedOutput(CecMessage.REPORT_PHYSICAL_ADDRESS); int receivedParams = hdmiCecUtils.getParamsFromMessage(message); assertEquals(PHYSICAL_ADDRESS, receivedParams >> 8); assertEquals(PLAYBACK_DEVICE_TYPE, receivedParams & 0xFF); } finally { hdmiCecUtils.killCecProcess(); } }
Source:
<code><START> private RuntimeException hardFailOwingToFailureOnLeader(RetryableException ex) { <END> log.error("This connection has failed on a leader when its semantics instruct it not to retry" + " except on a non-leader.", ex); return ex == null ? new IllegalStateException("continueOrPropagate called on null") : ex; }</code><technical_language>static</technical_language>

Target:
private static RuntimeException hardFailOwingToFailureOnLeader(RetryableException ex) { log.error("This connection has failed on a leader when its semantics instruct it not to retry" + " except on a non-leader.", ex); return ex == null ? new IllegalStateException("continueOrPropagate called on null") : ex; }
Source:
<code>public void testOperationTimeRange() throws Exception { assertNotNull(fExperiment); assertNotNull(fTraces); SelectTracesOperation selectTracesOperation = new <START> SelectTracesOperation(fExperiment, fTraces, new <END> HashMap<String, TmfTraceElement>(), fStartTimeRange, fEndTimeRange); PlatformUI.getWorkbench().getProgressService().run(true, true, selectTracesOperation); validateTracesExperiment(true); }</code><technical_language>forgot... i warnings here. Do them? fixed</technical_language>

Target:
public void testOperationTimeRange() throws Exception { assertNotNull(fExperiment); assertNotNull(fTraces); SelectTracesOperation selectTracesOperation = new SelectTracesOperation(NonNullUtils.checkNotNull(fExperiment), fTraces, new HashMap<String, TmfTraceElement>(), fStartTimeRange, fEndTimeRange); PlatformUI.getWorkbench().getProgressService().run(true, true, selectTracesOperation); validateTracesExperiment(true); }
Source:
<code>public PathVariablesGroup(boolean multiSelect, int variableType) { this.multiSelect = multiSelect; this.variableType = variableType; pathVariableManager = ResourcesPlugin.getWorkspace() .getPathVariableManager(); removedVariableNames = new HashSet(); Collator ignoreCaseComparator = Collator.getInstance(); <START> ignoreCaseComparator.setStrength(Collator.TERTIARY); <END> tempPathVariables = new TreeMap(ignoreCaseComparator); initTemporaryState(); }</code><technical_language>Is a reason set strength? of Platform/UI JDT code so</technical_language>

Target:
public PathVariablesGroup(boolean multiSelect, int variableType) { this.multiSelect = multiSelect; this.variableType = variableType; pathVariableManager = ResourcesPlugin.getWorkspace() .getPathVariableManager(); removedVariableNames = new HashSet(); Collator ignoreCaseComparator = Collator.getInstance(); tempPathVariables = new TreeMap(ignoreCaseComparator); initTemporaryState(); }
Source:
<code>private void scanMethodAnnotations( Set<TypeElement> typeHierarchy, ExecutableElement getMethod, Map<Class<? extends Annotation>, Annotation> annotations) { Class<? extends Annotation> exclusiveAnnotation = getExclusiveAnnotation(annotations); for (Class<? extends Annotation> annotationClass : PROPERTY_ANNOTATIONS) { Optional<? extends ResolvedAnnotation<? extends Annotation>> annotation = <START> getMethodAnnotation(annotationClass, getMethod, typeHierarchy); <END> if (annotation.isPresent()) { if (EXCLUSIVE_PROPERTY_ANNOTATIONS.contains(annotationClass)) { if (exclusiveAnnotation == null) { exclusiveAnnotation = annotationClass; } else { reportMultipleAnnotationError( annotation.get().getElement(), exclusiveAnnotation, annotationClass); } } if (!annotations.containsKey(annotationClass)) { annotations.put(annotationClass, annotation.get().getAnnotation()); } } } }</code><technical_language>Nit: avoid static imports for non-obvious cases this</technical_language>

Target:
private void scanMethodAnnotations( Set<TypeElement> typeHierarchy, ExecutableElement getMethod, Map<Class<? extends Annotation>, Annotation> annotations) { Class<? extends Annotation> exclusiveAnnotation = getExclusiveAnnotation(annotations); for (Class<? extends Annotation> annotationClass : PROPERTY_ANNOTATIONS) { Optional<? extends ResolvedAnnotation<? extends Annotation>> annotation = AnnotationScanner.getMethodAnnotation(annotationClass, getMethod, typeHierarchy); if (annotation.isPresent()) { if (EXCLUSIVE_PROPERTY_ANNOTATIONS.contains(annotationClass)) { if (exclusiveAnnotation == null) { exclusiveAnnotation = annotationClass; } else { reportMultipleAnnotationError( annotation.get().getElement(), exclusiveAnnotation, annotationClass); } } if (!annotations.containsKey(annotationClass)) { annotations.put(annotationClass, annotation.get().getAnnotation()); } } } }
Source:
<code>public Map<String, String> parse(Document document) { Map<String, String> map = new HashMap<String, String>(); NodeList servicesNodes = document.getElementsByTagName("service"); for (int i = 0; i < servicesNodes.getLength(); i++) { Element node = (Element) servicesNodes.item(i); <START> if (node.hasAttribute("class") && node.hasAttribute("id") && node.getAttribute("id").startsWith("doctrine.orm") && node.getAttribute("id").endsWith("_entity_manager")) { <END> NodeList calls = document.getElementsByTagName("call"); for (int x = 0; x < calls.getLength(); x++) { Element call = (Element) calls.item(x); if (call.hasAttribute("method") && call.getAttribute("method").equals("setEntityNamespaces")) { NodeList arguments = call.getElementsByTagName("argument"); for (int y = 0; y < arguments.getLength(); y++) { Element arg = (Element) arguments.item(y); if (arg.hasAttribute("key")) { map.put(arg.getAttribute("key"), "\\" + arg.getTextContent()); } } } } } } return map; }</code><technical_language>a xpath query</technical_language>

Target:
public Map<String, String> parse(Document document) { Map<String, String> map = new HashMap<String, String>(); Object result = null; try { XPath xpath = XPathFactory.newInstance().newXPath(); XPathExpression xPathExpr = xpath.compile("/container/services/service[@id[starts-with(.,'doctrine.orm.')]] result = xPathExpr.evaluate(document, XPathConstants.NODESET); } catch (XPathExpressionException e) { return map; } NodeList nodes = (NodeList) result; for (int i = 0; i < nodes.getLength(); i++) { Element node = (Element) nodes.item(i); map.put(node.getAttribute("key"), "\\" + node.getTextContent()); } return map; }
Source:
<code>public void setVpnProxy(@Nullable ProxyInfo proxyInfo) { synchronized (mProxyLock) { if (proxyInfo == null) { mVPNProxy = null; return; } <START> if (!TextUtils.isEmpty(proxyInfo.getHost()) && proxyInfo.getPort() != 0) { <END> mVPNProxy = proxyInfo; } } }</code><technical_language>if is a host, port is 0, simply change previous ? sounds counter-intuitive. Honestly I this simply read synchronized (mProxyLock) { mVPNProxy = proxyInfo; }</technical_language>

Target:
public void setVpnProxy(@Nullable ProxyInfo proxyInfo) { synchronized (mProxyLock) { mVPNProxy = proxyInfo; } }
Source:
<code>public BsmAdminPageEditWindow openNewDialog(String businessServiceName) throws InterruptedException { findElementById("createButton").click(); wait.until(pageContainsText("Business Service Edit")); <START> return new BsmAdminPageEditWindow(businessServiceName).name(businessServiceName); <END> }</code><technical_language>remove BsmAdminPageEditWindow(String) constructor</technical_language>

Target:
public BsmAdminPageEditWindow openNewDialog(String businessServiceName) throws InterruptedException { findElementById("createButton").click(); wait.until(pageContainsText("Business Service Edit")); return new BsmAdminPageEditWindow().name(businessServiceName); }
Source:
<code>public void done() { <START> if(fMissMatched > 0) { <END> Activator.logWarning("Incoherent callstack found on " + fMissMatched + " occations "); } super.done(); }</code><technical_language>formatting</technical_language>

Target:
public void done() { if (fMissMatched > 0) { Activator.getInstance().logWarning(NLS.bind(Messages.CallStackStateProvider_IncoherentCallstack, fMissMatched)); } super.done(); }
Source:
<code>private boolean sample(Span wavefrontSpan) { <START> if (sampler != null && sampler.sample(wavefrontSpan.getName(), <END> UUID.fromString(wavefrontSpan.getTraceId()).getLeastSignificantBits(), wavefrontSpan.getDuration())) { return true; } discardedSpansBySampler.inc(); return false; }</code><technical_language>need check for sampler is null is marked Nullable if sampler null default is true false</technical_language>

Target:
private boolean sample(Span wavefrontSpan) { if (sampler.sample(wavefrontSpan.getName(), UUID.fromString(wavefrontSpan.getTraceId()).getLeastSignificantBits(), wavefrontSpan.getDuration())) { return true; } discardedSpansBySampler.inc(); return false; }
Source:
<code>public void onOrganizerResponse(boolean isOrganizer) { if (isOrganizer) { TaggedEventSeries eventSeries = intent.getParcelableExtra(Const.EXTRA_TAGGED_EVENT); NotificationHandler notificationHandler = new NotificationHandler(this, eventSeries); Notification notification = notificationHandler.createNotification(); NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); nm.notify(NOTIFICATION_ID, notification); <START> PrefUtils.setTaggedEventSeriesNotificationSet(this, eventSeries); <END> } stop(); }</code><technical_language>Definitely. implemented this rapidly. This is a bug. if this is implemented this way, multiple alarms set, right</technical_language>

Target:
public void onOrganizerResponse(boolean isOrganizer) { if (isOrganizer || intent.getBooleanExtra(Const.EXTRA_ALARM_FOR_ALL, true)) { TaggedEventSeries eventSeries = intent.getParcelableExtra(Const.EXTRA_TAGGED_EVENT); NotificationHandler notificationHandler = new NotificationHandler(this, eventSeries); Notification notification = notificationHandler.createNotification(); NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); nm.notify(NOTIFICATION_ID, notification); } stop(); }
Source:
<code>private static @NonNull Intent helper_basicOSHMSOpenIntentWithActionId(final @NonNull String actionId) throws JSONException { return helper_baseHMSOpenIntent() .putExtra( "custom", new JSONObject() {{ put("i", UUID.randomUUID().toString()); put(BUNDLE_KEY_ACTION_ID, actionId); }}.toString() <START> ); <END> }</code><technical_language>OSNotificationFormatHelper.PAYLOAD_OS_NOTIFICATION_ID for "i"? OSNotificationFormatHelper.PAYLOAD_OS_ROOT_CUSTOM for "custom"</technical_language>

Target:
private static @NonNull Intent helper_basicOSHMSOpenIntentWithActionId(final @NonNull String actionId) throws JSONException { return helper_baseHMSOpenIntent() .putExtra( PAYLOAD_OS_ROOT_CUSTOM, new JSONObject() {{ put(PAYLOAD_OS_NOTIFICATION_ID, UUID.randomUUID().toString()); put(BUNDLE_KEY_ACTION_ID, actionId); }}.toString() ); }
Source:
<code><START> public String getVersion() { return bundle != null ? bundle.getVersion().toString() : ""; } <END></code><technical_language>"" is correct alternative? null</technical_language>

Target:
public String getVersion() { return bundle.getVersion().toString(); }
Source:
<code>protected void refreshUiReal() { updateConversationList(); if (conversationList.size() > 0) { if (!this.mConversationFragment.isAdded()) { Log.d(Config.LOGTAG,"fragment NOT added to activity. detached="+Boolean.toString(mConversationFragment.isDetached())); } if (getSelectedConversation() == null) { reInitLatestConversation(); } else { ConversationActivity.this.mConversationFragment.updateMessages(); updateActionBarTitle(); invalidateOptionsMenu(); } } else { if (!isStopping() && mRedirected.compareAndSet(false, true)) { redirectToStartConversationActivity(); } Log.d(Config.LOGTAG,"not updating conversations fragment because conversations list size was 0"); } mConversationFragment.checkRttButtonStatus(); <START> if (!xmppConnectionService.useRealTimeText()) { <END> mConversationFragment.rttStatusButton.setVisibility(View.GONE); } else { mConversationFragment.rttStatusButton.setVisibility(View.VISIBLE); } }</code><technical_language>move hide/show code onStart(). is called frequently. flickering changed. refreshUiReal() is called a delay. In onStart() longer access xmppConnectionService access getPreferences() directly</technical_language>

Target:
protected void refreshUiReal() { updateConversationList(); if (conversationList.size() > 0) { if (!this.mConversationFragment.isAdded()) { Log.d(Config.LOGTAG,"fragment NOT added to activity. detached="+Boolean.toString(mConversationFragment.isDetached())); } if (getSelectedConversation() == null) { reInitLatestConversation(); } else { ConversationActivity.this.mConversationFragment.updateMessages(); updateActionBarTitle(); invalidateOptionsMenu(); } } else { if (!isStopping() && mRedirected.compareAndSet(false, true)) { redirectToStartConversationActivity(); } Log.d(Config.LOGTAG,"not updating conversations fragment because conversations list size was 0"); } mConversationFragment.checkRttButtonStatus(); }
Source:
<code><START> public byte getValueIfPresent(PointerType key, PointerByReference value) { <END> return INSTANCE.CFDictionaryGetValueIfPresent(this, key, value); }</code><technical_language>sense convert return of CFDictionaryGetValueIfPresent a boolean</technical_language>

Target:
public boolean getValueIfPresent(PointerType key, PointerByReference value) { return INSTANCE.CFDictionaryGetValueIfPresent(this, key, value) > 0; }
Source:
<code>public void setUp() throws Exception { <START> folderWithoutWritePermission = tempDir.newFolder("folder-without-write-permission"); <END> folderWithoutWritePermission.setWritable(false); folderWithWritePermission = tempDir.newFolder("folder-with-write-permission"); loggerContext = new LoggerContext(); factory = new LoggingFactory(loggerContext); }</code><technical_language>need folders in test. I more call tempDir.newFolder in test expose folderWithoutWritePermission folderWithWritePermission fields</technical_language>

Target:
public void setUp() throws Exception { output = new ByteArrayOutputStream(); factory = new LoggingFactory(new LoggerContext(), new PrintStream(output)); }
Source:
<code>public Object moveToNextValue(Object currentValue) { <START> BigInteger oneBigInteger = new BigInteger("1"); <END> if (currentValue == null) { return oneBigInteger; } else { return ((BigInteger) currentValue).add(oneBigInteger); } }</code><technical_language>BigInteger.ONE instead</technical_language>

Target:
public Object moveToNextValue(Object currentValue) { BigInteger oneBigInteger = BigInteger.ONE; if (currentValue == null) { return oneBigInteger; } else { return ((BigInteger) currentValue).add(oneBigInteger); } }
Source:
<code>public void testRewrite() { tester().assertThat(new TransformCorrelatedSingleRowSubqueryToProject()) .on(p -> p.lateral( ImmutableList.of(p.symbol("nationkey"), p.symbol("nationkey")), p.tableScan(ImmutableList.of(p.symbol("nationkey")), ImmutableMap.of(p.symbol("nationkey"), new TpchColumnHandle("tpch:nationkey", BIGINT))), p.project( <START> Assignments.of(p.symbol("nationkey"), expression("nationkey")), <END> p.values( ImmutableList.of(), ImmutableList.of( ImmutableList.of()))))) .matches(project( ImmutableMap.of(), any())); }</code><technical_language>this is identity projection, more complicated a +1</technical_language>

Target:
public void testRewrite() { tester().assertThat(new TransformCorrelatedSingleRowSubqueryToProject()) .on(p -> p.lateral( ImmutableList.of(p.symbol("l_nationkey")), p.tableScan(new TableHandle( new ConnectorId("local"), new TpchTableHandle("local", "nation", TINY_SCALE_FACTOR)), ImmutableList.of(p.symbol("l_nationkey")), ImmutableMap.of(p.symbol("l_nationkey"), new TpchColumnHandle("nationkey", BIGINT))), p.project( Assignments.of(p.symbol("l_expr2"), expression("l_nationkey + 1")), p.values( ImmutableList.of(), ImmutableList.of( ImmutableList.of()))))) .matches(project( ImmutableMap.of( ("l_expr2"), PlanMatchPattern.expression("l_nationkey + 1"), "l_nationkey", PlanMatchPattern.expression("l_nationkey")), tableScan("nation", ImmutableMap.of("l_nationkey", "nationkey")))); }
Source:
<code>public static void refreshValidProjects(IProject[] projects, boolean delete, IProgressMonitor monitor) throws CoreException { SubMonitor subMonitor = SubMonitor.convert(monitor, CoreText.ProjectUtil_refreshingProjects, projects.length); for (IProject p : projects) { if (subMonitor.isCanceled()) break; IPath projectLocation = p.getLocation(); if (projectLocation == null) continue; String projectFilePath = projectLocation .append(IProjectDescription.DESCRIPTION_FILE_NAME) .toOSString(); File projectFile = new File(projectFilePath); if (projectFile.exists()) p.refreshLocal(IResource.DEPTH_INFINITE, subMonitor.newChild(1)); else if (delete) p.delete(false, true, subMonitor.newChild(1)); <START> else closeMissingProject(p, projectFile, monitor); subMonitor.worked(1); <END> } }</code><technical_language>This logic wrong. (Yes, change.) this else { closeMissingProject(p, projectFile, subMonitor.newChild(1)); }</technical_language>

Target:
public static void refreshValidProjects(IProject[] projects, boolean delete, IProgressMonitor monitor) throws CoreException { SubMonitor subMonitor = SubMonitor.convert(monitor, CoreText.ProjectUtil_refreshingProjects, projects.length); for (IProject p : projects) { if (subMonitor.isCanceled()) break; IPath projectLocation = p.getLocation(); if (projectLocation == null) continue; String projectFilePath = projectLocation .append(IProjectDescription.DESCRIPTION_FILE_NAME) .toOSString(); File projectFile = new File(projectFilePath); if (projectFile.exists()) p.refreshLocal(IResource.DEPTH_INFINITE, subMonitor.newChild(1)); else if (delete) p.delete(false, true, subMonitor.newChild(1)); else closeMissingProject(p, projectFile, subMonitor.newChild(1)); } }
Source:
<code>public void onListItemClick(ListView l, View v, int position, long id) { Map.Entry<String, PulseEntry> pulse = mAdapter.getItem(position); if (mTarget.equals(GLOBAL)) { mListener.openPulse(pulse.getKey()); } else { <START> if (v.isEnabled()) { <END> Intent chapterIntent = new Intent(getActivity(), MainActivity.class); chapterIntent.putExtra(Const.EXTRA_CHAPTER_ID, pulse.getValue().getId()); startActivity(chapterIntent); } else { View rootView = getListView().getRootView(); Snackbar.make(rootView, R.string.no_pulse, Snackbar.LENGTH_SHORT) .show(); } } }</code><technical_language>disabling click? is grayed out. I simpler way. need translation for new string</technical_language>

Target:
public void onListItemClick(ListView l, View v, int position, long id) { Map.Entry<String, PulseEntry> pulse = mAdapter.getItem(position); if (isGlobalSelected()) { mListener.openPulse(pulse.getKey()); } else { if (v.isEnabled()) { Intent chapterIntent = new Intent(getActivity(), MainActivity.class); chapterIntent.putExtra(Const.EXTRA_CHAPTER_ID, pulse.getValue().getId()); startActivity(chapterIntent); } } }
Source:
<code>public Slice serialize() { SliceOutput sliceBuilder = new DynamicSliceOutput(toIntExact(estimatedSerializedSizeInBytes())); <START> sliceBuilder.writeByte(0); END> sliceBuilder.writeByte(0); sliceBuilder.writeDouble(min); sliceBuilder.writeDouble(max); sliceBuilder.writeDouble(publicCompression); sliceBuilder.writeDouble(totalWeight); sliceBuilder.writeInt(activeCentroids); sliceBuilder.writeBytes(wrappedDoubleArray(weight), 0, activeCentroids * SIZE_OF_DOUBLE); sliceBuilder.writeBytes(wrappedDoubleArray(mean), 0, activeCentroids * SIZE_OF_DOUBLE); return sliceBuilder.slice(); }</code><technical_language>nit: "1", "+1", "+8"..</technical_language>

Target:
public Slice serialize() { SliceOutput sliceOutput = new DynamicSliceOutput(toIntExact(estimatedSerializedSizeInBytes())); sliceOutput.writeByte(0); sliceOutput.writeByte(0); sliceOutput.writeDouble(min); sliceOutput.writeDouble(max); sliceOutput.writeDouble(publicCompression); sliceOutput.writeDouble(totalWeight); sliceOutput.writeInt(activeCentroids); sliceOutput.writeBytes(wrappedDoubleArray(weight), 0, activeCentroids * SIZE_OF_DOUBLE); sliceOutput.writeBytes(wrappedDoubleArray(mean), 0, activeCentroids * SIZE_OF_DOUBLE); return sliceOutput.slice(); }
Source:
<code>public Property getSourceEndAssociation(Association association, DDiagramElement view) { final DEdge edge = (DEdge)view; <START> final String sourceObject = edge.getSourceNode().toString(); <END> final List<Property> members = association.getMemberEnds(); for (final Property member : members) { final String typeName = member.getType().getName(); if (sourceObject.contains(typeName)) { return member; } } return null; }</code><technical_language>Instead of toString EObject compare for example : private Property getSourceEndNaryAssociation(Association association, DDiagramElement view){ final DEdge edge = (DEdge)view; final List<Property> members = association.getMemberEnds(); final DNodeListSpec source = (DNodeListSpec)edge.getSourceNode(); final List<EObject> sourceSemanticElements = source.getSemanticElements(); for (final EObject sourceEObject : sourceSemanticElements) { for (final Property member : members) { if (sourceEObject.equals(member.getType())) { return member; } } } return null; }</technical_language>

Target:
public Property getSourceEndAssociation(Association association, DDiagramElement view) { final DEdge edge = (DEdge)view; final List<Property> members = association.getMemberEnds(); final DNodeListSpec source = (DNodeListSpec)edge.getSourceNode(); final List<EObject> sourceSemanticElements = source.getSemanticElements(); for (final EObject sourceEObject : sourceSemanticElements) { for (final Property member : members) { if (sourceEObject.equals(member.getType())) { return member; } } } return null; }
Source:
<code><START> protected HeaderBag getDefaultHeaders() { <END> String subnetName = "subnet-" + properties.getProperty("graviton.workerId"); String authHeaderName = properties.getProperty("graviton.authentication.header.name"); return new HeaderBag.Builder() .set("Content-Type", "application/json") .set("Accept", "application/json") .set(authHeaderName, subnetName) .build(); }</code><technical_language>missing @Override annotation</technical_language>

Target:
protected HeaderBag getDefaultHeaders() { String authHeaderValue = properties.getProperty("graviton.authentication.prefix.username") .concat(properties.getProperty("graviton.workerId")); String authHeaderName = properties.getProperty("graviton.authentication.header.name"); return new HeaderBag.Builder() .set("Content-Type", "application/json") .set("Accept", "application/json") .set(authHeaderName, authHeaderValue) .build(); }
Source:
<code>public String getDisplayName() { <START> return "GitHub Configuration"; <END> }</code><technical_language>maintain production installations plugins extremely critical plugin contributes configuration :-1:</technical_language>

Target:
public String getDisplayName() { return "GitHub"; }
Source:
<code>public void writeSelf(File file, long pos) { fLock.readLock().lock(); try (FileOutputStream fos = new FileOutputStream(file, true); FileChannel fc = fos.getChannel();) { fc.position(pos); try (ObjectOutputStream oos = new ObjectOutputStream(fos)) { oos.writeInt(ATTRIB_TREE_MAGIC_NUMBER); List<String[]> list = new ArrayList<>(fAttributeList.size()); String[] prevFullAttribute = null; for (Attribute entry : fAttributeList) { String[] curFullAttribute = entry.getFullAttribute(); String[] curEncodedAttribute = encodeFullAttribute(prevFullAttribute, entry.getFullAttribute()); list.add(curEncodedAttribute); prevFullAttribute = curFullAttribute; } oos.writeObject(list); } } catch (IOException e) { <START> Activator.getDefault().logInfo("Error writing the file "+file+" due to "+e.getMessage()); END> } finally { fLock.readLock().unlock(); } }</code><technical_language>logError(String, Throwable)</technical_language>

Target:
public void writeSelf(File file, long pos) { fLock.readLock().lock(); try (FileOutputStream fos = new FileOutputStream(file, true); FileChannel fc = fos.getChannel();) { fc.position(pos); try (ObjectOutputStream oos = new ObjectOutputStream(fos)) { oos.writeInt(ATTRIB_TREE_MAGIC_NUMBER); List<String[]> list = new ArrayList<>(fAttributeList.size()); String[] prevFullAttribute = null; for (Attribute entry : fAttributeList) { String[] curFullAttribute = entry.getFullAttribute(); String[] curEncodedAttribute = encodeFullAttribute(prevFullAttribute, entry.getFullAttribute()); list.add(curEncodedAttribute); prevFullAttribute = curFullAttribute; } oos.writeObject(list); } } catch (IOException e) { Activator.getDefault().logError("Error writing the file "+file+" due to ", e); } finally { fLock.readLock().unlock(); } }
Source:
<code>public int compareTo( @NotNull(message = "other can't be NULL") final RepoCommit other ) { <START> return this.sha().compareTo(other.sha()); <END> }</code><technical_language>Repo account comparison</technical_language>

Target:
public int compareTo( @NotNull(message = "other can't be NULL") final RepoCommit other ) { return new CompareToBuilder().append( this.repo().coordinates(), other.repo().coordinates() ).append(this.sha(), other.sha()).build(); }
Source:
<code>public Method getOnBinaryMessageMethod(Object webSocketEndpoint) { Method[] methods = webSocketEndpoint.getClass().getMethods(); <START> for (Method method : methods) { <END> if (method.isAnnotationPresent(OnMessage.class)) { Class<?>[] paraTypes = method.getParameterTypes(); List<Class<?>> paraList = Arrays.asList(paraTypes); if (paraList.contains(byte[].class) || paraList.contains(ByteBuffer.class)) { return method; } } } return null; }</code><technical_language>above, for loop throw a NPE if methods variable null</technical_language>

Target:
public Method getOnBinaryMessageMethod(Object webSocketEndpoint) { Method[] methods = webSocketEndpoint.getClass().getMethods(); if (methods == null) { return null; } for (Method method : methods) { if (method.isAnnotationPresent(OnMessage.class)) { Class<?>[] paraTypes = method.getParameterTypes(); List<Class<?>> paraList = Arrays.asList(paraTypes); if (paraList.contains(byte[].class) || paraList.contains(ByteBuffer.class)) { return method; } } } return null; }
Source:
<code>public void openedApp() { <START> trackEvent(openedApp, null, null); <END> }</code><technical_language>implement a trackEvent(event)that calls trackEvent(event, null, null) instead</technical_language>

Target:
public void openedApp() { trackEvent(OPENED); }
Source:
<code>protected void doWork(IProgressMonitor monitor) throws OseeCoreException { if (teamDefs.isEmpty() && ais.isEmpty()) { throw new OseeArgumentException("ERROR", "Must provide Team Definitions or Actionable Items"); } List<String> guids = new ArrayList<String>(); addAllTeamDefGuids(teamDefs, includeChildrenTeamDefs, guids); addAllAisGuids(ais, includeChildrenAis, guids); for (Artifact teamOrAiArt : ArtifactQuery.getArtifactListFromIds(guids, AtsUtilCore.getAtsBranch())) { <START> for (Artifact workPkgArt : teamOrAiArt.getRelatedArtifacts(AtsRelationTypes.WorkPackage_WorkPackage)) { <END> boolean active = workPkgArt.getSoleAttributeValue(AtsAttributeTypes.Active, true); if (activeWorkPkgs == Active.Both || ((active && activeWorkPkgs == Active.Active) || (!active && activeWorkPkgs == Active.InActive))) { results.add(workPkgArt); } } } }</code><technical_language>Suggest adding in a checkForCancelledStatus</technical_language>

Target:
protected void doWork(IProgressMonitor monitor) throws OseeCoreException { if (teamDefs.isEmpty() && ais.isEmpty()) { throw new OseeArgumentException("ERROR", "Must provide Team Definitions or Actionable Items"); } checkForCancelledStatus(monitor); List<String> guids = new ArrayList<String>(); addAllTeamDefGuids(monitor, teamDefs, includeChildrenTeamDefs, guids); addAllAisGuids(monitor, ais, includeChildrenAis, guids); for (Artifact teamOrAiArt : ArtifactQuery.getArtifactListFromIds(guids, AtsUtilCore.getAtsBranch())) { for (Artifact workPkgArt : teamOrAiArt.getRelatedArtifacts(AtsRelationTypes.WorkPackage_WorkPackage)) { boolean active = workPkgArt.getSoleAttributeValue(AtsAttributeTypes.Active, true); if (activeWorkPkgs == Active.Both || ((active && activeWorkPkgs == Active.Active) || (!active && activeWorkPkgs == Active.InActive))) { results.add(workPkgArt); } checkForCancelledStatus(monitor); } checkForCancelledStatus(monitor); } }
Source:
<code>public String toString() { return ToStringBuilder.forInstance(this) <START> .append("Private SPM Id", privateSpmId) .append("Private SPM Version", privateSpmLVER) .append("SPM Status", privateSpmStatus) <END> .build(); }</code><technical_language>need Private, adds nothing. Actually, while it, remove "private" prefix data members (in a separate patch)</technical_language>

Target:
public String toString() { return ToStringBuilder.forInstance(this) .append("SPM Id", spmId) .append("SPM LVER", spmLVER) .append("SPM Status", spmStatus) .build(); }
Source:
<code>public static WasbUnderFileSystem createInstance(AlluxioURI uri, UnderFileSystemConfiguration conf) { <START> Configuration wasbConf = createConfiguration(conf, uri.getScheme().startsWith("wasb://")); <END> return new WasbUnderFileSystem(uri, conf, wasbConf); }</code><technical_language>this startsWith("wasbs://")? Instead, 2 other constants, SCHEME_SECURE="wasbs://", SCHEME_INSECURE="wasb://"</technical_language>

Target:
public static WasbUnderFileSystem createInstance(AlluxioURI uri, UnderFileSystemConfiguration conf) { Configuration wasbConf = createConfiguration(conf, uri.getScheme().startsWith(SCHEME_SECURE)); return new WasbUnderFileSystem(uri, conf, wasbConf); }
Source:
<code>public List<Project> getAllProjects(User user) { List<Project> projects = new ArrayList<Project>(); projects.addAll(projectDao.getAll(user)); List<String> projectIds = projectAdminDao.findProjectIdsByAdmin(user.getUserId()); for (String projectId : projectIds) { try { Project project = getProject(projectId); <START> projects.add(project); <END> } catch (CloudFlowNotFoundException cfe) { } } return projects; }</code><technical_language>Is project is added list twice</technical_language>

Target:
public List<Project> getAllProjects(User user) { List<Project> projects = new ArrayList<Project>(); projects.addAll(projectDao.getAll(user)); List<String> projectIds = projectAdminDao.findProjectIdsByAdmin(user.getUserId()); for (String projectId : projectIds) { try { Project project = getProject(projectId); if (!projects.contains(project)) { projects.add(project); } } catch (CloudFlowNotFoundException cfe) { } } return projects; }
Source:
<code><START> public String toString() <END> { return "JoinOperatorInfo{" + "joinType=" + joinType + ", logHistogramProbes=" + Arrays.toString(logHistogramProbes) + ", logHistogramOutput=" + Arrays.toString(logHistogramOutput) + '}'; }</code><technical_language>modify autogenerated method toStringHelper</technical_language>

Target:
public String toString() { return toStringHelper(this) .add("joinType", joinType) .add("logHistogramProbes", logHistogramProbes) .add("logHistogramOutput", logHistogramOutput) .toString(); }
Source:
<code>@Test public void testSingleParam() { DeepLinkEntry entry = deepLinkEntry("airbnb://foo/{bar}"); <START> final Optional<DeepLinkMatch> matches = entry.matches("airbnb://foo/myData"); <END> assertThat(matches.isPresent()).isTrue(); assertThat(matches.get().getEntry()).isEqualTo(entry); final Map<String, String> parameters = matches.get().getParameters(); assertThat(parameters.get("bar")).isEqualTo("myData"); }</code><technical_language>nit: need local variables final, remove reduce clutter</technical_language>

Target:
@Test public void testSingleParam() { DeepLinkEntry entry = deepLinkEntry("airbnb://foo/{bar}"); Optional<DeepLinkMatch> matches = entry.matches("airbnb://foo/myData"); assertThat(matches.isPresent()).isTrue(); assertThat(matches.get().getEntry()).isEqualTo(entry); Map<String, String> parameters = matches.get().getParameters(); assertThat(parameters.get("bar")).isEqualTo("myData"); }
Source:
<code>public void run() { CoreSession session = ctx.getCoreSession(); Object input = ctx.getInput(); RetentionEventContext evctx = new RetentionEventContext(session.getPrincipal()); if (input != null) { if (input instanceof String) { evctx.setInput((String) input); } <START> <END> } Event event = evctx.newEvent(name); service.fireEvent(event); if (audit) { AuditLogger logger = Framework.getService(AuditLogger.class); LogEntry entry = logger.newLogEntry(); entry.setEventId(name); entry.setEventDate(new Date()); entry.setCategory(RetentionConstants.EVENT_CATEGORY); entry.setPrincipalName(session.getPrincipal().getName()); entry.setComment(evctx.getInput()); logger.addLogEntries(Collections.singletonList(entry)); } }</code><technical_language>extra space ;)</technical_language>

Target:
public void run() { CoreSession session = ctx.getCoreSession(); Object input = ctx.getInput(); RetentionEventContext evctx = new RetentionEventContext(session.getPrincipal()); if (input instanceof String) { evctx.setInput((String) input); } Event event = evctx.newEvent(name); service.fireEvent(event); if (audit) { AuditLogger logger = Framework.getService(AuditLogger.class); LogEntry entry = logger.newLogEntry(); entry.setEventId(name); entry.setEventDate(new Date()); entry.setCategory(RetentionConstants.EVENT_CATEGORY); entry.setPrincipalName(session.getPrincipal().getName()); entry.setComment(evctx.getInput()); logger.addLogEntries(Collections.singletonList(entry)); } }