auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void start() { URI restApiUri = restApiUri( ); webServer.addFilter( new CollectUserAgentFilter( clientNames() ), "/*", Collections.emptyMap() ); webServer.addFilter( new CorsFilter( logProvider ), "/*", Collections.singletonMap( "access_control_allow_origin", config.get( access_control_allow_origin ) ) ); webServer.addJAXRSClasses( getClassNames(), restApiUri.toString(), null ); loadPlugins(); }

Target:
public void start() { URI restApiUri = restApiUri( ); webServer.addFilter( new CollectUserAgentFilter( clientNames() ), "/*" ); webServer.addFilter( new CorsFilter( logProvider, config.get( http_access_control_allow_origin ) ), "/*" ); webServer.addJAXRSClasses( getClassNames(), restApiUri.toString(), null ); loadPlugins(); }
Source:
public String getDefaultQuotaName(storage_pool storagePool) { List<Quota> quotaList = getQuotaDAO().getQuotaByStoragePoolGuid(storagePool.getId()); String quotaDefaultName = "Quota_Def_" + storagePool.getname(); String regexToolPattern = quotaDefaultName + "_[0-9]{1,}$"; Integer suffixQuotaName = 0; for (Quota quota : quotaList) { String quotaName = quota.getQuotaName(); if (quotaName.contains(quotaDefaultName) && (quotaName.length() == quotaDefaultName.length() && suffixQuotaName == 0)) { suffixQuotaName = 1; } else if (quotaName.matches(regexToolPattern)) { String defaultQuotaString = quotaName.substring(quotaName.lastIndexOf("_") + 1); Integer defaultQuotaNumber = new Integer(defaultQuotaString); if (suffixQuotaName < defaultQuotaNumber.intValue()) { suffixQuotaName = defaultQuotaNumber.intValue() + 1; } } } return (suffixQuotaName > 0) ? quotaDefaultName + "_" + suffixQuotaName.toString() : quotaDefaultName; }

Target:
public String getDefaultQuotaName(storage_pool storagePool) { List<Quota> quotaList = getQuotaDAO().getQuotaByStoragePoolGuid(storagePool.getId()); String quotaDefaultName = "Quota_Def_" + storagePool.getname(); String regexToolPattern = quotaDefaultName + "_[0-9]{1,}$"; Integer suffixQuotaName = 0; for (Quota quota : quotaList) { String quotaName = quota.getQuotaName(); if (quotaName.contains(quotaDefaultName) && (quotaName.length() == quotaDefaultName.length() && suffixQuotaName == 0)) { suffixQuotaName = 1; } else if (quotaName.matches(regexToolPattern)) { String defaultQuotaString = quotaName.substring(quotaName.lastIndexOf("_") + 1); Integer defaultQuotaNumber = new Integer(defaultQuotaString); if (suffixQuotaName < defaultQuotaNumber.intValue()) { suffixQuotaName = defaultQuotaNumber.intValue() + 1; } } } return (suffixQuotaName > 0) ? String.format("%1$s_%2$s", quotaDefaultName, suffixQuotaName.toString()) : quotaDefaultName; }
Source:
public Map<String, CacheInfo> apply(ConfigResource rsrc) { Map<String, CacheInfo> cacheInfos = new TreeMap<>(); for (Map.Entry<String, Cache<?,?>> entry : getCaches().entrySet()) { cacheInfos.put(entry.getKey(), new CacheInfo(entry.getValue())); } return cacheInfos; }

Target:
public Map<String, CacheInfo> apply(ConfigResource rsrc) { Map<String, CacheInfo> cacheInfos = new TreeMap<>(); for (DynamicMap.Entry<Cache<?, ?>> e : cacheMap) { cacheInfos.put(cacheNameOf(e.getPluginName(), e.getExportName()), new CacheInfo(e.getProvider().get())); } return cacheInfos; }
Source:
public void testHighLevelApi() throws Exception { Random random = new Random(); int count = 10; List<PageView> pageviews = new ArrayList<>(count); Map<Integer, List<PageView>> expectedOutput = new HashMap<>(); for (int i = 0; i < count; i++) { String pagekey = PAGEKEYS[random.nextInt(PAGEKEYS.length - 1)]; int memberId = i; PageView pv = new PageView(pagekey, memberId); pageviews.add(pv); expectedOutput.put(i, new ArrayList<PageView>()); expectedOutput.get(i).add(pv); } CollectionStream<PageView> input = CollectionStream.of("test", "PageView", pageviews); CollectionStream output = CollectionStream.empty("test", "Output", 10); TestRunner .of(pageViewParition) .addInputStream(input) .addOutputStream(output) .addOverrideConfig("job.default.system", "test") .run(Duration.ofMillis(1500)); Assert.assertEquals(TestRunner.consumeStream(output, Duration.ofMillis(1000)).get(random.nextInt(count)).size(), 1); }

Target:
public void testHighLevelApi() throws Exception { Random random = new Random(); int count = 10; List<PageView> pageviews = new ArrayList<>(count); Map<Integer, List<PageView>> expectedOutput = new HashMap<>(); for (int i = 0; i < count; i++) { String pagekey = PAGEKEYS[random.nextInt(PAGEKEYS.length - 1)]; int memberId = i; PageView pv = new PageView(pagekey, memberId); pageviews.add(pv); } CollectionStream<PageView> input = CollectionStream.of("test", "PageView", pageviews); CollectionStream output = CollectionStream.empty("test", "Output", 10); TestRunner .of(pageViewParition) .addInputStream(input) .addOutputStream(output) .addOverrideConfig("job.default.system", "test") .run(Duration.ofMillis(1500)); Assert.assertEquals(TestRunner.consumeStream(output, Duration.ofMillis(1000)).get(random.nextInt(count)).size(), 1); }
Source:
public static void resetConnectionAfterTransaction( Connection con, @Nullable Integer previousIsolationLevel, boolean resetReadOnly) { Assert.notNull(con, "No Connection specified"); final boolean debugEnabled = logger.isDebugEnabled(); try { if (previousIsolationLevel != null) { if (debugEnabled) { logger.debug("Resetting isolation level of JDBC Connection [" + con + "] to " + previousIsolationLevel); } con.setTransactionIsolation(previousIsolationLevel); } if (resetReadOnly) { if (debugEnabled) { logger.debug("Resetting read-only flag of JDBC Connection [" + con + "]"); } con.setReadOnly(false); } } catch (Throwable ex) { logger.debug("Could not reset JDBC Connection after transaction", ex); } }

Target:
public static void resetConnectionAfterTransaction( Connection con, @Nullable Integer previousIsolationLevel, boolean resetReadOnly) { Assert.notNull(con, "No Connection specified"); boolean debugEnabled = logger.isDebugEnabled(); try { if (previousIsolationLevel != null) { if (debugEnabled) { logger.debug("Resetting isolation level of JDBC Connection [" + con + "] to " + previousIsolationLevel); } con.setTransactionIsolation(previousIsolationLevel); } if (resetReadOnly) { if (debugEnabled) { logger.debug("Resetting read-only flag of JDBC Connection [" + con + "]"); } con.setReadOnly(false); } } catch (Throwable ex) { logger.debug("Could not reset JDBC Connection after transaction", ex); } }
Source:
public void trackVideoSeek(String videoId, Double oldTime, Double newTime, String courseId, String unitUrl, Boolean skipSeek) { final FirebaseEvent event = new FirebaseEvent(Events.SEEK_VIDEO, videoId, Values.VIDEO_SEEKED); event.setCourseContext(courseId, unitUrl, Values.VIDEOPLAYER); oldTime = JavaUtil.formatDoubleValue(oldTime, 3); newTime = JavaUtil.formatDoubleValue(newTime, 3); Double skipInterval = newTime - oldTime; skipInterval = JavaUtil.formatDoubleValue(skipInterval, 3); event.putDouble(Keys.OLD_TIME, oldTime); event.putDouble(Keys.NEW_TIME, newTime); if (skipSeek) { event.putString(Keys.SEEK_TYPE, Values.SKIP); } else { event.putString(Keys.SEEK_TYPE, Values.SLIDE); } event.putDouble(Keys.REQUESTED_SKIP_INTERVAL, skipInterval); tracker.logEvent(event.getName(), event.getBundle()); ; }

Target:
public void trackVideoSeek(String videoId, Double oldTime, Double newTime, String courseId, String unitUrl, Boolean skipSeek) { final FirebaseEvent event = new FirebaseEvent(Events.SEEK_VIDEO, videoId, Values.VIDEO_SEEKED); event.setCourseContext(courseId, unitUrl, Values.VIDEOPLAYER); oldTime = JavaUtil.formatDoubleValue(oldTime, 3); newTime = JavaUtil.formatDoubleValue(newTime, 3); Double skipInterval = newTime - oldTime; skipInterval = JavaUtil.formatDoubleValue(skipInterval, 3); event.putDouble(Keys.OLD_TIME, oldTime); event.putDouble(Keys.NEW_TIME, newTime); if (skipSeek) { event.putString(Keys.SEEK_TYPE, Values.SKIP); } else { event.putString(Keys.SEEK_TYPE, Values.SLIDE); } event.putDouble(Keys.REQUESTED_SKIP_INTERVAL, skipInterval); tracker.logEvent(event.getName(), event.getBundle()); }
Source:
private SurfaceMetadata updateSurfaceMetadata(SurfaceMetadata surfaceMetadata, Set<DoublesPair> pairs) { List<SurfaceParameterMetadata> sortedMetaList = new ArrayList<SurfaceParameterMetadata>(); if (surfaceMetadata.getParameterMetadata().isPresent()) { List<SurfaceParameterMetadata> metaList = new ArrayList<SurfaceParameterMetadata>(surfaceMetadata.getParameterMetadata().get()); for (DoublesPair pair : pairs) { metadataLoop: for (SurfaceParameterMetadata parameterMetadata : metaList) { ArgChecker.isTrue(parameterMetadata instanceof SwaptionSurfaceExpiryTenorNodeMetadata, "Surface parameter metadata must be instance of SwaptionVolatilitySurfaceExpiryTenorNodeMetadata"); SwaptionSurfaceExpiryTenorNodeMetadata casted = (SwaptionSurfaceExpiryTenorNodeMetadata) parameterMetadata; if (pair.getFirst() == casted.getYearFraction() && pair.getSecond() == casted.getTenor()) { sortedMetaList.add(casted); metaList.remove(parameterMetadata); break metadataLoop; } } } ArgChecker.isTrue(metaList.size() == 0, "Mismatch between surface parameter metadata list and doubles pair list"); } else { for (DoublesPair pair : pairs) { SwaptionSurfaceExpiryTenorNodeMetadata parameterMetadata = SwaptionSurfaceExpiryTenorNodeMetadata.of(pair.getFirst(), pair.getSecond()); sortedMetaList.add(parameterMetadata); } } return surfaceMetadata.withParameterMetadata(sortedMetaList); }

Target:
private SurfaceMetadata updateSurfaceMetadata(SurfaceMetadata surfaceMetadata, Set<DoublesPair> pairs) { List<SurfaceParameterMetadata> orderedMetaList = new ArrayList<SurfaceParameterMetadata>(); if (surfaceMetadata.getParameterMetadata().isPresent()) { List<SurfaceParameterMetadata> metaList = new ArrayList<SurfaceParameterMetadata>(surfaceMetadata.getParameterMetadata().get()); for (DoublesPair pair : pairs) { metadataLoop: for (SurfaceParameterMetadata parameterMetadata : metaList) { ArgChecker.isTrue(parameterMetadata instanceof SwaptionSurfaceExpiryTenorNodeMetadata, "Surface parameter metadata must be instance of SwaptionVolatilitySurfaceExpiryTenorNodeMetadata"); SwaptionSurfaceExpiryTenorNodeMetadata casted = (SwaptionSurfaceExpiryTenorNodeMetadata) parameterMetadata; if (pair.getFirst() == casted.getYearFraction() && pair.getSecond() == casted.getTenor()) { orderedMetaList.add(casted); metaList.remove(parameterMetadata); break metadataLoop; } } } ArgChecker.isTrue(metaList.size() == 0, "Mismatch between surface parameter metadata list and doubles pair list"); } else { orderedMetaList = pairs.stream() .map(pair -> SwaptionSurfaceExpiryTenorNodeMetadata.of(pair.getFirst(), pair.getSecond())) .collect(toImmutableList()); } return surfaceMetadata.withParameterMetadata(orderedMetaList); }
Source:
public String getEscapedReplacement() { return escapedReplacement; }

Target:
String getEscapedReplacement() { return escapedReplacement; }
Source:
private void checkValid(String input, String errorMessage) throws InternalInfrastructureException { if (!namePattern.matcher(input).matches()) { throw new InternalInfrastructureException(format(errorMessage, input)); } }

Target:
private void checkValid(String input, String errorMessage) throws ValidationException { if (!namePattern.matcher(input).matches()) { throw new ValidationException(format(errorMessage, input)); } }
Source:
private boolean checkFilterParams() throws BadArgumentException { if (Guard.isMapNullOrEmpty(this.filterParams)) { return true; } final ImmutableList<String> legalParams = ImmutableList.of(CONTAINS, OWNER, NEWERTHAN, OLDERTHAN, LARGERTHAN, SMALLERTHAN); for (final String paramName : this.filterParams.keySet()) { if (!legalParams.contains(paramName)) { throw new BadArgumentException("Unknown filter parameter: " + paramName); } } return true; }

Target:
private void checkFilterParams() throws BadArgumentException { if (Guard.isMapNullOrEmpty(this.filterParams)) { return; } final ImmutableList<String> legalParams = ImmutableList.of(CONTAINS, OWNER, NEWERTHAN, OLDERTHAN, LARGERTHAN, SMALLERTHAN); for (final String paramName : this.filterParams.keySet()) { if (!legalParams.contains(paramName)) { throw new BadArgumentException("Unknown filter parameter: " + paramName); } } }
Source:
public void restartMachine(final org.eclipse.che.api.core.model.machine.Machine machineState) { eventBus.addHandler(MachineStateEvent.TYPE, new MachineStateEvent.Handler() { @Override public void onMachineCreating(MachineStateEvent event) { } @Override public void onMachineRunning(MachineStateEvent event) { } @Override public void onMachineDestroyed(MachineStateEvent event) { if (isMachineRestarting) { final MachineSource machineSource = machineState.getConfig().getSource(); final String displayName = machineState.getConfig().getName(); final boolean isDev = machineState.getConfig().isDev(); startMachine(asDto(machineSource), displayName, isDev, RESTART, "dockerfile", "docker"); isMachineRestarting = false; } } }); destroyMachine(machineState).then(new Operation<Void>() { @Override public void apply(Void arg) throws OperationException { isMachineRestarting = true; } }); }

Target:
public void restartMachine(final org.eclipse.che.api.core.model.machine.Machine machineState) { eventBus.addHandler(MachineStateEvent.TYPE, new MachineStateEvent.Handler() { @Override public void onMachineCreating(MachineStateEvent event) { } @Override public void onMachineRunning(MachineStateEvent event) { } @Override public void onMachineDestroyed(MachineStateEvent event) { if (isMachineRestarting) { final MachineSource machineSource = machineState.getConfig().getSource(); final String displayName = machineState.getConfig().getName(); final boolean isDev = machineState.getConfig().isDev(); startMachine(asDto(machineSource), displayName, isDev, RESTART, "docker"); isMachineRestarting = false; } } }); destroyMachine(machineState).then(new Operation<Void>() { @Override public void apply(Void arg) throws OperationException { isMachineRestarting = true; } }); }
Source:
public ElasticsearchTableDescription( @JsonProperty("tableName") String tableName, @JsonProperty("schemaName") String schemaName, @JsonProperty("hostAddress") String hostAddress, @JsonProperty("port") int port, @JsonProperty("clusterName") String clusterName, @JsonProperty("index") String index, @JsonProperty("indexExactMatch") boolean indexExactMatch, @JsonProperty("type") String type, @JsonProperty("columns") List<ElasticsearchColumn> columns) { checkArgument(!isNullOrEmpty(tableName), "tableName is null or is empty"); checkArgument(!isNullOrEmpty(hostAddress), "hostAddress is null or is empty"); checkArgument(!isNullOrEmpty(String.valueOf(port)), "port is null or is empty"); checkArgument(!isNullOrEmpty(clusterName), "clusterName is null or is empty"); checkArgument(!isNullOrEmpty(type), "type is null or is empty"); this.tableName = tableName; this.schemaName = schemaName; this.hostAddress = hostAddress; this.port = port; this.clusterName = clusterName; this.index = index; this.indexExactMatch = indexExactMatch; this.type = type; if (columns == null) { this.columns = null; } else { this.columns = ImmutableList.copyOf(columns); } }

Target:
public ElasticsearchTableDescription( @JsonProperty("tableName") String tableName, @JsonProperty("schemaName") String schemaName, @JsonProperty("hostAddress") String hostAddress, @JsonProperty("port") int port, @JsonProperty("clusterName") String clusterName, @JsonProperty("index") String index, @JsonProperty("indexExactMatch") boolean indexExactMatch, @JsonProperty("type") String type, @JsonProperty("columns") List<ElasticsearchColumn> columns) { checkArgument(!isNullOrEmpty(tableName), "tableName is null or is empty"); checkArgument(!isNullOrEmpty(hostAddress), "hostAddress is null or is empty"); checkArgument(!isNullOrEmpty(clusterName), "clusterName is null or is empty"); checkArgument(!isNullOrEmpty(type), "type is null or is empty"); this.tableName = tableName; this.schemaName = schemaName; this.hostAddress = hostAddress; this.port = port; this.clusterName = clusterName; this.index = index; this.indexExactMatch = indexExactMatch; this.type = type; if (columns == null) { this.columns = ImmutableList.of(); } else { this.columns = ImmutableList.copyOf(columns); } }
Source:
public boolean matches(byte[] array) { long state = 0; for (int i = 0; i < array.length; ++i) { byte symbol = array[i]; long highMask = high[symbol >>> 4]; long lowMask = low[symbol & 0xF]; state = ((state << 1) | 1) & highMask & lowMask; if ((state & termination) == termination) { return true; } } return false; }

Target:
public boolean matches(byte[] array) { long state = 0; for (byte symbol : array) { long highMask = high[symbol >>> 4]; long lowMask = low[symbol & 0xF]; state = ((state << 1) | 1) & highMask & lowMask; if ((state & termination) == termination) { return true; } } return false; }
Source:
public WorldBorder.Builder from(WorldBorder border) { this.diameter = border.getDiameter(); this.centre = border.getCenter(); this.warningTime = border.getWarningTime(); this.warningDistance = border.getWarningDistance(); this.damageThreshold = border.getDamageThreshold(); this.damageAmount = border.getDamageAmount(); return this; }

Target:
public WorldBorder.Builder from(WorldBorder border) { this.diameter = border.getDiameter(); this.center = border.getCenter(); this.warningTime = border.getWarningTime(); this.warningDistance = border.getWarningDistance(); this.damageThreshold = border.getDamageThreshold(); this.damageAmount = border.getDamageAmount(); return this; }
Source:
private static void checkThreadPool(final OperationContext context, final ModelNode operation, final String type) throws OperationFailedException { PathAddress threadPoolPath = PathAddress.pathAddress(operation.require(OP_ADDR)); PathAddress workManagerPath = threadPoolPath.getParent(); Set<Resource.ResourceEntry> entrySet = context.readResourceFromRoot(workManagerPath).getChildren(type); if (entrySet.size() > 0 && !entrySet.iterator().next().getName().equals(threadPoolPath.getLastElement().getValue())) { throw ConnectorLogger.ROOT_LOGGER.oneThreadPoolWorkManager(threadPoolPath.getLastElement().getValue(), type, workManagerPath.getLastElement().getValue()); } }

Target:
private static void checkThreadPool(final OperationContext context, final ModelNode operation, final String type) throws OperationFailedException { PathAddress threadPoolPath = context.getCurrentAddress(); PathAddress workManagerPath = threadPoolPath.getParent(); Set<Resource.ResourceEntry> entrySet = context.readResourceFromRoot(workManagerPath).getChildren(type); if (entrySet.size() > 0 && !entrySet.iterator().next().getName().equals(threadPoolPath.getLastElement().getValue())) { throw ConnectorLogger.ROOT_LOGGER.oneThreadPoolWorkManager(threadPoolPath.getLastElement().getValue(), type, workManagerPath.getLastElement().getValue()); } }
Source:
private void setupStormCode(Map<String, Object> conf, String topoId, String tmpJarLocation, Map<String, Object> topoConf, StormTopology topology) throws Exception { Subject subject = getSubject(); IStormClusterState clusterState = stormClusterState; BlobStore store = blobStore; String jarKey = ConfigUtils.masterStormJarKey(topoId); String codeKey = ConfigUtils.masterStormCodeKey(topoId); String confKey = ConfigUtils.masterStormConfKey(topoId); NimbusInfo hostPortInfo = nimbusHostPortInfo; CuratorFramework zkClient = null; if (store instanceof LocalFsBlobStore) { zkClient = BlobStoreUtils.createZKClient(conf); } if (tmpJarLocation != null) { try (FileInputStream fin = new FileInputStream(tmpJarLocation)) { store.createBlob(jarKey, fin, new SettableBlobMeta(BlobStoreAclHandler.DEFAULT), subject); } if (store instanceof LocalFsBlobStore) { clusterState.setupBlobstore(jarKey, hostPortInfo, getVersionForKey(jarKey, hostPortInfo, zkClient)); } } topoCache.addTopoConf(topoId, subject, topoConf); if (store instanceof LocalFsBlobStore) { clusterState.setupBlobstore(confKey, hostPortInfo, getVersionForKey(confKey, hostPortInfo, zkClient)); } topoCache.addTopology(topoId, subject, topology); if (store instanceof LocalFsBlobStore) { clusterState.setupBlobstore(codeKey, hostPortInfo, getVersionForKey(codeKey, hostPortInfo, zkClient)); } }

Target:
private void setupStormCode(Map<String, Object> conf, String topoId, String tmpJarLocation, Map<String, Object> topoConf, StormTopology topology) throws Exception { Subject subject = getSubject(); IStormClusterState clusterState = stormClusterState; BlobStore store = blobStore; String jarKey = ConfigUtils.masterStormJarKey(topoId); String codeKey = ConfigUtils.masterStormCodeKey(topoId); String confKey = ConfigUtils.masterStormConfKey(topoId); NimbusInfo hostPortInfo = nimbusHostPortInfo; if (tmpJarLocation != null) { try (FileInputStream fin = new FileInputStream(tmpJarLocation)) { store.createBlob(jarKey, fin, new SettableBlobMeta(BlobStoreAclHandler.DEFAULT), subject); } if (store instanceof LocalFsBlobStore) { clusterState.setupBlobstore(jarKey, hostPortInfo, getVersionForKey(jarKey, hostPortInfo, conf, zkClient)); } } topoCache.addTopoConf(topoId, subject, topoConf); if (store instanceof LocalFsBlobStore) { clusterState.setupBlobstore(confKey, hostPortInfo, getVersionForKey(confKey, hostPortInfo, conf, zkClient)); } topoCache.addTopology(topoId, subject, topology); if (store instanceof LocalFsBlobStore) { clusterState.setupBlobstore(codeKey, hostPortInfo, getVersionForKey(codeKey, hostPortInfo, conf, zkClient)); } }
Source:
public URIList getUriList() throws GoGoDuckException { return indexReader.getUriList(profile, TIME_FIELD, URL_FIELD, subset); }

Target:
public URIList getUriList() throws GoGoDuckException { return indexReader.getUriList(profile, goGoDuckConfig.getTimeField(), goGoDuckConfig.getFileUrlField(), subset); }
Source:
public static Integer strcmp(String s0, String s1) { return (int) Math.signum(s1.compareTo(s0)); }

Target:
public static int strcmp(String s0, String s1) { return (int) Math.signum(s1.compareTo(s0)); }
Source:
public void testIncludeAbsolute() throws IOException, ConfigInvalidException { final File includedFile = createFile(CONTENT1.getBytes()); final ByteArrayOutputStream bos = new ByteArrayOutputStream(); bos.write("[include]\npath=".getBytes()); bos.write(includedFile.getAbsolutePath() .replace(File.separatorChar, '/').getBytes()); final File file = createFile(bos.toByteArray()); final FileBasedConfig config = new FileBasedConfig(file, FS.DETECTED); config.load(); assertEquals(ALICE, config.getString(USER, null, NAME)); }

Target:
public void testIncludeAbsolute() throws IOException, ConfigInvalidException { final File includedFile = createFile(CONTENT1.getBytes()); final ByteArrayOutputStream bos = new ByteArrayOutputStream(); bos.write("[include]\npath=".getBytes()); bos.write(ConfigTest.pathToString(includedFile).getBytes()); final File file = createFile(bos.toByteArray()); final FileBasedConfig config = new FileBasedConfig(file, FS.DETECTED); config.load(); assertEquals(ALICE, config.getString(USER, null, NAME)); }
Source:
public Map<String, DbParameterAccessor> getAllColumns(String tableName) throws SQLException { DatabaseTable t = new DatabaseTable(getConnection(), getConnection().getSchema(), tableName.toUpperCase()); return t.getParams(); }

Target:
public Map<String, DbParameterAccessor> getAllColumns(String tableName) throws SQLException { return new DatabaseTable(buildDatabaseObjectName(tableName)).getParams(); }
Source:
protected String buildPayeeName(String lastName, String firstName, String middleInitial) { String seperator = KFSConstants.COMMA + KFSConstants.BLANK_SPACE; String fullName = lastName + seperator + firstName; if (StringUtils.isNotBlank(middleInitial)) { fullName = fullName + seperator + middleInitial + KFSConstants.DELIMITER; } if(fullName.length() > getPayeeNameFieldSize()) { fullName = StringUtils.substring(fullName, 0, getPayeeNameFieldSize()); fullName = removeLastCharacterWhenComma(fullName); } return fullName; }

Target:
protected String buildPayeeName(String lastName, String firstName, String middleInitial) { String separator = KFSConstants.COMMA + KFSConstants.BLANK_SPACE; String fullName = lastName + separator + firstName; if (StringUtils.isNotBlank(middleInitial)) { fullName = fullName + KFSConstants.BLANK_SPACE + middleInitial + KFSConstants.DELIMITER; } if(fullName.length() > getPayeeNameFieldSize()) { fullName = StringUtils.substring(fullName, 0, getPayeeNameFieldSize().intValue()); fullName = removeLastCharacterWhenComma(fullName); } return fullName; }
Source:
protected boolean canDoAction() { if (getParameters() == null || (getParameters().getQuotaId() == null)) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST); return false; } Quota quota = getQuota(); if (quota == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST); return false; } if (getQuotaDAO().isQuotaInUse(quota) && !QuotaEnforcementTypeEnum.DISABLED.equals(quota.getQuotaEnforcementType())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IN_USE_BY_VM_OR_DISK); return false; } return true; }

Target:
protected boolean canDoAction() { if (getParameters() == null || (getParameters().getQuotaId() == null)) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST); return false; } Quota quota = getQuota(); if (quota == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST); return false; } if (!QuotaEnforcementTypeEnum.DISABLED.equals(quota.getQuotaEnforcementType()) && getQuotaDAO().isQuotaInUse(quota)) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IN_USE_BY_VM_OR_DISK); return false; } return true; }
Source:
private void setWidgetContent(GQuery inner) { String oldDisplay = options.getWidget().getElement().getStyle().getDisplay(); options.getWidget().getElement().getStyle().setProperty("display", "none"); RootPanel.get().add(options.getWidget()); RootPanel.get().getElement().removeChild(options.getWidget().getElement()); inner.get(0).appendChild(options.getWidget().getElement()); options.getWidget().getElement().getStyle().setProperty("display", oldDisplay); }

Target:
private void setWidgetContent(GQuery inner) { Widget widget = options.getWidget(); String oldDisplay = $(widget).css("display"); $(widget).css("display", "none"); RootPanel.get().add(options.getWidget()); RootPanel.get().getElement().removeChild(options.getWidget().getElement()); $(widget).appendTo(inner).css("display", oldDisplay); }
Source:
public int run() throws IOException { if (targets == null || targets.isEmpty()) { throw new IllegalArgumentException("No views or datasets were specified."); } for (String uriOrName : targets) { if (isViewUri(uriOrName)) { View view = Datasets.load(uriOrName); Preconditions.checkArgument(viewMatches(view.getUri(), uriOrName), "Resolved view does not match requested view: " + view.getUri()); if(console.isDebugEnabled()){ for(PartitionView<?> pv: (Iterable<PartitionView<?>>) view.getCoveringPartitions()){ console.debug("Deleting partition {}", pv.getLocation()); } } if(!dryRun) { view.deleteAll(); } } else if (isDatasetUri(uriOrName)) { if (!dryRun){ Datasets.delete(uriOrName); } } else { if(!dryRun) { getDatasetRepository().delete(namespace, uriOrName); } } console.debug("Deleted {}", uriOrName); } return 0; }

Target:
public int run() throws IOException { if (targets == null || targets.isEmpty()) { throw new IllegalArgumentException("No views or datasets were specified."); } for (String uriOrName : targets) { if (isViewUri(uriOrName)) { View view = Datasets.load(uriOrName); Preconditions.checkArgument(viewMatches(view.getUri(), uriOrName), "Resolved view does not match requested view: " + view.getUri()); if(console.isDebugEnabled()){ for(PartitionView<?> pv: (Iterable<PartitionView<?>>) view.getCoveringPartitions()){ if(pv.canDelete()) { console.debug("Deleting partition {}", pv.getLocation()); }else{ console.debug("Deleting is not supported for partition {}", pv.getLocation()); } } } if(!dryRun) { view.deleteAll(); } } else if (isDatasetUri(uriOrName)) { if (!dryRun){ Datasets.delete(uriOrName); } } else { if(!dryRun) { getDatasetRepository().delete(namespace, uriOrName); } } console.debug(dryRun ? "Would have deleted {}" : "Deleted {}", uriOrName); } return 0; }
Source:
public void addPartitions(String databaseName, String tableName, List<PartitionWithStatistics> partitionsWithStatistics) { List<Partition> partitions = partitionsWithStatistics.stream() .map(ThriftMetastoreUtil::toMetastoreApiPartition) .collect(toImmutableList()); addMetastorePartitions(databaseName, tableName, partitions); try { if (partitionsWithStatistics.stream().allMatch(p -> p.getStatistics().getColumnStatistics().isEmpty())) { return; } Table table = getTable(databaseName, tableName) .orElseThrow(() -> new TableNotFoundException(new SchemaTableName(databaseName, tableName))); List<String> partitionColumns = table.getPartitionKeys().stream() .map(FieldSchema::getName) .collect(toImmutableList()); for (PartitionWithStatistics partitionWithStatistics : partitionsWithStatistics) { String partitionName = makePartName(partitionColumns, partitionWithStatistics.getPartition().getValues()); storePartitionColumnStatistics(databaseName, tableName, partitionName, partitionWithStatistics); } } catch (Throwable t) { for (Partition partition : partitions) { try { dropPartition(databaseName, tableName, partition.getValues(), false); } catch (Throwable suppressed) { if (t != suppressed) { t.addSuppressed(suppressed); } } } throw t; } }

Target:
public void addPartitions(String databaseName, String tableName, List<PartitionWithStatistics> partitionsWithStatistics) { List<Partition> partitions = partitionsWithStatistics.stream() .map(ThriftMetastoreUtil::toMetastoreApiPartition) .collect(toImmutableList()); addPartitionsWithoutStatistics(databaseName, tableName, partitions); for (PartitionWithStatistics partitionWithStatistics : partitionsWithStatistics) { storePartitionColumnStatistics(databaseName, tableName, partitionWithStatistics.getPartitionName(), partitionWithStatistics); } }
Source:
TaskData getTaskData(AbstractRepositoryConnector connector, IProgressMonitor monitor) throws CoreException { if (taskId != null && taskKey != null && connector.supportsSearchByTaskKey(repository)) { try { TaskData data = getTaskDataByKey(connector, monitor); if (data != null) { return data; } } catch (CoreException | RuntimeException e) { } return connector.getTaskData(repository, taskId, monitor); } else if (taskId != null) { return connector.getTaskData(repository, taskId, monitor); } else if (taskKey != null && connector.supportsSearchByTaskKey(repository)) { return getTaskDataByKey(connector, monitor); } return null; }

Target:
TaskData getTaskData(AbstractRepositoryConnector connector, IProgressMonitor monitor) throws CoreException { if (taskId != null && taskKey != null && connector.supportsSearchByTaskKey(repository)) { try { TaskData data = getTaskDataByKey(connector, monitor); if (data != null) { return data; } } catch (CoreException | RuntimeException e) { } try { return connector.getTaskData(repository, taskId, monitor); } catch (RuntimeException e) { throw new CoreException(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, String.format("Could not find task with ID %s", taskId), e)); } } else if (taskId != null) { return connector.getTaskData(repository, taskId, monitor); } else if (taskKey != null && connector.supportsSearchByTaskKey(repository)) { return getTaskDataByKey(connector, monitor); } return null; }
Source:
public Map toMap() { Map<String, Object> map = super.toMap(); map.put(SCHEMA, this.parserSchema.toString()); return map; }

Target:
public Map<String, Object> toMap() { Map<String, Object> map = super.toMap(); map.put(SCHEMA, this.parserSchema.toString()); return map; }
Source:
public Iterable<String> onTabComplete(CommandSender sender, String[] args) { final String lastArg = ( args.length > 0 ) ? args[args.length - 1].toLowerCase( Locale.ROOT ) : ""; return ProxyServer.getInstance().getPlayers().stream() .map( player -> player.getName().toLowerCase( Locale.ROOT ) ) .filter( name -> name.startsWith( lastArg ) ) .collect( Collectors.toList() ); }

Target:
public Iterable<String> onTabComplete(CommandSender sender, String[] args) { final String lastArg = ( args.length > 0 ) ? args[args.length - 1].toLowerCase( Locale.ROOT ) : ""; return ProxyServer.getInstance().getPlayers().stream() .map( player -> player.getName() ) .filter( name -> name.toLowerCase( Locale.ROOT ).startsWith( lastArg ) ) .collect( Collectors.toList() ); }
Source:
private Rectangle getBounds(final Widget widget) { return syncExec(new Result<Rectangle>() { public Rectangle run() { Control parent; Rectangle widgetBounds; if (widget instanceof Control) { parent = ((Control) widget).getParent(); widgetBounds = ((Control) widget).getBounds(); } else if (widget instanceof TableItem) { parent = ((TableItem) widget).getParent(); widgetBounds = ((TableItem) widget).getBounds(); } else if (widget instanceof TreeItem) { parent = ((TreeItem) widget).getParent(); widgetBounds = ((TreeItem) widget).getBounds(); } else { return null; } Point location = new Point(widgetBounds.x, widgetBounds.y); if (parent != null) { location = parent.toDisplay(location); } Rectangle bounds = new Rectangle(location.x, location.y, widgetBounds.width, widgetBounds.height); return bounds; } }); }

Target:
private Rectangle getBounds(final Widget widget) { return syncExec(new Result<Rectangle>() { public Rectangle run() { Control parent; Rectangle widgetBounds; if (widget instanceof Control) { parent = ((Control) widget).getParent(); widgetBounds = ((Control) widget).getBounds(); } else if (widget instanceof TableItem) { TableItem tableItem = (TableItem) widget; parent = tableItem.getParent(); widgetBounds = getTableItemBounds(tableItem); } else if (widget instanceof TreeItem) { TreeItem treeItem = (TreeItem) widget; parent = treeItem.getParent(); widgetBounds = getTreeItemBounds(treeItem); } else { return null; } Point location = new Point(widgetBounds.x, widgetBounds.y); if (parent != null) { location = parent.toDisplay(location); } return new Rectangle(location.x, location.y, widgetBounds.width, widgetBounds.height); } private Rectangle getTableItemBounds(TableItem tableItem) { Table table = tableItem.getParent(); int[] columnOrder = table.getColumnOrder(); Rectangle itemBounds; if (columnOrder.length > 0) { int lastColumnIndex = columnOrder[columnOrder.length - 1]; itemBounds = tableItem.getBounds(lastColumnIndex); } else { Rectangle tableBounds = table.getBounds(); itemBounds = tableItem.getBounds(); itemBounds.width = tableBounds.width; } return new Rectangle(0, itemBounds.y, itemBounds.x + itemBounds.width, itemBounds.height); } private Rectangle getTreeItemBounds(TreeItem treeItem) { Tree tree = treeItem.getParent(); int[] columnOrder = tree.getColumnOrder(); Rectangle itemBounds; if (columnOrder.length > 0) { int lastColumnIndex = columnOrder[columnOrder.length - 1]; itemBounds = treeItem.getBounds(lastColumnIndex); } else { Rectangle treeBounds = tree.getBounds(); itemBounds = treeItem.getBounds(); itemBounds.width = treeBounds.width; } return new Rectangle(0, itemBounds.y, itemBounds.x + itemBounds.width, itemBounds.height); } }); }
Source:
public Collection<ViewPrototype> getAllPrototypes() { Collection<ViewPrototype> result = new ArrayList<ViewPrototype>(); for (MergedArchitectureViewpoint viewpoint : getViewpoints()) { for (RepresentationKind kind : viewpoint.getRepresentationKinds()) { PapyrusRepresentationKind view = (PapyrusRepresentationKind) kind; ViewPrototype proto = ViewPrototype.get(view); if (!result.contains(proto) && null != proto) { result.add(proto); } } } return result; }

Target:
public Collection<ViewPrototype> getAllPrototypes() { Collection<ViewPrototype> result = new ArrayList<ViewPrototype>(); for (MergedArchitectureViewpoint viewpoint : getViewpoints()) { for (RepresentationKind kind : viewpoint.getRepresentationKinds()) { PapyrusRepresentationKind view = (PapyrusRepresentationKind) kind; ViewPrototype proto = ViewPrototype.get(view); if (null != proto && !result.contains(proto)) { result.add(proto); } } } return result; }
Source:
public void cluster_state_dump() throws Exception { put(0, "pets", "pet1", "Cubitus"); Properties properties = new Properties(); properties.setProperty(ConnectionPropertyNames.CONNECTION_TIMEOUT, String.valueOf("5000")); properties.setProperty(ConnectionPropertyNames.CONNECTION_NAME, "diagnostic"); properties.setProperty(PROP_REQUEST_TIMEOUT, "5000"); properties.setProperty(PROP_REQUEST_TIMEOUTMESSAGE, "5000"); URI uri = URI.create("diagnostic://" + voltron.getConnectionURI().getAuthority()); try (Connection connection = ConnectionFactory.connect(uri, properties)) { EntityRef<Diagnostics, Object, Void> ref = connection.getEntityRef(Diagnostics.class, 1, "root"); Diagnostics diagnostics = ref.fetchEntity(null); String dump = diagnostics.getClusterState(); System.out.println("=================================="); System.out.println(dump); System.out.println("=================================="); fail("Complete this test"); } }

Target:
public void cluster_state_dump() throws Exception { put(0, "pets", "pet1", "Cubitus"); Properties properties = new Properties(); properties.setProperty(ConnectionPropertyNames.CONNECTION_TIMEOUT, String.valueOf("5000")); properties.setProperty(ConnectionPropertyNames.CONNECTION_NAME, "diagnostic"); properties.setProperty(PROP_REQUEST_TIMEOUT, "5000"); properties.setProperty(PROP_REQUEST_TIMEOUTMESSAGE, "5000"); URI uri = URI.create("diagnostic://" + voltron.getConnectionURI().getAuthority()); try (Connection connection = ConnectionFactory.connect(uri, properties)) { EntityRef<Diagnostics, Object, Void> ref = connection.getEntityRef(Diagnostics.class, 1, "root"); Diagnostics diagnostics = ref.fetchEntity(null); String dump = diagnostics.getClusterState(); String cluster = nmsService.readTopology().toMap().toString(); assertThat(dump, containsString(cluster)); assertThat(dump, containsString("server=")); assertThat(dump, containsString("configurationCount=")); assertThat(dump, containsString("manageable=true")); assertThat(dump, containsString("cluster=")); assertThat(dump, containsString("consumerId=")); assertThat(dump, containsString("stripeName=")); assertThat(dump, containsString("messageQueueSize=")); assertThat(dump, containsString("capacity=")); assertThat(dump, containsString("available=")); assertThat(dump, containsString("cacheName=")); assertThat(dump, containsString("cacheSize=")); assertThat(dump, containsString(".caches")); assertThat(dump, containsString("instance=")); assertThat(dump, containsString("clientCount=")); assertThat(dump, containsString(".clients")); } }
Source:
protected void abandonSegment(final long truncatedTime, final Sink sink) { try { segmentAnnouncer.unannounceSegment(sink.getSegment()); removeSegment(sink, computePersistDir(schema, sink.getInterval())); log.info("Removing sinkKey %d for segment %s", truncatedTime, sink.getSegment().getIdentifier()); sinks.remove(truncatedTime); sinkTimeline.remove( sink.getInterval(), sink.getVersion(), new SingleElementPartitionChunk<>(sink) ); Iterables.transform(sink, new Function<FireHydrant, Void>() { @Nullable @Override public Void apply(@Nullable FireHydrant input) { cache.close(input.getSegment().getIdentifier() + "_" + input.getCount()); return null; } }); synchronized (handoffCondition) { handoffCondition.notifyAll(); } } catch (Exception e) { log.makeAlert(e, "Unable to abandon old segment for dataSource[%s]", schema.getDataSource()) .addData("interval", sink.getInterval()) .emit(); } }

Target:
protected void abandonSegment(final long truncatedTime, final Sink sink) { try { segmentAnnouncer.unannounceSegment(sink.getSegment()); removeSegment(sink, computePersistDir(schema, sink.getInterval())); log.info("Removing sinkKey %d for segment %s", truncatedTime, sink.getSegment().getIdentifier()); sinks.remove(truncatedTime); sinkTimeline.remove( sink.getInterval(), sink.getVersion(), new SingleElementPartitionChunk<>(sink) ); for (FireHydrant hydrant : sink) { cache.close(makeHydrantIdentifier(hydrant, hydrant.getSegment())); } synchronized (handoffCondition) { handoffCondition.notifyAll(); } } catch (Exception e) { log.makeAlert(e, "Unable to abandon old segment for dataSource[%s]", schema.getDataSource()) .addData("interval", sink.getInterval()) .emit(); } }
Source:
private void insert( Collection<PropertyValue> data ) throws IOException { PropertyValue[] dataArray = data.toArray( new PropertyValue[data.size()] ); for ( int i = 0; i < dataArray.length; i++ ) { Document doc = LuceneDocumentStructure.documentRepresentingProperties( (long) i, dataArray[i].value ); index.getIndexWriter().addDocument( doc ); } index.maybeRefreshBlocking(); }

Target:
private void insert( Collection<PropertyValue> data ) throws IOException { PropertyValue[] dataArray = data.toArray( new PropertyValue[data.size()] ); for ( int i = 0; i < dataArray.length; i++ ) { Document doc = LuceneDocumentStructure.documentRepresentingProperties( i, dataArray[i].value ); index.getIndexWriter().addDocument( doc ); } index.maybeRefreshBlocking(); }
Source:
public synchronized double getBPSAtoB() { if (getDuration() == 0) { return 0; } return fNbBytesAtoB / getDuration(); }

Target:
public synchronized double getBPSAtoB() { if (DoubleMath.fuzzyEquals(getDuration(), 0, Double.MIN_VALUE)) { return 0; } return fNbBytesAtoB / getDuration(); }
Source:
public void collapseParent(ParentObject parentObject, int position) { Object helperItem = mExpandableRecyclerAdapterHelper.getHelperItemAtPosition(position); if (helperItem instanceof ParentWrapper) { ParentWrapper parentWrapper = (ParentWrapper) helperItem; if (parentWrapper.getParentObject().equals(parentObject) && parentWrapper.isExpanded()) { expandParent(parentObject, position); } } }

Target:
public void collapseParent(ParentObject parentObject, int position) { Object helperItem = mHelper.getHelperItemAtPosition(position); if (helperItem instanceof ParentWrapper) { ParentWrapper parentWrapper = (ParentWrapper) helperItem; if (parentWrapper.getParentObject().equals(parentObject) && parentWrapper.isExpanded()) { toggleParentExpansion(parentObject, position); } } }
Source:
private void fetchRelatedEntities(GlusterVolumeEntity volume) { if (volume != null) { volume.setOptions(dbFacade.getGlusterOptionDao().getOptionsOfVolume(volume.getId())); volume.setAccessProtocols(new HashSet<AccessProtocol>(getAccessProtocolsOfVolume(volume.getId()))); volume.setTransportTypes(new HashSet<TransportType>(getTransportTypesOfVolume(volume.getId()))); volume.setAsyncTask(getAsyncTaskOfVolume(volume.getId())); List<GlusterBrickEntity> bricks = dbFacade.getGlusterBrickDao().getBricksOfVolume(volume.getId()); if (volume.getAsyncTask()!=null && volume.getAsyncTask().getStepId() != null) { for (GlusterBrickEntity brick: bricks) { if (brick.getAsyncTask() != null && brick.getAsyncTask().getTaskId().equals(volume.getAsyncTask().getTaskId())) { brick.setAsyncTask(volume.getAsyncTask()); } } } volume.setBricks(bricks); } }

Target:
private void fetchRelatedEntities(GlusterVolumeEntity volume) { if (volume != null) { volume.setOptions(dbFacade.getGlusterOptionDao().getOptionsOfVolume(volume.getId())); volume.setAccessProtocols(new HashSet<AccessProtocol>(getAccessProtocolsOfVolume(volume.getId()))); volume.setTransportTypes(new HashSet<TransportType>(getTransportTypesOfVolume(volume.getId()))); volume.setAsyncTask(getAsyncTaskOfVolume(volume.getId())); List<GlusterBrickEntity> bricks = dbFacade.getGlusterBrickDao().getBricksOfVolume(volume.getId()); if (volume.getAsyncTask()!=null && volume.getAsyncTask().getTaskId() != null) { for (GlusterBrickEntity brick: bricks) { if (brick.getAsyncTask() != null && brick.getAsyncTask().getTaskId().equals(volume.getAsyncTask().getTaskId())) { brick.setAsyncTask(volume.getAsyncTask()); } } } volume.setBricks(bricks); } }
Source:
public PurchasedNumberCreatedResponse purchaseNumber(String number, String countryCode, int billingIntervalMonths) throws UnauthorizedException, GeneralException { final String url = String.format("%s/v1/phone-numbers", NUMBERS_CALLS_BASE_URL); final Map<String, Object> payload = new LinkedHashMap<String, Object>(); payload.put("number", number); payload.put("countryCode", countryCode); payload.put("billingIntervalMonths", billingIntervalMonths); return messageBirdService.sendPayLoad(url, payload, PurchasedNumberCreatedResponse.class); }

Target:
public PurchasedNumberCreatedResponse purchaseNumber(String number, String countryCode, int billingIntervalMonths) throws UnauthorizedException, GeneralException, IllegalArgumentException { countryCodeIsValid(countryCode); final String url = String.format("%s/phone-numbers", NUMBERS_CALLS_BASE_URL); final Map<String, Object> payload = new LinkedHashMap<String, Object>(); payload.put("number", number); payload.put("countryCode", countryCode); if (!Arrays.asList(1, 3, 6, 9).contains(billingIntervalMonths)) { throw new IllegalArgumentException("Billing Interval Must Be Either 1, 3, 6, or 9."); } payload.put("billingIntervalMonths", billingIntervalMonths); return messageBirdService.sendPayLoad(url, payload, PurchasedNumberCreatedResponse.class); }
Source:
private String toStringDescription() { if (Strings.isValid(getDescription())) { return " - " + getDescription(); } return ""; }

Target:
private String toStringDescription() { String description = ""; if (Strings.isValid(getDescription())) { description = " - " + getDescription(); } return description; }
Source:
public XyrisTheWrithingStormDrawAbility() { super(Zone.BATTLEFIELD, new XyrisTheWrithingStormTokenEffect(), false); }

Target:
public XyrisTheWrithingStormDrawAbility() { super(Zone.BATTLEFIELD, new CreateTokenEffect(new SnakeToken(), 1), false); }
Source:
public void testJsonContentsGettingElement() throws Exception { assertEquals(HttpValueFunctions.jsonContents("mykey", String.class).apply(response), "myvalue"); }

Target:
public void testJsonContentsGettingElement() throws Exception { assertEquals(HttpValueFunctions.jsonContents(bodyKey, String.class).apply(response), bodyVal); }
Source:
protected Iterable<IAnalysisModule> getDependentAnalyses() { ITmfTrace trace = getTrace(); if (trace == null) { throw new IllegalStateException(); } IAnalysisModule module = trace.getAnalysisModule(TidAnalysisModule.ID); if (module == null) { return Collections.emptySet(); } return ImmutableSet.of(module); }

Target:
protected Iterable<IAnalysisModule> getDependentAnalyses() { ITmfTrace trace = getTrace(); if (trace == null) { throw new IllegalStateException("Trace should not be null"); } IAnalysisModule module = TmfTraceUtils.getAnalysisModuleOfClass(trace, TidAnalysisModule.class, TidAnalysisModule.ID); if (module == null) { throw new IllegalStateException("Module should not be null"); } return ImmutableSet.of(module); }
Source:
private void reportMTUDifferences(List<Network> ifaceNetworks) { List<String> mtuDiffNetworks = new ArrayList<String>(); for (Network net : ifaceNetworks) { mtuDiffNetworks.add(String.format("%s(%d)", net.getName(), net.getMtu())); } addViolation(VdcBllMessages.NETWORK_MTU_DIFFERENCES, String.format("[%s]", StringUtils.join(mtuDiffNetworks, ", "))); }

Target:
private void reportMTUDifferences(List<Network> ifaceNetworks) { List<String> mtuDiffNetworks = new ArrayList<String>(); for (Network net : ifaceNetworks) { mtuDiffNetworks.add(String.format("%s(%s)", net.getName(), net.getMtu() == 0 ? "default" : String.valueOf(net.getMtu()))); } addViolation(VdcBllMessages.NETWORK_MTU_DIFFERENCES, String.format("[%s]", StringUtils.join(mtuDiffNetworks, ", "))); }
Source:
public WiresLayer dock(final WiresContainer parent, final WiresShape child) { final WiresDockingControl dockingControl = child.getControl().getDockingControl(); dockingControl.dock(parent); return this; }

Target:
public WiresLayer dock(final WiresContainer parent, final WiresShape child) { final WiresDockingControl dockingControl = child.getControl().getDockingControl(); dockingControl.dock(parent); final Point2D candidateLocation = dockingControl.getCandidateLocation(); if (null != candidateLocation) { child.setLocation(candidateLocation); } return this; }