auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public AzureBlobFileSystemStore getAbfsStore() { return abfsStore; }

Target:
AzureBlobFileSystemStore getAbfsStore() { return abfsStore; }
Source:
public static <K, V> Block createMapBlock(MapType type, Map<K, V> map) { BlockBuilder blockBuilder = type.createBlockBuilder(null, 1); for (Map.Entry<K, V> entry : map.entrySet()) { BlockBuilder entryBuilder = blockBuilder.beginBlockEntry(); appendToBlockBuilder(BIGINT, entry.getKey(), entryBuilder); appendToBlockBuilder(BIGINT, entry.getValue(), entryBuilder); blockBuilder.closeEntry(); } return blockBuilder.build(); }

Target:
public static <K, V> Block createMapBlock(MapType type, Map<K, V> map) { BlockBuilder blockBuilder = type.createBlockBuilder(null, map.size()); for (Map.Entry<K, V> entry : map.entrySet()) { BlockBuilder entryBuilder = blockBuilder.beginBlockEntry(); appendToBlockBuilder(BIGINT, entry.getKey(), entryBuilder); appendToBlockBuilder(BIGINT, entry.getValue(), entryBuilder); blockBuilder.closeEntry(); } return blockBuilder.build(); }
Source:
private void checkPrivateEndpointForExistingNetworkLink(ValidationResultBuilder resultBuilder, EnvironmentDto environmentDto, NetworkDto networkDto) { if (networkDto.getServiceEndpointCreation() == ServiceEndpointCreation.ENABLED_PRIVATE_ENDPOINT && ResourceGroupUsagePattern.USE_MULTIPLE != getResourceGroupUsagePattern(environmentDto)) { CloudCredential cloudCredential = credentialToCloudCredentialConverter.convert(environmentDto.getCredential()); AzureClient azureClient = azureClientService.getClient(cloudCredential); Optional<String> resourceGroupName = getAzureResourceGroupDto(environmentDto) .map(AzureResourceGroupDto::getName); ValidationResult validationResult; if (resourceGroupName.isPresent()) { validationResult = azureNetworkLinkService.validateExistingNetworkLink(azureClient, networkDto.getAzure().getNetworkId(), resourceGroupName.get()); NullUtil.doIfNotNull(validationResult, resultBuilder::merge); } else { resultBuilder.error("Resource group name is not specified in the environment request!"); } } }

Target:
private void checkPrivateEndpointForExistingNetworkLink(ValidationResultBuilder resultBuilder, EnvironmentDto environmentDto, NetworkDto networkDto) { if (networkDto.getServiceEndpointCreation() == ServiceEndpointCreation.ENABLED_PRIVATE_ENDPOINT && ResourceGroupUsagePattern.USE_MULTIPLE != getResourceGroupUsagePattern(environmentDto)) { CloudCredential cloudCredential = credentialToCloudCredentialConverter.convert(environmentDto.getCredential()); AzureClient azureClient = azureClientService.getClient(cloudCredential); Optional<String> resourceGroupName = getAzureResourceGroupDto(environmentDto) .map(AzureResourceGroupDto::getName); resourceGroupName.ifPresent(rgName -> NullUtil.doIfNotNull( azureNetworkLinkService.validateExistingNetworkLink(azureClient, networkDto.getAzure().getNetworkId(), rgName), resultBuilder::merge)); } }
Source:
private List<ConstraintViolation> validateComplexTypeProperty(Schema schema, List<PathNode> path, Property prop, boolean dirtyOnly) { Field field = prop.getField(); assert field.getType().isComplexType(); List<ConstraintViolation> violations = new ArrayList<ConstraintViolation>(); boolean allChildrenPhantom = true; for (Property child : prop.getChildren()) { if (!child.isPhantom()) { allChildrenPhantom = false; break; } } Object value = prop.getValue(); if (prop.isPhantom() || value == null || allChildrenPhantom) { if (!field.isNillable()) { addNotNullViolation(violations, schema, path); } } else { if (value instanceof Map) { @SuppressWarnings("unchecked") Map<String, Object> castedValue = (Map<String, Object>) value; long nonNull = castedValue.values().stream().filter(Objects::nonNull).count(); if (castedValue.isEmpty() || nonNull < 1) { if (!field.isNillable()) { addNotNullViolation(violations, schema, path); } } else { for (Property child : prop.getChildren()) { List<PathNode> subPath = new ArrayList<PathNode>(path); subPath.add(new PathNode(child.getField())); violations.addAll(validateAnyTypeProperty(schema, subPath, child, dirtyOnly, true)); } } } } return violations; }

Target:
private List<ConstraintViolation> validateComplexTypeProperty(Schema schema, List<PathNode> path, Property prop, boolean dirtyOnly) { Field field = prop.getField(); assert field.getType().isComplexType(); List<ConstraintViolation> violations = new ArrayList<ConstraintViolation>(); boolean allChildrenPhantom = true; for (Property child : prop.getChildren()) { if (!child.isPhantom()) { allChildrenPhantom = false; break; } } Object value = prop.getValue(); if (prop.isPhantom() || value == null || allChildrenPhantom) { if (!field.isNillable()) { addNotNullViolation(violations, schema, path); } } else { if (value instanceof Map) { @SuppressWarnings("unchecked") Map<String, Object> castedValue = (Map<String, Object>) value; if (castedValue.isEmpty() || castedValue.values().stream().allMatch(Objects::isNull)) { if (!field.isNillable()) { addNotNullViolation(violations, schema, path); } } else { for (Property child : prop.getChildren()) { List<PathNode> subPath = new ArrayList<PathNode>(path); subPath.add(new PathNode(child.getField())); violations.addAll(validateAnyTypeProperty(schema, subPath, child, dirtyOnly, true)); } } } } return violations; }
Source:
private static void ingestTimeRangeDataForDuplicateDeletion( final Calendar cal, final Writer writer, final SimpleFeatureBuilder featureTimeRangeBuilder, final int min, final int max, final int field, final String name ) throws IOException { final GeometryFactory geomFactory = new GeometryFactory(); final int midPoint = (int) Math.floor((min + max) / 2.0); cal.set( field, min); featureTimeRangeBuilder.add(geomFactory.createPoint(new Coordinate( 0, 0))); featureTimeRangeBuilder.add(cal.getTime()); cal.set( field, max); featureTimeRangeBuilder.add(cal.getTime()); SimpleFeature feature = featureTimeRangeBuilder.buildFeature(name + ":fullrange"); writer.write(feature); }

Target:
private static void ingestTimeRangeDataForDuplicateDeletion( final Calendar cal, final Writer writer, final SimpleFeatureBuilder featureTimeRangeBuilder, final int min, final int max, final int field, final String name ) throws IOException { final GeometryFactory geomFactory = new GeometryFactory(); cal.set( field, min); featureTimeRangeBuilder.add(geomFactory.createPoint(new Coordinate( 0, 0))); featureTimeRangeBuilder.add(cal.getTime()); cal.set( field, max); featureTimeRangeBuilder.add(cal.getTime()); SimpleFeature feature = featureTimeRangeBuilder.buildFeature(name + ":fullrange"); writer.write(feature); }
Source:
private HttpResponse sendToNodeServlet(Class<? extends HttpServlet> servlet, List<NameValuePair> nvps) { LOGGER.entering(); final int TIME_OUT = 30 * 1000; RequestConfig config = RequestConfig.custom().setConnectTimeout(TIME_OUT).setSocketTimeout(TIME_OUT).build(); CloseableHttpClient client = HttpClientBuilder.create().setDefaultRequestConfig(config).build(); String url = String.format("http://%s:%d/extra/%s", machine, this.getRemoteHost().getPort(), servlet.getSimpleName()); HttpResponse postResponse = null; try { HttpPost post = new HttpPost(url); post.setEntity(new UrlEncodedFormEntity(nvps)); postResponse = client.execute(post); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } finally { try { client.close(); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } } LOGGER.exiting(postResponse); return postResponse; }

Target:
private HttpResponse sendToNodeServlet(Class<? extends HttpServlet> servlet, List<NameValuePair> nvps) { LOGGER.entering(); RequestConfig config = RequestConfig.custom().setConnectTimeout(CONNECTION_TIMEOUT).setSocketTimeout(CONNECTION_TIMEOUT).build(); CloseableHttpClient client = HttpClientBuilder.create().setDefaultRequestConfig(config).build(); String url = String.format("http://%s:%d/extra/%s", machine, this.getRemoteHost().getPort(), servlet.getSimpleName()); HttpResponse postResponse = null; try { HttpPost post = new HttpPost(url); post.setEntity(new UrlEncodedFormEntity(nvps)); postResponse = client.execute(post); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } finally { try { client.close(); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } } LOGGER.exiting(postResponse); return postResponse; }
Source:
void checkBlacklist(HttpRequest req, List<String> blacklist) { if (blacklist.contains(req.headers().get(HttpHeaderNames.HOST).toLowerCase())) { stripXFFHeaders(req); } }

Target:
void checkBlacklist(HttpRequest req, List<String> blacklist) { if (blacklist.stream().anyMatch(h -> h.equalsIgnoreCase(req.headers().get(HttpHeaderNames.HOST)))) { stripXFFHeaders(req); } }
Source:
public Stream getStream(String streamId) { for (Stream stream : this.getDeclaredOutputs()) { if (stream.getId().equals(streamId)) { return stream; } } throw new IllegalArgumentException("Invalid streamId " + streamId); }

Target:
public Stream getStream(String streamId) { for (Stream stream : this.getDeclaredOutputStreams()) { if (stream.getId().equals(streamId)) { return stream; } } throw new IllegalArgumentException("Invalid streamId " + streamId); }
Source:
public Instance(@JsonProperty(value = "host", required = true) String host, @JsonProperty(value = "port", required = true) int port, @JsonProperty(value = "type", required = true) InstanceType type, @JsonProperty("tags") @Nullable List<String> tags, @JsonProperty("pools") @Nullable Map<String, Integer> pools, @JsonProperty("grpcPort") int grpcPort) { Preconditions.checkArgument(host != null, "'host' must be configured"); Preconditions.checkArgument(type != null, "'type' must be configured"); _host = host; _port = port; _type = type; _tags = tags; _pools = pools; _grpcPort = grpcPort; }

Target:
public Instance(@JsonProperty(value = "host", required = true) String host, @JsonProperty(value = "port", required = true) int port, @JsonProperty(value = "type", required = true) InstanceType type, @JsonProperty("tags") @Nullable List<String> tags, @JsonProperty("pools") @Nullable Map<String, Integer> pools, @JsonProperty("grpcPort") int grpcPort) { Preconditions.checkArgument(host != null, "'host' must be configured"); Preconditions.checkArgument(type != null, "'type' must be configured"); _host = host; _port = port; _type = type; _tags = tags; _pools = pools; if (grpcPort == 0) { _grpcPort = NOT_SET_GRPC_PORT_VALUE; } else { _grpcPort = grpcPort; } }
Source:
private State mapResponseToState(final InfoResponse infoResponse, final String deviceName, final NeoStatProperty property) { final Device deviceInfo = infoResponse.getDevice(deviceName); if (deviceInfo == null) { logger.warn("Failed to find device info for {}", deviceName); return UnDefType.NULL; } switch (property) { case CurrentTemperature: BigDecimal currentTemperature = deviceInfo.getCurrentTemperature(); if (currentTemperature.intValue() == 255) { logger.warn("Current temperature for device is out of range (is device off?): {}", deviceName, currentTemperature); return UnDefType.UNDEF; } return new DecimalType(currentTemperature); case CurrentFloorTemperature: BigDecimal currentFloortemperature = deviceInfo.getCurrentFloorTemperature(); if (currentFloortemperature.intValue() == 127) { logger.warn("Current floor temperature for device is out of range (is floor sensor off?): {}", deviceName, currentFloortemperature); return UnDefType.UNDEF; } return new DecimalType(deviceInfo.getCurrentFloorTemperature()); case CurrentSetTemperature: return new DecimalType(deviceInfo.getCurrentSetTemperature()); case DeviceName: return new StringType(deviceInfo.getDeviceName()); case Away: return deviceInfo.isAway() ? OnOffType.ON : OnOffType.OFF; case Standby: return deviceInfo.isStandby() ? OnOffType.ON : OnOffType.OFF; case Heating: return (deviceInfo.isHeating() || deviceInfo.isPreHeat()) ? OnOffType.ON : OnOffType.OFF; default: throw new IllegalStateException( String.format("No result mapping configured for this neo stat property: %s", property)); } }

Target:
private State mapResponseToState(final InfoResponse infoResponse, final String deviceName, final NeoStatProperty property) { final Device deviceInfo = infoResponse.getDevice(deviceName); if (deviceInfo == null) { logger.warn("Failed to find device info for {}", deviceName); return UnDefType.NULL; } switch (property) { case CurrentTemperature: BigDecimal currentTemperature = deviceInfo.getCurrentTemperature(); if (currentTemperature.intValue() == 255) { logger.debug("Current temperature for device is out of range (is device off?): {}", deviceName, currentTemperature); return UnDefType.UNDEF; } return new DecimalType(currentTemperature); case CurrentFloorTemperature: BigDecimal currentFloortemperature = deviceInfo.getCurrentFloorTemperature(); if (currentFloortemperature.intValue() == 127) { logger.debug("Current floor temperature for device is out of range (is floor sensor off?): {}", deviceName, currentFloortemperature); return UnDefType.UNDEF; } return new DecimalType(deviceInfo.getCurrentFloorTemperature()); case CurrentSetTemperature: return new DecimalType(deviceInfo.getCurrentSetTemperature()); case DeviceName: return new StringType(deviceInfo.getDeviceName()); case Away: return deviceInfo.isAway() ? OnOffType.ON : OnOffType.OFF; case Standby: return deviceInfo.isStandby() ? OnOffType.ON : OnOffType.OFF; case Heating: return (deviceInfo.isHeating() || deviceInfo.isPreHeat()) ? OnOffType.ON : OnOffType.OFF; default: throw new IllegalStateException( String.format("No result mapping configured for this neo stat property: %s", property)); } }
Source:
public boolean setTimeAddition(long newTimeIn) { if (getWorld().getWorld().getDayTime() > newTimeIn) return false; this.newTime = newTimeIn; return true; }

Target:
public boolean setTimeAddition(long newTimeIn) { if (minTime > newTimeIn) return false; this.newTime = newTimeIn; return true; }
Source:
public CosmosDataAccessor(AsyncDocumentClient asyncDocumentClient, String cosmosCollectionLink, AzureMetrics azureMetrics) { this.asyncDocumentClient = asyncDocumentClient; this.cosmosCollectionLink = cosmosCollectionLink; this.azureMetrics = azureMetrics; }

Target:
CosmosDataAccessor(AsyncDocumentClient asyncDocumentClient, String cosmosCollectionLink, AzureMetrics azureMetrics) { this.asyncDocumentClient = asyncDocumentClient; this.cosmosCollectionLink = cosmosCollectionLink; this.azureMetrics = azureMetrics; }
Source:
public List<String> get(Path path, FileSystem.Permission permission) { switch (permission) { case READ: return readers.getAllowed(path); case WRITE: return writers.getAllowed(path); default: throw new IllegalStateException("Unimplemented"); } }

Target:
public List<String> get(Path path, FileSystem.Permission permission) { switch (permission) { case WRITE: return writers.getAllowed(path); case READ: List<String> allowed = readers.getAllowed(path); List<String> allowed2 = writers.getAllowed(path); return new ArrayList<>(Stream.of(allowed, allowed2).flatMap(e -> e.stream()).collect(Collectors.toSet())); default: throw new IllegalStateException("Unimplemented"); } }
Source:
private boolean removeDelayedMessageFromMessageStore(Message<?> message) { if (this.messageStore instanceof SimpleMessageStore) { synchronized (this.messageGroupId) { Collection<Message<?>> messages = this.messageStore.getMessageGroup(this.messageGroupId).getMessages(); if (messages.contains(message)) { this.messageStore.removeMessageFromGroup(this.messageGroupId, message); return true; } else { return false; } } } else { return ((MessageStore) this.messageStore).removeMessage(message.getHeaders().getId()) != null; } }

Target:
private boolean removeDelayedMessageFromMessageStore(Message<?> message) { if (this.messageStore instanceof SimpleMessageStore) { synchronized (this.messageGroupId) { Collection<Message<?>> messages = this.messageStore.getMessageGroup(this.messageGroupId).getMessages(); if (messages.contains(message)) { this.messageStore.removeMessagesFromGroup(this.messageGroupId, message); return true; } else { return false; } } } else { return ((MessageStore) this.messageStore).removeMessage(message.getHeaders().getId()) != null; } }
Source:
public String updatePublishers(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response, @PathVariable("appSlug") String slug, @RequestParam("enabled") String enabled, @RequestParam("disabled") String disabled) { Application app = null; for (String pubKey : CSV_SPLITTER.split(enabled)) { Publisher publisher = Publisher.fromKey(pubKey).valueOrNull(); if (publisher != null) { app = manager.enablePublisher(slug, publisher); } } for (String pubKey : CSV_SPLITTER.split(disabled)) { Publisher publisher = Publisher.fromKey(pubKey).valueOrNull(); if (publisher != null) { app = manager.disablePublisher(slug, publisher); } } model.put("application", modelBuilder.build(app)); return APPLICATION_TEMPLATE; }

Target:
public String updatePublishers(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response, @PathVariable("appSlug") String slug, @RequestParam("enabled") String enabled, @RequestParam("disabled") String disabled) { Application app = null; List<Publisher> enabledPubs = Publisher.fromCsv(enabled); for (Publisher publisher : enabledPubs) { app = manager.enablePublisher(slug, publisher); } List<Publisher> disabledPubs = Publisher.fromCsv(disabled); for (Publisher publisher : disabledPubs) { app = manager.disablePublisher(slug, publisher); } model.put("application", modelBuilder.build(app)); return APPLICATION_TEMPLATE; }
Source:
public DimensionSelectorHavingSpec( @JsonProperty("dimension") String dimName, @JsonProperty("value") String value, @JsonProperty("extractionFn") ExtractionFn extractionFn ) { this.dimension = Preconditions.checkNotNull(dimName, "Must have attribute 'dimension'"); this.value = value; this.extractionFn = extractionFn; }

Target:
public DimensionSelectorHavingSpec( @JsonProperty("dimension") String dimName, @JsonProperty("value") String value, @JsonProperty("extractionFn") ExtractionFn extractionFn ) { dimension = Preconditions.checkNotNull(dimName, "Must have attribute 'dimension'"); this.value = value; if (extractionFn != null) { this.extractionFn = extractionFn; } else { this.extractionFn = new IdentityExtractionFn(); } }
Source:
public Builder setOldRevision(Revision revision) { switch (type) { case DIFF: case LOG: this.oldRevision = revision; break; default: checkState(revision == null, "cannot set old revision on %s view", type); this.oldRevision = revision; break; } return this; }

Target:
public Builder setOldRevision(Revision revision) { switch (type) { case DIFF: case LOG: this.oldRevision = revision; return this; default: throw new IllegalStateException( String.format("cannot set old revision on %s view", type)); } }
Source:
protected void doStart() { try { if(datagram) { log.info("Starting Netty UDP server on port {}", port); Bootstrap boot = new Bootstrap(); boot.group(wrkr) .channel(NioDatagramChannel.class) .option(ChannelOption.SO_BACKLOG, 128) .option(ChannelOption.SO_KEEPALIVE, true) .handler(adapter); sock = boot.bind(port).sync(); } else { log.info("Starting Netty TCP server on port {}", port); ServerBootstrap boot = new ServerBootstrap(); boot.group(boss, wrkr) .channel(NioServerSocketChannel.class) .childHandler(adapter) .option(ChannelOption.SO_BACKLOG, 128) .option(ChannelOption.SO_KEEPALIVE, true); sock = boot.bind(port).sync(); } log.info("Netty server started"); notifyStarted(); } catch (InterruptedException e) { log.warn("Netty server start interrupted"); Thread.currentThread().interrupt(); notifyFailed(e); } }

Target:
protected void doStart() { try { if(datagram) { log.info("Starting Netty UDP server on port {}", port); Bootstrap boot = new Bootstrap(); boot.group(wrkr) .channel(NioDatagramChannel.class) .handler(adapter); sock = boot.bind(port).sync(); } else { log.info("Starting Netty TCP server on port {}", port); ServerBootstrap boot = new ServerBootstrap(); boot.group(boss, wrkr) .channel(NioServerSocketChannel.class) .childHandler(adapter) .option(ChannelOption.SO_BACKLOG, 128) .option(ChannelOption.SO_KEEPALIVE, true); sock = boot.bind(port).sync(); } log.info("Netty server started"); notifyStarted(); } catch (InterruptedException e) { log.warn("Netty server start interrupted"); Thread.currentThread().interrupt(); notifyFailed(e); } }
Source:
private void openShareMenu() { ShareUtils.showShareMenu( ShareUtils.newShareIntent(courseData.getCertificateURL(), null), getActivity().findViewById(R.id.course_detail_share), new ShareUtils.ShareMenuItemListener() { @Override public void onMenuItemClick(@NonNull ComponentName componentName) { String shareText = ResourceUtil.getFormattedString( getResources(), R.string.share_course, "platform_name", getString(R.string.platform_name)).toString(); String shareLink = courseData.getCourse().getCourse_about(); String event_type = componentName.getPackageName().toString(); System.out.println("Share course event:" + event_type); switch (event_type) { case "com.facebook.katana": event_type = "facebook"; break; case "com.twitter.android": event_type = "twitter"; break; default: event_type = "other"; break; } segIO.courseDetailShared( courseData.getCourse().getId(), "social-sharing", shareLink, event_type); final Intent intent = ShareUtils.newShareIntent( shareText + "\n" + shareLink, null); intent.setComponent(componentName); startActivity(intent); } }); }

Target:
private void openShareMenu() { final String shareText = ResourceUtil.getFormattedString( getResources(), R.string.share_course_message, "platform_name", getString(R.string.platform_name)).toString() + "\n" + courseData.getCourse().getCourse_about(); ShareUtils.showShareMenu( ShareUtils.newShareIntent(shareText), getActivity().findViewById(R.id.course_detail_share), new ShareUtils.ShareMenuItemListener() { @Override public void onMenuItemClick(@NonNull ComponentName componentName) { segIO.courseDetailShared(courseData.getCourse().getId(), shareText, componentName); final Intent intent = ShareUtils.newShareIntent(shareText); intent.setComponent(componentName); startActivity(intent); } }, R.string.share_course_popup_header); }
Source:
public void stop() throws ConnectException { log.info("Stopping table monitoring thread"); tableMonitorThread.shutdown(); try { tableMonitorThread.join(MAX_TIMEOUT); } catch (InterruptedException e) { } finally { try { cachedConnectionProvider.close(); } finally { try { if (dialect != null) { dialect.close(); } } finally { dialect = null; } } } }

Target:
public void stop() throws ConnectException { log.info("Stopping table monitoring thread"); tableMonitorThread.shutdown(); try { tableMonitorThread.join(MAX_TIMEOUT); } catch (InterruptedException e) { } finally { try { cachedConnectionProvider.close(); } finally { try { if (dialect != null) { dialect.close(); } } catch (Throwable t) { log.warn("Error while closing the dialect: ", dialect, t); } finally { dialect = null; } } } }
Source:
protected void createColumns() { createColumn(Messages.LatencyTableViewer_startTime, new LatencyTableColumnLabelProvider() { @Override public String getTextForITimeRange(ISegment input) { return NonNullUtils.nullToEmptyString(TmfTimestampFormat.getDefaulTimeFormat().format(input.getStart())); } }, new StartTimeColumnComparator()); createColumn(Messages.LatencyTableViewer_endTime, new LatencyTableColumnLabelProvider() { @Override public String getTextForITimeRange(ISegment input) { return NonNullUtils.nullToEmptyString(TmfTimestampFormat.getDefaulTimeFormat().format(input.getEnd())); } }, new EndTimeColumComparator()); createColumn(Messages.LatencyTableViewer_duration, new LatencyTableColumnLabelProvider() { @Override public String getTextForITimeRange(ISegment input) { return NonNullUtils.nullToEmptyString(Long.toString(input.getLength())); } }, new DurationColumnComparator()); }

Target:
private void createColumns() { createColumn(Messages.LatencyTableViewer_startTime, new LatencyTableColumnLabelProvider() { @Override public String getTextForITimeRange(ISegment input) { return NonNullUtils.nullToEmptyString(TmfTimestampFormat.getDefaulTimeFormat().format(input.getStart())); } }, TreeMapStore.INTERVAL_START_COMPARATOR); createColumn(Messages.LatencyTableViewer_endTime, new LatencyTableColumnLabelProvider() { @Override public String getTextForITimeRange(ISegment input) { return NonNullUtils.nullToEmptyString(TmfTimestampFormat.getDefaulTimeFormat().format(input.getEnd())); } }, TreeMapStore.INTERVAL_END_COMPARATOR); createColumn(Messages.LatencyTableViewer_duration, new LatencyTableColumnLabelProvider() { @Override public String getTextForITimeRange(ISegment input) { return NonNullUtils.nullToEmptyString(Long.toString(input.getLength())); } }, TreeMapStore.INTERVAL_LENGTH_COMPARATOR); }
Source:
public static void buildMiniDFS() throws Exception { File baseDir = folder.newFolder(); Configuration conf = new Configuration(); conf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, baseDir.getAbsolutePath()); MiniDFSCluster.Builder builder = new MiniDFSCluster.Builder(conf); dfsCluster = builder.build(); dfsCluster.waitActive(); fileSystem = FileSystem.newInstance(conf); }

Target:
public static void buildMiniDFS() throws Exception { File baseDir = TEMP_FOLDER.newFolder(); Configuration conf = new Configuration(); conf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, baseDir.getAbsolutePath()); dfsCluster = new MiniDFSCluster.Builder(conf).build(); dfsCluster.waitActive(); fileSystem = FileSystem.newInstance(conf); sshServer = setupSSHDaemon(); sshServer.start(); }
Source:
public long getLastInputActivityTime() throws IOException { RTPConnectorInputStream in = getRTPConnector().getDataInputStream(false); if (in != null) return in.getLastActivityTime(); else return -1; }

Target:
public long getLastInputActivityTime() throws IOException { RTPConnectorInputStream inData = getRTPConnector().getDataInputStream(false); long inDataActivity = -1; if (inData != null) { inDataActivity = inData.getLastActivityTime(); } RTPConnectorInputStream inControl = getRTPConnector().getControlInputStream(false); long inControlActivity = -1; if (inControl != null) { inControlActivity = inControl.getLastActivityTime(); } return Math.max(inControlActivity, inDataActivity); }
Source:
public void testGenotypesSearchByNameKIT() throws InvalidProtocolBufferException, UnirestException, GAWrapperException { final String phenotypeAssociationSetId = Utils.getPhenotypeAssociationSetId(client); SearchFeaturesRequest request = SearchFeaturesRequest .newBuilder() .setFeatureSetId(Utils.getFeatureG2PSetId(client)) .setName(TestData.FEATURE_NAME) .build(); SequenceAnnotationServiceOuterClass.SearchFeaturesResponse response = client.sequenceAnnotations.searchFeatures(request); assertThat(response.getFeaturesList()).isNotNull() ; assertThat(response.getFeaturesList()).isNotEmpty() ; assertThat(response.getFeaturesList().size()).isEqualTo(3) ; }

Target:
public void testGenotypesSearchByNameKIT() throws InvalidProtocolBufferException, UnirestException, GAWrapperException { SearchFeaturesRequest request = SearchFeaturesRequest .newBuilder() .setFeatureSetId(Utils.getFeatureG2PSetId(client)) .setName(TestData.FEATURE_NAME) .build(); SequenceAnnotationServiceOuterClass.SearchFeaturesResponse response = client.sequenceAnnotations.searchFeatures(request); assertThat(response.getFeaturesList()).isNotNull() ; assertThat(response.getFeaturesList()).isNotEmpty() ; assertThat(response.getFeaturesList().size()).isEqualTo(3) ; }
Source:
protected void doExecute() { DiagramDescription diagramdesc = DescriptionFactory.eINSTANCE.createDiagramDescription(); diagramdesc.setName(BASE_ID + ".default.layer"); viewpoint.getOwnedRepresentations().add(diagramdesc); Layer layer = DescriptionFactory.eINSTANCE.createLayer(); diagramdesc.setDefaultLayer(layer); ToolSection toolSection = createToolSection(layer); ContainerMapping packageMapping = packageCreation(layer, toolSection); ContainerMapping classMapping = classCreation(layer, toolSection); createAttribute(classMapping, toolSection); EdgeMapping edgeMappingInheritance = createEdgeMappingInheritance(layer, toolSection, classMapping); EdgeMapping edgeMappingReference = createEdgeMappingReference(layer, toolSection, classMapping); createDeleteTool(toolSection, classMapping, packageMapping, edgeMappingInheritance, edgeMappingReference); createEditTool(toolSection, classMapping, packageMapping, edgeMappingInheritance, edgeMappingReference); }

Target:
protected void doExecute() { DiagramDescription diagramdesc = DescriptionFactory.eINSTANCE.createDiagramDescription(); diagramdesc.setName(BASE_ID + ".default.layer"); viewpoint.getOwnedRepresentations().add(diagramdesc); Layer layer = DescriptionFactory.eINSTANCE.createLayer(); diagramdesc.setDefaultLayer(layer); ToolSection toolSection = createToolSection(layer); ContainerMapping packageMapping = createPackageMapping(layer, toolSection); ContainerMapping classMapping = createClassMapping(layer, toolSection); NodeMapping attribute = createAttribute(classMapping, toolSection); EdgeMapping edgeMappingInheritance = createEdgeMappingInheritance(layer, toolSection, classMapping); EdgeMapping edgeMappingReference = createEdgeMappingReference(layer, toolSection, classMapping); createDeleteTool(toolSection, classMapping, packageMapping, attribute, edgeMappingInheritance, edgeMappingReference); createEditTool(toolSection, classMapping, packageMapping, attribute, edgeMappingInheritance, edgeMappingReference); }
Source:
public void setToolTipText(String string) { super.setToolTipText(string); for (Sash sashe : sashes) { sashe.setToolTipText(string); } }

Target:
public void setToolTipText(String string) { super.setToolTipText(string); for (Sash sash : sashes) { sash.setToolTipText(string); } }
Source:
SubscribableQuerySubscription(Type responseType, Type updateType, SubscriptionQueryMessageHandler<? super QueryMessage<?, I>, I, U> queryHandler) { super(responseType, m -> { QueryUpdateEmitter<U> emitter = new QueryUpdateEmitter<U>() { @Override public void emit(U update) { } @Override public void complete() { } @Override public void error(Throwable error) { } }; return queryHandler.handle(m, emitter); }); this.updateType = updateType; this.subscriptionQueryMessageHandler = queryHandler; }

Target:
SubscribableQuerySubscription(Type responseType, Type updateType, SubscriptionQueryMessageHandler<? super QueryMessage<?, I>, I, U> queryHandler) { super(responseType, m -> queryHandler.handle(m, new NoOpQueryUpdateEmitter<>())); this.updateType = updateType; this.subscriptionQueryMessageHandler = queryHandler; }
Source:
public Response update(MultipartBody multipartBody, @Context UriInfo requestUriInfo) { LOGGER.trace("ENTERING: update"); Response response; List<Attachment> attachmentList = multipartBody.getAllAttachments(); File newFile = null; for (Attachment attachment : attachmentList) { newFile = createFileFromAttachement(attachment); } try { if (newFile == null) { throw new ApplicationServiceException("No file attachment provided."); } ZipFileApplicationDetails appDetails = ApplicationFileInstaller.getAppDetails(newFile); if (appDetails == null) { throw new ApplicationServiceException( "No Application details could be extracted from the provided file."); } Application existingApplication = appService.getApplication(appDetails.getName()); boolean wasExistingAppStarted = false; if (existingApplication != null) { wasExistingAppStarted = appService.isApplicationStarted(existingApplication); appService.removeApplication(existingApplication); } appService.addApplication(newFile.toURI()); if (wasExistingAppStarted) { appService.startApplication(appDetails.getName()); } Response.ResponseBuilder responseBuilder = Response.ok("{\"status\":\"success\"}").type("application/json"); response = responseBuilder.build(); } catch (ApplicationServiceException e) { LOGGER.warn("Unable to update an application on the server: {}", newFile, e); Response.ResponseBuilder responseBuilder = Response.serverError(); response = responseBuilder.build(); } return response; }

Target:
public Response update(MultipartBody multipartBody, @Context UriInfo requestUriInfo) { List<Attachment> attachmentList = multipartBody.getAllAttachments(); File newFile = null; for (Attachment attachment : attachmentList) { newFile = createFileFromAttachement(attachment); } try { if (newFile == null) { throw new ApplicationServiceException("No file attachment provided."); } ZipFileApplicationDetails appDetails = ApplicationFileInstaller.getAppDetails(newFile); if (appDetails == null) { throw new ApplicationServiceException( "No Application details could be extracted from the provided file."); } Application existingApplication = appService.getApplication(appDetails.getName()); boolean wasExistingAppStarted = false; if (existingApplication != null) { wasExistingAppStarted = appService.isApplicationStarted(existingApplication); appService.removeApplication(existingApplication); } appService.addApplication(newFile.toURI()); if (wasExistingAppStarted) { appService.startApplication(appDetails.getName()); } Response.ResponseBuilder responseBuilder = Response.ok("{\"status\":\"success\"}").type("application/json"); return responseBuilder.build(); } catch (ApplicationServiceException e) { LOGGER.warn("Unable to update an application on the server: {}", newFile, e); Response.ResponseBuilder responseBuilder = Response.serverError(); return responseBuilder.build(); } }
Source:
public List<NamedArrayList<? extends SCMTraitDescriptor<?>>> getTraitsDescriptorLists() { List<SCMTraitDescriptor<?>> all = new ArrayList<>(); all.addAll(SCMSourceTrait._for(this, GitHubSCMSourceContext.class, null)); all.addAll(SCMSourceTrait._for(this, null, GitHubSCMBuilder.class)); Set<SCMTraitDescriptor<?>> dedup = new HashSet<>(); for (Iterator<SCMTraitDescriptor<?>> iterator = all.iterator(); iterator.hasNext(); ) { SCMTraitDescriptor<?> d = iterator.next(); if (dedup.contains(d) || d instanceof GitBrowserSCMSourceTrait.DescriptorImpl) { iterator.remove(); } else { dedup.add(d); } } List<NamedArrayList<? extends SCMTraitDescriptor<?>>> result = new ArrayList<>(); NamedArrayList.select(all, Messages.within_repository(), NamedArrayList .anyOf(NamedArrayList.withAnnotation(Discovery.class), NamedArrayList.withAnnotation(Selection.class)), true, result); NamedArrayList.select(all, Messages.general(), null, true, result); return result; }

Target:
public List<NamedArrayList<? extends SCMTraitDescriptor<?>>> getTraitsDescriptorLists() { List<SCMTraitDescriptor<?>> all = new ArrayList<>(); all.addAll(SCMSourceTrait._for(this, GitHubSCMSourceContext.class, null)); all.addAll(SCMSourceTrait._for(this, null, GitHubSCMBuilder.class)); Set<SCMTraitDescriptor<?>> dedup = new HashSet<>(); for (Iterator<SCMTraitDescriptor<?>> iterator = all.iterator(); iterator.hasNext(); ) { SCMTraitDescriptor<?> d = iterator.next(); if (dedup.contains(d) || d instanceof GitBrowserSCMSourceTrait.DescriptorImpl) { iterator.remove(); } else { dedup.add(d); } } List<NamedArrayList<? extends SCMTraitDescriptor<?>>> result = new ArrayList<>(); NamedArrayList.select(all, Messages.GitHubSCMNavigator_withinRepository(), NamedArrayList .anyOf(NamedArrayList.withAnnotation(Discovery.class), NamedArrayList.withAnnotation(Selection.class)), true, result); NamedArrayList.select(all, Messages.GitHubSCMNavigator_general(), null, true, result); return result; }
Source:
private static void reportAppUpdate() { try { String username = CommCareApplication.instance().getRecordForCurrentUser().getUsername(); String updateLogMessage = "User " + username + " updated to app version " + ReportingUtils.getAppBuildNumber(); Logger.log(AndroidLogger.TYPE_USER, updateLogMessage); } catch (SessionUnavailableException e) { } }

Target:
private static void reportAppUpdate() { String updateLogMessage = "Update to app version " + ReportingUtils.getAppBuildNumber(); try { String username = CommCareApplication.instance().getRecordForCurrentUser().getUsername(); updateLogMessage += " by user " + username; } catch (SessionUnavailableException e) { } Logger.log(AndroidLogger.TYPE_RESOURCES, updateLogMessage); }
Source:
private static boolean isApiKey(String value) { if (Strings.isNullOrEmpty(value)) { return false; } try { UUID.fromString(value); } catch (IllegalArgumentException e) { return false; } return true; }

Target:
private static boolean isApiKey(String value) { if (isNullOrEmpty(value)) { return false; } try { UUID.fromString(value); } catch (IllegalArgumentException e) { return false; } return true; }
Source:
@Override protected void onFinishInflate() { super.onFinishInflate(); ButterKnife.inject(this); File filesDir = getContext().getExternalFilesDir(null); final File file = new File(filesDir, "shakespeare.txt"); FileOutputStream out = null; try { out = new FileOutputStream(file); out.write(SHAKESPEARE.getBytes()); } catch (java.io.IOException e) { throw new RuntimeException(e); } finally { if (out != null) { try { out.close(); } catch (IOException ignored) { } } } telescopeView.setLens( new EmailLens(getContext(), new String[] { "bugs@blackhole.io" }, "Bug report") { @Override protected Set<Uri> getAdditionalAttachments() { HashSet<Uri> attachments = new HashSet<>(); attachments.add(Uri.fromFile(file)); return attachments; } } ); }

Target:
@Override protected void onFinishInflate() { super.onFinishInflate(); ButterKnife.inject(this); File filesDir = getContext().getExternalFilesDir(null); final File file = new File(filesDir, "shakespeare.txt"); FileOutputStream out = null; try { out = new FileOutputStream(file); out.write(SHAKESPEARE.getBytes()); } catch (java.io.IOException e) { throw new RuntimeException(e); } finally { if (out != null) { try { out.close(); } catch (IOException ignored) { } } } telescopeView.setLens( new EmailLens(getContext(), new String[] { "bugs@blackhole.io" }, "Bug report") { @Override protected Set<Uri> getAdditionalAttachments() { return Collections.singleton(Uri.fromFile(file)); } } ); }
Source:
private void checkBlockSizeReached() throws IOException { if (recordCount >= recordCountForNextMemCheck) { boolean startNewRowGroup = false; long memSize = columnStore.getBufferedSize(); long recordSize = memSize / recordCount; if (memSize > nextRowGroupSize) { columnStore.writePages(); final long newMemSize = columnStore.getBufferedSize(); LOG.debug("mem size > {}: closing pages. Mem size after closing pages: {}. Min size for starting new row group: {}", memSize, nextRowGroupSize, newMemSize, minSizeForAlignment); memSize = newMemSize; recordSize = memSize / recordCount; if (memSize > minSizeForAlignment) { startNewRowGroup = true; LOG.debug("mem size > {}: flushing records to disk.", memSize, minSizeForAlignment, recordCount); } } if (startNewRowGroup) { flushRowGroupToStore(); initStore(); recordCountForNextMemCheck = min(max(MINIMUM_RECORD_COUNT_FOR_CHECK, recordCount / 2), MAXIMUM_RECORD_COUNT_FOR_CHECK); this.lastRowGroupEndPos = parquetFileWriter.getPos(); } else { long estimatedRecordCountInRowGroup = nextRowGroupSize / recordSize; LOG.debug("Estimated record count is {}", estimatedRecordCountInRowGroup); recordCountForNextMemCheck = recordCount/2 + estimatedRecordCountInRowGroup/2; if (recordCountForNextMemCheck < MINIMUM_RECORD_COUNT_FOR_CHECK) { recordCountForNextMemCheck = MINIMUM_RECORD_COUNT_FOR_CHECK; } if (recordCountForNextMemCheck > recordCount + MAXIMUM_RECORD_COUNT_FOR_CHECK) { recordCountForNextMemCheck = recordCount + MAXIMUM_RECORD_COUNT_FOR_CHECK; } LOG.debug("Checked mem at will check again at: {}", recordCount, recordCountForNextMemCheck); } } }

Target:
private void checkBlockSizeReached() throws IOException { if (recordCount >= recordCountForNextMemCheck) { long memSize = columnStore.getBufferedSize(); if (memSize > nextRowGroupSize) { columnStore.writePages(); final long newMemSize = columnStore.getBufferedSize(); LOG.debug("mem size > {}: closing pages. Mem size after closing pages: {}. Min size for starting new row group: {}", memSize, nextRowGroupSize, newMemSize, minSizeForAlignment); memSize = newMemSize; if (memSize > minSizeForAlignment) { LOG.debug("mem size > {}: flushing records to disk.", memSize, minSizeForAlignment, recordCount); flushRowGroupToStore(); initStore(); recordCountForNextMemCheck = min(max(MINIMUM_RECORD_COUNT_FOR_CHECK, recordCount/5), MAXIMUM_RECORD_COUNT_FOR_CHECK); this.lastRowGroupEndPos = parquetFileWriter.getPos(); return; } } final long estimatedRecordCountInRowGroup = nextRowGroupSize / memSize * recordCount; LOG.debug("Estimated record count is {}", estimatedRecordCountInRowGroup); recordCountForNextMemCheck = recordCount/5*4 + estimatedRecordCountInRowGroup/5; if (recordCountForNextMemCheck < MINIMUM_RECORD_COUNT_FOR_CHECK) { recordCountForNextMemCheck = MINIMUM_RECORD_COUNT_FOR_CHECK; } if (recordCountForNextMemCheck > recordCount + MAXIMUM_RECORD_COUNT_FOR_CHECK) { recordCountForNextMemCheck = recordCount + MAXIMUM_RECORD_COUNT_FOR_CHECK; } LOG.debug("Checked mem at will check again at: {}", recordCount, recordCountForNextMemCheck); } }
Source:
protected void setBlobStorageService(BlobStorageService blobStorageService) { if (blobStorageService == null) { throw new IllegalArgumentException("BlobStorageService cannot be null"); } else { this.blobStorageService = blobStorageService; logger.trace("BlobStorage service set to {}", blobStorageService.getClass()); } }

Target:
protected void setBlobStorageService(BlobStorageService blobStorageService) { if (blobStorageService == null) { throw new IllegalArgumentException("BlobStorageService cannot be null"); } this.blobStorageService = blobStorageService; logger.trace("BlobStorage service set to {}", blobStorageService.getClass()); }
Source:
ServiceBusReceiverAsyncClient buildAsyncClient(boolean isAutoCompleteAllowed) { final MessagingEntityType entityType = validateEntityPaths(logger, connectionStringEntityName, topicName, queueName); final String entityPath = getEntityPath(logger, entityType, queueName, topicName, subscriptionName, subQueue); validateAndThrow(prefetchCount); if (!isAutoCompleteAllowed && enableAutoComplete) { throw new IllegalStateException("'enableAutoComplete' is not support in synchronous client."); } final ServiceBusConnectionProcessor connectionProcessor = getOrCreateConnectionProcessor(messageSerializer); final ReceiverOptions receiverOptions = new ReceiverOptions(receiveMode, prefetchCount, enableAutoComplete); return new ServiceBusReceiverAsyncClient(connectionProcessor.getFullyQualifiedNamespace(), entityPath, entityType, receiverOptions, connectionProcessor, ServiceBusConstants.OPERATION_TIMEOUT, tracerProvider, messageSerializer, ServiceBusClientBuilder.this::onClientClose); }

Target:
ServiceBusReceiverAsyncClient buildAsyncClient(boolean isAutoCompleteAllowed) { final MessagingEntityType entityType = validateEntityPaths(logger, connectionStringEntityName, topicName, queueName); final String entityPath = getEntityPath(logger, entityType, queueName, topicName, subscriptionName, subQueue); if (!isAutoCompleteAllowed && enableAutoComplete) { logger.warning( "'enableAutoComplete' is not supported in synchronous client except through callback receive."); enableAutoComplete = false; } else if (enableAutoComplete && receiveMode == ReceiveMode.RECEIVE_AND_DELETE) { throw logger.logExceptionAsError(new IllegalStateException( "'enableAutoComplete' is not valid for RECEIVE_AND_DELETE mode.")); } if (receiveMode == ReceiveMode.RECEIVE_AND_DELETE) { maxAutoLockRenewDuration = Duration.ZERO; } final ServiceBusConnectionProcessor connectionProcessor = getOrCreateConnectionProcessor(messageSerializer); final ReceiverOptions receiverOptions = new ReceiverOptions(receiveMode, prefetchCount, maxAutoLockRenewDuration, enableAutoComplete); return new ServiceBusReceiverAsyncClient(connectionProcessor.getFullyQualifiedNamespace(), entityPath, entityType, receiverOptions, connectionProcessor, ServiceBusConstants.OPERATION_TIMEOUT, tracerProvider, messageSerializer, ServiceBusClientBuilder.this::onClientClose); }
Source:
private static LinkedHashMap<Object, ArrayList<ITestNGMethod>> sortMethodsByInstance(ITestNGMethod[] methods) { LinkedHashMap<Object, ArrayList<ITestNGMethod>> result = new LinkedHashMap<>(); for (ITestNGMethod method : methods) { Object methodClass = method.getInstance(); if (result.containsKey(methodClass)) { ArrayList<ITestNGMethod> methodList = result.get(methodClass); methodList.add(method); result.put(methodClass, methodList); } else { ArrayList<ITestNGMethod> methodList = new ArrayList<>(); methodList.add(method); result.put(methodClass, methodList); } } return result; }

Target:
private static Map<Object, List<ITestNGMethod>> sortMethodsByInstance(ITestNGMethod[] methods) { LinkedHashMap<Object, List<ITestNGMethod>> result = new LinkedHashMap<>(); for (ITestNGMethod method : methods) { Object methodInstance = method.getInstance(); List<ITestNGMethod> methodList = result.get(methodInstance); if (methodList == null) { methodList = new ArrayList<>(); } methodList.add(method); result.put(methodInstance, methodList); } return result; }
Source:
public void processWithChildContextBlockingErrorInChainRegainsParentContext() throws Exception { try { processWithChildContextBlocking(input, createChain(error), Optional.empty()); fail("Exception expected"); } catch (Throwable t) { assertThat(t, is(instanceOf(MessagingException.class))); assertThat(t.getCause(), is(exception)); assertThat(((MessagingException) t).getEvent().getContext(), is((instanceOf(DefaultEventContext.class)))); } }

Target:
public void processWithChildContextBlockingErrorInChainRegainsParentContext() throws Exception { try { processWithChildContextBlocking(input, createChain(error), Optional.empty()); fail("Exception expected"); } catch (Throwable t) { assertThat(t, is(instanceOf(MessagingException.class))); assertThat(t.getCause(), is(exception)); assertThat(((MessagingException) t).getEvent().getContext(), sameInstance(input.getContext())); } }
Source:
public MergingEquivalentsResolverBackedContainerSummaryResolver(MergingEquivalentsResolver<Content> contentResolver) { this.contentResolver = contentResolver; }

Target:
public MergingEquivalentsResolverBackedContainerSummaryResolver(MergingEquivalentsResolver<Content> contentResolver) { this.contentResolver = checkNotNull(contentResolver); }
Source:
protected void run() throws Exception { if (list) { list(); } else { throw new NotSupportedException( "only --list option is currently supported"); } }

Target:
protected void run() throws Exception { if (list) list(); else throw new NotSupportedException( "only --list option is currently supported"); }
Source:
public RemovrCompositeSpec(String rawKey, Map<String, Object> spec ) { super( rawKey ); ArrayList<RemovrSpec> all = new ArrayList<RemovrSpec>(); for ( String rawLhsStr : spec.keySet() ) { Object rawRhs = spec.get( rawLhsStr ); String[] keyStrings = rawLhsStr.split( "\\|" ); for ( String keyString : keyStrings ) { RemovrSpec childSpec; if( rawRhs instanceof Map ) { childSpec = new RemovrCompositeSpec(keyString, (Map<String, Object>) rawRhs ); } else { childSpec = new RemovrLeafSpec(keyString); } all.add(childSpec); } } allChildren = Collections.unmodifiableList( all ); }

Target:
public RemovrCompositeSpec(String rawKey, Map<String, Object> spec ) { super( rawKey ); ArrayList<RemovrSpec> all = new ArrayList<RemovrSpec>(); for ( String rawLhsStr : spec.keySet() ) { Object rawRhs = spec.get( rawLhsStr ); String[] keyStrings = rawLhsStr.split( "\\|" ); for ( String keyString : keyStrings ) { RemovrSpec childSpec; if( rawRhs instanceof Map ) { childSpec = new RemovrCompositeSpec(keyString, (Map<String, Object>) rawRhs ); } else if (rawRhs instanceof String && ((String)rawRhs).trim().length() == 0) { childSpec = new RemovrLeafSpec(keyString); } else{ throw new SpecException("Invalid Removr spec RHS. Should be a non-empty string or Map"); } all.add(childSpec); } } allChildren = Collections.unmodifiableList( all ); }