auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void progress() { this.progressCounter++; if (this.player.isDead() || !this.player.isOnline()) { this.remove(); return; } else if (this.currentLoc != null && GeneralMethods.isRegionProtectedFromBuild(this, this.currentLoc)) { this.remove(); return; } if (this.origin == null) { this.direction = this.player.getEyeLocation().getDirection().normalize(); this.origin = GeneralMethods.getMainHandLocation(player).add(this.direction.clone().multiply(10)); } if (this.progressCounter < 8) { return; } if (this.destination == null) { this.destination = GeneralMethods.getMainHandLocation(player).add(GeneralMethods.getMainHandLocation(player).getDirection().normalize().multiply(10)); final Vector origToDest = GeneralMethods.getDirection(this.origin, this.destination); for (double i = 0; i < 30; i++) { final Location endLoc = this.origin.clone().add(origToDest.clone().multiply(i / 30)); <START> if (GeneralMethods.locationEqualsIgnoreDirection(GeneralMethods.getMainHandLocation(player), endLoc)) { <END> continue; } final Vector vec = GeneralMethods.getDirection(GeneralMethods.getMainHandLocation(player), endLoc); final FireComboStream fs = new FireComboStream(this.player, this, vec, GeneralMethods.getMainHandLocation(player), this.range, this.speed); fs.setDensity(1); fs.setSpread(0F); fs.setUseNewParticles(true); fs.setParticleEffect(getAirbendingParticles()); fs.setCollides(false); fs.runTaskTimer(ProjectKorra.plugin, (long) (i / 2.5), 1L); this.tasks.add(fs); } } this.manageAirVectors(); }</code><technical_language>a variable beginning of loop for getMainHandLocation run 3 times</technical_language>

Target:
public void progress() { this.progressCounter++; if (this.player.isDead() || !this.player.isOnline()) { this.remove(); return; } else if (this.currentLoc != null && GeneralMethods.isRegionProtectedFromBuild(this, this.currentLoc)) { this.remove(); return; } if (this.origin == null) { this.direction = this.player.getEyeLocation().getDirection().normalize(); this.origin = GeneralMethods.getMainHandLocation(player).add(this.direction.clone().multiply(10)); } if (this.progressCounter < 8) { return; } if (this.destination == null) { this.destination = GeneralMethods.getMainHandLocation(player).add(GeneralMethods.getMainHandLocation(player).getDirection().normalize().multiply(10)); final Vector origToDest = GeneralMethods.getDirection(this.origin, this.destination); final Location hand = GeneralMethods.getMainHandLocation(player); for (double i = 0; i < 30; i++) { final Location endLoc = this.origin.clone().add(origToDest.clone().multiply(i / 30)); if (GeneralMethods.locationEqualsIgnoreDirection(hand, endLoc)) { continue; } final Vector vec = GeneralMethods.getDirection(hand, endLoc); final FireComboStream fs = new FireComboStream(this.player, this, vec, hand, this.range, this.speed); fs.setDensity(1); fs.setSpread(0F); fs.setUseNewParticles(true); fs.setParticleEffect(getAirbendingParticles()); fs.setCollides(false); fs.runTaskTimer(ProjectKorra.plugin, (long) (i / 2.5), 1L); this.tasks.add(fs); } } this.manageAirVectors(); }
Source:
<code>public ProjectType getProjectType(Path path) { <START> for(ProjectType type : projectTypes.keySet()) { <END> if(type.getLanguagePlugin().isExerciseTypeCorrect(path)) { return type; } } return null; }</code><technical_language>hashmap unnecessary. iterate ProjectType.values() get plugin ProjectType. Also, coding style a space keywords for if (but method names)</technical_language>

Target:
public ProjectType getProjectType(Path path) { for (ProjectType type : ProjectType.values()) { if (type.getLanguagePlugin().isExerciseTypeCorrect(path)) { return type; } } return null; }
Source:
<code>public int hashCode() { int result = name.hashCode(); <START> result = 31 * result + (version != null ? version.hashCode(): 0); <END> return result; }</code><technical_language>BTW java.util.Objects this a bit simpler</technical_language>

Target:
public int hashCode() { return Objects.hash(name, version); }
Source:
<code><START> private void zipFile(File file, String path, ZipOutputStream zos) throws FileNotFoundException, java.io.IOException { <END> try (FileInputStream fis = new FileInputStream(file)) { ZipEntry zipEntry = new ZipEntry(path); zos.putNextEntry(zipEntry); int length; while ((length = fis.read(buffer)) >= 0) { zos.write(buffer, 0, length); } zos.closeEntry(); } }</code><technical_language>a small note. is need declare FileNotFoundException is a subclass of IOException</technical_language>

Target:
private void zipFile(File file, String path, ZipOutputStream zos) throws java.io.IOException { try (FileInputStream fis = new FileInputStream(file)) { ZipEntry zipEntry = new ZipEntry(path); zos.putNextEntry(zipEntry); int length; while ((length = fis.read(buffer)) >= 0) { zos.write(buffer, 0, length); } zos.closeEntry(); } }
Source:
<code>public String listRunningThirdPartyProcesses() { String psOutput = runAdbCommand("shell ps"); StringBuilder sb = new StringBuilder(); boolean isFirstHeaderLine = true; <START> for (String line: Splitter.on(System.getProperty("line.separator")).split(psOutput)) { <END> boolean isThirdPartyProcess = line.contains(".") && !line.contains("com.android"); if (isFirstHeaderLine || isThirdPartyProcess) { sb.append(line + System.getProperty("line.separator")); } isFirstHeaderLine = false; } return sb.toString(); }</code><technical_language>adb output line separators based OS</technical_language>

Target:
public String listRunningThirdPartyProcesses() { String psOutput = runAdbCommand("shell ps"); StringBuilder sb = new StringBuilder(); boolean isFirstHeaderLine = true; for (String line: Splitter.on("\n").split(psOutput)) { boolean isThirdPartyProcess = line.contains(".") && !line.contains("com.android"); if (isFirstHeaderLine || isThirdPartyProcess) { sb.append(line + "\n"); } isFirstHeaderLine = false; } return sb.toString(); }
Source:
<code>private static String getRealRelativeFilePath(String basepath, String absolutePath) throws IOException { String realAbsolutePath = Paths.get(absolutePath).toRealPath().toString(); String realBasePath = Paths.get(basepath).toRealPath().toString(); <START> return basepath.endsWith("/") ? realAbsolutePath.substring(realBasePath.length()) <END> : realAbsolutePath.substring(realBasePath.length() + 1); }</code><technical_language>basepath.endWith(Files.separator)</technical_language>

Target:
private static String getRealRelativeFilePath(String basepath, String absolutePath) throws IOException { String realAbsolutePath = Paths.get(absolutePath).toRealPath().toString(); String realBasePath = Paths.get(basepath).toRealPath().toString(); return basepath.endsWith(File.separator) ? realAbsolutePath.substring(realBasePath.length()) : realAbsolutePath.substring(realBasePath.length() + 1); }
Source:
<code>public BlazeArc(final Player player, final Location location, final Vector direction, final double range) { super(player); this.range = this.getDayFactor(range); this.speed = getConfig().getLong("Abilities.Fire.Blaze.Speed"); this.interval = (long) (1000. / this.speed); if(bPlayer.canUseSubElement(SubElement.BLUE_FIRE)) { <START> this.range += BlueFireAbility.getRangeFactor() * range; <END> } this.origin = location.clone(); this.location = this.origin.clone(); this.direction = direction.clone(); this.direction.setY(0); this.direction = this.direction.clone().normalize(); this.location = this.location.clone().add(this.direction); this.time = System.currentTimeMillis(); this.start(); }</code><technical_language>I += =. This double time, multiply modifer</technical_language>

Target:
public BlazeArc(final Player player, final Location location, final Vector direction, final double range) { super(player); this.range = this.getDayFactor(range); this.speed = getConfig().getLong("Abilities.Fire.Blaze.Speed"); this.interval = (long) (1000.0 / this.speed); if(bPlayer.canUseSubElement(SubElement.BLUE_FIRE)) { this.range += BlueFireAbility.getRangeFactor() * range - range; } this.origin = location.clone(); this.location = this.origin.clone(); this.direction = direction.clone(); this.direction.setY(0); this.direction = this.direction.clone().normalize(); this.location = this.location.clone().add(this.direction); this.time = System.currentTimeMillis(); this.start(); }
Source:
<code>public void testConnectionFailed() { resetCallbacks(); createMediaBrowser(TEST_WRONG_BROWSER_SERVICE); mMediaBrowser.connect(); new PollingCheck(TIME_OUT_MS) { @Override protected boolean check() { return <START> mConnectionCallback.mConnectionFailedCount > 0; <END> } }.run(); }</code><technical_language>check if other counts 0 also</technical_language>

Target:
public void testConnectionFailed() { resetCallbacks(); createMediaBrowser(TEST_INVALID_BROWSER_SERVICE); mMediaBrowser.connect(); new PollingCheck(TIME_OUT_MS) { @Override protected boolean check() { return mConnectionCallback.mConnectionFailedCount > 0 && mConnectionCallback.mConnectedCount == 0 && mConnectionCallback.mConnectionSuspendedCount == 0; } }.run(); }
Source:
<code>public void gather(MetricsCollector collector) { List<LockInfo> locks = getLocks(); LocalDateTime limitForAcquired = LocalDateTime.now().minus(LONG_RUNNING_LOGS_THRESHOLD); collector.metric("locks-count", "Active Locks", locks.size(), null); collector.metric("locks-long-running", "Long locks", <START> locks.stream() <END> .filter(lock -> Objects.nonNull(lock.getAcquired())) .filter(lock -> lock.getAcquired().isBefore(limitForAcquired)) .count(), null); }</code><technical_language>code is a bit cleaner if stream is mapped filtering locks.stream().map(LockInfo::getAcquired) .filter(Objects::nonNull) .filter(date -> date.isBefore(limitForAcquired)) .count()</technical_language>

Target:
public void gather(MetricsCollector collector) { List<LockInfo> locks = getLocks(); LocalDateTime limitForAcquired = LocalDateTime.now().minus(LONG_RUNNING_LOGS_THRESHOLD); collector.metric("locks-count", "Active Locks", locks.size(), null); collector.metric("locks-long-running", "Long locks", locks.stream() .map(LockInfo::getAcquired) .filter(Objects::nonNull) .filter(date -> date.isBefore(limitForAcquired)) .count(), null); }
Source:
<code>public void cannotReadForWrongSweepStrategy() { <START> assertThat(readThorough(shard)).isEmpty(); <END> assertThat(readConservative(shard2)).isEmpty(); }</code><technical_language>rename shard conservativeShard shard2 thoroughShard</technical_language>

Target:
public void cannotReadForWrongSweepStrategy() { assertThat(readThorough(shardCons)).isEmpty(); assertThat(readConservative(shardThor)).isEmpty(); }
Source:
<code>int getClientWidth () { if ((state & ZERO_WIDTH) != 0) return 0; GtkAllocation allocation = new GtkAllocation(); if (handle != 0) { gtk_widget_get_allocation (handle, allocation); return allocation.width; } else { return 0; <START> } <END> }</code><technical_language>This implementation restructured below: int getClientWidth () { if (handle == 0 || (state & ZERO_WIDTH) != 0) return 0; GtkAllocation allocation = new GtkAllocation (); gtk_widget_get_allocation (handle, allocation); return allocation.width; }</technical_language>

Target:
int getClientWidth () { if (handle == 0 || (state & ZERO_WIDTH) != 0) return 0; GtkAllocation allocation = new GtkAllocation(); gtk_widget_get_allocation (handle, allocation); return allocation.width; }
Source:
<code>public @Nullable DiskRequest getDiskRequestFrom(List<ITmfStateInterval> fullState) { if (fQuark > fullState.size()) { fLastRequest = null; return null; } <START> if (fullState.get(fQuark).getStateValue().isNull()) { <END> fLastRequest = null; return null; } DiskRequest request = fLastRequest; if (request != null && fullState.get(fQuark).getEndTime() == request.getEndTime()) { return request; } fLastRequest = fQueue.getRequestFrom(fullState, fQuark); return fLastRequest; }</code><technical_language>extract local variable</technical_language>

Target:
public @Nullable DiskRequest getDiskRequestFrom(List<ITmfStateInterval> fullState) { if (fQuark > fullState.size()) { fLastRequest = null; return null; } ITmfStateInterval interval = fullState.get(fQuark); if (interval.getStateValue().isNull()) { fLastRequest = null; return null; } DiskRequest request = fLastRequest; if (request != null && interval.getEndTime() == request.getEndTime()) { return request; } fLastRequest = fQueue.getRequestFrom(fullState, fQuark); return fLastRequest; }
Source:
<code>private void resetOffset( KafkaConsumer<byte[], byte[]> consumer, Set<Integer> assignment, TopicPartition topicPartition ) { log.warn( "Resetting consumer offset to [%s] for partition [%d]", ioConfig.isUseEarliestOffset() ? "earliest" : "latest", topicPartition.partition() ); if (ioConfig.isUseEarliestOffset()) { consumer.seekToBeginning(topicPartition); } else { consumer.seekToEnd(topicPartition); } nextOffsets.put(topicPartition.partition(), consumer.position(topicPartition)); <START> log.warn("Consumer is now at offset [%d]", consumer.position(topicPartition)); <END> if (consumer.position(topicPartition) >= endOffsets.get(topicPartition.partition()) && assignment.remove(topicPartition.partition())) { log.info( "Finished reading topic[%s], partition[%,d].", topicPartition.topic(), topicPartition.partition() ); } assignPartitions(consumer, topicPartition.topic(), assignment); }</code><technical_language>Hm, I nextOffsets.get() set repeatedly calling consumer.position() line below, cost of calling consumer.position() control nextOffsets</technical_language>

Target:
private void resetOffset( KafkaConsumer<byte[], byte[]> consumer, Set<Integer> assignment, TopicPartition topicPartition ) { log.warn( "Resetting consumer offset to [%s] for partition [%d]", ioConfig.isUseEarliestOffset() ? "earliest" : "latest", topicPartition.partition() ); if (ioConfig.isUseEarliestOffset()) { consumer.seekToBeginning(topicPartition); } else { consumer.seekToEnd(topicPartition); } nextOffsets.put(topicPartition.partition(), consumer.position(topicPartition)); log.warn("Consumer is now at offset [%d]", nextOffsets.get(topicPartition.partition())); if (nextOffsets.get(topicPartition.partition()) >= endOffsets.get(topicPartition.partition()) && assignment.remove(topicPartition.partition())) { log.info( "Finished reading topic[%s], partition[%,d].", topicPartition.topic(), topicPartition.partition() ); } assignPartitions(consumer, topicPartition.topic(), assignment); }
Source:
<code>public String toString() { if (fieldString == null && fieldBytes != null) { try { Object array = readBinaryArray(1, 0); if (PrimitiveArraySupport.isSupportedPrimitiveArray(array)) { <START> fieldString = PrimitiveArraySupport.arrayToString(connection.getTypeInfo().getArrayDelimiter(oid), array); <END> } else { java.sql.Array tmpArray = connection.createArrayOf(getBaseTypeName(), (Object[]) array); fieldString = tmpArray.toString(); } } catch (SQLException e) { fieldString = "NULL"; } } return fieldString; }</code><technical_language>this: java arraySupport = PrimitiveArraySupport.getArraySupport(array) if (arraySupport != null) { fieldString = arraySupport.toArrayString(array) } static PrimitiveArraySupport.arrayToString() method removed then</technical_language>

Target:
public String toString() { if (fieldString == null && fieldBytes != null) { try { Object array = readBinaryArray(1, 0); final PrimitiveArraySupport arraySupport = PrimitiveArraySupport.getArraySupport(array); if (arraySupport != null) { fieldString = arraySupport.toArrayString(connection.getTypeInfo().getArrayDelimiter(oid), array); } else { java.sql.Array tmpArray = connection.createArrayOf(getBaseTypeName(), (Object[]) array); fieldString = tmpArray.toString(); } } catch (SQLException e) { fieldString = "NULL"; } } return fieldString; }
Source:
<code>public MissingParameterException(String parameterName) { super(ERROR_CODE); <START> this.parameterName = parameterName; <END> }</code><technical_language>requireNonNull</technical_language>

Target:
public MissingParameterException(String parameterName) { super(ERROR_CODE); this.parameterName = requireNonNull(parameterName); }
Source:
<code>public void testRegisterMultipleClusterListener() { reset(); <START> TestClusterListener clusterListener1 = new TestClusterListener(); _state.registerClusterListener(clusterListener1); TestClusterListener clusterListener2 = new TestClusterListener(); _state.registerClusterListener(clusterListener2); _state.listenToCluster(CLUSTER1_CLUSTER_NAME, new NullStateListenerCallback()); _state.listenToCluster(CLUSTER2_CLUSTER_NAME, new NullStateListenerCallback()); _clusterRegistry.put(CLUSTER1_CLUSTER_NAME, new ClusterProperties(CLUSTER1_CLUSTER_NAME)); _clusterRegistry.put(CLUSTER2_CLUSTER_NAME, new ClusterProperties(CLUSTER2_CLUSTER_NAME)); _clusterRegistry.put(CLUSTER2_CLUSTER_NAME, new ClusterProperties(CLUSTER2_CLUSTER_NAME)); assertEquals(clusterListener1.getCount(CLUSTER1_CLUSTER_NAME), 1, "expected 1 call"); assertEquals(clusterListener2.getCount(CLUSTER2_CLUSTER_NAME), 2, "expected 2 call"); <END> }</code><technical_language>add spacing for readability</technical_language>

Target:
public void testRegisterMultipleClusterListener() { reset(); MockClusterListener clusterListener1 = new MockClusterListener(); _state.registerClusterListener(clusterListener1); MockClusterListener clusterListener2 = new MockClusterListener(); _state.registerClusterListener(clusterListener2); _state.listenToCluster(CLUSTER1_CLUSTER_NAME, new NullStateListenerCallback()); _state.listenToCluster(CLUSTER2_CLUSTER_NAME, new NullStateListenerCallback()); _clusterRegistry.put(CLUSTER1_CLUSTER_NAME, new ClusterProperties(CLUSTER1_CLUSTER_NAME)); _clusterRegistry.put(CLUSTER2_CLUSTER_NAME, new ClusterProperties(CLUSTER2_CLUSTER_NAME)); _clusterRegistry.put(CLUSTER2_CLUSTER_NAME, new ClusterProperties(CLUSTER2_CLUSTER_NAME)); assertEquals(clusterListener1.getClusterAddedCount(CLUSTER1_CLUSTER_NAME), 1, "expected 1 call for cluster1"); assertEquals(clusterListener2.getClusterAddedCount(CLUSTER2_CLUSTER_NAME), 2, "expected 2 call for cluster2"); assertEquals(clusterListener1.getClusterAddedCount(CLUSTER2_CLUSTER_NAME), 2, "expected 1 call for cluster2"); assertEquals(clusterListener2.getClusterAddedCount(CLUSTER1_CLUSTER_NAME), 1, "expected 1 call for cluster1"); }
Source:
<code>public void makeBucket(String bucketName, String region) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { Map<String,String> headerMap = new HashMap<>(); String configString; if (region == null || US_EAST_1.equals(region)) { configString = ""; } else { CreateBucketConfiguration config = new CreateBucketConfiguration(region); configString = config.toString(); } <START> executePut(bucketName, null, headerMap, null, US_EAST_1, configString, configString.length()); <END> }</code><technical_language>String.length() != []byte.length. need convert string UTF8 encoded byte array</technical_language>

Target:
public void makeBucket(String bucketName, String region) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { String configString; if (region == null || US_EAST_1.equals(region)) { configString = ""; } else { CreateBucketConfiguration config = new CreateBucketConfiguration(region); configString = config.toString(); } HttpResponse response = executePut(bucketName, null, null, null, US_EAST_1, configString, 0); response.body().close(); }
Source:
<code>public ServiceTest(TOptions options) throws IllegalStateException { super(options); String connectionString = System.getenv("EVENTHUBS_CONNECTION_STRING"); String eventHubName = System.getenv("EVENTHUB_NAME"); if (CoreUtils.isNullOrEmpty(connectionString)) { throw new IllegalStateException("Environment variable EVENTHUBS_CONNECTION_STRING must be set"); } if (CoreUtils.isNullOrEmpty(eventHubName)) { throw new IllegalStateException("Environment variable EVENTHUB_NAME must be set"); } EventHubClientBuilder builder = new EventHubClientBuilder() .connectionString(connectionString, eventHubName); <START> eventHubProducerAsyncClient = builder.buildAsyncProducerClient(); eventHubProducerClient = builder.buildProducerClient(); <END> }</code><technical_language>clients closed? perf test is completed, eventHubProducer*Client.close() called</technical_language>

Target:
public ServiceTest(TOptions options) throws IllegalStateException { super(options); connectionString = System.getenv("EVENTHUBS_CONNECTION_STRING"); eventHubName = System.getenv("EVENTHUB_NAME"); if (CoreUtils.isNullOrEmpty(connectionString)) { throw new IllegalStateException("Environment variable EVENTHUBS_CONNECTION_STRING must be set"); } if (CoreUtils.isNullOrEmpty(eventHubName)) { throw new IllegalStateException("Environment variable EVENTHUB_NAME must be set"); } }
Source:
<code>private FilePath createWindowsStandardAskpass(StandardUsernamePasswordCredentials creds) throws IOException, InterruptedException { FilePath askpass = workspace.createTempFile("pass", ".bat"); askpass.write("@set arg=%~1\n" + "@if (%arg:~0,8%)==(Username) echo " + quoteWindowsCredentials(creds.getUsername()) + "\n" + "@if (%arg:~0,8%)==(Password) echo " + quoteWindowsCredentials(Secret.toString(creds.getPassword())), null); <START> askpass.chmod(0700); <END> return askpass; }</code><technical_language>do expect this do windows :-)</technical_language>

Target:
private FilePath createWindowsStandardAskpass(StandardUsernamePasswordCredentials creds) throws IOException, InterruptedException { FilePath askpass = workspace.createTextTempFile("pass", ".bat", "@set arg=%~1\r\n" + "@if (%arg:~0,8%)==(Username) echo " + quoteWindowsCredentials(creds.getUsername()) + "\r\n" + "@if (%arg:~0,8%)==(Password) echo " + quoteWindowsCredentials(Secret.toString(creds.getPassword())), false); return askpass; }
Source:
<code>public void testNullOperators() throws Exception { DataType<?> type; do { type = randomType(); <START> } while (type == DataTypes.INTERVAL); <END> execute("create table t1 (c " + type.getName() + ") with (number_of_replicas = 0)"); Supplier dataGenerator = DataTypeTesting.getDataGenerator(type); Object[][] bulkArgs = $$($(dataGenerator.get()), $(dataGenerator.get()), new Object[]{null}); execute("insert into t1 (c) values (?)", bulkArgs); execute("refresh table t1"); execute("select count(*) from t1 where c is null"); assertThat(printedTable(response.rows()), is("1\n")); execute("select count(*) from t1 where c is not null"); assertThat(printedTable(response.rows()), is("2\n")); }</code><technical_language>I undestand this change necessary this PR? interval stored new. randomType change in some unrelated way</technical_language>

Target:
public void testNullOperators() throws Exception { DataType<?> type = randomType(); execute("create table t1 (c " + type.getName() + ") with (number_of_replicas = 0)"); Supplier dataGenerator = DataTypeTesting.getDataGenerator(type); Object[][] bulkArgs = $$($(dataGenerator.get()), $(dataGenerator.get()), new Object[]{null}); execute("insert into t1 (c) values (?)", bulkArgs); execute("refresh table t1"); execute("select count(*) from t1 where c is null"); assertThat(printedTable(response.rows()), is("1\n")); execute("select count(*) from t1 where c is not null"); assertThat(printedTable(response.rows()), is("2\n")); }
Source:
<code>protected void executeQueryCommand() { Optional<Network> defRouteNetwork = networkDao <START> .getAllForCluster((getParameters()).getClusterId()).stream() <END> .filter(n -> n.getCluster().isDefaultRoute()) .findFirst(); Optional<NetworkAttachment> attachment = networkAttachmentDao .getAllForHost((getParameters()).getHostId()).stream() .filter(na -> defRouteNetwork.isPresent() && Objects.equals(na.getNetworkId(), defRouteNetwork.get().getId())) .findFirst(); getQueryReturnValue().setReturnValue(attachment.isPresent()); }</code><technical_language>nit: extra parenthesis</technical_language>

Target:
protected void executeQueryCommand() { Optional<Network> defRouteNetwork = networkDao .getAllForCluster(getParameters().getClusterId()).stream() .filter(n -> n.getCluster().isDefaultRoute()) .findFirst(); Optional<NetworkAttachment> attachment = networkAttachmentDao .getAllForHost(getParameters().getHostId()).stream() .filter(na -> defRouteNetwork.isPresent() && Objects.equals(na.getNetworkId(), defRouteNetwork.get().getId())) .findFirst(); getQueryReturnValue().setReturnValue(attachment.isPresent()); }
Source:
<code>public int findCloseOffset(String line, int lineOffset) { if (nestedBlock == null) { <START> return findCloseOffset(line, lineOffset); <END> } return nestedBlock.findCloseOffset(line, lineOffset); }</code><technical_language>This line is untested. this happen? this result in a stack overflow calls parameters</technical_language>

Target:
public int findCloseOffset(String line, int lineOffset) { if (nestedBlock == null) { return super.findCloseOffset(line, lineOffset); } return nestedBlock.findCloseOffset(line, lineOffset); }
Source:
<code>private static JSONArray buildEnumerateResult(final List<String> extensions) throws FalconException { JSONArray results = new JSONArray(); ExtensionMetricStore metricStore = ExtensionStore.get().getMetricStore(); List<ExtensionMetadataBean> beanList = metricStore.getAllExtensions(); for (ExtensionMetadataBean bean : beanList) { JSONObject resultObject = new JSONObject(); try { resultObject.put(EXTENSION_NAME, bean.getExtensionName().toLowerCase()); resultObject.put(EXTENSION_TYPE, bean.getExtensionType()); <START> resultObject.put(EXTENSION_DESC, bean.getDescription()); <END> } catch (JSONException e) { throw new FalconException(e); } results.put(resultObject); } return results; }</code><technical_language>add location enumerate api</technical_language>

Target:
private static JSONArray buildEnumerateResult(final List<String> extensions) throws FalconException { JSONArray results = new JSONArray(); ExtensionMetaStore metricStore = ExtensionStore.get().getMetaStore(); List<ExtensionMetadataBean> beanList = metricStore.getAllExtensions(); for (ExtensionMetadataBean bean : beanList) { JSONObject resultObject = new JSONObject(); try { resultObject.put(EXTENSION_NAME, bean.getExtensionName().toLowerCase()); resultObject.put(EXTENSION_TYPE, bean.getExtensionType()); resultObject.put(EXTENSION_DESC, bean.getDescription()); resultObject.put(EXTENSION_LOCATION, bean.getLocation()); } catch (JSONException e) { throw new FalconException(e); } results.put(resultObject); } return results; }
Source:
<code>public Optional<String> getMqttUri() { String mqttUri = null; try { if (hasMqttConfig()) { mqttUri = config.getJSONObject(NSBarcodeConfigKeys.MQTT_CONFIG).getString(NSBarcodeConfigKeys.MQTT_URI); <START> } else { <END> return Optional.absent(); } } catch (JSONException e) { return Optional.absent(); } return Optional.of(mqttUri); }</code><technical_language>remove this return in catch block, return Optional.fromNullable(mqttUri) line 83</technical_language>

Target:
public Optional<String> getMqttUri() { String mqttUri = null; try { if (hasMqttConfig()) { mqttUri = config.getJSONObject(NSBarcodeConfigKeys.MQTT_CONFIG).getString(NSBarcodeConfigKeys.MQTT_URI); } } catch (JSONException e) { return Optional.fromNullable(mqttUri); } return Optional.of(mqttUri); }
Source:
<code>protected static Iterator<BucketResult> getResultsIterator(@AggregationState PrecisionRecallState state) { if (state.getTrueWeights() == null) { return Collections.<BucketResult>emptyList().iterator(); } <START> final double totalTrueWeight = Streams.stream(state.getTrueWeights().iterator()) <END> .mapToDouble(c -> c.getWeight()) .sum(); final double totalFalseWeight = Streams.stream(state.getFalseWeights().iterator()) .mapToDouble(c -> c.getWeight()) .sum(); return new Iterator<BucketResult>() { Iterator<FixedDoubleHistogram.Bucket> trueIt = state.getTrueWeights().iterator(); Iterator<FixedDoubleHistogram.Bucket> falseIt = state.getFalseWeights().iterator(); double runningFalseWeight; double runningTrueWeight; @Override public boolean hasNext() { return trueIt.hasNext() && totalTrueWeight > runningTrueWeight; } @Override public BucketResult next() { if (!trueIt.hasNext() || !falseIt.hasNext()) { throw new NoSuchElementException(); } final FixedDoubleHistogram.Bucket trueResult = trueIt.next(); final FixedDoubleHistogram.Bucket falseResult = falseIt.next(); final BucketResult result = new BucketResult( trueResult.getLeft(), totalTrueWeight, totalFalseWeight, totalTrueWeight - runningTrueWeight, runningFalseWeight, runningTrueWeight, totalFalseWeight - runningFalseWeight); runningTrueWeight += trueResult.getWeight(); runningFalseWeight += falseResult.getWeight(); return result; } @Override public void remove() { throw new UnsupportedOperationException(); } }; }</code><technical_language>remove final</technical_language>

Target:
protected static Iterator<BucketResult> getResultsIterator(@AggregationState PrecisionRecallState state) { if (state.getTrueWeights() == null) { return Collections.<BucketResult>emptyList().iterator(); } double totalTrueWeight = Streams.stream(state.getTrueWeights().iterator()) .mapToDouble(FixedDoubleHistogram.Bucket::getWeight) .sum(); double totalFalseWeight = Streams.stream(state.getFalseWeights().iterator()) .mapToDouble(FixedDoubleHistogram.Bucket::getWeight) .sum(); return new Iterator<BucketResult>() { Iterator<FixedDoubleHistogram.Bucket> trueIterator = state.getTrueWeights().iterator(); Iterator<FixedDoubleHistogram.Bucket> falseIterator = state.getFalseWeights().iterator(); double runningFalseWeight; double runningTrueWeight; @Override public boolean hasNext() { return trueIterator.hasNext() && totalTrueWeight > runningTrueWeight; } @Override public BucketResult next() { if (!trueIterator.hasNext() || !falseIterator.hasNext()) { throw new NoSuchElementException(); } FixedDoubleHistogram.Bucket trueResult = trueIterator.next(); FixedDoubleHistogram.Bucket falseResult = falseIterator.next(); BucketResult result = new BucketResult( trueResult.getLeft(), totalTrueWeight, totalFalseWeight, totalTrueWeight - runningTrueWeight, runningFalseWeight, runningTrueWeight, totalFalseWeight - runningFalseWeight); runningTrueWeight += trueResult.getWeight(); runningFalseWeight += falseResult.getWeight(); return result; } @Override public void remove() { throw new UnsupportedOperationException(); } }; }
Source:
<code>private VmStatsRefresher getRefresherForVds(VdsManager vdsManager) { Version version = vdsManager.getCompatibilityVersion(); VDS vds = vdsManager.getCopyVds(); if ((FeatureSupported.jsonProtocol(version) && VdsProtocol.STOMP == vds.getProtocol() && FeatureSupported.vmStatsEvents(version)) <START> || <END> (FeatureSupported.jsonProtocol(version) && VdsProtocol.STOMP == vds.getProtocol() && FeatureSupported.events(version))) { return new EventVmStatsRefresher(vdsManager); } return new PollListAndAllVmStatsRefresher(vdsManager); }</code><technical_language>In order able events need flags set true</technical_language>

Target:
private VmStatsRefresher getRefresherForVds(VdsManager vdsManager) { Version version = vdsManager.getCompatibilityVersion(); VDS vds = vdsManager.getCopyVds(); if ((FeatureSupported.jsonProtocol(version) && VdsProtocol.STOMP == vds.getProtocol() && FeatureSupported.vmStatsEvents(version)) && FeatureSupported.events(version)){ return new EventVmStatsRefresher(vdsManager); } return new PollListAndAllVmStatsRefresher(vdsManager); }
Source:
<code>public void getDefaultCredentials_envUser_providesToken() throws IOException { InputStream userStream = UserCredentialsTest.writeUserStream(USER_CLIENT_ID, USER_CLIENT_SECRET, REFRESH_TOKEN); TestDefaultCredentialsProvider testProvider = new TestDefaultCredentialsProvider(); File credentialFile = File.createTempFile("user", ".json"); <START> credentialFile.deleteOnExit(); <END> String userPath = credentialFile.getPath(); testProvider.addFile(userPath, userStream); testProvider.setEnv(DefaultCredentialsProvider.CREDENTIAL_ENV_VAR, userPath); testUserProvidesToken( testProvider, USER_CLIENT_ID, USER_CLIENT_SECRET, REFRESH_TOKEN); }</code><technical_language>Is a reason clean this in a finally block sooner</technical_language>

Target:
public void getDefaultCredentials_envUser_providesToken() throws IOException { InputStream userStream = UserCredentialsTest.writeUserStream(USER_CLIENT_ID, USER_CLIENT_SECRET, REFRESH_TOKEN); TestDefaultCredentialsProvider testProvider = new TestDefaultCredentialsProvider(); String userPath = tempFilePath("user.json"); testProvider.addFile(userPath, userStream); testProvider.setEnv(DefaultCredentialsProvider.CREDENTIAL_ENV_VAR, userPath); testUserProvidesToken( testProvider, USER_CLIENT_ID, USER_CLIENT_SECRET, REFRESH_TOKEN); }
Source:
<code>protected Mediator createSpecificMediator(OMElement elem, Properties properties) { invoker = new InvokeMediator(); processAuditStatus(invoker, elem); OMAttribute targetTemplateAttr = elem.getAttribute(ATT_TARGET); if (targetTemplateAttr != null) { if (StringUtils.isNotEmpty(targetTemplateAttr.getAttributeValue())) { invoker.setTargetTemplate(targetTemplateAttr.getAttributeValue()); buildParameters(elem); } else { String msg = "EIP Invoke mediator should have a non empty target name specified."; log.error(msg); throw new SynapseException(msg); } } else { String msg = "EIP Invoke mediator should have a target template specified."; log.error(msg); throw new SynapseException(msg); } OMAttribute errorHandlerAttr = elem.getAttribute(ATT_ONERROR); if (errorHandlerAttr != null) { <START> if (StringUtils.isNotEmpty(errorHandlerAttr.getAttributeValue())) { <END> invoker.setErrorHandler(errorHandlerAttr.getAttributeValue()); } } addAllCommentChildrenToList(elem, invoker.getCommentsList()); return invoker; }</code><technical_language>combine if conditions save errorHandlerAttr.getAttributeValue() a</technical_language>

Target:
protected Mediator createSpecificMediator(OMElement elem, Properties properties) { invoker = new InvokeMediator(); processAuditStatus(invoker, elem); OMAttribute targetTemplateAttr = elem.getAttribute(ATT_TARGET); if (targetTemplateAttr != null) { if (StringUtils.isNotEmpty(targetTemplateAttr.getAttributeValue())) { invoker.setTargetTemplate(targetTemplateAttr.getAttributeValue()); buildParameters(elem); } else { String msg = "EIP Invoke mediator should have a non empty target name specified."; log.error(msg); throw new SynapseException(msg); } } else { String msg = "EIP Invoke mediator should have a target template specified."; log.error(msg); throw new SynapseException(msg); } OMAttribute errorHandlerAttr = elem.getAttribute(ATT_ONERROR); if ((errorHandlerAttr != null) && (StringUtils.isNotEmpty(errorHandlerAttr.getAttributeValue()))) { invoker.setErrorHandler(errorHandlerAttr.getAttributeValue()); } addAllCommentChildrenToList(elem, invoker.getCommentsList()); return invoker; }
Source:
<code>public void addPartition(String dbName, String tableName, Map <String, String> partSpec) { String key = getKey(normalizeIdentifier(dbName), normalizeIdentifier(tableName)); <START> updateMetaDataList.get(updateMetaDataMap.get(key)).addPartition(partSpec); <END> }</code><technical_language>Safer check if get() returns null call set method</technical_language>

Target:
public void addPartition(String dbName, String tableName, Map <String, String> partSpec) throws SemanticException { if (dbName == null) { throw new SemanticException("db name can not be null"); } String key = getKey(normalizeIdentifier(dbName), normalizeIdentifier(tableName)); Integer idx = updateMetaDataMap.get(key); if (idx == null) { throw new SemanticException("add partition to metadata map failed as list is not yet set for table : " + key); } updateMetaDataList.get(idx).addPartition(partSpec); }
Source:
<code>public static QuantityType<?> operator_multiply(Number x, QuantityType<?> y) { BigDecimal xValue = numberToBigDecimal(x); if (xValue == null) { <START> return new QuantityType<>("0"); <END> } else if (y == null) { return new QuantityType<>("0"); } else { return y.multiply(xValue); } }</code><technical_language>nicer a constructor takes int</technical_language>

Target:
public static QuantityType<?> operator_multiply(Number x, QuantityType<?> y) { BigDecimal xValue = numberToBigDecimal(x); if (xValue == null) { return QuantityType.ZERO; } else if (y == null) { return QuantityType.ZERO; } else { return y.multiply(xValue); } }
Source:
<code>public void addToClasspath(URL u, boolean updateDto) { if (updateDto) classpath.entries.add(u.toExternalForm()); <START> addToClasspath(new URLClassLoader(new URL[] { u })); <END> }</code><technical_language>Do need invalidate previous scan (e.g. isLoaded = false)</technical_language>

Target:
public void addToClasspath(URL u, boolean updateDto) { if (updateDto) classpath.getEntries().add(u.toExternalForm()); addToClasspath(new URLClassLoader(new URL[] { u })); }
Source:
<code><START> public boolean isNUllRow(int[] row, Indexed<String> encodings) <END> { if (row == null) { return true; } for (int i : row) { if (encodings.get(i) != null) { return false; } } return true; }</code><technical_language>this need public</technical_language>

Target:
private boolean isNUllRow(int[] row, Indexed<String> encodings) { if (row == null) { return true; } for (int i : row) { if (encodings.get(i) != null) { return false; } } return true; }
Source:
<code>protected boolean accept(EdgeIteratorState edge, SPTEntry currEdge, boolean reverse) { final int incEdge = getIncomingEdge(currEdge); final int prevOrNextEdgeId = getOrigEdgeId(edge, !reverse); double turnWeight = reverse ? turnWeighting.calcTurnWeight(prevOrNextEdgeId, edge.getBaseNode(), incEdge) : turnWeighting.calcTurnWeight(incEdge, edge.getBaseNode(), prevOrNextEdgeId); <START> if (turnWeight == Double.POSITIVE_INFINITY) { <END> return false; } return additionalEdgeFilter == null || additionalEdgeFilter.accept(edge); }</code><technical_language>This Double.isInfinite(turnWeight) instead (?)</technical_language>

Target:
protected boolean accept(EdgeIteratorState edge, SPTEntry currEdge, boolean reverse) { final int incEdge = getIncomingEdge(currEdge); final int prevOrNextEdgeId = getOrigEdgeId(edge, !reverse); double turnWeight = reverse ? turnWeighting.calcTurnWeight(prevOrNextEdgeId, edge.getBaseNode(), incEdge) : turnWeighting.calcTurnWeight(incEdge, edge.getBaseNode(), prevOrNextEdgeId); if (Double.isInfinite(turnWeight)) { return false; } return additionalEdgeFilter == null || additionalEdgeFilter.accept(edge); }
Source:
<code>private void handleInetSockLocalIn(ITmfEvent event) { Object cpuObj = TmfTraceUtils.resolveEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event); if (cpuObj == null) { throw new NullPointerException(); } Integer cpu = (Integer) cpuObj; String host = event.getTrace().getHostId(); LttngSystemModel system = getProvider().getSystem(); LttngInterruptContext intCtx = system.peekContextStack(host, cpu); Context context = intCtx.getContext(); if (context == Context.SOFTIRQ) { LttngWorker k = getOrCreateKernelWorker(event, cpu); TmfVertex endpoint = stateExtend(k, event.getTimestamp().getValue()); fTcpNodes.put(event, endpoint); <START> fTcpMatching.matchEvent(event, event.getTrace(), new NullProgressMonitor()); <END> } }</code><technical_language>Done. This is OK share instance of progress monitor, is basically empty</technical_language>

Target:
private void handleInetSockLocalIn(ITmfEvent event) { Object cpuObj = TmfTraceUtils.resolveEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event); if (cpuObj == null) { throw new NullPointerException(); } Integer cpu = (Integer) cpuObj; String host = event.getTrace().getHostId(); LttngSystemModel system = getProvider().getSystem(); LttngInterruptContext intCtx = system.peekContextStack(host, cpu); Context context = intCtx.getContext(); if (context == Context.SOFTIRQ) { LttngWorker k = getOrCreateKernelWorker(event, cpu); TmfVertex endpoint = stateExtend(k, event.getTimestamp().getValue()); fTcpNodes.put(event, endpoint); fTcpMatching.matchEvent(event, event.getTrace(), DEFAULT_PROGRESS_MONITOR); } }
Source:
<code>public void onPlayerCrash(EntityDamageEvent e) { if (!(e.getEntity() instanceof Player)) return; if (!(e.getCause() == EntityDamageEvent.DamageCause.FALL || e.getCause() == EntityDamageEvent.DamageCause.FLY_INTO_WALL)) return; Player p = (Player) e.getEntity(); if (p.isGliding()) { <START> ItemStack stack = p.getInventory().getHelmet(); SlimefunItem item = SlimefunItem.getByItem(stack); if (!Slimefun.hasUnlocked(p, item, true)) return; <END> if (item instanceof ProtectiveArmor) { Optional<PlayerProfile> optional = PlayerProfile.find(p); if (!optional.isPresent()) { PlayerProfile.request(p); return; } PlayerProfile profile = optional.get(); if (profile.hasFullProtectionAgainst(ProtectionType.FLYING_INTO_WALL)) { e.setDamage(0); p.playSound(p.getLocation(), Sound.BLOCK_STONE_HIT, 20, 1); if (p.getGameMode() != GameMode.CREATIVE && item instanceof DamageableItem) { ((DamageableItem) item).damageItem(p, stack); } } } } }</code><technical_language>lines moved down, PlayerProfile caches armor too, access item save a ton of performance too</technical_language>

Target:
public void onPlayerCrash(EntityDamageEvent e) { if (!(e.getEntity() instanceof Player)) return; if (!(e.getCause() == EntityDamageEvent.DamageCause.FALL || e.getCause() == EntityDamageEvent.DamageCause.FLY_INTO_WALL)) return; Player p = (Player) e.getEntity(); if (p.isGliding()) { Optional<PlayerProfile> optional = PlayerProfile.find(p); if (!optional.isPresent()) { PlayerProfile.request(p); return; } PlayerProfile profile = optional.get(); HashedArmorpiece helmet = profile.getArmor()[0]; if (helmet.getItem().isPresent()) { SlimefunItem item = helmet.getItem().get(); if (Slimefun.hasUnlocked(p, item, true) && profile.hasFullProtectionAgainst(ProtectionType.FLYING_INTO_WALL)) { e.setDamage(0); p.playSound(p.getLocation(), Sound.BLOCK_STONE_HIT, 20, 1); if (p.getGameMode() != GameMode.CREATIVE && item instanceof DamageableItem) { ((DamageableItem) item).damageItem(p, p.getInventory().getHelmet()); } } } } }
Source:
<code>protected ListenerList<IDebugContextListener> getListeners(IWorkbenchPart part) { String id = null; if (part != null) { id = getCombinedPartId(part); ListenerList<IDebugContextListener> listenerList = fListenersByPartId.get(id); return listenerList != null ? listenerList : new ListenerList<IDebugContextListener>(); } else { ListenerList<IDebugContextListener> listenerList = fListenersByPartId.get(null); ListenerList<IDebugContextListener> retVal = new ListenerList<>(); if (listenerList != null) { for (IDebugContextListener iDebugContextListener : listenerList) { retVal.add(iDebugContextListener); } } outer: for (Iterator<String> itr = fListenersByPartId.keySet().iterator(); itr.hasNext();) { String listenerPartId = itr.next(); for (int i = 0; i < fProviders.size(); i++) { String providerPartId = getCombinedPartId(fProviders.get(i).getPart()); if ((listenerPartId == null && providerPartId == null) || (listenerPartId != null && listenerPartId.equals(providerPartId))) { continue outer; } } for (IDebugContextListener <START> iDebugContextListener : <END> fListenersByPartId.get(listenerPartId)) { if (iDebugContextListener != null) { retVal.add(iDebugContextListener); } } } return retVal; } }</code><technical_language>I get NPE, ? move get out of for run for if output of get is null places</technical_language>

Target:
protected ListenerList<IDebugContextListener> getListeners(IWorkbenchPart part) { String id = null; if (part != null) { id = getCombinedPartId(part); ListenerList<IDebugContextListener> listenerList = fListenersByPartId.get(id); return listenerList != null ? listenerList : new ListenerList<IDebugContextListener>(); } else { ListenerList<IDebugContextListener> listenerList = fListenersByPartId.get(null); ListenerList<IDebugContextListener> retVal = new ListenerList<>(); if (listenerList != null) { for (IDebugContextListener iDebugContextListener : listenerList) { retVal.add(iDebugContextListener); } } outer: for (Iterator<String> itr = fListenersByPartId.keySet().iterator(); itr.hasNext();) { String listenerPartId = itr.next(); for (int i = 0; i < fProviders.size(); i++) { String providerPartId = getCombinedPartId(fProviders.get(i).getPart()); if ((listenerPartId == null && providerPartId == null) || (listenerPartId != null && listenerPartId.equals(providerPartId))) { continue outer; } } ListenerList<IDebugContextListener> listenersForPart = fListenersByPartId.get(listenerPartId); if (listenersForPart != null) { for (IDebugContextListener iDebugContextListener : listenersForPart) { retVal.add(iDebugContextListener); } } } return retVal; } }
Source:
<code>public void init() throws MojoFailureException { try { client = KieServicesFactory.newKieServicesClient(config); } catch (RuntimeException kieEx) { <START> throw new MojoFailureException("error on establish connection with remote server: " + kieEx.getMessage()); <END> } }</code><technical_language>Putting a message original exception lead losing stacktrace - root cause. incorporate MojoFailureException, please</technical_language>

Target:
public void init() throws MojoFailureException { try { client = KieServicesFactory.newKieServicesClient(config); } catch (RuntimeException kieEx) { throw new MojoFailureException("error on establish connection with remote server: " + kieEx.getMessage(), kieEx.getCause()); } }
Source:
<code>public void setPermissionLevel(FolderPermissionLevel value) throws ServiceLocalException { if (this.permissionLevel != value) { if (value == FolderPermissionLevel.Custom) { throw new ServiceLocalException( <START> "The PermissionLevel property can't be set to FolderPermissionLevel.Custom. To define a custom permission, set its individual properties to the values you want."); <END> } this.AssignIndividualPermissions(defaultPermissions.getMember() .get(value)); if (this.canSetFieldValue(this.permissionLevel, value)) { this.permissionLevel = value; this.changed(); } } }</code><technical_language>line-lenght ok</technical_language>

Target:
public void setPermissionLevel(FolderPermissionLevel value) throws ServiceLocalException { if (this.permissionLevel != value) { if (value == FolderPermissionLevel.Custom) { throw new ServiceLocalException( "The PermissionLevel property can't be set to FolderPermissionLevel.Custom. " + "To define a custom permission, set its individual properties to the values you want."); } this.AssignIndividualPermissions(defaultPermissions.getMember() .get(value)); if (this.canSetFieldValue(this.permissionLevel, value)) { this.permissionLevel = value; this.changed(); } } }
Source:
<code>public void shouldRecycleTask() { <START> EasyMock.expectLastCall(); <END> stateManager.flush(); EasyMock.expectLastCall(); stateManager.checkpoint(Collections.emptyMap()); EasyMock.expectLastCall(); stateManager.recycle(); EasyMock.expectLastCall(); EasyMock.expect(stateManager.changelogOffsets()).andReturn(Collections.emptyMap()); EasyMock.replay(stateManager); task = createStandbyTask(); task.initializeIfNeeded(); task.closeAndRecycleState(); EasyMock.verify(stateManager); }</code><technical_language>this lastCall suggest</technical_language>

Target:
public void shouldRecycleTask() { stateManager.flush(); EasyMock.expectLastCall(); stateManager.recycle(); EasyMock.expectLastCall(); EasyMock.replay(stateManager); task = createStandbyTask(); task.initializeIfNeeded(); task.closeAndRecycleState(); EasyMock.verify(stateManager); }
Source:
<code>private void visitTypeDef(DetailAST typeDef) { if (isVerifiable(typeDef)) { <START> checkIdent(typeDef.findFirstToken(TokenTypes.IDENT)); <END> checkTypeParameters(typeDef); final DetailAST extendsClause = typeDef.findFirstToken(TokenTypes.EXTENDS_CLAUSE); if (extendsClause != null) { checkBaseTypes(extendsClause); } final DetailAST implementsClause = typeDef.findFirstToken(TokenTypes.IMPLEMENTS_CLAUSE); if (implementsClause != null) { checkBaseTypes(implementsClause); } } }</code><technical_language>Issue checking extends implements. 2 lines do more that? I content of issue Class name too, issue title agree too. @romani IllegalType extend defined class names too</technical_language>

Target:
private void visitTypeDef(DetailAST typeDef) { if (isVerifiable(typeDef)) { checkTypeParameters(typeDef); final DetailAST extendsClause = typeDef.findFirstToken(TokenTypes.EXTENDS_CLAUSE); if (extendsClause != null) { checkBaseTypes(extendsClause); } final DetailAST implementsClause = typeDef.findFirstToken(TokenTypes.IMPLEMENTS_CLAUSE); if (implementsClause != null) { checkBaseTypes(implementsClause); } } }