auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private List<IClasspathEntry> collectExternalDependencies() { Builder<IClasspathEntry> result = ImmutableList.builder(); for (OmniExternalDependency dependency : this.gradleProject.getExternalDependencies()) { File dependencyFile = dependency.getFile(); String dependencyName = dependencyFile.getName(); if (!dependencyFile.exists()) { IPath path = new Path("/" + dependencyFile.getPath()); IResource member = this.eclipseProject.getProject().findMember(path); if (member != null) { IClasspathEntry entry = JavaCore.newLibraryEntry(member.getFullPath(), null, null); result.add(entry); continue; } } if (dependencyFile.isDirectory() || dependencyName.endsWith(".jar") || dependencyName.endsWith(".zip")) { IPath path = org.eclipse.core.runtime.Path.fromOSString(dependencyFile.getAbsolutePath()); File dependencySource = dependency.getSource(); IPath sourcePath = dependencySource != null ? org.eclipse.core.runtime.Path.fromOSString(dependencySource.getAbsolutePath()) : null; IClasspathEntry entry = JavaCore.newLibraryEntry(path, sourcePath, null, ClasspathUtils.createAccessRules(dependency), ClasspathUtils .createClasspathAttributes(dependency), dependency.isExported()); result.add(entry); } } return result.build(); }

Target:
private List<IClasspathEntry> collectExternalDependencies() { Builder<IClasspathEntry> result = ImmutableList.builder(); for (OmniExternalDependency dependency : this.gradleProject.getExternalDependencies()) { File dependencyFile = dependency.getFile(); boolean linkedResourceCreated = tryCreatingLinkedResource(dependencyFile, result); if (!linkedResourceCreated) { String dependencyName = dependencyFile.getName(); if (dependencyFile.isDirectory() || dependencyName.endsWith(".jar") || dependencyName.endsWith(".zip")) { IPath path = org.eclipse.core.runtime.Path.fromOSString(dependencyFile.getAbsolutePath()); File dependencySource = dependency.getSource(); IPath sourcePath = dependencySource != null ? org.eclipse.core.runtime.Path.fromOSString(dependencySource.getAbsolutePath()) : null; IClasspathEntry entry = JavaCore.newLibraryEntry(path, sourcePath, null, ClasspathUtils.createAccessRules(dependency), ClasspathUtils .createClasspathAttributes(dependency), dependency.isExported()); result.add(entry); } } } return result.build(); }
Source:
public SlackNotificationPayloadContent(){ payloadCommits = new PayloadContentCommits(); }

Target:
public SlackNotificationPayloadContent(){ }
Source:
if (a instanceof TimeGraphEntry && b instanceof TimeGraphEntry) { ITimeGraphEntryModel aModel = ((TimeGraphEntry) a).getModel(); ITimeGraphEntryModel bModel = ((TimeGraphEntry) b).getModel(); if (aModel instanceof traceEntryModel && bModel instanceof traceEntryModel) { ITmfTrace ta = ((traceEntryModel) a).getTrace(); ITmfTrace tb = ((traceEntryModel) b).getTrace(); if (ta instanceof TmfExperiment && !(tb instanceof TmfExperiment)) { return -1; } else if (!(ta instanceof TmfExperiment) && (tb instanceof TmfExperiment)) { return 1; } } }

Target:
if (a instanceof TimeGraphEntry && b instanceof TimeGraphEntry) { ITimeGraphEntryModel aModel = ((TimeGraphEntry) a).getModel(); ITimeGraphEntryModel bModel = ((TimeGraphEntry) b).getModel(); if (aModel instanceof TraceEntryModel && bModel instanceof TraceEntryModel) { ITmfTrace ta = ((TraceEntryModel) a).getTrace(); ITmfTrace tb = ((TraceEntryModel) b).getTrace(); if (ta instanceof TmfExperiment && !(tb instanceof TmfExperiment)) { return -1; } else if (!(ta instanceof TmfExperiment) && (tb instanceof TmfExperiment)) { return 1; } } }
Source:
private boolean isOgmEnabled(Map<?, ?> settings) { Boolean ogmEnabled = new ConfigurationPropertyReader( settings ) .property( OgmProperties.ENABLED, boolean.class ) .withDefault( false ) .getValue(); return ogmEnabled || isOgmImplicitEnabled( settings ); }

Target:
private boolean isOgmEnabled(Map<?, ?> settings) { Boolean ogmEnabled = new ConfigurationPropertyReader( settings ) .property( OgmProperties.ENABLED, Boolean.class ) .getValue(); if ( ogmEnabled == null ) { return isOgmImplicitEnabled( settings ); } return ogmEnabled; }
Source:
private boolean satisfiedByNetCapabilities(NetworkCapabilities nc, boolean onlyImmutable) { long requestedCapabilities = mNetworkCapabilities; long requestedUnwantedCapabilities = mUnwantedNetworkCapabilities; long providedCapabilities = nc.mNetworkCapabilities; if (onlyImmutable) { requestedCapabilities &= ~MUTABLE_CAPABILITIES; requestedUnwantedCapabilities &= ~MUTABLE_CAPABILITIES; providedCapabilities &= ~MUTABLE_CAPABILITIES; } return ((providedCapabilities & requestedCapabilities) == requestedCapabilities) && ((requestedUnwantedCapabilities & providedCapabilities) == 0); }

Target:
private boolean satisfiedByNetCapabilities(NetworkCapabilities nc, boolean onlyImmutable) { long requestedCapabilities = mNetworkCapabilities; long requestedUnwantedCapabilities = mUnwantedNetworkCapabilities; long providedCapabilities = nc.mNetworkCapabilities; if (onlyImmutable) { requestedCapabilities &= ~MUTABLE_CAPABILITIES; requestedUnwantedCapabilities &= ~MUTABLE_CAPABILITIES; } return ((providedCapabilities & requestedCapabilities) == requestedCapabilities) && ((requestedUnwantedCapabilities & providedCapabilities) == 0); }
Source:
@Override public void visitToken(DetailAST ast) { DetailAST nodeWithAnnotations = ast; if (ast.getType() == TokenTypes.TYPECAST) { nodeWithAnnotations = ast.findFirstToken(TokenTypes.TYPE); } DetailAST modifiersNode = nodeWithAnnotations.findFirstToken(TokenTypes.MODIFIERS); if (modifiersNode == null) { modifiersNode = nodeWithAnnotations.findFirstToken(TokenTypes.ANNOTATIONS); } if (modifiersNode != null) { for (DetailAST annotationNode = modifiersNode.getFirstChild(); annotationNode != null; annotationNode = annotationNode.getNextSibling()) { if (annotationNode.getType() == TokenTypes.ANNOTATION && OVERRIDE.equals(getAnnotationName(annotationNode)) && onDifferentLines(annotationNode)) { log(annotationNode.getLineNo(), DIFF_LINE_ERR_MSG, getAnnotationName(annotationNode)); } } } }

Target:
@Override public void visitToken(DetailAST ast) { DetailAST node = ast.findFirstToken(MODIFIERS); if (node == null) node = ast.findFirstToken(ANNOTATIONS); if (node == null) return; for (node = node.getFirstChild(); node != null; node = node.getNextSibling()) { if (node.getType() == TokenTypes.ANNOTATION && Override.class.getSimpleName().equals(annotationName(node)) && node.getLineNo() != nextNode(node).getLineNo()) log(node.getLineNo(), DIFF_LINE_ERR_MSG, annotationName(node)); } }
Source:
public void testSimulatePackfileReplacement() throws Exception { File f1 = createFile("file"); File f2 = createFile("fool"); waitNextSec(f2); waitNextSec(f2); FileTime timestamp = Files.getLastModifiedTime(f1.toPath()); FileSnapshot save = FileSnapshot.save(f1); Files.move(f2.toPath(), f1.toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE); Files.setLastModifiedTime(f1.toPath(), timestamp); assertTrue(save.isModified(f1)); assertTrue("unexpected change of fileKey", save.wasFileKeyChanged()); assertFalse("unexpected size change", save.wasSizeChanged()); assertFalse("unexpected lastModified change", save.wasLastModifiedChanged()); assertFalse("lastModified was unexpectedly racily clean", save.wasLastModifiedRacilyClean()); }

Target:
public void testSimulatePackfileReplacement() throws Exception { Assume.assumeFalse(SystemReader.getInstance().isWindows()); File f1 = createFile("file"); File f2 = createFile("fool"); waitNextSec(f2); waitNextSec(f2); FileTime timestamp = Files.getLastModifiedTime(f1.toPath()); FileSnapshot save = FileSnapshot.save(f1); Files.move(f2.toPath(), f1.toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE); Files.setLastModifiedTime(f1.toPath(), timestamp); assertTrue(save.isModified(f1)); assertTrue("unexpected change of fileKey", save.wasFileKeyChanged()); assertFalse("unexpected size change", save.wasSizeChanged()); assertFalse("unexpected lastModified change", save.wasLastModifiedChanged()); assertFalse("lastModified was unexpectedly racily clean", save.wasLastModifiedRacilyClean()); }
Source:
public boolean hasPreciseLocation() { return isLocationPrecise && (ownLocation != null); }

Target:
public boolean hasPreciseLocation() { return (ownLocation != null) && isLocationPrecise; }
Source:
public Timestamp handle(TUAssignProject command) throws TUFailedToCreateProject { throw new TUFailedToCreateProject(getId()); }

Target:
public TUProjectAssigned handle(TUAssignProject command) throws TUFailedToAssignProject { throw new TUFailedToAssignProject(getId()); }
Source:
public String docs() { return "boolean {locationArray, [name]} Sets the name to the Command Block at the given location." + "If no name is given, the Command Block's name is set to @."; }

Target:
public String docs() { return "void {locationArray, [name]} Sets the name of the Command Block at the given location." + "If no name is given or name is null, the Command Block's name is reset to @."; }
Source:
public TaskStatus run(TaskToolbox toolbox) throws Exception { final TaskLock myLock = Iterables.getOnlyElement(getTaskLocks(toolbox)); if (!myLock.getDataSource().equals(getDataSource())) { throw new ISE("WTF?! Lock dataSource[%s] != task dataSource[%s]", myLock.getDataSource(), getDataSource()); } if (!myLock.getInterval().equals(getInterval())) { throw new ISE("WTF?! Lock interval[%s] != task interval[%s]", myLock.getInterval(), getInterval()); } final List<DataSegment> unusedSegments = toolbox .getTaskActionClient() .submit(new SegmentListUnusedAction(myLock.getDataSource(), myLock.getInterval())); for (final DataSegment unusedSegment : unusedSegments) { if (unusedSegment.getVersion().compareTo(myLock.getVersion()) > 0) { throw new ISE( "WTF?! Unused segment[%s] has version[%s] > task version[%s]", unusedSegment.getIdentifier(), unusedSegment.getVersion(), myLock.getVersion() ); } log.info("OK to restore segment: %s", unusedSegment.getIdentifier()); } List<DataSegment> restoredSegments = Lists.newLinkedList(); for (DataSegment segment : unusedSegments) { final DataSegment restored = toolbox.getDataSegmentArchiver().restore(segment); if (restored == null) { log.info("Segment [%s] did not move, not updating metadata", segment); } else { restoredSegments.add(toolbox.getDataSegmentArchiver().restore(segment)); } } if (restoredSegments.isEmpty()) { log.info("No segments restored"); } else { toolbox.getTaskActionClient().submit( new SegmentMetadataUpdateAction( ImmutableSet.copyOf(restoredSegments) ) ); } return TaskStatus.success(getId()); }

Target:
public TaskStatus run(TaskToolbox toolbox) throws Exception { final TaskLock myLock = Iterables.getOnlyElement(getTaskLocks(toolbox)); if (!myLock.getDataSource().equals(getDataSource())) { throw new ISE("WTF?! Lock dataSource[%s] != task dataSource[%s]", myLock.getDataSource(), getDataSource()); } if (!myLock.getInterval().equals(getInterval())) { throw new ISE("WTF?! Lock interval[%s] != task interval[%s]", myLock.getInterval(), getInterval()); } final List<DataSegment> unusedSegments = toolbox .getTaskActionClient() .submit(new SegmentListUnusedAction(myLock.getDataSource(), myLock.getInterval())); for (final DataSegment unusedSegment : unusedSegments) { if (unusedSegment.getVersion().compareTo(myLock.getVersion()) > 0) { throw new ISE( "WTF?! Unused segment[%s] has version[%s] > task version[%s]", unusedSegment.getIdentifier(), unusedSegment.getVersion(), myLock.getVersion() ); } log.info("OK to restore segment: %s", unusedSegment.getIdentifier()); } final List<DataSegment> restoredSegments = new ArrayList<>(); for (DataSegment segment : unusedSegments) { final DataSegment restored = toolbox.getDataSegmentArchiver().restore(segment); if (restored != null) { restoredSegments.add(restored); } else { log.info("Segment [%s] did not move, not updating metadata", segment); } } if (restoredSegments.isEmpty()) { log.info("No segments restored"); } else { toolbox.getTaskActionClient().submit( new SegmentMetadataUpdateAction( ImmutableSet.copyOf(restoredSegments) ) ); } return TaskStatus.success(getId()); }
Source:
private boolean validateStorageNameUpdate() { storageDomainNameChanged = !StringUtils.equals(oldDomain.getStorageName(), getStorageDomain().getStorageName()); if (storageDomainNameChanged) { if (!checkStorageDomainStatus(StorageDomainStatus.Active) || !checkStorageDomainNameLengthValid()) { return false; } if (storageDomainNameChanged && !validate(new StoragePoolValidator(getStoragePool()).isUp())) { return false; } if (storageDomainNameChanged && isStorageWithSameNameExists()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NAME_ALREADY_EXIST); } } return true; }

Target:
private boolean validateStorageNameUpdate() { storageDomainNameChanged = !StringUtils.equals(oldDomain.getStorageName(), getStorageDomain().getStorageName()); if (!storageDomainNameChanged) { return true; } return checkStorageDomainStatus(StorageDomainStatus.Active) && checkStorageDomainNameLengthValid() && descriptionChangeAllowed() && validateNotTheSameName(); }
Source:
public void handle(Willie bot, Channel channel, User sender, String[] args) { if(args.length==0 || args.length >= 2) { bot.sendAction(channel, "Please use '!pet <person>'!"); return; } String person = args[0]; bot.sendAction(channel, "pets " + person); }

Target:
public void handle(Willie bot, Channel channel, User sender, String[] args) { if(args.length==0) { bot.sendAction(channel, "pets everyone!"); return; } else if(args.length==1){ bot.sendAction(channel, "pets " + args[0]); } else { bot.sendAction(channel, "Please use !pet or !pet <person>!"); } }
Source:
public <T extends IResource> T update(T resource) { try { final URL endpoint = new URLBuilder(getBaseURL(), getTypeMappings()) .resource(resource) .addParmeter("namespace", resource.getNamespace()) .build(); String response = client.put(endpoint, IHttpClient.DEFAULT_READ_TIMEOUT, resource); LOGGER.debug(response); return factory.create(response); } catch (HttpClientException e){ throw handleHttpClientException("Exception creating the resource", e); } catch (SocketTimeoutException e) { throw new com.openshift.client.OpenShiftException(e, "SocketTimeout creating resource %", resource.getName()); } }

Target:
public <T extends IResource> T update(T resource) { try { final URL endpoint = new URLBuilder(getBaseURL(), getTypeMappings()) .resource(resource) .addParmeter("namespace", resource.getNamespace()) .build(); String response = client.put(endpoint, IHttpClient.DEFAULT_READ_TIMEOUT, resource); LOGGER.debug(response); return factory.create(response); } catch (HttpClientException e){ throw handleHttpClientException("Exception updating the resource", e); } catch (SocketTimeoutException e) { throw new com.openshift.client.OpenShiftException(e, "SocketTimeout updating resource %", resource.getName()); } }
Source:
public void execute(DatastoreService ds, String[] args) throws Exception { Long surveyId = null; boolean doit = false; final List<Key> toBeRemoved = new ArrayList<>(); for (int i = 0; i < args.length; i++) { if (args[i].equalsIgnoreCase("--doit")) { doit = true; } else { surveyId = Long.parseLong(args[i]); } } if (surveyId == null) { System.out.println("No Survey id parameter given!"); return; } DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); df.setTimeZone(TimeZone.getTimeZone("UT")); try { Entity survey = ds.get(KeyFactory.createKey("SurveyGroup", surveyId)); toBeRemoved.add(survey.getKey()); if (! "PROJECT".equals(survey.getProperty("projectType"))) { System.out.println("Survey not found: " + surveyId); return; } List<Key> formList = formsOfSurvey(ds,surveyId); if (formList.size() > 0) { System.out.println("Survey " + surveyId + " not empty. Forms: " + formList); return; } if (doit) { System.out.println("Deleting survey " + surveyId); ds.delete(toBeRemoved); } else { System.out.println("Not deleting survey " + surveyId); } } catch (EntityNotFoundException e) { System.out.println("Survey not found: " + surveyId); return; } }

Target:
public void execute(DatastoreService ds, String[] args) throws Exception { Long surveyId = null; boolean doit = false; final List<Key> toBeRemoved = new ArrayList<>(); for (int i = 0; i < args.length; i++) { if (args[i].equalsIgnoreCase("--doit")) { doit = true; } else { surveyId = Long.parseLong(args[i]); } } if (surveyId == null) { System.out.println("No Survey id parameter given!"); return; } DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); df.setTimeZone(TimeZone.getTimeZone("UT")); try { Entity survey = ds.get(KeyFactory.createKey("SurveyGroup", surveyId)); toBeRemoved.add(survey.getKey()); if (! "PROJECT".equals(survey.getProperty("projectType"))) { System.out.println("Survey not found: " + surveyId); return; } List<Key> formList = formsOfSurvey(ds,surveyId); if (formList.size() > 0) { System.out.println("Survey " + surveyId + " not empty. Forms: " + formList); return; } if (doit) { System.out.println("Deleting survey " + surveyId); DataUtils.batchDelete(ds,toBeRemoved); } else { System.out.println("Not deleting survey " + surveyId); } } catch (EntityNotFoundException e) { System.out.println("Survey not found: " + surveyId); return; } }
Source:
public int canAdapt( final RepositoryBaseResource resource ) { int score = super.canAdapt( resource ); if ( score > 0 ) { if ( "maven2".equals( resource.getProvider() ) ) { score++; } } return score; }

Target:
public int canAdapt( final RepositoryBaseResource resource ) { int score = super.canAdapt( resource ); if ( score > 0 ) { if ( JerseyMavenHostedRepository.PROVIDER.equals( resource.getProvider() ) ) { score++; } } return score; }
Source:
public void accept( final Collection<Session> sessions, final ServerMessageEnvelope serverEventEnvelope) { log.info("Broadcasting: {}", serverEventEnvelope); ImmutableSet.copyOf(sessions) .parallelStream() .filter(Session::isOpen) .forEach(s -> messageSender.accept(s, serverEventEnvelope)); }

Target:
public void accept( final Collection<Session> sessions, final ServerMessageEnvelope serverEventEnvelope) { log.info("Broadcasting: {}", serverEventEnvelope); Set.copyOf(sessions) .parallelStream() .filter(Session::isOpen) .forEach(s -> messageSender.accept(s, serverEventEnvelope)); }
Source:
private void checkRequiredProperties(EPersonRest epersonRest) { MetadataRest metadataRest = epersonRest.getMetadata(); if (metadataRest != null) { List<MetadataValueRest> epersonFirstName = metadataRest.getMap().get("eperson.firstname"); List<MetadataValueRest> epersonLastName = metadataRest.getMap().get("eperson.lastname"); if (epersonFirstName == null || epersonLastName == null || epersonFirstName.isEmpty() || epersonLastName.isEmpty()) { throw new DSpaceBadRequestException("The eperson.firstname and eperson.lastname values need to be " + "filled in"); } } String password = epersonRest.getPassword(); if (!accountService.verifyPasswordStructure(password)) { throw new DSpaceBadRequestException("the password cannot be left blank"); } }

Target:
private void checkRequiredProperties(EPersonRest epersonRest) { MetadataRest metadataRest = epersonRest.getMetadata(); if (metadataRest != null) { List<MetadataValueRest> epersonFirstName = metadataRest.getMap().get("eperson.firstname"); List<MetadataValueRest> epersonLastName = metadataRest.getMap().get("eperson.lastname"); if (epersonFirstName == null || epersonLastName == null || epersonFirstName.isEmpty() || epersonLastName.isEmpty()) { throw new DSpaceBadRequestException("The eperson.firstname and eperson.lastname values need to be " + "filled in"); } } String password = epersonRest.getPassword(); if (!accountService.verifyPasswordStructure(password)) { throw new DSpaceBadRequestException("The given password is invalid"); } }
Source:
public Double getOpening(int bp) { if (bp < 0 || bp >= getPairingParameters().length) throw new IllegalArgumentException(); return pairingParameters[bp][2]; }

Target:
public Double getOpening(int bp) { checkArgument(bp); return pairingParameters[bp][2]; }
Source:
protected synchronized void modified(Map<String, Object> properties) { if (properties != null) { String enabled = (String) properties.get("enabled"); if ("false".equalsIgnoreCase(enabled)) { this.enabled = false; } else if ("true".equalsIgnoreCase(enabled)) { this.enabled = true; } } if (enabled) { logger.info("Enabling channel item provider."); for (ProviderChangeListener<Item> listener : listeners) { for (Item item : getAll()) { listener.added(this, item); } } this.linkRegistry.addRegistryChangeListener(linkRegistryListener); this.itemRegistry.addRegistryChangeListener(itemRegistryListener); this.thingRegistry.addRegistryChangeListener(thingRegistryListener); } else { logger.info("Disabling channel item provider."); for (ProviderChangeListener<Item> listener : listeners) { for (Item item : getAll()) { listener.removed(this, item); } } removeRegistryChangeListeners(); } }

Target:
protected synchronized void modified(Map<String, Object> properties) { if (properties != null) { String enabled = (String) properties.get("enabled"); if ("false".equalsIgnoreCase(enabled)) { this.enabled = false; } else { this.enabled = true; } } if (enabled) { logger.debug("Enabling channel item provider."); for (ProviderChangeListener<Item> listener : listeners) { for (Item item : getAll()) { listener.added(this, item); } } this.linkRegistry.addRegistryChangeListener(linkRegistryListener); this.itemRegistry.addRegistryChangeListener(itemRegistryListener); this.thingRegistry.addRegistryChangeListener(thingRegistryListener); } else { logger.debug("Disabling channel item provider."); for (ProviderChangeListener<Item> listener : listeners) { for (Item item : getAll()) { listener.removed(this, item); } } removeRegistryChangeListeners(); } }
Source:
public void testExecuteQuery() throws Exception { try (Connection connection = createConnection(); PreparedStatement statement = connection.prepareStatement( "SELECT ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?")) { setTestValues(statement); try (ResultSet rs = statement.executeQuery()) { assertTrue(rs.next()); assertTestValues(rs); assertFalse(rs.next()); } } }

Target:
public void testExecuteQuery() throws Exception { try (Connection connection = createConnection(); PreparedStatement statement = connection.prepareStatement("SELECT ?, ?")) { statement.setInt(1, 123); statement.setString(2, "hello"); try (ResultSet rs = statement.executeQuery()) { assertTrue(rs.next()); assertEquals(rs.getInt(1), 123); assertEquals(rs.getString(2), "hello"); assertFalse(rs.next()); } assertTrue(statement.execute()); try (ResultSet rs = statement.getResultSet()) { assertTrue(rs.next()); assertEquals(rs.getInt(1), 123); assertEquals(rs.getString(2), "hello"); assertFalse(rs.next()); } } }
Source:
public void putUnlessExists(long startTimestamp, long commitTimestamp) throws KeyAlreadyExistsException { if (!isTimestampValid(startTimestamp)) { throw new SafeIllegalStateException("Attempted to putUnlessExists({}, {}) which is unexpected.", SafeArg.of("startTimestamp", startTimestamp), SafeArg.of("commitTimestamp", commitTimestamp)); } delegate.putUnlessExists(startTimestamp, commitTimestamp); }

Target:
public void putUnlessExists(long startTimestamp, long commitTimestamp) throws KeyAlreadyExistsException { if (!isTimestampValid(startTimestamp)) { throw new SafeIllegalStateException("Attempted to putUnlessExists({}, {}) which is disallowed.", SafeArg.of("startTimestamp", startTimestamp), SafeArg.of("commitTimestamp", commitTimestamp)); } delegate.putUnlessExists(startTimestamp, commitTimestamp); }
Source:
private LauncherDiscoveryListener getLauncherDiscoveryListener(ConfigurationParameters configurationParameters) { LauncherDiscoveryListener defaultDiscoveryListener = LauncherDiscoveryListeners.fromConfigurationParameter( configurationParameters); if (discoveryListeners.isEmpty()) { return defaultDiscoveryListener; } if (discoveryListeners.contains(defaultDiscoveryListener)) { return LauncherDiscoveryListeners.composite(discoveryListeners); } List<LauncherDiscoveryListener> allDiscoveryListeners = new ArrayList<>(discoveryListeners); allDiscoveryListeners.add(defaultDiscoveryListener); return LauncherDiscoveryListeners.composite(allDiscoveryListeners); }

Target:
private LauncherDiscoveryListener getLauncherDiscoveryListener(ConfigurationParameters configurationParameters) { LauncherDiscoveryListener defaultDiscoveryListener = configurationParameters.get( DEFAULT_DISCOVERY_LISTENER_CONFIGURATION_PROPERTY_NAME) .map(value -> LauncherDiscoveryListeners.fromConfigurationParameter( DEFAULT_DISCOVERY_LISTENER_CONFIGURATION_PROPERTY_NAME, value)) .orElseGet(LauncherDiscoveryListeners::abortOnFailure); if (discoveryListeners.isEmpty()) { return defaultDiscoveryListener; } if (discoveryListeners.contains(defaultDiscoveryListener)) { return LauncherDiscoveryListeners.composite(discoveryListeners); } List<LauncherDiscoveryListener> allDiscoveryListeners = new ArrayList<>(discoveryListeners); allDiscoveryListeners.add(defaultDiscoveryListener); return LauncherDiscoveryListeners.composite(allDiscoveryListeners); }
Source:
private Map<String, String> normalizeHeaders(Map<String,String> headerMap) { Map<String,String> normHeaderMap = new HashMap<String,String>(); for (Map.Entry<String, String> entry : headerMap.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (amzHeaders.contains(key.toLowerCase(Locale.US))) { key = "x-amz-" + key; } else if (!standardHeaders.contains(key.toLowerCase(Locale.US)) && !key.toLowerCase(Locale.US).startsWith("x-amz-")) { key = "x-amz-meta-" + key; } normHeaderMap.put(key, value); } return normHeaderMap; }

Target:
private Map<String, String> normalizeHeaders(Map<String,String> headerMap) { Map<String,String> normHeaderMap = new HashMap<String,String>(); for (Map.Entry<String, String> entry : headerMap.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); String keyLowerCased = key.toLowerCase(Locale.US); if (amzHeaders.contains(keyLowerCased)) { key = "x-amz-" + key; } else if (!standardHeaders.contains(keyLowerCased) && !keyLowerCased.startsWith("x-amz-")) { key = "x-amz-meta-" + key; } normHeaderMap.put(key, value); } return normHeaderMap; }
Source:
public MysqlSchemaStore(ConnectionPool maxwellConnectionPool, ConnectionPool replicationConnectionPool, Long serverID, BinlogPosition initialPosition, CaseSensitivity caseSensitivity, MaxwellFilter filter, boolean replayMode) { super(replicationConnectionPool, caseSensitivity, filter); this.caseSensitivity = caseSensitivity; this.serverID = serverID; this.maxwellConnectionPool = maxwellConnectionPool; this.initialPosition = initialPosition; this.replayMode = replayMode; }

Target:
public MysqlSchemaStore(ConnectionPool maxwellConnectionPool, ConnectionPool replicationConnectionPool, Long serverID, BinlogPosition initialPosition, CaseSensitivity caseSensitivity, MaxwellFilter filter, boolean replayMode) { super(replicationConnectionPool, caseSensitivity, filter); this.serverID = serverID; this.maxwellConnectionPool = maxwellConnectionPool; this.initialPosition = initialPosition; this.replayMode = replayMode; }
Source:
public MultiDataSetIterator getTrainIterator() { return new MultiDataSetIterator() { @Override public MultiDataSet next(int num) { throw new UnsupportedOperationException("To be implemented yet"); } @Override public void setPreProcessor(MultiDataSetPreProcessor preProcessor) { backedIterator.setPreProcessor(preProcessor); } @Override public MultiDataSetPreProcessor getPreProcessor() { return backedIterator.getPreProcessor(); } @Override public boolean resetSupported() { return backedIterator.asyncSupported(); } @Override public boolean asyncSupported() { return backedIterator.asyncSupported(); } @Override public void reset() { resetPending.set(true); } @Override public boolean hasNext() { if (resetPending.get()) { backedIterator.reset(); counter.set(0); resetPending.set(false); } val state = backedIterator.hasNext(); if (state && counter.get() < numTrain) return true; else return false; } @Override public MultiDataSet next() { counter.incrementAndGet(); return backedIterator.next(); } @Override public void remove() { throw new UnsupportedOperationException(); } }; }

Target:
public MultiDataSetIterator getTrainIterator() { return new MultiDataSetIterator() { @Override public MultiDataSet next(int num) { throw new UnsupportedOperationException("To be implemented yet"); } @Override public void setPreProcessor(MultiDataSetPreProcessor preProcessor) { backedIterator.setPreProcessor(preProcessor); } @Override public MultiDataSetPreProcessor getPreProcessor() { return backedIterator.getPreProcessor(); } @Override public boolean resetSupported() { return backedIterator.resetSupported(); } @Override public boolean asyncSupported() { return backedIterator.asyncSupported(); } @Override public void reset() { resetPending.set(true); } @Override public boolean hasNext() { if (resetPending.get()) { if (resetSupported()) { backedIterator.reset(); counter.set(0); resetPending.set(false); } else throw new UnsupportedOperationException("Reset isn't supported by underlying iterator"); } val state = backedIterator.hasNext(); if (state && counter.get() < numTrain) return true; else return false; } @Override public MultiDataSet next() { counter.incrementAndGet(); val p = backedIterator.next(); if (counter.get() == 1 && firstTrain == null) { firstTrain = (org.nd4j.linalg.dataset.MultiDataSet) p.copy(); firstTrain.detach(); } else if (counter.get() == 1) { int cnt = 0; for (val c: p.getFeatures()) if (!c.equalsWithEps(firstTrain.getFeatures()[cnt++], 1e-5)) throw new ND4JIllegalStateException("First examples do not match. Randomization was used?"); } return p; } @Override public void remove() { throw new UnsupportedOperationException(); } }; }
Source:
public byte[] encode() { StringBuilder builder = new StringBuilder(name); builder.append('\0').append(type); builder.append('\0').append(server); builder.append('\0').append(saveLogin ? username : ""); builder.append('\0').append(saveLogin ? password : ""); builder.append('\0').append(dnsServers); builder.append('\0').append(searchDomains); builder.append('\0').append(routes); builder.append('\0').append(mppe); builder.append('\0').append(l2tpSecret); builder.append('\0').append(ipsecIdentifier); builder.append('\0').append(ipsecSecret); builder.append('\0').append(ipsecUserCert); builder.append('\0').append(ipsecCaCert); builder.append('\0').append(ipsecServerCert); builder.append('\0').append(proxy != null ? proxy.getHost() : ""); builder.append('\0').append(proxy != null ? proxy.getPort() : ""); builder.append('\0').append(proxy != null ? proxy.getExclusionListAsString() : ""); builder.append('\0').append(proxy != null ? proxy.getPacFileUrl().toString() : ""); return builder.toString().getBytes(StandardCharsets.UTF_8); }

Target:
public byte[] encode() { StringBuilder builder = new StringBuilder(name); builder.append('\0').append(type); builder.append('\0').append(server); builder.append('\0').append(saveLogin ? username : ""); builder.append('\0').append(saveLogin ? password : ""); builder.append('\0').append(dnsServers); builder.append('\0').append(searchDomains); builder.append('\0').append(routes); builder.append('\0').append(mppe); builder.append('\0').append(l2tpSecret); builder.append('\0').append(ipsecIdentifier); builder.append('\0').append(ipsecSecret); builder.append('\0').append(ipsecUserCert); builder.append('\0').append(ipsecCaCert); builder.append('\0').append(ipsecServerCert); if (proxy != null) { builder.append('\0').append(proxy.getHost() != null ? proxy.getHost() : ""); builder.append('\0').append(proxy.getPort()); builder.append('\0').append(proxy.getExclusionListAsString() != null ? proxy.getExclusionListAsString() : ""); builder.append('\0').append(proxy.getPacFileUrl().toString()); } return builder.toString().getBytes(StandardCharsets.UTF_8); }
Source:
void init() { dragArea.onmousedown = this::onDragAreaMouseDown; dragArea.onmouseup = this::onDragAreaMouseUp; dragArea.onmousemove = this::onDragAreaMouseMove; }

Target:
private void init() { dragArea.onmousedown = this::onDragAreaMouseDown; dragArea.onmouseup = this::onDragAreaMouseUp; dragArea.onmousemove = this::onDragAreaMouseMove; }
Source:
private boolean acquireTokensForJob(JobDescriptorImpl job) { final String requiredLicenses = job.getInternal().getRuntimeGenericInformation().get(REQUIRED_LICENSES); final String jobId = job.getJobId().value(); if (requiredLicenses != null) { logger.debug("For job considering licenses " + requiredLicenses); final HashSet<String> requiredLicensesSet = new HashSet<String>(Arrays.asList(requiredLicenses.split(","))); for (String requiredLicense : requiredLicensesSet) { if (!licenseSynchronization.containsLicense(requiredLicense)) { logger.debug("The required software is not specified in the license properties file, keep job pending"); return false; } if (!licenseSynchronization.containsJobId(requiredLicense, jobId) && !canGetToken(requiredLicense)) { logger.debug("Token for " + requiredLicense + " not available, keep job pending"); return false; } } for (String requiredLicense : requiredLicensesSet) { if (!licenseSynchronization.containsJobId(requiredLicense, jobId)) { licenseSynchronization.addJobToLicense(requiredLicense, jobId); licenseSynchronization.acquireToken(requiredLicense); licenseSynchronization.getAndPutForJobsLicensePersist(requiredLicense); } } logger.debug("Job eligible since it can get all tokens"); licenseSynchronization.persist(); return true; } else { logger.debug("Job eligible since it does not require any license"); return true; } }

Target:
private boolean acquireTokensForJob(JobDescriptorImpl job) { final String requiredLicenses = job.getInternal().getRuntimeGenericInformation().get(REQUIRED_LICENSES); final String jobId = job.getJobId().value(); if (requiredLicenses != null) { logger.debug("For job considering licenses " + requiredLicenses); final HashSet<String> requiredLicensesSet = new HashSet<String>(Arrays.asList(requiredLicenses.split(","))); for (String requiredLicense : requiredLicensesSet) { if (!licenseSynchronization.containsLicense(requiredLicense)) { logger.debug("The required software is not specified in the license properties file, keep job pending"); return false; } if (!licenseSynchronization.containsJobId(requiredLicense, jobId) && !canGetToken(requiredLicense)) { logger.debug("Token for " + requiredLicense + " not available, keep job pending"); return false; } } for (String requiredLicense : requiredLicensesSet) { if (!licenseSynchronization.containsJobId(requiredLicense, jobId)) { licenseSynchronization.addJobToLicense(requiredLicense, jobId); licenseSynchronization.markJobLicenseChange(requiredLicense); } } logger.debug("Job eligible since it can get all tokens"); licenseSynchronization.persist(); return true; } else { logger.debug("Job eligible since it does not require any license"); return true; } }
Source:
private void createInternalAAAConfigurations() { Properties authConfig = new Properties(); authConfig.put(ExtensionsManager.CLASS, "org.ovirt.engine.extensions.aaa.builtin.internal.InternalAuthenticator"); authConfig.put(ExtensionsManager.PROVIDES, "org.ovirt.engine.core.authentication"); authConfig.put(ExtensionsManager.ENABLED, "true"); authConfig.put(ExtensionsManager.MODULE, "org.ovirt.engine.extensions.builtin"); authConfig.put(ExtensionsManager.NAME, "builtin-authn-internal"); authConfig.put("ovirt.engine.aaa.authn.profile.name", "internal"); authConfig.put("ovirt.engine.aaa.authn.authz.plugin", "builtin-authz-internal"); authConfig.put("config.authn.user.name", Config.<String> getValue(ConfigValues.AdminUser)); authConfig.put("config.authn.user.password", Config.<String> getValue(ConfigValues.AdminPassword)); authConfig.put(ExtensionsManager.SENSITIVE_KEYS, "config.authn.user.password)"); ExtensionsManager.getInstance().load(authConfig); Properties dirConfig = new Properties(); dirConfig.put(ExtensionsManager.CLASS, "org.ovirt.engine.extensions.aaa.builtin.internal.InternalDirectory"); dirConfig.put(ExtensionsManager.PROVIDES, "org.ovirt.engine.core.authorization"); dirConfig.put(ExtensionsManager.ENABLED, "true"); dirConfig.put(ExtensionsManager.MODULE, "org.ovirt.engine.extensions.builtin"); dirConfig.put("config.authz.user.name", Config.<String> getValue(ConfigValues.AdminUser)); dirConfig.put(ExtensionsManager.NAME, "builtin-authz-internal"); dirConfig.put("ovirt.engine.aaa.authz.profile.name", "internal"); ExtensionsManager.getInstance().load(dirConfig); }

Target:
private void createInternalAAAConfigurations() { Properties authConfig = new Properties(); authConfig.put(ExtensionsManager.CLASS, "org.ovirt.engine.extensions.aaa.builtin.internal.InternalAuthenticator"); authConfig.put(ExtensionsManager.PROVIDES, "org.ovirt.engine.authentication"); authConfig.put(ExtensionsManager.ENABLED, "true"); authConfig.put(ExtensionsManager.MODULE, "org.ovirt.engine.extensions.builtin"); authConfig.put(ExtensionsManager.NAME, "builtin-authn-internal"); authConfig.put("ovirt.engine.aaa.authn.profile.name", "internal"); authConfig.put("ovirt.engine.aaa.authn.authz.plugin", "builtin-authz-internal"); authConfig.put("config.authn.user.name", Config.<String> getValue(ConfigValues.AdminUser)); authConfig.put("config.authn.user.password", Config.<String> getValue(ConfigValues.AdminPassword)); authConfig.put(ExtensionsManager.SENSITIVE_KEYS, "config.authn.user.password)"); ExtensionsManager.getInstance().load(authConfig); Properties dirConfig = new Properties(); dirConfig.put(ExtensionsManager.CLASS, "org.ovirt.engine.extensions.aaa.builtin.internal.InternalDirectory"); dirConfig.put(ExtensionsManager.PROVIDES, "org.ovirt.engine.authorization"); dirConfig.put(ExtensionsManager.ENABLED, "true"); dirConfig.put(ExtensionsManager.MODULE, "org.ovirt.engine.extensions.builtin"); dirConfig.put(ExtensionsManager.NAME, "builtin-authz-internal"); dirConfig.put("config.authz.user.name", Config.<String> getValue(ConfigValues.AdminUser)); ExtensionsManager.getInstance().load(dirConfig); }
Source:
public void handlesOptional() throws Exception { TypedValue result = expressionLanguage.evaluate("'hello' as String {class: 'java.util.Optional'}", testEvent(), BindingContext.builder().build()); assertThat(result.getValue(), is(instanceOf(Optional.class))); }

Target:
public void handlesOptional() throws Exception { TypedValue result = expressionLanguage.evaluate("'hello' as String {class: 'java.util.Optional'}", testEvent(), BindingContext.builder().build()); assertThat(result.getValue(), is(instanceOf(Optional.class))); assertThat(((Optional) result.getValue()).get(), is("hello")); }
Source:
public List<Integer> getQuarks() { String[] paths = fPath.split(SPLIT_STRING); int i = 0; @SuppressWarnings("null") @NonNull List<Integer> quarks = Collections.singletonList(IXmlStateSystemContainer.ROOT_QUARK); while (i < paths.length) { List<Integer> subQuarks = new LinkedList<>(); String name = paths[i].replaceAll("\\*", ".*"); for (int relativeQuark : quarks) { try { for (int quark : fStateSystem.getSubAttributes(relativeQuark, false, name)) { subQuarks.add(quark); } } catch (AttributeNotFoundException e) { } } quarks = subQuarks; i++; } return quarks; }

Target:
public List<Integer> getQuarks() { String[] paths = fPath.split(SPLIT_STRING); @SuppressWarnings("null") @NonNull List<Integer> quarks = Collections.singletonList(IXmlStateSystemContainer.ROOT_QUARK); try { for (String path : paths) { List<Integer> subQuarks = new LinkedList<>(); String name = WILDCARD_PATTERN.matcher(path).replaceAll(".*"); for (int relativeQuark : quarks) { subQuarks.addAll(fStateSystem.getSubAttributes(relativeQuark, false, name)); } quarks = subQuarks; } } catch (AttributeNotFoundException e) { throw new IllegalStateException(); } return quarks; }
Source:
public AbstractHorizontalScrollViewAssert hasMaximumScrollAmount(int amount) { isNotNull(); int actualAmount = actual.getMaxScrollAmount(); assertThat(actualAmount) .overridingErrorMessage("Expected maximum scroll amount <%s> but was <%s>.", amount, actualAmount) .isEqualTo(amount); return this; }

Target:
public S hasMaximumScrollAmount(int amount) { isNotNull(); int actualAmount = actual.getMaxScrollAmount(); assertThat(actualAmount) .overridingErrorMessage("Expected maximum scroll amount <%s> but was <%s>.", amount, actualAmount) .isEqualTo(amount); return myself; }
Source:
public void checkApplicationIsBeingInitialized(Activity activity, ProgressDialog progressDialog) { startApplication(); synchronized (OsmandApplication.this) { if (startDialog != null) { if (osmandSettings.usingEnglishNames()) { try { SpecialPhrases.setLanguage(this, new Locale("en")); } catch (IOException e) { LOG.error("I/O exception", e); Toast error = Toast.makeText(this, "Error while reading the special phrases. Restart OsmAnd if possible", Toast.LENGTH_LONG); error.show(); } } else { try { SpecialPhrases.setLanguage(this, Locale.getDefault()); } catch (IOException e) { LOG.error("I/O exception", e); Toast error = Toast.makeText(this, "Error while reading the special phrases. Restart OsmAnd if possible", Toast.LENGTH_LONG); error.show(); } } progressDialog.setTitle(getString(R.string.loading_data)); progressDialog.setMessage(getString(R.string.reading_indexes)); activity.showDialog(PROGRESS_DIALOG); startDialog.setDialog(progressDialog); } else if (startingWarnings != null) { showWarnings(startingWarnings, activity); } } }

Target:
public void checkApplicationIsBeingInitialized(Activity activity, ProgressDialog progressDialog) { startApplication(); synchronized (OsmandApplication.this) { if (startDialog != null) { try { SpecialPhrases.setLanguage(this, osmandSettings); } catch (IOException e) { LOG.error("I/O exception", e); Toast error = Toast.makeText(this, "Error while reading the special phrases. Restart OsmAnd if possible", Toast.LENGTH_LONG); error.show(); } progressDialog.setTitle(getString(R.string.loading_data)); progressDialog.setMessage(getString(R.string.reading_indexes)); activity.showDialog(PROGRESS_DIALOG); startDialog.setDialog(progressDialog); } else if (startingWarnings != null) { showWarnings(startingWarnings, activity); } } }
Source:
public Collection<Symptom> detect(Collection<Measurement> measurements) { Collection<Symptom> result = new ArrayList<>(); MeasurementsTable waitQueueMetrics = MeasurementsTable.of(measurements).type (METRIC_WAIT_Q_SIZE.text()); for (String component : waitQueueMetrics.uniqueComponents()) { Set<String> addresses = new HashSet<>(); double maxSlope = computeWaitQueueSizeTrend(waitQueueMetrics.component(component)); if (maxSlope > rateLimit) { LOG.info(String.format("Detected growing wait queues for %s, max rate %f", component, maxSlope)); addresses.add(component); result.add(new Symptom(SYMPTOM_GROWING_WAIT_Q.text(), context.checkpoint(), addresses)); } } return result; }

Target:
public Collection<Symptom> detect(Collection<Measurement> measurements) { Collection<Symptom> result = new ArrayList<>(); MeasurementsTable waitQueueMetrics = MeasurementsTable.of(measurements).type(METRIC_WAIT_Q_SIZE.text()); for (String component : waitQueueMetrics.uniqueComponents()) { double maxSlope = computeWaitQueueSizeTrend(waitQueueMetrics.component(component)); if (maxSlope > rateLimit) { LOG.info(String.format("Detected growing wait queues for %s, max rate %f", component, maxSlope)); Collection<String> addresses = Collections.singletonList(component); result.add(new Symptom(SYMPTOM_GROWING_WAIT_Q.text(), context.checkpoint(), addresses)); } } return result; }
Source:
public void setup(Context.OperatorContext context) { this.timeIncrement = context.getValue(Context.OperatorContext.APPLICATION_WINDOW_COUNT) * context.getValue(Context.DAGContext.STREAMING_WINDOW_SIZE_MILLIS); validate(); windowStateMap.setup(context); dataStorage.setup(context); if (retractionStorage != null) { retractionStorage.setup(context); } for (Component component : components.values()) { component.setup(context); } if (this.windowOption instanceof WindowOption.GlobalWindow) { windowStateMap.put(Window.GlobalWindow.getInstance(), new WindowState()); } }

Target:
public void setup(Context.OperatorContext context) { this.timeIncrement = context.getValue(Context.OperatorContext.APPLICATION_WINDOW_COUNT) * context.getValue(Context.DAGContext.STREAMING_WINDOW_SIZE_MILLIS); validate(); windowStateMap.setup(context); dataStorage.setup(context); if (retractionStorage != null) { retractionStorage.setup(context); } for (Component component : components.values()) { component.setup(context); } if (this.windowOption instanceof WindowOption.GlobalWindow) { windowStateMap.put(Window.GlobalWindow.INSTANCE, new WindowState()); } }
Source:
public Inventory parent() { return this.parent == null ? this : this.parent(); }

Target:
public Inventory parent() { return this.parent == null ? this : this.parent; }
Source:
public Subscription(final String id, final DateTime createdAt, final DateTime updatedAt, final SubscriptionBase subscriptionBase) { super(subscriptionBase, id); this.id = id; this.createdAt = createdAt; this.updatedAt = updatedAt; }

Target:
public Subscription(final String id, final DateTime createdAt, final DateTime updatedAt, final SubscriptionBase subscriptionBase) { super(subscriptionBase); this.id = id; this.createdAt = createdAt; this.updatedAt = updatedAt; }
Source:
public FilterMessageTableModel getFilterMessageTableModel() { return filterMessageTableModel; }

Target:
FilterMessageTableModel getFilterMessageTableModel() { return filterMessageTableModel; }
Source:
public void asyncLogContainerWithDetails() throws Exception { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") .withCmd("--log-driver", "journald", "--log-opt", "env=ENV_VAR", "-e", "ENV_VAR=logtester.1234", "flyinprogrammer/logtester") .exec(); LOG.info("Created container: {}", container.toString()); assertThat(container.getId(), not(isEmptyString())); dockerRule.getClient().startContainerCmd(container.getId()) .exec(); LogContainerTestCallback loggingCallback = new LogContainerTestCallback(true); dockerRule.getClient().logContainerCmd(container.getId()) .withStdErr(true) .withStdOut(true) .withDetails(true) .exec(loggingCallback); loggingCallback.awaitCompletion(3, TimeUnit.SECONDS); assertTrue(loggingCallback.toString().contains("ENV_VAR=logtester.1234")); }

Target:
public void asyncLogContainerWithDetails() throws Exception { HashMap<String, String> config = new HashMap<>(); config.put("env", "ENV_VAR"); LogConfig logConfig = new LogConfig(LogConfig.LoggingType.JOURNALD, config); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("flyinprogrammer/logtester") .withEnv("ENV_VAR=logtester.1234") .withLogConfig(logConfig) .exec(); LOG.info("Created container: {}", container.toString()); assertThat(container.getId(), not(isEmptyString())); dockerRule.getClient().startContainerCmd(container.getId()) .exec(); LogContainerTestCallback loggingCallback = new LogContainerTestCallback(true); dockerRule.getClient().logContainerCmd(container.getId()) .withStdErr(true) .withStdOut(true) .withDetails(true) .exec(loggingCallback); loggingCallback.awaitCompletion(3, TimeUnit.SECONDS); assertTrue(loggingCallback.toString().contains("ENV_VAR=logtester.1234")); }