auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void shouldCallGetServersV2WithNull() throws Throwable { GetServersProcedureRunner runner = new TestGetServersProcedureRunner( value( (Object)null ) ); Connection mock = mock( Connection.class ); when( mock.server() ).thenReturn( new InternalServerInfo( new BoltServerAddress( "123:45" ), "Neo4j/3.2.1" ) ); runner.run( mock ); assertThat( runner.procedureCalled().toString(), equalTo( "Statement{text='CALL dbms.cluster.routing.getServersV2', parameters=NULL}" ) ); }

Target:
public void shouldCallGetServersV2WithNull() throws Throwable { GetServersProcedureRunner runner = new TestGetServersProcedureRunner( value( (Object)null ) ); Connection mock = mock( Connection.class ); when( mock.server() ).thenReturn( new InternalServerInfo( new BoltServerAddress( "123:45" ), "Neo4j/3.2.1" ) ); runner.run( mock ); assertThat( runner.procedureCalled(), equalTo( new Statement( "CALL " + GET_ROUTING_TABLE, value( (Object) null) ) ) ); }
Source:
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable { if (ctx.hasFlag(Flag.SKIP_LOCKING)) return invokeNextInterceptor(ctx, command); try { final boolean localNodeOwnsLock = cll.localNodeOwnsLock(command.getKey()); acquireRemoteIfNeeded(ctx, command.getKey(), localNodeOwnsLock); if (ctx.hasFlag(Flag.SKIP_OWNERSHIP_CHECK) || localNodeOwnsLock) { lockKeyAndCheckOwnership(ctx, command.getKey()); } else if (cll.localNodeIsOwner(command.getKey())) { ((TxInvocationContext)ctx).getCacheTransaction().addBackupLockForKey(command.getKey()); } return invokeNextInterceptor(ctx, command); } catch (Throwable te) { releaseLocksOnFailureBeforePrepare(ctx); throw te; } }

Target:
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable { if (ctx.hasFlag(Flag.SKIP_LOCKING)) return invokeNextInterceptor(ctx, command); try { final boolean localNodeOwnsLock = cdl.localNodeIsPrimaryOwner(command.getKey()); acquireRemoteIfNeeded(ctx, command.getKey(), localNodeOwnsLock); if (ctx.hasFlag(Flag.SKIP_OWNERSHIP_CHECK) || localNodeOwnsLock) { lockKeyAndCheckOwnership(ctx, command.getKey()); } else if (cdl.localNodeIsOwner(command.getKey())) { ((TxInvocationContext)ctx).getCacheTransaction().addBackupLockForKey(command.getKey()); } return invokeNextInterceptor(ctx, command); } catch (Throwable te) { releaseLocksOnFailureBeforePrepare(ctx); throw te; } }
Source:
Pair<Map<Integer, FeatureType>, Integer> getFeatureTypes() { final Map<Integer, FeatureType> featureTypes = new HashMap<>(numFeatures + 1); int valueTypeNum = 0; final HdfsSplitInfo[] infoArr = HdfsSplitManager.getSplits(metadataPath, TextInputFormat.class.getName(), NUM_SPLIT); for (final HdfsSplitInfo info : infoArr) { try { final Iterator<Pair<LongWritable, Text>> iterator = HdfsSplitFetcher.fetchData(info); while (iterator.hasNext()) { final String text = iterator.next().getValue().toString().trim(); if (text.startsWith("#") || text.length() == 0) { continue; } final String[] splits = text.split(" "); for (final String split : splits) { final String[] idxVal = split.split(":"); assert idxVal.length == 2; final int idx = Integer.parseInt(idxVal[0]); if (idx == numFeatures) { valueTypeNum = Integer.parseInt(idxVal[1]); } final FeatureType featureType = Integer.parseInt(idxVal[1]) == 0 ? FeatureType.CONTINUOUS : FeatureType.CATEGORICAL; featureTypes.put(idx, featureType); } } } catch (final IOException e) { throw new RuntimeException(e); } } return Pair.of(featureTypes, valueTypeNum); }

Target:
Pair<Map<Integer, FeatureType>, Integer> getFeatureTypes() { final HdfsSplitInfo[] infoArr = HdfsSplitManager.getSplits(metadataPath, TextInputFormat.class.getName(), NUM_SPLIT); assert infoArr.length == 1; final HdfsSplitInfo info = infoArr[0]; try { final Iterator<Pair<LongWritable, Text>> iterator = HdfsSplitFetcher.fetchData(info); while (iterator.hasNext()) { final String text = iterator.next().getValue().toString().trim(); if (text.startsWith("#") || text.length() == 0) { continue; } final Map<Integer, FeatureType> featureTypes = new HashMap<>(numFeatures); final String[] splits = text.split(" "); for (final String split : splits) { final String[] idxVal = split.split(":"); assert idxVal.length == 2; final int idx = Integer.parseInt(idxVal[0]); if (idx != numFeatures) { final FeatureType featureType = Integer.parseInt(idxVal[1]) == 0 ? FeatureType.CONTINUOUS : FeatureType.CATEGORICAL; featureTypes.put(idx, featureType); } } final int valueTypeNum = Integer.parseInt(splits[numFeatures].split(":")[1]); return Pair.of(featureTypes, valueTypeNum); } } catch (final IOException e) { throw new RuntimeException(e); } return NO_INFORMATION; }
Source:
public ShowcaseView build() { ViewGroup parent; int index; if (mParent == null) { parent = ((ViewGroup) activity.getWindow().getDecorView()); index = mParentIndex; } else { parent = mParent; index = -1; } insertShowcaseView(showcaseView, parent, index); return showcaseView; }

Target:
public ShowcaseView build() { insertShowcaseView(showcaseView, parent, parentIndex); return showcaseView; }
Source:
static void init() throws Exception { jarDir = TMP.newFolder().toPath(); final String parameterProgramJarName = System.getProperty("parameterJarName") + ".jar"; final String parameterProgramWithoutManifestJarName = System.getProperty("parameterJarWithoutManifestName") + ".jar"; final Path jarLocation = Paths.get(System.getProperty("targetDir")); jarWithManifest = Files.copy( jarLocation.resolve(parameterProgramJarName), jarDir.resolve("program-with-manifest.jar")); jarWithoutManifest = Files.copy( jarLocation.resolve(parameterProgramWithoutManifestJarName), jarDir.resolve("program-without-manifest.jar")); restfulGateway = new TestingDispatcherGateway.Builder() .setBlobServerPort(BLOB_SERVER_RESOURCE.getBlobServerPort()) .setSubmitFunction(jobGraph -> { LAST_SUBMITTED_JOB_GRAPH_REFERENCE.set(jobGraph); return CompletableFuture.completedFuture(Acknowledge.get()); }) .setRequestJobResultFunction(jobID -> CompletableFuture.completedFuture( new JobResult.Builder() .jobId(jobID) .applicationStatus(ApplicationStatus.SUCCEEDED) .accumulatorResults(Collections.emptyMap()) .netRuntime(Long.MAX_VALUE) .build())) .build(); gatewayRetriever = () -> CompletableFuture.completedFuture(restfulGateway); localAddressFuture = CompletableFuture.completedFuture("shazam://localhost:12345"); timeout = Time.seconds(10); responseHeaders = Collections.emptyMap(); executor = TestingUtils.defaultExecutor(); }

Target:
static void init() throws Exception { jarDir = TMP.newFolder().toPath(); final String parameterProgramJarName = System.getProperty("parameterJarName") + ".jar"; final String parameterProgramWithoutManifestJarName = System.getProperty("parameterJarWithoutManifestName") + ".jar"; final Path jarLocation = Paths.get(System.getProperty("targetDir")); jarWithManifest = Files.copy( jarLocation.resolve(parameterProgramJarName), jarDir.resolve("program-with-manifest.jar")); jarWithoutManifest = Files.copy( jarLocation.resolve(parameterProgramWithoutManifestJarName), jarDir.resolve("program-without-manifest.jar")); restfulGateway = new TestingDispatcherGateway.Builder() .setBlobServerPort(BLOB_SERVER_RESOURCE.getBlobServerPort()) .setSubmitFunction(jobGraph -> { LAST_SUBMITTED_JOB_GRAPH_REFERENCE.set(jobGraph); return CompletableFuture.completedFuture(Acknowledge.get()); }) .build(); gatewayRetriever = () -> CompletableFuture.completedFuture(restfulGateway); localAddressFuture = CompletableFuture.completedFuture("shazam://localhost:12345"); timeout = Time.seconds(10); responseHeaders = Collections.emptyMap(); executor = TestingUtils.defaultExecutor(); }
Source:
protected double getScore(double availableCpu, double availableMemory, Map<String, Double> availableGenericResources) { TopologyDetails td = getNextHighest(); return getScore(availableCpu, availableMemory, availableGenericResources, td); }

Target:
protected double getScore(double availableCpu, double availableMemory, Map<String, Double> availableGenericResources) { return getScore(availableCpu, availableMemory, availableGenericResources, getNextHighest()); }
Source:
KafkaRecordSet(KafkaSplit split, KafkaConsumerManager consumerManager, List<KafkaColumnHandle> columnHandles, RowDecoder keyDecoder, RowDecoder messageDecoder) { this.split = requireNonNull(split, "split is null"); this.consumerManager = requireNonNull(consumerManager, "consumerManager is null"); this.keyDecoder = requireNonNull(keyDecoder, "rowDecoder is null"); this.messageDecoder = requireNonNull(messageDecoder, "rowDecoder is null"); this.columnHandles = requireNonNull(columnHandles, "columnHandles is null"); ImmutableList.Builder<Type> typeBuilder = ImmutableList.builder(); for (DecoderColumnHandle handle : this.columnHandles) { typeBuilder.add(handle.getType()); } this.columnTypes = typeBuilder.build(); KafkaConsumer consumer = consumerManager.createConsumer(Thread.currentThread().getId(), split.getLeader()); TopicPartition tp = new TopicPartition(split.getTopicName(), split.getPartitionId()); consumer.assign(ImmutableList.of(tp)); setOffsetRange(consumer, split); consumer.close(); }

Target:
KafkaRecordSet(KafkaSplit split, KafkaConsumerManager consumerManager, List<KafkaColumnHandle> columnHandles, RowDecoder keyDecoder, RowDecoder messageDecoder) { this.split = requireNonNull(split, "split is null"); this.consumerManager = requireNonNull(consumerManager, "consumerManager is null"); this.keyDecoder = requireNonNull(keyDecoder, "rowDecoder is null"); this.messageDecoder = requireNonNull(messageDecoder, "rowDecoder is null"); this.columnHandles = requireNonNull(columnHandles, "columnHandles is null"); ImmutableList.Builder<Type> typeBuilder = ImmutableList.builder(); for (DecoderColumnHandle handle : columnHandles) { typeBuilder.add(handle.getType()); } this.columnTypes = typeBuilder.build(); }
Source:
public Response<Set<String>> apply(ChangeResource req, Input input) throws AuthException, OrmException, IOException, BadRequestException { if (input == null || Strings.isNullOrEmpty(input.hashtags)) { throw new BadRequestException("Hashtags are required"); } ChangeControl control = req.getControl(); if(!control.canEditHashtags()){ throw new AuthException("Editing hashtags not permitted"); } ChangeUpdate update = updateFactory.create(control); ChangeNotes notes = control.getNotes().load(); Set<String> existingHashtags = notes.getHashtags(); Set<String> updatedHashtags = new HashSet<String>(); Set<String> removed = new HashSet<String>(); List<String> toRemove = Arrays.asList(input.hashtags.split(",")); if (existingHashtags != null) { updatedHashtags.addAll(existingHashtags); for (String hashtag : toRemove) { if (existingHashtags.contains(hashtag)) { removed.add(hashtag); } } } if (removed.size() > 0) { updatedHashtags.removeAll(removed); update.setHashtags(updatedHashtags); update.commit(); IdentifiedUser currentUser = ((IdentifiedUser) control.getCurrentUser()); hooks.doHashtagsEditedHook( req.getChange(), currentUser.getAccount(), null, removed, updatedHashtags, dbProvider.get()); } return Response.ok(updatedHashtags); }

Target:
public Response<Set<String>> apply(ChangeResource req, Input input) throws AuthException, OrmException, IOException, BadRequestException { if (input == null || Strings.isNullOrEmpty(input.hashtags)) { throw new BadRequestException("Hashtags are required"); } ChangeControl control = req.getControl(); if(!control.canEditHashtags()){ throw new AuthException("Editing hashtags not permitted"); } ChangeUpdate update = updateFactory.create(control); ChangeNotes notes = control.getNotes().load(); Set<String> existingHashtags = notes.getHashtags(); Set<String> updatedHashtags = new HashSet<String>(); Set<String> removed = new HashSet<String>(); List<String> toRemove = Arrays.asList(input.hashtags.split(",")); if (existingHashtags != null) { updatedHashtags.addAll(existingHashtags); for (String hashtag : toRemove) { if (existingHashtags.contains(hashtag)) { removed.add(hashtag); } } } if (removed.size() > 0) { updatedHashtags.removeAll(removed); update.setHashtags(updatedHashtags); update.commit(); indexer.index(dbProvider.get(), update.getChange()); IdentifiedUser currentUser = ((IdentifiedUser) control.getCurrentUser()); hooks.doHashtagsEditedHook( req.getChange(), currentUser.getAccount(), null, removed, updatedHashtags, dbProvider.get()); } return Response.ok(updatedHashtags); }
Source:
public static String escapeForHtml(String inStr, boolean changeSpace, int tabLength) { StringBuilder retStr = new StringBuilder(); int i = 0; int l = 0; while (i < inStr.length()) { if (inStr.charAt(i) == '&') { retStr.append("&amp;"); } else if (inStr.charAt(i) == '<') { retStr.append("&lt;"); } else if (inStr.charAt(i) == '>') { retStr.append("&gt;"); } else if (inStr.charAt(i) == '\"') { retStr.append("&quot;"); } else if (changeSpace && inStr.charAt(i) == ' ') { retStr.append("&nbsp;"); } else if (changeSpace && inStr.charAt(i) == '\t') { for (int j = 0; j < tabLength - l; j++) { retStr.append("&nbsp;"); } l = -1; } else { retStr.append(inStr.charAt(i)); } l = (l + 1) % tabLength; if (inStr.charAt(i) == '\n') l = 0; i++; } return retStr.toString(); }

Target:
public static String escapeForHtml(String inStr, boolean changeSpace, int tabLength) { StringBuilder retStr = new StringBuilder(); int i = 0; int l = 0; while (i < inStr.length()) { if (inStr.charAt(i) == '&') { retStr.append("&amp;"); } else if (inStr.charAt(i) == '<') { retStr.append("&lt;"); } else if (inStr.charAt(i) == '>') { retStr.append("&gt;"); } else if (inStr.charAt(i) == '\"') { retStr.append("&quot;"); } else if (changeSpace && inStr.charAt(i) == ' ') { retStr.append("&nbsp;"); } else if (changeSpace && inStr.charAt(i) == '\t') { for (int j = 0; j < tabLength - l; j++) { retStr.append("&nbsp;"); } l = -1; } else { retStr.append(inStr.charAt(i)); } l = (l + 1) % tabLength; if (inStr.charAt(i) == '\n') { l = 0; } i++; } return retStr.toString(); }
Source:
AbstractDataManipulator (String title, IPath pathWorkDir, IProject project) { this.title = title; this.pathWorkDir=pathWorkDir; this.project=project; threads = new ArrayList<Thread>(); }

Target:
AbstractDataManipulator (String title, IPath pathWorkDir, IProject project) { this(title, pathWorkDir); this.project=project; }
Source:
public Void apply(EntryView.ReadWriteEntryView<K, Collection<V>> entryView) { Collection<V> newValues = new HashSet<>(); newValues.add(value); try { Collection<V> values = entryView.get(); newValues.addAll(values); } catch (NoSuchElementException ex) { } entryView.set(newValues); return null; }

Target:
public Void apply(EntryView.ReadWriteEntryView<K, Collection<V>> entryView) { Collection<V> newValues = new HashSet<>(); newValues.add(value); entryView.find().map(newValues::addAll); entryView.set(newValues); return null; }
Source:
public void addSource(Object source) { if (source instanceof Resource) { XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.context); reader.loadBeanDefinitions((Resource)source); } }

Target:
public void addSource(Object source) { Assert.notNull(source,"source cannot be null"); Assert.isInstanceOf(Resource.class,source,"unsupported source: " + source.getClass().getName()); Resource resource = (Resource)source; XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.context); reader.loadBeanDefinitions(resource); }
Source:
public void createControl(Composite parent) { initializeDialogUnits(parent); Composite composite= new Composite(parent, SWT.NONE); composite.setFont(parent.getFont()); int nColumns= 3; GridLayout layout= new GridLayout(); layout.numColumns= 3; composite.setLayout(layout); Label label= new Label(composite, SWT.WRAP); String info= Messages.format(NewWizardMessages.NewModuleInfoWizardPage_info, filename); label.setText(info); GridData gd= new GridData(); gd.widthHint= convertWidthInCharsToPixels(60); gd.horizontalSpan= 3; label.setLayoutData(gd); createModuleInfoControls(composite, nColumns); setControl(composite); Dialog.applyDialogFont(composite); }

Target:
public void createControl(Composite parent) { initializeDialogUnits(parent); Composite composite= new Composite(parent, SWT.NONE); composite.setFont(parent.getFont()); int nColumns= 2; GridLayout layout= new GridLayout(); layout.numColumns= 2; composite.setLayout(layout); createModuleInfoControls(composite, nColumns); setControl(composite); Dialog.applyDialogFont(composite); }
Source:
public ApiResponse handleApiAction(String name, JSONObject params) throws ApiException { RuleConfig rc; switch (name) { case ACTION_SET_RULE_CONFIG_VALUE: rc = extension.getRuleConfig(params.getString(PARAM_KEY)); if (rc != null) { if (params.containsKey(PARAM_VALUE)) { extension.setRuleConfigValue(rc.getKey(), params.getString(PARAM_VALUE)); } else { extension.setRuleConfigValue(rc.getKey(), ""); } } else { throw new ApiException(ApiException.Type.DOES_NOT_EXIST); } break; case ACTION_RESET_RULE_CONFIG_VALUE: rc = extension.getRuleConfig(params.getString(PARAM_KEY)); if (rc != null) { extension.resetRuleConfigValue(rc.getKey()); } else { throw new ApiException(ApiException.Type.DOES_NOT_EXIST); } break; case ACTION_RESET_ALL_RULE_CONFIG_VALUES: extension.resetAllRuleConfigValues();; break; default: throw new ApiException(ApiException.Type.BAD_ACTION); } return ApiResponseElement.OK; }

Target:
public ApiResponse handleApiAction(String name, JSONObject params) throws ApiException { RuleConfig rc; switch (name) { case ACTION_SET_RULE_CONFIG_VALUE: rc = extension.getRuleConfig(params.getString(PARAM_KEY)); if (rc != null) { if (params.containsKey(PARAM_VALUE)) { extension.setRuleConfigValue(rc.getKey(), params.getString(PARAM_VALUE)); } else { extension.setRuleConfigValue(rc.getKey(), ""); } } else { throw new ApiException(ApiException.Type.DOES_NOT_EXIST, PARAM_KEY); } break; case ACTION_RESET_RULE_CONFIG_VALUE: rc = extension.getRuleConfig(params.getString(PARAM_KEY)); if (rc != null) { extension.resetRuleConfigValue(rc.getKey()); } else { throw new ApiException(ApiException.Type.DOES_NOT_EXIST, PARAM_KEY); } break; case ACTION_RESET_ALL_RULE_CONFIG_VALUES: extension.resetAllRuleConfigValues(); break; default: throw new ApiException(ApiException.Type.BAD_ACTION); } return ApiResponseElement.OK; }
Source:
public static ExclusionItem parse(String text) { int i = text.indexOf(':'); if (i < 0) { return null; } String item = text.substring(i+1); if (StringUtils.trimToNull(item) == null) { return null; } switch (text.substring(0, i).toUpperCase()) { case "FILE": return new ExclusionItem(FILE, item); case "DIRECTORY": return new ExclusionItem(DIRECTORY, item); case "GLOB": return new ExclusionItem(GLOB, item); default: return null; } }

Target:
public static ExclusionItem parse(String text) { int i = text.indexOf(':'); if (i < 0) { return null; } String item = text.substring(i+1); if (StringUtils.trimToNull(item) == null) { return null; } switch (text.substring(0, i).toUpperCase(Locale.US)) { case "FILE": return new ExclusionItem(FILE, item); case "DIRECTORY": return new ExclusionItem(DIRECTORY, item); case "GLOB": return new ExclusionItem(GLOB, item); default: return null; } }
Source:
public void executeCommand(Command command, ExecutionHandlerContext context) { List<byte[]> commandElems = command.getProcessedCommand(); if (commandElems.size() < 3) { command.setResponse( Coder.getErrorResponse(context.getByteBufAllocator(), RedisConstants.ArityDef.KEYS)); return; } ByteArrayWrapper key = command.getKey(); ByteArrayWrapper newKey = new ByteArrayWrapper(commandElems.get(2)); RedisKeyCommands redisKeyCommands = new RedisKeyCommandsFunctionExecutor(context.getRegionProvider().getDataRegion()); if (!redisKeyCommands.rename(key, newKey)) { command.setResponse( Coder.getErrorResponse(context.getByteBufAllocator(), RedisConstants.ERROR_NO_SUCH_KEY)); return; } command.setResponse(Coder.getSimpleStringResponse(context.getByteBufAllocator(), "OK")); }

Target:
public void executeCommand(Command command, ExecutionHandlerContext context) { List<ByteArrayWrapper> commandElems = command.getProcessedCommandWrappers(); ByteArrayWrapper key = command.getKey(); ByteArrayWrapper newKey = commandElems.get(2); RedisKeyCommands redisKeyCommands = getRedisKeyCommands(context); if (key.equals(newKey)) { command.setResponse(Coder.getSimpleStringResponse(context.getByteBufAllocator(), "OK")); return; } if (!redisKeyCommands.rename(key, newKey)) { command.setResponse( Coder.getErrorResponse(context.getByteBufAllocator(), RedisConstants.ERROR_NO_SUCH_KEY)); return; } command.setResponse(Coder.getSimpleStringResponse(context.getByteBufAllocator(), "OK")); }
Source:
public boolean onOptionsItemSelected(MenuItem menuItem) { if (menuItem.getItemId() == android.R.id.home) { finish(); } else if (menuItem.getItemId() == R.id.action_menu_save){ presenter.saveReminders(); } return super.onOptionsItemSelected(menuItem); }

Target:
public boolean onOptionsItemSelected(MenuItem menuItem) { if (menuItem.getItemId() == android.R.id.home) { presenter.saveReminders(); finish(); } return super.onOptionsItemSelected(menuItem); }
Source:
public static String getAPIUrl(String serviceName, String plan) { if (serviceName == null || serviceName.isEmpty()) return null; final JsonObject services = getVCAPServices(); if (services == null) return null; final JsonObject credentials = getCredentialsObject(services, serviceName, plan); if (credentials.has(URL)) return credentials.get(URL).getAsString(); return null; }

Target:
public static String getAPIUrl(String serviceName, String plan) { if (serviceName == null || serviceName.isEmpty()) return null; final JsonObject services = getVCAPServices(); if (services == null) return null; final JsonObject credentials = getCredentialsObject(services, serviceName, plan); if (credentials != null && credentials.has(URL)) return credentials.get(URL).getAsString(); return null; }
Source:
public void testListAllVirtualMachines() { Iterable<VirtualMachine> vms = env.context.getCloudService().listVirtualMachines(); assertTrue(size(vms) > 1); }

Target:
public void testListAllVirtualMachines() { Iterable<VirtualMachine> vms = env.context.getCloudService().listVirtualMachines(); assertTrue(size(vms) > 1); find(vms, new Predicate<VirtualMachine>() { @Override public boolean apply(VirtualMachine input) { return input.getId().equals(env.virtualMachine.getId()); } }); }
Source:
public EObject createObject(EFactory eFactory, EClassifier type) { EFactory factory = eFactory; if (migrationNeeded) { if (type != null && type.getEPackage() != null && type.getEPackage().getEFactoryInstance() != null) { factory = type.getEPackage().getEFactoryInstance(); } } EObject newObject = super.createObject(factory, type); if (migrationNeeded) { newObject = RepresentationsFileMigrationService.getInstance().updateCreatedObject(newObject, version); } return newObject; }

Target:
public EObject createObject(EFactory eFactory, EClassifier type) { EFactory factory = eFactory; if (migrationNeeded) { if (type != null && type.getEPackage() != null && type.getEPackage().getEFactoryInstance() != null) { factory = type.getEPackage().getEFactoryInstance(); } } return super.createObject(factory, type); }
Source:
public static List<Class<? extends Annotation>> validEnhancedViewSupportAnnotations() { return validEnhancedViewSupportAnnotations; }

Target:
public static List<Class<? extends Annotation>> validEnhancedViewSupportAnnotations() { return Collections.unmodifiableList(validEnhancedViewSupportAnnotations); }
Source:
public AnalyzerConfiguration( final String webWorkerUUID, final DateTimeFormatProvider dateTimeFormatter, final UUIDKeyProvider uuidKeyProvider, final CheckConfiguration checkConfiguration, final RunnerType runnerType ) { this.webWorkerUUID = PortablePreconditions.checkNotNull( "webWorkerUUID", webWorkerUUID ); this.dateTimeFormatter = PortablePreconditions.checkNotNull( "dateTimeFormatter", dateTimeFormatter ); this.uuidKeyProvider = PortablePreconditions.checkNotNull( "uuidKeyProvider", uuidKeyProvider ); this.checkConfiguration = PortablePreconditions.checkNotNull( "checkWhiteList", checkConfiguration ); this.runnerType = PortablePreconditions.checkNotNull( "runnerType", runnerType ); }

Target:
public AnalyzerConfiguration( final String webWorkerUUID, final DateTimeFormatProvider dateTimeFormatter, final UUIDKeyProvider uuidKeyProvider, final CheckConfiguration checkConfiguration, final RunnerType runnerType ) { this.webWorkerUUID = PortablePreconditions.checkNotNull( "webWorkerUUID", webWorkerUUID ); this.dateTimeFormatter = PortablePreconditions.checkNotNull( "dateTimeFormatter", dateTimeFormatter ); this.uuidKeyProvider = PortablePreconditions.checkNotNull( "uuidKeyProvider", uuidKeyProvider ); this.checkConfiguration = PortablePreconditions.checkNotNull( "checkConfiguration", checkConfiguration ); this.runnerType = PortablePreconditions.checkNotNull( "runnerType", runnerType ); }
Source:
protected final Object visitDataReadCommand(InvocationContext ctx, DataCommand command) throws Throwable { if (!readNeedsLock(ctx, command)) { return invokeNext(ctx, command); } try { if (!readNeedsLock(ctx, command)) { return invokeNext(ctx, command); } Object key = command.getKey(); if (!needRemoteLocks(ctx, key, command)) { acquireLocalLock(ctx, command); return invokeNext(ctx, command); } TxInvocationContext txContext = (TxInvocationContext) ctx; LockControlCommand lcc = cf.buildLockControlCommand(key, command.getFlagsBitSet(), txContext.getGlobalTransaction()); Object result = invokeNextThenApply(ctx, lcc, (rCtx, rCommand, rv) -> invokeNext(rCtx, command)); return makeStage(result).andFinally(ctx, command, (rCtx, rCommand, rv, t) -> { if (t != null) { rethrowAndReleaseLocksIfNeeded(rCtx, t); return; } acquireLocalLock(rCtx, (DataCommand) rCommand); }); } catch (Throwable t) { rethrowAndReleaseLocksIfNeeded(ctx, t); throw t; } }

Target:
protected final Object visitDataReadCommand(InvocationContext ctx, DataCommand command) throws Throwable { if (!readNeedsLock(ctx, command)) { return invokeNext(ctx, command); } try { if (!readNeedsLock(ctx, command)) { return invokeNext(ctx, command); } Object key = command.getKey(); if (!needRemoteLocks(ctx, key, command)) { acquireLocalLock(ctx, command); return invokeNext(ctx, command); } TxInvocationContext txContext = (TxInvocationContext) ctx; LockControlCommand lcc = cf.buildLockControlCommand(key, command.getFlagsBitSet(), txContext.getGlobalTransaction()); Object result = invokeNextThenApply(ctx, lcc, (rCtx, rCommand, rv) -> invokeNext(rCtx, command)); return makeStage(result).andFinally(ctx, command, (rCtx, rCommand, rv, t) -> { if (t != null) { rethrowAndReleaseLocksIfNeeded(rCtx, t); } else { acquireLocalLock(rCtx, (DataCommand) rCommand); } }); } catch (Throwable t) { rethrowAndReleaseLocksIfNeeded(ctx, t); throw t; } }
Source:
private int calculateDropdownTop() { int ddTop; DropdownPosition dropdownPosition = options.getDropdownPosition(); if (dropdownPosition == null) { dropdownPosition = DropdownPosition.BELOW; } switch (dropdownPosition) { case BELOW: ddTop = positionBelow(); break; case ABOVE: ddTop = positionAbove(); break; case AUTO: if (options.getDropdownBoundaries() == null && options.getDropdownBoundariesProvider() == null) { ddTop = positionRelativeToWindow(); } else { ddTop = positionRelativeToBoundaries(); } break; default: ddTop = positionBelow(); break; } return ddTop; }

Target:
private int calculateDropdownTop() { int ddTop; DropdownPosition dropdownPosition = options.getDropdownPosition(); switch (dropdownPosition) { case ABOVE: ddTop = positionAbove(); break; case AUTO: if (options.getDropdownBoundaries() == null && options.getDropdownBoundariesProvider() == null) { ddTop = positionRelativeToWindow(); } else { ddTop = positionRelativeToBoundaries(); } break; case BELOW: default: ddTop = positionBelow(); break; } return ddTop; }
Source:
public List<String> getAliases() { List<Object> defaultAliases = (List<Object>) defaults .get(SystemPreference.ALIASES.getKey()); if(prefs != null) { List<Object> list = prefs.getList(SystemPreference.ALIASES.getKey(), defaultAliases); return list.stream() .map(object -> Objects.toString(object, null)) .collect(Collectors.toList()); } else { return defaultAliases.stream() .map(object -> Objects.toString(object, null)) .collect(Collectors.toList()); } }

Target:
public List<String> getAliases() { if(prefs != null) { List<Object> aliases = prefs.getList(SystemPreference.ALIAS .getKey()); aliases.addAll(prefs.getList(SystemPreference.ALIASES.getKey())); return aliases.stream().map(alias -> Objects.toString(alias)) .collect(Collectors.toList()); } else { return Collections.emptyList(); } }
Source:
private void performTopologicalSort() { Set<BatchIdentifier> visitedNodes = new HashSet<>(); Stack<BatchIdentifier> stack = new Stack<>(); for( BatchIdentifier node: latestBatches ) { if( !visitedNodes.contains( node ) ) { topologicalSort( node, visitedNodes, stack ); } } if( !stack.isEmpty() ) { latestBatches.clear(); while( !stack.isEmpty() ) { latestBatches.add( stack.pop() ); } } }

Target:
private void performTopologicalSort() { Set<BatchIdentifier> visitedNodes = new HashSet<>(); Deque<BatchIdentifier> stack = new LinkedList<>(); for( BatchIdentifier node: latestBatches ) { if( !visitedNodes.contains( node ) ) { topologicalSort( node, visitedNodes, stack ); } } if( !stack.isEmpty() ) { latestBatches.clear(); while( !stack.isEmpty() ) { latestBatches.add( stack.pop() ); } } }
Source:
public Comparable getSortKey() { String sourceProviderName = mySourceProvider == null ? "" : mySourceProvider.getName(); final String s = getQualifiedNameSortKey() + "-" + (SdkConstants.FD_MAIN.equals(sourceProviderName) ? "" : sourceProviderName); return s; }

Target:
public Comparable getSortKey() { String sourceProviderName = mySourceProvider == null ? "" : mySourceProvider.getName(); return getQualifiedNameSortKey() + "-" + (SdkConstants.FD_MAIN.equals(sourceProviderName) ? "" : sourceProviderName); }
Source:
private void gracefulShutdown() { vaults.filtered(Vault.NOT_LOCKED).forEach(Vault::prepareForShutdown); if (!vaults.filtered(Vault.NOT_LOCKED).isEmpty()) { ButtonType tryAgainButtonType = new ButtonType( localization.getString("main.gracefulShutdown.button.tryAgain")); ButtonType forceShutdownButtonType = new ButtonType( localization.getString("main.gracefulShutdown.button.forceShutdown")); Alert gracefulShutdownDialog = DialogBuilderUtil.buildGracefulShutdownDialog( localization.getString("main.gracefulShutdown.dialog.title"), localization.getString("main.gracefulShutdown.dialog.header"), localization.getString("main.gracefulShutdown.dialog.content"), tryAgainButtonType, forceShutdownButtonType); Optional<ButtonType> choice = gracefulShutdownDialog.showAndWait(); if (choice.isPresent()) { if (tryAgainButtonType.equals(choice.get())) { gracefulShutdown(); } else if (forceShutdownButtonType.equals(choice.get())) { Platform.runLater(Platform::exit); } } } }

Target:
private void gracefulShutdown() { vaults.filtered(Vault.NOT_LOCKED).forEach(Vault::prepareForShutdown); if (!vaults.filtered(Vault.NOT_LOCKED).isEmpty()) { ButtonType tryAgainButtonType = new ButtonType(localization.getString("main.gracefulShutdown.button.tryAgain")); ButtonType forceShutdownButtonType = new ButtonType(localization.getString("main.gracefulShutdown.button.forceShutdown")); Alert gracefulShutdownDialog = DialogBuilderUtil.buildGracefulShutdownDialog( localization.getString("main.gracefulShutdown.dialog.title"), localization.getString("main.gracefulShutdown.dialog.header"), localization.getString("main.gracefulShutdown.dialog.content"), forceShutdownButtonType, forceShutdownButtonType, tryAgainButtonType); Optional<ButtonType> choice = gracefulShutdownDialog.showAndWait(); choice.ifPresent(btnType -> { if (tryAgainButtonType.equals(btnType)) { gracefulShutdown(); } else if (forceShutdownButtonType.equals(btnType)) { Platform.runLater(Platform::exit); } }); } }
Source:
public static <T> T invokeStatic(String fqcn, String methodName, Class[] argTypes, Object... args) { try { Class clazz = Classes.forName(fqcn); final Method method = clazz.getDeclaredMethod(methodName, argTypes); AccessController.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { method.setAccessible(true); return null; } }); return(T)method.invoke(null, args); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { String msg = "Unable to invoke class method " + fqcn + "#" + methodName + ". Ensure the necessary " + "implementation is in the runtime classpath."; throw new IllegalStateException(msg, e); } }

Target:
public static <T> T invokeStatic(String fqcn, String methodName, Class[] argTypes, Object... args) { try { Class clazz = Classes.forName(fqcn); final Method method = clazz.getDeclaredMethod(methodName, argTypes); AccessController.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { method.setAccessible(true); return null; } }); return(T)method.invoke(null, args); } catch (Exception e) { String msg = "Unable to invoke class method " + fqcn + "#" + methodName + ". Ensure the necessary " + "implementation is in the runtime classpath."; throw new IllegalStateException(msg, e); } }
Source:
private <T> Module bind(List<Class<? extends T>> classes) { Function<Class<? extends T>, Module> bindToModule = clazz -> (Binder binder) -> binder.bind(clazz).in(Singleton.class); List<Module> modules = classes.stream().map(bindToModule).collect(toList()); return combine(modules); }

Target:
private <T> Module bind(List<Class<? extends T>> classes) { Function<Class<? extends T>, Module> bindToModule = clazz -> (Binder binder) -> binder.bind(clazz).in(Singleton.class); List<Module> modules = classes.stream() .map(bindToModule) .collect(toImmutableList()); return combine(modules); }
Source:
public int getActiveSessionsFull() { int sessionCount = 0; try { sessionCount = store.getSize(); } catch (IOException e) { log.error("An error occurred while counting sessions: " + e); } return sessionCount; }

Target:
public int getActiveSessionsFull() { int sessionCount = 0; try { sessionCount = store.getSize(); } catch (IOException e) { log.error("An error occurred while counting sessions: ", e); } return sessionCount; }
Source:
public void iamTokenAndCookieSuccessful() throws Exception { mockWebServer.enqueue(OK_IAM_COOKIE); mockWebServer.enqueue(new MockResponse().setResponseCode(200).addHeader("Set-Cookie", setCookie(iamSession(EXPECTED_OK_COOKIE))) .setBody(hello)); mockIamServer.enqueue(new MockResponse().setResponseCode(200).setBody(IAM_TOKEN)); CloudantClient c = CloudantClientHelper.newMockWebServerClientBuilder(mockWebServer) .iamApiKey(iamApiKey) .build(); String response = c.executeRequest(Http.GET(c.getBaseUri())).responseAsString(); assertEquals("The expected response should be received", hello, response); RecordedRequest[] recordedRequests = takeN(mockWebServer, 2); assertEquals("The request should have been for /_iam_session", "/_iam_session", recordedRequests[0].getPath()); assertThat("The request body should contain the IAM token", recordedRequests[0].getBody().readString(Charset.forName("UTF-8")), containsString(IAM_TOKEN)); assertEquals("The request should have been for /", "/", recordedRequests[1].getPath()); assertThat("The Cookie header should contain the expected session value", recordedRequests[1].getHeader("Cookie"), anyOf(containsString(iamSession(EXPECTED_OK_COOKIE)), containsString(iamSessionUnquoted(EXPECTED_OK_COOKIE)))); RecordedRequest[] recordedIamRequests = takeN(mockIamServer, 1); assertEquals("The request should have been for /oidc/token", iamTokenEndpoint, recordedIamRequests[0].getPath()); assertThat("The request body should contain the IAM API key", recordedIamRequests[0].getBody().readString(Charset.forName("UTF-8")), containsString("apikey="+iamApiKey)); }

Target:
public void iamTokenAndCookieSuccessful() throws Exception { mockWebServer.enqueue(OK_IAM_COOKIE); mockWebServer.enqueue(new MockResponse().setResponseCode(200) .setBody(hello)); mockIamServer.enqueue(new MockResponse().setResponseCode(200).setBody(IAM_TOKEN)); CloudantClient c = CloudantClientHelper.newMockWebServerClientBuilder(mockWebServer) .iamApiKey(iamApiKey) .build(); String response = c.executeRequest(Http.GET(c.getBaseUri())).responseAsString(); assertEquals("The expected response should be received", hello, response); RecordedRequest[] recordedRequests = takeN(mockWebServer, 2); assertEquals("The request should have been for /_iam_session", "/_iam_session", recordedRequests[0].getPath()); assertThat("The request body should contain the IAM token", recordedRequests[0].getBody().readString(Charset.forName("UTF-8")), containsString(IAM_TOKEN)); assertEquals("The request should have been for /", "/", recordedRequests[1].getPath()); assertThat("The Cookie header should contain the expected session value", recordedRequests[1].getHeader("Cookie"), anyOf(containsString(iamSession(EXPECTED_OK_COOKIE)), containsString(iamSessionUnquoted(EXPECTED_OK_COOKIE)))); RecordedRequest[] recordedIamRequests = takeN(mockIamServer, 1); assertEquals("The request should have been for /oidc/token", iamTokenEndpoint, recordedIamRequests[0].getPath()); assertThat("The request body should contain the IAM API key", recordedIamRequests[0].getBody().readString(Charset.forName("UTF-8")), containsString("apikey="+iamApiKey)); }
Source:
static <K, V> HashMap<K, V> empty() { return new HashMap<>(HashTree.empty()); }

Target:
static <K, V> HashMap<K, V> empty() { return (HashMap<K, V>) INSTANCE; }
Source:
public List<GroovyParser> getParsers() { return parsers; }

Target:
public GroovyParser[] getParsers() { return groovyParsers.toArray(new GroovyParser[groovyParsers.size()]); }
Source:
public void update(Observable arg0, Object arg1) { if (arg1 == OoyalaPlayer.TIME_CHANGED_NOTIFICATION) { return; } count++ ; String text="Notification Received: " + arg1 + " - state: " + player.getState() + "count: " +count; SDCardLogcatOoyalaEventsLogger Playbacklog= new SDCardLogcatOoyalaEventsLogger(); Playbacklog.writeToSdcardLog(count,text); Log.d(TAG, "Notification Received: " + arg1 + " - state: " + player.getState()); }

Target:
public void update(Observable arg0, Object arg1) { if (arg1 == OoyalaPlayer.TIME_CHANGED_NOTIFICATION) { return; } String text="Notification Received: " + arg1 + " - state: " + player.getState(); Playbacklog.writeToSdcardLog(text); Log.d(TAG, "Notification Received: " + arg1 + " - state: " + player.getState()); }
Source:
MavenExecutionResult readProjectsWithDependencies(IProjectRegistry state, Collection<IFile> pomFiles, ResolverConfiguration resolverConfiguration, IProgressMonitor monitor) { try { return execute(state, null, resolverConfiguration, new ICallable<MavenExecutionResult>() { public MavenExecutionResult call(IMavenExecutionContext context, IProgressMonitor monitor) throws CoreException { ProjectBuildingRequest configuration = context.newProjectBuildingRequest(); configuration.setResolveDependencies(true); MavenExecutionResult res = getMaven().readMavenProjects( pomFiles.stream().map(file -> file.getLocation().toFile()).collect(Collectors.toList()), configuration); return res; } }, monitor); } catch(CoreException ex) { DefaultMavenExecutionResult result = new DefaultMavenExecutionResult(); result.addException(ex); return result; } }

Target:
MavenExecutionResult readProjectsWithDependencies(IProjectRegistry state, Collection<IFile> pomFiles, ResolverConfiguration resolverConfiguration, IProgressMonitor monitor) { try { return execute(state, null, resolverConfiguration, (context, aMonitor) -> { ProjectBuildingRequest configuration = context.newProjectBuildingRequest(); configuration.setResolveDependencies(true); return getMaven().readMavenProjects( pomFiles.stream().map(file -> file.getLocation().toFile()).collect(Collectors.toList()), configuration); }, monitor); } catch(CoreException ex) { DefaultMavenExecutionResult result = new DefaultMavenExecutionResult(); result.addException(ex); return result; } }
Source:
public WSProfileConfigurationManager(String serverUrl, String cookie, ConfigurationContext configCtxt) throws UserStoreException { try { stub = new RemoteProfileConfigurationManagerServiceStub(configCtxt, serverUrl + SERVICE_NAME); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie); } catch (AxisFault e) { if (log.isDebugEnabled()) { log.debug(CONNECTION_ERROR_MESSAGE, e); } throw new UserStoreException(); } }

Target:
public WSProfileConfigurationManager(String serverUrl, String cookie, ConfigurationContext configCtxt) throws UserStoreException { try { stub = new RemoteProfileConfigurationManagerServiceStub(configCtxt, serverUrl + SERVICE_NAME); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie); } catch (AxisFault e) { throw new UserStoreException("Axis error occurred while creating service client stub",e); } }
Source:
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) { final ConsoleReader reader = shellState.getReader(); AccumuloVFSClassLoader.printClassPath(s -> { try { reader.println(s); } catch (IOException ex) { throw new RuntimeException(ex); } }, true); return 0; }

Target:
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) { final ConsoleReader reader = shellState.getReader(); AccumuloVFSClassLoader.printClassPath(s -> { try { reader.print(s); } catch (IOException ex) { throw new RuntimeException(ex); } }, true); return 0; }
Source:
public ValueMatcher makeValueMatcher(String dimension, final DruidPredicateFactory predicateFactory) { ValueType type = getTypeForDimension(dimension); switch (type) { case LONG: return makeLongValueMatcher(dimension, predicateFactory.makeLongPredicate()); case STRING: return makeStringValueMatcher(dimension, predicateFactory.makeStringPredicate()); default: throw new UOE("Cannot make ValueMatcher for type[%s]", type); } }

Target:
public ValueMatcher makeValueMatcher(String dimension, final DruidPredicateFactory predicateFactory) { ValueType type = getTypeForDimension(dimension); switch (type) { case LONG: return makeLongValueMatcher(dimension, predicateFactory.makeLongPredicate()); case STRING: return makeStringValueMatcher(dimension, predicateFactory.makeStringPredicate()); default: return new BooleanValueMatcher(predicateFactory.makeStringPredicate().apply(null)); } }
Source:
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { try { if (localName.equals(TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORIES) && attributes != null && version.equals("")) { version = attributes.getValue(TaskRepositoriesExternalizer.ATTRIBUTE_VERSION); } else if (version.equals("1")) { handleVersion1(localName, attributes); } else if (version.equals("2")) { handleVersion2(localName, attributes); } } catch (Exception e) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Could not read repositories" , e)); } }

Target:
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { try { if (localName.equals(TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY)) { handleVersion1(localName, attributes); } else if (localName.equals(TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORYV2) || currentV2Repository != null) { handleVersion2(localName, attributes); } } catch (Exception e) { StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Could not read repositories" , e)); } }
Source:
public org.radargun.traits.Query.Builder subquery() { return this; }

Target:
public Query.Builder subquery() { return this; }
Source:
public Color getBackground(Object element, int columnIndex) { String result = ((PMSymbolMatch) element).getResult(); switch (columnIndex) { case 3: try { float resFloat = Float.parseFloat(result); if (resFloat < 0) { return new Color(Display.getCurrent(), StringConverter.asRGB(COLOR_RED)); } else if (resFloat == 0) { return Display.getCurrent().getSystemColor(SWT.COLOR_WHITE); } else { return new Color(Display.getCurrent(), StringConverter.asRGB(COLOR_GREEN)); } } catch (Exception ex) { return Display.getCurrent().getSystemColor(SWT.COLOR_WHITE); } default: return Display.getCurrent().getSystemColor(SWT.COLOR_WHITE); } }

Target:
public Color getBackground(Object element, int columnIndex) { PMSymbolMatch match = (PMSymbolMatch) element; String result = match.getResult(); switch (columnIndex) { case 3: if (result != null && result.equals(PMSymbolMatch.SYMBOL_MATCHED)) { float resFloat = match.getOverheadDifference(); if (resFloat < 0) { return new Color(Display.getCurrent(), StringConverter.asRGB(COLOR_RED)); } else if (resFloat > 0) { return new Color(Display.getCurrent(), StringConverter.asRGB(COLOR_GREEN)); } else { return Display.getCurrent().getSystemColor(SWT.COLOR_WHITE); } } else { return Display.getCurrent().getSystemColor(SWT.COLOR_WHITE); } default: return Display.getCurrent().getSystemColor(SWT.COLOR_WHITE); } }
Source:
public String explain() { return "Access on " + operation + " " + resource.getType() + ":" + resource.getName() + " denied" + (StringUtils.isEmpty(reason) ? "" : "; Reason : " + reason); }

Target:
public String explain() { return "Access on " + (null == operation ? "" : operation + " ") + resource.getType() + ":" + resource.getName() + " denied" + (StringUtils.isEmpty(reason) ? "" : "; Reason : " + reason); }
Source:
private static boolean canPlugInterface(VmNic iface, Guid vdsGroupId) { VDSGroup vdsGroup = DbFacade.getInstance().getVdsGroupDao().get(vdsGroupId); Guid dataCenterId = vdsGroup == null ? null : vdsGroup.getStoragePoolId(); boolean canPlugInterface = canPlugInterfaceInDc(iface, dataCenterId); if (!canPlugInterface) { new VmInterfaceManager().auditLogMacInUseUnplug(iface); } return canPlugInterface; }

Target:
private static boolean canPlugInterface(VmNic iface, Guid vdsGroupId) { VDSGroup vdsGroup = dbFacade.getVdsGroupDao().get(vdsGroupId); Guid dataCenterId = vdsGroup == null ? null : vdsGroup.getStoragePoolId(); boolean canPlugInterface = canPlugInterfaceInDc(iface, dataCenterId); if (!canPlugInterface) { new VmInterfaceManager().auditLogMacInUseUnplug(iface); } return canPlugInterface; }
Source:
public boolean hasMoreCandidates() { return true; }

Target:
public boolean hasMoreCandidates() { return hasMoreCandidates; }