auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private MethodInvocationSupport() { <START> throw new UnsupportedOperationException("utility class"); <END> }</code><technical_language>I call classes invokedynamic bootstrap methods "utility classes" :smile:</technical_language>

Target:
private MethodInvocationSupport() { throw new UnsupportedOperationException("Don't instantiate invokedynamic bootstrap class"); }
Source:
<code>public Boolean call() { try { CallContext callContext = bulkInputOutputCallerImpl.getCallContextQueue().poll(); if(callContext != null) bulkInputOutputCallerImpl.processInput(callContext, inputBatch); if(getPhase() == WorkPhase.COMPLETED && bulkInputOutputCallerImpl.getCallContextQueue().isEmpty()) { getCallerThreadPoolExecutor().shutdown(); } <START> else if(callContext != null) { <END> bulkInputOutputCallerImpl.getCallContextQueue().put(callContext); } } catch(Exception ex) { throw new InternalError("Error occurred while processing CallContext - "+ex.getMessage()); } return true; }</code><technical_language>also, is important check for a null call context checking for shutdown</technical_language>

Target:
public Boolean call() { try { CallContext callContext = bulkInputOutputCallerImpl.getCallContextQueue().poll(); if(callContext != null) { bulkInputOutputCallerImpl.processInput(callContext, inputBatch); bulkInputOutputCallerImpl.getCallContextQueue().put(callContext); } else if(bulkInputOutputCallerImpl.getCallContextQueue().isEmpty() && getCallerThreadPoolExecutor().getActiveCount() == 0) { getCallerThreadPoolExecutor().shutdown(); } } catch(Exception ex) { throw new InternalError("Error occurred while processing CallContext - "+ex.getMessage()); } return true; }
Source:
<code>public void append(InputStream inputStream, String path) throws IOException { Assert.notNull(inputStream, "inputStream must not be null"); <START> Assert.hasText(path, "path must not be null"); <END> boolean completed = this.client.appendFile(path, inputStream); if (!completed) { throw new IOException("Failed to append to '" + path + "'. Server replied with: " + this.client.getReplyString()); } if (logger.isInfoEnabled()) { logger.info("File has been successfully transfered to: " + path); } }</code><technical_language>s/not null/not empty</technical_language>

Target:
public void append(InputStream inputStream, String path) throws IOException { Assert.notNull(inputStream, "inputStream must not be null"); Assert.hasText(path, "path must not be null or empty"); boolean completed = this.client.appendFile(path, inputStream); if (!completed) { throw new IOException("Failed to append to '" + path + "'. Server replied with: " + this.client.getReplyString()); } if (logger.isInfoEnabled()) { logger.info("File has been successfully appended to: " + path); } }
Source:
<code>public void testUserAgent_invalidUserAgentThrows() throws InterruptedException { expectedException.expect(IllegalArgumentException.class); OkHttpClientOptions okHttpClientOptions = OkHttpClientOptions.builder().build(); <START> RetrofitClientFactory.createProxy(Optional.<SSLSocketFactory>absent(), "", String.class, okHttpClientOptions, <END> "("); }</code><technical_language>check message sorts of throw in there</technical_language>

Target:
public void testUserAgent_invalidUserAgentThrows() throws InterruptedException { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage(is("User Agent must match pattern '[A-Za-z0-9()/\\.,_\\s]+': !@")); OkHttpClientOptions okHttpClientOptions = OkHttpClientOptions.builder().build(); RetrofitClientFactory.createProxy(Optional.<SSLSocketFactory>absent(), "", String.class, okHttpClientOptions, "!@"); }
Source:
<code>private static void inject(Object target, Object source, Finder finder) { if (target == null) <START> throw new UnableToInjectException("target of injection cannot be null"); <END> Class<?> targetClass = target.getClass(); try { Method inject = INJECTORS.get(targetClass); if (inject == null) { Class<?> injector = Class.forName(targetClass.getName() + InjectViewProcessor.SUFFIX); inject = injector.getMethod("inject", Finder.class, targetClass, Object.class); INJECTORS.put(targetClass, inject); } inject.invoke(null, finder, target, source); } catch (ClassNotFoundException e) { INJECTORS.put(targetClass, NO_OP); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new UnableToInjectException("Unable to inject views for " + target, e); } }</code><technical_language>Wrap in curly braces. Capitalize "Target" in exception message. argue this a NullPointerException</technical_language>

Target:
private static void inject(Object target, Object source, Finder finder) { Class<?> targetClass = target.getClass(); try { Method inject; if (!INJECTORS.containsKey(targetClass)) { Class<?> injector = Class.forName(targetClass.getName() + InjectViewProcessor.SUFFIX); inject = injector.getMethod("inject", Finder.class, targetClass, Object.class); INJECTORS.put(targetClass, inject); } else { inject = INJECTORS.get(targetClass); } if (inject != null) inject.invoke(null, finder, target, source); } catch (ClassNotFoundException e) { INJECTORS.put(targetClass, NO_OP); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new UnableToInjectException("Unable to inject views for " + target, e); } }
Source:
<code>private static boolean validateName(String name){ if(name.toLowerCase().endsWith(".js") || name.toLowerCase().endsWith(".css") || name.toLowerCase().endsWith(".jsp") || name.toLowerCase().endsWith(".htm") || name.toLowerCase().endsWith(".html") || <START> name.toLowerCase().endsWith(".xhtml") END> ){ return true; } return false; }</code><technical_language>String nameLc = name.toLowerCase(); If(nameLc.endsWith() || nameLc.endsWith()....) is call name.toLowerCase() 6 times</technical_language>

Target:
private static boolean validateName(String name){ String nameLc = name.toLowerCase(); if(nameLc.endsWith(".js") || nameLc.endsWith(".css") || nameLc.endsWith(".jsp") || nameLc.endsWith(".htm") || nameLc.endsWith(".html") || nameLc.endsWith(".xhtml") ){ return true; } return false; }
Source:
<code>public void addDeadWatcher(int watcherBit) { while (maxInProcessingDeadWatchers > 0 && !stopped && totalDeadWatchers.get() >= maxInProcessingDeadWatchers) { try { RATE_LOGGER.rateLimitLog("Waiting for dead watchers cleaning"); synchronized(processingCompletedEvent) { processingCompletedEvent.wait(100); } <START> ServerMetrics.ADD_DEAD_WATCHER_STALL_TIME.add(100); <END> } catch (InterruptedException e) { LOG.info("Got interrupted while waiting for dead watches " + "queue size"); break; } } synchronized (this) { if (deadWatchers.add(watcherBit)) { totalDeadWatchers.incrementAndGet(); ServerMetrics.DEAD_WATCHERS_QUEUED.add(1); if (deadWatchers.size() >= watcherCleanThreshold) { synchronized (cleanEvent) { cleanEvent.notifyAll(); } } } } }</code><technical_language>Is 100 right? supposing *wait* timeouts? Is worth track exact time</technical_language>

Target:
public void addDeadWatcher(int watcherBit) { while (maxInProcessingDeadWatchers > 0 && !stopped && totalDeadWatchers.get() >= maxInProcessingDeadWatchers) { try { RATE_LOGGER.rateLimitLog("Waiting for dead watchers cleaning"); long startTime = Time.currentElapsedTime(); synchronized(processingCompletedEvent) { processingCompletedEvent.wait(100); } long latency = Time.currentElapsedTime() - startTime; ServerMetrics.ADD_DEAD_WATCHER_STALL_TIME.add(latency); } catch (InterruptedException e) { LOG.info("Got interrupted while waiting for dead watches " + "queue size"); break; } } synchronized (this) { if (deadWatchers.add(watcherBit)) { totalDeadWatchers.incrementAndGet(); ServerMetrics.DEAD_WATCHERS_QUEUED.add(1); if (deadWatchers.size() >= watcherCleanThreshold) { synchronized (cleanEvent) { cleanEvent.notifyAll(); } } } } }
Source:
<code>private QueryStatistics createQueryStatistics(QueryInfo queryInfo) { ImmutableList.Builder<String> operatorSummaries = ImmutableList.builder(); for (OperatorStats summary : queryInfo.getQueryStats().getOperatorSummaries()) { operatorSummaries.add(operatorStatsCodec.toJson(summary)); } QueryStats queryStats = queryInfo.getQueryStats(); return new QueryStatistics( ofMillis(queryStats.getTotalCpuTime().toMillis()), ofMillis(queryStats.getTotalScheduledTime().toMillis()), ofMillis(queryStats.getQueuedTime().toMillis()), Optional.of(ofMillis(queryStats.getAnalysisTime().toMillis())), queryStats.getPeakUserMemoryReservation().toBytes(), queryStats.getPeakTotalMemoryReservation().toBytes(), queryStats.getPeakTaskUserMemory().toBytes(), queryStats.getPeakTaskTotalMemory().toBytes(), queryStats.getRawInputDataSize().toBytes(), queryStats.getRawInputPositions(), queryStats.getOutputDataSize().toBytes(), queryStats.getOutputPositions(), queryStats.getWrittenOutputLogicalDataSize().toBytes(), <START> queryStats.getWrittenOutputPositions(), <END> queryStats.getCumulativeUserMemory(), queryStats.getStageGcStatistics(), queryStats.getCompletedDrivers(), queryInfo.isCompleteInfo(), getCpuDistributions(queryInfo), operatorSummaries.build()); }</code><technical_language>commit message typo: intermidiate -> intermediate</technical_language>

Target:
private QueryStatistics createQueryStatistics(QueryInfo queryInfo) { ImmutableList.Builder<String> operatorSummaries = ImmutableList.builder(); for (OperatorStats summary : queryInfo.getQueryStats().getOperatorSummaries()) { operatorSummaries.add(operatorStatsCodec.toJson(summary)); } QueryStats queryStats = queryInfo.getQueryStats(); return new QueryStatistics( ofMillis(queryStats.getTotalCpuTime().toMillis()), ofMillis(queryStats.getTotalScheduledTime().toMillis()), ofMillis(queryStats.getQueuedTime().toMillis()), Optional.of(ofMillis(queryStats.getAnalysisTime().toMillis())), queryStats.getPeakUserMemoryReservation().toBytes(), queryStats.getPeakTotalMemoryReservation().toBytes(), queryStats.getPeakTaskUserMemory().toBytes(), queryStats.getPeakTaskTotalMemory().toBytes(), queryStats.getRawInputDataSize().toBytes(), queryStats.getRawInputPositions(), queryStats.getOutputDataSize().toBytes(), queryStats.getOutputPositions(), queryStats.getWrittenOutputLogicalDataSize().toBytes(), queryStats.getWrittenOutputPositions(), queryStats.getWrittenIntermediatePhysicalDataSize().toBytes(), queryStats.getCumulativeUserMemory(), queryStats.getStageGcStatistics(), queryStats.getCompletedDrivers(), queryInfo.isCompleteInfo(), getCpuDistributions(queryInfo), operatorSummaries.build()); }
Source:
<code>public VALUE setValue( VALUE value ) { <START> return null; <END> }</code><technical_language>throw new UnsupportedOperationException</technical_language>

Target:
public VALUE setValue( VALUE value ) { throw new UnsupportedOperationException(); }
Source:
<code>public void metaUrlExtractorTest() throws IOException { HashMap<String, String> linkMap = new HashMap<>(); <START> linkMap.put("<LINK_3>", "<LINK_1>"); <END> for (HashMap.Entry<String, String> pair : linkMap.entrySet()) { assertEquals(pair.getValue(), ClientConnection.getRedirect(pair.getKey())); } }</code><technical_language>test is for checking redirects meta tag present a webpage for 301 response codes. need check this similar</technical_language>

Target:
public void metaUrlExtractorTest() throws IOException { HashMap<String, String> linkMap = new HashMap<>(); linkMap.put("<LINK_0>", "<LINK_0>/en/index.html"); for (HashMap.Entry<String, String> pair : linkMap.entrySet()) { assertEquals(pair.getValue(), ClientConnection.getRedirect(pair.getKey())); } }
Source:
<code>public ItemBlockBloodTank(Block block) { super(block); setHasSubtypes(true); <START> setMaxDamage(0); <END> }</code><technical_language>Unecessary</technical_language>

Target:
public ItemBlockBloodTank(Block block) { super(block); setHasSubtypes(true); }
Source:
<code>public static List<AlarmExpansion> getExpansionsAtExpectedTime(final DateTime expectedRingTime, final List<Alarm> alarmList) { <START> List<AlarmExpansion> expansions = Lists.newArrayList(); <END> for(final Alarm alarm: alarmList){ if(alarm.expansions.isEmpty()) { continue; } if(expectedRingTime.getHourOfDay() != alarm.hourOfDay || expectedRingTime.getMinuteOfHour() != alarm.minuteOfHour) { continue; } if(!alarm.isRepeated && alarm.year == expectedRingTime.getYear() && alarm.month == expectedRingTime.getMonthOfYear() && alarm.day == expectedRingTime.getDayOfMonth()){ expansions.addAll(alarm.expansions); } if(alarm.isRepeated && alarm.dayOfWeek.contains(expectedRingTime.getDayOfWeek())){ expansions.addAll(alarm.expansions); } } return expansions; }</code><technical_language>final</technical_language>

Target:
public static List<AlarmExpansion> getExpansionsAtExpectedTime(final DateTime expectedRingTime, final List<Alarm> alarmList) { final List<AlarmExpansion> expansions = Lists.newArrayList(); for(final Alarm alarm: alarmList){ if(alarm.expansions.isEmpty()) { continue; } if(expectedRingTime.getHourOfDay() != alarm.hourOfDay || expectedRingTime.getMinuteOfHour() != alarm.minuteOfHour) { continue; } if(!alarm.isRepeated && alarm.year == expectedRingTime.getYear() && alarm.month == expectedRingTime.getMonthOfYear() && alarm.day == expectedRingTime.getDayOfMonth()){ expansions.addAll(alarm.expansions); } if(alarm.isRepeated && alarm.dayOfWeek.contains(expectedRingTime.getDayOfWeek())){ expansions.addAll(alarm.expansions); } } return expansions; }
Source:
<code>private CheckBox renderCheckBox(LabeledWidgetsGrid g, ConfigParameterInfo param) { CheckBox checkBox = new CheckBox(); checkBox.setValue(Boolean.parseBoolean(param.value())); <START> g.add(getDisplayName(param), checkBox); <END> saveEnabler.listenTo(checkBox); return checkBox; }</code><technical_language>want g.add(null, checkBox) put display name CheckBox widget. This shows [x] Foo instead of Foo [x] users get a bigger click target (the label text) mash mouse</technical_language>

Target:
private CheckBox renderCheckBox(LabeledWidgetsGrid g, ConfigParameterInfo param) { CheckBox checkBox = new CheckBox(getDisplayName(param)); checkBox.setValue(Boolean.parseBoolean(param.value())); g.add(null, checkBox); saveEnabler.listenTo(checkBox); return checkBox; }
Source:
<code>protected void subscribeActual(MaybeObserver<? super T> s) { <START> s.onSubscribe(EmptyDisposable.INSTANCE); <END> try { T v = callable.call(); if (v != null) { s.onSuccess(v); } else { s.onComplete(); } } catch (Throwable e) { s.onError(e); } }</code><technical_language>Setting EmptyDisposable onError() onComplete() a fused-consumer expect request a it</technical_language>

Target:
protected void subscribeActual(MaybeObserver<? super T> s) { s.onSubscribe(EmptyDisposable.INSTANCE); try { T v = callable.call(); if (v != null) { s.onSuccess(v); } else { s.onComplete(); } } catch (Throwable e) { Exceptions.throwIfFatal(e); s.onError(e); } }
Source:
<code>public void testCreateFileHeader_Binary() throws Exception { ObjectId adId = blob("a\nd\n"); ObjectId binId = blob("a\nb\nc\n\0\0\0\0d\n"); String diffHeader = makeDiffHeader(PATH_A, PATH_B, adId, binId) + "Binary files differ\n"; DiffEntry ad = DiffEntry.delete(PATH_A, adId); DiffEntry abcd = DiffEntry.add(PATH_B, binId); <START> DiffEntry mod = DiffEntry.pair(ChangeType.MODIFY, ad, abcd, 50); <END> FileHeader fh = df.createFileHeader(mod); assertEquals(diffHeader, RawParseUtils.decode(fh.getBuffer())); assertEquals(1, fh.getHunks().size()); HunkHeader hh = fh.getHunks().get(0); assertEquals(0, hh.toEditList().size()); }</code><technical_language>Again, score of 0 for a modify</technical_language>

Target:
public void testCreateFileHeader_Binary() throws Exception { ObjectId adId = blob("a\nd\n"); ObjectId binId = blob("a\nb\nc\n\0\0\0\0d\n"); String diffHeader = makeDiffHeader(PATH_A, PATH_B, adId, binId) + "Binary files differ\n"; DiffEntry ad = DiffEntry.delete(PATH_A, adId); DiffEntry abcd = DiffEntry.add(PATH_B, binId); DiffEntry mod = DiffEntry.pair(ChangeType.MODIFY, ad, abcd, 0); FileHeader fh = df.createFileHeader(mod); assertEquals(diffHeader, RawParseUtils.decode(fh.getBuffer())); assertEquals(1, fh.getHunks().size()); HunkHeader hh = fh.getHunks().get(0); assertEquals(0, hh.toEditList().size()); }
Source:
<code>public ResultSubpartitionStateHandle deserializeResultSubpartitionStateHandle(DataInputStream dis) throws IOException { <START> final boolean hasResultSubpartitionStateHandle = dis.readInt() != 0; <END> return hasResultSubpartitionStateHandle ? channelStateHandleSerializer.deserializeResultSubpartitionStateHandle(dis) : null; }</code><technical_language>dis.readInt() != 0 is good enough check maintain compatibility? Do test coverage for that</technical_language>

Target:
public StateObjectCollection<ResultSubpartitionStateHandle> deserializeResultSubpartitionStateHandle(DataInputStream dis) throws IOException { return deserializeCollection(dis, channelStateHandleSerializer::deserializeResultSubpartitionStateHandle); }
Source:
<code>public <T extends Assignable> T createFromZipFile(final Class<T> type, final File archiveFile) throws IllegalArgumentException, ArchiveImportException { if (type == null) { throw new IllegalArgumentException("Type must be specified"); } if (archiveFile == null) { throw new IllegalArgumentException("File must be specified"); } if (!archiveFile.exists()) { throw new IllegalArgumentException("File for import does not exist: " + archiveFile.getAbsolutePath()); } if (archiveFile.isDirectory()) { throw new IllegalArgumentException("File for import must not be a directory: " + archiveFile.getAbsolutePath()); } ZipFile zipFile = null; try { zipFile = new ZipFile(archiveFile); return ShrinkWrap.create(type, archiveFile.getName()).as(ZipImporter.class).importFrom(zipFile).as(type); } catch (final ZipException ze) { throw new IllegalArgumentException("Does not appear to be a valid ZIP file: " + archiveFile.getAbsolutePath()); } catch (final IOException ioe) { throw new RuntimeException("I/O Error in importing new archive from ZIP: " + archiveFile.getAbsolutePath(), ioe); <START> }finally { <END> if(null != zipFile){ try { zipFile.close(); } catch (final IOException e) { } } } }</code><technical_language>remove return statement</technical_language>

Target:
public <T extends Assignable> T createFromZipFile(final Class<T> type, final File archiveFile) throws IllegalArgumentException, ArchiveImportException { if (type == null) { throw new IllegalArgumentException("Type must be specified"); } if (archiveFile == null) { throw new IllegalArgumentException("File must be specified"); } if (!archiveFile.exists()) { throw new IllegalArgumentException("File for import does not exist: " + archiveFile.getAbsolutePath()); } if (archiveFile.isDirectory()) { throw new IllegalArgumentException("File for import must not be a directory: " + archiveFile.getAbsolutePath()); } try { return ShrinkWrap.create(type, archiveFile.getName()).as(ZipImporter.class).importFrom(new ZipFile(archiveFile)).as(type); } catch (final ZipException ze) { throw new IllegalArgumentException("Does not appear to be a valid ZIP file: " + archiveFile.getAbsolutePath()); } catch (final IOException ioe) { throw new RuntimeException("I/O Error in importing new archive from ZIP: " + archiveFile.getAbsolutePath(), ioe); } }
Source:
<code>public List<String> getAttribute(final String key) { <START> return attributes.containsKey(key)? attributes.get(key) : Collections.emptyList(); <END> }</code><technical_language>getOrDefault()</technical_language>

Target:
public List<String> getAttribute(final String key) { return attributes.getOrDefault(key, Collections.emptyList()); }
Source:
<code>public boolean deleteImage(String id) { try { Integer imageId = Ints.tryParse(id); if (imageId != null) { api.getImageApi().delete(imageId); } else { <START> api.getImageApi().delete(id); <END> } return true; } catch (Exception ex) { return false; } }</code><technical_language>this a good place for some debug logging</technical_language>

Target:
public boolean deleteImage(String id) { try { Integer imageId = Ints.tryParse(id); if (imageId != null) { logger.debug(">> image does not have a slug. Using the id to delete the image..."); api.getImageApi().delete(imageId); } else { logger.debug(">> image has a slug. Using it to delete the image..."); api.getImageApi().delete(id); } return true; } catch (Exception ex) { return false; } }
Source:
<code>public void testIndexersProduceSameIndexes() throws Exception { long bamFileSize = BAM_FILE.length(); for (long g : new long[] { 1, 2, 10, SBIIndexWriter.DEFAULT_GRANULARITY }) { <START> SBIIndex index1 = fromBAMFile(BAM_FILE, g); <END> SBIIndex index2 = fromSAMRecords(BAM_FILE, g); Assert.assertEquals(index1, index2); Assert.assertEquals(index1.dataFileLength(), bamFileSize); Assert.assertEquals(index2.dataFileLength(), bamFileSize); } }</code><technical_language>final</technical_language>

Target:
public void testIndexersProduceSameIndexes() throws Exception { final long bamFileSize = BAM_FILE.length(); for (final long g : new long[] { 1, 2, 10, SBIIndexWriter.DEFAULT_GRANULARITY }) { final SBIIndex index1 = fromBAMFile(BAM_FILE, g); final SBIIndex index2 = fromSAMRecords(BAM_FILE, g); Assert.assertEquals(index1, index2); Assert.assertEquals(index1.dataFileLength(), bamFileSize); Assert.assertEquals(index2.dataFileLength(), bamFileSize); } }
Source:
<code>protected boolean canAddVm(ArrayList<String> reasons, Collection<StorageDomain> destStorages) { VmStatic vmStaticFromParams = getParameters().getVmStaticData(); if (!canAddVm(reasons, vmStaticFromParams.getName(), getStoragePoolId(), vmStaticFromParams.getPriority())) { return false; } if (!validateCustomProperties(vmStaticFromParams, reasons)) { return false; } if (shouldCheckSpaceInStorageDomains()) { if (!getStoragePoolId().equals(getStoragePoolIdFromSourceImageContainer())) { reasons.add(EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_MATCH.toString()); return false; } for (StorageDomain domain : destStorages) { StorageDomainValidator storageDomainValidator = new StorageDomainValidator(domain); if (!validate(storageDomainValidator.isDomainExistAndActive())) { return false; } } if (!validateSpaceRequirements()) { return false; } } return VmHandler.validateDedicatedVdsExistOnSameCluster(vmStaticFromParams, <START> getReturnValue().getValidateMessages()); <END> }</code><technical_language>getValidationMessages()</technical_language>

Target:
protected boolean canAddVm(ArrayList<String> reasons, Collection<StorageDomain> destStorages) { VmStatic vmStaticFromParams = getParameters().getVmStaticData(); if (!canAddVm(reasons, vmStaticFromParams.getName(), getStoragePoolId(), vmStaticFromParams.getPriority())) { return false; } if (!validateCustomProperties(vmStaticFromParams, reasons)) { return false; } if (shouldCheckSpaceInStorageDomains()) { if (!getStoragePoolId().equals(getStoragePoolIdFromSourceImageContainer())) { reasons.add(EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_MATCH.toString()); return false; } for (StorageDomain domain : destStorages) { StorageDomainValidator storageDomainValidator = new StorageDomainValidator(domain); if (!validate(storageDomainValidator.isDomainExistAndActive())) { return false; } } if (!validateSpaceRequirements()) { return false; } } return VmHandler.validateDedicatedVdsExistOnSameCluster(vmStaticFromParams, getReturnValue().getValidationMessages()); }
Source:
<code>public <T> List<T> getList(String key, Class<T> type) { List value = config.getList(key); if (value == null) { return notFound(key); } ; List<T> result = new ArrayList<T>(); for (Object part : value) { <START> result.add(getDecoder().decode(type, part.toString())); <END> } return result; }</code><technical_language>need call decoder if part is of type 'type'</technical_language>

Target:
public <T> List<T> getList(String key, Class<T> type) { List value = config.getList(key); if (value == null) { return notFound(key); } ; List<T> result = new ArrayList<T>(); for (Object part : value) { if (type.isInstance(part)) { result.add((T)part); } else if (part instanceof String) { result.add(getDecoder().decode(type, (String) part)); } else { throw new UnsupportedOperationException( "Property values other than " + type.getCanonicalName() +" or String not supported"); } } return result; }
Source:
<code>public void handleDefaultDeviceResponse(final String deviceIdentification, final String organisationIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleDefaultDeviceResponse for MessageType: {}", messageType); ResponseMessageResultType result = deviceResult; OsgpException osgpException = exception; if (deviceResult == ResponseMessageResultType.NOT_OK && exception == null) { LOGGER.error("Incorrect response received, exception should not be null when result is not ok"); osgpException = new TechnicalException(ComponentType.DOMAIN_PUBLIC_LIGHTING, "An unknown error occurred"); } if (deviceResult == ResponseMessageResultType.OK && exception != null) { LOGGER.error("Incorrect response received, result should be set to not ok when exception is not null"); result = ResponseMessageResultType.NOT_OK; } <START> this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() <END> .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(result).withOsgpException(osgpException) .build()); }</code><technical_language>Extract building of ResponseMessage variable (in eclipse, select text, right-click > refactor > extract local variable / select code + shift+alt+L). This code a bit more readable, especially passing in other besides ResponseMessage</technical_language>

Target:
public void handleDefaultDeviceResponse(final String deviceIdentification, final String organisationIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleDefaultDeviceResponse for MessageType: {}", messageType); ResponseMessageResultType result = deviceResult; OsgpException osgpException = exception; if (deviceResult == ResponseMessageResultType.NOT_OK && exception == null) { LOGGER.error("Incorrect response received, exception should not be null when result is not ok"); osgpException = new TechnicalException(ComponentType.DOMAIN_PUBLIC_LIGHTING, "An unknown error occurred"); } if (deviceResult == ResponseMessageResultType.OK && exception != null) { LOGGER.error("Incorrect response received, result should be set to not ok when exception is not null"); result = ResponseMessageResultType.NOT_OK; } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(result).withOsgpException(osgpException) .build(); this.webServiceResponseMessageSender.send(responseMessage); }
Source:
<code><START> public List<Task> getTasks(String username, String clientId, TaskStatus taskStatus, String offset, String limit) <END> throws MambuApiException { ParamsMap paramsMap = new ParamsMap(); paramsMap.addParam(APIData.USERNAME, username); paramsMap.addParam(APIData.CLIENT_ID, clientId); paramsMap.addParam(APIData.STATUS, taskStatus.name()); paramsMap.put(APIData.OFFSET, offset); paramsMap.put(APIData.LIMIT, limit); String urlString = new String(mambuAPIService.createUrl(TASKS + "/")); String jsonResponse = mambuAPIService.executeRequest(urlString, paramsMap, Method.GET); Type collectionType = new TypeToken<List<Task>>() {}.getType(); List<Task> tasks = (List<Task>) GsonUtils.createGson().fromJson(jsonResponse, collectionType); return tasks; }</code><technical_language>add some input validation (!= null, !var.isEmpty(), limit > 0, offset >= 0) please</technical_language>

Target:
public List<Task> getTasks(String username, String clientId, TaskStatus taskStatus, String offset, String limit) throws MambuApiException { ParamsMap paramsMap = new ParamsMap(); paramsMap.addParam(APIData.USERNAME, username); paramsMap.addParam(APIData.CLIENT_ID, clientId); if (taskStatus != null) { paramsMap.addParam(APIData.STATUS, taskStatus.name()); } paramsMap.put(APIData.OFFSET, offset); paramsMap.put(APIData.LIMIT, limit); String urlString = new String(mambuAPIService.createUrl(TASKS + "/")); String jsonResponse = mambuAPIService.executeRequest(urlString, paramsMap, Method.GET); Type collectionType = new TypeToken<List<Task>>() {}.getType(); List<Task> tasks = (List<Task>) GsonUtils.createGson().fromJson(jsonResponse, collectionType); return tasks; }
Source:
<code>public NotificationProcessor(Environment env){ int numThreads = env.getConfiguration().getWorkerThreads(); this.env = env; <START> this.semaphore = new Semaphore(3 * numThreads); <END> this.executor = Executors.newFixedThreadPool(numThreads); this.queue = new LinkedBlockingQueue<>(); this.executor = new ThreadPoolExecutor(numThreads, numThreads, 0L, TimeUnit.MILLISECONDS, queue); this.queuedWork = new HashSet<>(); this.observers = new Observers(env); }</code><technical_language>3 * numThreads for semaphore permits? wondering..</technical_language>

Target:
public NotificationProcessor(Environment env){ int numThreads = env.getConfiguration().getWorkerThreads(); this.env = env; this.queue = new LinkedBlockingQueue<>(); this.executor = new ThreadPoolExecutor(numThreads, numThreads, 0L, TimeUnit.MILLISECONDS, queue); this.tracker = new NotificationTracker(); this.observers = new Observers(env); }
Source:
<code>private static void saveEslintError(SensorContext context, EslintError eslintError, InputFile inputFile, String originalFilePath) { String eslintKey = eslintError.ruleId; if (eslintKey == null) { LOG.warn("Parse error issue from ESLint will not be imported, file " + inputFile.uri()); return; } TextRange location = getLocation(eslintError, inputFile); TextPointer start = location.start(); ExternalRuleLoader ruleLoader = EslintRulesDefinition.loader(eslintKey); RuleType ruleType = ruleLoader.ruleType(eslintKey); Severity severity = ruleLoader.ruleSeverity(eslintKey); Long effortInMinutes = ruleLoader.ruleConstantDebtMinutes(eslintKey); <START> LOG.debug("External Eslint issue { file:\"{}\", id:{}, message:\"{}\", line:{}, offset:{}, type: {}, severity:{}, remediation:{} }", <END> originalFilePath, eslintKey, eslintError.message, start.line(), start.lineOffset(), ruleType, severity, effortInMinutes); NewExternalIssue newExternalIssue = context.newExternalIssue(); NewIssueLocation primaryLocation = newExternalIssue.newLocation() .message(eslintError.message) .on(inputFile) .at(location); newExternalIssue .at(primaryLocation) .engineId(EslintRulesDefinition.REPOSITORY_KEY) .ruleId(eslintKey) .type(ruleType) .severity(severity) .remediationEffortMinutes(effortInMinutes) .save(); }</code><technical_language>here: -> Saving external ESLint issue</technical_language>

Target:
private static void saveEslintError(SensorContext context, EslintError eslintError, InputFile inputFile, String originalFilePath) { String eslintKey = eslintError.ruleId; if (eslintKey == null) { LOG.warn("Parse error issue from ESLint will not be imported, file " + inputFile.uri()); return; } TextRange location = getLocation(eslintError, inputFile); TextPointer start = location.start(); ExternalRuleLoader ruleLoader = EslintRulesDefinition.loader(eslintKey); RuleType ruleType = ruleLoader.ruleType(eslintKey); Severity severity = ruleLoader.ruleSeverity(eslintKey); Long effortInMinutes = ruleLoader.ruleConstantDebtMinutes(eslintKey); LOG.debug("Saving external ESLint issue { file:\"{}\", id:{}, message:\"{}\", line:{}, offset:{}, type: {}, severity:{}, remediation:{} }", originalFilePath, eslintKey, eslintError.message, start.line(), start.lineOffset(), ruleType, severity, effortInMinutes); NewExternalIssue newExternalIssue = context.newExternalIssue(); NewIssueLocation primaryLocation = newExternalIssue.newLocation() .message(eslintError.message) .on(inputFile) .at(location); newExternalIssue .at(primaryLocation) .engineId(EslintRulesDefinition.REPOSITORY_KEY) .ruleId(eslintKey) .type(ruleType) .severity(severity) .remediationEffortMinutes(effortInMinutes) .save(); }
Source:
<code>protected Build createBuild(List<Artifact> artifacts, List<Dependency> dependencies) { ModuleBuilder moduleBuilder = new ModuleBuilder().id(moduleName); if (artifacts != null) { moduleBuilder.artifacts(artifacts); } if (dependencies != null) { moduleBuilder.dependencies(dependencies); } <START> List<Module> modules = Lists.newArrayList(moduleBuilder.build()); <END> Build build = new Build(); build.setModules(modules); return build; }</code><technical_language>Specifically in build-info project, try avoid guava possible, due potential compatibility issues (@RobiNino elaborate more this)</technical_language>

Target:
protected Build createBuild(List<Artifact> artifacts, List<Dependency> dependencies) { ModuleBuilder moduleBuilder = new ModuleBuilder().id(moduleName); if (artifacts != null) { moduleBuilder.artifacts(artifacts); } if (dependencies != null) { moduleBuilder.dependencies(dependencies); } List<Module> modules = Arrays.asList(moduleBuilder.build()); Build build = new Build(); build.setModules(modules); return build; }
Source:
<code>public void doRegistration(final SchedulerDriver driver, Protos.FrameworkID id) { _driver = driver; _stormScheduler = new StormSchedulerImpl(_driver); _state.put(FRAMEWORK_ID, id.getValue()); _offers = new HashMap<Protos.OfferID, Protos.Offer>(); _timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { Collection<TaskStatus> taskStatuses = new ArrayList<TaskStatus>(); _driver.reconcileTasks(taskStatuses); <START> LOG.info("Performing tasking reconciliation between scheduler and master"); <END> } }, TASK_RECONCILIATION_INTERVAL, TASK_RECONCILIATION_INTERVAL); }</code><technical_language>typo: tasking -> task</technical_language>

Target:
public void doRegistration(final SchedulerDriver driver, Protos.FrameworkID id) { _driver = driver; _stormScheduler = new StormSchedulerImpl(_driver); _state.put(FRAMEWORK_ID, id.getValue()); _offers = new HashMap<Protos.OfferID, Protos.Offer>(); _timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { Collection<TaskStatus> taskStatuses = new ArrayList<TaskStatus>(); List<String> logviewerPaths = _zkClient.getChildren(_logviewerZkDir); if (logviewerPaths == null) { _driver.reconcileTasks(taskStatuses); return; } for (String path : logviewerPaths) { TaskID logviewerTaskId = TaskID.newBuilder() .setValue(new String(_zkClient.getNodeData(String.format("%s/%s", _logviewerZkDir, path)))) .build(); TaskStatus logviewerTaskStatus = TaskStatus.newBuilder() .setTaskId(logviewerTaskId) .setState(TaskState.TASK_RUNNING) .build(); taskStatuses.add(logviewerTaskStatus); } _driver.reconcileTasks(taskStatuses); LOG.info("Performing task reconciliation between scheduler and master on following tasks: {}", taskStatuses.toString()); } }, 0, TASK_RECONCILIATION_INTERVAL); }
Source:
<code>protected int compareSecure(Value v, CompareMode mode) { <START> return compare(valueType, this, v); <END> }</code><technical_language>this compare values of type</technical_language>

Target:
protected int compareSecure(Value v, CompareMode mode) { return compare(this, v); }
Source:
<code>public Token appendCheckpoint(Token snapshotTimestamp) { long start = System.currentTimeMillis(); rt.getObjectsView().TXBuild() .type(TransactionType.SNAPSHOT) .snapshot(snapshotTimestamp) .build() .begin(); try (Stream<Map.Entry> entries = this.map.entryStream()) { <START> log.info("appendCheckpoint: Started checkpoint for at snapshot {}", streamId, snapshotTimestamp); <END> startCheckpoint(snapshotTimestamp); int entryCount = appendObjectState(entries); finishCheckpoint(); long cpDuration = System.currentTimeMillis() - start; log.info("appendCheckpoint: completed checkpoint for {}, entries({}), " + "cpSize({}) bytes at snapshot in ms", streamId, entryCount, numBytes, snapshotTimestamp, cpDuration); } finally { rt.getObjectsView().TXEnd(); } return snapshotTimestamp; }</code><technical_language>this change, put this log info try-with statement</technical_language>

Target:
public Token appendCheckpoint(Token snapshotTimestamp) { long start = System.currentTimeMillis(); rt.getObjectsView().TXBuild() .type(TransactionType.SNAPSHOT) .snapshot(snapshotTimestamp) .build() .begin(); log.info("appendCheckpoint: Started checkpoint for at snapshot {}", streamId, snapshotTimestamp); try (Stream<Map.Entry> entries = this.map.entryStream()) { startCheckpoint(snapshotTimestamp); int entryCount = appendObjectState(entries); finishCheckpoint(); long cpDuration = System.currentTimeMillis() - start; log.info("appendCheckpoint: completed checkpoint for {}, entries({}), " + "cpSize({}) bytes at snapshot in ms", streamId, entryCount, numBytes, snapshotTimestamp, cpDuration); } finally { rt.getObjectsView().TXEnd(); } return snapshotTimestamp; }
Source:
<code>static DiscoveryGroupConfiguration createDiscoveryGroupConfiguration(final String name, final DiscoveryGroupConfiguration config, final JChannel channel, final String channelName) throws Exception { final long refreshTimeout = config.getRefreshTimeout(); final long initialWaitTimeout = config.getDiscoveryInitialWaitTimeout(); <START> final BroadcastEndpointFactory endpointFactory = new ForkChannelBroadcastEndpointFactory(channel, channelName); <END> return new DiscoveryGroupConfiguration() .setName(name) .setRefreshTimeout(refreshTimeout) .setDiscoveryInitialWaitTimeout(initialWaitTimeout) .setBroadcastEndpointFactory(endpointFactory); }</code><technical_language>While channel is question is a ForkChannel default, is necessarily so. name of this class appropriate</technical_language>

Target:
static DiscoveryGroupConfiguration createDiscoveryGroupConfiguration(final String name, final DiscoveryGroupConfiguration config, final JChannel channel, final String channelName) throws Exception { final long refreshTimeout = config.getRefreshTimeout(); final long initialWaitTimeout = config.getDiscoveryInitialWaitTimeout(); final BroadcastEndpointFactory endpointFactory = new ClosingChannelBroadcastEndpointFactory(channel, channelName); return new DiscoveryGroupConfiguration() .setName(name) .setRefreshTimeout(refreshTimeout) .setDiscoveryInitialWaitTimeout(initialWaitTimeout) .setBroadcastEndpointFactory(endpointFactory); }
Source:
<code>public boolean validate(boolean customBondNameSupported) { getBond().validateSelectedItem(new IValidation[] { new NotEmptyValidation(), new LengthValidation(BusinessEntitiesDefinitions.HOST_NIC_NAME_LENGTH), customBondNameSupported ? <START> new CustomBondNameValidation() : new NumberOnlyBondNameValidation() }); <END> getCustomBondEditor().setIsValid(true); if (getBondingOptions().getSelectedItem().getKey().equals(CUSTOM_BONDING_MODE)) { getCustomBondEditor().validateEntity(new IValidation[] { new KeyValueFormatValidation() }); } return getBond().getIsValid() && getCustomBondEditor().getIsValid(); }</code><technical_language>another nice bonus making objects independent of argument, is create static constants in class, save some cpu cycles GC. e.g. private static RegexValidation CUSTOM_BOND_NAME_VALIDATION = new ...; ref const's in validate() method. A nice a :)</technical_language>

Target:
public boolean validate(boolean customBondNameSupported) { getBond().validateSelectedItem(new IValidation[] { new NotEmptyValidation(), new LengthValidation(BusinessEntitiesDefinitions.HOST_NIC_NAME_LENGTH), customBondNameSupported ? CUSTOM_BOND_NAME_VALIDATION : NUM_ONLY_BOND_NAME_VALIDATION }); getCustomBondEditor().setIsValid(true); if (getBondingOptions().getSelectedItem().getKey().equals(CUSTOM_BONDING_MODE)) { getCustomBondEditor().validateEntity(new IValidation[] { new KeyValueFormatValidation() }); } return getBond().getIsValid() && getCustomBondEditor().getIsValid(); }
Source:
<code>public void loopProcessRedirectIntoFile() throws IOException, InterruptedException { final File file = temporaryFolder.newFile(); final ProcessBuilder pb = new ProcessBuilder(commands); final Process process = ProcessBuilderExecutor.asyncExecute(pb, file); Thread.sleep(3000); log.info("Terminate process"); process.destroy(); assertEquals(0, process.waitFor()); <START> assertThat(FileUtils.readFileToString(file), allOf(containsString("Sleep over"))); <END> }</code><technical_language>Change allOf is</technical_language>

Target:
public void loopProcessRedirectIntoFile() throws IOException, InterruptedException { final File file = temporaryFolder.newFile(); final ProcessBuilder pb = new ProcessBuilder(commands); final Process process = ProcessBuilderExecutor.asyncExecute(pb, file); Thread.sleep(3000); log.info("Terminate process"); process.destroy(); assertEquals(0, process.waitFor()); assertThat(FileUtils.readFileToString(file), is(containsString("Sleep over"))); }
Source:
<code>public static AccessModifier getAccessModifierFromModifiersToken(DetailAST modifiersToken) { if (modifiersToken == null || modifiersToken.getType() != TokenTypes.MODIFIERS) { throw new IllegalArgumentException("expected non-null AST-token with type 'MODIFIERS'"); } AccessModifier accessModifier = AccessModifier.PACKAGE_LOCAL; for (AST token = modifiersToken.getFirstChild(); token != null; token = token.getNextSibling()) { <START> if ("public".equals(token.getText())) { <END> accessModifier = AccessModifier.PUBLIC; } else if ("protected".equals(token.getText())) { accessModifier = AccessModifier.PROTECTED; } else if ("private".equals(token.getText())) { accessModifier = AccessModifier.PRIVATE; } } return accessModifier; }</code><technical_language>compare text instead of token type</technical_language>

Target:
public static AccessModifier getAccessModifierFromModifiersToken(DetailAST modifiersToken) { if (modifiersToken == null || modifiersToken.getType() != TokenTypes.MODIFIERS) { throw new IllegalArgumentException("expected non-null AST-token with type 'MODIFIERS'"); } AccessModifier accessModifier = AccessModifier.PACKAGE; for (AST token = modifiersToken.getFirstChild(); token != null; token = token.getNextSibling()) { final int tokenType = token.getType(); if (tokenType == TokenTypes.LITERAL_PUBLIC) { accessModifier = AccessModifier.PUBLIC; } else if (tokenType == TokenTypes.LITERAL_PROTECTED) { accessModifier = AccessModifier.PROTECTED; } else if (tokenType == TokenTypes.LITERAL_PRIVATE) { accessModifier = AccessModifier.PRIVATE; } } return accessModifier; }
Source:
<code>public LayerNormBp(INDArray input, INDArray gain, INDArray bias, INDArray grad, INDArray dLdx, INDArray dLdg, INDArray dLdb, int... dimensions) { <START> super("layer_norm_bp", new INDArray[]{input, gain, bias, grad}, new INDArray[]{dLdx, dLdg, dLdb}); <END> this.dimensions = dimensions; addIArgument(dimensions); }</code><technical_language>null bias entry (or throw exception if null allowed). set noBias field</technical_language>

Target:
public LayerNormBp(INDArray input, INDArray gain, INDArray bias, INDArray grad, INDArray dLdx, INDArray dLdg, INDArray dLdb, int... dimensions) { super("layer_norm_bp", new INDArray[]{input, gain, bias, grad}, new INDArray[]{dLdx, dLdg, dLdb}); Preconditions.checkArgument(bias != null, "LayerNormBp: Use constructor without bias argument if bias is null / not available."); setDimensions(dimensions); }
Source:
<code>public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == IMAGE_REQUEST){ if(resultCode == Activity.RESULT_OK) { patientPhoto = getPortraitImage(output.getPath()); Bitmap bitmap = ThumbnailUtils.extractThumbnail(patientPhoto, patientImageView.getWidth(), patientImageView.getHeight()); patientImageView.setImageBitmap(bitmap); patientImageView.invalidate(); <START> }else if(resultCode == Activity.RESULT_CANCELED) { <END> output = null; } } }</code><technical_language>Good work @hao555sky ! This done else condition, need else if condition</technical_language>

Target:
public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == IMAGE_REQUEST){ if(resultCode == Activity.RESULT_OK) { patientPhoto = getPortraitImage(output.getPath()); Bitmap bitmap = ThumbnailUtils.extractThumbnail(patientPhoto, patientImageView.getWidth(), patientImageView.getHeight()); patientImageView.setImageBitmap(bitmap); patientImageView.invalidate(); }else { output = null; } } }
Source:
<code>long getNumberRunsScratch(Map<byte[], byte[]> rawFamily) { long numberRuns = 0L; if (rawFamily != null) { numberRuns = rawFamily.size(); } if(numberRuns == 0L) { LOG.error("Number of runs in scratch column family can't be 0," <START> +" if processing within TTL"); <END> } LOG.trace("number of runs in getNumberRunsScratch " + numberRuns); return numberRuns; }</code><technical_language>In this case, is intent returning 0? do want throw exception</technical_language>

Target:
long getNumberRunsScratch(Map<byte[], byte[]> rawFamily) { long numberRuns = 0L; if (rawFamily != null) { numberRuns = rawFamily.size(); } if(numberRuns == 0L) { LOG.error("Number of runs in scratch column family can't be 0," +" if processing within TTL"); throw new ProcessingException("Number of runs is 0"); } return numberRuns; }
Source:
<code>private static void validatePropertySection(String fileName, String sectionName, Node subSection, Object instance) throws Exception { final Set<String> properties = getProperties(instance.getClass()); final Class<?> clss = instance.getClass(); fixCapturedProperties(sectionName, instance, clss, properties); if (subSection != null) { Assert.assertTrue(fileName + " section '" + sectionName + "' should have no properties to show", !properties.isEmpty()); final Set<Node> nodes = XmlUtil.getChildrenElements(subSection); Assert.assertEquals(fileName + " section '" + sectionName + "' subsection 'Properties' should have one child node", 1, nodes.size()); final Node div = nodes.iterator().next(); Assert.assertEquals(fileName + " section '" + sectionName + "' subsection 'Properties' has unexpected child node", <START> "div", div.getNodeName()); <END> final Node table = XmlUtil.getFirstChildElement(div); Assert.assertEquals(fileName + " section '" + sectionName + "' subsection 'Properties' has unexpected child node", "table", table.getNodeName()); validatePropertySectionProperties(fileName, sectionName, table, instance, properties); } Assert.assertTrue(fileName + " section '" + sectionName + "' should show properties: " + properties, properties.isEmpty()); }</code><technical_language>helpful if this div check a class=wrapper check right too</technical_language>

Target:
private static void validatePropertySection(String fileName, String sectionName, Node subSection, Object instance) throws Exception { final Set<String> properties = getProperties(instance.getClass()); final Class<?> clss = instance.getClass(); fixCapturedProperties(sectionName, instance, clss, properties); if (subSection != null) { Assert.assertTrue(fileName + " section '" + sectionName + "' should have no properties to show", !properties.isEmpty()); final Set<Node> nodes = XmlUtil.getChildrenElements(subSection); Assert.assertEquals(fileName + " section '" + sectionName + "' subsection 'Properties' should have one child node", 1, nodes.size()); final Node div = nodes.iterator().next(); Assert.assertEquals(fileName + " section '" + sectionName + "' subsection 'Properties' has unexpected child node", "div", div.getNodeName()); final String wrapperMessage = fileName + " section '" + sectionName + "' subsection 'Properties' wrapping div for table needs the" + " class 'wrapper'"; Assert.assertTrue(wrapperMessage, div.hasAttributes()); Assert.assertNotNull(wrapperMessage, div.getAttributes().getNamedItem("class").getNodeValue()); Assert.assertTrue(wrapperMessage, div.getAttributes().getNamedItem("class").getNodeValue().contains("wrapper")); final Node table = XmlUtil.getFirstChildElement(div); Assert.assertEquals(fileName + " section '" + sectionName + "' subsection 'Properties' has unexpected child node", "table", table.getNodeName()); validatePropertySectionProperties(fileName, sectionName, table, instance, properties); } Assert.assertTrue(fileName + " section '" + sectionName + "' should show properties: " + properties, properties.isEmpty()); }