auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void updateAccessPoints() { final int wifiState = mWifiManager.getWifiState(); switch (wifiState) { case WifiManager.WIFI_STATE_ENABLED: final Collection<AccessPoint> accessPoints = constructAccessPoints(); getPreferenceScreen().removeAll(); if (mInXlSetupWizard) { ((WifiSettingsForSetupWizardXL)getActivity()).onAccessPointsUpdated( getPreferenceScreen(), accessPoints); } else { if(accessPoints.size() == 0) <START> addMessagePreference(R.string.wifi_empty_list_wifi_on); <END> for (AccessPoint accessPoint : accessPoints) { getPreferenceScreen().addPreference(accessPoint); } } break; case WifiManager.WIFI_STATE_ENABLING: getPreferenceScreen().removeAll(); break; case WifiManager.WIFI_STATE_DISABLING: addMessagePreference(R.string.wifi_stopping); break; case WifiManager.WIFI_STATE_DISABLED: addMessagePreference(R.string.wifi_empty_list_wifi_off); break; } }</code><technical_language>multi-line if statements need braces</technical_language>

Target:
private void updateAccessPoints() { final int wifiState = mWifiManager.getWifiState(); switch (wifiState) { case WifiManager.WIFI_STATE_ENABLED: final Collection<AccessPoint> accessPoints = constructAccessPoints(); getPreferenceScreen().removeAll(); if (mInXlSetupWizard) { ((WifiSettingsForSetupWizardXL)getActivity()).onAccessPointsUpdated( getPreferenceScreen(), accessPoints); } else { if(accessPoints.size() == 0) { addMessagePreference(R.string.wifi_empty_list_wifi_on); } for (AccessPoint accessPoint : accessPoints) { getPreferenceScreen().addPreference(accessPoint); } } break; case WifiManager.WIFI_STATE_ENABLING: getPreferenceScreen().removeAll(); break; case WifiManager.WIFI_STATE_DISABLING: addMessagePreference(R.string.wifi_stopping); break; case WifiManager.WIFI_STATE_DISABLED: addMessagePreference(R.string.wifi_empty_list_wifi_off); break; } }
Source:
<code>public void addMessage(final Message m) { synchronized (lock) { if (m == null) { throw new IllegalArgumentException("Cannot add null message"); } if (isMessageLimitExceeded()) { LOGGER.log(Level.WARNING, "cannot add message to the system, limit of {0} messages exceeded." + <START> "consider setting the ''messageLimit'' tunable.", messageLimit); <END> throw new IllegalStateException("Cannot add message - message limit exceeded"); } if (expirationTimer == null) { expireMessages(); } AcceptedMessage acceptedMessage = new AcceptedMessage(m); addMessage(acceptedMessage); } }</code><technical_language>Odd spacing. more terse "exceeded Configuration messageLimit of {0}"</technical_language>

Target:
public void addMessage(final Message m) { synchronized (lock) { if (m == null) { throw new IllegalArgumentException("Cannot add null message"); } if (isMessageLimitExceeded()) { LOGGER.log(Level.WARNING, "cannot add message to the system, " + "exceeded Configuration messageLimit of {0}", messageLimit); throw new IllegalStateException("Cannot add message - message limit exceeded"); } if (expirationTimer == null) { expireMessages(); } AcceptedMessage acceptedMessage = new AcceptedMessage(m); addMessage(acceptedMessage); } }
Source:
<code>public Map<String, String> getOptions(@NonNull TaskAttribute attribute) { if (attribute.getId().equals(BugzillaRestCreateTaskSchema.getDefault().TARGET_MILESTONE.getKey()) || attribute.getId().equals(BugzillaRestCreateTaskSchema.getDefault().VERSION.getKey()) || attribute.getId().equals(BugzillaRestCreateTaskSchema.getDefault().COMPONENT.getKey())) { TaskAttribute productAttribute = attribute.getParentAttribute() .getAttribute(BugzillaRestCreateTaskSchema.getDefault().PRODUCT.getKey()); BugzillaRestConfiguration repositoryConfiguration; try { repositoryConfiguration = connector.getRepositoryConfiguration(this.getTaskRepository()); Product actualProduct = repositoryConfiguration.getProductWithName(productAttribute.getValue()); if (attribute.getId().equals(BugzillaRestCreateTaskSchema.getDefault().TARGET_MILESTONE.getKey())) { <START> internalSetAttributeOptions(attribute, actualProduct.getMilestones()); <END> } else if (attribute.getId().equals(BugzillaRestCreateTaskSchema.getDefault().VERSION.getKey())) { internalSetAttributeOptions(attribute, actualProduct.getVersions()); } else if (attribute.getId().equals(BugzillaRestCreateTaskSchema.getDefault().COMPONENT.getKey())) { internalSetAttributeOptions(attribute, actualProduct.getComponents()); } } catch (CoreException e) { StatusHandler.log(new RepositoryStatus(getTaskRepository(), IStatus.ERROR, BugzillaRestCore.ID_PLUGIN, 0, "Failed to obtain repository configuration", e)); } } return super.getOptions(attribute); }</code><technical_language>I return options set attribute</technical_language>

Target:
public Map<String, String> getOptions(@NonNull TaskAttribute attribute) { if (attribute.getId().equals(BugzillaRestCreateTaskSchema.getDefault().TARGET_MILESTONE.getKey()) || attribute.getId().equals(BugzillaRestCreateTaskSchema.getDefault().VERSION.getKey()) || attribute.getId().equals(BugzillaRestCreateTaskSchema.getDefault().COMPONENT.getKey())) { TaskAttribute productAttribute = attribute.getParentAttribute() .getAttribute(BugzillaRestCreateTaskSchema.getDefault().PRODUCT.getKey()); BugzillaRestConfiguration repositoryConfiguration; try { repositoryConfiguration = connector.getRepositoryConfiguration(this.getTaskRepository()); if (!productAttribute.getValue().equals("")) { Product actualProduct = repositoryConfiguration.getProductWithName(productAttribute.getValue()); if (attribute.getId().equals(BugzillaRestCreateTaskSchema.getDefault().TARGET_MILESTONE.getKey())) { internalSetAttributeOptions(attribute, actualProduct.getMilestones()); } else if (attribute.getId().equals(BugzillaRestCreateTaskSchema.getDefault().VERSION.getKey())) { internalSetAttributeOptions(attribute, actualProduct.getVersions()); } else if (attribute.getId().equals(BugzillaRestCreateTaskSchema.getDefault().COMPONENT.getKey())) { internalSetAttributeOptions(attribute, actualProduct.getComponents()); } } } catch (CoreException e) { StatusHandler.log(new RepositoryStatus(getTaskRepository(), IStatus.ERROR, BugzillaRestCore.ID_PLUGIN, 0, "Failed to obtain repository configuration", e)); } } return super.getOptions(attribute); }
Source:
<code>public void testConsumerAlreadyExists() throws Exception { final CompletableFuture<DescribeStreamSummaryResponse> dssFuture = CompletableFuture .completedFuture(createDescribeStreamSummaryResponse()); final CompletableFuture<DescribeStreamConsumerResponse> dscFuture = CompletableFuture .completedFuture(createDescribeStreamConsumerResponse(ConsumerStatus.ACTIVE)); when(client.describeStreamSummary(any(DescribeStreamSummaryRequest.class))).thenReturn(dssFuture); when(client.describeStreamConsumer(any(DescribeStreamConsumerRequest.class))).thenReturn(dscFuture); final String consumerArn = consumerRegistration.getOrCreateStreamConsumerArn(); assertThat(consumerArn, equalTo(CONSUMER_ARN)); verify(client, times(2)).describeStreamConsumer(any(DescribeStreamConsumerRequest.class)); <START> verify(client).describeStreamSummary(any(DescribeStreamSummaryRequest.class)); <END> verify(client, never()).registerStreamConsumer(any(RegisterStreamConsumerRequest.class)); }</code><technical_language>This falls "Test behavior, implementation" matter calling describeStreamConsumer, is verifying register existing consumer behavior confirm</technical_language>

Target:
public void testConsumerAlreadyExists() throws Exception { final CompletableFuture<DescribeStreamSummaryResponse> dssFuture = CompletableFuture .completedFuture(createDescribeStreamSummaryResponse()); final CompletableFuture<DescribeStreamConsumerResponse> dscFuture = CompletableFuture .completedFuture(createDescribeStreamConsumerResponse(ConsumerStatus.ACTIVE)); when(client.describeStreamSummary(any(DescribeStreamSummaryRequest.class))).thenReturn(dssFuture); when(client.describeStreamConsumer(any(DescribeStreamConsumerRequest.class))).thenReturn(dscFuture); final String consumerArn = consumerRegistration.getOrCreateStreamConsumerArn(); assertThat(consumerArn, equalTo(CONSUMER_ARN)); verify(client, never()).registerStreamConsumer(any(RegisterStreamConsumerRequest.class)); }
Source:
<code>private static void compareJson(LinkedList<String> arguments) throws IOException { String oldJsonPath = arguments.pollFirst(); String newJsonPath = arguments.pollFirst(); File oldJsonFile = new File(oldJsonPath); checkExist(oldJsonFile); File newJsonFile = new File(newJsonPath); checkExist(newJsonFile); ObjectMapper mapper = new ObjectMapper(); ThriftType.StructType oldStruct = mapper.readValue(oldJsonFile, ThriftType.StructType.class); ThriftType.StructType newStruct = mapper.readValue(newJsonFile, ThriftType.StructType.class); CompatibilityReport report = new CompatibilityChecker().checkCompatibility(oldStruct, newStruct); if (!report.isCompatible) { System.err.println("schema not compatible"); System.err.println(report.getMessages()); System.exit(1); } <START> if (!report.hasEmptyStruct()) { <END> System.err.println("schema contains empty struct"); System.err.println(report.getMessages()); System.exit(1); } System.out.println("[success] schema is compatible"); }</code><technical_language>this backwards? if (report.hasEmptyStruct())</technical_language>

Target:
private static void compareJson(LinkedList<String> arguments) throws IOException { String oldJsonPath = arguments.pollFirst(); String newJsonPath = arguments.pollFirst(); File oldJsonFile = new File(oldJsonPath); checkExist(oldJsonFile); File newJsonFile = new File(newJsonPath); checkExist(newJsonFile); ObjectMapper mapper = new ObjectMapper(); ThriftType.StructType oldStruct = mapper.readValue(oldJsonFile, ThriftType.StructType.class); ThriftType.StructType newStruct = mapper.readValue(newJsonFile, ThriftType.StructType.class); CompatibilityReport report = new CompatibilityChecker().checkCompatibility(oldStruct, newStruct); if (!report.isCompatible) { System.err.println("schema not compatible"); System.err.println(report.getMessages()); System.exit(1); } if (report.hasEmptyStruct()) { System.err.println("schema contains empty struct"); System.err.println(report.getMessages()); System.exit(1); } System.out.println("[success] schema is compatible"); }
Source:
<code>public void updateContents() { errorView.setVisibility(View.GONE); containerView.setVisibility(summary == null ? View.GONE : View.VISIBLE); progressBar.setVisibility(summary == null ? View.VISIBLE : View.GONE); if (summary == null) { return; } articleTitleView.setText(summary.getNormalizedTitle()); articleSubtitleView.setText(null); extractView.setText(StringUtil.fromHtml(summary.getExtractHtml())); ViewTreeObserver observer = extractView.getViewTreeObserver(); observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { if (!isAdded() || extractView == null) { return; } int maxLines = extractView.getHeight() / extractView.getLineHeight() - 1; final int minLines = 3; extractView.setMaxLines(Math.max(maxLines, minLines)); extractView.getViewTreeObserver().removeOnGlobalLayoutListener(this); } }); imageView.loadImage(TextUtils.isEmpty(summary.getThumbnailUrl()) ? null : Uri.parse((WikipediaApp.getInstance().isTablet() <START> ? ImageUrlUtil.getUrlForPreferredSize(summary.getThumbnailUrl(), PREFERRED_TABLET_THUMBNAIL_SIZE) <END> : summary.getThumbnailUrl()))); }</code><technical_language>reason 800dp in cases? image kind of pixelated phone displays, too..</technical_language>

Target:
public void updateContents() { errorView.setVisibility(View.GONE); containerView.setVisibility(summary == null ? View.GONE : View.VISIBLE); progressBar.setVisibility(summary == null ? View.VISIBLE : View.GONE); if (summary == null) { return; } articleTitleView.setText(summary.getNormalizedTitle()); articleSubtitleView.setText(null); extractView.setText(StringUtil.fromHtml(summary.getExtractHtml())); ViewTreeObserver observer = extractView.getViewTreeObserver(); observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { if (!isAdded() || extractView == null) { return; } int maxLines = extractView.getHeight() / extractView.getLineHeight() - 1; final int minLines = 3; extractView.setMaxLines(Math.max(maxLines, minLines)); extractView.getViewTreeObserver().removeOnGlobalLayoutListener(this); } }); imageView.loadImage(TextUtils.isEmpty(summary.getThumbnailUrl()) ? null : Uri.parse(ImageUrlUtil.getUrlForPreferredSize(summary.getThumbnailUrl(), PREFERRED_CARD_THUMBNAIL_SIZE))); }
Source:
<code>public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { return; } refWatcher = installLeakCanary(); <START> context = this; <END> SettingsActivity.initSettings(this); NewPipe.init(getDownloader()); StateSaver.init(this); initNotificationChannel(); ImageLoader.getInstance().init(getImageLoaderConfigurations(10, 50)); configureRxJavaErrorHandler(); new CheckForNewAppVersionTask().execute(); }</code><technical_language>Call this app of type Context</technical_language>

Target:
public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { return; } refWatcher = installLeakCanary(); app = this; SettingsActivity.initSettings(this); NewPipe.init(getDownloader(), org.schabi.newpipe.util.Localization.getPreferredExtractorLocal(this)); StateSaver.init(this); initNotificationChannel(); ImageLoader.getInstance().init(getImageLoaderConfigurations(10, 50)); configureRxJavaErrorHandler(); new CheckForNewAppVersionTask().execute(); }
Source:
<code>public int getVersion() { <START> return Helper.staticHashCode(toString()); <END> }</code><technical_language>Hmm toString includes hints (which is good/required for custom weighting), PMap (unordered) HashMap, this wrong? LinkedHashMap in PMap? implement some method returns string in a deterministic way</technical_language>

Target:
public int getVersion() { return Helper.staticHashCode(createContentString()); }
Source:
<code>public DailyJobSun(String thingUID, AstroThingHandler handler) { <START> checkNotNull(thingUID, "Thing UID cannot be null"); <END> checkNotNull(handler, "AstroThingHandler instance cannot be null"); this.thingUID = thingUID; this.handler = handler; }</code><technical_language>Please change a normal null check throw a IllegalArgumentException. This is more meaningful throwing NPE here</technical_language>

Target:
public DailyJobSun(String thingUID, AstroThingHandler handler) { checkArgument(thingUID != null, "Thing UID cannot be null"); checkArgument(handler != null, "AstroThingHandler instance cannot be null"); this.thingUID = thingUID; this.handler = handler; }
Source:
<code>public AlgorithmParameterSpec getEncryptionParameterSpec(final byte[] iv, final long position) { Validate.notNull(iv, "Initialization vector must not be null"); Validate.isTrue(iv.length == getIVLengthInBytes(), "Initialization vector has the wrong byte count [%d] " + "expected [%d] bytes", iv.length, getIVLengthInBytes()); final int ivLength = getIVLengthInBytes(); final int blockSize = getBlockSizeInBytes(); final long startingBlock = position / blockSize; byte[] startingBlockArray = ByteBuffer.allocate(ivLength).putLong(8, startingBlock).array(); byte[] updatedIV = new byte[ivLength]; int carry = 0; for (int ivIndex = ivLength - 1; ivIndex >= 0; ivIndex--) { int newIVByteAsInt = ((int)iv[ivIndex] & 0xff) + ((int)startingBlockArray[ivIndex] & 0xff) + carry; byte newIVByte = (byte) newIVByteAsInt; carry = newIVByteAsInt >>> 8; <START> updatedIV[ivIndex] = (byte)newIVByte; <END> } return new IvParameterSpec(updatedIV); }</code><technical_language>Redundant cast</technical_language>

Target:
public AlgorithmParameterSpec getEncryptionParameterSpec(final byte[] iv, final long position) { Validate.notNull(iv, "Initialization vector must not be null"); Validate.isTrue(iv.length == getIVLengthInBytes(), "Initialization vector has the wrong byte count [%d] " + "expected [%d] bytes", iv.length, getIVLengthInBytes()); final int ivLength = getIVLengthInBytes(); final int blockSize = getBlockSizeInBytes(); final long startingBlock = position / blockSize; byte[] startingBlockArray = ByteBuffer.allocate(ivLength).putLong(8, startingBlock).array(); byte[] updatedIV = new byte[ivLength]; int carry = 0; for (int ivIndex = ivLength - 1; ivIndex >= 0; ivIndex--) { int newIVByteAsInt = ((int)iv[ivIndex] & 0xff) + ((int)startingBlockArray[ivIndex] & 0xff) + carry; carry = newIVByteAsInt >>> 8; byte newIVByte = (byte) newIVByteAsInt; updatedIV[ivIndex] = newIVByte; } return new IvParameterSpec(updatedIV); }
Source:
<code><START> public long getFileSize() { <END> String uriString = s3Uri.toString(); String removedScheme = uriString.substring(5); String bucket = removedScheme.substring(0, removedScheme.indexOf('/')); String key = removedScheme.substring(removedScheme.indexOf('/') + 1); initializeClient(); return s3Client.getObjectMetadata(bucket, key).getContentLength(); }</code><technical_language>this method is expensive, called multiple times (in constructor clients), a lazy getter</technical_language>

Target:
public Long getFileSize() { if (fileSize == null) { fileSize = getS3Client().getObjectMetadata(bucket, key).getContentLength(); } return fileSize; }
Source:
<code>public KafkaFuture<Void> partitionResult(final TopicPartition partition) { final KafkaFutureImpl<Void> result = new KafkaFutureImpl<>(); this.future.whenComplete((topicPartitions, throwable) -> { if (throwable != null) { result.completeExceptionally(throwable); } else { <START> Throwable exception = KafkaAdminClient.getSubLevelError(topicPartitions, partition, <END> "Group offset deletion for partition \"" + partition + "\" was not attempted"); if (exception != null) { result.completeExceptionally(exception); } else { result.complete(null); } } }); return result; }</code><technical_language>nit: extract this method extract message in a constant avoid duplicating bellow</technical_language>

Target:
public KafkaFuture<Void> partitionResult(final TopicPartition partition) { if (!partitions.contains(partition)) { throw new IllegalArgumentException("Partition " + partition + " was not included in the original request"); } final KafkaFutureImpl<Void> result = new KafkaFutureImpl<>(); this.future.whenComplete((topicPartitions, throwable) -> { if (throwable != null) { result.completeExceptionally(throwable); } else if (!maybeCompleteExceptionally(topicPartitions, partition, result)) { result.complete(null); } }); return result; }
Source:
<code>public void testParticipantObjectId() { String oid = PRPAIN201305UV02Parser.getQueryId(request); <START> assertEquals("QueryId mismatch", TestPatientDiscoveryMessageHelper.QUERY_ID_EXTENSION, oid); <END> }</code><technical_language>Consider removing "oid" variable, (function call) in-line</technical_language>

Target:
public void testParticipantObjectId() { assertEquals("QueryId mismatch", "abd3453dcd24wkkks545", PRPAIN201305UV02Parser.getQueryId( TestPatientDiscoveryMessageHelper.createPRPAIN201305UV02Request("Gallow", "Younger", "M", "01-12-2967", "1.1", "D12345", "2.2", "abd3453dcd24wkkks545"))); }
Source:
<code>protected void setTimeZone(char timeZoneFlag, char t0, char t1, char t3, char t4) { int timeZoneOffset = ((t0 - '0') * 10 + (t1 - '0')) * 3600 * 1000; timeZoneOffset += ((t3 - '0') * 10 + (t4 - '0')) * 60 * 1000; if (timeZoneFlag == '-') { timeZoneOffset = -timeZoneOffset; } if (calendar.getTimeZone().getRawOffset() != timeZoneOffset) { <START> calendar.setTimeZone(new SimpleTimeZone(timeZoneOffset, "" + timeZoneOffset)); <END> } }</code><technical_language>calendar.setTimeZone(new SimpleTimeZone(timeZoneOffset, Integer.toString(timeZoneOffset))); ======== string concat</technical_language>

Target:
protected void setTimeZone(char timeZoneFlag, char t0, char t1, char t3, char t4) { int timeZoneOffset = ((t0 - '0') * 10 + (t1 - '0')) * 3600 * 1000; timeZoneOffset += ((t3 - '0') * 10 + (t4 - '0')) * 60 * 1000; if (timeZoneFlag == '-') { timeZoneOffset = -timeZoneOffset; } if (calendar.getTimeZone().getRawOffset() != timeZoneOffset) { calendar.setTimeZone(new SimpleTimeZone(timeZoneOffset, Integer.toString(timeZoneOffset))); } }
Source:
<code>@Override @Nullable public Column loadColumn(int chunkX, int chunkZ) throws IOException { NBTTagCompound nbt; SaveEntry<EntryLocation2D> saveEntry; if ((saveEntry = columnsToSave.get(new ChunkPos(chunkX, chunkZ))) != null) { nbt = saveEntry.nbt; } else { Optional<ByteBuffer> buf = this.save.load(new EntryLocation2D(chunkX, chunkZ)); if (!buf.isPresent()) { return null; } <START> nbt = this.dataFixer.process(FixTypes.CHUNK, CompressedStreamTools.readCompressed(new ByteArrayInputStream(buf.get().array()))); <END> } return IONbtReader.readColumn(world, chunkX, chunkZ, nbt); }</code><technical_language>~~Not needed for columns~~</technical_language>

Target:
@Override @Nullable public Column loadColumn(int chunkX, int chunkZ) throws IOException { NBTTagCompound nbt; SaveEntry<EntryLocation2D> saveEntry; if ((saveEntry = columnsToSave.get(new ChunkPos(chunkX, chunkZ))) != null) { nbt = saveEntry.nbt; } else { Optional<ByteBuffer> buf = this.save.load(new EntryLocation2D(chunkX, chunkZ)); if (!buf.isPresent()) { return null; } nbt = FMLCommonHandler.instance().getDataFixer().process(FixTypes.CHUNK, CompressedStreamTools.readCompressed(new ByteArrayInputStream(buf.get().array()))); } return IONbtReader.readColumn(world, chunkX, chunkZ, nbt); }
Source:
<code>public void setParentIds(ObjectId... newParents) { parentIds = new ObjectId[newParents.length]; int newParentCount = 0; for (int i = 0; i < newParents.length; i++) { for (int j = 0; j < newParentCount; j++) if (parentIds[j].equals(newParents[i])) throw new IllegalArgumentException(MessageFormat.format( JGitText.get().duplicateParents, parentIds[j].getName())); parentIds[newParentCount++] = newParents[i].copy(); } if (newParentCount == parentIds.length) return; ObjectId[] tmpIds = new ObjectId[newParentCount]; System.arraycopy(parentIds, 0, tmpIds, 0, newParentCount); <START> parentIds = tmpIds; <END> }</code><technical_language>lines, I do understand. newParentCount is newParents.length, throw exception. a good idea, however, safe, if throw exception, parentId's changed. In this patch wind a partially initialized parentIds array</technical_language>

Target:
public void setParentIds(ObjectId... newParents) { ObjectId[] tmpIds = new ObjectId[newParents.length]; int newParentCount = 0; for (int i = 0; i < newParents.length; i++) { for (int j = 0; j < newParentCount; j++) if (tmpIds[j].equals(newParents[i])) throw new IllegalArgumentException(MessageFormat.format( JGitText.get().duplicateParents, tmpIds[j].getName())); tmpIds[newParentCount++] = newParents[i].copy(); } parentIds = tmpIds; }
Source:
<code>public void failIfUnknownSetting() throws Exception { try { db.execute( "CALL dbms.setConfigValue('unknown.setting.indeed', 'foo')" ); } catch ( Exception e ) { Throwable cause = Exceptions.rootCause( e ); assertThat( cause, instanceOf( IllegalArgumentException.class ) ); assertThat( cause.getMessage(), equalTo( "Unknown setting: unknown.setting.indeed" ) ); return; } <START> fail( "Should throw IllegalArgumentException" ); <END> }</code><technical_language>fail of try block instead db.execute do need return statement catch block; ExpectedException rule</technical_language>

Target:
public void failIfUnknownSetting() throws Exception { expect.expect( new NestedThrowableMatcher( IllegalArgumentException.class ) ); expect.expectMessage( "Unknown setting: unknown.setting.indeed" ); db.execute( "CALL dbms.setConfigValue('unknown.setting.indeed', 'foo')" ); }
Source:
<code>public void vmTypeChanged(VmType vmType) { if (getModel().getProvisioning().getIsAvailable()) { getModel().getProvisioning().setEntity(vmType == VmType.Server || vmType == VmType.HighPerformance); } if (getModel().getIoThreadsEnabled().getIsAvailable()) { getModel().getIoThreadsEnabled().setEntity(vmType == VmType.Server || vmType == VmType.HighPerformance); <START> } <END> super.vmTypeChanged(vmType); }</code><technical_language>in VmModelBaseBehavior#vmTypeChanged</technical_language>

Target:
public void vmTypeChanged(VmType vmType) { if (getModel().getProvisioning().getIsAvailable()) { getModel().getProvisioning().setEntity(vmType == VmType.Server || vmType == VmType.HighPerformance); } super.vmTypeChanged(vmType); }
Source:
<code>public void scheduleHealthCheck() { <START> zookeeperClientManager.getClients().forEach(client -> client.ensurePathExists(healthCheckPath)); <END> executorService.scheduleAtFixedRate(healthCheckTask, 0, period, TimeUnit.SECONDS); }</code><technical_language>if this ensure fails of clients</technical_language>

Target:
public void scheduleHealthCheck() { logger.info("Starting the storage health check scheduler"); executorService.scheduleAtFixedRate(healthCheckTask, 0, period, TimeUnit.SECONDS); }
Source:
<code>String mesosMasterAddress() { try (CuratorFramework cf = zkClient()) { cf.start(); List<String> children = cf.getChildren().forPath("/mesos"); List<Integer> masterIDList= new ArrayList<Integer>(); if (children.isEmpty()) { return null; } JSONObject cfData = null; for (String child : children) { if (child.startsWith("json.info")) { <START> masterIDList.add(Integer.parseInt(child.split("_")[1])); <END> } } Collections.sort(masterIDList); for (String child : children) { if (child.endsWith(String.valueOf(masterIDList.get(0)))) { cfData = new JSONObject(new String(cf.getData().forPath("/mesos/" + child))); break; } } if (cfData != null) { JSONObject address = cfData.getJSONObject("address"); return String.format("%s:%d", address.getString("ip"), address.getInt("port")); } } catch (Exception e) { LOGGER.error("Error while obtaining a mesos address from the curator framework: ", e); } return null; }</code><technical_language>get string child.split("_")[1], parse Integer, parse String String.valueOf(masterIDList.get(0)). why</technical_language>

Target:
String mesosMasterAddress() { try (CuratorFramework cf = zkClient()) { cf.start(); List<String> children = cf.getChildren().forPath("/mesos"); List<Integer> masterIds= new ArrayList<Integer>(); if (children.isEmpty()) { return null; } JSONObject cfData = null; for (String child : children) { if (child.startsWith("json.info")) { masterIds.add(Integer.parseInt(child.split("_")[1])); } } Collections.sort(masterIds); for (String child : children) { if (child.endsWith(String.valueOf(masterIds.get(0)))) { cfData = new JSONObject(new String(cf.getData().forPath("/mesos/" + child))); break; } } if (cfData != null) { JSONObject address = cfData.getJSONObject("address"); return String.format("%s:%d", address.getString("ip"), address.getInt("port")); } } catch (Exception e) { LOGGER.error("Error while obtaining a mesos address from the curator framework: ", e); } return null; }
Source:
<code><START> public static Class getJavaType(int sqlType) { <END> switch (sqlType) { case Types.CHAR: case Types.VARCHAR: case Types.LONGVARCHAR: return String.class; case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY: return byte[].class; case Types.BIT: return Boolean.class; case Types.TINYINT: case Types.SMALLINT: return Short.class; case Types.INTEGER: return Integer.class; case Types.BIGINT: return Long.class; case Types.REAL: return Float.class; case Types.DOUBLE: case Types.FLOAT: return Double.class; case Types.DATE: return Date.class; case Types.TIME: return Time.class; case Types.TIMESTAMP: return Timestamp.class; default: throw new RuntimeException("We do not support tables with SqlType: " + getSqlTypeName(sqlType)); } }</code><technical_language>add some docs this method</technical_language>

Target:
public static Class getJavaType(int sqlType) { switch (sqlType) { case Types.CHAR: case Types.VARCHAR: case Types.LONGVARCHAR: case Types.CLOB: return String.class; case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY: return byte[].class; case Types.BIT: return Boolean.class; case Types.TINYINT: case Types.SMALLINT: return Short.class; case Types.INTEGER: return Integer.class; case Types.BIGINT: return Long.class; case Types.REAL: return Float.class; case Types.DOUBLE: case Types.FLOAT: return Double.class; case Types.DATE: return Date.class; case Types.TIME: return Time.class; case Types.TIMESTAMP: return Timestamp.class; default: throw new RuntimeException("We do not support tables with SqlType: " + getSqlTypeName(sqlType)); } }
Source:
<code>public Map toMap () { <START> ObjectMapper mapper = new ObjectMapper(); <END> String uiSpecification; try { uiSpecification = mapper.writeValueAsString(serviceUISpecification); } catch (JsonProcessingException e) { throw new RuntimeException(e); } Map<String, Object> map = new HashMap<String, Object>(); map.put(ID, id); map.put(NAME, name); map.put(TIMESTAMP, timestamp); map.put(UI_SPECIFICATION, uiSpecification); map.put(REGISTER_CLASS, registerClass); return map; }</code><technical_language>this able reused. a static field</technical_language>

Target:
public Map toMap () { String uiSpecification; try { uiSpecification = mapper.writeValueAsString(serviceUISpecification); } catch (JsonProcessingException e) { throw new RuntimeException(e); } Map<String, Object> map = new HashMap<String, Object>(); map.put(ID, id); map.put(NAME, name); map.put(TIMESTAMP, timestamp); map.put(UI_SPECIFICATION, uiSpecification); map.put(REGISTER_CLASS, registerClass); return map; }
Source:
<code>private StreamingResponse _findAndStream(FindRequest req,OperationContext ctx) { StreamingResponse response = new StreamingResponse(factory.getNodeFactory()); response.setStatus(OperationStatus.ERROR); response.setEntity(ctx.getTopLevelEntityName(),ctx.getTopLevelEntityVersion()); CompositeMetadata md = ctx.getTopLevelEntityMetadata(); if (!md.getAccess().getFind().hasAccess(ctx.getCallerRoles())) { ctx.setStatus(OperationStatus.ERROR); LOGGER.debug("No access"); ctx.addError(Error.get(CrudConstants.ERR_NO_ACCESS, "find " + ctx.getTopLevelEntityName())); } else if (checkQueryAccess(ctx, req.getQuery())) { factory.getInterceptors().callInterceptors(InterceptPoint.PRE_MEDIATOR_FIND, ctx); Finder finder; if (ctx.isSimple()) { LOGGER.debug("Simple entity"); finder = new SimpleFindImpl(md, factory); } else { LOGGER.debug("Composite entity"); finder = new CompositeFindImpl(md); <START> ((CompositeFindImpl) finder).setParallelism(9); <END> } ctx.measure.begin("finder.find"); CRUDFindResponse result = finder.find(ctx, req.getCRUDFindRequest()); ctx.measure.end("finder.find"); if(!ctx.hasErrors()) { ctx.setStatus(OperationStatus.COMPLETE); response.documentStream=ctx.getDocumentStream(); if(ctx.isComputeMatchCount()) { response.matchCount=result.getSize(); } } else { ctx.setStatus(OperationStatus.ERROR); } } response.setStatus(ctx.getStatus()); response.getErrors().addAll(ctx.getErrors()); return response; }</code><technical_language>this configurable</technical_language>

Target:
private StreamingResponse _findAndStream(FindRequest req,OperationContext ctx) { StreamingResponse response = new StreamingResponse(factory.getNodeFactory()); response.setStatus(OperationStatus.ERROR); response.setEntity(ctx.getTopLevelEntityName(),ctx.getTopLevelEntityVersion()); CompositeMetadata md = ctx.getTopLevelEntityMetadata(); if (!md.getAccess().getFind().hasAccess(ctx.getCallerRoles())) { ctx.setStatus(OperationStatus.ERROR); LOGGER.debug("No access"); ctx.addError(Error.get(CrudConstants.ERR_NO_ACCESS, "find " + ctx.getTopLevelEntityName())); } else if (checkQueryAccess(ctx, req.getQuery())) { factory.getInterceptors().callInterceptors(InterceptPoint.PRE_MEDIATOR_FIND, ctx); Finder finder; if (ctx.isSimple()) { LOGGER.debug("Simple entity"); finder = new SimpleFindImpl(md, factory); } else { LOGGER.debug("Composite entity"); finder = new CompositeFindImpl(md); ((CompositeFindImpl) finder).setParallelism(9); } ctx.measure.begin("finder.find"); CRUDFindResponse result = finder.find(ctx, req.getCRUDFindRequest()); ctx.measure.end("finder.find"); if(!ctx.hasErrors()) { ctx.setStatus(OperationStatus.COMPLETE); response.documentStream=ctx.getDocumentStream(); if(ctx.isComputeCounts()) { response.matchCount=result.getSize(); } } else { ctx.setStatus(OperationStatus.ERROR); } } response.setStatus(ctx.getStatus()); response.getErrors().addAll(ctx.getErrors()); return response; }
Source:
<code>@Override public boolean process(Set<? extends TypeElement> elements, RoundEnvironment env) { Map<TypeElement, ExtraInjector> targetClassMap = findAndParseTargets(env); for (Map.Entry<TypeElement, ExtraInjector> entry : targetClassMap.entrySet()) { TypeElement typeElement = entry.getKey(); ExtraInjector extraInjector = entry.getValue(); try { JavaFileObject jfo = filer.createSourceFile(extraInjector.getFqcn(), typeElement); Writer writer = jfo.openWriter(); writer.write(extraInjector.brewJava()); writer.flush(); writer.close(); } catch (IOException e) { error(typeElement, "Unable to write injector for type %s: %s", typeElement, e.getMessage()); } try { IntentBuilder intentBuilder = new IntentBuilder(extraInjector.getClassPackage(), typeElement.getSimpleName()+INTENT_BUILDER_SUFFIX, extraInjector.getTargetClass(), extraInjector.getInjectionMap()); JavaFileObject jfo = filer.createSourceFile(intentBuilder.getFqcn(), typeElement); Writer writer = jfo.openWriter(); writer.write(intentBuilder.brewJava()); <START> writer.flush(); <END> writer.close(); } catch (IOException e) { error(typeElement, "Unable to write intent builder for type %s: %s", typeElement, e.getMessage()); } } return true; }</code><technical_language>this is pattern a writer: close finally block. close flushes</technical_language>

Target:
@Override public boolean process(Set<? extends TypeElement> elements, RoundEnvironment env) { Map<TypeElement, ExtraInjector> targetClassMap = findAndParseTargets(env); for (Map.Entry<TypeElement, ExtraInjector> entry : targetClassMap.entrySet()) { TypeElement typeElement = entry.getKey(); ExtraInjector extraInjector = entry.getValue(); Writer writer = null; try { JavaFileObject jfo = filer.createSourceFile(extraInjector.getFqcn(), typeElement); writer = jfo.openWriter(); writer.write(extraInjector.brewJava()); } catch (IOException e) { error(typeElement, "Unable to write injector for type %s: %s", typeElement, e.getMessage()); } finally { if (writer != null) { try { writer.close(); } catch (IOException e) { error(typeElement, "Unable to close injector source file for type %s: %s", typeElement, e.getMessage()); } } } Writer writer2 = null; try { IntentBuilder intentBuilder = new IntentBuilder(extraInjector.getClassPackage(), typeElement.getSimpleName() + INTENT_BUILDER_SUFFIX, extraInjector.getTargetClass(), extraInjector.getInjectionMap()); JavaFileObject jfo = filer.createSourceFile(intentBuilder.getFqcn(), typeElement); writer2 = jfo.openWriter(); writer2.write(intentBuilder.brewJava()); } catch (IOException e) { error(typeElement, "Unable to write intent builder for type %s: %s", typeElement, e.getMessage()); } finally { if (writer2 != null) { try { writer2.close(); } catch (IOException e) { error(typeElement, "Unable to close intent builder source file for type %s: %s", typeElement, e.getMessage()); } } } } return true; }
Source:
<code>public void reserveAvailableResource() throws Exception { LockableResourcesManager lm = LockableResourcesManager.get(); lm.createResourceWithLabel("resource1", "label1"); WorkflowJob p = j.jenkins.createProject(WorkflowJob.class, "p"); p.setDefinition(new CpsFlowDefinition(SCRIPT_TRY_DONT_RELEASE)); WorkflowRun b1 = p.scheduleBuild2(0).waitForStart(); j.assertBuildStatusSuccess(j.waitForCompletion(b1)); j.assertLogContains("Returned True", b1); <START> } <END></code><technical_language>need a RunListener similar ensue locks acquired a build released exits if user forgot release step (or forgot put in a finally block, CPS VM crashed build exit Groovy call stack)</technical_language>

Target:
public void reserveAvailableResource() throws Exception { final LockableResourcesManager lm = LockableResourcesManager.get(); lm.createResourceWithLabel("resource1", "label1"); final WorkflowJob p = j.jenkins.createProject(WorkflowJob.class, "p"); p.setDefinition(new CpsFlowDefinition(SCRIPT_TRY_DONT_RELEASE)); final WorkflowRun b1 = p.scheduleBuild2(0).waitForStart(); j.assertBuildStatusSuccess(j.waitForCompletion(b1)); j.assertLogContains("Returned True", b1); j.assertLogContains("[lockable-resources] released lock on [resource1]", b1); }
Source:
<code>private String getUserAlias(LinkedHashMap<String, LinkedHashMap<String, String>> attribute, String fullAttributeName){ String alias = attribute.get(fullAttributeName).get(ALIAS); if (alias == null) { return null; } alias = this.replaceByAlias(alias); alias = alias.replace("$attribute", fullAttributeName); alias = alias.replace("$domain", domain); try { alias = alias.replace("$value", getJmxValue().toString()); <START> } catch (Exception e) { <END> } return alias; }</code><technical_language>catch a more specific exception? kind of exceptions expect</technical_language>

Target:
private String getUserAlias(LinkedHashMap<String, LinkedHashMap<String, String>> attribute, String fullAttributeName){ String alias = attribute.get(fullAttributeName).get(ALIAS); if (alias == null) { return null; } alias = this.replaceByAlias(alias); alias = alias.replace("$attribute", fullAttributeName); alias = alias.replace("$domain", domain); try { alias = alias.replace("$value", getJmxValue().toString()); } catch (JMException e) { LOGGER.warn("Unable to replace $value for attribute " + fullAttributeName, e); } catch (IOException e) { LOGGER.warn("Unable to replace $value for attribute " + fullAttributeName, e); } return alias; }
Source:
<code>public void testGetFieldType() { StringMultipleInputFieldDefinition fieldDefinition = new StringMultipleInputFieldDefinition(); fieldDefinition.setStandaloneClassName(String.class.getName()); assertEquals(fieldDefinition.getFieldTypeInfo().getType(), TypeKind.BASE); fieldDefinition.setStandaloneClassName(Object.class.getName()); <START> assertNotEquals(fieldDefinition.getFieldTypeInfo().getType(), TypeKind.BASE); <END> }</code><technical_language>again, check equality TypeKind.OBJECT</technical_language>

Target:
public void testGetFieldType() { StringMultipleSelectorFieldDefinition fieldDefinition = new StringMultipleSelectorFieldDefinition(); fieldDefinition.setStandaloneClassName(String.class.getName()); assertEquals(TypeKind.BASE, fieldDefinition.getFieldTypeInfo().getType()); fieldDefinition.setStandaloneClassName(Object.class.getName()); assertEquals(TypeKind.OBJECT, fieldDefinition.getFieldTypeInfo().getType()); }
Source:
<code>protected ZkClient(IZkConnection zkConnection, int connectionTimeout, long operationRetryTimeout, PathBasedZkSerializer zkSerializer, String monitorType, String monitorKey, String monitorInstanceName, boolean monitorRootPathOnly) { if (zkConnection == null) { throw new NullPointerException("Zookeeper connection is null!"); } _uid = UID.getAndIncrement(); _connection = zkConnection; _pathBasedZkSerializer = zkSerializer; _operationRetryTimeoutInMillis = operationRetryTimeout; _isNewSessionEventFired = false; _asyncCallRetryThread = new ZkAsyncRetryThread(zkConnection.getServers()); _asyncCallRetryThread.start(); LOG.debug("ZkClient created with _uid {}, _asyncCallRetryThread id {}", _uid, _asyncCallRetryThread.getId()); if (monitorKey != null && !monitorKey.isEmpty() && monitorType != null && !monitorType .isEmpty()) { _monitor = new ZkClientMonitor(monitorType, monitorKey, monitorInstanceName, monitorRootPathOnly, <START> _eventThread); <END> } else { LOG.info("ZkClient monitor key or type is not provided. Skip monitoring."); } connect(connectionTimeout, this); }</code><technical_language>give a more complete change. 1. constructor require _eventThread anymore, null anyway. 2. setAndInitZkEventThreadMonitor create event thread monitor call updateAttributesInfo() update attribute. Re-register monitor is wrong, end 2 mbeans 2nd register fail</technical_language>

Target:
protected ZkClient(IZkConnection zkConnection, int connectionTimeout, long operationRetryTimeout, PathBasedZkSerializer zkSerializer, String monitorType, String monitorKey, String monitorInstanceName, boolean monitorRootPathOnly) { if (zkConnection == null) { throw new NullPointerException("Zookeeper connection is null!"); } _uid = UID.getAndIncrement(); _connection = zkConnection; _pathBasedZkSerializer = zkSerializer; _operationRetryTimeoutInMillis = operationRetryTimeout; _isNewSessionEventFired = false; _asyncCallRetryThread = new ZkAsyncRetryThread(zkConnection.getServers()); _asyncCallRetryThread.start(); LOG.debug("ZkClient created with _uid {}, _asyncCallRetryThread id {}", _uid, _asyncCallRetryThread.getId()); if (monitorKey != null && !monitorKey.isEmpty() && monitorType != null && !monitorType .isEmpty()) { _monitor = new ZkClientMonitor(monitorType, monitorKey, monitorInstanceName, monitorRootPathOnly, _eventThread); } else { LOG.info("ZkClient monitor key or type is not provided. Skip monitoring."); } connect(connectionTimeout, this); try { if (_monitor != null) { _monitor.register(); } } catch (JMException e){ LOG.error("Error in creating ZkClientMonitor", e); } }
Source:
<code>public List<Edge<V, E>> path(V start, V end) { ArrayList<Edge<V, E>> path = new ArrayList<>(); HashMap<V, Edge<V, E>> hist = new HashMap<>(); HashSet<V> visited = new HashSet<>(); Queue<V> queue = new LinkedList<>(); <START> queue.offer(start); <END> while (!queue.isEmpty()) { V node = queue.poll(); visited.add(node); for (Edge<V, E> e : adj(node)) { V to = e.getTo(); if (!visited.contains(to)) { queue.offer(e.getTo()); if (!hist.containsKey(e.getTo())) { hist.put(e.getTo(), e); } } } } V node = end; while (true) { Edge<V, E> edge = hist.get(node); if (edge == null) { break; } path.add(edge); node = edge.getFrom(); if (node == start) { break; } } Collections.reverse(path); return path; }</code><technical_language>avoiding recursion making a breadth insertion? I think..</technical_language>

Target:
public List<Edge<V, E>> path(V start, V end) { ArrayList<Edge<V, E>> path = new ArrayList<>(); HashMap<V, Edge<V, E>> hist = new HashMap<>(); HashSet<V> visited = new HashSet<>(); Queue<V> queue = new LinkedList<>(); queue.offer(start); while (!queue.isEmpty()) { V node = queue.poll(); visited.add(node); for (Edge<V, E> e : adj(node)) { V to = e.getTo(); if (!visited.contains(to)) { queue.offer(e.getTo()); if (!hist.containsKey(e.getTo())) { hist.put(e.getTo(), e); } } } } V node = end; Edge<V, E> edge = hist.get(node); while (edge != null && node != start) { path.add(edge); node = edge.getFrom(); edge = hist.get(node); } Collections.reverse(path); return path; }
Source:
<code>public void testWithValueOutSideInterval() { fModule.schedule(); fModule.waitForCompletion(); ITmfStateSystem ss = fModule.getStateSystem(); assertNotNull(ss); assertEquals(1L, ss.getStartTime()); assertEquals(30L, ss.getCurrentEndTime()); <START> boolean thrown1 = false; <END> boolean thrown2 = false; try { ITmfStateInterval kernelState1 = ss.querySingleState(0L, 0); long value =0; value = kernelState1.getStateValue().unboxLong(); assertEquals(0, value); } catch (org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException e) { thrown1 = true; } catch (AttributeNotFoundException | StateSystemDisposedException e) { fail(e.getMessage()); } try { ITmfStateInterval kernelState2 = ss.querySingleState(31L, 0); long value =0; value = kernelState2.getStateValue().unboxLong(); assertEquals(0, value); } catch (org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException e) { thrown2 = true; } catch (AttributeNotFoundException | StateSystemDisposedException e) { fail(e.getMessage()); } assertTrue(thrown1); assertTrue(thrown2); }</code><technical_language>need this check I catches fail. better, test throw attributeNotFound ssd exceptions</technical_language>

Target:
public void testWithValueOutSideInterval() { fModule.schedule(); fModule.waitForCompletion(); ITmfStateSystem ss = fModule.getStateSystem(); assertNotNull(ss); assertEquals(1L, ss.getStartTime()); assertEquals(30L, ss.getCurrentEndTime()); ITmfStateInterval kernelState1; ITmfStateInterval kernelState2; long value = 0; try { kernelState1 = ss.querySingleState(0L, 0); value = kernelState1.getStateValue().unboxLong(); assertEquals(0L, value); } catch (AttributeNotFoundException | StateSystemDisposedException e) { fail(e.getMessage()); } try { kernelState2 = ss.querySingleState(31L, 0); value = kernelState2.getStateValue().unboxLong(); assertEquals(0L, value); } catch (AttributeNotFoundException | StateSystemDisposedException e) { fail(e.getMessage()); } }
Source:
<code>public String getData() { <START> if (data == null) <END> return null; return data; }</code><technical_language>return data</technical_language>

Target:
public String getData() { return data; }
Source:
<code>public Object data(Computer computer) { String currentValueStr = (String) super.data(computer); if (currentValueStr == null || currentValueStr.contains(Messages.InodesMonitor_NotApplicable())) { return currentValueStr; } try { int currentValue = parse(currentValueStr); String currentState = "current=" + currentValue + ",threshold=" + inodesPercentThreshold; String computerName = computer.getName(); if ("".equals(computer.getName())) { computerName = hudson.model.Messages.Hudson_Computer_DisplayName(); } if (currentValue >= parse(inodesPercentThreshold)) { OfflineCause offlineCause = OfflineCause.create(Messages._InodesMonitor_MarkedOffline(computerName, currentState)); if (((InodesUseInPercentMonitorDescriptor) getDescriptor()).markOffline(computer, offlineCause)) { String inodesmonitor_markedOffline = Messages.InodesMonitor_MarkedOffline(computerName, currentState); LOGGER.warning(inodesmonitor_markedOffline); } } else { if (((InodesUseInPercentMonitorDescriptor) getDescriptor()).markOnline(computer)) { LOGGER.warning(Messages.InodesMonitor_MarkedOnline(computerName, currentState)); } } } catch (ParseException e) { <START> throw new IllegalStateException("WTF? Can't parse " + currentValueStr + " as integer percentage", e); <END> } return currentValueStr; }</code><technical_language>unlikely, message reworded</technical_language>

Target:
public Object data(Computer computer) { String currentValueStr = (String) super.data(computer); if (currentValueStr == null || currentValueStr.contains(Messages.InodesMonitor_NotApplicable())) { return currentValueStr; } try { int currentValue = parse(currentValueStr); String currentState = "current=" + currentValue + ",threshold=" + inodesPercentThreshold; String computerName = computer.getName(); if ("".equals(computer.getName())) { computerName = hudson.model.Messages.Hudson_Computer_DisplayName(); } if (currentValue >= parse(inodesPercentThreshold)) { OfflineCause offlineCause = OfflineCause.create(Messages._InodesMonitor_MarkedOffline(computerName, currentState)); if (((InodesUseInPercentMonitorDescriptor) getDescriptor()).markOffline(computer, offlineCause)) { String inodesmonitor_markedOffline = Messages.InodesMonitor_MarkedOffline(computerName, currentState); LOGGER.warning(inodesmonitor_markedOffline); } } else { if (((InodesUseInPercentMonitorDescriptor) getDescriptor()).markOnline(computer)) { LOGGER.warning(Messages.InodesMonitor_MarkedOnline(computerName, currentState)); } } } catch (ParseException e) { throw new IllegalStateException("Shouldn't happen: can't parse " + currentValueStr + " as integer percentage", e); } return currentValueStr; }
Source:
<code><START> public static <T> CollectionStream<T> of(String systemName, String streamName, Map<Integer, ? extends Iterable<T>> partitions) { <END> Preconditions.checkNotNull(systemName); Preconditions.checkNotNull(streamName); Preconditions.checkNotNull(partitions); return new CollectionStream<>(systemName, streamName, partitions); }</code><technical_language>Do need this if regular constructor</technical_language>

Target:
public static <T> CollectionStream<T> of(String systemName, String streamName, Map<Integer, ? extends Iterable<T>> partitions) { return new CollectionStream<>(systemName, streamName, partitions); }