auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void test() throws Exception { Schema schema = schemaManager.getSchema("dublincore"); Field title = schema.getField("title"); List<PathNode> titleNode = Arrays.asList(new PathNode(title)); ConstraintViolation violation1 = new ConstraintViolation(schema, titleNode, NotNullConstraint.get(), null); Field description = schema.getField("description"); List<PathNode> descNode = Arrays.asList(new PathNode(description)); ConstraintViolation violation2 = new ConstraintViolation(schema, descNode, new PatternConstraint(".*"), null); DocumentValidationReport report = new DocumentValidationReport(Arrays.asList(violation1, violation2)); JsonAssert json = jsonAssert(report); json.properties(4); json.has("entity-type").isEquals("validation_report"); json.has("has_error").isTrue(); json.has("number").isEquals(2); json = json.has("violations").length(2); json.has(0).properties(5).has("message").isText(); <START> json.has(1).properties(5).has("message").isText(); <END> json.childrenContains("invalid_value", null, null); json.childrenContains("constraint.entity-type", "validation_constraint", "validation_constraint"); json.childrenContains("constraint.name", "NotNullConstraint", "PatternConstraint"); json.childrenContains("path.field_name", "dc:title", "dc:description"); json.childrenContains("path.is_list_item", "false", "false"); }</code><technical_language>Worth testing messageKey field here</technical_language>

Target:
public void test() throws Exception { Schema schema = schemaManager.getSchema("dublincore"); Field title = schema.getField("title"); List<PathNode> titleNode = Arrays.asList(new PathNode(title)); ConstraintViolation violation1 = new ConstraintViolation(schema, titleNode, NotNullConstraint.get(), null); Field description = schema.getField("description"); List<PathNode> descNode = Arrays.asList(new PathNode(description)); ConstraintViolation violation2 = new ConstraintViolation(schema, descNode, new PatternConstraint(".*"), null); DocumentValidationReport report = new DocumentValidationReport(Arrays.asList(violation1, violation2)); JsonAssert json = jsonAssert(report); json.properties(4); json.has("entity-type").isEquals("validation_report"); json.has("has_error").isTrue(); json.has("number").isEquals(2); json = json.has("violations").length(2); json.has(0).properties(5).has("message").isText(); json.has(1).properties(5).has("message").isText(); json.childrenContains("messageKey", "label.schema.constraint.violation.NotNullConstraint.dublincore.title", "label.schema.constraint.violation.PatternConstraint.dublincore.description"); json.childrenContains("invalid_value", null, null); json.childrenContains("constraint.entity-type", "validation_constraint", "validation_constraint"); json.childrenContains("constraint.name", "NotNullConstraint", "PatternConstraint"); json.childrenContains("path.field_name", "dc:title", "dc:description"); json.childrenContains("path.is_list_item", "false", "false"); }
Source:
<code>public void eventMessageLogger(GlusterAsyncTask task, JobExecutionStatus oldStatus, VDSGroup cluster) { String vol = task.getTaskParameters().getVolumeName(); GlusterVolumeEntity volume = getVolumeDao().getByName(cluster.getId(), vol); if (JobExecutionStatus.ABORTED == task.getStatus() || JobExecutionStatus.FINISHED == task.getStatus() || JobExecutionStatus.FAILED == task.getStatus()){ if(oldStatus != task.getStatus()){ <START> logMessage(volume.getClusterId(), volume , taskTypeStrMap.get(task.getType()), task.getStatus().name().toLowerCase(), taskTypeAuditMsg.get(task.getType())); <END> } } }</code><technical_language>NPE volume.getClusterId. cluster.getId instead</technical_language>

Target:
public void eventMessageLogger(GlusterAsyncTask task, JobExecutionStatus oldStatus, VDSGroup cluster) { String vol = task.getTaskParameters().getVolumeName(); GlusterVolumeEntity volume = getVolumeDao().getByName(cluster.getId(), vol); if (JobExecutionStatus.ABORTED == task.getStatus() || JobExecutionStatus.FINISHED == task.getStatus() || JobExecutionStatus.FAILED == task.getStatus()){ if(oldStatus != task.getStatus()){ logMessage(cluster.getId(), volume , taskTypeStrMap.get(task.getType()), task.getStatus().name().toLowerCase(), taskTypeAuditMsg.get(task.getType())); } } }
Source:
<code>public ResourceBundle merge(ResourceBundle other) { if (other instanceof ResourceBundleDescriptor) { boolean append = ((ResourceBundleDescriptor) other).isAppend(); List<String> res = other.getResources(); List<String> merged = new ArrayList<String>(); if (append && resources != null) { merged.addAll(resources); } if (res != null) { merged.addAll(res); } if (merged.removeAll(Arrays.asList("", null))) { log.error("Some resources references were null or blank while setting " + this.name + " and have been supressed. This probably happened because some <resource> tags were empty in the xml declaration. The correct form is <resource>resource name</resource>."); <START> } <END> resources = merged; } return this; }</code><technical_language>block of code, put this in a private method. if case is in merge method resources set call setResources</technical_language>

Target:
public ResourceBundle merge(ResourceBundle other) { if (other instanceof ResourceBundleDescriptor) { boolean append = ((ResourceBundleDescriptor) other).isAppend(); List<String> res = other.getResources(); List<String> merged = new ArrayList<String>(); if (append && resources != null) { merged.addAll(resources); } if (res != null) { merged.addAll(res); } resources = merged; } return this; }
Source:
<code>public WorkerConnectionInfoProto getProto() { <START> builder.setId(id) <END> .setHost(host) .setPeerRpcPort(peerRpcPort) .setPullServerPort(pullServerPort) .setClientPort(clientPort) .setHttpInfoPort(httpInfoPort) .setQueryMasterPort(queryMasterPort); return builder.build(); }</code><technical_language>reuses builder. Recently, experienced race condition of builder object. Is possibility of concurrency problem</technical_language>

Target:
public WorkerConnectionInfoProto getProto() { WorkerConnectionInfoProto.Builder builder = WorkerConnectionInfoProto.newBuilder(); builder.setId(id) .setHost(host) .setPeerRpcPort(peerRpcPort) .setPullServerPort(pullServerPort) .setClientPort(clientPort) .setHttpInfoPort(httpInfoPort) .setQueryMasterPort(queryMasterPort); return builder.build(); }
Source:
<code>public void TopWikipediaSessionsTest() { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); TopWikipediaSessions app = new TopWikipediaSessions(); try { lma.prepareDAG(app, conf); } catch (Exception e) { e.printStackTrace(); } LocalMode.Controller lc = lma.getController(); <START> lc.run(50000); <END> }</code><technical_language>Add result verfiication</technical_language>

Target:
public void TopWikipediaSessionsTest() throws Exception { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); lma.prepareDAG(new TopWikipediaSessions(), conf); LocalMode.Controller lc = lma.getController(); ((StramLocalCluster)lc).setExitCondition(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return TopWikipediaSessions.SessionGen.getTupleCount() >= 250; } }); lc.run(30000); for (int i = 0; i < TopWikipediaSessions.Collector.getResult().size(); i++) { Assert.assertTrue(isInOrder(TopWikipediaSessions.Collector.getResult().get(i))); } }
Source:
<code>public boolean delete(final PagedMessage[] messages) throws Exception { if (storageManager != null) { storageManager.pageDeleted(storeName, pageId); } if (logger.isDebugEnabled()) { logger.debug("Deleting pageNr=" + pageId + " on store " + storeName); } List<Long> largeMessageIds = new ArrayList<>(); if (messages != null) { for (PagedMessage msg : messages) { if (msg.getMessage() instanceof ICoreMessage && (msg.getMessage()).isLargeMessage()) { LargeServerMessage lmsg = (LargeServerMessage) msg.getMessage(); lmsg.decrementDelayDeletionCount(); largeMessageIds.add(lmsg.getMessageID()); } } } try { if (!storageManager.getContext().waitCompletion(5000)) { <START> logger.info("Time out waiting for large messages" + largeMessageIds + ", may be not deleted if crashed"); <END> } if (suspiciousRecords) { ActiveMQServerLogger.LOGGER.pageInvalid(file.getFileName(), file.getFileName()); file.renameTo(file.getFileName() + ".invalidPage"); } else { file.delete(); } return true; } catch (Exception e) { ActiveMQServerLogger.LOGGER.pageDeleteError(e); return false; } }</code><technical_language>please create a paramatised logger a log code, ActiveMQServerLogger.LOGGER</technical_language>

Target:
public boolean delete(final PagedMessage[] messages) throws Exception { if (storageManager != null) { storageManager.pageDeleted(storeName, pageId); } if (logger.isDebugEnabled()) { logger.debug("Deleting pageNr=" + pageId + " on store " + storeName); } List<Long> largeMessageIds = new ArrayList<>(); if (messages != null) { for (PagedMessage msg : messages) { if (msg.getMessage() instanceof ICoreMessage && (msg.getMessage()).isLargeMessage()) { LargeServerMessage lmsg = (LargeServerMessage) msg.getMessage(); lmsg.decrementDelayDeletionCount(); largeMessageIds.add(lmsg.getMessageID()); } } } try { if (!storageManager.waitOnOperations(5000)) { ActiveMQServerLogger.LOGGER.timedOutWaitingForLargeMessagesDeletion(largeMessageIds); } if (suspiciousRecords) { ActiveMQServerLogger.LOGGER.pageInvalid(file.getFileName(), file.getFileName()); file.renameTo(file.getFileName() + ".invalidPage"); } else { file.delete(); } return true; } catch (Exception e) { ActiveMQServerLogger.LOGGER.pageDeleteError(e); return false; } }
Source:
<code>public void write(URL url) throws IllegalArgumentException, IOException { LockFile lockFile = new LockFile(file.toFile()); if (lockFile.lock()) { try { if (snapshot.isModified(file.toFile())) { LOG.debug( "Reading the underlying cookie file '{}' as it has been modified since the last access", file); Set<HttpCookie> cookiesFromFile = NetscapeCookieFile .read(file, creationDate); this.cookies = mergeCookies(cookiesFromFile, cookies); } write(file, cookies, url, creationDate); } finally { lockFile.unlock(); } } else { throw new IOException( <START> "Some other process is holding the lock, please retry writing later"); END> } }</code><technical_language>1. Do need a retry mechanism? 2. lock (and re-try) reading, too? 3. Error message externalized</technical_language>

Target:
public void write(URL url) throws IllegalArgumentException, IOException, InterruptedException { LockFile lockFile = new LockFile(file.toFile()); for (int retryCount = 0; retryCount < LOCK_ACQUIRE_MAX_RETRY_COUNT; retryCount++) { if (lockFile.lock()) { try { if (snapshot.isModified(file.toFile())) { LOG.debug( "Reading the underlying cookie file '{}' as it has been modified since the last access", file); Set<HttpCookie> cookiesFromFile = NetscapeCookieFile .read(file, creationDate); this.cookies = mergeCookies(cookiesFromFile, cookies); } write(file, cookies, url, creationDate); } finally { lockFile.unlock(); } return; } Thread.sleep(LOCK_ACQUIRE_RETRY_SLEEP); } throw new IOException( MessageFormat.format(JGitText.get().cannotLock, lockFile)); }
Source:
<code><START> private synchronized static String generateScriptName() { <END> return "Script" + (++counter) + ".groovy"; }</code><technical_language>This changes method accessed thread instance thread class. issue this method does, in general I this kind of bulk change synchronized method</technical_language>

Target:
private static synchronized String generateScriptName() { return "Script" + (++counter) + ".groovy"; }
Source:
<code>ByteArrayPoolCacheAdapter(ArrayPool<byte[]> pool) { <START> this.pool = pool; <END> }</code><technical_language>requireNonNull</technical_language>

Target:
ByteArrayPoolCacheAdapter(ArrayPool<byte[]> pool) { this.pool = requireNonNull(pool, "pool is null"); }
Source:
<code><START> private String getMaterialName() { <END> return materialName; }</code><technical_language>this change</technical_language>

Target:
public String getMaterialName() { return materialName; }
Source:
<code>ServiceMap lookupDependenciesOf(ServiceMap resolved, Class<? extends Service> requested) throws DependencyException { for (Class<? extends Service> dependency : identifyImmediateDependenciesOf(requested)) { resolved = lookupService(resolved, dependency); } <START> for (Class<? extends Service> dependency : identifyImmediateOptionalDependenciesOf(requested)) { <END> try { resolved = lookupService(resolved, dependency); } catch (DependencyException de) { OptionalServiceDependencies optionalAnnotation = requested.getAnnotation(OptionalServiceDependencies.class); if (optionalAnnotation != null && Arrays.asList(optionalAnnotation.value()).contains(dependency.getName())) { LOGGER.debug("Skipping optional dependency of that cannot be looked up: {}", requested, dependency); continue; } throw de; } } return resolved; }</code><technical_language>idea move try/catch identifyImmediateOptionalDependenciesOf</technical_language>

Target:
ServiceMap lookupDependenciesOf(ServiceMap resolved, Class<? extends Service> requested) throws DependencyException { for (Class<? extends Service> dependency : identifyImmediateDependenciesOf(requested)) { try { resolved = lookupService(resolved, dependency); } catch (DependencyException de) { OptionalServiceDependencies optionalAnnotation = requested.getAnnotation(OptionalServiceDependencies.class); if (optionalAnnotation != null && Arrays.asList(optionalAnnotation.value()).contains(dependency.getName())) { LOGGER.debug("Skipping optional dependency of that cannot be looked up: {}", requested, dependency); continue; } throw de; } } return resolved; }
Source:
<code>private void capFingerprints(final Map<FingerprintIdDetails, Fingerprint> fpMap) { for (Map.Entry<FingerprintIdDetails, Fingerprint> fingerprintEntry : fpMap.entrySet()) { <START> final Fingerprint cappedFp = new Fingerprint(fingerprintEntry.getValue().getSample(),fingerprintEntry.getValue().getSource(),fingerprintEntry.getValue().getInfo()); <END> for (HaplotypeBlock haplotypeBlock : fingerprintEntry.getValue().keySet()) { HaplotypeProbabilities cappedHp = new CappedHaplotypeProbabilities(fingerprintEntry.getValue().get(haplotypeBlock),-MAX_EFFECT_OF_EACH_HAPLOTYPE_BLOCK); cappedFp.add(cappedHp); } fpMap.put(fingerprintEntry.getKey(), cappedFp); } }</code><technical_language>IMO this clearer create a local variable for expression fingerprintEntry.getValue()</technical_language>

Target:
private Map<FingerprintIdDetails, Fingerprint> capFingerprints(final Map<FingerprintIdDetails, Fingerprint> fpMap) { return fpMap.entrySet().stream() .collect(Collectors.toMap(Map.Entry::getKey, entry -> { final Fingerprint value = entry.getValue(); final Fingerprint cappedFp = new Fingerprint(value.getSample(), value.getSource(), value.getInfo()); value.values().stream() .map(probabilities -> new CappedHaplotypeProbabilities(probabilities, -MAX_EFFECT_OF_EACH_HAPLOTYPE_BLOCK)) .forEach(cappedFp::add); return cappedFp; })); }
Source:
<code>public Response list(@Context final HttpServletRequest request, @QueryParam("contentInode") final String contentInode) throws DotDataException, DotSecurityException { <START> Logger.debug(this, String.format("listing languages %s", request.getRequestURI())); <END> final InitDataObject init = webResource.init(true, request, true); final User user = init.getUser(); final List<Language> languages = contentInode != null ? languageAPI.getAvailableContentPageLanguages(contentInode, user) : languageAPI.getLanguages(); return Response.ok(new ResponseEntityView(ImmutableList.copyOf(languages))).build(); }</code><technical_language>This replaced Logger.debug(this, () -> String.format("listing languages %s", request.getRequestURI())); supplier avoids string creation logger is in debug mode</technical_language>

Target:
public Response list(@Context final HttpServletRequest request, @QueryParam("contentInode") final String contentInode) throws DotDataException, DotSecurityException { Logger.debug(this, () -> String.format("listing languages %s", request.getRequestURI())); final InitDataObject init = webResource.init(true, request, true); final User user = init.getUser(); final List<Language> languages = contentInode != null ? languageAPI.getAvailableContentLanguages(contentInode, user) : languageAPI.getLanguages(); return Response.ok(new ResponseEntityView(ImmutableList.copyOf(languages))).build(); }
Source:
<code>public void onRightClickCauldron(PlayerInteractEvent.RightClickBlock event) { World world = event.getWorld(); EntityPlayer player = event.getEntityPlayer(); IBlockState state = world.getBlockState(event.getPos()); if (player.getHeldItem(event.getHand()).getItem() == Items.GLASS_BOTTLE && state.getBlock() instanceof BlockCauldron && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_THIRST)) <START> { <END> BlockCauldron cauldron = (BlockCauldron)state.getBlock(); int level = ((Integer)state.getValue(BlockCauldron.LEVEL)); if (level > 0 && !world.isRemote) { if (!player.capabilities.isCreativeMode) { ItemStack waterBottle = new ItemStack(TANItems.water_bottle); player.addStat(StatList.CAULDRON_USED); player.getHeldItem(event.getHand()).setCount(player.getHeldItem(event.getHand()).getCount() - 1); if (player.getHeldItem(event.getHand()).isEmpty()) { player.setHeldItem(event.getHand(), waterBottle); } else if (!player.inventory.addItemStackToInventory(waterBottle)) { player.dropItem(waterBottle, false); } else if (player instanceof EntityPlayerMP) { ((EntityPlayerMP)player).sendContainerToPlayer(player.inventoryContainer); } } cauldron.setWaterLevel(world, event.getPos(), state, level - 1); event.setCanceled(true); } } }</code><technical_language>This unrelated this change</technical_language>

Target:
public void onRightClickCauldron(PlayerInteractEvent.RightClickBlock event) { World world = event.getWorld(); EntityPlayer player = event.getEntityPlayer(); IBlockState state = world.getBlockState(event.getPos()); if (state.getBlock() instanceof BlockCauldron && player.getHeldItem(event.getHand()).getItem() == Items.GLASS_BOTTLE && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_THIRST)) { BlockCauldron cauldron = (BlockCauldron)state.getBlock(); int level = ((Integer)state.getValue(BlockCauldron.LEVEL)); if (level > 0 && !world.isRemote) { if (!player.capabilities.isCreativeMode) { ItemStack waterBottle = new ItemStack(TANItems.water_bottle); player.addStat(StatList.CAULDRON_USED); player.getHeldItem(event.getHand()).setCount(player.getHeldItem(event.getHand()).getCount() - 1); if (player.getHeldItem(event.getHand()).isEmpty()) { player.setHeldItem(event.getHand(), waterBottle); } else if (!player.inventory.addItemStackToInventory(waterBottle)) { player.dropItem(waterBottle, false); } else if (player instanceof EntityPlayerMP) { ((EntityPlayerMP)player).sendContainerToPlayer(player.inventoryContainer); } } cauldron.setWaterLevel(world, event.getPos(), state, level - 1); event.setCanceled(true); } } }
Source:
<code>public String getProperty(String key) { <START> return this.properties.get(key).toString(); <END> }</code><technical_language>return String.valueOf(this.properties.get(key)) perhaps? protect null..</technical_language>

Target:
public String getProperty(String key) { return String.valueOf(this.properties.get(key)); }
Source:
<code>public void onWorkingTreeModified(WorkingTreeModifiedEvent event) { if (event.isEmpty()) { return; } Repository repo = event.getRepository(); if (repo == null || repo.isBare()) { return; } File gitDir = repo.getDirectory(); <START> synchronized (repositoriesChanged) { <END> ResourceRefreshHandler.WorkingTreeChanges changes = repositoriesChanged.get(gitDir); if (changes == null) { repositoriesChanged.put(gitDir, new WorkingTreeChanges(event)); } else { changes.merge(event); if (changes.isEmpty()) { repositoriesChanged.remove(gitDir); } } } if (GitTraceLocation.REFRESH.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REFRESH.getLocation(), "Triggered refresh"); } run(new NullProgressMonitor()); }</code><technical_language>do do this? If call run synchronously anyway, need batch merge events. sense while a job. pass event run(). mechanism repositoriesChanged map is longer needed</technical_language>

Target:
public void onWorkingTreeModified(WorkingTreeModifiedEvent event) { if (event.isEmpty()) { return; } Repository repo = event.getRepository(); if (repo == null || repo.isBare()) { return; } if (GitTraceLocation.REFRESH.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REFRESH.getLocation(), "Triggered refresh for repo: " + repo); } try { refreshRepository(new WorkingTreeChanges(event), new NullProgressMonitor()); } catch (OperationCanceledException oe) { return; } catch (CoreException e) { Activator.error(CoreText.Activator_refreshFailed, e); } }
Source:
<code>public static boolean isOk( final Matcher matcher, final SharedPreferences prefs, final String prefix, final Network network ) { if ( ! isFilterOn( prefs, prefix ) ) { return true; } if ( matcher != null ) { try { final String ssid = network.getSsid(); if (null == ssid) { <START> } <END> matcher.reset(ssid); final boolean invert = prefs.getBoolean(prefix + ListFragment.PREF_MAPF_INVERT, false); final boolean matches = matcher.find(); if (!matches && !invert) { return false; } else if (matches && invert) { return false; } } catch (IllegalArgumentException iaex) { MainActivity.warn("Matcher: IllegalArgument: " + network.getSsid() + "pattern: " + matcher.pattern()); final boolean invert = prefs.getBoolean(prefix + ListFragment.PREF_MAPF_INVERT, false); return !invert; } } if ( NetworkType.WIFI.equals( network.getType() ) ) { switch ( network.getCrypto() ) { case Network.CRYPTO_NONE: if ( ! prefs.getBoolean( prefix + ListFragment.PREF_MAPF_OPEN, true ) ) { return false; } break; case Network.CRYPTO_WEP: if ( ! prefs.getBoolean( prefix + ListFragment.PREF_MAPF_WEP, true ) ) { return false; } break; case Network.CRYPTO_WPA: case Network.CRYPTO_WPA2: if ( ! prefs.getBoolean( prefix + ListFragment.PREF_MAPF_WPA, true ) ) { return false; } break; default: MainActivity.error( "unhandled crypto: " + network ); } } else if (!prefs.getBoolean(prefix + ListFragment.PREF_MAPF_CELL, true)) { return false; } return true; }</code><technical_language>empty if block</technical_language>

Target:
public static boolean isOk( final Matcher matcher, final SharedPreferences prefs, final String prefix, final Network network ) { if ( ! isFilterOn( prefs, prefix ) ) { return true; } if ( matcher != null ) { try { final String ssid = network.getSsid(); matcher.reset(ssid); final boolean invert = prefs.getBoolean(prefix + ListFragment.PREF_MAPF_INVERT, false); final boolean matches = matcher.find(); if (!matches && !invert) { return false; } else if (matches && invert) { return false; } } catch (IllegalArgumentException iaex) { MainActivity.warn("Matcher: IllegalArgument: " + network.getSsid() + "pattern: " + matcher.pattern()); final boolean invert = prefs.getBoolean(prefix + ListFragment.PREF_MAPF_INVERT, false); return !invert; } } if ( NetworkType.WIFI.equals( network.getType() ) ) { switch ( network.getCrypto() ) { case Network.CRYPTO_NONE: if ( ! prefs.getBoolean( prefix + ListFragment.PREF_MAPF_OPEN, true ) ) { return false; } break; case Network.CRYPTO_WEP: if ( ! prefs.getBoolean( prefix + ListFragment.PREF_MAPF_WEP, true ) ) { return false; } break; case Network.CRYPTO_WPA: case Network.CRYPTO_WPA2: if ( ! prefs.getBoolean( prefix + ListFragment.PREF_MAPF_WPA, true ) ) { return false; } break; default: MainActivity.error( "unhandled crypto: " + network ); } } else if (!prefs.getBoolean(prefix + ListFragment.PREF_MAPF_CELL, true)) { return false; } return true; }
Source:
<code><START> public String setLocale(String code) { <END> locale = new Locale(code); return locale.toString(); }</code><technical_language>marked abstract subclasses implement them</technical_language>

Target:
public void setLocale(String code) { locale = new Locale(code); }
Source:
<code>private boolean sendRequest(final URL queryUrl) throws IOException, JSONException { Logger.v(TAG, "Sending discovery request to:" + queryUrl); HashMap<String, String> headers = new HashMap<String, String>(); headers.put(WebRequestHandler.HEADER_ACCEPT, WebRequestHandler.HEADER_ACCEPT_JSON); if (mCorrelationId != null) { headers.put(AuthenticationConstants.AAD.CLIENT_REQUEST_ID, mCorrelationId.toString()); headers.put(AuthenticationConstants.AAD.RETURN_CLIENT_REQUEST_ID, "true"); } HttpWebResponse webResponse = null; String errorCodes = ""; try { ClientMetrics.INSTANCE.beginClientMetricsRecord(queryUrl, mCorrelationId, headers); try { webResponse = mWebrequestHandler.sendGet(queryUrl, headers); ClientMetrics.INSTANCE.setLastError(null); } catch (IOException e) { ClientMetrics.INSTANCE.setLastError(String.valueOf(webResponse.getStatusCode())); throw e; } HashMap<String, String> discoveryResponse = parseResponse(webResponse); if(discoveryResponse.containsKey(AuthenticationConstants.OAuth2.ERROR_CODES)) { errorCodes = discoveryResponse.get(AuthenticationConstants.OAuth2.ERROR_CODES); <START> ClientMetrics.INSTANCE.setLastError(errorCodes); <END> } return (discoveryResponse != null && discoveryResponse.containsKey(TENANT_DISCOVERY_ENDPOINT)); } finally { ClientMetrics.INSTANCE.endClientMetricsRecord(ClientMetricsEndpointType.INSTANCE_DISCOVERY, mCorrelationId); } }</code><technical_language>disappointed: Thanks for cleaning this up. I understand this way, catch rethrow it, for logging?!..</technical_language>

Target:
private boolean sendRequest(final URL queryUrl) throws IOException, JSONException { Logger.v(TAG, "Sending discovery request to:" + queryUrl); Map<String, String> headers = new HashMap<String, String>(); headers.put(WebRequestHandler.HEADER_ACCEPT, WebRequestHandler.HEADER_ACCEPT_JSON); if (mCorrelationId != null) { headers.put(AuthenticationConstants.AAD.CLIENT_REQUEST_ID, mCorrelationId.toString()); headers.put(AuthenticationConstants.AAD.RETURN_CLIENT_REQUEST_ID, "true"); } HttpWebResponse webResponse = null; String errorCodes = ""; try { ClientMetrics.INSTANCE.beginClientMetricsRecord(queryUrl, mCorrelationId, headers); try { webResponse = mWebrequestHandler.sendGet(queryUrl, headers); ClientMetrics.INSTANCE.setLastError(null); } catch (IOException e) { ClientMetrics.INSTANCE.setLastError(String.valueOf(webResponse.getStatusCode())); throw e; } final Map<String, String> discoveryResponse = parseResponse(webResponse); if(discoveryResponse.containsKey(AuthenticationConstants.OAuth2.ERROR_CODES)) { errorCodes = discoveryResponse.get(AuthenticationConstants.OAuth2.ERROR_CODES); ClientMetrics.INSTANCE.setLastError(errorCodes); } return (discoveryResponse != null && discoveryResponse.containsKey(TENANT_DISCOVERY_ENDPOINT)); } finally { ClientMetrics.INSTANCE.endClientMetricsRecord(ClientMetricsEndpointType.INSTANCE_DISCOVERY, mCorrelationId); } }
Source:
<code>@Override public void run(@Nonnull JDefinedClassOrInterface type) throws Exception { if (!(type instanceof JDefinedClass) || <START> TypeToBeEmittedMarker.isToBeEmitted(type.getSuperClass())) { <END> return; } State state = new State(); trackOverridingChains((JDefinedClass) type, state); for (JMethod method : state.effectivelyFinalMethods) { if (!method.isAbstract() && !method.isFinal()) { assert !method.isStatic() && !method.isPrivate() && !(method instanceof JConstructor); EffectivelyFinalMethodMarker.markAsEffectivelyFinal(method); if (!preserveReflections) { method.setFinal(); tracer.getStatistic(METHODS_FINALIZED).incValue(); } } } }</code><technical_language>need assert != null getSuperClass return a null isToBeEmitted want a @Nonnull</technical_language>

Target:
@Override public void run(@Nonnull JDefinedClassOrInterface type) throws Exception { JClass superClass = type.getSuperClass(); if (!(type instanceof JDefinedClass) || superClass == null || TypeToBeEmittedMarker.isToBeEmitted(superClass)) { return; } State state = new State(); trackOverridingChains((JDefinedClass) type, state); for (JMethod method : state.effectivelyFinalMethods) { if (!method.isAbstract() && !method.isFinal()) { assert !method.isStatic() && !method.isPrivate() && !(method instanceof JConstructor); EffectivelyFinalMethodMarker.markAsEffectivelyFinal(method); if (!preserveReflections) { method.setFinal(); tracer.getStatistic(METHODS_FINALIZED).incValue(); } } } }
Source:
<code>public static int parseSize(final String propertyKey, final String sizeString) { <START> final Matcher matcher = SIZE_REGEX.matcher(sizeString); <END> if (!matcher.matches()) { throw new IllegalArgumentException(String.format(PARSE_SIZE_VALUE_FAILURE_FORMAT, sizeString, propertyKey)); } final int value = Integer.valueOf(matcher.group("value")); final String magnitude = matcher.group("magnitude"); if (magnitude != null) { switch (magnitude) { case "k": return value * 1024; case "m": return value * 1024 * 1024; case "g": return value * 1024 * 1024 * 1024; default: throw new IllegalArgumentException( String.format(PARSE_SIZE_MAGNITUDE_FAILURE_FORMAT, sizeString, propertyKey, magnitude)); } } else { return value; } }</code><technical_language>I simpler more efficient simply check character if is a digit</technical_language>

Target:
public static long parseSize(final String propertyKey, final String sizeString) { final char lastCharacter = sizeString.charAt(sizeString.length() - 1); final long value; if (Character.isDigit(lastCharacter)) { return Long.valueOf(sizeString); } else { value = Long.valueOf(sizeString.substring(0, sizeString.length() - 1)); } switch (lastCharacter) { case 'k': case 'K': if (MAX_K_VALUE <= value) { throw new ConfigurationException("Value " + value + lastCharacter + " would overflow maximum long."); } return value * 1024; case 'm': case 'M': if (MAX_M_VALUE <= value) { throw new ConfigurationException("Value " + value + lastCharacter + " would overflow maximum long."); } return value * 1024 * 1024; case 'g': case 'G': if (MAX_G_VALUE <= value) { throw new ConfigurationException("Value " + value + lastCharacter + " would overflow maximum long."); } return value * 1024 * 1024 * 1024; default: throw new ConfigurationException( "Couldn't parse value: " + sizeString + " for property " + propertyKey + ". " + "Trailing character should be one of k, m, or g, but was " + lastCharacter); } }
Source:
<code>private static Map<String, Object> parseArgs(String[] args) throws Exception { if(args.length < 1) { throw new ExitException("Please provide module.", 0); } return new ParametersParser( <START> ExtensionsToolExecutor.class.getResourceAsStream("arguments.properties.in") <END> ).parse(args); }</code><technical_language>in in jar, is template for makefile</technical_language>

Target:
private static Map<String, Object> parseArgs(String[] args) throws Exception { if(args.length < 1) { throw new ExitException("Please provide module.", 0); } return new ParametersParser( ExtensionsToolExecutor.class.getResourceAsStream("arguments.properties") ).parse("core", args); }
Source:
<code>public void onReceive(Context context, Intent intent) { super.onReceive(context, intent); <START> } <END></code><technical_language>empty implementations removed I guess</technical_language>

Target:
public void onReceive(Context context, Intent intent) { ((MainApplication) context.getApplicationContext()).getInjector().injectMembers(this); super.onReceive(context, intent); }
Source:
<code>public static BoolToken matchable(Term subject, Term pattern, TermContext context) { PatternMatcher matcher = new PatternMatcher(context); try { matcher.match(subject, pattern); <START> } catch (PatternMatchingFailure e) { <END> return BoolToken.FALSE; } return BoolToken.TRUE; }</code><technical_language>question, a Exception class</technical_language>

Target:
public static BoolToken matchable(Term subject, Term pattern, TermContext context) { return PatternMatcher.matchable(subject, pattern, context) ? BoolToken.TRUE : BoolToken.FALSE; }
Source:
<code>public void createUnauthorizedEPersonNoAdminRights() throws Exception { <START> context.turnOffAuthorisationSystem(); <END> MetadataFieldRest metadataFieldRest = new MetadataFieldRest(); metadataFieldRest.setElement(ELEMENT); metadataFieldRest.setQualifier(QUALIFIER); metadataFieldRest.setScopeNote(SCOPE_NOTE); String token = getAuthToken(eperson.getEmail(), password); getClient(token) .perform(post("/api/core/metadatafields") .param("schemaId", metadataSchema.getID() + "") .content(new ObjectMapper().writeValueAsBytes(metadataFieldRest)) .contentType(contentType)) .andExpect(status().isForbidden()); }</code><technical_language>I Auth system remain in this method</technical_language>

Target:
public void createUnauthorizedEPersonNoAdminRights() throws Exception { MetadataFieldRest metadataFieldRest = new MetadataFieldRest(); metadataFieldRest.setElement(ELEMENT); metadataFieldRest.setQualifier(QUALIFIER); metadataFieldRest.setScopeNote(SCOPE_NOTE); String token = getAuthToken(eperson.getEmail(), password); getClient(token) .perform(post("/api/core/metadatafields") .param("schemaId", metadataSchema.getID() + "") .content(new ObjectMapper().writeValueAsBytes(metadataFieldRest)) .contentType(contentType)) .andExpect(status().isForbidden()); }
Source:
<code>protected void assertOwnershipAndNonOwnership(Object key, boolean allowL1) { for (Cache cache : caches) { <START> Object keyToBeChecked = cache.getAdvancedCache().getKeyDataConversion().getEncoder().toStorage(key); <END> DataContainer dc = cache.getAdvancedCache().getDataContainer(); InternalCacheEntry ice = dc.get(keyToBeChecked); if (isOwner(cache, keyToBeChecked)) { assertNotNull(ice); assertTrue(ice instanceof ImmortalCacheEntry); } else { if (allowL1) { assertTrue("ice is null or L1Entry", ice == null || ice.isL1Entry()); } else { eventuallyEquals("Fail on non-owner cache " + addressOf(cache) + ": dc.get(" + key + ")", null, () -> dc.get(keyToBeChecked)); } } } }</code><technical_language>I this line Object keyToBeChecked = cache.getAdvancedCache().getKeyDataConversion().toStorage(key); instead</technical_language>

Target:
protected void assertOwnershipAndNonOwnership(Object key, boolean allowL1) { for (Cache cache : caches) { Object keyToBeChecked = cache.getAdvancedCache().getKeyDataConversion().toStorage(key); DataContainer dc = cache.getAdvancedCache().getDataContainer(); InternalCacheEntry ice = dc.get(keyToBeChecked); if (isOwner(cache, keyToBeChecked)) { assertNotNull(ice); assertTrue(ice instanceof ImmortalCacheEntry); } else { if (allowL1) { assertTrue("ice is null or L1Entry", ice == null || ice.isL1Entry()); } else { eventuallyEquals("Fail on non-owner cache " + addressOf(cache) + ": dc.get(" + key + ")", null, () -> dc.get(keyToBeChecked)); } } } }
Source:
<code>public void run() { if (job == null) { return; } FolderComputation<?> computation = job.getComputation(); <START> long delay = System.currentTimeMillis() - computation.getTimestamp().getTimeInMillis(); <END> if (delay < interval) { return; } job.scheduleBuild(0, new TimerTrigger.TimerTriggerCause()); }</code><technical_language>Is this related? produce a merge conflict #91</technical_language>

Target:
public void run() { if (job == null) { return; } long now = System.currentTimeMillis(); FolderComputation<?> computation = job.getComputation(); if (computation != null) { long delay = now - computation.getTimestamp().getTimeInMillis(); if (delay < interval) { LOGGER.log(Level.FINE, "Too early to reschedule {0} based on last computation", job); return; } } if (now - lastTriggered < interval) { LOGGER.log(Level.FINE, "Too early to reschedule {0} based on last triggering", job); return; } if (job.scheduleBuild(0, new TimerTrigger.TimerTriggerCause())) { lastTriggered = now; } else { LOGGER.log(Level.WARNING, "Queue refused to schedule {0}", job); } }
Source:
<code><START> public void recordTermination() { <END> try { throw new RuntimeException(String.format("Termination requested by %s", Thread.currentThread())); } catch (RuntimeException e) { terminatedBy.add(e); } }</code><technical_language>@since (can TODO version string a placeholder remind merger)</technical_language>

Target:
public void recordTermination() { StaplerRequest request = Stapler.getCurrentRequest(); if (request != null) { terminatedBy.add(new TerminationRequest( String.format("Termination requested at %s by %s [id=%d] from HTTP request for %s", new Date(), Thread.currentThread(), Thread.currentThread().getId(), request.getRequestURL() ) )); } else { terminatedBy.add(new TerminationRequest( String.format("Termination requested at %s by %s [id=%d]", new Date(), Thread.currentThread(), Thread.currentThread().getId() ) )); } }
Source:
<code>public void testSetDIOSuccess() throws Exception { ATCommandResponse mockedResponse = Mockito.mock(ATCommandResponse.class); Mockito.when(mockedResponse.getResponseStatus()).thenReturn(ATCommandStatus.OK); Mockito.doReturn(mockedResponse).when(xbeeDevice).sendATCommand((ATCommand)Mockito.any()); try { <START> xbeeDevice.setDIOValue(IOLine.DIO0_AD0, IOValue.HIGH); <END> } catch (InvalidOperatingModeException e) { fail("This exception shouldn't be thrown now."); } catch (XBeeException e) { fail("This exception shouldn't be thrown now."); } }</code><technical_language>Do catch exceptions throw them, if this occurs test case is failing is need</technical_language>

Target:
public void testSetDIOSuccess() throws InvalidOperatingModeException, XBeeException { ATCommandResponse mockedResponse = Mockito.mock(ATCommandResponse.class); Mockito.when(mockedResponse.getResponseStatus()).thenReturn(ATCommandStatus.OK); Mockito.doReturn(mockedResponse).when(xbeeDevice).sendATCommand((ATCommand)Mockito.any()); xbeeDevice.setDIOValue(IOLine.DIO0_AD0, IOValue.HIGH); }
Source:
<code>ProxyConfiguration(ProxyAuthenticationType authentication, Proxy proxyAddress, String username, String password) { Objects.requireNonNull(authentication); this.authentication = authentication; this.proxyAddress = proxyAddress; if (username != null && password != null) { this.credentials = new PasswordAuthentication(username, password.toCharArray()); } else { <START> logger.asInformational().log("Username or Password is NULL."); <END> this.credentials = null; } }</code><technical_language>"..is null, Java system defaults."</technical_language>

Target:
ProxyConfiguration(ProxyAuthenticationType authentication, Proxy proxyAddress, String username, String password) { Objects.requireNonNull(authentication); this.authentication = authentication; this.proxyAddress = proxyAddress; if (username != null && password != null) { this.credentials = new PasswordAuthentication(username, password.toCharArray()); } else { logger.asInformational().log("Username or password is null. Using system-wide authentication."); this.credentials = null; } }
Source:
<code>private void verifyCachesAndGroups(IgniteEx ig) { Map<String, DynamicCacheDescriptor> caches = ig.context().cache().cacheDescriptors(); assertEquals(3, caches.size()); assertTrue(caches.keySet().contains(GridCacheUtils.UTILITY_CACHE_NAME)); assertTrue(caches.keySet().contains(STATIC_CACHE_NAME_0)); assertTrue(caches.keySet().contains(DYNAMIC_CACHE_NAME_0)); Map<Integer, CacheGroupDescriptor> groups = ig.context().cache().cacheGroupDescriptors(); assertEquals(2, groups.size()); boolean defaultGroupFound = false; boolean mixedCachesGroupFound = false; for (CacheGroupDescriptor grpDesc : groups.values()) { if (grpDesc.cacheOrGroupName().equals(GridCacheUtils.UTILITY_CACHE_NAME)) defaultGroupFound = true; else if (grpDesc.cacheOrGroupName().equals(MIXED_CACHES_GROUP_NAME_0)) mixedCachesGroupFound = true; } <START> assertTrue(defaultGroupFound && mixedCachesGroupFound); <END> }</code><technical_language>Assert message re-used non-persistent test</technical_language>

Target:
private void verifyCachesAndGroups(IgniteEx ig) { Map<String, DynamicCacheDescriptor> caches = ig.context().cache().cacheDescriptors(); assertEquals(3, caches.size()); assertTrue(caches.keySet().contains(GridCacheUtils.UTILITY_CACHE_NAME)); assertTrue(caches.keySet().contains(STATIC_CACHE_NAME_0)); assertTrue(caches.keySet().contains(DYNAMIC_CACHE_NAME_0)); Map<Integer, CacheGroupDescriptor> groups = ig.context().cache().cacheGroupDescriptors(); assertEquals(2, groups.size()); boolean defaultGroupFound = false; boolean mixedCachesGroupFound = false; for (CacheGroupDescriptor grpDesc : groups.values()) { if (grpDesc.cacheOrGroupName().equals(GridCacheUtils.UTILITY_CACHE_NAME)) defaultGroupFound = true; else if (grpDesc.cacheOrGroupName().equals(MIXED_CACHES_GROUP_NAME_0)) mixedCachesGroupFound = true; } assertTrue(String.format("Default group found: %b, mixed group found: %b", defaultGroupFound, mixedCachesGroupFound), defaultGroupFound && mixedCachesGroupFound); }
Source:
<code>private static void copyFileFromPackage(final Context context, final int resourceId, final String target) { try { final FileOutputStream outputStream = context.openFileOutput(target, 0); final InputStream inputStream = context.getResources().openRawResource(resourceId); Util.copyStream(inputStream, outputStream); outputStream.flush(); outputStream.close(); inputStream.close(); Lg.i("created ", target); <START> } catch (final FileNotFoundException e) { <END> Lg.ex(e, "FileNotFoundException: failed to create: ", target); } catch (final IOException e) { Lg.ex(e, "IOException: failed to create: ", target); } }</code><technical_language>this? } catch (final FileNotFoundException | IOException e) { Lg.ex(e, "Failed create: ", target);</technical_language>

Target:
private static void copyFileFromPackage(final Context context, final int resourceId, final String target) { try { final FileOutputStream outputStream = context.openFileOutput(target, 0); final InputStream inputStream = context.getResources().openRawResource(resourceId); Util.copyStream(inputStream, outputStream); outputStream.flush(); outputStream.close(); inputStream.close(); Lg.i("created ", target); } catch (final IOException e) { Lg.ex(e, "IOException: failed to create: ", target); } }
Source:
<code>public boolean removeRoot(InternalRegion rootRgn) { String regionName = rootRgn.getName(); InternalRegion found = rootRegions.get(regionName); <START> if (found == rootRgn) { <END> InternalRegion previous = rootRegions.remove(regionName); Assert.assertTrue(previous == rootRgn); return true; } return false; }</code><technical_language>This code longer correct. synchronization this thread safe. sync need call a method rootRegions once. I want do this: return rootRegions.remove(regionName, rootRgn);</technical_language>

Target:
public boolean removeRoot(InternalRegion rootRgn) { String regionName = rootRgn.getName(); return rootRegions.remove(regionName, rootRgn); }
Source:
<code>public int purgeBlobs(List<CloudBlobMetadata> blobMetadataList) throws CloudStorageException { int numPurged = 0; for (CloudBlobMetadata blobMetadata : blobMetadataList) { purgeBlob(blobMetadata); <START> numPurged++; <END> } logger.info("Purged blobs", numPurged); return numPurged; }</code><technical_language>also, this method throw exception return list size</technical_language>

Target:
public int purgeBlobs(List<CloudBlobMetadata> blobMetadataList) throws CloudStorageException { int numPurged = 0; for (CloudBlobMetadata blobMetadata : blobMetadataList) { if (purgeBlob(blobMetadata)) { numPurged++; } } logger.info("Purged blobs", numPurged); return numPurged; }
Source:
<code>public void coupleMbusDevice(final DeviceMessageMetadata deviceMessageMetadata, final CoupleMbusDeviceRequestData requestData) throws FunctionalException { final String deviceIdentification = deviceMessageMetadata.getDeviceIdentification(); final String mbusDeviceIdentification = requestData.getMbusDeviceIdentification(); LOGGER.debug("coupleMbusDevice for organisationIdentification: for gateway: {}, m-bus device ", deviceMessageMetadata.getOrganisationIdentification(), deviceIdentification, mbusDeviceIdentification); try { final SmartMeter gatewayDevice = this.domainHelperService.findSmartMeter(deviceIdentification); <START> final SmartMeter gasMeterDevice = this.domainHelperService.findSmartMeter(mbusDeviceIdentification); <END> this.checkGasMeter(gasMeterDevice); final MbusChannelElementsDto mbusChannelElementsDto = this.makeMbusChannelElementsDto(gasMeterDevice); final RequestMessage requestMessage = new RequestMessage(deviceMessageMetadata.getCorrelationUid(), deviceMessageMetadata.getOrganisationIdentification(), deviceMessageMetadata.getDeviceIdentification(), gatewayDevice.getIpAddress(), mbusChannelElementsDto); this.osgpCoreRequestMessageSender.send(requestMessage, deviceMessageMetadata.getMessageType(), deviceMessageMetadata.getMessagePriority(), deviceMessageMetadata.getScheduleTime()); } catch (final FunctionalException ex) { throw ex; } }</code><technical_language>A good point in time refactor name gasMeterDevice mBusDevice</technical_language>

Target:
public void coupleMbusDevice(final DeviceMessageMetadata deviceMessageMetadata, final CoupleMbusDeviceRequestData requestData) throws FunctionalException { final String deviceIdentification = deviceMessageMetadata.getDeviceIdentification(); final String mbusDeviceIdentification = requestData.getMbusDeviceIdentification(); LOGGER.debug("coupleMbusDevice for organizationIdentification: for gateway: {}, m-bus device ", deviceMessageMetadata.getOrganisationIdentification(), deviceIdentification, mbusDeviceIdentification); try { final SmartMeter gatewayDevice = this.domainHelperService.findSmartMeter(deviceIdentification); final SmartMeter mbusDevice = this.domainHelperService.findSmartMeter(mbusDeviceIdentification); this.checkAndHandleInactiveMbusDevice(mbusDevice); this.checkAndHandleIfGivenMBusAlreadyCoupled(mbusDevice); final MbusChannelElementsDto mbusChannelElementsDto = this.makeMbusChannelElementsDto(mbusDevice); final RequestMessage requestMessage = new RequestMessage(deviceMessageMetadata.getCorrelationUid(), deviceMessageMetadata.getOrganisationIdentification(), deviceMessageMetadata.getDeviceIdentification(), gatewayDevice.getIpAddress(), mbusChannelElementsDto); this.osgpCoreRequestMessageSender.send(requestMessage, deviceMessageMetadata.getMessageType(), deviceMessageMetadata.getMessagePriority(), deviceMessageMetadata.getScheduleTime()); } catch (final FunctionalException ex) { throw ex; } }
Source:
<code><START> public ParsedColInfo toTVE(int indx, int diff) { <END> TupleValueExpression exp = new TupleValueExpression(tableName, tableAlias, columnName, alias, expression, indx); exp.setDifferentiator(diff); expression = exp; return this; }</code><technical_language>This a static method? access instance members</technical_language>

Target:
public ParsedColInfo toTVE(int indx, int diff) { TupleValueExpression exp = new TupleValueExpression(m_tableName, m_tableAlias, m_columnName, m_alias, m_expression, indx); exp.setDifferentiator(diff); m_expression = exp; return this; }
Source:
<code>public SolNames() { <START> <END> planets = new ArrayList<String>(); systems = new ArrayList<String>(); final Set<ResourceUrn> planetNameConfigs = Assets.getAssetHelper().list(Json.class, "[a-zA-Z0-9]*:planetNamesConfig"); for (ResourceUrn planetNameConfig : planetNameConfigs) { planets.addAll(readList(planetNameConfig.toString())); } final Set<ResourceUrn> systemNameConfigs = Assets.getAssetHelper().list(Json.class, "[a-zA-Z0-9]*:systemNamesConfig"); for (ResourceUrn systemNameConfig : systemNameConfigs) { systems.addAll(readList(systemNameConfig.toString())); } }</code><technical_language>Remove this newline</technical_language>

Target:
public SolNames() { planets = new HashMap<String, ArrayList<String>>(); systems = new ArrayList<String>(); final Set<ResourceUrn> planetNameConfigs = Assets.getAssetHelper().list(Json.class, "[a-zA-Z0-9]*:planetNamesConfig"); for (ResourceUrn planetNameConfig : planetNameConfigs) { planets.put(planetNameConfig.getModuleName().toString(), readList(planetNameConfig.toString())); } final Set<ResourceUrn> systemNameConfigs = Assets.getAssetHelper().list(Json.class, "[a-zA-Z0-9]*:systemNamesConfig"); for (ResourceUrn systemNameConfig : systemNameConfigs) { systems.addAll(readList(systemNameConfig.toString())); } }