auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void shouldSendRecordViaCorrectSourceTopic() { testDriver = new TopologyTestDriver(setupMultipleSourceTopology(SOURCE_TOPIC_1, SOURCE_TOPIC_2), config); final List<String> processedRecords1 = supplier.capturedProcessors(2).get(0).processed; final List<String> processedRecords2 = supplier.capturedProcessors(2).get(1).processed; testDriver.pipeInput(consumerRecord1); assertEquals(1, processedRecords1.size()); assertEquals(0, processedRecords2.size()); String record = processedRecords1.get(0); String expectedResult = MockProcessor.makeRecord(consumerRecord1.key(), consumerRecord1.value(), consumerRecord1.timestamp()); assertThat(record, equalTo(expectedResult)); testDriver.pipeInput(consumerRecord2); assertEquals(1, processedRecords1.size()); assertEquals(1, processedRecords2.size()); record = processedRecords2.get(0); expectedResult = MockProcessor.makeRecord(consumerRecord2.key(), consumerRecord2.value(), consumerRecord2.timestamp()); assertThat(record, equalTo(expectedResult)); <START> } <END></code><technical_language>MockProcessor support callbacks..</technical_language>

Target:
public void shouldSendRecordViaCorrectSourceTopic() { testDriver = new TopologyTestDriver(setupMultipleSourceTopology(SOURCE_TOPIC_1, SOURCE_TOPIC_2), config); final List<Record> processedRecords1 = mockProcessors.get(0).processedRecords; final List<Record> processedRecords2 = mockProcessors.get(1).processedRecords; testDriver.pipeInput(consumerRecord1); assertEquals(1, processedRecords1.size()); assertEquals(0, processedRecords2.size()); Record record = processedRecords1.get(0); Record expectedResult = new Record(consumerRecord1, 0L); assertThat(record, equalTo(expectedResult)); testDriver.pipeInput(consumerRecord2); assertEquals(1, processedRecords1.size()); assertEquals(1, processedRecords2.size()); record = processedRecords2.get(0); expectedResult = new Record(consumerRecord2, 0L); assertThat(record, equalTo(expectedResult)); }
Source:
<code>public List<Document> saveAll(final Table table, List<Document> documents) { if(documents == null || documents.isEmpty()) { throw FoxtrotExceptions.createBadRequestException(table.getName(), "null/empty document list not allowed"); } List<Put> puts = new ArrayList<>(); ImmutableList.Builder<Document> translatedDocuments = ImmutableList.builder(); List<String> errorMessages = new ArrayList<>(); try { for(int i = 0; i < documents.size(); i++) { Document document = documents.get(i); if(!isValidDocument(document, errorMessages, i)) { continue; } Document translatedDocument = translator.translate(table, document); puts.add(getPutForDocument(translatedDocument)); translatedDocuments.add(translatedDocument); } } catch (JsonProcessingException e) { throw FoxtrotExceptions.createBadRequestException(table, e); } if(!errorMessages.isEmpty()) { throw FoxtrotExceptions.createBadRequestException(table.getName(), errorMessages); } try (org.apache.hadoop.hbase.client.Table hTable = tableWrapper.getTable(table)) { hTable.put(puts); } catch (IOException e) { <START> logger.error("Error occurred while ingesting event in HBase : {}", e, e.getCause(), e.getMessage()); <END> throw FoxtrotExceptions.createConnectionException(table, e); } return translatedDocuments.build(); }</code><technical_language>In case of error, work properly i think..</technical_language>

Target:
public List<Document> saveAll(final Table table, List<Document> documents) { if(documents == null || documents.isEmpty()) { throw FoxtrotExceptions.createBadRequestException(table.getName(), "null/empty document list not allowed"); } List<Put> puts = new ArrayList<>(); ImmutableList.Builder<Document> translatedDocuments = ImmutableList.builder(); List<String> errorMessages = new ArrayList<>(); try { for(int i = 0; i < documents.size(); i++) { Document document = documents.get(i); if(!isValidDocument(document, errorMessages, i)) { continue; } Document translatedDocument = translator.translate(table, document); puts.add(getPutForDocument(translatedDocument)); translatedDocuments.add(translatedDocument); } } catch (JsonProcessingException e) { throw FoxtrotExceptions.createBadRequestException(table, e); } if(!errorMessages.isEmpty()) { throw FoxtrotExceptions.createBadRequestException(table.getName(), errorMessages); } try (org.apache.hadoop.hbase.client.Table hTable = tableWrapper.getTable(table)) { hTable.put(puts); } catch (IOException e) { logger.error("Error occurred while ingesting event in HBase : ", e); throw FoxtrotExceptions.createConnectionException(table, e); } return translatedDocuments.build(); }
Source:
<code>public void push(RowMap r) throws Exception { String value = r.toJSON(outputConfig); <START> if (value == null) { <END> return; } String routingKey = r.getDatabase() + "." + r.getTable(); channel.basicPublish(exchangeName, routingKey, null, value.getBytes()); if ( r.isTXCommit() ) { context.setPosition(r.getPosition()); } if ( LOGGER.isDebugEnabled()) { LOGGER.debug("-> routing key:" + routingKey + ", partition:" + value); } }</code><technical_language>if merge master, a new RowMap#shouldOutput() method. update this PR that? note if shouldOutput returns false, want set binlog position. I think</technical_language>

Target:
public void push(RowMap r) throws Exception { if ( !r.shouldOutput(outputConfig) ) { context.setPosition(r.getPosition()); return; } String value = r.toJSON(outputConfig); String routingKey = getRoutingKeyFromTemplate(r); channel.basicPublish(exchangeName, routingKey, null, value.getBytes()); if ( r.isTXCommit() ) { context.setPosition(r.getPosition()); } if ( LOGGER.isDebugEnabled()) { LOGGER.debug("-> routing key:" + routingKey + ", partition:" + value); } }
Source:
<code>public void testResponseStreamIsReadable() throws Exception { final RestResponse response = getStreamTestResponse(); <START> try (InputStream in = response.asInputStream()) { <END> assertStreamTestResponseStreamIsValid(in); } catch (IOException e) { fail("The InputStream should be readable and an IOException should not have been thrown"); } catch (JSONException e) { fail("Valid JSON data should have been returned"); } finally { response.consumeQuietly(); } }</code><technical_language>@clibc I if enforce Java 7 a minimum, Java 6 syntax here</technical_language>

Target:
public void testResponseStreamIsReadable() throws Exception { final RestResponse response = getStreamTestResponse(); try { InputStream in = response.asInputStream(); assertStreamTestResponseStreamIsValid(in); } catch (IOException e) { fail("The InputStream should be readable and an IOException should not have been thrown"); } catch (JSONException e) { fail("Valid JSON data should have been returned"); } finally { response.consumeQuietly(); } }
Source:
<code>private Object[] getCachedChildren(Object parent) { if (parent == null) { <START> return new Object[0]; <END> } Object[] children = m_childMap.get(parent); if (children == null || children.length == 0) { ITreeNode scoutNode = (ITreeNode) parent; children = scoutNode.getFilteredChildNodes(); m_childMap.put(parent, children); for (int i = 0; i < children.length; i++) { m_childIndexMap.put(children[i], i); } } return children; }</code><technical_language>callers of this method? side-effects if empty array is returned this place</technical_language>

Target:
private Object[] getCachedChildren(Object parent) { Object[] children = m_childMap.get(parent); if (children == null || children.length == 0) { ITreeNode scoutNode = (ITreeNode) parent; children = scoutNode.getFilteredChildNodes(); m_childMap.put(parent, children); for (int i = 0; i < children.length; i++) { m_childIndexMap.put(children[i], i); } } return children; }
Source:
<code>public TransformSpatialPredicates(Metadata metadata) { <START> this.metadata = metadata; <END> }</code><technical_language>requireNonNull</technical_language>

Target:
public TransformSpatialPredicates(Metadata metadata) { this.metadata = requireNonNull(metadata, "metadata is null"); }
Source:
<code>public double[] solveFToD(float[] b) { RealVector bVec = new ArrayRealVector(b.length); for (int i = 0; i < b.length; i++) { bVec.setEntry(i, b[i]); } RealVector vec = solver.solve(bVec); <START> double[] result = new double[b.length]; <END> for (int i = 0; i < result.length; i++) { result[i] = vec.getEntry(i); } return result; }</code><technical_language>call vec.toArray() I</technical_language>

Target:
public double[] solveFToD(float[] b) { RealVector bVec = new ArrayRealVector(b.length); for (int i = 0; i < b.length; i++) { bVec.setEntry(i, b[i]); } RealVector vec = solver.solve(bVec); return vec.toArray(); }
Source:
<code>public void addFilter(@NonNull ViewerFilter filter) { fTimeGraphCtrl.addFilter(filter); refresh(); <START> fTimeGraphCtrl.fireFilterApplied(); <END> }</code><technical_language>If a filter is applied TimeGraphControl, listeners notified. In case, TimeGraphViewer sole owner of listener list, fire events. Otherwise, TimeGraphControl fire events addFilter() removeFilter() is called</technical_language>

Target:
public void addFilter(@NonNull ViewerFilter filter) { fTimeGraphCtrl.addFilter(filter); refresh(); }
Source:
<code>public void injectManagementContext(ManagementContext managementContext) { <START> if (this.managementContext!=null && managementContext!=null && !this.managementContext.equals(managementContext)) <END> throw new IllegalStateException("Cannot switch management context of "+this+"; from "+this.managementContext+" to "+managementContext); this.managementContext = managementContext; }</code><technical_language>prefer NPE if injected managementContext is null. a programming error lazy test code</technical_language>

Target:
public void injectManagementContext(ManagementContext managementContext) { Preconditions.checkNotNull(managementContext, "management context"); if (this.managementContext!=null && managementContext!=this.managementContext) throw new IllegalStateException("Cannot switch management context, from "+this.managementContext+" to "+managementContext); this.managementContext = managementContext; }
Source:
<code>public void setAssignmentMetadata(final Map<TaskId, Set<TopicPartition>> activeTasks, final Map<TaskId, Set<TopicPartition>> standbyTasks) { addedActiveTasks.clear(); for (final Map.Entry<TaskId, Set<TopicPartition>> entry : activeTasks.entrySet()) { if (!assignedActiveTasks.containsKey(entry.getKey())) { addedActiveTasks.put(entry.getKey(), entry.getValue()); } } addedStandbyTasks.clear(); for (final Map.Entry<TaskId, Set<TopicPartition>> entry : standbyTasks.entrySet()) { if (!assignedStandbyTasks.containsKey(entry.getKey())) { addedStandbyTasks.put(entry.getKey(), entry.getValue()); } } revokedActiveTasks.clear(); for (final Map.Entry<TaskId, Set<TopicPartition>> entry : assignedActiveTasks.entrySet()) { if (!activeTasks.containsKey(entry.getKey())) { revokedActiveTasks.put(entry.getKey(), entry.getValue()); } } revokedStandbyTasks.clear(); for (final Map.Entry<TaskId, Set<TopicPartition>> entry : assignedStandbyTasks.entrySet()) { if (!standbyTasks.containsKey(entry.getKey())) { revokedStandbyTasks.put(entry.getKey(), entry.getValue()); } } <START> log.debug("Assigning metadata with activeTasks: {}. The updated active task states are: \n" + <END> "\taddedActiveTasks {},\n" + "\tassignedActiveTasks {}", activeTasks, addedActiveTasks, assignedActiveTasks); this.assignedActiveTasks = activeTasks; this.assignedStandbyTasks = standbyTasks; }</code><technical_language>include addedStandbyTasks / assignedStandbyTasks / revokedActiveTasks / revokedStandbyTasks well</technical_language>

Target:
public void setAssignmentMetadata(final Map<TaskId, Set<TopicPartition>> activeTasks, final Map<TaskId, Set<TopicPartition>> standbyTasks) { addedActiveTasks.clear(); for (final Map.Entry<TaskId, Set<TopicPartition>> entry : activeTasks.entrySet()) { if (!assignedActiveTasks.containsKey(entry.getKey())) { addedActiveTasks.put(entry.getKey(), entry.getValue()); } } addedStandbyTasks.clear(); for (final Map.Entry<TaskId, Set<TopicPartition>> entry : standbyTasks.entrySet()) { if (!assignedStandbyTasks.containsKey(entry.getKey())) { addedStandbyTasks.put(entry.getKey(), entry.getValue()); } } revokedActiveTasks.clear(); for (final Map.Entry<TaskId, Set<TopicPartition>> entry : assignedActiveTasks.entrySet()) { if (!activeTasks.containsKey(entry.getKey())) { revokedActiveTasks.put(entry.getKey(), entry.getValue()); } } revokedStandbyTasks.clear(); for (final Map.Entry<TaskId, Set<TopicPartition>> entry : assignedStandbyTasks.entrySet()) { if (!standbyTasks.containsKey(entry.getKey())) { revokedStandbyTasks.put(entry.getKey(), entry.getValue()); } } log.debug("Assigning metadata with: " + "\tactiveTasks: {},\n" + "\tstandbyTasks: {}\n" + "The updated active task states are: \n" + "\tassignedActiveTasks {},\n" + "\tassignedStandbyTasks {},\n" + "\taddedActiveTasks {},\n" + "\taddedStandbyTasks {},\n" + "\trevokedActiveTasks {},\n" + "\trevokedStandbyTasks {}", activeTasks, standbyTasks, assignedActiveTasks, assignedStandbyTasks, addedActiveTasks, addedStandbyTasks, revokedActiveTasks, revokedStandbyTasks); this.assignedActiveTasks = activeTasks; this.assignedStandbyTasks = standbyTasks; }
Source:
<code>private synchronized JsonNode request(String method, String url, String payload, String payloadType, boolean retry) throws IOException, InvalidLoginException { logger.debug("Requsting URL {}", url); String dataString = executeUrl(method, url, header, payload == null ? null : IOUtils.toInputStream(payload), payloadType, 5000); logger.debug("Received MyQ JSON: {}", dataString); <START> if (dataString == null) <END> throw new IOException("Null response from MyQ server"); try { ObjectMapper mapper = new ObjectMapper(); JsonNode rootNode = mapper.readTree(dataString); int returnCode = rootNode.get("ReturnCode").asInt(); logger.debug("myq ReturnCode: {}", returnCode); MyQResponseCode rc = MyQResponseCode.fromCode(returnCode); switch (rc) { case OK: { return rootNode; } case ACCOUNT_INVALID: case ACCOUNT_NOT_FOUND: case ACCOUNT_LOCKED: case ACCOUNT_LOCKED_PENDING: throw new InvalidLoginException(rc.getDesc()); case LOGIN_ERROR: if (retry) { login(); return request(method, url, payload, payloadType, false); } default: throw new IOException("Request Failed: " + rc.getDesc()); } } catch (JsonProcessingException e) { throw new IOException("Could not parse response", e); } }</code><technical_language>{ } for one-liners</technical_language>

Target:
private synchronized JsonNode request(String method, String url, String payload, String payloadType, boolean retry) throws IOException, InvalidLoginException { logger.debug("Requsting URL {}", url); String dataString = executeUrl(method, url, header, payload == null ? null : IOUtils.toInputStream(payload), payloadType, timeout); logger.debug("Received MyQ JSON: {}", dataString); if (dataString == null) { throw new IOException("Null response from MyQ server"); } try { ObjectMapper mapper = new ObjectMapper(); JsonNode rootNode = mapper.readTree(dataString); int returnCode = rootNode.get("ReturnCode").asInt(); logger.debug("myq ReturnCode: {}", returnCode); MyQResponseCode rc = MyQResponseCode.fromCode(returnCode); switch (rc) { case OK: { return rootNode; } case ACCOUNT_INVALID: case ACCOUNT_NOT_FOUND: case ACCOUNT_LOCKED: case ACCOUNT_LOCKED_PENDING: throw new InvalidLoginException(rc.getDesc()); case LOGIN_ERROR: if (retry) { login(); return request(method, url, payload, payloadType, false); } default: throw new IOException("Request Failed: " + rc.getDesc()); } } catch (JsonProcessingException e) { throw new IOException("Could not parse response", e); } }
Source:
<code><START> ReceivedPackStatistics build() { <END> ReceivedPackStatistics s = new ReceivedPackStatistics(); s.numBytesRead = numBytesRead; s.numBytesTransferred = numBytesTransferred; s.numBytesDuplicated = numBytesDuplicated; s.numWholeCommit = numWholeCommit; s.numWholeTree = numWholeTree; s.numWholeBlob = numWholeBlob; s.numWholeTag = numWholeTag; s.numOfsDelta = numOfsDelta; s.numRefDelta = numRefDelta; s.numDeltaCommit = numDeltaCommit; s.numDeltaTree = numDeltaTree; s.numDeltaBlob = numDeltaBlob; s.numDeltaTag = numDeltaTag; return s; }</code><technical_language>Is numDuplicated missing here</technical_language>

Target:
ReceivedPackStatistics build() { ReceivedPackStatistics s = new ReceivedPackStatistics(); s.numBytesRead = numBytesRead; s.numBytesTransferred = numBytesTransferred; s.numBytesDuplicated = numBytesDuplicated; s.numWholeCommit = numWholeCommit; s.numWholeTree = numWholeTree; s.numWholeBlob = numWholeBlob; s.numWholeTag = numWholeTag; s.numOfsDelta = numOfsDelta; s.numRefDelta = numRefDelta; s.numDeltaCommit = numDeltaCommit; s.numDeltaTree = numDeltaTree; s.numDeltaBlob = numDeltaBlob; s.numDeltaTag = numDeltaTag; s.numDuplicated = numDuplicated; return s; }
Source:
<code>public SumcoinindexRateSource() { final ClientConfig config = new ClientConfig(); try { SSLContext sslcontext=SSLContext.getInstance("TLS"); sslcontext.init(null,null,null); final CompatSSLSocketFactory socketFactory = new CompatSSLSocketFactory(sslcontext.getSocketFactory()); config.setSslSocketFactory(socketFactory); config.setIgnoreHttpErrorCodes(true); <START> api = RestProxyFactory.createProxy(ISumcoinindexAPI.class, "<LINK_1>", config); <END> } catch (NoSuchAlgorithmException e) { log.error("Error", e); } catch (KeyManagementException e) { log.error("Error", e); } }</code><technical_language>This is line needed remove CompatSSLSocketFactory. Also, https if possible</technical_language>

Target:
public SumcoinindexRateSource() { api = RestProxyFactory.createProxy(ISumcoinindexAPI.class, "<LINK_0>"); }
Source:
<code>String toCsvString() { <START> StringBuilder line = new StringBuilder(""); <END> line.append('"').append(getCaseName()).append('"').append(','); line.append('"').append(getDataSourceName()).append('"').append(','); line.append('"').append(getType()).append('"').append(','); line.append('"').append(getValue()).append('"').append(','); line.append('"').append(getKnown().toString()).append('"').append(','); line.append('"').append(getFilePath()).append('"').append(','); line.append('"').append(getComment()).append('"').append(System.getProperty("line.separator")); return line.toString(); }</code><technical_language>Codacy a lot of flags of StringBuilder here</technical_language>

Target:
String toCsvString() { StringBuilder line = new StringBuilder("\""); line.append(getCaseName()).append(CSV_ITEM_SEPARATOR) .append(getDataSourceName()).append(CSV_ITEM_SEPARATOR) .append(getType()).append(CSV_ITEM_SEPARATOR) .append(getValue()).append(CSV_ITEM_SEPARATOR) .append(getKnown().toString()).append(CSV_ITEM_SEPARATOR) .append(getFilePath()).append(CSV_ITEM_SEPARATOR) .append(getComment()).append('"') .append(System.getProperty("line.separator")); return line.toString(); }
Source:
<code>public static ImsServiceProxy create(Context context , int slotId) { ImsServiceProxy serviceProxy = new ImsServiceProxy(context, slotId, ImsFeature.MMTEL); IImsMMTelFeature <START> b = <END> getTelephonyManager(context).getImsMMTelFeatureAndListen(slotId, serviceProxy.getListener()); if (b != null) { serviceProxy.setBinder(b.asBinder()); serviceProxy.getFeatureStatus(); } else { Rlog.w(LOG_TAG, "getServiceProxy: b is null! Phone Id: " + slotId); } return serviceProxy; }</code><technical_language>is this "b"? "a" some point? I protest</technical_language>

Target:
public static ImsServiceProxy create(Context context , int slotId) { ImsServiceProxy serviceProxy = new ImsServiceProxy(context, slotId, ImsFeature.MMTEL); TelephonyManager tm = getTelephonyManager(context); IImsMMTelFeature binder = tm != null ? tm.getImsMMTelFeatureAndListen(slotId, serviceProxy.getListener()) : null; if (binder != null) { serviceProxy.setBinder(binder.asBinder()); serviceProxy.getFeatureStatus(); } else { Rlog.w(TAG, "getServiceProxy: binder is null! Phone Id: " + slotId); } return serviceProxy; }
Source:
<code>static Object invokeCallback(Object callable, Task<?> task) { if (callable instanceof Closure) return ((Closure<?>)callable).call(task); if (callable instanceof Callable) { try { return ((Callable<?>)callable).call(); } catch (Throwable t) { <START> throw Throwables.propagate(t); <END> } } if (callable instanceof Runnable) { ((Runnable)callable).run(); return null; } if (callable instanceof Function) { return ((Function)callable).apply(task); } if (callable==null) return null; throw new IllegalArgumentException("Cannot invoke unexpected callback object "+callable+" of type "+callable.getClass()+" on "+task); }</code><technical_language>Exceptions.propagate(t), properly handle InterruptedException</technical_language>

Target:
static Object invokeCallback(Object callable, Task<?> task) { if (callable instanceof Closure) return ((Closure<?>)callable).call(task); if (callable instanceof Callable) { try { return ((Callable<?>)callable).call(); } catch (Throwable t) { throw Exceptions.propagate(t); } } if (callable instanceof Runnable) { ((Runnable)callable).run(); return null; } if (callable instanceof Function) { return ((Function)callable).apply(task); } if (callable==null) return null; throw new IllegalArgumentException("Cannot invoke unexpected callback object "+callable+" of type "+callable.getClass()+" on "+task); }
Source:
<code>public EntityModelCellTable(SelectionMode selectionMode, Resources resources, boolean hideCheckbox, boolean showSelectAllCheckbox) { super(DEFAULT_PAGESIZE, resources); this.editorAdapter = new HasDataListModelEditorAdapter<M, EntityModel>(this); switch (selectionMode) { case MULTIPLE: setSelectionModel(new MultiSelectionModel<EntityModel>(), DefaultSelectionEventManager.<EntityModel> createCheckboxManager(0)); break; case NONE: setSelectionModel(new NoSelectionModel<EntityModel>()); break; case SINGLE: default: setSelectionModel(new SingleSelectionModel<EntityModel>()); break; } <START> setSelectionChangeHandler(); <END> buildAddCheckBox(hideCheckbox, showSelectAllCheckbox); }</code><technical_language>for consistency/symmetry - consider renaming: * s/setSelectionChangeHandler/addSelectionChangeHandler * s/buildAddCheckBox/addCheckBoxColumn</technical_language>

Target:
public EntityModelCellTable(SelectionMode selectionMode, Resources resources, boolean hideCheckbox, boolean showSelectAllCheckbox) { super(DEFAULT_PAGESIZE, resources); this.editorAdapter = new HasDataListModelEditorAdapter<M, EntityModel>(this); switch (selectionMode) { case MULTIPLE: setSelectionModel(new MultiSelectionModel<EntityModel>(), DefaultSelectionEventManager.<EntityModel> createCheckboxManager(0)); break; case NONE: setSelectionModel(new NoSelectionModel<EntityModel>()); break; case SINGLE: default: setSelectionModel(new SingleSelectionModel<EntityModel>()); break; } addSelectionChangeHandler(); addCheckBoxColumn(hideCheckbox, showSelectAllCheckbox); }
Source:
<code>private static ClassLoader getPluginClassloader( String pluginType, String pluginId ) throws KettlePluginException { Class<? extends PluginTypeInterface> pluginTypeInterface = null; PluginRegistry pluginRegistry = PluginRegistry.getInstance(); int maxTries = 10000; while ( maxTries-- > 0 ) { if ( pluginTypeInterface == null ) { for ( Class<? extends PluginTypeInterface> potentialPluginTypeInterface : pluginRegistry.getPluginTypes() ) { if ( pluginType.equals( potentialPluginTypeInterface.getCanonicalName() ) ) { pluginTypeInterface = potentialPluginTypeInterface; } } } PluginInterface plugin = pluginRegistry.getPlugin( pluginTypeInterface, pluginId ); if ( plugin != null ) { return pluginRegistry.getClassLoader( plugin ); } try { <START> Thread.sleep( 1000 ); <END> } catch ( InterruptedException e ) { throw new KettlePluginException( e ); } } return null; }</code><technical_language>This replaced wait() pluginRegistry. PluginRegistry call notify() a plugin is registered. this aid in debugging deadlocks more performant</technical_language>

Target:
private static ClassLoader getPluginClassloader( String pluginType, String pluginId ) throws KettlePluginException { Class<? extends PluginTypeInterface> pluginTypeInterface = null; PluginRegistry pluginRegistry = PluginRegistry.getInstance(); while ( true ) { synchronized ( pluginRegistry ) { if ( pluginTypeInterface == null ) { for ( Class<? extends PluginTypeInterface> potentialPluginTypeInterface : pluginRegistry.getPluginTypes() ) { if ( pluginType.equals( potentialPluginTypeInterface.getCanonicalName() ) ) { pluginTypeInterface = potentialPluginTypeInterface; } } } PluginInterface plugin = pluginRegistry.getPlugin( pluginTypeInterface, pluginId ); if ( plugin != null ) { return pluginRegistry.getClassLoader( plugin ); } try { pluginRegistry.wait(); } catch ( InterruptedException e ) { throw new KettlePluginException( e ); } } } }
Source:
<code>protected String[] customCommandLineValidation() { final List<String> errs = new ArrayList<>(); if (OUTPUT != null) { IOUtil.assertFileIsWritable(OUTPUT); } MetricToAllowableRelativeChange = new HashMap<>(); if (METRIC_ALLOWABLE_RELATIVE_CHANGE != null) { for (String diffs : METRIC_ALLOWABLE_RELATIVE_CHANGE) { String[] pair = diffs.split(":"); if (pair.length == 2) { String name = pair[0]; try { double value = Double.parseDouble(pair[1]); if (value > 0) { MetricToAllowableRelativeChange.put(name, value); } else { errs.add("Value for numeric component of Argument 'METRIC_ALLOWABLE_RELATIVE_CHANGE' must be > 0.0"); } } catch (NumberFormatException ne) { errs.add("Invalid value for numeric component of Argument 'METRIC_ALLOWABLE_RELATIVE_CHANGE'"); } } else { errs.add("Invalid value for Argument 'METRIC_ALLOWABLE_RELATIVE_CHANGE'"); } } } if (errs.isEmpty()) { return null; <START> } else { <END> return errs.toArray(new String[0]); } }</code><technical_language>Unnecessary else return</technical_language>

Target:
protected String[] customCommandLineValidation() { final List<String> errs = new ArrayList<>(); if (OUTPUT != null) { IOUtil.assertFileIsWritable(OUTPUT); } if (METRIC_ALLOWABLE_RELATIVE_CHANGE != null) { for (String diffs : METRIC_ALLOWABLE_RELATIVE_CHANGE) { String[] pair = diffs.split(":"); if (pair.length == 2) { String name = pair[0]; try { double value = Double.parseDouble(pair[1]); if (value > 0) { MetricToAllowableRelativeChange.put(name, value); } else { errs.add("Value for numeric component of Argument 'METRIC_ALLOWABLE_RELATIVE_CHANGE' must be > 0.0"); } } catch (NumberFormatException ne) { errs.add("Invalid value for numeric component of Argument 'METRIC_ALLOWABLE_RELATIVE_CHANGE'"); } } else { errs.add("Invalid value for Argument 'METRIC_ALLOWABLE_RELATIVE_CHANGE'"); } } } if (errs.isEmpty()) { return null; } return errs.toArray(new String[0]); }
Source:
<code>private CommunicationChannel getComChannel(boolean local, Event sourceEvent, Connection connection) { CommunicationChannel channel = communicationModel.getChannels().get(sourceEvent); if <START> (channel == null) { <END> if(connection instanceof EventConnection) { channel = new CommunicationChannel(); channel.setSourceEvent(sourceEvent); channel.setLocal(local); communicationModel.getChannels().put(sourceEvent, channel); } } else if (!local) { channel.setLocal(false); } return channel; }</code><technical_language>if this coding rule applies Java code, null lhs</technical_language>

Target:
private CommunicationChannel getComChannel(boolean local, Event sourceEvent, Connection connection) { CommunicationChannel channel = communicationModel.getChannels().get(sourceEvent); if (null == channel) { if(connection instanceof EventConnection) { channel = new CommunicationChannel(); channel.setSourceEvent(sourceEvent); channel.setLocal(local); communicationModel.getChannels().put(sourceEvent, channel); } } else if (!local) { channel.setLocal(false); } return channel; }
Source:
<code>protected void configure() { install(new PacketComputeParserModule()); super.configure(); <START> } <END></code><technical_language>remove this if add parser module list of modules in api metadata. complete list there</technical_language>

Target:
protected void configure() { super.configure(); bind(ImplicitLocationSupplier.class).to(FirstRegion.class).in(Scopes.SINGLETON); bind(new TypeLiteral<Function<Href, ListOptions>>() { }).to(LinkToListOptions.class); }
Source:
<code>public XMLSerialization indented() { <START> indented = environment.get(ENVIRONMENT_INDENTED_KEY, "true").equals("true"); <END> return this; }</code><technical_language>TRUE (upper case) accepted</technical_language>

Target:
public XMLSerialization indented() { indented = true; return this; }
Source:
<code>public static String getPropNameForAccessor(String accessorName) { int prefixLength = accessorName.startsWith("is") ? 2 : 3; if (accessorName.length() < prefixLength + 1) return accessorName; <START> if (!isValidAccessorName(accessorName)) return accessorName; <END> return String.valueOf(accessorName.charAt(prefixLength)).toLowerCase() + accessorName.substring(prefixLength + 1); }</code><technical_language>sense move length check isValidAccessorName method below? ensure isValidAccessorName return true for methods named get()/is()/set()</technical_language>

Target:
public static String getPropNameForAccessor(String accessorName) { if (!isValidAccessorName(accessorName)) return accessorName; int prefixLength = accessorName.startsWith("is") ? 2 : 3; return String.valueOf(accessorName.charAt(prefixLength)).toLowerCase() + accessorName.substring(prefixLength + 1); }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == MENU_SAVE_SESSION) { <START> DevSessionRestorer.saveSessionToPrefs(); <END> } return super.onOptionsItemSelected(item); }</code><technical_language>want return true instead of calling super method stop processing item selections</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == MENU_SAVE_SESSION) { DevSessionRestorer.saveSessionToPrefs(); return true; } return super.onOptionsItemSelected(item); }
Source:
<code>void refreshTable() { if (m_table != null) { m_beanItemContainer = WallboardProvider.getInstance().getBeanContainer(); m_table.setContainerDataSource(m_beanItemContainer); m_table.setVisibleColumns(new Object[]{"title", "Edit", "Remove", "Preview", "Default"}); m_table.setColumnHeader("title", "Title"); <START> m_table.refreshRowCache(); <END> } }</code><technical_language>Do sort here</technical_language>

Target:
void refreshTable() { if (m_table != null) { m_beanItemContainer = WallboardProvider.getInstance().getBeanContainer(); m_table.setContainerDataSource(m_beanItemContainer); m_table.setVisibleColumns(new Object[]{"title", "Edit", "Remove", "Preview", "Default"}); m_table.setColumnHeader("title", "Title"); m_table.sort(); m_table.refreshRowCache(); } }
Source:
<code>public void done(IJobChangeEvent event) { if (event.getResult().isOK()) { lock.lock(); try { if (isFetchingGroup) { isFetchingGroup = false; pending = null; final Iterator<FetchListener> listenersIterator; if (listenerLeftToRun != null) { listenersIterator = listenerLeftToRun.iterator(); } else { listenersIterator = listeners.iterator(); } while (listenersIterator.hasNext()) { FetchListener listener = listenersIterator.next(); listener.doneFetching(); if (isFetchingGroup) { listenerLeftToRun = Lists.newArrayList(listenersIterator); return; } } final Iterator<CallbackHolder> callbacksIterator; if (callbacksLeftRun != null) { callbacksIterator = callbacksLeftRun.iterator(); } else { callbacksIterator = callbacks.iterator(); } while (callbacksIterator.hasNext()) { CallbackHolder callbackHolder = callbacksIterator.next(); run(callbackHolder.getCallback(), callbackHolder.getType()); if (isFetchingGroup) { listenerLeftToRun = Collections.emptyList(); callbacksLeftRun = Lists.newArrayList(callbacksIterator); <START> return; <END> } } listenerLeftToRun = null; callbacksLeftRun = null; callbacks.clear(); } } finally { lock.unlock(); } } }</code><technical_language>clear of callbacks list</technical_language>

Target:
public void done(IJobChangeEvent event) { if (event.getResult().isOK()) { lock.lock(); try { if (isFetchingGroup) { isFetchingGroup = false; pending = null; final Iterator<FetchListener> listenersIterator; if (listenerLeftToRun != null) { listenersIterator = listenerLeftToRun.iterator(); } else { listenersIterator = listeners.iterator(); } while (listenersIterator.hasNext()) { FetchListener listener = listenersIterator.next(); listener.doneFetching(); if (isFetchingGroup) { listenerLeftToRun = Lists.newArrayList(listenersIterator); return; } } final Iterator<CallbackHolder> callbacksIterator = callbacks.iterator(); while (callbacksIterator.hasNext()) { CallbackHolder callbackHolder = callbacksIterator.next(); run(callbackHolder.getCallback(), callbackHolder.getType()); if (isFetchingGroup) { listenerLeftToRun = Collections.emptyList(); List<CallbackHolder> remainingCallBack = Lists.newArrayList(callbacksIterator); callbacks = new CopyOnWriteArrayList<EMFCompareStructureMergeViewerContentProvider.CallbackHolder>( remainingCallBack); return; } } listenerLeftToRun = null; callbacks.clear(); } } finally { lock.unlock(); } } }
Source:
<code>public AttributeDefinition createAttribute(PerunSession sess, AttributeDefinition attribute) throws InternalErrorException, AttributeDefinitionExistsException { <START> return createAttribute(sess, attribute, false); <END> }</code><technical_language>"true"</technical_language>

Target:
public AttributeDefinition createAttribute(PerunSession sess, AttributeDefinition attribute) throws InternalErrorException, AttributeDefinitionExistsException { return createAttribute(sess, attribute, true); }
Source:
<code>public void testFailedRefreshCallback() throws InterruptedException { AtomicReference<Set<LockRefreshToken>> failedTokens = new AtomicReference<>(); server.registerRefreshFailedCallback(failedTokens::set); LockRequest request = LockRequest.builder(ImmutableSortedMap.of(lock1, LockMode.WRITE)) .timeoutAfter(SimpleTimeDuration.of(5, TimeUnit.SECONDS)) .build(); LockResponse lock = server.lockWithFullLockResponse(LockClient.ANONYMOUS, request); internalServer.unlock(lock.getToken()); <START> Thread.sleep(10000); <END> assertThat(failedTokens.get()).containsExactlyInAnyOrder(lock.getLockRefreshToken()); }</code><technical_language>awaitility instead of sleeping</technical_language>

Target:
public void testFailedRefreshCallback() throws InterruptedException { AtomicReference<Set<LockRefreshToken>> failedTokens = new AtomicReference<>(); server.registerRefreshFailedCallback(failedTokens::set); LockRequest request = LockRequest.builder(ImmutableSortedMap.of(lock1, LockMode.WRITE)) .timeoutAfter(SimpleTimeDuration.of(5, TimeUnit.SECONDS)) .build(); LockResponse lock = server.lockWithFullLockResponse(LockClient.ANONYMOUS, request); internalServer.unlock(lock.getToken()); Awaitility.waitAtMost(20, TimeUnit.SECONDS) .until(() -> failedTokens.get() != null); assertThat(failedTokens.get()).containsExactlyInAnyOrder(lock.getLockRefreshToken()); }
Source:
<code>public void propertyChange(PropertyChangeEvent evt) { <START> if (evt.getPropertyName().equals("stopWait")) { <END> queueDelayedUpdate(); } }</code><technical_language>This string presumaby match a string is fired elsewhere. referenced a constant</technical_language>

Target:
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(STOP_WAIT_PROPERTY_IDENTIFIER)) { queueDelayedUpdate(); } }
Source:
<code>public void onApiConnected() { super.onApiConnected(); final View view = getView(); final Context context = getContext(); typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.WAYPOINT)); final NumericWheelAdapter delayAdapter = new NumericWheelAdapter(context, R.layout.wheel_text_centered, 0, 60, "%d s"); CardWheelHorizontalView<Integer> delayPicker = (CardWheelHorizontalView) view.findViewById(R.id .waypointDelayPicker); delayPicker.setViewAdapter(delayAdapter); delayPicker.addScrollListener(this); final LengthUnitProvider lengthUP = getLengthUnitProvider(); final LengthWheelAdapter altitudeAdapter = new LengthWheelAdapter(context, R.layout.wheel_text_centered, lengthUP.boxBaseValueToTarget(MIN_ALTITUDE), lengthUP.boxBaseValueToTarget(MAX_ALTITUDE)); CardWheelHorizontalView<LengthUnit> altitudePicker = (CardWheelHorizontalView) view.findViewById(R.id .altitudePicker); altitudePicker.setViewAdapter(altitudeAdapter); altitudePicker.addScrollListener(this); <START> if(getMissionItems().size() > 0) { <END> final Waypoint item = (Waypoint) getMissionItems().get(0); delayPicker.setCurrentValue((int) item.getDelay()); altitudePicker.setCurrentValue(lengthUP.boxBaseValueToTarget(item.getCoordinate().getAltitude())); } }</code><technical_language>@droneboost mission items list is expected empty, requirement for displaying this fragment. check is fine, enforce requirement throwing exception if list is empty. allow detect error conditions well</technical_language>

Target:
public void onApiConnected() { super.onApiConnected(); final View view = getView(); final Context context = getContext(); typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.WAYPOINT)); final NumericWheelAdapter delayAdapter = new NumericWheelAdapter(context, R.layout.wheel_text_centered, 0, 60, "%d s"); CardWheelHorizontalView<Integer> delayPicker = (CardWheelHorizontalView) view.findViewById(R.id .waypointDelayPicker); delayPicker.setViewAdapter(delayAdapter); delayPicker.addScrollListener(this); final LengthUnitProvider lengthUP = getLengthUnitProvider(); final LengthWheelAdapter altitudeAdapter = new LengthWheelAdapter(context, R.layout.wheel_text_centered, lengthUP.boxBaseValueToTarget(MIN_ALTITUDE), lengthUP.boxBaseValueToTarget(MAX_ALTITUDE)); CardWheelHorizontalView<LengthUnit> altitudePicker = (CardWheelHorizontalView) view.findViewById(R.id .altitudePicker); altitudePicker.setViewAdapter(altitudeAdapter); altitudePicker.addScrollListener(this); final Waypoint item = (Waypoint) getMissionItems().get(0); delayPicker.setCurrentValue((int) item.getDelay()); altitudePicker.setCurrentValue(lengthUP.boxBaseValueToTarget(item.getCoordinate().getAltitude())); }
Source:
<code>private static OriginalType getOriginalType(ConvertedType type) { switch (type) { case UTF8: return OriginalType.UTF8; case MAP: return OriginalType.MAP; case MAP_KEY_VALUE: return OriginalType.MAP_KEY_VALUE; case LIST: return OriginalType.LIST; case ENUM: return OriginalType.ENUM; case DECIMAL: return OriginalType.DECIMAL; case DATE: return OriginalType.DATE; case TIME_MILLIS: return OriginalType.TIME_MILLIS; case TIMESTAMP_MILLIS: return OriginalType.TIMESTAMP_MILLIS; case INTERVAL: return OriginalType.INTERVAL; case INT_8: return OriginalType.INT_8; case INT_16: return OriginalType.INT_16; case INT_32: return OriginalType.INT_32; case INT_64: return OriginalType.INT_64; case UINT_8: return OriginalType.UINT_8; case UINT_16: return OriginalType.UINT_16; case UINT_32: return OriginalType.UINT_32; case UINT_64: return OriginalType.UINT_64; case JSON: return OriginalType.JSON; case BSON: return OriginalType.BSON; <START> case TIMESTAMP_MICROS: <END> return OriginalType.TIMESTAMP_MICROS; default: throw new IllegalArgumentException("Unknown converted type " + type); } }</code><technical_language>put this change in a separate commit? This commit upgrade Parquet, in a subsequent commit handle timestamp type</technical_language>

Target:
private static OriginalType getOriginalType(ConvertedType type) { switch (type) { case UTF8: return OriginalType.UTF8; case MAP: return OriginalType.MAP; case MAP_KEY_VALUE: return OriginalType.MAP_KEY_VALUE; case LIST: return OriginalType.LIST; case ENUM: return OriginalType.ENUM; case DECIMAL: return OriginalType.DECIMAL; case DATE: return OriginalType.DATE; case TIME_MILLIS: return OriginalType.TIME_MILLIS; case TIMESTAMP_MILLIS: return OriginalType.TIMESTAMP_MILLIS; case INTERVAL: return OriginalType.INTERVAL; case INT_8: return OriginalType.INT_8; case INT_16: return OriginalType.INT_16; case INT_32: return OriginalType.INT_32; case INT_64: return OriginalType.INT_64; case UINT_8: return OriginalType.UINT_8; case UINT_16: return OriginalType.UINT_16; case UINT_32: return OriginalType.UINT_32; case UINT_64: return OriginalType.UINT_64; case JSON: return OriginalType.JSON; case BSON: return OriginalType.BSON; default: throw new IllegalArgumentException("Unknown converted type " + type); } }
Source:
<code>public void started() { <START> Context.getService(HtmlFormEntryService.class).addHandler("encounterProviderAndRole", new EncounterProviderAndRoleTagHandler()); <END> log.info("Started HTML Form Entry Module"); }</code><technical_language>Instead of adding this here, this added entry "handlers" bean in moduleApplicationContext, other added. (Adding activator in 19ext module a bit of a hack)</technical_language>

Target:
public void started() { log.info("Started HTML Form Entry Module"); }
Source:
<code>public void send(Message<?> message, ScopeDescriptor scopeDescription) throws Exception { if (scopeDescription instanceof AggregateDescriptor) { <START> load(((AggregateDescriptor) scopeDescription).getIdentifier().toString()).handle(message); <END> } }</code><technical_language>loading aggregate result in Exception. In case of AggregateNotFoundException, want silently ignore (but log debug level) message. is uncommon for Aggregate deleted a deadline expires</technical_language>

Target:
public void send(Message<?> message, ScopeDescriptor scopeDescription) throws Exception { CompletableFuture future = new CompletableFuture(); send(message, scopeDescription, future); try { future.get(); } catch (ExecutionException e) { if (e.getCause() instanceof Exception) { throw (Exception) e.getCause(); } throw e; } }
Source:
<code>protected ReconnectingChannel createReconnectingChannel(final InetSocketAddress host) throws IOException { return new ReconnectingChannel(options.getTimeoutMs(), new ReconnectingChannel.Factory() { @Override public Channel createChannel() throws IOException { return NettyChannelBuilder .forAddress(host) .sslContext(createSslContext()) .eventLoopGroup(elg) .executor(batchPool) .negotiationType(NegotiationType.TLS) .flowControlWindow(1 << 20) .build(); } @Override public Closeable createClosable(final Channel channel) { return new Closeable() { @Override public void close() throws IOException { ChannelImpl channelImpl = (ChannelImpl) channel; channelImpl.shutdown(); try { <START> channelImpl.awaitTermination(CHANNEL_TERMINATE_WAIT_MS, TimeUnit.MILLISECONDS); <END> } catch (InterruptedException e) { Thread.interrupted(); throw new IOException("Interrupted while sleeping for close", e); } if (!channelImpl.isTerminated()) { throw new IOException("Could not close the channel. "); } } }; } }); }</code><technical_language>want retry if times out</technical_language>

Target:
protected ReconnectingChannel createReconnectingChannel(final InetSocketAddress host) throws IOException { return new ReconnectingChannel(options.getTimeoutMs(), new ReconnectingChannel.Factory() { @Override public Channel createChannel() throws IOException { return NettyChannelBuilder .forAddress(host) .sslContext(createSslContext()) .eventLoopGroup(elg) .executor(batchPool) .negotiationType(NegotiationType.TLS) .flowControlWindow(1 << 20) .build(); } @Override public Closeable createClosable(final Channel channel) { return new Closeable() { @Override public void close() throws IOException { ChannelImpl channelImpl = (ChannelImpl) channel; channelImpl.shutdown(); try { channelImpl.awaitTermination(options.getTimeoutMs(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.interrupted(); throw new IOException("Interrupted while sleeping for close", e); } if (!channelImpl.isTerminated()) { throw new IOException("Could not close the channel after " + options.getTimeoutMs() + " ms."); } } }; } }); }
Source:
<code>protected void doService(ToolPageContext page) throws IOException, ServletException { String typeId = page.param(String.class, "typeId"); <START> Class<?> rteClass = ObjectType.getInstance(UUID.fromString(typeId)).getObjectClass(); <END> RichTextElement rte = (RichTextElement) TypeDefinition.getInstance(rteClass).newInstance(); rte.fromAttributes((Map<String, String>) ObjectUtils.fromJson(page.param(String.class, "attributes"))); try { rte.writePreviewHtml(page); } catch (RuntimeException error) { } }</code><technical_language>Get habit of ObjectUtils.to(UUID.class, ...) faster</technical_language>

Target:
protected void doService(ToolPageContext page) throws IOException, ServletException { UUID typeId = page.param(UUID.class, "typeId"); Class<?> rteClass = ObjectType.getInstance(typeId).getObjectClass(); RichTextElement rte = (RichTextElement) TypeDefinition.getInstance(rteClass).newInstance(); rte.fromAttributes((Map<String, String>) ObjectUtils.fromJson(page.param(String.class, "attributes"))); try { rte.writePreviewHtml(page); } catch (RuntimeException error) { } }
Source:
<code>public String[] importArchive(InputStream in, final String name) throws Exception { File tempCache = new File(getLocalCacheDir(), System.currentTimeMillis()+""); List<String> importedTargetTranslationSlugs = new ArrayList<>(); try { tempCache.mkdirs(); Zip.unzipFromStream(in, tempCache); importArchiveFromTempCache(tempCache, importedTargetTranslationSlugs); } catch (Exception e) { throw e; } finally { IOUtils.closeQuietly(in); FileUtils.deleteQuietly(tempCache); } String[] translationSlugs = importedTargetTranslationSlugs.toArray(new String[importedTargetTranslationSlugs.size()]); <START> boolean success = TargetTranslationMigrator.migrate(tempCache,translationSlugs); <END> return translationSlugs; }</code><technical_language>This is redundant ran migration time reach this line</technical_language>

Target:
public String[] importArchive(InputStream in, final String name) throws Exception { File tempCache = new File(getLocalCacheDir(), System.currentTimeMillis()+""); List<String> importedTargetTranslationSlugs = new ArrayList<>(); try { tempCache.mkdirs(); Zip.unzipFromStream(in, tempCache); importArchiveFromTempCache(tempCache, importedTargetTranslationSlugs); } catch (Exception e) { throw e; } finally { IOUtils.closeQuietly(in); FileUtils.deleteQuietly(tempCache); } return importedTargetTranslationSlugs.toArray(new String[importedTargetTranslationSlugs.size()]); }
Source:
<code><START> protected void init() { <END> proxy = null; }</code><technical_language>initialise proxyPanel (otherwise defaults applied, e.g "Remove Unsupported Encodings" is selected default)</technical_language>

Target:
protected void init() { proxy = null; this.getFieldsPanel(); ProxiesParamProxy paramProxy = new ProxiesParamProxy(true); proxyPanel.setProxy(paramProxy); }
Source:
<code>public void cancel() { <START> objPeakDetection.cancel(); <END> }</code><technical_language>If this method is called execute(), throw a NullPointerException</technical_language>

Target:
public void cancel() { if (objPeakDetection != null) { objPeakDetection.cancel(); canceled = true; } }
Source:
<code>public CosmosDBAccountImpl withIpRangeFilter(String ipRangeFilter) { List<IpAddressOrRange> rules = new ArrayList<>(); <START> for (String ip : ipRangeFilter.split(",")) { rules.add(new IpAddressOrRange().withIpAddressOrRange(ip)); } <END> this.innerModel().withIpRules(rules); return this; }</code><technical_language>CoreUtils.isNullOrEmpty</technical_language>

Target:
public CosmosDBAccountImpl withIpRangeFilter(String ipRangeFilter) { List<IpAddressOrRange> rules = new ArrayList<>(); if (!CoreUtils.isNullOrEmpty(ipRangeFilter)) { for (String ip : ipRangeFilter.split(",")) { rules.add(new IpAddressOrRange().withIpAddressOrRange(ip)); } } this.innerModel().withIpRules(rules); return this; }