auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void init(FilterConfig filterConfig) throws ServletException { LOGGER.debug("Starting CSRF filter."); protectedContexts = new ArrayList<>(); protectedContexts.add(JOLOKIA_CONTEXT); protectedContexts.add(INTRIGUE_CONTEXT); protectedContexts.add(WEBSOCKET_CONTEXT); String internalHostname = System.getProperty("org.codice.ddf.system.hostname"); String internalHttpPort = System.getProperty("org.codice.ddf.system.httpPort"); String internalHttpsPort = System.getProperty("org.codice.ddf.system.httpsPort"); String externalHostname = System.getProperty("org.codice.ddf.external.hostname"); String externalHttpPort = System.getProperty("org.codice.ddf.external.httpPort"); String externalHttpsPort = System.getProperty("org.codice.ddf.external.httpsPort"); trustedAuthorities = new ArrayList<>(); trustedAuthorities.add(internalHostname + ":" + internalHttpPort); trustedAuthorities.add(internalHostname + ":" + internalHttpsPort); trustedAuthorities.add(externalHostname + ":" + externalHttpPort); trustedAuthorities.add(externalHostname + ":" + externalHttpsPort); if (internalHttpPort.equals("80") || internalHttpsPort.equals("443")) { trustedAuthorities.add(internalHostname); } if (externalHttpPort.equals("80") || externalHttpsPort.equals("443")) { trustedAuthorities.add(externalHostname); } }

Target:
public void init(FilterConfig filterConfig) throws ServletException { LOGGER.debug("Starting CSRF filter."); protectedContexts = new ArrayList<>(); protectedContexts.add(JOLOKIA_CONTEXT); protectedContexts.add(INTRIGUE_CONTEXT); protectedContexts.add(WEBSOCKET_CONTEXT); String internalHostname = SystemBaseUrl.INTERNAL.getHost(); String internalHttpPort = SystemBaseUrl.INTERNAL.getHttpPort(); String internalHttpsPort = SystemBaseUrl.INTERNAL.getHttpsPort(); String externalHostname = SystemBaseUrl.EXTERNAL.getHost(); String externalHttpPort = SystemBaseUrl.EXTERNAL.getHttpPort(); String externalHttpsPort = SystemBaseUrl.EXTERNAL.getHttpsPort(); trustedAuthorities = new ArrayList<>(); trustedAuthorities.add(internalHostname + ":" + internalHttpPort); trustedAuthorities.add(internalHostname + ":" + internalHttpsPort); trustedAuthorities.add(externalHostname + ":" + externalHttpPort); trustedAuthorities.add(externalHostname + ":" + externalHttpsPort); }
Source:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitForStatement(@NotNull GoForStatement o) { super.visitForStatement(o); GoBlock forBlock = o.getBlock(); GoRangeClause forRangeClause = o.getRangeClause(); GoForClause forClause = o.getForClause(); if (o.getExpression() != null || forBlock == null || (forRangeClause != null && !forRangeClause.getExpressionList().isEmpty()) || (forClause != null && !forClause.getStatementList().isEmpty()) || !forBlock.getStatementList().isEmpty()) { return; } holder.registerProblem(o, "Infinite for loop", ProblemHighlightType.GENERIC_ERROR_OR_WARNING, new GoReplaceWithSelectStatementQuickFix(o)); } }; }

Target:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitForStatement(@NotNull GoForStatement o) { super.visitForStatement(o); if (o.getExpression() == null && !hasBlock(o.getBlock()) && !hasRangeClause(o.getRangeClause()) && !hasClause(o.getForClause())) { holder.registerProblem(o, "Infinite for loop", ProblemHighlightType.GENERIC_ERROR_OR_WARNING, new GoReplaceWithSelectStatementQuickFix()); } } }; }
Source:
public ViewExtensionDescription getDefaultRules(ResourceSet resourceSet) { Resource resource = resourceSet.getResource(DEFAULT_RULES_RESOURCE_URI, true); if (resource == null) { SiriusPropertiesCorePlugin.getPlugin().error(Messages.DefaultRulesProvider_DefaultPropertiesNotFound); } else { Optional<Group> optionalGroup = resource.getContents().stream().filter(Group.class::isInstance).map(Group.class::cast).findFirst(); Optional<ViewExtensionDescription> viewExtensionDescription = optionalGroup.flatMap(group -> { return group.getExtensions().stream().filter(ViewExtensionDescription.class::isInstance).map(ViewExtensionDescription.class::cast).findFirst(); }); return viewExtensionDescription.orElse(null); } return null; }

Target:
public ViewExtensionDescription getDefaultRules(ResourceSet resourceSet) { Optional<Resource> resource = Optional.ofNullable(resourceSet.getResource(DEFAULT_RULES_RESOURCE_URI, true)); if (!resource.isPresent()) { SiriusPropertiesCorePlugin.getPlugin().error(Messages.DefaultRulesProvider_DefaultPropertiesNotFound); } return resource.map(r -> r.getContents()).filter(Group.class::isInstance).map(Group.class::cast).map(group -> group.getExtensions()).filter(ViewExtensionDescription.class::isInstance) .map(ViewExtensionDescription.class::cast).orElse(null); }
Source:
public void changed() { super.changed(); if (!ConfServer.localPollingEnabled || !MassiveCoreMConf.get().warnOnLocalAlter) return; this.lastStackTraceChanged = MUtil.getStackTrace(); }

Target:
public void changed() { super.changed(); if (!MStore.isLocalPollingDebugEnabled() || !MassiveCoreMConf.get().advancedLocalPollingDebug) return; this.lastStackTraceChanged = MUtil.getStackTrace(); }
Source:
public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); Log.d(TAG, "got new message: " + remoteMessage.getData()); CountlyPush.Message message = CountlyPush.decodeMessage(remoteMessage.getData()); Intent notificationIntent = null; if (!message.has("c.l")) { notificationIntent = new Intent(this, MainActivity.class); notificationIntent.putExtra(MainActivity.NOTIFICATION_DIALOG, "yes"); notificationIntent.putExtra("title", "title"); notificationIntent.putExtra("message", "message"); } Boolean result = CountlyPush.displayMessage(getApplicationContext(), message, R.drawable.notification_icon, notificationIntent); if (result == null) { Log.d(TAG, "Message wasn't sent from Countly server, so it cannot be handled by Countly SDK"); } else if (result) { Log.d(TAG, "Message was handled by Countly SDK"); } else { Log.d(TAG, "Message wasn't handled by Countly SDK because API level is too low for Notification support or because currentActivity is null (not enough lifecycle method calls)"); } }

Target:
public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); Log.d(TAG, "got new message: " + remoteMessage.getData()); CountlyPush.Message message = CountlyPush.decodeMessage(remoteMessage.getData()); Intent notificationIntent = null; if (!message.has("c.l")) { notificationIntent = new Intent(this, MainActivity.class); notificationIntent.putExtra(MainActivity.NOTIFICATION_DIALOG, "yes"); notificationIntent.putExtra("title", message.title()); notificationIntent.putExtra("message", message.message()); } Boolean result = CountlyPush.displayMessage(getApplicationContext(), message, R.drawable.notification_icon, notificationIntent); if (result == null) { Log.d(TAG, "Message wasn't sent from Countly server, so it cannot be handled by Countly SDK"); } else if (result) { Log.d(TAG, "Message was handled by Countly SDK"); } else { Log.d(TAG, "Message wasn't handled by Countly SDK because API level is too low for Notification support or because currentActivity is null (not enough lifecycle method calls)"); } }
Source:
public List getRulesetFilenames() { try { return Files.walk(Paths.get(ConfigCore.getParameter("RegelsaetzeVerzeichnis"))) .filter(f -> f.toString().endsWith(".xml")) .map(Path::getFileName) .sorted() .collect(Collectors.toList()); } catch (IOException e) { Helper.setErrorMessage("errorLoadingMany", new Object[] {Helper.getTranslation("rulesets")}, logger, e); return new ArrayList(); } }

Target:
public List getRulesetFilenames() { try { return Files.walk(Paths.get(ConfigCore.getParameter(Parameters.DIR_RULESETS))) .filter(f -> f.toString().endsWith(".xml")) .map(Path::getFileName) .sorted() .collect(Collectors.toList()); } catch (IOException e) { Helper.setErrorMessage("errorLoadingMany", new Object[] {Helper.getTranslation("rulesets")}, logger, e); return new ArrayList(); } }
Source:
public void pushSubjectToConference(final Conversation conference, final String subject) { MessagePacket packet = this.getMessageGenerator().conferenceSubject(conference, subject); this.sendMessagePacket(conference.getAccount(), packet); final MucOptions mucOptions = conference.getMucOptions(); final MucOptions.User self = mucOptions.getSelf(); if (self.getAffiliation().ranks(MucOptions.Affiliation.OWNER)) { Bundle options = new Bundle(); if (!mucOptions.persistent()) { options.putString("muc#roomconfig_persistentroom", "1"); } options.putString("muc#roomconfig_roomname", subject); this.pushConferenceConfiguration(conference, options, null); } }

Target:
public void pushSubjectToConference(final Conversation conference, final String subject) { MessagePacket packet = this.getMessageGenerator().conferenceSubject(conference, subject); this.sendMessagePacket(conference.getAccount(), packet); final MucOptions mucOptions = conference.getMucOptions(); final MucOptions.User self = mucOptions.getSelf(); if (self.getAffiliation().ranks(MucOptions.Affiliation.OWNER)) { Bundle options = new Bundle(); options.putString("muc#roomconfig_persistentroom", "1"); options.putString("muc#roomconfig_roomname", subject); this.pushConferenceConfiguration(conference, options, null); } }
Source:
protected Channel setupChannel(Connection connection) throws Exception { Channel chan = connection.createChannel(); if (rmqConnectionConfig.getPrefetchCount().isPresent()) { chan.basicQos(rmqConnectionConfig.getPrefetchCount().get()); } return chan; }

Target:
private Channel setupChannel(Connection connection) throws Exception { Channel chan = connection.createChannel(); if (rmqConnectionConfig.getPrefetchCount().isPresent()) { chan.basicQos(rmqConnectionConfig.getPrefetchCount().get(), true); } return chan; }
Source:
public String getFullyQualifiedSignature() { if (!this.isConstructorCall() && !this.isMethodCall()) { return null; } Package classPackage = this.declaringType.getPackage(); String packageName = (classPackage == null) ? null : classPackage.getName(); String classname = this.getDeclaringType().getRawtype().getUnqualifiedName(); String name = this.getUnqualifiedName().equals("<init>") ? classname : this.getUnqualifiedName(); Iterator<Type> inputTypeIterator = inputTypes.iterator(); List<String> typeNames = new ArrayList<>(); for (int i = 0; inputTypeIterator.hasNext(); i++) { String typeName = inputTypeIterator.next().getName(); if (!isStatic() && i == 0) { System.out.println("Skipped "); continue; } typeNames.add(typeName); } return ((packageName == null) ? "" : packageName + ".") + (classname.equals(name) ? name : classname + "." + name) + "(" + UtilPlume.join(typeNames, ",") + ")"; }

Target:
public String getFullyQualifiedSignature() { if (!this.isConstructorCall() && !this.isMethodCall()) { return null; } Package classPackage = this.declaringType.getPackage(); String packageName = (classPackage == null) ? null : classPackage.getName(); String classname = this.getDeclaringType().getRawtype().getUnqualifiedName(); String name = this.getUnqualifiedName().equals("<init>") ? classname : this.getUnqualifiedName(); Iterator<Type> inputTypeIterator = inputTypes.iterator(); List<String> typeNames = new ArrayList<>(); for (int i = 0; inputTypeIterator.hasNext(); i++) { String typeName = inputTypeIterator.next().getName(); if (!isStatic() && i == 0) { continue; } typeNames.add(typeName); } return ((packageName == null) ? "" : packageName + ".") + (classname.equals(name) ? name : classname + "." + name) + "(" + UtilPlume.join(typeNames, ",") + ")"; }
Source:
public String getIconFileName() { if (Jenkins.get().hasPermission(Jenkins.MANAGE) || Jenkins.get().hasPermission(Jenkins.SYSTEM_READ)) return "gear2.png"; else return null; }

Target:
public String getIconFileName() { if (Jenkins.get().hasAnyPermission(Jenkins.MANAGE, Jenkins.SYSTEM_READ)) return "gear2.png"; else return null; }
Source:
private static void assertGetResult(VmTemplate result) { assertNotNull(result); assertEquals(EXISTING_TEMPLATE_ID, result.getId()); assertTrue("Template generation wasn't loaded as expected", result.getDbGeneration() == 1); }

Target:
private static void assertGetResult(VmTemplate result) { assertNotNull(result); assertEquals(EXISTING_TEMPLATE_ID, result.getId()); assertEquals("Template generation wasn't loaded as expected", 1, result.getDbGeneration()); }
Source:
public static Map<String, Object> getVideoDeviceSpecParams(VmBase vmBase) { Map<String, Object> specParams = new HashMap<>(); getVideoDeviceParams(vmBase).forEach((k, v) -> specParams.put(k, String.valueOf(v))); return specParams; }

Target:
public static Map<String, Object> getVideoDeviceSpecParams(VmBase vmBase) { return getVideoDeviceRAMSettings(vmBase).entrySet().stream() .collect(Collectors.toMap(Map.Entry::getKey, e -> String.valueOf(e.getValue()))); }
Source:
public void use(SquareContainer square) { if (direction == null) throw new IllegalStateException( "The disk cannot be used when there is no direction set!"); currentSquare = (SquareContainer) square; if (!canMoveDisk(direction)) currentSquare.addItem(this); else while (canMoveDisk(direction)) { moveDisk(direction); if (currentSquare.hasPlayer()) { currentSquare.getPlayer().asExplodable().skipNumberOfActions(3); break; } } direction = null; currentSquare = null; }

Target:
public void use(SquareContainer square) { if (direction == null) throw new IllegalStateException( "The disk cannot be used when there is no direction set!"); setSquare(square); if (!canMoveDisk(direction)) currentSquare.addItem(this); else while (canMoveDisk(direction)) { moveDisk(direction); if (currentSquare.hasPlayer()) { currentSquare.getPlayer().asExplodable().skipNumberOfActions(3); break; } } direction = null; currentSquare = null; }
Source:
public static String[] basePackages(SimpleModuleDefinition moduleDefinition, ClassLoader moduleClassLoader) { Resource propertiesFile = ModuleUtils.locateModuleResource(moduleDefinition, moduleClassLoader, ".properties"); if (propertiesFile == null) { return new String[0]; } Properties properties = new Properties(); try { properties.load(propertiesFile.getInputStream()); } catch (IOException e) { throw new RuntimeException(String.format("Unable to read module properties for %s:%s", moduleDefinition.getName(), moduleDefinition.getType()), e); } String basePackageNames = properties.getProperty(BASE_PACKAGES); return StringUtils.commaDelimitedListToStringArray(basePackageNames); }

Target:
public static String[] basePackages(SimpleModuleDefinition moduleDefinition, ClassLoader moduleClassLoader) { Resource propertiesFile = ModuleUtils.modulePropertiesFile(moduleDefinition, moduleClassLoader); if (propertiesFile == null) { return new String[0]; } Properties properties = new Properties(); try { properties.load(propertiesFile.getInputStream()); } catch (IOException e) { throw new RuntimeException(String.format("Unable to read module properties for %s:%s", moduleDefinition.getName(), moduleDefinition.getType()), e); } String basePackageNames = properties.getProperty(BASE_PACKAGES); return StringUtils.commaDelimitedListToStringArray(basePackageNames); }
Source:
public List<CloudBlobMetadata> findEntriesSince(String partitionPath, CloudFindToken findToken, long maxTotalSizeOfEntries) { List<CloudBlobMetadata> entries = new LinkedList<>(); for (BlobId blobId : map.keySet()) { if (map.get(blobId).getFirst().getLastUpdateTime() >= findToken.getLastUpdateTime()) { if (findToken.getLastUpdateTimeReadBlobIds().contains(map.get(blobId).getFirst().getId())) { continue; } entries.add(map.get(blobId).getFirst()); } } Collections.sort(entries, (CloudBlobMetadata o1, CloudBlobMetadata o2) -> { if (o1.getLastUpdateTime() == o2.getLastUpdateTime()) { return 0; } return o1.getLastUpdateTime() > o2.getLastUpdateTime() ? 1 : -1; }); long totalSize = 0; List<CloudBlobMetadata> results = new ArrayList<>(); for (CloudBlobMetadata metadata : entries) { if (totalSize + metadata.getSize() > maxTotalSizeOfEntries) { if (results.size() == 0) { results.add(metadata); } break; } results.add(metadata); totalSize += metadata.getSize(); } return results; }

Target:
public List<CloudBlobMetadata> findEntriesSince(String partitionPath, CloudFindToken findToken, long maxTotalSizeOfEntries) { List<CloudBlobMetadata> entries = new LinkedList<>(); for (BlobId blobId : map.keySet()) { if (map.get(blobId).getFirst().getLastUpdateTime() >= findToken.getLastUpdateTime()) { if (findToken.getLastUpdateTimeReadBlobIds().contains(map.get(blobId).getFirst().getId())) { continue; } entries.add(map.get(blobId).getFirst()); } } Collections.sort(entries, Comparator.comparingLong(CloudBlobMetadata::getLastUpdateTime)); return CloudBlobMetadata.capMetadataListBySize(entries, maxTotalSizeOfEntries); }
Source:
@Test public void dataset_09() { Dataset ds = createDataset(); assertTrue("Named default graph not found", ds.containsNamedModel(Quad.defaultGraphIRI.getURI())); }

Target:
@Test public void dataset_09() { Dataset ds = createDataset(); assertTrue("Default graph not found using '<"+Quad.defaultGraphIRI.getURI()+">'", ds.containsNamedModel(Quad.defaultGraphIRI.getURI())); }
Source:
public Object setRuntimePropertyValue(String propertyName, Object newValue) { if ("comPort".equalsIgnoreCase(propertyName)) { final Object oldValue = propComPort; propComPort = newValue.toString(); return oldValue; } if ("baudRate".equalsIgnoreCase(propertyName)) { final Object oldValue = propBaudRate; propBaudRate = Integer.parseInt(newValue.toString()); return oldValue; } if ("sendStringTerminator".equalsIgnoreCase(propertyName)) { final Object oldValue = propSendStringTerminator; propSendStringTerminator = Integer.parseInt(newValue.toString()); return oldValue; } if ("receiveStringTerminator".equalsIgnoreCase(propertyName)) { final Object oldValue = propReceiveStringTerminator; propReceiveStringTerminator = Integer.parseInt(newValue.toString()); return oldValue; } if ("sendBytesBufferSize".equalsIgnoreCase(propertyName)) { final Object oldValue = propSendBytesBufferSize; propSendBytesBufferSize = Integer.parseInt(newValue.toString()); sendBytesBuffer=ByteBuffer.allocate(propSendBytesBufferSize); return oldValue; } if ("cimId".equalsIgnoreCase(propertyName)) { final Object oldValue = propCimId; if(newValue != null) { String s = newValue.toString().trim(); if (s.startsWith("0x")) { s = s.substring(2); try { propCimId = (short) Integer.parseInt(s, 16); } catch (NumberFormatException e) { logger.warning("could not format cimId, value is: " + s); } } } return oldValue; } return null; }

Target:
public Object setRuntimePropertyValue(String propertyName, Object newValue) { if ("comPort".equalsIgnoreCase(propertyName)) { final Object oldValue = propComPort; propComPort = newValue.toString(); return oldValue; } if ("baudRate".equalsIgnoreCase(propertyName)) { final Object oldValue = propBaudRate; propBaudRate = Integer.parseInt(newValue.toString()); return oldValue; } if ("sendStringTerminator".equalsIgnoreCase(propertyName)) { final Object oldValue = propSendStringTerminator; propSendStringTerminator = Integer.parseInt(newValue.toString()); return oldValue; } if ("receiveStringTerminator".equalsIgnoreCase(propertyName)) { final Object oldValue = propReceiveStringTerminator; propReceiveStringTerminator = Integer.parseInt(newValue.toString()); return oldValue; } if ("sendBytesBufferSize".equalsIgnoreCase(propertyName)) { final Object oldValue = propSendBytesBufferSize; propSendBytesBufferSize = Integer.parseInt(newValue.toString()); sendBytesBuffer=ByteBuffer.allocate(propSendBytesBufferSize); return oldValue; } if ("cimId".equalsIgnoreCase(propertyName)) { final Object oldValue = propCimId; if(newValue != null) { String s = newValue.toString().trim().toLowerCase(); if (s.startsWith("0x")) { s = s.substring(2); try { propCimId = (short) Integer.parseInt(s, 16); } catch (NumberFormatException e) { logger.warning("could not format cimId, value is: " + s); } } } return oldValue; } return null; }
Source:
DataOperation(final Optional<String> origEvalId, final String operationId, final DataOpType operationType, final String dataType, final List<LongRange> dataKeyRanges, final Optional<SortedMap<Long, T>> dataKeyValueMap) { this.origEvalId = origEvalId; this.operationId = operationId; this.operationType = operationType; this.dataType = dataType; this.dataKeyRanges = Collections.unmodifiableList(dataKeyRanges); if (dataKeyValueMap.isPresent()) { this.dataKeyValueMap = Optional.of(Collections.unmodifiableSortedMap(dataKeyValueMap.get())); } else { this.dataKeyValueMap = dataKeyValueMap; } }

Target:
DataOperation(final Optional<String> origEvalId, final String operationId, final DataOpType operationType, final String dataType, final List<LongRange> dataKeyRanges, final Optional<SortedMap<Long, T>> dataKeyValueMap) { this.origEvalId = origEvalId; this.operationId = operationId; this.operationType = operationType; this.dataType = dataType; this.dataKeyRanges = dataKeyRanges; this.dataKeyValueMap = dataKeyValueMap; }
Source:
abstract protected IDynamicDistributionTemplate initTemplate(DynamicPluginAdapter pluginAdapter, IDynamicMonitor monitor) throws Exception; @Override public void unregist(IDynamicPlugin dynamicPlugin, IDynamicMonitor monitor) throws Exception { IDynamicPluginConfiguration pluginConfiguration = dynamicPlugin.getPluginConfiguration(); String id = pluginConfiguration.getId(); DynamicPluginAdapter registedPluginAdapter = registedPluginMap.get(id); if (registedPluginAdapter != null) { DynamicServiceUtil.removeContribution(registedPluginAdapter.getPlugin()); registedPluginMap.remove(id); } ServiceRegistration registedOsgiService = registedOsgiServiceMap.get(id); if (registedOsgiService != null) { DynamicServiceUtil.unregistOSGiService(registedOsgiService); registedOsgiServiceMap.remove(id); } }

Target:
abstract protected IDynamicDistributionTemplate initTemplate(DynamicPluginAdapter pluginAdapter, IDynamicMonitor monitor) throws Exception; @Override public void unregister(IDynamicPlugin dynamicPlugin, IDynamicMonitor monitor) throws Exception { IDynamicPluginConfiguration pluginConfiguration = dynamicPlugin.getPluginConfiguration(); String id = pluginConfiguration.getId(); DynamicPluginAdapter registedPluginAdapter = registedPluginMap.get(id); if (registedPluginAdapter != null) { DynamicServiceUtil.removeContribution(registedPluginAdapter.getPlugin()); registedPluginMap.remove(id); } ServiceRegistration registedOsgiService = registedOsgiServiceMap.get(id); if (registedOsgiService != null) { DynamicServiceUtil.unregistOSGiService(registedOsgiService); registedOsgiServiceMap.remove(id); } }
Source:
public static Set set(String field, Date date){ return set(field, ClientConstants.getDateFormat().format(date)); }

Target:
public static Set set(String field, Date date){ return new Set().more(field, Literal.value(date)); }
Source:
public void testDifferentThresholdsForMinLogSizeToCompact() throws StoreException { int[] minLogSizeToTriggerCompactionInPercentages = new int[]{60, 61, 65, 70, 80, 95}; for (int minLogSize : minLogSizeToTriggerCompactionInPercentages) { properties.setProperty("store.min.log.size.to.trigger.compaction.in.percent", String.valueOf(minLogSize)); StoreConfig config = new StoreConfig(new VerifiableProperties(properties)); MetricRegistry metricRegistry = new MetricRegistry(); StorageManagerMetrics metrics = new StorageManagerMetrics(metricRegistry); blobStore = new MockBlobStore("", config, null, null, metrics, null, 0, null, null, null, time); blobStore.capacityInBytes = CAPACITY_IN_BYTES; blobStore.start(); compactionManager = new CompactionManager(config); blobStore.usedCapacity = CAPACITY_IN_BYTES * 6 / 10; blobStore.validLogSegments = generateRandomString(2); verifyCompactionDetails(null); } minLogSizeToTriggerCompactionInPercentages = new int[]{10, 20, 35, 40, 50, 59}; for (int minLogSize : minLogSizeToTriggerCompactionInPercentages) { properties.setProperty("store.min.log.size.to.trigger.compaction.in.percent", String.valueOf(minLogSize)); StoreConfig config = new StoreConfig(new VerifiableProperties(properties)); MetricRegistry metricRegistry = new MetricRegistry(); StorageManagerMetrics metrics = new StorageManagerMetrics(metricRegistry); blobStore = new MockBlobStore("", config, null, null, metrics, null, 0, null, null, null, time); blobStore.capacityInBytes = CAPACITY_IN_BYTES; blobStore.start(); compactionManager = new CompactionManager(config); blobStore.usedCapacity = CAPACITY_IN_BYTES * 6 / 10; blobStore.validLogSegments = generateRandomString(2); verifyCompactionDetails(new CompactionDetails(blobStore.getTime().milliseconds() - messageRetentionTimeInMs, blobStore.validLogSegments)); } }

Target:
public void testDifferentThresholdsForMinLogSizeToCompact() throws StoreException { int[] minLogSizeToTriggerCompactionInPercentages = new int[]{10, 20, 35, 40, 50, 59, 60, 61, 65, 70, 80, 95}; for (int minLogSize : minLogSizeToTriggerCompactionInPercentages) { properties.setProperty("store.min.log.size.to.trigger.compaction.in.percent", String.valueOf(minLogSize)); config = new StoreConfig(new VerifiableProperties(properties)); MetricRegistry metricRegistry = new MetricRegistry(); StorageManagerMetrics metrics = new StorageManagerMetrics(metricRegistry); blobStore = new MockBlobStore(config, metrics, time, CAPACITY_IN_BYTES, DEFAULT_USED_CAPACITY_IN_BYTES); compactionManager = new CompactionManager(config, time); blobStore.validLogSegments = generateRandomStrings(2); if (blobStore.usedCapacity < (config.storeMinUsedCapacityToTriggerCompactionInPercentage / 100.0 * blobStore.capacityInBytes)) { verifyCompactionDetails(null); } else { verifyCompactionDetails( new CompactionDetails(time.milliseconds() - messageRetentionTimeInMs, blobStore.validLogSegments)); } } }
Source:
public void anonCanLogInViaUserLoginPage() { WikiBasePageObject base = new WikiBasePageObject(); base.openSpecialUpload(wikiURL); base.verifyLoginRequiredMessage(); base.clickLoginOnSpecialPage(); new AttachedSignInPage().login(credentials.userName10, credentials.password10); base.verifyUserLoggedIn(credentials.userName10); Assertion.assertTrue(base.isStringInURL(URLsContent.SPECIAL_UPLOAD)); }

Target:
public void anonCanLogInViaUserLoginPage() { WikiBasePageObject base = new WikiBasePageObject(); base.openSpecialUpload(wikiURL); base.verifyLoginRequiredMessage(); base.clickLoginOnSpecialPage(); new AttachedSignInPage().login(credentials.userName10, credentials.password10); base.verifyUserLoggedIn(credentials.userName10); assertTrue(base.isStringInURL(URLsContent.SPECIAL_UPLOAD)); }
Source:
private String getCachedImgTag(int id){ if(!GUIPreferences.getInstance().getBoolean(GUIPreferences.ADVANCED_ROUND_REPORT_SPRITES) || imgCache == null || !imgCache.containsKey(id)) { return null; } return imgCache.get(id); }

Target:
private String getCachedImgTag(int id){ if (!GUIPreferences.getInstance().getBoolean(GUIPreferences.ADVANCED_ROUND_REPORT_SPRITES) || (imgCache == null) || !imgCache.containsKey(id)) { return null; } return imgCache.get(id); }
Source:
private void forcedLoadAlbums(){ Account account = userManager.getActiveAccount().getValue(); if (albumsSubscription != null) { albumsSubscription.unsubscribe(); albumsSubscription = null; } if (photosSubscription != null) { photosSubscription.unsubscribe(); photosSubscription = null; } if (account != null) { albumsSubscription = categoriesRepository.getCategories(account, category, preferencesRepository.getStringPreference(PreferencesRepository.KEY_PREF_THUMBNAIL_SIZE, "medium")) .subscribe(new CategoriesSubscriber()); photosSubscription = imageRepository.getImages(account, category) .subscribe(new ImagesSubscriber()); } }

Target:
private void forcedLoadAlbums(){ Account account = userManager.getActiveAccount().getValue(); if (albumsSubscription != null) { albumsSubscription.unsubscribe(); albumsSubscription = null; } if (photosSubscription != null) { photosSubscription.unsubscribe(); photosSubscription = null; } if (account != null) { albumsSubscription = categoriesRepository.getCategories(account, category, preferences.getString(PreferencesRepository.KEY_PREF_DOWNLOAD_SIZE)) .subscribe(new CategoriesSubscriber()); photosSubscription = imageRepository.getImages(account, category) .subscribe(new ImagesSubscriber()); } }
Source:
public Client(InetSocketAddress address){ nwc.startListeningOnAnyAvailablePort(); nwc.addPeer(address); send(new ConnectEvent(isSpectator())); playerId = -1; timer = new SimulationTimer(); timer.addListener(this); timer.start(); }

Target:
public Client(InetSocketAddress address){ nwc.startListeningOnAnyAvailablePort(); nwc.addPeer(address); send(new ConnectEvent(isSpectator())); playerId = -1; }
Source:
public void editDefaultAuthenticationContext() throws Exception { final Address authenticationContextAddress = createAuthenticationContext(); final SnapshotBackup snapshotBackup = new SnapshotBackup(); client.apply(snapshotBackup.backup()); try { page.navigate(); new ConfigChecker.Builder(client, ElytronOperations.getElytronSubsystemAddress()) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.TEXT, DEFAULT_AUTHENTICATION_CONTEXT, authenticationContextAddress.getLastPairValue()) .verifyFormSaved() .verifyAttribute(DEFAULT_AUTHENTICATION_CONTEXT, authenticationContextAddress.getLastPairValue()); } finally { client.apply(snapshotBackup.restore()); } }

Target:
public void editDefaultAuthenticationContext() throws Exception { final Address authenticationContextAddress = createAuthenticationContext(); try { elytronAuthenticationOperations.performActionOnAttributeAndRevertItsValueToOriginal( ElytronOperations.getElytronSubsystemAddress(), DEFAULT_AUTHENTICATION_CONTEXT, () -> { page.navigate(); new ConfigChecker.Builder(client, ElytronOperations.getElytronSubsystemAddress()) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.TEXT, DEFAULT_AUTHENTICATION_CONTEXT, authenticationContextAddress.getLastPairValue()) .verifyFormSaved() .verifyAttribute(DEFAULT_AUTHENTICATION_CONTEXT, authenticationContextAddress.getLastPairValue()); } ); } finally { ops.removeIfExists(authenticationContextAddress); } }
Source:
public ImmutableSet<ColumnName> columnNames() { return ImmutableSet.copyOf(storageFields.keySet()); }

Target:
public final ImmutableSet<ColumnName> columnNames() { return ImmutableSet.copyOf(storageFields.keySet()); }
Source:
private CRPluggableScmMaterial pluggableScmMaterialConfigToCRPluggableScmMaterial(PluggableSCMMaterialConfig pluggableScmMaterialConfig) { SCMs scms = getSCMs(); String id = pluggableScmMaterialConfig.getScmId(); SCM scmConfig = scms.find(id); if (scmConfig == null) throw new ConfigConvertionException( String.format("Failed to find referenced scm '%s'", id)); return new CRPluggableScmMaterial(pluggableScmMaterialConfig.getName().toString(), id, pluggableScmMaterialConfig.getFolder(), pluggableScmMaterialConfig.getFilterAsString()); }

Target:
private CRPluggableScmMaterial pluggableScmMaterialConfigToCRPluggableScmMaterial(PluggableSCMMaterialConfig pluggableScmMaterialConfig) { SCMs scms = getSCMs(); String id = pluggableScmMaterialConfig.getScmId(); SCM scmConfig = scms.find(id); if (scmConfig == null) throw new ConfigConvertionException( String.format("Failed to find referenced scm '%s'", id)); return new CRPluggableScmMaterial(pluggableScmMaterialConfig.getName().toString(), id, pluggableScmMaterialConfig.getFolder(), pluggableScmMaterialConfig.filter().ignoredFileNames()); }
Source:
public void testRunHook() throws Exception { assumeSupportedPlatform(); writeHookFile(PreCommitHook.NAME, "#!/bin/sh\necho \"test $1 $2\"\nread INPUT\necho $INPUT\necho $GIT_DIR\necho $GIT_WORK_TREE\necho 1>&2 \"stderr\""); ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream err = new ByteArrayOutputStream(); ProcessResult res = FS.DETECTED.runHookIfPresent(db, PreCommitHook.NAME, new String[] { "arg1", "arg2" }, new PrintStream(out), new PrintStream(err), "stdin"); assertEquals("unexpected hook output", "test arg1 arg2\nstdin\n" + db.getDirectory().getAbsolutePath() + '\n' + db.getWorkTree().getAbsolutePath() + '\n', out.toString("UTF-8")); assertEquals("unexpected output on stderr stream", "stderr\n", err.toString("UTF-8")); assertEquals("unexpected exit code", 0, res.getExitCode()); assertEquals("unexpected process status", ProcessResult.Status.OK, res.getStatus()); }

Target:
public void testRunHook() throws Exception { assumeSupportedPlatform(); writeHookFile(PreCommitHook.NAME, "#!/bin/sh\necho \"test $1 $2\"\nread INPUT\necho $INPUT\n" + "echo $GIT_DIR\necho $GIT_WORK_TREE\necho 1>&2 \"stderr\""); ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream err = new ByteArrayOutputStream(); ProcessResult res = FS.DETECTED.runHookIfPresent(db, PreCommitHook.NAME, new String[] { "arg1", "arg2" }, new PrintStream(out), new PrintStream(err), "stdin"); assertEquals("unexpected hook output", "test arg1 arg2\nstdin\n" + db.getDirectory().getAbsolutePath() + '\n' + db.getWorkTree().getAbsolutePath() + '\n', out.toString("UTF-8")); assertEquals("unexpected output on stderr stream", "stderr\n", err.toString("UTF-8")); assertEquals("unexpected exit code", 0, res.getExitCode()); assertEquals("unexpected process status", ProcessResult.Status.OK, res.getStatus()); }
Source:
public static double[] reorderedCopy(double[] values, int[] positions) { int len1 = positions.length; if (len1 != values.length) { throw new IllegalArgumentException("Value array cannot be reordered as they differ in length"); } double[] result = new double[len1]; for (int i = 0; i < len1; i++) { int key = positions[i]; ArgChecker.inRange(key, 0, len1, "key must be in range: 0 <= key < length"); result[i] = values[key]; } return result; }

Target:
public static double[] reorderedCopy(double[] values, int[] positions) { int len1 = positions.length; if (len1 != values.length) { throw new IllegalArgumentException("Value array cannot be reordered as they differ in length"); } double[] result = new double[len1]; for (int i = 0; i < len1; i++) { int key = positions[i]; ArgChecker.inRange(key, 0, len1, "key"); result[i] = values[key]; } return result; }
Source:
public static final boolean isTreeTable(final TableConfiguration tableConfiguration) { TableDisplayStyle style = (TableDisplayStyle) tableConfiguration.getStyle(NattablestylePackage.eINSTANCE.getTableDisplayStyle()); if (style != null) { final DisplayStyle displayStyle = style.getDisplayStyle(); return DisplayStyle.HIERARCHIC_MULTI_TREE_COLUMN.equals(displayStyle) || DisplayStyle.HIERARCHIC_SINGLE_TREE_COLUMN.equals(displayStyle); } return false; }

Target:
public static final boolean isTreeTable(final TableConfiguration tableConfiguration) { final TableDisplayStyle style = (TableDisplayStyle) tableConfiguration.getStyle(NattablestylePackage.eINSTANCE.getTableDisplayStyle()); if (null != style) { final DisplayStyle displayStyle = style.getDisplayStyle(); return DisplayStyle.HIERARCHIC_MULTI_TREE_COLUMN.equals(displayStyle) || DisplayStyle.HIERARCHIC_SINGLE_TREE_COLUMN.equals(displayStyle); } return false; }
Source:
protected long getCommitSize() { ConfigurationService configurationService = Framework.getService(ConfigurationService.class); String commitSize = configurationService.getProperty(DEFAULT_COMMIT_SIZE_PROP); if (commitSize == null) { return DEFAULT_COMMIT_SIZE; } try { return Long.parseLong(commitSize); } catch (NumberFormatException e) { log.error("Invalid configuration property " + DEFAULT_COMMIT_SIZE_PROP, e); return DEFAULT_COMMIT_SIZE; } }

Target:
protected long getCommitSize() { ConfigurationService configurationService = Framework.getService(ConfigurationService.class); String commitSize = configurationService.getProperty(DEFAULT_COMMIT_SIZE_PROP); if (StringUtils.isBlank(commitSize)) { return DEFAULT_COMMIT_SIZE; } try { return Long.parseLong(commitSize); } catch (NumberFormatException e) { log.error("Invalid configuration property " + DEFAULT_COMMIT_SIZE_PROP, e); return DEFAULT_COMMIT_SIZE; } }
Source:
public MultiMapContainer(String name, MultiMapService service, int partitionId) { super(name, service.getNodeEngine()); this.partitionId = partitionId; this.lockNamespace = new DistributedObjectNamespace(MultiMapService.SERVICE_NAME, name); LockService lockService = nodeEngine.getSharedService(LockService.SERVICE_NAME); this.lockStore = lockService == null ? null : lockService.createLockStore(partitionId, lockNamespace); this.creationTime = currentTimeMillis(); this.objectNamespace = new DistributedObjectNamespace(MultiMapService.SERVICE_NAME, name); this.size = new AtomicInteger(0); }

Target:
public MultiMapContainer(String name, MultiMapService service, int partitionId) { super(name, service.getNodeEngine()); this.partitionId = partitionId; this.lockNamespace = new DistributedObjectNamespace(MultiMapService.SERVICE_NAME, name); LockService lockService = nodeEngine.getSharedService(LockService.SERVICE_NAME); this.lockStore = lockService == null ? null : lockService.createLockStore(partitionId, lockNamespace); this.creationTime = currentTimeMillis(); this.objectNamespace = new DistributedObjectNamespace(MultiMapService.SERVICE_NAME, name); }
Source:
protected static void updateLocalDisksUsage(VDS vds, Map<String, Object> xmlRpcStruct) { if (xmlRpcStruct.containsKey(VdsProperties.DISK_STATS)) { Map<String, Object> diskStatsStruct = (Map<String, Object>) xmlRpcStruct.get(VdsProperties.DISK_STATS); Map<String, Long> diskStats = new HashMap<>(); vds.setLocalDisksUsage(diskStats); diskStatsStruct.entrySet() .stream() .forEach(entry -> diskStats.put(entry.getKey(), assignLongValue((Map<String, Object>) entry.getValue(), VdsProperties.DISK_STATS_FREE))); } }

Target:
protected static void updateLocalDisksUsage(VDS vds, Map<String, Object> xmlRpcStruct) { if (xmlRpcStruct.containsKey(VdsProperties.DISK_STATS)) { Map<String, Object> diskStatsStruct = (Map<String, Object>) xmlRpcStruct.get(VdsProperties.DISK_STATS); Map<String, Long> diskStats = diskStatsStruct.entrySet() .stream() .collect(Collectors.toMap(Entry::getKey, e -> assignLongValue((Map<String, Object>) e.getValue(), VdsProperties.DISK_STATS_FREE))); vds.setLocalDisksUsage(diskStats); } }
Source:
public void checkConstruction() { ConfigureISODatesInJson testInstance = new ConfigureISODatesInJson(); Assert.assertEquals("ConfigureISODatesInJson", testInstance.getName()); Assert.assertTrue(testInstance.getEvents().get(0).getClass() == ApplicationStartedEvent.class); }

Target:
public void checkConstruction() throws ComponentLookupException { EventListener testInstance = this.mocker.getComponentUnderTest(); Assert.assertEquals("ConfigureISODatesInJson", testInstance.getName()); Assert.assertThat(testInstance.getEvents(), hasItem(isA(ApplicationStartedEvent.class))); }
Source:
public Response migrate(Action action) { validateParameters(action, "bricks"); GlusterVolumeRemoveBricksParameters params = toParameters(action); return performAction(VdcActionType.StartRemoveGlusterVolumeBricks, params, action, false); }

Target:
public Response migrate(Action action) { validateParameters(action, "bricks"); validateBrickNames(action); GlusterVolumeRemoveBricksParameters params = toParameters(action); return performAction(VdcActionType.StartRemoveGlusterVolumeBricks, params, action, false); }
Source:
private Boolean checkProblemValue() { final SWTBotView problemViewBot = bot.viewByTitle("Problems"); problemViewBot.setFocus(); final SWTBotTree problemTree = problemViewBot.bot().tree(); bot.waitUntil(new ICondition() { public boolean test() throws Exception { return (problemViewBot.isActive()) && (problemTree.getAllItems().length == 1); } public void init(SWTBot bot) { } public String getFailureMessage() { return "Problems view is not active."; } }); String errorMessage = "\"Group > emptyName > diagTest > Default > \" is not a valid name, it must be different of empty or null."; for (SWTBotTreeItem item : problemTree.getAllItems()) { item.expand(); for (String itemMessage : item.getNodes()) { if (errorMessage.equals(itemMessage)) { return true; } } } return false; }

Target:
private Boolean checkProblemValue() { final SWTBotView problemViewBot = bot.viewByTitle("Problems"); problemViewBot.setFocus(); final SWTBotTree problemTree = problemViewBot.bot().tree(); bot.waitUntil(new ICondition() { public boolean test() throws Exception { return (problemViewBot.isActive()) && (problemTree.getAllItems().length == 1); } public void init(SWTBot bot) { } public String getFailureMessage() { return "Problems view is not active."; } }); for (SWTBotTreeItem item : problemTree.getAllItems()) { item.expand(); for (String itemMessage : item.getNodes()) { if (errorMessage.equals(itemMessage)) { return true; } } } return false; }
Source:
public void sendsRequestDirectly() throws Exception { final MkContainer container = new MkGrizzlyContainer() .next( new MkAnswer.Simple( HttpURLConnection.HTTP_OK, LastModifiedCachingWireTest.BODY ) ).next( new MkAnswer.Simple( HttpURLConnection.HTTP_OK, LastModifiedCachingWireTest.BODY ) ) .start(); try { final Request req = new JdkRequest(container.home()) .through(LastModifiedCachingWire.class).header( HttpHeaders.IF_MODIFIED_SINCE, "Fri, 01 Jan 2016 00:00:00 GMT" ); for (int idx = 0; idx < 2; idx = idx + 1) { req.fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .assertBody( Matchers.equalTo(LastModifiedCachingWireTest.BODY) ); } MatcherAssert.assertThat(container.queries(), Matchers.equalTo(2)); } finally { container.stop(); } }

Target:
public void sendsRequestDirectly() throws Exception { final MkContainer container = new MkGrizzlyContainer() .next( new MkAnswer.Simple( HttpURLConnection.HTTP_OK, LastModifiedCachingWireTest.BODY ) ) .next( new MkAnswer.Simple( HttpURLConnection.HTTP_OK, LastModifiedCachingWireTest.BODY ) ) .start(); try { final Request req = new JdkRequest(container.home()) .through(LastModifiedCachingWire.class).header( HttpHeaders.IF_MODIFIED_SINCE, "Fri, 01 Jan 2016 00:00:00 GMT" ); for (int idx = 0; idx < 2; ++idx) { req.fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .assertBody( Matchers.equalTo(LastModifiedCachingWireTest.BODY) ); } MatcherAssert.assertThat(container.queries(), Matchers.equalTo(2)); } finally { container.stop(); } }
Source:
public DescribableList<NodeProperty<?>, NodePropertyDescriptor> getNodeProperties() { return Objects.requireNonNull(nodeProperties); }

Target:
public DescribableList<NodeProperty<?>, NodePropertyDescriptor> getNodeProperties() { if (nodeProperties == null) throw new IllegalStateException(); return nodeProperties; }
Source:
private boolean InternalCanDoAction() { boolean returnValue = false; try { Transaction transaction = TransactionSupport.suspend(); try { returnValue = IsUserAutorizedToRunAction() && IsBackwardsCompatible() && validateInputs() && acquireLock() && canDoAction(); if (this instanceof Quotable) { returnValue &= ((Quotable) this).validateAndSetQuota(); } if (!returnValue && getReturnValue().getCanDoActionMessages().size() > 0) { log.warnFormat("CanDoAction of action {0} failed. Reasons:{1}", getActionType(), StringHelper.aggregate(getReturnValue().getCanDoActionMessages(), ',')); } } finally { TransactionSupport.resume(transaction); } } catch (DataAccessException dataAccessEx) { log.error("Data access error during CanDoActionFailure.", dataAccessEx); addCanDoActionMessage(VdcBllMessages.CAN_DO_ACTION_DATABASE_CONNECTION_FAILURE); } catch (RuntimeException ex) { log.error("Error during CanDoActionFailure.", ex); addCanDoActionMessage(VdcBllMessages.CAN_DO_ACTION_GENERAL_FAILURE); } finally { if (!returnValue) { freeLock(); } } return returnValue; }

Target:
private boolean InternalCanDoAction() { boolean returnValue = false; try { Transaction transaction = TransactionSupport.suspend(); try { returnValue = IsUserAutorizedToRunAction() && IsBackwardsCompatible() && validateInputs() && acquireLock() && canDoAction(); if (this instanceof Quotable) { returnValue &= ((Quotable) this).validateAndSetQuota(); } if (!returnValue && getReturnValue().getCanDoActionMessages().size() > 0) { log.warnFormat("CanDoAction of action {0} failed. Reasons:{1}", getActionType(), StringUtils.join(getReturnValue().getCanDoActionMessages(), ',')); } } finally { TransactionSupport.resume(transaction); } } catch (DataAccessException dataAccessEx) { log.error("Data access error during CanDoActionFailure.", dataAccessEx); addCanDoActionMessage(VdcBllMessages.CAN_DO_ACTION_DATABASE_CONNECTION_FAILURE); } catch (RuntimeException ex) { log.error("Error during CanDoActionFailure.", ex); addCanDoActionMessage(VdcBllMessages.CAN_DO_ACTION_GENERAL_FAILURE); } finally { if (!returnValue) { freeLock(); } } return returnValue; }
Source:
public void stateUpdated(Item item, State state) { setState(function.calculate(members)); setGroupState(new GroupType(item.getName(),GroupChange.CHANGED)); }

Target:
public void stateUpdated(Item item, State state) { State oldState = this.state; setState(function.calculate(members)); if (!oldState.equals(this.state)) { sendGroupStateChangedEvent(item.getName(), this.state, oldState); } }
Source:
public void itCanFireWorkFailureEvent() throws Exception { int initCount = DummyPostCommitEventListener.handledCount(); int initEvtCount = DummyPostCommitEventListener.eventCount(); int initSyncEvntCount = WorkFailureEventListener.getCount(); int duration = 2000; SleepAndFailWork work = new SleepAndFailWork(0, false); service.schedule(work); assertTrue(service.awaitCompletion(duration * 3, TimeUnit.MILLISECONDS)); assertEquals(1 + initSyncEvntCount, WorkFailureEventListener.getCount()); EventService eventService = Framework.getService(EventService.class); eventService.waitForAsyncCompletion(); assertEquals(1 + initCount, DummyPostCommitEventListener.handledCount()); assertEquals(1 + initEvtCount, DummyPostCommitEventListener.eventCount()); }

Target:
public void itCanFireWorkFailureEvent() throws Exception { int initCount = DummyPostCommitEventListener.handledCount(); int initEvtCount = DummyPostCommitEventListener.eventCount(); int initSyncEvntCount = WorkFailureEventListener.getCount(); int duration = 2000; SleepAndFailWork work = new SleepAndFailWork(0, false); service.schedule(work); assertTrue(service.awaitCompletion(duration * 3, TimeUnit.MILLISECONDS)); assertEquals(1 + initSyncEvntCount, WorkFailureEventListener.getCount()); eventService.waitForAsyncCompletion(); assertEquals(1 + initCount, DummyPostCommitEventListener.handledCount()); assertEquals(1 + initEvtCount, DummyPostCommitEventListener.eventCount()); }
Source:
public DockerSSLConfig(String caPem, String keyPem, String certPem) { try { Security.addProvider(new BouncyCastleProvider()); String e = System.getProperty("https.protocols"); System.setProperty("https.protocols", "TLSv1"); sslConfig = SslConfigurator.newInstance(true); if (e != null) { System.setProperty("https.protocols", e); } sslConfig.keyStore(CertificateUtils.createKeyStore(keyPem, certPem)); sslConfig.keyStorePassword("docker"); sslConfig.trustStore(CertificateUtils.createTrustStore(caPem)); } catch (Exception e) { ClientLogger logger = new ClientLogger(getClass()); throw logger.logExceptionAsError(new DockerClientException(e.getMessage(), e)); } }

Target:
public DockerSSLConfig(String caPem, String keyPem, String certPem) { try { Security.addProvider(new BouncyCastleProvider()); String e = System.getProperty("https.protocols"); System.setProperty("https.protocols", "TLSv1"); sslConfig = SslConfigurator.newInstance(true); if (e != null) { System.setProperty("https.protocols", e); } sslConfig.keyStore(CertificateUtils.createKeyStore(keyPem, certPem)); sslConfig.keyStorePassword("docker"); sslConfig.trustStore(CertificateUtils.createTrustStore(caPem)); } catch (Exception e) { throw new DockerClientException(e.getMessage(), e); } }
Source:
public static String getDefaultLogFileCount() { return LOG_FILE_NUM_STRING; }

Target:
public static int getDefaultLogFileCount() { return LOG_FILE_NUM_INT; }