auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void loadFormValues() { final Map<String, List<String>> dropDowns = new HashMap<String, List<String>>(); processDefinitionsListBox.clear(); processDeploymentIdListBox.clear(); currentFilter = new PortableQueryFilter(0, PAGE_SIZE_UNLIMITED, false, "", FIELD_ID_PROCESSNAME, true ); processDefinitionService.call( new RemoteCallback<List<ProcessSummary>>() { @Override public void callback( List<ProcessSummary> processSummaries ) { for ( ProcessSummary sum : processSummaries ) { if ( dropDowns.get( sum.getDeploymentId() ) == null ) { dropDowns.put( sum.getDeploymentId(), new ArrayList<String>() ); } dropDowns.get( sum.getDeploymentId() ).add( sum.getProcessDefId() ); } processDeploymentIdListBox.clear(); processDeploymentIdListBox.addItem( "--------" ); processDeploymentIdListBox.setSelectedIndex( 0 ); for ( String deploymentId : dropDowns.keySet() ) { processDeploymentIdListBox.addItem( deploymentId ); } } } ).getAll( currentFilter ); processDeploymentIdListBox.addChangeHandler( new ChangeHandler() { @Override public void onChange( ChangeEvent event ) { processDefinitionsListBox.clear(); processDefinitionsListBox.addItem( "-------" ); processDefinitionsListBox.setSelectedIndex( 0 ); int selected = processDeploymentIdListBox.getSelectedIndex(); if ( dropDowns.get( processDeploymentIdListBox.getValue( selected ) ) != null ) { for ( String processDef : dropDowns.get( processDeploymentIdListBox.getValue( selected ) ) ) { processDefinitionsListBox.addItem( processDef ); } } } } ); }

Target:
protected void loadFormValues() { final Map<String, List<String>> dropDowns = new HashMap<String, List<String>>(); processDefinitionsListBox.clear(); processDeploymentIdListBox.clear(); currentFilter = new PortableQueryFilter(0, Integer.MAX_VALUE - 1, false, "", FIELD_ID_PROCESSNAME, true); processDefinitionService.call( new RemoteCallback<List<ProcessSummary>>() { @Override public void callback( List<ProcessSummary> processSummaries ) { for ( ProcessSummary sum : processSummaries ) { if ( dropDowns.get( sum.getDeploymentId() ) == null ) { dropDowns.put( sum.getDeploymentId(), new ArrayList<String>() ); } dropDowns.get( sum.getDeploymentId() ).add( sum.getProcessDefId() ); } processDeploymentIdListBox.clear(); processDeploymentIdListBox.addItem( "--------" ); processDeploymentIdListBox.setSelectedIndex( 0 ); for ( String deploymentId : dropDowns.keySet() ) { processDeploymentIdListBox.addItem( deploymentId ); } } } ).getAll( currentFilter ); processDeploymentIdListBox.addChangeHandler( new ChangeHandler() { @Override public void onChange( ChangeEvent event ) { processDefinitionsListBox.clear(); processDefinitionsListBox.addItem( "-------" ); processDefinitionsListBox.setSelectedIndex( 0 ); int selected = processDeploymentIdListBox.getSelectedIndex(); if ( dropDowns.get( processDeploymentIdListBox.getValue( selected ) ) != null ) { for ( String processDef : dropDowns.get( processDeploymentIdListBox.getValue( selected ) ) ) { processDefinitionsListBox.addItem( processDef ); } } } } ); }
Source:
private String surfaceRotationToString(int surfaceRotation) { switch (surfaceRotation) { case Surface.ROTATION_0: return "0"; case Surface.ROTATION_90: return "90"; case Surface.ROTATION_180: return "180"; case Surface.ROTATION_270: return "270"; } throw new IllegalArgumentException("Unsupported surface rotation value" + surfaceRotation); }

Target:
private static String surfaceRotationToString(int surfaceRotation) { switch (surfaceRotation) { case Surface.ROTATION_0: return "0"; case Surface.ROTATION_90: return "90"; case Surface.ROTATION_180: return "180"; case Surface.ROTATION_270: return "270"; } throw new IllegalArgumentException("Unsupported surface rotation value" + surfaceRotation); }
Source:
public void registerDefaults() { this.equipmentTypeMap.put("any", new SpongeEquipmentType("any")); this.equipmentTypeMap.put("equipped", new SpongeEquipmentType("equipped")); final SpongeWornEquipmentType head = new SpongeWornEquipmentType("head", EntityEquipmentSlot.HEAD); this.equipmentTypeMap.put("headwear", head); this.equipmentTypeMap.put("head", head); this.equipmentTypeMap.put("chestplate", new SpongeWornEquipmentType("chestplate", EntityEquipmentSlot.CHEST)); this.equipmentTypeMap.put("leggings", new SpongeWornEquipmentType("leggings", EntityEquipmentSlot.LEGS)); this.equipmentTypeMap.put("boots", new SpongeWornEquipmentType("boots", EntityEquipmentSlot.FEET)); this.equipmentTypeMap.put("worn", new SpongeWornEquipmentType("worn", EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET)); this.equipmentTypeMap.put("main_hand", new SpongeHeldEquipmentType("main_hand", EntityEquipmentSlot.MAINHAND)); this.equipmentTypeMap.put("off_hand", new SpongeHeldEquipmentType("off_hand", EntityEquipmentSlot.MAINHAND)); this.equipmentTypeMap.put("held", new SpongeHeldEquipmentType("held", EntityEquipmentSlot.MAINHAND, EntityEquipmentSlot.OFFHAND)); }

Target:
public void registerDefaults() { this.registerType("any"); this.registerType("equipped"); final SpongeWornEquipmentType head = this.registerWornType("head", EntityEquipmentSlot.HEAD); this.equipmentTypeMap.put("headwear", head); this.registerWornType("chestplate", EntityEquipmentSlot.CHEST); this.registerWornType("leggings", EntityEquipmentSlot.LEGS); this.registerWornType("boots", EntityEquipmentSlot.FEET); this.registerWornType("worn", EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET); this.registerHeldType("main_hand", EntityEquipmentSlot.MAINHAND); this.registerHeldType("off_hand", EntityEquipmentSlot.OFFHAND); this.registerHeldType("held", EntityEquipmentSlot.MAINHAND, EntityEquipmentSlot.OFFHAND); }
Source:
public boolean hasParent() { return this.m_elements.size()>1; }

Target:
public boolean hasParent() { return this.elements.size()>1; }
Source:
public static void set( Object object, String path, Object value ) { final String[] split = StringUtils.split( path, '.' ); Object next = object; for( int i = 0; i < split.length - 1; i++ ) { if( next == null ) break; final Object instance = next; next = reflect( next.getClass() ) .field( split[i] ) .map( f -> f.get( instance ) ) .map( v -> v instanceof Optional ? ( ( Optional ) v ).orElse( null ) : v ) .orElse( null ); } if( next == null ) return; final MutableObject<Object> mutableObject = new MutableObject<>( next ); reflect( next.getClass() ) .field( split[split.length - 1] ) .ifPresent( f -> f.set( mutableObject.getValue(), value ) ); }

Target:
public static void set( Object object, String path, Object value ) { final String[] split = StringUtils.split( path, '.' ); Object next = object; for( int i = 0; i < split.length - 1; i++ ) { Preconditions.checkState( next != null, format("Path [%s] contains nullable objects", path ) ); final Object instance = next; next = reflect( next.getClass() ) .field( split[i] ) .map( f -> f.get( instance ) ) .map( v -> v instanceof Optional ? ( ( Optional ) v ).orElse( null ) : v ) .orElse( null ); } Preconditions.checkState( next != null, format("Path [%s] contains nullable objects", path ) ); final MutableObject<Object> mutableObject = new MutableObject<>( next ); reflect( next.getClass() ) .field( split[split.length - 1] ) .ifPresent( f -> f.set( mutableObject.getValue(), f.type().isOptional() ? Optional.ofNullable( value ) : value ) ); }
Source:
protected void executeCommand() { VmStatic vmStatic = getParameters().getVmStaticData(); boolean vmAddedSuccessfully = false; VdcReturnValueBase returnValueFromAddVm = null; if (VmTemplateHandler.BlankVmTemplateId.equals(vmStatic.getVmtGuid())) { AddVmFromScratchParameters tempVar = new AddVmFromScratchParameters(vmStatic, getParameters() .getDiskInfoList(), getParameters().getStorageDomainId()); tempVar.setSessionId(getParameters().getSessionId()); tempVar.setDontAttachToDefaultTag(true); returnValueFromAddVm = Backend.getInstance().runInternalAction(VdcActionType.AddVmFromScratch, tempVar, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); } else { VmManagementParametersBase tempVar2 = new VmManagementParametersBase(vmStatic); tempVar2.setSessionId(getParameters().getSessionId()); tempVar2.setDontCheckTemplateImages(true); tempVar2.setDontAttachToDefaultTag(true); tempVar2.setDiskInfoDestinationMap(diskInfoDestinationMap); returnValueFromAddVm = Backend.getInstance().runInternalAction(VdcActionType.AddVm, tempVar2, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); } vmAddedSuccessfully = returnValueFromAddVm.getSucceeded(); if (vmAddedSuccessfully) { getTaskIdList().addAll(returnValueFromAddVm.getInternalTaskIdList()); AddVmToPoolParameters tempVar3 = new AddVmToPoolParameters(getParameters().getPoolId(), vmStatic.getId()); tempVar3.setShouldBeLogged(false); setSucceeded(Backend.getInstance().runInternalAction(VdcActionType.AddVmToPool, tempVar3).getSucceeded()); addVmPermission(); } }

Target:
protected void executeCommand() { VmStatic vmStatic = getParameters().getVmStaticData(); VdcReturnValueBase returnValueFromAddVm; if (VmTemplateHandler.BlankVmTemplateId.equals(vmStatic.getVmtGuid())) { returnValueFromAddVm = addVmFromScratch(vmStatic); } else { returnValueFromAddVm = addVm(vmStatic); } if (returnValueFromAddVm.getSucceeded()) { getTaskIdList().addAll(returnValueFromAddVm.getInternalTaskIdList()); addVmToPool(vmStatic); } }
Source:
public QueryFunc(String query) { super(); Matcher m = Pattern.compile("q\\((.*?),\\s*(.*?)\\)").matcher(query); if (!m.matches() || m.groupCount() != 2) { throw new ExpressionException( "Query segment [" + query + "] failed to parse. Groups=[" + m.groupCount() + "]"); } this.queryName = m.group(1).trim(); this.function = m.group(2).trim(); }

Target:
public QueryFunc(String query) { super(); Matcher m = PATTERN_QUERY_FUNC.matcher(query); if (!m.matches() || m.groupCount() != 2) { throw new IllegalArgumentException( "Query segment [" + query + "] failed to parse. Groups=[" + m.groupCount() + "]"); } this.queryName = m.group(1).trim(); this.function = m.group(2).trim(); }
Source:
public String toString() { return "LwM2mJsonElement [baseName=" + baseName + ", baseTime=" + baseTime + ", resourceList=" + jsonArray + "]"; }

Target:
public String toString() { return String.format("LwM2mJsonElement [baseName=%s, baseTime=%d, resourceList=%s]", baseName, baseTime, jsonArray); }
Source:
private void processOptions(RepositoryState state) throws JGitInternalException { if (author == null) author = new PersonIdent(repo); if (name == null) throw new JGitInternalException(JGitText.get().tagNameNotSpecified); if (signed == true) throw new UnsupportedOperationException(); }

Target:
private void processOptions(RepositoryState state) throws JGitInternalException { if (author == null) author = new PersonIdent(repo); if (name == null || !Repository.isValidRefName(Constants.R_TAGS + name)) throw new JGitInternalException(MessageFormat .format(JGitText.get().tagNameInvalid, name == null ? "<null>" : name)); if (signed == true) throw new UnsupportedOperationException(JGitText.get().signingNotSupportedOnTag); }
Source:
public boolean validate() { boolean uploadImageIsValid; setIsValid(true); getInvalidityReasons().clear(); getImageInfoModel().getInvalidityReasons().clear(); if (getImageSourceLocalEnabled().getEntity()) { getImagePath().validateEntity(new IValidation[] { new IValidation() { @Override public ValidationResult validate(Object value) { ValidationResult result = new ValidationResult(); if (value == null || StringHelper.isNullOrEmpty((String) value)) { result.setSuccess(false); result.getReasons().add(constants.emptyImagePath()); } return result; } } }); getImageInfoModel().validateEntity(new IValidation[] { new IValidation() { @Override public ValidationResult validate(Object value) { ValidationResult result = new ValidationResult(); ImageInfoModel.QemuCompat qcowCompat = getImageInfoModel().getQcowCompat(); if (qcowCompat != null && qcowCompat != ImageInfoModel.QemuCompat.V2) { StorageFormatType storageFormatType = getDiskModel().getStorageDomain().getSelectedItem().getStorageFormat(); switch (storageFormatType) { case V1: case V2: case V3: result.setSuccess(false); result.getReasons().add(messages.uploadImageQemuCompatUnsupported( qcowCompat.getValue(), storageFormatType.name())); break; } } return result; } } }); uploadImageIsValid = getImagePath().getIsValid() && getImageInfoModel().validate(); getInvalidityReasons().addAll(getImagePath().getInvalidityReasons()); getInvalidityReasons().addAll(getImageInfoModel().getInvalidityReasons()); } else { uploadImageIsValid = false; } return uploadImageIsValid && diskModel.validate(); }

Target:
public boolean validate() { boolean uploadImageIsValid; setIsValid(true); getInvalidityReasons().clear(); getImageInfoModel().getInvalidityReasons().clear(); if (getImageSourceLocalEnabled().getEntity()) { getImagePath().validateEntity(new IValidation[] { new IValidation() { @Override public ValidationResult validate(Object value) { ValidationResult result = new ValidationResult(); if (value == null || StringHelper.isNullOrEmpty((String) value)) { result.setSuccess(false); result.getReasons().add(constants.emptyImagePath()); } return result; } } }); if (getImagePath().getIsValid()) { getImageInfoModel().validateEntity(new IValidation[]{ new IValidation() { @Override public ValidationResult validate(Object value) { ValidationResult result = new ValidationResult(); ImageInfoModel.QemuCompat qcowCompat = getImageInfoModel().getQcowCompat(); if (qcowCompat != null && qcowCompat != ImageInfoModel.QemuCompat.V2) { StorageFormatType storageFormatType = getDiskModel().getStorageDomain().getSelectedItem().getStorageFormat(); switch (storageFormatType) { case V1: case V2: case V3: result.setSuccess(false); result.getReasons().add(messages.uploadImageQemuCompatUnsupported( qcowCompat.getValue(), storageFormatType.name())); break; } } return result; } } }); } uploadImageIsValid = getImagePath().getIsValid() && getImageInfoModel().validate(); getInvalidityReasons().addAll(getImagePath().getInvalidityReasons()); getInvalidityReasons().addAll(getImageInfoModel().getInvalidityReasons()); } else { uploadImageIsValid = false; } return uploadImageIsValid && diskModel.validate(); }
Source:
AttributeChangeTracker(AttributeSet attributeSet) { attributeSet.attributes().forEach(a -> a.addListener((attr, oldVal) -> { if (this.isTracking) { String name = attr.name(); Object value = attr.get(); changedAttributes.add(name.concat("=").concat(value == null ? "" : value.toString())); } })); }

Target:
AttributeChangeTracker(AttributeSet attributeSet) { attributeSet.attributes().forEach(a -> a.addListener((attr, oldVal) -> { if (this.isTracking) { String name = attr.name(); Object value = attr.get(); changedAttributes.add(name + "=" + (value == null ? "" : value.toString())); } })); }
Source:
private SelectItem createTagsSelect() { SelectItem tagsCb = new SelectItem(); tagsCb.setTitle("<b>Dirac tag</b>"); tagsCb.setType("comboBox"); final AsyncCallback<List<String>> callback = new AsyncCallback<List<String>>() { @Override public void onFailure(Throwable caught) { Layout.getInstance().setWarningMessage("Unable to retrieve configurated list of requirements, setting it to None:<br />" + caught.getMessage()); tagsCb.setValueMap("None"); } @Override public void onSuccess(List<String> result) { if(!result.contains("None")){ result.add("None"); } LinkedHashMap<String, String> requirementsValues = new LinkedHashMap<String, String>(); for (String requirement : result) { requirementsValues.put(requirement, requirement); } tagsCb.setValueMap(requirementsValues); } }; ApplicationImporterService.Util.getInstance().getApplicationImporterRequirements(callback); tagsCb.setValue("None"); return tagsCb; }

Target:
private SelectItem createTagsSelect() { SelectItem tagsCb = new SelectItem(); tagsCb.setTitle("<b>Dirac tag</b>"); tagsCb.setType("comboBox"); final AsyncCallback<List<String>> callback = new AsyncCallback<List<String>>() { @Override public void onFailure(Throwable caught) { Layout.getInstance().setWarningMessage("Unable to retrieve configurated list of requirements, setting it to None:<br />" + caught.getMessage()); tagsCb.setValueMap("None"); } @Override public void onSuccess(List<String> result) { if(!result.contains("None")){ result.add("None"); } Map<String, String> requirementsValues = new LinkedHashMap<>(); for (String requirement : result) { requirementsValues.put(requirement, requirement); } tagsCb.setValueMap(requirementsValues); } }; ApplicationImporterService.Util.getInstance().getApplicationImporterRequirements(callback); tagsCb.setValue("None"); return tagsCb; }
Source:
public Map<String,String> classify(String s) { Map<String,String> ret=new HashMap<String,String>(); if(dclass_index!=0 && s!=null) { long kv; kv=classify(dclass_index,s); if(kv!=0) { int len=kvlength(kv); String id=kvgetid(kv); for(int i=0;i<len;i++) { String key=kvgetkey(kv,i); String value=kvgetvalue(kv,i); ret.put(key,value); } ret.put("id",id); } } return ret; }

Target:
public Map<String,String> classify(String s) { Map<String,String> ret=new HashMap<String,String>(); if(isDClassInitialized && s!=null) { long kv; kv=classify(dclass_index,s); if(kv!=0) { int len=kvlength(kv); String id=kvgetid(kv); for(int i=0;i<len;i++) { String key=kvgetkey(kv,i); String value=kvgetvalue(kv,i); ret.put(key,value); } ret.put("id",id); } } return ret; }
Source:
public static X500Principal asX500Principal(Principal principal, boolean convert) { if (principal instanceof X500Principal) { return (X500Principal) principal; } if (X500_NAME_CLASS != null && X500_NAME_CLASS.isAssignableFrom(principal.getClass())) { try { return (X500Principal) AS_X500_PRINCIPAL_HANLDE.invoke(principal); } catch(RuntimeException | Error ex) { throw ex; } catch(final Throwable t) { throw new RuntimeException(t); } } if (convert) { try { return new X500Principal(principal.getName()); } catch (IllegalArgumentException ignored) { log.trace("Unable to convert to X500Principal", ignored); } } return null; }

Target:
public static X500Principal asX500Principal(Principal principal, boolean convert) { if (principal instanceof X500Principal) { return (X500Principal) principal; } if (X500_NAME_CLASS != null && X500_NAME_CLASS.isAssignableFrom(principal.getClass())) { try { return (X500Principal) AS_X500_PRINCIPAL_HANDLE.invoke(principal); } catch (RuntimeException | Error ex) { throw ex; } catch (Throwable t) { throw new UndeclaredThrowableException(t); } } if (convert) { try { return new X500Principal(principal.getName()); } catch (IllegalArgumentException ignored) { log.trace("Unable to convert to X500Principal", ignored); } } return null; }
Source:
public synchronized void allocateEvaluators(final int evalNum, final int megaBytes, final int cores, final EventHandler<AllocatedEvaluator> evaluatorAllocatedHandler, final List<EventHandler<ActiveContext>> contextActiveHandlerList) { try { ongoingEvaluatorRequest.get().await(); } catch (final InterruptedException e) { LOG.log(Level.WARNING, "Interrupted while waiting for ongoing request to be finished", e); } LOG.log(Level.INFO, "Requesting {0} evaluators...", evalNum); for (int i = 0; i < evalNum; i++) { final Queue<EventHandler<ActiveContext>> handlerQueue = new ConcurrentLinkedQueue<>(contextActiveHandlerList); pendingEvalRequests.add(new Tuple2<>(evaluatorAllocatedHandler, handlerQueue)); } final EvaluatorRequest request = EvaluatorRequest.newBuilder() .setNumber(evalNum) .setNumberOfCores(cores) .setMemory(megaBytes) .build(); ongoingEvaluatorRequest.set(new CountDownLatch(request.getNumber())); evaluatorRequestor.submit(request); }

Target:
public synchronized void allocateEvaluators(final int evalNum, final int megaBytes, final int cores, final EventHandler<AllocatedEvaluator> evaluatorAllocatedHandler, final List<EventHandler<ActiveContext>> contextActiveHandlerList) { while (true) { try { ongoingEvaluatorRequest.get().await(); break; } catch (final InterruptedException e) { LOG.log(Level.WARNING, "Interrupted while waiting for ongoing request to be finished", e); } } LOG.log(Level.INFO, "Requesting {0} evaluators with {1} MB memory and {2} cores...", new Object[]{evalNum, megaBytes, cores}); for (int i = 0; i < evalNum; i++) { final Queue<EventHandler<ActiveContext>> handlerQueue = new ConcurrentLinkedQueue<>(contextActiveHandlerList); pendingEvalRequests.add(new Tuple2<>(evaluatorAllocatedHandler, handlerQueue)); } final EvaluatorRequest request = EvaluatorRequest.newBuilder() .setNumber(evalNum) .setNumberOfCores(cores) .setMemory(megaBytes) .build(); ongoingEvaluatorRequest.set(new CountDownLatch(request.getNumber())); evaluatorRequestor.submit(request); }
Source:
public void onPageStarted(WebView view, String urlClient, Bitmap favicon) { if (webViewLoadingDialog == null) { webViewLoadingDialog = new ProgressDialog(view.getContext(), R.style.WebViewLoadingCircle); webViewLoadingDialog.setCancelable(true); webViewLoadingDialog.setCanceledOnTouchOutside(false); webViewLoadingDialog.setProgressStyle(android.R.style.Widget_ProgressBar_Small); webViewLoadingDialog.show(); } if (callMainMenu && urlClient.equals(Constants.BASE_URL_HTTPS)) { Intent intent = null; if (BuildConfig.CREATE_AT_SCHOOL) { try { intent = new Intent(getBaseContext(), Class.forName("org.catrobat.catroid.createatschool.ui" + ".CreateAtSchoolMainMenuActivity")); } catch (ClassNotFoundException e) { Log.e(TAG, e.getMessage()); } } else if (BuildConfig.PHIRO_CODE) { try { intent = new Intent(getBaseContext(), Class.forName("org.catrobat.catroid.phiro.ui" + ".PhiroMainMenuActivity")); } catch (ClassNotFoundException e) { Log.e(TAG, e.getMessage()); } } else { intent = new Intent(getBaseContext(), MainMenuActivity.class); } startActivity(intent); } }

Target:
public void onPageStarted(WebView view, String urlClient, Bitmap favicon) { if (webViewLoadingDialog == null) { webViewLoadingDialog = new ProgressDialog(view.getContext(), R.style.WebViewLoadingCircle); webViewLoadingDialog.setCancelable(true); webViewLoadingDialog.setCanceledOnTouchOutside(false); webViewLoadingDialog.setProgressStyle(android.R.style.Widget_ProgressBar_Small); webViewLoadingDialog.show(); } if (callMainMenu && urlClient.equals(Constants.BASE_URL_HTTPS)) { startActivity(new Intent(getBaseContext(), MainMenuActivity.class)); } }
Source:
public void testInitVersionRecordManager() { final ObservablePath path = mock(ObservablePath.class); final PlaceRequest placeRequest = mock(PlaceRequest.class); final String version = "version"; final Callback<VersionRecord> callback = (v) -> { }; when(versionRecordManager.getCurrentPath()).thenReturn(path); when(placeRequest.getParameter(anyString(), any())).thenReturn(version); doReturn(callback).when(editor).getSelectVersion(); doReturn(placeRequest).when(editor).getPlace(); editor.initVersionRecordManager(); verify(versionRecordManager).init(version, path, callback); }

Target:
public void testInitVersionRecordManager() { final ObservablePath path = mock(ObservablePath.class); final PlaceRequest placeRequest = mock(PlaceRequest.class); final String version = "version"; final Callback<VersionRecord> selectionCallback = (v) -> { }; when(versionRecordManager.getCurrentPath()).thenReturn(path); when(placeRequest.getParameter(anyString(), any())).thenReturn(version); doReturn(selectionCallback).when(editor).getSelectVersion(); doReturn(placeRequest).when(editor).getPlace(); editor.initVersionRecordManager(); verify(versionRecordManager).init(version, path, selectionCallback); }
Source:
public void run() { Looper.prepare(); try { initRealm(); setLooper(Looper.myLooper()); base.evaluate(); Looper.loop(); } catch (Throwable t) { setAssertionError(t); setUnitTestFailed(); } finally { try { looperTearDown(); closeResources(); if (!runAfterTestIsComplete.isEmpty()) { for (Runnable task : runAfterTestIsComplete) { task.run(); } } } catch (Throwable t) { setAssertionError(t); setUnitTestFailed(); } testComplete(); closeRealms(); signalClosedRealm.countDown(); } }

Target:
public void run() { Looper.prepare(); try { initRealm(); setLooper(Looper.myLooper()); base.evaluate(); Looper.loop(); } catch (Throwable t) { setAssertionError(t); setUnitTestFailed(); } finally { try { looperTearDown(); closeResources(); for (Runnable task : runAfterTestIsComplete) { task.run(); } } catch (Throwable t) { setAssertionError(t); setUnitTestFailed(); } testComplete(); closeRealms(); signalClosedRealm.countDown(); } }
Source:
public void move() { if (!canMove) { return; } x += dx; y += dy; r += dr; observers.get(1).update(this); }

Target:
public void move() { if (!canMove) { return; } x += dx; y += dy; r += dr; observers.forEach(observer -> observer.update(this)); }
Source:
protected void _check(String attributeValue) { if ("a".equals(attributeValue)) { addError("there is an error"); } }

Target:
protected void _check(String attributeValue) { if ("this password is not accepted by the TestValidator validator".equals(attributeValue)) { addError("the validator TestValidator rejected this password"); } }
Source:
public static void main(String... args) { ManageDomainsArguments mdArgs = null; try { mdArgs = new ManageDomainsArguments(); mdArgs.parse(args); if (mdArgs.contains(ARG_LOG_FILE)) { JavaLoggingUtils.addFileHandler(mdArgs.get(ARG_LOG_FILE), mdArgs.get(ARG_LOG_LEVEL)); } } catch (Throwable t) { System.out.println(t.getMessage()); System.exit(1); } try { if (mdArgs.contains(ARG_HELP)) { mdArgs.printHelp(); System.exit(0); } else { ManageDomains util = new ManageDomains(mdArgs); util.init(); util.createConfigurationProvider(); util.runCommand(); } } catch (ManageDomainsResult e) { ManageDomains.exitOnError(e); } System.out.println(ManageDomainsResultEnum.OK.getDetailedMessage()); System.exit(ManageDomainsResultEnum.OK.getExitCode()); }

Target:
public static void main(String... args) { ManageDomainsArguments mdArgs = null; try { mdArgs = new ManageDomainsArguments(); mdArgs.parse(args); if (mdArgs.contains(ARG_LOG_FILE)) { JavaLoggingUtils.addFileHandler(mdArgs.get(ARG_LOG_FILE)); } if (mdArgs.contains(ARG_LOG_LEVEL)) { JavaLoggingUtils.setLogLevel(mdArgs.get(ARG_LOG_LEVEL)); } } catch (Throwable t) { System.out.println(t.getMessage()); System.exit(1); } try { if (mdArgs.contains(ARG_HELP)) { mdArgs.printHelp(); System.exit(0); } else { ManageDomains util = new ManageDomains(mdArgs); util.init(); util.createConfigurationProvider(); util.runCommand(); } } catch (ManageDomainsResult e) { ManageDomains.exitOnError(e); } System.out.println(ManageDomainsResultEnum.OK.getDetailedMessage()); System.exit(ManageDomainsResultEnum.OK.getExitCode()); }
Source:
public void start(BundleContext context) throws Exception { super.start(context); }

Target:
public void start(BundleContext context) throws Exception { super.start(context); String jdkversion = System.getProperty("java.version"); if (!jdkversion.startsWith("11")) { Bundle bundle = Platform.getBundle("org.talend.mdm.ws.jars"); if (bundle != null && (bundle.getState() == Bundle.ACTIVE || bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.STARTING)) { bundle.uninstall(); } } }
Source:
protected String getTraceNotApplyHelpText(ITmfTrace trace) { return "Cannot perform the analysis on this trace because the trace is of the wrong type"; }

Target:
protected String getTraceNotApplyHelpText(ITmfTrace trace) { return Messages.TmfAbstractAnalysisModule_AnalysisDoesNotApply; }
Source:
public Object evaluate(String colorMap, final double min, final double max) { GradientColorMapGenerator generator = null; Resource xmlFile = null; if (!colorMap.startsWith(GradientColorMapGenerator.RGB_INLINEVALUE_MARKER) && !colorMap.startsWith(GradientColorMapGenerator.HEX_INLINEVALUE_MARKER)) { GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class); colorMap = colorMap.replace('\\', '/'); String path = Paths.path("styles","ramps", colorMap+"svg"); xmlFile = loader.get( path ); if( xmlFile.getType() != Type.RESOURCE ){ throw new IllegalArgumentException( "The specified colorMap do not exist in the styles/ramp folder\n" + "Check that " + path + " exsusts abd is an .svg file"); } } try { if (xmlFile != null) { generator = GradientColorMapGenerator.getColorMapGenerator(xmlFile.file()); } else { generator = GradientColorMapGenerator.getColorMapGenerator(colorMap); } return generator.generateColorMap(min, max); } catch (Exception e) { throw new IllegalArgumentException("Filter Function problem for function colormap", e); } }

Target:
public Object evaluate(String colorMap, final double min, final double max) { GradientColorMapGenerator generator = null; Resource xmlFile = null; if (!colorMap.startsWith(GradientColorMapGenerator.RGB_INLINEVALUE_MARKER) && !colorMap.startsWith(GradientColorMapGenerator.HEX_INLINEVALUE_MARKER)) { GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class); colorMap = colorMap.replace('\\', '/'); String path = Paths.path("styles","ramps", colorMap+"svg"); xmlFile = loader.get( path ); if( xmlFile.getType() != Type.RESOURCE ){ throw new IllegalArgumentException( "The specified colorMap do not exist in the styles/ramp folder\n" + "Check that " + path + " exists and is an .svg file"); } } try { if (xmlFile != null) { generator = GradientColorMapGenerator.getColorMapGenerator(xmlFile.file()); } else { generator = GradientColorMapGenerator.getColorMapGenerator(colorMap); } return generator.generateColorMap(min, max); } catch (Exception e) { throw new IllegalArgumentException("Filter Function problem for function colormap", e); } }
Source:
protected FileSystem doCreateFileSystem(final FileName name, final FileSystemOptions fileSystemOptions) throws FileSystemException { final GenericFileName rootName = (GenericFileName) name; Session session; UserAuthenticationData authData = null; try { authData = UserAuthenticatorUtils.authenticate(fileSystemOptions, AUTHENTICATOR_TYPES); session = SftpClientFactory.createConnection(rootName.getHostName(), rootName.getPort(), UserAuthenticatorUtils.getData(authData, UserAuthenticationData.USERNAME, UserAuthenticatorUtils.toChar(rootName.getUserName())), UserAuthenticatorUtils.getData(authData, UserAuthenticationData.PASSWORD, UserAuthenticatorUtils.toChar(rootName.getPassword())), fileSystemOptions); } catch (final Exception e) { logger.info("Creat sftp connection fail: {}", e.getMessage()); throw new FileSystemException("vfs.provider.sftp/connect.error", name, e); } finally { UserAuthenticatorUtils.cleanup(authData); } return new SftpFileSystem(rootName, session, fileSystemOptions); }

Target:
protected FileSystem doCreateFileSystem(final FileName name, final FileSystemOptions fileSystemOptions) throws FileSystemException { final GenericFileName rootName = (GenericFileName) name; Session session; UserAuthenticationData authData = null; try { authData = UserAuthenticatorUtils.authenticate(fileSystemOptions, AUTHENTICATOR_TYPES); session = SftpClientFactory.createConnection(rootName.getHostName(), rootName.getPort(), UserAuthenticatorUtils.getData(authData, UserAuthenticationData.USERNAME, UserAuthenticatorUtils.toChar(rootName.getUserName())), UserAuthenticatorUtils.getData(authData, UserAuthenticationData.PASSWORD, UserAuthenticatorUtils.toChar(rootName.getPassword())), fileSystemOptions); } catch (final Exception e) { logger.error("Create SFTP connection was failed: {}", e.getMessage()); throw new FileSystemException("vfs.provider.sftp/connect.error", name, e); } finally { UserAuthenticatorUtils.cleanup(authData); } return new SftpFileSystem(rootName, session, fileSystemOptions); }
Source:
public void run() { try { do { Thread.sleep(1000); } while (!gameStarted && !gameFinishedByOtherServer); while (!gameFinishedByOtherServer && !field.gameHasFinished()) { for (int clientId : connectedPlayers.keySet()) { ClientInterface ci = connectedPlayers.get(clientId); try { ci.ping(); clientPings.put(clientId, true); } catch (RemoteException e) { if (clientPings.containsKey(clientId) && !clientPings.get(clientId)) { clientCrashed(clientId); } else { clientPings.put(clientId, false); } } } if (!otherServers.isEmpty()) { for (int serverId : otherServers.keySet()) { try { otherServers.get(serverId).heartBeat(serverId); serverPings.put(serverId, 0); } catch (RemoteException e) { serverPings.put(serverId, serverPings.get(serverId) + 1); } } for (int serverId : serverPings.keySet()) { if (serverPings.get(serverId) > 1) { serverCrashed(serverId); } } } Set<Action> actionSet = field.dragonRage(connectedPlayers.keySet()); for (Action a : actionSet) { broadcastActionToClients(a); broadcastActionToServers(a); } Thread.sleep(1000); } if (!gameFinishedByOtherServer) { logger.info("Server " + ID + " finished the game."); EndOfGameAction endAction = new EndOfGameAction(this.ID); broadcastActionToClients(endAction); broadcastActionToServers(endAction); } logger.info("Server " + ID + " is going to sleep and exit now"); Thread.sleep(1000); System.exit(0); } catch (Exception e) { e.printStackTrace(); } }

Target:
public void run() { try { do { Thread.sleep(1000); } while (!gameStarted && !gameFinishedByOtherServer); while (!gameFinishedByOtherServer && !field.gameHasFinished()) { for (int clientId : connectedPlayers.keySet()) { ClientInterface ci = connectedPlayers.get(clientId); try { ci.ping(); clientPings.put(clientId, true); } catch (RemoteException e) { if (clientPings.containsKey(clientId) && !clientPings.get(clientId)) { clientCrashed(clientId); } else { clientPings.put(clientId, false); } } } for (int serverId : otherServers.keySet()) { try { otherServers.get(serverId).heartBeat(serverId); serverPings.put(serverId, 0); } catch (RemoteException e) { serverPings.put(serverId, serverPings.get(serverId) + 1); } } for (int serverId : serverPings.keySet()) { if (serverPings.get(serverId) > 1) { serverCrashed(serverId); } } Set<Action> actionSet = field.dragonRage(connectedPlayers.keySet()); for (Action a : actionSet) { broadcastActionToClients(a); broadcastActionToServers(a); } Thread.sleep(1000); } if (!gameFinishedByOtherServer) { logger.info("Server " + ID + " finished the game."); EndOfGameAction endAction = new EndOfGameAction(this.ID); broadcastActionToClients(endAction); broadcastActionToServers(endAction); } logger.info("Server " + ID + " is going to sleep and exit now"); Thread.sleep(1000); System.exit(0); } catch (Exception e) { e.printStackTrace(); } }
Source:
public synchronized double getMaxCapacityUsageGauge() { return _maxCapacityUsageGauge.getValue(); }

Target:
protected synchronized double getMaxCapacityUsageGauge() { return _maxCapacityUsageGauge.getValue(); }
Source:
protected Optional<DyeColor> getVal(TileEntityShulkerBox container) { return Optional.ofNullable(((IMixinTileEntityShulkerBox) container).getColor()) .map(enumValue -> (DyeColor) (Object) enumValue); }

Target:
protected Optional<DyeColor> getVal(TileEntityShulkerBox container) { EnumDyeColor enumType = ((IMixinTileEntityShulkerBox) container).getColor(); if (enumType != null) { return Optional.of((DyeColor) (Object) enumType); } return Optional.empty(); }
Source:
private void getStateStatus(final TeamWorkFlowArtifact currWf, final IStateToken currState) { if (!this.getValueText().equals("")) { return; } Composite tasksCompositeLabel = new Composite(this.compositeLabel, SWT.LEFT); HashMap<String, Integer> countingMap = new HashMap<String, Integer>(); HashMap<String, Integer> colorMap = new HashMap<String, Integer>(); int numStates = 0; for (IAtsTask task : AtsClientService.get().getTaskService().getTasks(currWf)) { if (countingMap.containsKey(task.getStateDefinition().getName())) { countingMap.put(task.getStateDefinition().getName(), countingMap.get(task.getStateDefinition().getName()) + 1); } else { countingMap.put(task.getStateDefinition().getName(), 1); StateColor currColor = task.getStateDefinition().getColor(); if (currColor == null) { currColor = StateColor.BLACK; } colorMap.put(task.getStateDefinition().getName(), StateColorToSwtColor.convert(currColor)); } numStates++; } if (numStates < 3) { numStates = 3; } tasksCompositeLabel.setLayout(new GridLayout(numStates, false)); tasksCompositeLabel.setLayoutData(new GridData(SWT.NONE, SWT.NONE, true, false)); setValueText(String.format(" Total: %d | Current State \"%s\": %s", numStates, currState.getName(), AtsClientService.get().getTaskService().getTasks(currWf, currState).size())); Label leftAlignLab = new Label(tasksCompositeLabel, SWT.NONE); leftAlignLab.setText("\n "); for (String key : countingMap.keySet()) { Label lab = new Label(tasksCompositeLabel, SWT.NONE); lab.setText("\"" + key + "\"" + ": " + countingMap.get(key) + " "); lab.setForeground(Displays.getSystemColor(colorMap.get(key))); } }

Target:
private void getStateStatus(final TeamWorkFlowArtifact currWf, final IStateToken currState) { if (!this.getValueText().equals("")) { return; } Composite tasksCompositeLabel = new Composite(this.compositeLabel, SWT.LEFT); HashMap<String, Integer> countingMap = new HashMap<String, Integer>(); HashMap<String, Integer> colorMap = new HashMap<String, Integer>(); int numStates = 0; for (IAtsTask task : AtsClientService.get().getTaskService().getTasks(currWf)) { String currTaskName = task.getStateDefinition().getName(); if (countingMap.containsKey(currTaskName)) { countingMap.put(currTaskName, countingMap.get(currTaskName) + 1); } else { countingMap.put(currTaskName, 1); StateColor currColor = task.getStateDefinition().getColor(); if (currColor == null) { currColor = StateColor.BLACK; } colorMap.put(currTaskName, StateColorToSwtColor.convert(currColor)); } numStates++; } if (numStates < 3) { numStates = 3; } tasksCompositeLabel.setLayout(new GridLayout(numStates, false)); tasksCompositeLabel.setLayoutData(new GridData(SWT.NONE, SWT.NONE, true, false)); setValueText(String.format(" Total: %d | Current State \"%s\": %s", numStates, currState.getName(), AtsClientService.get().getTaskService().getTasks(currWf, currState).size())); Label leftAlignLab = new Label(tasksCompositeLabel, SWT.NONE); leftAlignLab.setText(" "); for (String key : countingMap.keySet()) { Label lab = new Label(tasksCompositeLabel, SWT.NONE); lab.setText("\"" + key + "\"" + ": " + countingMap.get(key) + " "); lab.setForeground(Displays.getSystemColor(colorMap.get(key))); } }
Source:
public AccessToken refreshAccessToken() throws IOException { if (!(this.sourceCredentials instanceof IdTokenProvider)) { throw new IOException("Provided sourceToken does not implement IdTokenProvider"); } if (this.sourceCredentials.getAccessToken() == null) { this.sourceCredentials = this.sourceCredentials.createScoped(Arrays.asList(CLOUD_PLATFORM_SCOPE)); } try { this.sourceCredentials.refreshIfExpired(); } catch (IOException e) { throw new IOException("Unable to refresh sourceCredentials", e); } this.idToken = ((IdTokenProvider) this.sourceCredentials).idTokenWithAudience(targetAudience, options); return this.idToken; }

Target:
public AccessToken refreshAccessToken() throws IOException { return this.idTokenProvider.idTokenWithAudience(targetAudience, options); }
Source:
public boolean verify(String hostname, SSLSession session) { X509Certificate[] peerCerts; try { peerCerts = (X509Certificate[]) session.getPeerCertificates(); } catch (SSLPeerUnverifiedException e) { return false; } if (peerCerts == null || peerCerts.length == 0) { return false; } X509Certificate serverCert = peerCerts[0]; try { Collection subjectAltNames = serverCert.getSubjectAlternativeNames(); Iterator sanIt = subjectAltNames.iterator(); while (sanIt.hasNext()) { List list = (List) sanIt.next(); String san = ((String) list.get(1)); Integer type = (Integer) list.get(0); if (type == ALT_DNS_NAME && san.equals(hostname)) { return true; } } } catch (CertificateParsingException e) { return false; } LdapName DN; try { DN = new LdapName(serverCert.getSubjectX500Principal().getName(X500Principal.RFC2253)); } catch (InvalidNameException e) { return false; } String CN = null; for (Rdn rdn : DN.getRdns()) { if ("CN".equals(rdn.getType())) { CN = (String) rdn.getValue(); break; } } if (CN == null) { return false; } else if (CN.startsWith("*")) { if (hostname.endsWith(CN.substring(1))) { return !(hostname.substring(0, hostname.length() - CN.length() + 1).contains(".")); } else { return false; } } else { return CN.equals(hostname); } }

Target:
public boolean verify(String hostname, SSLSession session) { X509Certificate[] peerCerts; try { peerCerts = (X509Certificate[]) session.getPeerCertificates(); } catch (SSLPeerUnverifiedException e) { return false; } if (peerCerts == null || peerCerts.length == 0) { return false; } X509Certificate serverCert = peerCerts[0]; try { Collection<List<?>> subjectAltNames = serverCert.getSubjectAlternativeNames(); if (subjectAltNames != null) { for (List<?> sanit : subjectAltNames) { Integer type = (Integer) sanit.get(0); String san = (String) sanit.get(1); if (type != null && type == ALT_DNS_NAME && verifyHostName(hostname, san)) { return true; } } } } catch (CertificateParsingException e) { return false; } LdapName DN; try { DN = new LdapName(serverCert.getSubjectX500Principal().getName(X500Principal.RFC2253)); } catch (InvalidNameException e) { return false; } String CN = null; for (Rdn rdn : DN.getRdns()) { if ("CN".equals(rdn.getType())) { CN = (String) rdn.getValue(); break; } } return verifyHostName(hostname, CN); }
Source:
public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements) { List<C> result = new ArrayList<C>(); Set<String> ids = new HashSet<String>(); if (ACL.SYSTEM.equals(authentication)) { while (itemGroup != null) { if (itemGroup instanceof AbstractFolder) { if (!((AbstractFolder) itemGroup).getACL().hasPermission(authentication, USE_ITEM)) { continue; } final AbstractFolder<?> folder = AbstractFolder.class.cast(itemGroup); FolderCredentialsProperty property = folder.getProperties().get(FolderCredentialsProperty.class); if (property != null) { for (C c : DomainCredentials.getCredentials( property.getDomainCredentialsMap(), type, domainRequirements, CredentialsMatchers.always())) { if (!(c instanceof IdCredentials) || ids.add(((IdCredentials) c).getId())) { result.add(c); } } } } if (itemGroup instanceof Item) { itemGroup = Item.class.cast(itemGroup).getParent(); } else { break; } } } return result; }

Target:
public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements) { List<C> result = new ArrayList<C>(); Set<String> ids = new HashSet<String>(); if (ACL.SYSTEM.equals(authentication)) { while (itemGroup != null) { if (itemGroup instanceof AbstractFolder) { final AbstractFolder<?> folder = AbstractFolder.class.cast(itemGroup); FolderCredentialsProperty property = folder.getProperties().get(FolderCredentialsProperty.class); if (property != null) { for (C c : DomainCredentials.getCredentials( property.getDomainCredentialsMap(), type, domainRequirements, CredentialsMatchers.always())) { if (!(c instanceof IdCredentials) || ids.add(((IdCredentials) c).getId())) { result.add(c); } } } } if (itemGroup instanceof Item) { itemGroup = Item.class.cast(itemGroup).getParent(); } else { break; } } } return result; }
Source:
protected static void checkBindingsSubsetOfVarOrder(final BindingSet bindingSet, final VariableOrder varOrder) throws IllegalArgumentException { checkNotNull(bindingSet); checkNotNull(varOrder); final Set<String> bindingNames = bindingSet.getBindingNames(); final List<String> varNames = varOrder.getVariableOrders(); checkArgument(varNames.containsAll(bindingNames), "The BindingSet contains a Binding whose name is not part of the VariableOrder."); }

Target:
private static void checkBindingsSubsetOfVarOrder(final BindingSet bindingSet, final VariableOrder varOrder) throws IllegalArgumentException { checkNotNull(bindingSet); checkNotNull(varOrder); final Set<String> bindingNames = bindingSet.getBindingNames(); final List<String> varNames = varOrder.getVariableOrders(); checkArgument(varNames.containsAll(bindingNames), "The BindingSet contains a Binding whose name is not part of the VariableOrder."); }
Source:
public void sessionModeChanged(Mode mode) { if (mode.equals(Mode.attack)) { if (View.isInitialised() && View.getSingleton().isCanGetFocus() && extension.getScannerParam().isPromptInAttackMode()) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { boolean anyInScope = false; for (Context ctx: Model.getSingleton().getSession().getContexts()) { if (ctx.isInScope() && (ctx.getIncludeInContextRegexs() != null && !ctx.getIncludeInContextRegexs().isEmpty())) { anyInScope = true; return; } } String promptMsg = anyInScope ? Constant.messages.getString("ascan.attack.prompt") : Constant.messages.getString("ascan.attack.prompt") + Constant.messages.getString("ascan.attack.prompt.no.scope", Constant.messages.getString("view.toolbar.mode.attack.select")); int res = View.getSingleton().showYesNoRememberDialog( View.getSingleton().getMainFrame(), promptMsg); if (View.getSingleton().isRememberLastDialogChosen()) { extension.getScannerParam().setPromptInAttackMode(false); extension.getScannerParam().setRescanInAttackMode(res == JOptionPane.YES_OPTION); } rescanOnChange = (res == JOptionPane.YES_OPTION); start(); }}); } else { this.rescanOnChange = extension.getScannerParam().isRescanInAttackMode(); this.start(); } } else { this.stop(); } }

Target:
public void sessionModeChanged(Mode mode) { if (mode.equals(Mode.attack)) { if (View.isInitialised() && View.getSingleton().isCanGetFocus() && extension.getScannerParam().isPromptInAttackMode()) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { boolean anyInScope = false; for (Context ctx: Model.getSingleton().getSession().getContexts()) { if (ctx.isInScope() && (ctx.getIncludeInContextRegexs() != null && !ctx.getIncludeInContextRegexs().isEmpty())) { anyInScope = true; break; } } String promptMsg = anyInScope ? Constant.messages.getString("ascan.attack.prompt") : Constant.messages.getString("ascan.attack.prompt") + Constant.messages.getString("ascan.attack.prompt.no.scope", Constant.messages.getString("view.toolbar.mode.attack.select")); int res = View.getSingleton().showYesNoRememberDialog( View.getSingleton().getMainFrame(), promptMsg); if (View.getSingleton().isRememberLastDialogChosen()) { extension.getScannerParam().setPromptInAttackMode(false); extension.getScannerParam().setRescanInAttackMode(res == JOptionPane.YES_OPTION); } rescanOnChange = (res == JOptionPane.YES_OPTION); start(); }}); } else { this.rescanOnChange = extension.getScannerParam().isRescanInAttackMode(); this.start(); } } else { this.stop(); } }
Source:
private DirectoryGroup findDirectoryGroup(String directoryName, Group groupModel) { if (groupModel.isSetId()) { String groupId = groupModel.getId(); return getEntity( DirectoryGroup.class, VdcQueryType.GetDirectoryGroupById, new DirectoryIdQueryParameters(directoryName, ExternalId.fromHex(groupId)), groupId, true ); } if (groupModel.isSetName()) { String groupName = groupModel.getName(); if (groupName.startsWith(directoryName + "/")) { int lastSlash = groupName.lastIndexOf("/"); if (lastSlash != -1) { groupName = groupName.substring(lastSlash + 1); } } return getEntity( DirectoryGroup.class, SearchType.DirectoryGroup, getDirectoryGroupSearchPattern(groupName, directoryName) ); } return null; }

Target:
private DirectoryGroup findDirectoryGroup(String directoryName, Group groupModel) { if (groupModel.isSetId()) { String groupId = groupModel.getId(); return getEntity( DirectoryGroup.class, VdcQueryType.GetDirectoryGroupById, new DirectoryIdQueryParameters(directoryName, ExternalId.fromHex(groupId)), groupId, true ); } if (groupModel.isSetName()) { String groupName = groupModel.getName(); if (groupName.startsWith(directoryName + "/")) { int lastSlash = groupName.lastIndexOf("/"); groupName = groupName.substring(lastSlash + 1); } return getEntity( DirectoryGroup.class, SearchType.DirectoryGroup, getDirectoryGroupSearchPattern(groupName, directoryName) ); } return null; }