auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static EmptyMessage manageError(OSException e, Response response) { if (e == null) { LOGGER.error(ErrorDescriptions.EXCEPTION_NULL); throw new NullPointerException(ErrorDescriptions.EXCEPTION_NULL); } String errMess = e.getMessage(); if (errMess == null) { LOGGER.error(ErrorDescriptions.ERROR_MESS_NULL); throw new NullPointerException(ErrorDescriptions.ERROR_MESS_NULL); } if(errMess.equals(ErrorDescriptions.DECRYPTION_FAILED)) { LOGGER.info("Sending empty ACK message due to Response decryption failure"); <START> return EmptyMessage.newACK(response); <END> } if (!response.isConfirmable()) { LOGGER.error("An Empty Message will not be created"); return null; } LOGGER.info("Sending empty RST message"); return EmptyMessage.newRST(response); }</code><technical_language>RFC7252 responses piggybacked. If so, a ACK for a ACK is compliant. Dose OSCORE change this? piggybacked responses OSCORE</technical_language>

Target:
public static EmptyMessage manageError(OSException e, Response response) { if (e == null) { LOGGER.error(ErrorDescriptions.EXCEPTION_NULL); throw new NullPointerException(ErrorDescriptions.EXCEPTION_NULL); } String errMess = e.getMessage(); if (errMess == null) { LOGGER.error(ErrorDescriptions.ERROR_MESS_NULL); throw new NullPointerException(ErrorDescriptions.ERROR_MESS_NULL); } if (!response.isConfirmable()) { LOGGER.error("An Empty Message will not be created"); return null; } LOGGER.info("Sending empty RST message"); return EmptyMessage.newRST(response); }
Source:
<code>private String getBillingFrequencyDescription(Award award) { <START> if (award == null || award.getBillingFrequency() == null) { <END> return StringUtils.EMPTY; } return award.getBillingFrequency().getFrequencyDescription(); }</code><technical_language>I suggest ObjectUtils check for nulls</technical_language>

Target:
private String getBillingFrequencyDescription(Award award) { if (ObjectUtils.isNull(award) || ObjectUtils.isNull(award.getBillingFrequency())) { return StringUtils.EMPTY; } return award.getBillingFrequency().getFrequencyDescription(); }
Source:
<code>protected final void addWaitKey(String name, W key, long timeoutMs) { <START> long deadline = timeoutMs > 0 ? Clock.currentTimeMillis() + timeoutMs : NO_WAIT_KEY_DEADLINE; <END> if (timeoutMs > 0) { waitTimeouts.putIfAbsent(BiTuple.of(name, key.invocationUid), BiTuple.of(timeoutMs, deadline)); } if (timeoutMs != 0) { addLiveOperation(key, deadline); } }</code><technical_language>if Clock.currentTimeMillis() + timeoutMs overflows</technical_language>

Target:
protected final void addWaitKey(String name, W key, long timeoutMs) { long deadline; if (timeoutMs > 0) { long now = Clock.currentTimeMillis(); deadline = Long.MAX_VALUE - now >= timeoutMs ? now + timeoutMs : Long.MAX_VALUE; waitTimeouts.putIfAbsent(BiTuple.of(name, key.invocationUid), BiTuple.of(timeoutMs, deadline)); } else { deadline = NO_WAIT_KEY_DEADLINE; } if (timeoutMs != 0) { addLiveOperation(key, deadline); } }
Source:
<code>public void testCompare() { <START> Component componentB = new Component("B", "B", "job/A", false, new ArrayList<Pipeline>(), 3, false); <END> Component componentA = new Component("A", "A", "job/B", false, new ArrayList<Pipeline>(), 3, false); List<Component> list = new ArrayList<Component>(); list.add(componentB); list.add(componentA); Collections.sort(list, new NameComparator.DescriptorImpl().createInstance()); assertEquals(componentA, list.get(0)); assertEquals(componentB, list.get(1)); }</code><technical_language>extract false a constant declared in beginning of class declare intent of parameter, reused test file</technical_language>

Target:
public void testCompare() { Component componentB = new Component("B", "B", "job/A", false, new ArrayList<Pipeline>(), 3, pagingEnabledFalse); Component componentA = new Component("A", "A", "job/B", false, new ArrayList<Pipeline>(), 3, pagingEnabledFalse); List<Component> list = new ArrayList<Component>(); list.add(componentB); list.add(componentA); Collections.sort(list, new NameComparator.DescriptorImpl().createInstance()); assertEquals(componentA, list.get(0)); assertEquals(componentB, list.get(1)); }
Source:
<code>private void checkForPotentialVendorDeletionAttempts(Collection<PaymentWorksVendor> vendors) { boolean vendorDeletionAttemptExists = vendors.stream() .anyMatch((vendor) -> StringUtils.equalsIgnoreCase( PaymentWorksConstants.SUPPLIER_UPLOAD_DELETE_INDICATOR, vendor.getRequestingCompanyLegalNameForProcessing())); if (vendorDeletionAttemptExists) { <START> LOG.error("checkForPotentialVendorDeletionAttempts, discovered a potential attempt to delete a vendor via the supplier upload"); <END> throw new RuntimeException("Detected a potential attempt to delete a vendor via the supplier upload"); } }</code><technical_language>For troubleshooting, more specific information output vendor generating error, PMW vendor ID KFS vendor ID</technical_language>

Target:
private void checkForPotentialVendorDeletionAttempts(Collection<PaymentWorksVendor> vendors) { List<PaymentWorksVendor> vendorDeletions = vendors.stream() .filter((vendor) -> StringUtils.equalsIgnoreCase( PaymentWorksConstants.SUPPLIER_UPLOAD_DELETE_INDICATOR, vendor.getRequestingCompanyLegalNameForProcessing())) .collect(Collectors.toCollection(ArrayList::new)); if (!vendorDeletions.isEmpty()) { String vendorDeletionNumbers = buildVendorNumberList(vendorDeletions); LOG.error("checkForPotentialVendorDeletionAttempts, discovered a potential attempt to delete these vendors via the supplier upload: " + vendorDeletionNumbers); throw new RuntimeException("Detected a potential attempt to delete the following vendors via the supplier upload: " + vendorDeletionNumbers); } }
Source:
<code>public final void run(Configuration config, final Environment env) throws Exception { env.jersey().register(HttpRemotingJerseyFeature.INSTANCE); env.jersey().register(new TestResource()); <START> env.jersey().register(new EmptyOptionalTo204ExceptionMapper()); <END> env.getObjectMapper().registerModule(new Jdk8Module()); }</code><technical_language>do need this</technical_language>

Target:
public final void run(Configuration config, final Environment env) throws Exception { env.jersey().register(HttpRemotingJerseyFeature.INSTANCE); env.jersey().register(new JacksonMessageBodyProvider(ObjectMappers.newServerObjectMapper())); env.jersey().register(new EmptyOptionalTo204ExceptionMapper()); env.jersey().register(new TestResource()); }
Source:
<code>public Date convert(String source) { <START> DateFormat df = new SimpleDateFormat(dateFormatString); <END> try { return df.parse(source); } catch (ParseException cause) { throw new RuntimeException(cause); } }</code><technical_language>here, relying [DateFormatterProvider](<LINK_0></technical_language>

Target:
public Date convert(String source) { return Date.from(Instant.parse(source)); }
Source:
<code>@Test public void port(){ story.addStep(new Statement() { @Override public void evaluate() throws Throwable { assumeDocker(); WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj"); p.setDefinition(new CpsFlowDefinition( "node {\n" + " def img = docker.image('httpd:2.4.12')\n" + " def container = img.run('-p 12345:80')\n" + " def port = container.port(80)\n" + <START> " container.stop()\n" + <END> " echo \"container running on ${port}\"" + "}", true)); WorkflowRun r = story.j.assertBuildStatusSuccess(p.scheduleBuild2(0)); story.j.assertLogContains("container running on 0.0.0.0:12345", r); } }); }</code><technical_language>ant: safer groovy def port = img.withRun('-p 12345:80') {c -> c.port(80)}</technical_language>

Target:
@Test public void port(){ story.addStep(new Statement() { @Override public void evaluate() throws Throwable { assumeDocker(); WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj"); p.setDefinition(new CpsFlowDefinition( "node {\n" + " def img = docker.image('httpd:2.4.12')\n" + " def port = img.withRun('-p 12345:80') { c -> c.port(80) }\n" + " echo \"container running on ${port}\"" + "}", true)); WorkflowRun r = story.j.assertBuildStatusSuccess(p.scheduleBuild2(0)); story.j.assertLogContains("container running on 0.0.0.0:12345", r); } }); }
Source:
<code>public int getMaxIntermediateSize() { <START> return Longs.BYTES + Floats.BYTES; <END> }</code><technical_language>Long.BYTES Float.BYTES</technical_language>

Target:
public int getMaxIntermediateSize() { return Long.BYTES + Float.BYTES; }
Source:
<code><START> public Integer getWarningLowSpaceSize() { <END> return getWarningLowSpaceIndicator() == null ? 0 : getTotalDiskSize() * getWarningLowSpaceIndicator() / 100; }</code><technical_language>problems other properties of StorageDomain converstion of Integer int NPEs resulting I return type int return null way, please fix merge</technical_language>

Target:
public int getWarningLowSpaceSize() { return getWarningLowSpaceIndicator() == null ? 0 : getTotalDiskSize() * getWarningLowSpaceIndicator() / 100; }
Source:
<code>public void close() throws Exception{ <START> if (!running) { return; } running = false; LOG.info("Closing {}", this); client.getUnhandledErrorListenable().removeListener(this); <END> client.getConnectionStateListenable().removeListener(listener); Exception exception = null; try { cache.close(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } try { leaderLatch.close(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } if (exception != null) { throw new Exception("Could not properly stop the ZooKeeperLeaderElectionDriver.", exception); } }</code><technical_language>suggest introduce a lock guard accesses running other places is accessed. prevent concurrency shutting this component ZooKeeper threads trigger update</technical_language>

Target:
public void close() throws Exception{ if (!running) { return; } running = false; LOG.info("Closing {}", this); client.getUnhandledErrorListenable().removeListener(this); client.getConnectionStateListenable().removeListener(listener); Exception exception = null; try { cache.close(); } catch (Exception e) { exception = e; } try { leaderLatch.close(); } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } if (exception != null) { throw new Exception("Could not properly stop the ZooKeeperLeaderElectionDriver.", exception); } }
Source:
<code>public MainModule(Context context) { this.context = context.getApplicationContext(); GsonBuilder gsonBuilder = new GsonBuilder(); <START> gsonBuilder.setPrettyPrinting(); <END> gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapter(ApiItem.class, new CollectionDeserializer()); gsonBuilder.registerTypeAdapter(Content.class, new PageContentDeserializer()); gsonBuilder.registerTypeAdapter(CanvassData.class, new CanvassDataSerializer()); gson = gsonBuilder.create(); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); rxPrefs = RxSharedPreferences.create(preferences); config = new ConfigImpl(context); }</code><technical_language>Do want pretty printing on</technical_language>

Target:
public MainModule(Context context) { this.context = context.getApplicationContext(); GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapter(ApiItem.class, new CollectionDeserializer()); gsonBuilder.registerTypeAdapter(Content.class, new PageContentDeserializer()); gsonBuilder.registerTypeAdapter(CanvassData.class, new CanvassDataSerializer()); gson = gsonBuilder.create(); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); rxPrefs = RxSharedPreferences.create(preferences); config = new ConfigImpl(context); }
Source:
<code>public synchronized void addChild(@NonNull TimeGraphEntry child) { if (fComparator == null) { addChild(fChildren.size(), child); } else { int i = Collections.binarySearch(fChildren, child, fComparator); <START> i = i >= 0 ? i + 1 : -i - 1; <END> addChild(i, child); } }</code><technical_language>Works duplicates if 3 more</technical_language>

Target:
public synchronized void addChild(@NonNull TimeGraphEntry child) { if (fComparator == null) { addChild(fChildren.size(), child); } else { int i = Collections.binarySearch(fChildren, child, fComparator); if (i >= 0) { while (i < fChildren.size() && fComparator.compare(child, fChildren.get(i)) == 0) { i++; } } else { i = -i - 1; } addChild(i, child); } }
Source:
<code>public CommandResult execute(CommandInvocation commandInvocation) throws IOException { if (help) { commandInvocation.getShell().out().print(commandInvocation.getHelpInfo("touch")); return CommandResult.SUCCESS; } if (arguments == null || arguments.size() < 1) { commandInvocation.getShell().out().print("touch: Invalid arguments"); return CommandResult.FAILURE; } try { for (File file : arguments) { <START> file.createNewFile(); <END> } } catch (IOException ioe) { commandInvocation.getShell().out().print("touch: " + ioe.getMessage()); return CommandResult.FAILURE; } return CommandResult.SUCCESS; }</code><technical_language>testing i dont File.createNewFile change access modification time of a file if exists</technical_language>

Target:
public CommandResult execute(CommandInvocation commandInvocation) throws IOException { if (help) { commandInvocation.getShell().out().print(commandInvocation.getHelpInfo("touch")); return CommandResult.SUCCESS; } if (arguments == null || arguments.size() < 1) { commandInvocation.getShell().out().print("touch: Invalid arguments"); return CommandResult.FAILURE; } try { for (File file : arguments) { if (file.exists()) { continue; } file.createNewFile(); } } catch (IOException ioe) { commandInvocation.getShell().out().print("touch: " + ioe.getMessage()); return CommandResult.FAILURE; } return CommandResult.SUCCESS; }
Source:
<code>public static Champ fromCbor(Cborable cbor) { if (! (cbor instanceof CborObject.CborList)) <START> throw new IllegalStateException("Invalid cbor for CHAMP! " + cbor); <END> List<? extends Cborable> list = ((CborObject.CborList) cbor).value; BitSet dataMap = BitSet.valueOf(((CborObject.CborByteArray)list.get(0)).value); BitSet nodeMap = BitSet.valueOf(((CborObject.CborByteArray)list.get(1)).value); List<? extends Cborable> contentsCbor = ((CborObject.CborList) list.get(2)).value; List<HashPrefixPayload> contents = new ArrayList<>(); for (int i=0; i < contentsCbor.size(); i++) { Cborable keyOrHash = contentsCbor.get(i); if (keyOrHash instanceof CborObject.CborList) { List<KeyElement> mappings = new ArrayList<>(); List<? extends Cborable> mappingsCbor = ((CborObject.CborList) keyOrHash).value; for (int j=0; j < mappingsCbor.size(); j += 2) { byte[] key = ((CborObject.CborByteArray) mappingsCbor.get(j)).value; Cborable value = mappingsCbor.get(j + 1); mappings.add(new KeyElement(new ByteArrayWrapper(key), value instanceof CborObject.CborNull ? MaybeMultihash.empty() : MaybeMultihash.of(((CborObject.CborMerkleLink) value).target))); } contents.add(new HashPrefixPayload(mappings.toArray(new KeyElement[0]), null)); } else { contents.add(new HashPrefixPayload(null, MaybeMultihash.of(((CborObject.CborMerkleLink)keyOrHash).target))); } } return new Champ(dataMap, nodeMap, contents.toArray(new HashPrefixPayload[contents.size()])); }</code><technical_language>Add check list-length==3 too? a error messsage</technical_language>

Target:
public static Champ fromCbor(Cborable cbor) { if (! (cbor instanceof CborObject.CborList)) throw new IllegalStateException("Invalid cbor for CHAMP! " + cbor); List<? extends Cborable> list = ((CborObject.CborList) cbor).value; BitSet dataMap = BitSet.valueOf(((CborObject.CborByteArray)list.get(0)).value); BitSet nodeMap = BitSet.valueOf(((CborObject.CborByteArray)list.get(1)).value); List<? extends Cborable> contentsCbor = ((CborObject.CborList) list.get(2)).value; List<HashPrefixPayload> contents = new ArrayList<>(); for (int i=0; i < contentsCbor.size(); i++) { Cborable keyOrHash = contentsCbor.get(i); if (keyOrHash instanceof CborObject.CborList) { List<KeyElement> mappings = new ArrayList<>(); List<? extends Cborable> mappingsCbor = ((CborObject.CborList) keyOrHash).value; for (int j=0; j < mappingsCbor.size(); j += 2) { byte[] key = ((CborObject.CborByteArray) mappingsCbor.get(j)).value; Cborable value = mappingsCbor.get(j + 1); mappings.add(new KeyElement(new ByteArrayWrapper(key), value instanceof CborObject.CborNull ? MaybeMultihash.empty() : MaybeMultihash.of(((CborObject.CborMerkleLink) value).target))); } contents.add(new HashPrefixPayload(mappings.toArray(new KeyElement[0]))); } else { contents.add(new HashPrefixPayload(MaybeMultihash.of(((CborObject.CborMerkleLink)keyOrHash).target))); } } return new Champ(dataMap, nodeMap, contents.toArray(new HashPrefixPayload[contents.size()])); }
Source:
<code>public Addresses loadAddresses() { List<String> configuredAddresses = networkConfig.getAddresses(); if (configuredAddresses.isEmpty()) { configuredAddresses.add("127.0.0.1"); } Addresses addresses = new Addresses(); for (String address : configuredAddresses) { List<Address> addressesForMember = AddressHelper.getSocketAddresses(address); if (!addressesForMember.isEmpty()) { <START> addresses.primary().add(addressesForMember.remove(0)); <END> addresses.secondary().addAll(addressesForMember); } } return addresses; }</code><technical_language>I for simplicity AddressHelper.getSocketAddresses method return Addresses do primary secondary separation internally (It generation responsibility of AddressHelper.getSocketAddresses). I method AddressHelper.getSocketAddresses is called this place easy change</technical_language>

Target:
public Addresses loadAddresses() { List<String> configuredAddresses = networkConfig.getAddresses(); if (configuredAddresses.isEmpty()) { configuredAddresses.add("127.0.0.1"); } Addresses addresses = new Addresses(); for (String address : configuredAddresses) { addresses.addAll(AddressHelper.getSocketAddresses(address)); } return addresses; }
Source:
<code>public void testBuilderDefaults() { CoordinatorDynamicConfig defaultConfig = CoordinatorDynamicConfig.builder().build(); assertConfig(defaultConfig, 900000, 524288000, 100, 5, 15, 10, 1, false, ImmutableSet.of(), false, 0, ImmutableSet.of(), <START> 7); <END> }</code><technical_language>Druid formatting rules, break arguments</technical_language>

Target:
public void testBuilderDefaults() { CoordinatorDynamicConfig defaultConfig = CoordinatorDynamicConfig.builder().build(); ImmutableSet<String> emptyList = ImmutableSet.of(); assertConfig(defaultConfig, 900000, 524288000, 100, 5, 15, 10, 1, false, emptyList, false, 0, emptyList, 7); }
Source:
<code>private AzureBlobStorageBuilder buildImpl() { Objects.requireNonNull(endpoint); Objects.requireNonNull(containerName); Objects.requireNonNull(blobName); final List<HttpPipelinePolicy> policies = new ArrayList<>(); if (configuration == null) { configuration = Configuration.NONE; <START> } <END> policies.add(new UserAgentPolicy(BlobConfiguration.NAME, BlobConfiguration.VERSION, configuration)); policies.add(new RequestIdPolicy()); policies.add(new AddDatePolicy()); if (sharedKeyCredential != null) { policies.add(new SharedKeyCredentialPolicy(sharedKeyCredential)); } else if (tokenCredential != null) { policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, String.format("%s://%s/.default", endpoint.getProtocol(), endpoint.getHost()))); } else if (sasTokenCredential != null) { policies.add(new SASTokenCredentialPolicy(sasTokenCredential)); } else { policies.add(new AnonymousCredentialPolicy()); } policies.add(retryPolicy); policies.addAll(this.policies); policies.add(new HttpLoggingPolicy(logLevel)); HttpPipeline pipeline = HttpPipeline.builder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); return new AzureBlobStorageBuilder() .url(String.format("%s/%s/%s", endpoint.toString(), containerName, blobName)) .pipeline(pipeline); }</code><technical_language>I this is incorrect - if configuration is specified, global configuration, 'no' configuration (i.e. empty Map). Please confirm @alzimmermsft (and ensure other client libraries this either!)</technical_language>

Target:
private AzureBlobStorageBuilder buildImpl() { Objects.requireNonNull(endpoint); Objects.requireNonNull(containerName); Objects.requireNonNull(blobName); final List<HttpPipelinePolicy> policies = new ArrayList<>(); if (configuration == null) { configuration = ConfigurationManager.getConfiguration(); } policies.add(new UserAgentPolicy(BlobConfiguration.NAME, BlobConfiguration.VERSION, configuration)); policies.add(new RequestIdPolicy()); policies.add(new AddDatePolicy()); if (sharedKeyCredential != null) { policies.add(new SharedKeyCredentialPolicy(sharedKeyCredential)); } else if (tokenCredential != null) { policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, String.format("%s/.default", endpoint))); } else if (sasTokenCredential != null) { policies.add(new SASTokenCredentialPolicy(sasTokenCredential)); } else { policies.add(new AnonymousCredentialPolicy()); } policies.add(new RequestRetryPolicy(retryOptions)); policies.addAll(this.policies); policies.add(new HttpLoggingPolicy(logLevel)); HttpPipeline pipeline = HttpPipeline.builder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); return new AzureBlobStorageBuilder() .url(String.format("%s/%s/%s", endpoint, containerName, blobName)) .pipeline(pipeline); }
Source:
<code>protected void askForPermission(String[] permissions, int requestCode) { if (getActivity() != null) { <START> if (PermissionsUtil.checkPermissions(permissions[0], getActivity())) { <END> if (permissionListener != null) { permissionListener.onPermissionGranted(permissions, requestCode); } } else { PermissionsUtil.requestPermissions(requestCode, permissions, BaseFragment.this); } } }</code><technical_language>right implementation, permissions other zeroth index get ignored</technical_language>

Target:
protected void askForPermission(String[] permissions, int requestCode) { if (getActivity() != null) { if (permissionListener != null && getGrantedPermissionsCount(permissions) == permissions.length) { permissionListener.onPermissionGranted(permissions, requestCode); } else { PermissionsUtil.requestPermissions(requestCode, permissions, BaseFragment.this); } } }
Source:
<code>private static <T extends Item> void addRangeKeyConditionToQuerySpec(final QuerySpec querySpec, final CompoundAttributeQuery compoundAttributeQuery, final Class<T> itemClass) { <START> final String supportingConditionValue = compoundAttributeQuery.getSupportingCondition().getValues().iterator() <END> .next(); final Operators comparisonOperator = compoundAttributeQuery.getSupportingCondition().getComparisonOperator(); final Class<?> clazz = compoundAttributeQuery.getSupportingAttributeType(itemClass); try { final Object value = clazz.getConstructor(String.class).newInstance(supportingConditionValue); final RangeKeyCondition rangeKeyCondition = RangeKeyConditionBuilder .build(compoundAttributeQuery.getSupportingAttributeName(), value, comparisonOperator); querySpec.withRangeKeyCondition(rangeKeyCondition); } catch (final Exception e) { throw new PersistenceResourceFailureException( String.format("Could not add range key condition for query: %s on item %s.", compoundAttributeQuery, itemClass.getSimpleName()), e); } }</code><technical_language>supportingConditionValue -> supportingConditionStringValue</technical_language>

Target:
private static <T extends Item> void addRangeKeyConditionToQuerySpec(final QuerySpec querySpec, final CompoundAttributeQuery compoundAttributeQuery, final Class<T> itemClass) { final String supportingConditionStringValue = compoundAttributeQuery.getSupportingCondition().getValues().iterator() .next(); final Operators comparisonOperator = compoundAttributeQuery.getSupportingCondition().getComparisonOperator(); final Class<?> supportingAttributeType = compoundAttributeQuery.getSupportingAttributeType(itemClass); try { final Object supportingConditionValue = supportingAttributeType.getConstructor(String.class).newInstance(supportingConditionStringValue); final RangeKeyCondition rangeKeyCondition = RangeKeyConditionBuilder .build(compoundAttributeQuery.getSupportingAttributeName(), supportingConditionValue, comparisonOperator); querySpec.withRangeKeyCondition(rangeKeyCondition); } catch (final Exception e) { throw new PersistenceResourceFailureException( String.format("Could not add range key condition for query: %s on item %s.", compoundAttributeQuery, itemClass.getSimpleName()), e); } }
Source:
<code>public void copy(Velocity other) { <START> this.velocity = other.velocity; <END> }</code><technical_language>This is a deep copy</technical_language>

Target:
public void copy(Velocity other) { velocity = other.velocity.cpy(); }
Source:
<code>protected List<Object> getChannelKeys(Message<?> message) { String mostSpecificCause = null; Object payload = message.getPayload(); if (payload instanceof Throwable) { Throwable cause = (Throwable) payload; Set<String> mapping = getChannelMappings().keySet(); Map<String, Class<?>> classesCache = new HashMap<String, Class<?>>(); while (cause != null) { for (String className : mapping) { Class<?> exceptionClass = classesCache.get(className); if (exceptionClass == null) { try { exceptionClass = ClassUtils.forName(className, getApplicationContext().getClassLoader()); classesCache.put(className, exceptionClass); } catch (ClassNotFoundException e) { <START> throw new IllegalStateException(e); <END> } } if (exceptionClass.isInstance(cause)) { mostSpecificCause = className; } } cause = cause.getCause(); } } return mostSpecificCause != null ? Collections.<Object>singletonList(mostSpecificCause) : null; }</code><technical_language>I detect bad keys initialization runtime, store cache a field, simply log throwing exception. runtime exception controlled resolutionRequired. build cache call, needs cleared/rebuilt mappings change</technical_language>

Target:
protected List<Object> getChannelKeys(Message<?> message) { String mostSpecificCause = null; Object payload = message.getPayload(); if (payload instanceof Throwable) { Throwable cause = (Throwable) payload; while (cause != null) { for (Map.Entry<String, Class<?>> entry : this.classNameMappings.entrySet()) { String channelKey = entry.getKey(); Class<?> exceptionClass = entry.getValue(); if (exceptionClass.isInstance(cause)) { mostSpecificCause = channelKey; } } cause = cause.getCause(); } } return mostSpecificCause != null ? Collections.<Object>singletonList(mostSpecificCause) : null; }
Source:
<code>public static List<StorageServerConnections> updateInitiators(List<StorageServerConnections> conns, Guid vdsId) { List<StorageServerConnections> res = new ArrayList<>(conns); for (StorageServerConnections conn : conns) { List<VdsNetworkInterface> initiators = DbFacade.getInstance().getInterfaceDao() <START> .getIscsiInitiatorsByVdsIdAndStorageTargetId(vdsId, conn.getid()); <END> if (initiators != null && !initiators.isEmpty()) { conn.setInitiatorName(initiators.remove(0).getName()); for (VdsNetworkInterface initiator : initiators) { StorageServerConnections newConn = StorageServerConnections.copyOf(conn); newConn.setid(Guid.newGuid().toString()); newConn.setInitiatorName(initiator.getName()); res.add(newConn); } } } return res; }</code><technical_language>is getIscsiInitiatorsByVdsIdAndStorageTargetId in InterfaceDAO getIscsiInitiatorsByHostIdAndStorageTargetId (Host instead of Vds)</technical_language>

Target:
public static List<StorageServerConnections> updateInitiators(List<StorageServerConnections> conns, Guid vdsId) { List<StorageServerConnections> res = new ArrayList<>(conns); for (StorageServerConnections conn : conns) { List<VdsNetworkInterface> initiators = DbFacade.getInstance().getInterfaceDao() .getIscsiInitiatorsByHostIdAndStorageTargetId(vdsId, conn.getid()); if (!initiators.isEmpty()) { conn.setInitiatorName(initiators.remove(0).getName()); for (VdsNetworkInterface initiator : initiators) { StorageServerConnections newConn = StorageServerConnections.copyOf(conn); newConn.setid(Guid.newGuid().toString()); newConn.setInitiatorName(initiator.getName()); res.add(newConn); } } } return res; }
Source:
<code>private void serviceCacheCleanup() { <START> long currentTime = new Date().getTime(); <END> long updateTime = lastCacheCleanupMillis + ( DataServiceConstants.STREAMING_CACHE_CLEANUP_INTERVAL_SECONDS * 1000 ); if ( updateTime <= currentTime ) { serviceListeners.cleanUp(); lastCacheCleanupMillis = currentTime; } }</code><technical_language>Consider System.currentTimeMillis instead, performance (not much, Date().getTime() I reckon), save GC execution, skipping creation of a new object, fills memory cleaned up. [StreamingServiceTransExecutor](<LINK_0>, more relevant here, this is called for row</technical_language>

Target:
private void serviceCacheCleanup() { long currentTime = System.currentTimeMillis(); long updateTime = lastCacheCleanupMillis + ( DataServiceConstants.STREAMING_CACHE_CLEANUP_INTERVAL_SECONDS * 1000 ); if ( updateTime <= currentTime ) { serviceListeners.cleanUp(); lastCacheCleanupMillis = currentTime; } }
Source:
<code>public int getItemHeight(ITimeGraphEntry entry) { int itemHeight = super.getItemHeight(entry); if (isCurrentThread(entry)) { <START> return itemHeight / 4; <END> } return itemHeight; }</code><technical_language>1.65 interesting (instead of 4)</technical_language>

Target:
public int getItemHeight(ITimeGraphEntry entry) { int itemHeight = super.getItemHeight(entry); if (isType(entry, Type.CPU)) { return (int) (itemHeight * 0.65); } return itemHeight; }
Source:
<code>public void initializeState(FunctionInitializationContext context) throws Exception { lastSentStored = context.getOperatorStateStore().getListState(new ListStateDescriptor<>("counter", Integer.class)); if (context.isRestored()) { <START> Iterator<Integer> iterator = lastSentStored.get().iterator(); checkState(iterator.hasNext()); sentCount = iterator.next(); checkState(!iterator.hasNext()); <END> } checkState(cancelAfter == null || sentCount < cancelAfter); }</code><technical_language>Guava's Iterables.getOnlyElement more crisp</technical_language>

Target:
public void initializeState(FunctionInitializationContext context) throws Exception { lastSentStored = context.getOperatorStateStore().getListState(new ListStateDescriptor<>("counter", Integer.class)); if (context.isRestored()) { sentCount = getOnlyElement(lastSentStored.get()); } checkState(cancelAfter == null || sentCount < cancelAfter); }
Source:
<code>public void uninstall() throws DeviceException { ILogger lifecycleLogger = new LoggerWrapper(getLogger(), LogLevel.LIFECYCLE); final String applicationId = variant.getApplicationId(); <START> getLogger().info("Uninstalling <END> app: " + applicationId); final DeviceProvider deviceProvider = new ConnectedDeviceProvider(getAdbExe()); deviceProvider.init(); final List<? extends DeviceConnector> devices = deviceProvider.getDevices(); final List<DeviceConnector> onlineDevices = InstallUtils.keepOnlineDevices(devices, lifecycleLogger); for (DeviceConnector device : onlineDevices) { device.uninstallPackage(applicationId, getTimeOutInMs(), getILogger()); logUninstall(device, applicationId); } int n = onlineDevices.size(); getLogger().quiet("Uninstalled from device{}.", applicationId, n, n == 1 ? "" : "s"); }</code><technical_language>here, requery a single logger object</technical_language>

Target:
public void uninstall() throws DeviceException { final Logger logger = getLogger(); final String applicationId = variant.getApplicationId(); logger.info("Uninstalling app: {}", applicationId); final ILogger lifecycleLogger = new LoggerWrapper(getLogger(), LogLevel.LIFECYCLE); final DeviceProvider deviceProvider = new ConnectedDeviceProvider(getAdbExe(), lifecycleLogger); deviceProvider.init(); final List<? extends DeviceConnector> devices = deviceProvider.getDevices(); for (DeviceConnector device : devices) { device.uninstallPackage(applicationId, getTimeOutInMs(), getILogger()); logger.lifecycle( "Uninstalling (from {}:{}) from device '{}' ({}).", applicationId, getProject().getName(), variant.getVariantConfiguration().getFullName(), device.getName(), device.getSerialNumber()); } int n = devices.size(); logger.quiet("Uninstalled from device{}.", applicationId, n, n == 1 ? "" : "s"); }
Source:
<code>public boolean hasMore() { if (savedInputRow != null) { return true; } while (firehose.hasMore()) { final InputRow row = firehose.nextRow(); if (predicate.apply(row)) { savedInputRow = row; return true; } <START> if (ignored % ignoredThreshold == 0) { <END> ignored++; log.warn("[%s] InputRow(s) ignored as they do not satisfy the predicate", ignored); } } return false; }</code><technical_language>@pjain1 @gianm this means if 5000 events properly formatted log. i exponential backoff strategy</technical_language>

Target:
public boolean hasMore() { if (savedInputRow != null) { return true; } while (firehose.hasMore()) { final InputRow row = firehose.nextRow(); if (predicate.apply(row)) { savedInputRow = row; return true; } if (ignored % IGNORE_THRESHOLD == 0) { log.warn("[%,d] InputRow(s) ignored as they do not satisfy the predicate", ignored); } ignored++; } return false; }
Source:
<code>public static void afterClass() throws InterruptedException, TimeoutException, IOException, CommandFailedException { <START> client.apply(new RemoveDataSource(JDBC_STORE_DATASOURCE_NAME)); <END> client.apply(snapshotBackup.restore()); administration.restartIfRequired(); }</code><technical_language>Removing datasource restoring snapshot is necessary IMO</technical_language>

Target:
public static void afterClass() throws InterruptedException, TimeoutException, IOException, CommandFailedException { client.apply(snapshotBackup.restore()); administration.restartIfRequired(); }
Source:
<code>public ContainerInfo allocateContainer(final ReplicationType type, final ReplicationFactor replicationFactor, final String owner) throws IOException { lock.lock(); try { <START> final ContainerInfo containerInfo; <END> containerInfo = containerStateManager .allocateContainer(pipelineManager, type, replicationFactor, owner); addContainerToDB(containerInfo); return containerInfo; } finally { lock.unlock(); } }</code><technical_language>put single statement --> final ContainerInfo containerInfo = containerStateManager.allocateContainer(pipelineManager, type, replicationFactor, owner);</technical_language>

Target:
public ContainerInfo allocateContainer(final ReplicationType type, final ReplicationFactor replicationFactor, final String owner) throws IOException { lock.lock(); try { final ContainerInfo containerInfo = containerStateManager.allocateContainer(pipelineManager, type, replicationFactor, owner); addContainerToDB(containerInfo); return containerInfo; } finally { lock.unlock(); } }
Source:
<code>public InputStream getEntryInputStream() { <START> if (data == null) { <END> throw new IllegalStateException("entry content can be accessed only once"); } ByteBufInputStream res = new ByteBufInputStream(data); data = null; return res; }</code><technical_language>question: necessary</technical_language>

Target:
public InputStream getEntryInputStream() { Preconditions.checkNotNull(data, "entry content can be accessed only once"); ByteBufInputStream res = new ByteBufInputStream(data); data = null; return res; }
Source:
<code>public AsyncTableFunction<RowData> getAsyncLookupFunction(String[] lookupKeys) { <START> return null; <END> }</code><technical_language>throw new UnsupportedOperationException</technical_language>

Target:
public AsyncTableFunction<RowData> getAsyncLookupFunction(String[] lookupKeys) { throw new UnsupportedOperationException("Hive table doesn't support async lookup"); }
Source:
<code>public void testTxLocalNodeFailover(){ withAllIsolationsAndConcurrencies(new IgniteClosure<Object, Void>() { @Override public Void apply(Object o) { try { txLocalNodeFailover(); } <START> catch (Exception ignore) { <END> ignore.printStackTrace(); assert false : "Impossible situation"; } return null; } }); }</code><technical_language>Please, fail(). <LINK_0></technical_language>

Target:
public void testTxLocalNodeFailover() throws Exception { startGrid(getTestIgniteInstanceName(0)); runWithAllIsolations(new IgniteCallable<Void>() { @Override public Void call() throws Exception { txLocalNodeFailover(); return null; } }); stopAllGrids(); }
Source:
<code>public static IWorkspace getWorkspace() { Job job = initWorkspaceJob; if (workspace == null && job == null) { throw new IllegalStateException(Messages.resources_workspaceClosed); } else if (job != null && Thread.currentThread() != job.getThread()) { try { while (!job.join(GET_WORKSPACE_TIMEOUT_BEFORE_WARNING, new NullProgressMonitor())) { class SeverityMultiStatus extends MultiStatus { public SeverityMultiStatus(int severity, String pluginId, String message, Throwable exception) { super(pluginId, OK, message, exception); setSeverity(severity); } } MultiStatus status = new SeverityMultiStatus(IStatus.WARNING, PI_RESOURCES, <START> NLS.bind(Messages.resources_longWorkspaceInit, <END> Thread.currentThread()), null); Exception exception = new Exception(); status.add(new Status(IStatus.INFO, PI_RESOURCES, String.format(Messages.resources_sampleStacktrace, new SimpleDateFormat("HH:mm:ss.SSS").format(new Date())), exception)); getPlugin().getLog().log(status); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } if (workspace == null) { throw new IllegalStateException(Messages.resources_workspaceClosed); } } return workspace; }</code><technical_language>I messages localized. Imagine a situation get bug report a user China messages in log</technical_language>

Target:
public static IWorkspace getWorkspace() { Job job = initWorkspaceJob; if (workspace == null && job == null) { throw new IllegalStateException(Messages.resources_workspaceClosed); } else if (job != null && Thread.currentThread() != job.getThread()) { try { while (!job.join(GET_WORKSPACE_TIMEOUT_BEFORE_WARNING_MILLIS, new NullProgressMonitor())) { logLongWorkspaceInitWarning(job); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } if (workspace == null) { throw new IllegalStateException(Messages.resources_workspaceClosed); } } return workspace; }
Source:
<code>private boolean isNotDuplicateDocumentFilter(@NonNull final DocumentFilter filterToAdd) { <START> return _addedFiltersNoDuplicates.add(filterToAdd.withId("1")); <END> }</code><technical_language>suggestion return _addedFiltersNoDuplicates.add(filterToAdd.withId("AvoidDuplicateFiltersThatOnlyDifferInTheirId"));</technical_language>

Target:
private boolean isNotDuplicateDocumentFilter(@NonNull final DocumentFilter filterToAdd) { return _addedFiltersNoDuplicates.add(filterToAdd.withId("AvoidDuplicateFiltersThatOnlyDifferInTheirId")); }
Source:
<code>public void onBindViewHolder(RecyclerView.ViewHolder holder, int pos) { if (holder instanceof ReadingListPageItemHolder) { ((ReadingListPageItemHolder) <START> holder).bindItem(readingList.getPages().get(pos)); <END> } }</code><technical_language>I this flagged a potential NPE Android Studio. sense this happen I recommend adding a readingList != null conditional, suppressing warning, throwing IllegalStateException if null show author considering this case true warnings flagged Android Studio</technical_language>

Target:
public void onBindViewHolder(RecyclerView.ViewHolder holder, int pos) { if (readingList != null && holder instanceof ReadingListPageItemHolder) { ((ReadingListPageItemHolder) holder).bindItem(readingList.getPages().get(pos)); } }
Source:
<code>public static boolean isSymlink(@Nonnull File file) throws IOException { try { Path path = file.toPath(); BasicFileAttributes attrs = Files.readAttributes(path, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS); if (attrs.isSymbolicLink()) { return true; } else if (attrs instanceof DosFileAttributes) { return attrs.isOther(); } else { return false; } } catch (NoSuchFileException e) { <START> return false; <END> } }</code><technical_language>behavior implemented appropriate. If called a nonexistent file, return false; if else wrong, throw exception. Right</technical_language>

Target:
public static boolean isSymlink(@Nonnull File file) throws IOException { try { Path path = file.toPath(); BasicFileAttributes attrs = Files.readAttributes(path, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS); if (attrs.isSymbolicLink()) { return true; } else if (attrs instanceof DosFileAttributes) { return attrs.isOther(); } else { return false; } } catch (InvalidPathException e) { throw new IOException(e); } catch (NoSuchFileException e) { return false; } }
Source:
<code>protected Geometry unifyGeometry(Geometry geom, IOReporter report) { if (geom == null) { return geom; } EnumWindingOrderTypes windingOrder = getWindingOrder(); if (windingOrder == null || windingOrder == EnumWindingOrderTypes.noChanges) { return geom; } else { Geometry unifiedGeometry; switch (windingOrder) { case counterClockwise: unifiedGeometry = WindingOrder.unifyWindingOrder(geom, true); break; case clockwise: unifiedGeometry = WindingOrder.unifyWindingOrder(geom, false); break; default: if (report != null) { <START> report.error(new IOMessageImpl("WindingOrder is not set", null)); <END> } unifiedGeometry = geom; break; } return unifiedGeometry; } }</code><technical_language>Actually, in case winding order parameter set, a enum is handled here. good if message state encountered a parameter know. state enum value's name</technical_language>

Target:
protected Geometry unifyGeometry(Geometry geom, IOReporter report) { if (geom == null) { return geom; } EnumWindingOrderTypes windingOrder = getWindingOrder(); if (windingOrder == null || windingOrder == EnumWindingOrderTypes.noChanges) { return geom; } else { Geometry unifiedGeometry; switch (windingOrder) { case counterClockwise: unifiedGeometry = WindingOrder.unifyWindingOrder(geom, true); break; case clockwise: unifiedGeometry = WindingOrder.unifyWindingOrder(geom, false); break; default: if (report != null) { report.error(new IOMessageImpl( "Parameter encountered as winding order is not known: " + windingOrder.toString(), null)); } unifiedGeometry = geom; break; } return unifiedGeometry; } }
Source:
<code>public PanelNameTextField(String panelName, FilterPanel panel) { this.panel = panel; previousText = panelName; Platform.runLater(() -> { requestFocus(); selectAll(); }); setText(panelName); setup(); textProperty().addListener(new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observableValue, String s, String s2) { if (getText().length() > PANEL_MAX_NAME_LENGTH) { setText(previousText); } previousText = getText(); } <START> }); <END> setPrefColumnCount(30); }</code><technical_language>replaced a lambda</technical_language>

Target:
public PanelNameTextField(String panelName, FilterPanel panel) { this.panel = panel; previousText = panelName; Platform.runLater(() -> { requestFocus(); selectAll(); }); setText(panelName); setup(); textProperty().addListener(c -> { if (getText().length() > PANEL_MAX_NAME_LENGTH) { setText(previousText); } previousText = getText(); }); setPrefColumnCount(30); }
Source:
<code>public void run() { GerritTrigger trigger = getGerritTrigger(); if (trigger == null) { return; } <START> if (trigger.getTriggerConfigURL() == null || trigger.getTriggerConfigURL().isEmpty()) { <END> return; } trigger.updateTriggerConfigURL(); }</code><technical_language>StringUtils.isEmpty()</technical_language>

Target:
public void run() { GerritTrigger trigger = getGerritTrigger(); if (trigger == null) { return; } if (StringUtils.isEmpty(trigger.getTriggerConfigURL())) { return; } trigger.updateTriggerConfigURL(); }
Source:
<code>public void forecast(Weather weather) { <START> this.forecast(weather, (300 + (new Random()).nextInt(600)) * 20); <END> }</code><technical_language>reason for this exact RNG function? Also, this.rand provided in World class</technical_language>

Target:
public void forecast(Weather weather) { this.forecast(weather, (300 + this.rand.nextInt(600)) * 20); }
Source:
<code>public void inputGroupRecipient(String fileName) { WebElement groupReceiverListUploadBox = this.getGroupReceiverListUploadBox(); <START> JavascriptExecutor js = (JavascriptExecutor) browser.driver; <END> js.executeScript("arguments[0].style.display = 'inline'", groupReceiverListUploadBox); File file = new File("src/test/resources/data/" + fileName); WebElement uploadGroupListFile = this.uploadGroupListFile(); uploadGroupListFile.sendKeys(file.getAbsolutePath()); js.executeScript("arguments[0].style.display = 'none'", groupReceiverListUploadBox); waitForAjaxLoaderGifToDisappear(); }</code><technical_language>a Object executeScript(String script, Object... args) method in AppPage</technical_language>

Target:
public void inputGroupRecipient(String fileName) { executeScript("arguments[0].style.display = 'inline'", groupReceiverListUploadBox); File file = new File(TestProperties.TEST_EMAILS_FOLDER + File.separator + fileName); inputFieldForGroupList.sendKeys(file.getAbsolutePath()); executeScript("arguments[0].style.display = 'none'", groupReceiverListUploadBox); waitForAjaxLoaderGifToDisappear(); }
Source:
<code>public BinaryData getBodyAsBinaryData() { final AmqpBodyType bodyType = amqpAnnotatedMessage.getBody().getBodyType(); switch (bodyType) { case DATA: <START> return ((AmqpDataBody) amqpAnnotatedMessage.getBody()).getDataAsBinaryData().stream().findFirst().get(); <END> case SEQUENCE: case VALUE: throw logger.logExceptionAsError(new UnsupportedOperationException("Body type not supported yet " + bodyType.toString())); default: logger.warning("Invalid body type {}.", bodyType); throw logger.logExceptionAsError(new IllegalStateException("Body type not valid " + bodyType.toString())); } }</code><technical_language>Do amqpAnnotatedMessage for messages need this</technical_language>

Target:
public BinaryData getBodyAsBinaryData() { final AmqpBodyType bodyType = amqpAnnotatedMessage.getBody().getBodyType(); switch (bodyType) { case DATA: return ((AmqpDataBody) amqpAnnotatedMessage.getBody()).getData().stream().findFirst().get(); case SEQUENCE: case VALUE: throw logger.logExceptionAsError(new UnsupportedOperationException("Body type not supported yet " + bodyType.toString())); default: throw logger.logExceptionAsError(new IllegalStateException("Body type not valid " + bodyType.toString())); } }
Source:
<code>public void run() { if (!isRunAllowed() || !InfinispanRoutePolicy.this.isRunAllowed()) { return; } if (isLeader() && version != null) { LOGGER.debug("Lock refresh key={} with version={}", lockKey, version); <START> if (!cache.replaceWithVersion(lockKey, lockKey, version, (int)lifespanTimeUnit.toSeconds(lifespan))) { <END> setLeader(false); } } if (!isLeader()) { Object result = cache.putIfAbsent(lockKey, lockValue, lifespan, lifespanTimeUnit); if (result == null) { setLeader(true); version = cache.getWithMetadata(lockKey).getVersion(); LOGGER.debug("Lock acquired key={} with version={}", lockKey, version); } else if (ObjectHelper.equal(lockValue, result) && !isLeader()) { setLeader(true); version = cache.getWithMetadata(lockKey).getVersion(); LOGGER.debug("Lock resumed key={} with version={}", lockKey, version); } else { setLeader(false); } } }</code><technical_language>above. new lockValue</technical_language>

Target:
public void run() { if (!isRunAllowed() || !InfinispanRoutePolicy.this.isRunAllowed()) { return; } if (isLeader() && version != null) { LOGGER.debug("Lock refresh key={} with version={}", lockKey, version); if (!cache.replaceWithVersion(lockKey, lockValue, version, (int)lifespanTimeUnit.toSeconds(lifespan))) { setLeader(false); } } if (!isLeader()) { Object result = cache.putIfAbsent(lockKey, lockValue, lifespan, lifespanTimeUnit); if (result == null) { setLeader(true); version = cache.getWithMetadata(lockKey).getVersion(); LOGGER.debug("Lock acquired key={} with version={}", lockKey, version); } else if (ObjectHelper.equal(lockValue, result) && !isLeader()) { setLeader(true); version = cache.getWithMetadata(lockKey).getVersion(); LOGGER.debug("Lock resumed key={} with version={}", lockKey, version); } else { setLeader(false); } } }
Source:
<code>public UrlValidation(String[] allowedSchemes) { if (allowedSchemes == null) { this.allowedSchemes.add(new String()); <START> } else for (String scheme : allowedSchemes) { <END> this.allowedSchemes.add(scheme.toLowerCase()); } }</code><technical_language>Please format this code correctly. Enter { else</technical_language>

Target:
public UrlValidation(String[] allowedSchemes) { if (allowedSchemes == null) { this.allowedSchemes.add(new String()); } else { for (String scheme : allowedSchemes) { this.allowedSchemes.add(scheme.toLowerCase()); } } }