auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Object getEntity(EntityView view, Map<String, Object> params) { String siteId = view.getPathSegment(2); if (siteId == null || "".equals(siteId)) { throw new IllegalArgumentException("No siteId in provided reference"); } Site site; try { <START> site = siteService.getSite(siteId); <END> } catch (IdUnusedException e) { throw new IllegalArgumentException("Cannot find site by siteId: " + siteId, e); } String fileLocation = site.getInfoUrl(); String description = site.getDescription(); EntityOverview eo = new EntityOverview(); if (fileLocation == null) { if (description != null) { eo.setData(site.getDescription()); } else { eo.setData(site.getTitle()); } } else { ContentResource resource = null; String resourceLocation = fileLocation.replaceAll("/access/content", ""); try { resource = contentService.getResource(resourceLocation); if ("text/html".equals(resource.getContentType())) { eo.setData(new String(resource.getContent())); } } catch (PermissionException pe) { log.warn("Permission exception: " + pe); } catch (IdUnusedException ie) { log.warn("ID unused exception: " + ie); } catch (TypeException te) { log.warn("Type exception: " + te); } catch (ServerOverloadException se) { log.warn("Server overload exception: " + se); } } return eo; }</code><technical_language>This wants a getSiteVisit(String) call checks permissions. Technically if in public list of sites returning ok return description ability visit site for purposes of migration need worry that</technical_language>

Target:
public Object getEntity(EntityView view, Map<String, Object> params) throws PermissionException { String siteId = view.getPathSegment(2); if (siteId == null || "".equals(siteId)) { throw new IllegalArgumentException("No siteId in provided reference"); } Site site; try { site = siteService.getSiteVisit(siteId); } catch (IdUnusedException e) { throw new IllegalArgumentException("Cannot find site by siteId: " + siteId, e); } catch (PermissionException pe) { throw new SecurityException(pe); } String fileLocation = site.getInfoUrl(); String description = site.getDescription(); EntityOverview eo = new EntityOverview(); if (fileLocation == null) { if (description != null) { eo.setData(site.getDescription()); } else { eo.setData(site.getTitle()); } } else { ContentResource resource = null; String resourceLocation = fileLocation.replaceAll("/access/content", ""); try { resource = contentService.getResource(resourceLocation); if ("text/html".equals(resource.getContentType())) { eo.setData(new String(resource.getContent())); } } catch (PermissionException pe) { log.warn("Permission exception: " + pe); } catch (IdUnusedException ie) { log.warn("ID unused exception: " + ie); } catch (TypeException te) { log.warn("Type exception: " + te); } catch (ServerOverloadException se) { log.warn("Server overload exception: " + se); } } return eo; }
Source:
<code>public static List<List<TurboIssueEvent>> groupLabelUpdateEvents( List<TurboIssueEvent> labelUpdateEvents) { assert labelUpdateEvents != null : "Error: Received null list of events"; List<TurboIssueEvent> events = new ArrayList<>(labelUpdateEvents); List<List<TurboIssueEvent>> result = new ArrayList<>(); List<TurboIssueEvent> currentSubList = new ArrayList<>(); Collections.sort(events, (e1, e2) -> { return e1.getDate().compareTo(e2.getDate()); }); Collections.sort(events, (e1, e2) -> { return e1.getActor().getLogin().compareTo(e2.getActor().getLogin()); <START> }); <END> for (TurboIssueEvent e : events) { if (currentSubList.isEmpty() || e.isInSameLabelUpdateEventGroup(currentSubList.get(0))) { currentSubList.add(e); } else { result.add(currentSubList); currentSubList = new ArrayList<>(); currentSubList.add(e); } } if (!currentSubList.isEmpty()) { result.add(currentSubList); } Collections.sort(result, (l1, l2) -> { return l1.get(0).getDate().compareTo(l2.get(0).getDate()); }); return result; }</code><technical_language>collapse: java // Sort time Collections.sort(events, (e1, e2) -> e1.getDate().compareTo(e2.getDate())); // Sort author Collections.sort(events, (e1, e2) -> e1.getActor().getLogin().compareTo(e2.getActor().getLogin()));</technical_language>

Target:
public static List<List<TurboIssueEvent>> groupLabelUpdateEvents( List<TurboIssueEvent> labelUpdateEvents) { assert labelUpdateEvents != null : "Error: Received null list of events"; List<TurboIssueEvent> events = new ArrayList<>(labelUpdateEvents); List<List<TurboIssueEvent>> result = new ArrayList<>(); List<TurboIssueEvent> currentSubList = new ArrayList<>(); Collections.sort(events, (e1, e2) -> e1.getDate().compareTo(e2.getDate())); Collections.sort(events, (e1, e2) -> e1.getActor().getLogin().compareTo(e2.getActor().getLogin())); for (TurboIssueEvent e : events) { if (currentSubList.isEmpty() || e.isInSameLabelUpdateEventGroup(currentSubList.get(0))) { currentSubList.add(e); } else { result.add(currentSubList); currentSubList = new ArrayList<>(); currentSubList.add(e); } } if (!currentSubList.isEmpty()) { result.add(currentSubList); } Collections.sort(result, (l1, l2) -> l1.get(0).getDate().compareTo(l2.get(0).getDate())); return result; }
Source:
<code>public void process(final K key, final V value) { if (key == null) { LOG.warn( "Skipping record due to null key. topic=[{}] partition=[{}] offset=[{}]", context().topic(), context().partition(), context().offset() ); droppedRecordsSensor.record(); return; } if (queryableName != null) { final MeteredTimestampedKeyValueStore<K, V>.RawAndDeserializedValue<V> tuple = store.getWithBinary(key); final ValueAndTimestamp<V> oldValueAndTimestamp = tuple.value; final V oldValue; if (oldValueAndTimestamp != null) { oldValue = oldValueAndTimestamp.value(); if (context().timestamp() < oldValueAndTimestamp.timestamp()) { LOG.warn("Detected out-of-order KTable update for at offset {}, partition {}.", store.name(), context().offset(), context().partition()); } } else { oldValue = null; } <START> final boolean isDifferentValue = store.putIfDifferentValues(key, ValueAndTimestamp.make(value, context().timestamp()), tuple.serializedValue); <END> if (isDifferentValue) { tupleForwarder.maybeForward(key, value, oldValue); } else { skippedIdempotentUpdatesSensor.record(); } } else { context().forward(key, new Change<>(value, null)); } }</code><technical_language>Q: If record is out-of-order, put state store of is not? I this more correct is idempotent update new out-of-order value. This is of rare cases correct order. WDYT</technical_language>

Target:
public void process(final K key, final V value) { if (key == null) { LOG.warn( "Skipping record due to null key. topic=[{}] partition=[{}] offset=[{}]", context().topic(), context().partition(), context().offset() ); droppedRecordsSensor.record(); return; } if (queryableName != null) { final RawAndDeserializedValue<V> tuple = store.getWithBinary(key); final ValueAndTimestamp<V> oldValueAndTimestamp = tuple.value; final V oldValue; if (oldValueAndTimestamp != null) { oldValue = oldValueAndTimestamp.value(); if (context().timestamp() < oldValueAndTimestamp.timestamp()) { LOG.warn("Detected out-of-order KTable update for at offset {}, partition {}.", store.name(), context().offset(), context().partition()); } } else { oldValue = null; } final ValueAndTimestamp<V> newValueAndTimestamp = ValueAndTimestamp.make(value, context().timestamp()); final boolean isDifferentValue = store.putIfDifferentValues(key, newValueAndTimestamp, tuple.serializedValue); if (isDifferentValue) { tupleForwarder.maybeForward(key, value, oldValue); } else { skippedIdempotentUpdatesSensor.record(); } } else { context().forward(key, new Change<>(value, null)); } }
Source:
<code>protected BoundType(AnnotatedTypeMirror type) { if (type.getKind() == TypeKind.WILDCARD) { AnnotatedWildcardType wildcardType = (AnnotatedWildcardType) type; this.lower = wildcardType.getSuperBound(); this.upper = wildcardType.getExtendsBound(); } else if (TypesUtils.isCaptured(type.getUnderlyingType())) { AnnotatedTypeVariable typeVariable = (AnnotatedTypeVariable) type; this.lower = typeVariable.getLowerBound(); this.upper = typeVariable.getUpperBound(); } else { throw new BugInCF("Unexpected: %s", type); } <START> this.hasSuperBound = lower.getKind() != TypeKind.NULL; <END> }</code><technical_language>is this field needed? clients of lower? I expect methods do right passed a null type (that is, a type kind TypeKind.NULL)</technical_language>

Target:
protected BoundType(AnnotatedTypeMirror type) { if (type.getKind() == TypeKind.WILDCARD) { AnnotatedWildcardType wildcardType = (AnnotatedWildcardType) type; this.lower = wildcardType.getSuperBound(); this.upper = wildcardType.getExtendsBound(); } else if (TypesUtils.isCaptured(type.getUnderlyingType())) { AnnotatedTypeVariable typeVariable = (AnnotatedTypeVariable) type; this.lower = typeVariable.getLowerBound(); this.upper = typeVariable.getUpperBound(); } else { throw new BugInCF("Unexpected: %s", type); } this.hasExplicitLowerBound = lower.getKind() != TypeKind.NULL; }
Source:
<code>public double withReadLock() { return rwLock.withReadLock(() -> { <START> return Math.random(); <END> }); }</code><technical_language>static import</technical_language>

Target:
public double withReadLock() { return rwLock.withReadLock(() -> { return random(); }); }
Source:
<code>public void testNormal() { byte[] lastStringArray = "client".getBytes(); byte[] lastArray = new byte[lastStringArray.length + 32]; <START> arraycopy(lastStringArray, 0, lastArray, 0, lastStringArray.length); <END> List<byte[]> buffers = ImmutableList.of( "hello ".getBytes(), "this ".getBytes(), "is ".getBytes(), "http ".getBytes(), lastArray); byte[] expectedAll = "hello this is http client".getBytes(); byte[] expectedPartial = "hello this".getBytes(); try (GatheringByteArrayInputStream in = new GatheringByteArrayInputStream(buffers, expectedAll.length)) { byte[] buffer = new byte[expectedAll.length + 32]; assertEquals(in.read(buffer, 0, expectedPartial.length), expectedPartial.length); assertByteArrayEquals(buffer, 0, expectedPartial, 0, expectedPartial.length); assertEquals(in.read(buffer, expectedPartial.length, buffer.length - expectedPartial.length), expectedAll.length - expectedPartial.length); assertByteArrayEquals(buffer, 0, expectedAll, 0, expectedAll.length); assertEquals(-1, in.read(buffer, 0, expectedAll.length)); } }</code><technical_language>This byte[] lastArray = Arrays.copyOf(lastStringArray, lastStringArray.length + 32</technical_language>

Target:
public void testNormal() { byte[] lastStringArray = "client".getBytes(); byte[] lastArray = Arrays.copyOf(lastStringArray, lastStringArray.length + 32); arraycopy(lastStringArray, 0, lastArray, 0, lastStringArray.length); List<byte[]> buffers = ImmutableList.of( "hello ".getBytes(), "this ".getBytes(), "is ".getBytes(), "http ".getBytes(), lastArray); byte[] expectedAll = "hello this is http client".getBytes(); byte[] expectedPartial = "hello this".getBytes(); try (GatheringByteArrayInputStream in = new GatheringByteArrayInputStream(buffers, expectedAll.length)) { byte[] buffer = new byte[expectedAll.length + 32]; assertEquals(in.read(buffer, 0, expectedPartial.length), expectedPartial.length); assertByteArrayEquals(buffer, 0, expectedPartial, 0, expectedPartial.length); assertEquals(in.read(buffer, expectedPartial.length, buffer.length - expectedPartial.length), expectedAll.length - expectedPartial.length); assertByteArrayEquals(buffer, 0, expectedAll, 0, expectedAll.length); assertEquals(-1, in.read(buffer, 0, expectedAll.length)); } }
Source:
<code><START> public Seq<? extends E> getErrors() { <END> return errors; }</code><technical_language>java public Seq<E> getErrors()</technical_language>

Target:
public Seq<E> getErrors() { return errors; }
Source:
<code><START> public boolean equals(Object o) { <END> if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; QueryInterval that = (QueryInterval) o; if (referenceIndex != that.referenceIndex) return false; if (start != that.start) return false; return end == that.end; }</code><technical_language>In classes implement Comparable preferable implement equals() this.compareTo(that) == 0 initial type checks</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; QueryInterval that = (QueryInterval) o; return this.compareTo(that) == 0; }
Source:
<code>private int getCmasSeverity() { switch (messageIdentifier) { case SmsCbConstants.MESSAGE_ID_CMAS_ALERT_EXTREME_IMMEDIATE_OBSERVED: case SmsCbConstants.MESSAGE_ID_CMAS_ALERT_EXTREME_IMMEDIATE_LIKELY: return SmsCbCmasInfo.CMAS_SEVERITY_EXTREME; case SmsCbConstants.MESSAGE_ID_CMAS_ALERT_EXTREME_EXPECTED_OBSERVED: <START> case SmsCbConstants.MESSAGE_ID_CMAS_ALERT_EXTREME_EXPECTED_LIKELY: <END> case SmsCbConstants.MESSAGE_ID_CMAS_ALERT_SEVERE_IMMEDIATE_OBSERVED: case SmsCbConstants.MESSAGE_ID_CMAS_ALERT_SEVERE_IMMEDIATE_LIKELY: case SmsCbConstants.MESSAGE_ID_CMAS_ALERT_SEVERE_EXPECTED_OBSERVED: case SmsCbConstants.MESSAGE_ID_CMAS_ALERT_SEVERE_EXPECTED_LIKELY: return SmsCbCmasInfo.CMAS_SEVERITY_SEVERE; default: return SmsCbCmasInfo.CMAS_SEVERITY_UNKNOWN; } }</code><technical_language>"CMAS Severe Alerts", getCmasSeverity() return CMAS_SEVERITY_EXTREME? Spec "Severity of Extreme, Urgency of Expected..."</technical_language>

Target:
private int getCmasSeverity() { switch (messageIdentifier) { case SmsCbConstants.MESSAGE_ID_CMAS_ALERT_EXTREME_IMMEDIATE_OBSERVED: case SmsCbConstants.MESSAGE_ID_CMAS_ALERT_EXTREME_IMMEDIATE_LIKELY: case SmsCbConstants.MESSAGE_ID_CMAS_ALERT_EXTREME_EXPECTED_OBSERVED: case SmsCbConstants.MESSAGE_ID_CMAS_ALERT_EXTREME_EXPECTED_LIKELY: return SmsCbCmasInfo.CMAS_SEVERITY_EXTREME; case SmsCbConstants.MESSAGE_ID_CMAS_ALERT_SEVERE_IMMEDIATE_OBSERVED: case SmsCbConstants.MESSAGE_ID_CMAS_ALERT_SEVERE_IMMEDIATE_LIKELY: case SmsCbConstants.MESSAGE_ID_CMAS_ALERT_SEVERE_EXPECTED_OBSERVED: case SmsCbConstants.MESSAGE_ID_CMAS_ALERT_SEVERE_EXPECTED_LIKELY: return SmsCbCmasInfo.CMAS_SEVERITY_SEVERE; default: return SmsCbCmasInfo.CMAS_SEVERITY_UNKNOWN; } }
Source:
<code>public void logoClickOnEnglishCommunityOpensFandom() { new HomePage().getGlobalNavigation().clickFandomLogo(); System.out.println(driver.getCurrentUrl()); <START> System.out.println(fandomUrlBuilder.getFandomUrl(new Configuration().getEnvType())); <END> Assertion.assertEquals( urlChecker.getProtocolRelativeURL(driver.getCurrentUrl()), urlChecker.getProtocolRelativeURL(fandomUrlBuilder.getFandomUrl(new Configuration().getEnvType())) ); }</code><technical_language>do need this? Is necessary in test</technical_language>

Target:
public void logoClickOnEnglishCommunityOpensFandom() { new HomePage().getGlobalNavigation().clickFandomLogo(); Assertion.assertEquals( urlChecker.getProtocolRelativeURL(driver.getCurrentUrl()), urlChecker.getProtocolRelativeURL(fandomUrlBuilder.getFandomUrl(new Configuration().getEnvType())) ); }
Source:
<code>String getLocalSiteName() { <START> return SystemInfo.getSiteName(); <END> }</code><technical_language>If equalsIgnoreCase everywhere, change data? other reasons converting lowercase</technical_language>

Target:
String getLocalSiteName() { return SystemInfo.getSiteName().toLowerCase(Locale.getDefault()); }
Source:
<code>public void constructAccount() throws Exception { <START> GenericAccount account = (GenericAccount) dao.constructAccount(STUDY, EMAIL, PHONE, DUMMY_PASSWORD); <END> assertEquals(TestConstants.TEST_STUDY, account.getStudyIdentifier()); assertEquals(EMAIL, account.getEmail()); assertEquals(HEALTH_CODE, account.getHealthCode()); assertEquals(HEALTH_ID, account.getHealthId()); assertEquals(PasswordAlgorithm.DEFAULT_PASSWORD_ALGORITHM, account.getPasswordAlgorithm()); assertTrue(PasswordAlgorithm.DEFAULT_PASSWORD_ALGORITHM.checkHash(account.getPasswordHash(), DUMMY_PASSWORD)); }</code><technical_language>Unit test verify constructed account contains expected phone verified flags set correctly</technical_language>

Target:
public void constructAccount() throws Exception { GenericAccount account = (GenericAccount) dao.constructAccount(STUDY, EMAIL, PHONE, DUMMY_PASSWORD); assertEquals(TestConstants.TEST_STUDY, account.getStudyIdentifier()); assertEquals(EMAIL, account.getEmail()); assertEquals(PHONE.getNationalFormat(), account.getPhone().getNationalFormat()); assertEquals(Boolean.FALSE, account.getEmailVerified()); assertEquals(Boolean.FALSE, account.getPhoneVerified()); assertEquals(HEALTH_CODE, account.getHealthCode()); assertEquals(HEALTH_ID, account.getHealthId()); assertEquals(PasswordAlgorithm.DEFAULT_PASSWORD_ALGORITHM, account.getPasswordAlgorithm()); assertTrue(PasswordAlgorithm.DEFAULT_PASSWORD_ALGORITHM.checkHash(account.getPasswordHash(), DUMMY_PASSWORD)); }
Source:
<code>public static List<? extends CommandBase> <START> findChildCommands(Guid <END> commandId) { final List<CommandBase> failedCommands = new ArrayList<>(); final List<Guid> childCommandIds = getChildCommandIds(commandId); for (Guid childCommandId : childCommandIds) { final CommandBase<?> childCommand = retrieveCommand(childCommandId); failedCommands.add(childCommand); } return failedCommands; }</code><technical_language>findFailedChildCommands</technical_language>

Target:
public static List<? extends CommandBase> findChildCommands(Guid commandId) { final List<CommandBase> childCommands = new ArrayList<>(); final List<Guid> childCommandIds = getChildCommandIds(commandId); for (Guid childCommandId : childCommandIds) { final CommandBase<?> childCommand = retrieveCommand(childCommandId); childCommands.add(childCommand); } return childCommands; }
Source:
<code>private ListOffsetResult fetchOffsetsByTimes(Map<TopicPartition, Long> timestampsToSearch, Timer timer, boolean requireTimestamps) { ListOffsetResult result = new ListOffsetResult(); if (timestampsToSearch.isEmpty()) return result; Map<TopicPartition, Long> remainingToSearch = new HashMap<>(timestampsToSearch); do { RequestFuture<ListOffsetResult> future = sendListOffsetsRequests(remainingToSearch, requireTimestamps); client.poll(future, timer); if (!future.isDone()) { break; } else if (future.succeeded()) { ListOffsetResult value = future.value(); result.fetchedOffsets.putAll(value.fetchedOffsets); remainingToSearch.keySet().retainAll(value.partitionsToRetry); } else if (!future.isRetriable()) { throw future.exception(); } <START> if (remainingToSearch.isEmpty()) { <END> return result; } else { metadata.requestUpdate(); } if (metadata.updateRequested()) client.awaitMetadataUpdate(timer); else timer.sleep(retryBackoffMs); } while (timer.notExpired()); throw new TimeoutException("Failed to get offsets by times in " + timer.elapsedMs() + "ms"); }</code><technical_language>consolidate this logic below. this: scala if (remainingToSearch.isEmpty()) { return result; } else { client.awaitMetadataUpdate(timer); }</technical_language>

Target:
private ListOffsetResult fetchOffsetsByTimes(Map<TopicPartition, Long> timestampsToSearch, Timer timer, boolean requireTimestamps) { ListOffsetResult result = new ListOffsetResult(); if (timestampsToSearch.isEmpty()) return result; Map<TopicPartition, Long> remainingToSearch = new HashMap<>(timestampsToSearch); do { RequestFuture<ListOffsetResult> future = sendListOffsetsRequests(remainingToSearch, requireTimestamps); client.poll(future, timer); if (!future.isDone()) { break; } else if (future.succeeded()) { ListOffsetResult value = future.value(); result.fetchedOffsets.putAll(value.fetchedOffsets); remainingToSearch.keySet().retainAll(value.partitionsToRetry); } else if (!future.isRetriable()) { throw future.exception(); } if (remainingToSearch.isEmpty()) { return result; } else { client.awaitMetadataUpdate(timer); } } while (timer.notExpired()); throw new TimeoutException("Failed to get offsets by times in " + timer.elapsedMs() + "ms"); }
Source:
<code>public void testProperties() { assertNotNull(CoreUtils.getUserAgentPropertiesFromProperties("azure-core.properties").getVersion()); assertNotNull(CoreUtils.getUserAgentPropertiesFromProperties("azure-core.properties").getName()); <START> assertTrue(CoreUtils.getUserAgentPropertiesFromProperties("azure-core.properties").getVersion() <END> .matches("\\d.\\d.\\d([-a-zA-Z0-9.])*")); }</code><technical_language>this a single call CoreUtils</technical_language>

Target:
public void testProperties() { UserAgentProperties properties = CoreUtils.getUserAgentProperties("azure-core.properties"); assertFalse(properties.getName().matches("UnknownName")); assertTrue(CoreUtils.getUserAgentProperties("azure-core.properties").getVersion() .matches("\\d.\\d.\\d([-a-zA-Z0-9.])*")); }
Source:
<code>private void restrictMaxWidthForDialog(@NonNull Dialog dialog) { Resources resources = dialog.getContext().getResources(); int dp = (int) resources.getDimension(R.dimen.bottom_sheet_dialog_width); if (dp > 0) { FrameLayout bottomSheetLayout = <START> dialog.findViewById(com.google.android.material.R.id.design_bottom_sheet); <END> CoordinatorLayout.LayoutParams coordinatorLayoutParams = (CoordinatorLayout.LayoutParams) bottomSheetLayout.getLayoutParams(); coordinatorLayoutParams.width = dp; bottomSheetLayout.setLayoutParams(coordinatorLayoutParams); CoordinatorLayout coordinatorLayout = (CoordinatorLayout) bottomSheetLayout.getParent(); FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) coordinatorLayout.getLayoutParams(); layoutParams.gravity = Gravity.CENTER_HORIZONTAL; coordinatorLayout.setLayoutParams(layoutParams); } }</code><technical_language>internal resource [design_bottom_sheet Material Components library](<LINK_0> is risky considered anti-pattern. control library, is actively developed regular [releases](<LINK_1> If resource name is changed removed, a NullPointerException crash bottomSheetLayout.getLayoutParams() call in line below. Unfortunately, referencing internal resources in codebase this setting a precedent. a minimum, add a null-check ensure NullPointerException crash occur</technical_language>

Target:
private void restrictMaxWidthForDialog(@NonNull Dialog dialog) { Resources resources = dialog.getContext().getResources(); int dp = (int) resources.getDimension(R.dimen.bottom_sheet_dialog_width); if (dp > 0) { FrameLayout bottomSheetLayout = dialog.findViewById(com.google.android.material.R.id.design_bottom_sheet); if (bottomSheetLayout != null) { ViewParent bottomSheetParent = bottomSheetLayout.getParent(); if (bottomSheetParent instanceof CoordinatorLayout) { CoordinatorLayout.LayoutParams coordinatorLayoutParams = (CoordinatorLayout.LayoutParams) bottomSheetLayout.getLayoutParams(); coordinatorLayoutParams.width = dp; bottomSheetLayout.setLayoutParams(coordinatorLayoutParams); CoordinatorLayout coordinatorLayout = (CoordinatorLayout) bottomSheetParent; FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) coordinatorLayout.getLayoutParams(); layoutParams.gravity = Gravity.CENTER_HORIZONTAL; coordinatorLayout.setLayoutParams(layoutParams); } } } }
Source:
<code>public void setEntity(EntityLocal entity) { super.setEntity(entity); <START> checkArgument(getConfig(SOURCE_SENSOR) instanceof AttributeSensor, "expected SOURCE_SENSOR to be AttributeSensor, found " + getConfig(SOURCE_SENSOR)); <END> PortForwardManager.AssociationListener listener = new PortForwardManager.AssociationListener() { public void onEvent(PortForwardManager.AssociationMetadata metadata) { Maybe<MachineLocation> machine = Machines.findUniqueMachineLocation(ImmutableList.of(metadata.getLocation())); String sensorVal = producer.getAttribute((AttributeSensor)sourceSensor).toString(); URI uri = URI.create(sensorVal); int port = uri.getPort(); if (sensorVal != null && machine.isPresent() && port != -1) { if (metadata.getLocation().equals(machine.get()) && metadata.getPrivatePort() == port) { log.debug("emitting event on due to port association {}", new Object[] {sourceSensor, producer, metadata}); UriTransformingEnricher.this.onEvent(new BasicSensorEvent<Object>(sourceSensor, producer, producer.getAttribute((AttributeSensor)sourceSensor))); } } } }; getConfig(SUBNET_TIER).getPortForwardManager().addAssociationListener(listener, Predicates.alwaysTrue()); }</code><technical_language>%s feature of checkArgument, prevent concatenating strings necessary. i.e. checkArgument(getConfig(SOURCE_SENSOR) instanceof AttributeSensor, "expected SOURCE_SENSOR AttributeSensor, %s", getConfig(SOURCE_SENSOR));</technical_language>

Target:
public void setEntity(EntityLocal entity) { super.setEntity(entity); checkArgument(getConfig(SOURCE_SENSOR) instanceof AttributeSensor, "expected SOURCE_SENSOR to be AttributeSensor, found %s", getConfig(SOURCE_SENSOR)); PortForwardManager.AssociationListener listener = new PortForwardManager.AssociationListener() { public void onEvent(PortForwardManager.AssociationMetadata metadata) { Maybe<MachineLocation> machine = Machines.findUniqueMachineLocation(ImmutableList.of(metadata.getLocation())); String sensorVal = producer.getAttribute((AttributeSensor)sourceSensor).toString(); if (sensorVal != null) { URI uri = URI.create(sensorVal); int port = uri.getPort(); if (machine.isPresent() && port != -1) { if (metadata.getLocation().equals(machine.get()) && metadata.getPrivatePort() == port) { log.debug("Simulating sensor-event on new port-association {}, to trigger URI transformation by {}", new Object[] {metadata, UriTransformingEnricher.this}); UriTransformingEnricher.this.onEvent(new BasicSensorEvent<Object>(sourceSensor, producer, sensorVal); } } } } }; getConfig(SUBNET_TIER).getPortForwardManager().addAssociationListener(listener, Predicates.alwaysTrue()); }
Source:
<code>private Thread startDirectoryWatcher(Path mapsDirectory) { Thread thread = new Thread(() -> noCatch(() -> { WatchService watcher = mapsDirectory.getFileSystem().newWatchService(); customMapsDirectory.register(watcher, ENTRY_DELETE); <START> try (watcher) { <END> while (!Thread.interrupted()) { WatchKey key = watcher.take(); key.pollEvents().stream() .filter(event -> event.kind() == ENTRY_DELETE) .forEach(event -> removeMap(mapsDirectory.resolve((Path) event.context()))); key.reset(); } } catch (InterruptedException e) { logger.debug("Watcher terminated ({})", e.getMessage()); } })); thread.setDaemon(true); thread.start(); return thread; }</code><technical_language>declare variable in try-with-resources block. WatchService watcher = mapsDirectory.getFileSystem().newWatchService(); try() customMapsDirectory.register(watcher, ENTRY_DELETE); part of try-block</technical_language>

Target:
private Thread startDirectoryWatcher(Path mapsDirectory) { Thread thread = new Thread(() -> noCatch(() -> { try (WatchService watcher = mapsDirectory.getFileSystem().newWatchService()) { customMapsDirectory.register(watcher, ENTRY_DELETE); while (!Thread.interrupted()) { WatchKey key = watcher.take(); key.pollEvents().stream() .filter(event -> event.kind() == ENTRY_DELETE) .forEach(event -> removeMap(mapsDirectory.resolve((Path) event.context()))); key.reset(); } } catch (InterruptedException e) { logger.debug("Watcher terminated ({})", e.getMessage()); } })); thread.setDaemon(true); thread.start(); return thread; }
Source:
<code>protected boolean set(EntityLivingBase entity, Float value) { <START> entity.fallDistance = value; <END> return true; }</code><technical_language>Needs some validation itself. if is provided implementation, defensively check argument</technical_language>

Target:
protected boolean set(EntityLivingBase entity, Float value) { entity.fallDistance = Preconditions.checkNotNull(value); return true; }
Source:
<code>protected void execute() { if (shouldDiscover()) { discover(); } for (EdimaxBindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { EdimaxBindingConfiguration config = ((EdimaxGenericBindingProvider) provider) .getConfig(itemName); String macAddress = config.getMacAddress(); String deviceIP = getDeviceIP(macAddress); if (deviceIP == null) { <START> logger.error("Device with MAC: " + macAddress <END> + " not found/discovered."); continue; } EdimaxBindingConfiguration.Type type = config.getType(); if (type == null) { type = Type.STATE; } State newState = null; try { switch (type) { case CURRENT: BigDecimal current = createSender(config).getCurrent( deviceIP); newState = new DecimalType(current); break; case POWER: BigDecimal power = createSender(config).getPower( deviceIP); newState = new DecimalType(power); break; case STATE: Boolean state = createSender(config).getState(deviceIP); if (state) { newState = OnOffType.ON; } else { newState = OnOffType.OFF; } break; } } catch (IOException e) { logger.error( "Error in communication with device. Device's MAC: " + macAddress + ". Cannot get update from device.", e); } if (newState != null) { eventPublisher.postUpdate(itemName, newState); } } } }</code><technical_language>parameterized logging instead of string concatenation</technical_language>

Target:
protected void execute() { if (shouldDiscover()) { discover(); } for (EdimaxBindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { EdimaxBindingConfiguration config = ((EdimaxGenericBindingProvider) provider).getConfig(itemName); String macAddress = config.getMacAddress(); String deviceIP = getDeviceIP(macAddress); if (deviceIP == null) { logger.error("Device with MAC: not found/discovered.", macAddress); continue; } EdimaxBindingConfiguration.Type type = config.getType(); if (type == null) { type = Type.STATE; } State newState = null; try { switch (type) { case CURRENT: BigDecimal current = createSender(config).getCurrent(deviceIP); newState = new DecimalType(current); break; case POWER: BigDecimal power = createSender(config).getPower(deviceIP); newState = new DecimalType(power); break; case STATE: Boolean state = createSender(config).getState(deviceIP); if (state) { newState = OnOffType.ON; } else { newState = OnOffType.OFF; } break; } } catch (IOException e) { logger.error("Error in communication with device. Device's MAC: {}. Cannot get update from device.", macAddress, e); } if (newState != null) { eventPublisher.postUpdate(itemName, newState); } } } }
Source:
<code><START> public CrashGenCleaner( PagedFile pagedFile, TreeNode<?,?> treeNode, long lowTreeNodeId, long highTreeNodeId, <END> long stableGeneration, long unstableGeneration, Monitor monitor ) { this.pagedFile = pagedFile; this.treeNode = treeNode; this.lowTreeNodeId = lowTreeNodeId; this.highTreeNodeId = highTreeNodeId; this.stableGeneration = stableGeneration; this.unstableGeneration = unstableGeneration; this.monitor = monitor; this.maxKeyCount = treeNode.internalMaxKeyCount(); }</code><technical_language>this constructor package local class is package local</technical_language>

Target:
CrashGenCleaner( PagedFile pagedFile, TreeNode<?,?> treeNode, long lowTreeNodeId, long highTreeNodeId, long stableGeneration, long unstableGeneration, Monitor monitor ) { this.pagedFile = pagedFile; this.treeNode = treeNode; this.lowTreeNodeId = lowTreeNodeId; this.highTreeNodeId = highTreeNodeId; this.availableProcessors = Runtime.getRuntime().availableProcessors(); this.batchSize = min( 1000, max( 10, (highTreeNodeId - lowTreeNodeId) / (100 * availableProcessors) ) ); this.stableGeneration = stableGeneration; this.unstableGeneration = unstableGeneration; this.monitor = monitor; this.internalMaxKeyCount = treeNode.internalMaxKeyCount(); }
Source:
<code>public List<MLModelField> getModelInputFields(MLModelInfo modelInfo) throws IOException, SAXException, JAXBException { <START> final List<MLModelField> fieldNames = doGetInputFieldsFromPMMLStream(modelInfo.getPmml()); <END> return fieldNames; }</code><technical_language>inline this: return doGetInputFieldsFromPMMLStream(modelInfo.getPmml());</technical_language>

Target:
public List<MLModelField> getModelInputFields(MLModelInfo modelInfo) throws IOException, SAXException, JAXBException { return doGetInputFieldsFromPMMLStream(modelInfo.getPmml()); }
Source:
<code>public ElasticsearchTextFieldPredicateBuilderFactory( ToDocumentFieldValueConverter<?, ? extends String> converter, ToDocumentFieldValueConverter<String, ? extends String> rawConverter, ElasticsearchFieldCodec<String> codec, PropertyMapping mapping) { super( converter, rawConverter, codec ); this.type = mapping.getType(); <START> this.analyzerOrNormalizer = mapping.getAnalyzerOrNormalizer(); <END> }</code><technical_language>I reason get analyzer name PropertyMapping instead of passing constructor directly. pollutes PropertyMapping class information relevant this class</technical_language>

Target:
public ElasticsearchTextFieldPredicateBuilderFactory( ToDocumentFieldValueConverter<?, ? extends String> converter, ToDocumentFieldValueConverter<String, ? extends String> rawConverter, ElasticsearchFieldCodec<String> codec, PropertyMapping mapping) { super( converter, rawConverter, codec ); this.type = mapping.getType(); this.analyzer = mapping.getAnalyzer(); this.normalizer = mapping.getNormalizer(); }
Source:
<code>public DatasetDescriptor create(String namespace, String name, DatasetDescriptor descriptor) { Compatibility.checkDatasetName(namespace, name); Compatibility.checkDescriptor(descriptor); URI location = descriptor.getLocation(); if (location != null && location.getPath().startsWith( HiveAbstractDatasetRepository.REPLACE_PATH)) { location = null; } String resolved = resolveNamespace(namespace, name, location); if (resolved != null) { if (resolved.equals(namespace)) { throw new DatasetExistsException( "Metadata already exists for dataset: " + namespace + "." + name); <START> } else { <END> DatasetDescriptor loaded = load(resolved, name); LOG.warn("Creating table managed table {}.{}: replaces default.{}", new Object[]{namespace, name, name}); Compatibility.checkUpdate(loaded, descriptor); location = loaded.getLocation(); } } LOG.info("Creating a managed Hive table named: " + name); boolean isExternal = (location != null); DatasetDescriptor toCreate = descriptor; if (isExternal) { toCreate = new DatasetDescriptor.Builder(descriptor) .location(location) .build(); } Table table = HiveUtils.tableForDescriptor( namespace, name, toCreate, isExternal); getMetaStoreUtil().createTable(table); Table newTable = getMetaStoreUtil().getTable(namespace, name); return new DatasetDescriptor.Builder(descriptor) .location(newTable.getSd().getLocation()) .build(); } @Override protected URI expectedLocation(String namespace, String name) { return null; } }</code><technical_language>This is happening previously create a dataset this namespace name, in default Hive database need move database name namespace</technical_language>

Target:
public DatasetDescriptor create(String namespace, String name, DatasetDescriptor descriptor) { Compatibility.checkDatasetName(namespace, name); Compatibility.checkDescriptor(descriptor); URI location = descriptor.getLocation(); String resolved = resolveNamespace(namespace, name, location); if (resolved != null) { if (resolved.equals(namespace)) { throw new DatasetExistsException( "Metadata already exists for dataset: " + namespace + "." + name); } else { DatasetDescriptor loaded = load(resolved, name); LOG.warn("Creating table managed table {}.{}: replaces default.{}", new Object[]{namespace, name, name}); Compatibility.checkUpdate(loaded, descriptor); location = loaded.getLocation(); } } LOG.info("Creating a managed Hive table named: " + name); boolean isExternal = (location != null); DatasetDescriptor toCreate = descriptor; if (isExternal) { toCreate = new DatasetDescriptor.Builder(descriptor) .location(location) .build(); } Table table = HiveUtils.tableForDescriptor( namespace, name, toCreate, isExternal); getMetaStoreUtil().createTable(table); Table newTable = getMetaStoreUtil().getTable(namespace, name); DatasetDescriptor newDescriptor = new DatasetDescriptor.Builder(descriptor) .location(newTable.getSd().getLocation()) .build(); if (isExternal) { FileSystemUtil.ensureLocationExists(newDescriptor, conf); } return newDescriptor; } @Override protected URI expectedLocation(String namespace, String name) { return null; } }
Source:
<code>public void transform(StructuredRecord in, Emitter<StructuredRecord> emitter) throws Exception { String body = in.get(config.field); try { org.apache.commons.csv.CSVParser parser = org.apache.commons.csv.CSVParser.parse(body, csvFormat); List<CSVRecord> records = parser.getRecords(); for (CSVRecord record : records) { emitter.emit(createStructuredRecord(record, in)); } } catch (IOException e) { <START> throw new RuntimeException("There was a issue parsing the record. " + e.getLocalizedMessage()); <END> } }</code><technical_language>Preserves original exception rethrowing exception. Also, throw Throwables.propagate(e); in this case</technical_language>

Target:
public void transform(StructuredRecord in, Emitter<StructuredRecord> emitter) throws Exception { String body = in.get(config.field); try { org.apache.commons.csv.CSVParser parser = org.apache.commons.csv.CSVParser.parse(body, csvFormat); List<CSVRecord> records = parser.getRecords(); for (CSVRecord record : records) { emitter.emit(createStructuredRecord(record, in)); } } catch (IOException e) { throw Throwables.propagate(e); } }
Source:
<code><START> String getCreatedTime(final AssetInfo asset) { <END> return ts.format(LibraryConstants.Created) + " " + SocialDateFormatter.format(asset.getCreatedTime()); }</code><technical_language>Please add access modifier, private probably</technical_language>

Target:
private String getCreatedTime(final AssetInfo asset) { return ts.format(LibraryConstants.Created) + " " + SocialDateFormatter.format(asset.getCreatedTime()); }
Source:
<code>public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject templatePreparationObject) { List<ApiClusterTemplateConfig> rangerConfigs = new ArrayList<>(); ConfigUtils.getStorageLocationForServiceProperty(templatePreparationObject, RANGER_HDFS_AUDIT_URL) <START> .map(location -> rangerConfigs.add(config(RANGER_HDFS_AUDIT_URL, location.getValue()))) <END> .orElseGet(() -> rangerConfigs.add(config(RANGER_HDFS_AUDIT_URL, getDefaultRangerAuditUrl(templateProcessor, templatePreparationObject)))); String cmVersion = templatePreparationObject.getProductDetailsView().getCm().getVersion(); if (CMRepositoryVersionUtil.isVersionNewerOrEqualThanLimited(cmVersion, CLOUDERAMANAGER_VERSION_7_2_1)) { ConfigUtils.getStorageLocationForServiceProperty(templatePreparationObject, RANGER_DATA_URL) .ifPresent(location -> rangerConfigs.add(config(RANGER_DATA_URL, location.getValue()))); ConfigUtils.getStorageLocationForServiceProperty(templatePreparationObject, RANGER_LOG_URL) .ifPresent(location -> rangerConfigs.add(config(RANGER_LOG_URL, location.getValue()))); } return rangerConfigs; }</code><technical_language>nit: This is hard parse. Consider rewriting extracting some of variables. List<ApiClusterTemplateConfig> rangerConfigs = new ArrayList<>(); final String rangerHdfsAuditUrl = ConfigUtils.getStorageLocationForServiceProperty(templatePreparationObject, RANGER_HDFS_AUDIT_URL) .map(location -> location.getValue()) .orElseGet(() -> getDefaultRangerAuditUrl(templateProcessor, templatePreparationObject)); rangerConfigs.add(config(RANGER_HDFS_AUDIT_URL, rangerHdfsAuditUrl)); final String rangerDataUrl = ... final String rangerLogUrl = ... rangerConfigs.add(...); rangerConfigs.add(...); return rangerConfigs;</technical_language>

Target:
public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject templatePreparationObject) { List<ApiClusterTemplateConfig> rangerConfigs = new ArrayList<>(); ConfigUtils.getStorageLocationForServiceProperty(templatePreparationObject, RANGER_HDFS_AUDIT_URL) .map(location -> rangerConfigs.add(config(RANGER_HDFS_AUDIT_URL, location.getValue()))) .orElseGet(() -> rangerConfigs.add(config(RANGER_HDFS_AUDIT_URL, getDefaultRangerAuditUrl(templateProcessor, templatePreparationObject)))); String cmVersion = templatePreparationObject.getProductDetailsView().getCm().getVersion(); if (CMRepositoryVersionUtil.isVersionNewerOrEqualThanLimited(cmVersion, CLOUDERAMANAGER_VERSION_7_2_1) && CloudPlatform.AZURE == templatePreparationObject.getCloudPlatform() && templatePreparationObject.getGeneralClusterConfigs().isEnableRangerRaz()) { String rangerAuditPath = rangerConfigs.get(0).getValue(); String baseDataPath = rangerAuditPath.split("ranger/audit")[0]; rangerConfigs.add(config(RANGER_DATA_URL, baseDataPath)); } return rangerConfigs; }
Source:
<code>private void onChunkOperationComplete(GetChunk chunk) { if (chunk.getChunkException() != null) { setOperationException(chunk.getChunkException()); } if (chunk == firstChunk) { if (operationCallbackInvoked.compareAndSet(false, true)) { long timeElapsed = time.milliseconds() - submissionTimeMs; routerMetrics.getBlobOperationLatencyMs.update(timeElapsed); Exception e = getOperationException(); blobDataChannel = e == null ? new BlobDataReadableStreamChannel() : null; <START> operationResult = e == null ? new GetBlobResult(blobInfo, blobDataChannel) : null; <END> if (e != null) { routerMetrics.onGetBlobError(e, options); } operationCompleteCallback.completeOperation(operationFuture, operationCallback, operationResult, e); } } chunk.postCompletionCleanup(); if (blobDataChannel != null) { blobDataChannel.maybeWriteToChannel(); } }</code><technical_language>of these, if-else cleaner</technical_language>

Target:
private void onChunkOperationComplete(GetChunk chunk) { if (chunk.getChunkException() != null) { setOperationException(chunk.getChunkException()); } if (chunk == firstChunk) { if (operationCallbackInvoked.compareAndSet(false, true)) { long timeElapsed = time.milliseconds() - submissionTimeMs; routerMetrics.getBlobOperationLatencyMs.update(timeElapsed); Exception e = getOperationException(); if (e == null) { blobDataChannel = new BlobDataReadableStreamChannel(); operationResult = new GetBlobResult(blobInfo, blobDataChannel); } else { blobDataChannel = null; operationResult = null; routerMetrics.onGetBlobError(e, options); } operationCompleteCallback.completeOperation(operationFuture, operationCallback, operationResult, e); } } chunk.postCompletionCleanup(); if (blobDataChannel != null) { blobDataChannel.maybeWriteToChannel(); } }
Source:
<code>protected Properties getDefaultApiKeyFileProperties() { Properties props = new Properties(); try { Reader reader = createFileReader(DEFAULT_API_KEY_PROPERTIES_FILE_LOCATION); props = toProperties(reader); } catch (IOException ignored) { log.debug( <START> "Unable to find or load default api key properties file [{}]. This can be safely ignored as this is a fallback location - other more specific locations will be checked.", <END> DEFAULT_API_KEY_PROPERTIES_FILE_LOCATION, ignored ); } return props; }</code><technical_language>a deal breaker line breaks present in long lines. For future reference</technical_language>

Target:
protected Properties getDefaultApiKeyFileProperties() { Properties props = new Properties(); try { Reader reader = createFileReader(DEFAULT_API_KEY_PROPERTIES_FILE_LOCATION); props = toProperties(reader); } catch (IOException ignored) { log.debug( "Unable to find or load default api key properties file [{}]. " + "This can be safely ignored as this is a fallback location - " + "other more specific locations will be checked.", DEFAULT_API_KEY_PROPERTIES_FILE_LOCATION, ignored ); } return props; }
Source:
<code>public void execute(OperationContext opContext, ModelNode model) throws OperationFailedException { try { ServiceName name = SubsystemExtension.SERVICE_NAME; ServiceRegistry serviceRegistry = opContext.getServiceRegistry(true); MonitorService service = (MonitorService) serviceRegistry.getRequiredService(name).getValue(); boolean restart = model.get("restart").asBoolean(false); if (restart) { LOGGER.debug("Asked to restart the Hawkualr Monitor service. Will stop it, then restart it now."); service.stopMonitorService(); } else { LOGGER.debug("Asked to start the Hawkular Monitor service"); } if (!service.isMonitorServiceStarted()) { Thread newThread = new Thread(new Runnable() { @Override public void run() { try { service.startMonitorService(); } catch (Throwable t) { <START> } <END> } }, "Hawkular WildFly Agent Operation Start Thread"); newThread.setDaemon(true); newThread.start(); } } catch (ServiceNotFoundException snfe) { throw new OperationFailedException("Cannot restart Hawkular Monitor service - it is disabled", snfe); } catch (Exception e) { throw new OperationFailedException("Cannot restart Hawkular Monitor service", e); } opContext.stepCompleted(); return; }</code><technical_language>log bad here</technical_language>

Target:
public void execute(OperationContext opContext, ModelNode model) throws OperationFailedException { try { ServiceName name = SubsystemExtension.SERVICE_NAME; ServiceRegistry serviceRegistry = opContext.getServiceRegistry(true); MonitorService service = (MonitorService) serviceRegistry.getRequiredService(name).getValue(); boolean restart = model.get("restart").asBoolean(false); if (restart) { LOGGER.debug("Asked to restart the Hawkualr Monitor service. Will stop it, then restart it now."); service.stopMonitorService(); } else { LOGGER.debug("Asked to start the Hawkular Monitor service"); } if (!service.isMonitorServiceStarted()) { Thread newThread = new Thread(new Runnable() { @Override public void run() { service.startMonitorService(); } }, "Hawkular WildFly Agent Operation Start Thread"); newThread.setDaemon(true); newThread.start(); } } catch (ServiceNotFoundException snfe) { throw new OperationFailedException("Cannot restart Hawkular Monitor service - it is disabled", snfe); } catch (Exception e) { throw new OperationFailedException("Cannot restart Hawkular Monitor service", e); } opContext.stepCompleted(); return; }
Source:
<code>private Node addStateNotations(View sourceView, State newState) { View region = getRegionCompartmentView(sourceView); Node stateNode = ViewService.createNode(region, newState, SemanticHints.STATE, DiagramActivator.DIAGRAM_PREFERENCES_HINT); Bounds sourceBounds = null; if(sourceView instanceof Node){ Node mynode = (Node)sourceView; LayoutConstraint layoutConstraint = mynode.getLayoutConstraint(); if(layoutConstraint instanceof Bounds){ sourceBounds = (Bounds) layoutConstraint; } } Bounds newStateBounds = NotationFactory.eINSTANCE.createBounds(); <START> newStateBounds.setX(sourceBounds.getX()+200); <END> newStateBounds.setY(sourceBounds.getY()); stateNode.setLayoutConstraint(newStateBounds); return stateNode; }</code><technical_language>Ctor of CreateViewAndOptionallyElementCommand</technical_language>

Target:
private Node addStateNotations(View sourceView, State newState) { View region = getParentRegionCompartmentView(sourceView); Node stateNode = ViewService.createNode(region, newState, SemanticHints.STATE, DiagramActivator.DIAGRAM_PREFERENCES_HINT); Bounds sourceBounds = getSourceBounds(sourceView); Bounds newStateBounds = NotationFactory.eINSTANCE.createBounds(); newStateBounds.setX(sourceBounds.getX()+150); newStateBounds.setY(sourceBounds.getY()+50); stateNode.setLayoutConstraint(newStateBounds); return stateNode; }
Source:
<code>public void notifyCheckpointAborted(long checkpointId) throws Exception { <START> if (keyedStateBackend != null && keyedStateBackend instanceof CheckpointListener) { <END> ((CheckpointListener) keyedStateBackend).notifyCheckpointAborted(checkpointId); } }</code><technical_language>suggestion if (keyedStateBackend instanceof CheckpointListener) { Ditto</technical_language>

Target:
public void notifyCheckpointAborted(long checkpointId) throws Exception { if (keyedStateBackend instanceof CheckpointListener) { ((CheckpointListener) keyedStateBackend).notifyCheckpointAborted(checkpointId); } }