auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testNormalize() throws Exception { List<URL> urls = new ArrayList<URL>(); urls.add(new URL("jar:file:/tmp/mesos/slaves/3014350f-cd05-44af-9c9c-3974bdeed86e-S1/frameworks/3014350f-cd05-44af-9c9c-3974bdeed86e-0016/executors/3014350f-cd05-44af-9c9c-3974bdeed86e-S1/runs/3697bc14-f0bd-48b9-8599-9683867eec63/elasticsearch-spark_2.10-2.2.0-m1.jar!/")); urls.add(new URL("jar:file:/tmp/mesos/slaves/3014350f-cd05-44af-9c9c-3974bdeed86e-S1/frameworks/3014350f-cd05-44af-9c9c-3974bdeed86e-0016/executors/3014350f-cd05-44af-9c9c-3974bdeed86e-S1/runs/3697bc14-f0bd-48b9-8599-9683867eec63/./elasticsearch-spark_2.10-2.2.0-m1.jar!/")); File file = new File(urls[0].toString); if (file.createNewFile()){ System.out.println("File is created!"); } else { System.out.println("File already exists."); } List<String> normalized = StringUtils.normalize(urls); System.out.println(normalized); assertEquals(1, normalized.size()); }

Target:
public void testNormalize() throws Exception { List<URL> urls = new ArrayList<URL>(); urls.add(new URL("jar:file:/tmp/mesos/slaves/3014350f-cd05-44af-9c9c-3974bdeed86e-S1/frameworks/3014350f-cd05-44af-9c9c-3974bdeed86e-0016/executors/3014350f-cd05-44af-9c9c-3974bdeed86e-S1/runs/3697bc14-f0bd-48b9-8599-9683867eec63/elasticsearch-spark_2.10-2.2.0-m1.jar!/")); urls.add(new URL("jar:file:/tmp/mesos/slaves/3014350f-cd05-44af-9c9c-3974bdeed86e-S1/frameworks/3014350f-cd05-44af-9c9c-3974bdeed86e-0016/executors/3014350f-cd05-44af-9c9c-3974bdeed86e-S1/runs/3697bc14-f0bd-48b9-8599-9683867eec63/./elasticsearch-spark_2.10-2.2.0-m1.jar!/")); String originPath = url.get(0).toString(); File file = new File(originPath); if (file.createNewFile()){ System.out.println("File is created!"); } else { System.out.println("File already exists."); } Path existingFilePath = Paths.get(originPath); Path symLinkPath = Paths.get(System.getProperty("java.io.tmpdir") + File.separator + "elasticsearch-spark_2.10-2.2.0-m1.jar"); Files.createSymbolicLink(symLinkPath, existingFilePath); Set<String> normalized = StringUtils.normalize(urls); System.out.println(normalized); assertEquals(1, normalized.size()); }
Source:
public boolean matches(Attribute<?> other) { if (other == null) return false; if (!this.definition.equals(other.definition)) return false; if (this.definition.isGlobal()) { if (Matchable.class.isAssignableFrom(this.definition.getType())) { return ((Matchable)value).matches(other.value); } else if (value != null) { return value.equals(other.value); } else { return other.value == null; } } return true; }

Target:
public boolean matches(Attribute<?> other) { if (other == null) return false; if (!this.definition.equals(other.definition)) return false; if (this.definition.isGlobal()) { if (Matchable.class.isAssignableFrom(this.definition.getType())) { return ((Matchable)value).matches(other.value); } else { return Objects.equals(value, other.value); } } return true; }
Source:
protected ConnectionAnchor createAnchor(PrecisionPoint p) { if (!myLinkLFIsEnabled) { return super.createAnchor(p); } if (p == null) { return createDefaultAnchor(); } ConnectionAnchor result; if (followSVGPapyrusPath) { result = new PapyrusSlidableSnapToGridAnchor(this, p); } else { result = new SlidableRoundedRectangleAnchor(this, p); } ((PapyrusSlidableSnapToGridAnchor) result).setEditPart(myHost); return result; }

Target:
protected ConnectionAnchor createAnchor(PrecisionPoint p) { if (!myLinkLFIsEnabled) { return super.createAnchor(p); } if (p == null) { return createDefaultAnchor(); } PapyrusSlidableSnapToGridAnchor result; if (followSVGPapyrusPath) { result = new PapyrusSlidableSnapToGridAnchor(this, p); } else { result = new SlidableRoundedRectangleAnchor(this, p); } result.setEditPart(myHost); return result; }
Source:
public void testExportPackageCannotContainJavaPackages() throws Exception { File config = OSGiTestsActivator.getContext().getDataFile(getName()); Map<String, String> headers = new HashMap<String, String>(); headers.put(Constants.BUNDLE_MANIFESTVERSION, "2"); headers.put(Constants.BUNDLE_SYMBOLICNAME, getName()); headers.put(Constants.EXPORT_PACKAGE, JAVA_LANG); config.mkdirs(); File bundle = SystemBundleTests.createBundle(config, getName(), headers); Equinox equinox = new Equinox(Collections.singletonMap(Constants.FRAMEWORK_STORAGE, config.getAbsolutePath())); try { equinox.start(); BundleContext systemContext = equinox.getBundleContext(); Bundle testBundle = systemContext.installBundle(bundle.toURI().toString()); testBundle.start(); fail("Failed to test Export-Package header"); } catch (BundleException e) { assertTrue("It should throw a Bundle Exception stating Invalid manifest header Export-Package", e.getMessage().contains("Cannot specify java.* packages in Export headers")); } finally { try { equinox.stop(); equinox.waitForStop(10000); } catch (Exception e) { } } }

Target:
public void testExportPackageCannotContainJavaPackages() throws Exception { File config = OSGiTestsActivator.getContext().getDataFile(getName()); Map<String, String> headers = new HashMap<String, String>(); headers.put(Constants.BUNDLE_MANIFESTVERSION, "2"); headers.put(Constants.BUNDLE_SYMBOLICNAME, getName()); headers.put(Constants.EXPORT_PACKAGE, JAVA_LANG); config.mkdirs(); File bundle = SystemBundleTests.createBundle(config, getName(), headers); Equinox equinox = new Equinox(Collections.singletonMap(Constants.FRAMEWORK_STORAGE, config.getAbsolutePath())); try { equinox.start(); BundleContext systemContext = equinox.getBundleContext(); Bundle testBundle = systemContext.installBundle(bundle.toURI().toString()); testBundle.start(); fail("Failed to test Export-Package header"); } catch (BundleException e) { assertEquals("It should throw a bundle exception of type manifest error", BundleException.MANIFEST_ERROR, e.getType()); assertTrue("It should throw a Bundle Exception stating Invalid manifest header Export-Package", e.getMessage().contains("Cannot specify java.* packages in Export headers")); } finally { try { equinox.stop(); equinox.waitForStop(10000); } catch (Exception e) { } } }
Source:
public void verifyTextEllipsis(int anchorIndex) { waitForElementVisibleByElement(noChevrons.get(anchorIndex)); waitForElementVisibleByElement(chevrons.get(anchorIndex)); if (noChevrons.get(anchorIndex).getCssValue("text-overflow").contains("ellipsis") && chevrons.get(anchorIndex).getCssValue("text-overflow").contains("ellipsis")) { PageObjectLogging.log("verifyTextEllipsis", "CSS selector is set to ellipsis", true); } else { PageObjectLogging.log("verifyTextEllipsis", "CSS sellector isn't set to ellipsis", false); } }

Target:
public void verifyTextEllipsis(int anchorIndex) { waitForElementVisibleByElement(noChevrons.get(anchorIndex)); waitForElementVisibleByElement(chevrons.get(anchorIndex)); boolean noChevronsEllipsis = noChevrons.get(anchorIndex).getCssValue("text-overflow").contains("ellipsis"); boolean chevronsEllipsis = chevrons.get(anchorIndex).getCssValue("text-overflow").contains("ellipsis"); if (noChevronsEllipsis && chevronsEllipsis) { PageObjectLogging.log("verifyTextEllipsis", "CSS selector is set to ellipsis", true); } else { PageObjectLogging.log("verifyTextEllipsis", "CSS sellector isn't set to ellipsis", false); } }
Source:
public void test_coverage() { coverageSensor.execute(context); testUtAndItReportsCoverageData(); }

Target:
public void test_coverage() { settings.setProperty(JavaScriptPlugin.LCOV_REPORT_PATHS, TWO_REPORTS); coverageSensor.execute(context); assertTwoReportsCoverageDataPresent(); }
Source:
public static String getStandardDeviationString(double[] standardDeviationDoubles) { if (standardDeviationDoubles == null) { return null; } StringBuilder standardDeviationString = new StringBuilder(standardDeviationDoubles.length * 9); DecimalFormatSymbols decimalFormatSymbols = DecimalFormatSymbols.getInstance(); decimalFormatSymbols.setDecimalSeparator('.'); DecimalFormat exponentialFormat = new DecimalFormat("0.0#E0"); exponentialFormat.setDecimalFormatSymbols(decimalFormatSymbols); DecimalFormat decimalFormat = new DecimalFormat("0.0#"); decimalFormat.setDecimalFormatSymbols(decimalFormatSymbols); boolean first = true; for (double standardDeviationDouble : standardDeviationDoubles) { if (first) { first = false; } else { standardDeviationString.append("/"); } String abbreviated; if (0.001 <= standardDeviationDouble && standardDeviationDouble <= 10000000.0) { abbreviated = decimalFormat.format(standardDeviationDouble); } else { abbreviated = exponentialFormat.format(standardDeviationDouble); } standardDeviationString.append(abbreviated); } return standardDeviationString.toString(); }

Target:
public static String getStandardDeviationString(double[] standardDeviationDoubles) { if (standardDeviationDoubles == null) { return null; } StringBuilder standardDeviationString = new StringBuilder(standardDeviationDoubles.length * 9); DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols(Locale.US); DecimalFormat exponentialFormat = new DecimalFormat("0.0#E0", decimalFormatSymbols); DecimalFormat decimalFormat = new DecimalFormat("0.0#", decimalFormatSymbols); boolean first = true; for (double standardDeviationDouble : standardDeviationDoubles) { if (first) { first = false; } else { standardDeviationString.append("/"); } String abbreviated; if (0.001 <= standardDeviationDouble && standardDeviationDouble <= 10000000.0) { abbreviated = decimalFormat.format(standardDeviationDouble); } else { abbreviated = exponentialFormat.format(standardDeviationDouble); } standardDeviationString.append(abbreviated); } return standardDeviationString.toString(); }
Source:
private void emitAssociationCreatedEvent(String publicIpId, HostAndPort publicEndpoint, Location location, int privatePort) { AssociationMetadata metadata = new AssociationMetadata(publicIpId, publicEndpoint, location, privatePort); for (Map.Entry<AssociationListener, Predicate<? super AssociationMetadata>> entry : associationListeners.entrySet()) { if (entry.getValue().apply(metadata)) { entry.getKey().onAssociationCreated(metadata); } } }

Target:
private void emitAssociationCreatedEvent(String publicIpId, HostAndPort publicEndpoint, Location location, int privatePort) { AssociationMetadata metadata = new AssociationMetadata(publicIpId, publicEndpoint, location, privatePort); for (Map.Entry<AssociationListener, Predicate<? super AssociationMetadata>> entry : associationListeners.entrySet()) { if (entry.getValue().apply(metadata)) { try { entry.getKey().onAssociationCreated(metadata); } catch (Exception e) { Exceptions.propagateIfFatal(e); log.warn("Exception thrown when emitting association creation event " + metadata, e); } } } }
Source:
public void should_use_upstream_trigger() { FreeStyleJob main = jenkins.jobs.create(FreeStyleJob.class); FreeStyleJob trigger = jenkins.jobs.create(FreeStyleJob.class); main.edit(() -> { UpstreamJobTrigger configuration = main.addTrigger(UpstreamJobTrigger.class); configuration.setUpstreamProjects(trigger.name); }); Build build = trigger.scheduleBuild().shouldSucceed(); assertThat(build.getConsole(), containsString("Triggering a new build of %s", main.name)); Build automaticallyStartedBuild = main.build(1); automaticallyStartedBuild.waitUntilFinished(); assertThat(automaticallyStartedBuild.getConsole(), containsString("Started by upstream project \"%s\"", trigger.name)); }

Target:
public void should_use_upstream_trigger() { FreeStyleJob main = jenkins.jobs.create(FreeStyleJob.class); FreeStyleJob trigger = jenkins.jobs.create(FreeStyleJob.class); main.configure(() -> { UpstreamJobTrigger configuration = main.addTrigger(UpstreamJobTrigger.class); configuration.setUpstreamProjects(trigger.name); }); Build build = trigger.scheduleBuild().shouldSucceed(); assertThat(build.getConsole(), containsString("Triggering a new build of %s", main.name)); Build automaticallyStartedBuild = main.build(1); automaticallyStartedBuild.waitUntilFinished(); assertThat(automaticallyStartedBuild.getConsole(), containsString("Started by upstream project \"%s\"", trigger.name)); }
Source:
public LookupElement[] calculateLookupItems(ExpressionContext context) { LookupElement[] lookupItems; int offset = context.getStartOffset(); Project project = context.getProject(); PsiDocumentManager.getInstance(project).commitAllDocuments(); assert context.getEditor() != null; PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(context.getEditor().getDocument()); assert file != null; PsiElement elementAt = file.findElementAt(offset); GoParameters parameters = PsiTreeUtil.getParentOfType(elementAt, GoParameters.class); Set<LookupElement> set = new LinkedHashSet<LookupElement>(); if (parameters == null) { for (String name : myNames) { set.add(LookupElementBuilder.create(name)); } lookupItems = set.toArray(new LookupElement[set.size()]); return lookupItems; } GoParamDefinition parameter = PsiTreeUtil.getParentOfType(elementAt, GoParamDefinition.class); Set<String> parameterNames = new HashSet<String>(); for (GoParameterDeclaration paramDecl : parameters.getParameterDeclarationList()) { for (GoParamDefinition paramDef : paramDecl.getParamDefinitionList()) { if (parameter == paramDef) continue; parameterNames.add(paramDef.getName()); } } for (String name : myNames) { if (parameterNames.contains(name)) { int j = 1; while (parameterNames.contains(name + j)) j++; name += j; } set.add(LookupElementBuilder.create(name)); } lookupItems = set.toArray(new LookupElement[set.size()]); return lookupItems; }

Target:
public LookupElement[] calculateLookupItems(ExpressionContext context) { int offset = context.getStartOffset(); Project project = context.getProject(); PsiDocumentManager.getInstance(project).commitAllDocuments(); assert context.getEditor() != null; PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(context.getEditor().getDocument()); assert file != null; PsiElement elementAt = file.findElementAt(offset); Set<String> parameterNames = new HashSet<String>(); GoParameters parameters = PsiTreeUtil.getParentOfType(elementAt, GoParameters.class); if (parameters != null) { GoParamDefinition parameter = PsiTreeUtil.getParentOfType(elementAt, GoParamDefinition.class); for (GoParameterDeclaration paramDecl : parameters.getParameterDeclarationList()) { for (GoParamDefinition paramDef : paramDecl.getParamDefinitionList()) { if (parameter == paramDef) continue; parameterNames.add(paramDef.getName()); } } } Set<LookupElement> set = new LinkedHashSet<LookupElement>(); for (String name : myNames) { String newName = UniqueNameGenerator.generateUniqueName(name, new Condition<String>() { @Override public boolean value(String s) { return !parameterNames.contains(s); } }); set.add(LookupElementBuilder.create(newName)); } return set.toArray(new LookupElement[set.size()]); }
Source:
public final void setExtendedExpiresOn(final Date extendedExpiresOn) { mExtendedExpiresOn = (Date) extendedExpiresOn.clone(); }

Target:
public final void setExtendedExpiresOn(final Date extendedExpiresOn) { mExtendedExpiresOn = Utility.getImmutableDateObject(extendedExpiresOn); }
Source:
public void warmup() throws InterruptedException { Random random = new Random(); values = new byte[valueCount][]; for (int k = 0; k < values.length; k++) { int delta = maxSize - minSize; int length = delta == 0 ? minSize : minSize + random.nextInt(maxSize - minSize); values[k] = generateByteArray(random, length); } MapStreamer<Integer, Object> streamer = MapStreamerFactory.getInstance(map); for (int key : keys) { streamer.pushEntry(key, values[random.nextInt(values.length)]); } streamer.await(); }

Target:
public void warmup() throws InterruptedException { Random random = new Random(); values = new byte[valueCount][]; for (int k = 0; k < values.length; k++) { int delta = maxSize - minSize; int length = delta == 0 ? minSize : minSize + random.nextInt(delta); values[k] = generateByteArray(random, length); } MapStreamer<Integer, Object> streamer = MapStreamerFactory.getInstance(map); for (int key : keys) { streamer.pushEntry(key, values[random.nextInt(values.length)]); } streamer.await(); }
Source:
protected void firstListenerAdded() { if (getRealm().isCurrent()) { startListeningInternal(); } else { getRealm().asyncExec(() -> { if (hasListeners && !isListening) { startListeningInternal(); } }); } hasListeners = true; super.firstListenerAdded(); }

Target:
protected final void firstListenerAdded() { if (getRealm().isCurrent()) { startListeningInternal(); } else { getRealm().asyncExec(() -> { if (hasListeners && !isListening) { startListeningInternal(); } }); } hasListeners = true; super.firstListenerAdded(); }
Source:
public void play(AudioStream audioStream, String sinkId, PercentType volume) { if (audioStream == null) { throw new NullPointerException("Audio stream cannot be played as it is null."); } AudioSink sink = getSink(sinkId); if (sink != null) { PercentType oldVolume = getVolume(sinkId); if (volume != null) { setVolume(volume, sinkId); } if (sink.getSupportedStreams().stream().anyMatch(clazz -> clazz.isInstance(audioStream))) { try { sink.process(audioStream); } catch (UnsupportedAudioFormatException | UnsupportedAudioStreamException e) { logger.warn("Error playing '{}': {}", audioStream, e.getMessage(), e); } } else { logger.warn("Failed playing audio stream '{}' as audio doesn't support it.", audioStream); } if (oldVolume != null) { setVolume(oldVolume, sinkId); } } else { logger.warn("Failed playing audio stream '{}' as no audio sink was found.", audioStream); } }

Target:
public void play(AudioStream audioStream, String sinkId, PercentType volume) { Objects.requireNonNull(audioStream, "Audio stream cannot be played as it is null."); AudioSink sink = getSink(sinkId); if (sink != null && sink.getSupportedStreams().stream().anyMatch(clazz -> clazz.isInstance(audioStream))) { PercentType oldVolume = getVolume(sinkId); if (volume != null) { setVolume(volume, sinkId); } try { sink.process(audioStream); } catch (UnsupportedAudioFormatException | UnsupportedAudioStreamException e) { logger.warn("Error playing '{}': {}", audioStream, e.getMessage(), e); } finally { if (oldVolume != null) { setVolume(oldVolume, sinkId); } } } else { logger.warn( "Failed playing audio stream '{}' as no audio sink was found or audio sink doesn't support the stream.", audioStream); } }
Source:
public void deleteEntry(@RequestParam String entryId) { Entry entry = entryService.getEntryById(entryId); if (UserServiceImpl.hasRole(0)) { entryService.deleteEntry(entry.getId()); smtpMailSender.sendToParticipants(entry, "Trainings", emailMessages.deleteEntry(entry)); } else { entry.getTraining().setStatus(TrainingStatus.DRAFTED); trainingService.updateTraining(entry.getTraining()); EntryDTO entryDTO = new EntryDTO(entry); entryDTO.setEventDescription("Trainer wants to cancel lecture at " + entry.getBeginTime().toString() + " on training \"" + entry.getTraining().getName() + "\"."); trainingEventService.addEvent(new TrainingEvent(entryDTO)); } }

Target:
public void deleteEntry(@RequestParam String entryId) { Entry entry = entryService.getEntryById(entryId); if (UserUtil.hasRole(0)) { entryService.deleteEntry(entry.getId()); smtpMailSender.sendToUsers(trainingService.getTrainingById(entry.getTraining().getId()).getParticipants(), "Trainings", emailMessages.deleteEntry(entry)); } else { entry.getTraining().setStatus(TrainingStatus.DRAFTED); trainingService.updateTraining(entry.getTraining()); EntryDTO entryDTO = new EntryDTO(entry); entryDTO.setEventDescription(emailMessages.deleteEntryToAdmin(entry)); trainingEventService.addEvent(new TrainingEvent(entryDTO)); smtpMailSender.sendToUsers(userService.getUsersByRole(UserRole.ADMIN), "Changes in training", emailMessages.deleteEntryToAdmin(entry)); } }
Source:
public boolean equals(Object obj) { if (obj instanceof GitModelCommit) { GitModelCommit objCommit = (GitModelCommit) obj; RevCommit objBaseCommit = objCommit.getBaseCommit(); return objBaseCommit == null ? baseCommit == null : objBaseCommit .equals(baseCommit) && objCommit.getRemoteCommit().equals(remoteCommit) && objCommit.getLocation().equals(getLocation()); } return false; }

Target:
public boolean equals(Object obj) { if (obj instanceof GitModelCommit) { GitModelCommit objCommit = (GitModelCommit) obj; boolean equalsBaseCommit; RevCommit objBaseCommit = objCommit.getBaseCommit(); if (objBaseCommit != null) equalsBaseCommit = objBaseCommit.equals(baseCommit); else equalsBaseCommit = baseCommit == null; return equalsBaseCommit && objCommit.getRemoteCommit().equals(remoteCommit) && objCommit.getLocation().equals(getLocation()); } return false; }
Source:
public boolean validateConcurStandardAccountingExtractDetailLineWithObjectCodeOverride(ConcurStandardAccountingExtractDetailLine line, ConcurStandardAccountingExtractBatchReportData reportData, String overriddenObjectCode, String overriddenSubObjectCode) { boolean valid = validateConcurStandardAccountingExtractDetailLineBase(line, reportData); valid = validateAccountingLineWithObjectCodeOverrides(line, reportData, overriddenSubObjectCode, null) && valid; return valid; }

Target:
public boolean validateConcurStandardAccountingExtractDetailLineWithObjectCodeOverride(ConcurStandardAccountingExtractDetailLine line, ConcurStandardAccountingExtractBatchReportData reportData, String overriddenObjectCode, String overriddenSubObjectCode) { boolean valid = validateConcurStandardAccountingExtractDetailLineBase(line, reportData); valid = validateAccountingLineWithObjectCodeOverrides(line, reportData, overriddenObjectCode, overriddenSubObjectCode) && valid; return valid; }
Source:
String getMessagesFromMap(final Map<String, String> keyValues) { ObjectNode node = new ObjectMapper().createObjectNode(); for (Map.Entry<String, String> entry : keyValues.entrySet()) { node.put(entry.getKey(), entry.getValue()); } return node.size() > 0 ? node.toString() : null; }

Target:
String getMessagesFromMap(final Map<String, String> keyValues) { ObjectNode node = objectMapper.createObjectNode(); for (Map.Entry<String, String> entry : keyValues.entrySet()) { node.put(entry.getKey(), entry.getValue()); } return node.size() > 0 ? node.toString() : null; }
Source:
public Object getImage(Object object) { final UMLDiff umlDiff = (UMLDiff)object; Object image = null; if (umlDiff.getDiscriminant() instanceof Element) { image = getImage(getRootAdapterFactory(), umlDiff.getDiscriminant()); } else { image = super.getImage(object); } if (overlayProvider != null && image != null) { Object diffImage = overlayProvider.getComposedImage(umlDiff, image); return ((UMLDiffItemProvider)delegate()).getOverlayImage(object, diffImage); } else { return image; } }

Target:
public Object getImage(Object object) { final UMLDiff umlDiff = (UMLDiff)object; Object image = null; if (umlDiff.getDiscriminant() instanceof Element) { image = getImage(getRootAdapterFactory(), umlDiff.getDiscriminant()); } else { image = super.getImage(object); } if (overlayProvider != null && image != null) { image = overlayProvider.getComposedImage(umlDiff, image); } return image; }
Source:
public void testInvalidDeferredUntilNotSpecified() throws Exception { LocationBackingForm venue = aLocationBackingForm().withId(1L).build(); Date deferredUntil = new Date(new Date().getTime() -(1000 *60 * 60 * 24)); DeferralBackingForm deferralBackingForm = aDeferralBackingForm() .withDeferralReason(aDeferralReasonBackingForm().withId(DEFERRAL_REASON_ID).build()) .withVenue(venue) .withDeferredDonor(aDonorBackingForm().withId(DEFERRED_DONOR_ID).build()) .withDeferredUntil(deferredUntil) .withDeferralDate(new Date()) .build(); mockFormFields(); when(locationRepository.verifyLocationExists(1L)).thenReturn(true); when(donorRepository.verifyDonorExists(DEFERRED_DONOR_ID)).thenReturn(true); when(deferralReasonRepository.verifyDeferralReasonExists(DEFERRAL_REASON_ID)).thenReturn(true); Errors errors = new MapBindingResult(new HashMap<String, String>(), "deferral"); deferralBackingFormValidator.validate(deferralBackingForm, errors); Assert.assertEquals("Errors exist", 1, errors.getErrorCount()); Assert.assertNotNull("Error on deferredUntil", errors.getFieldError("deferredUntil")); Assert.assertEquals("Error on deferral date",0, deferralBackingForm.getDeferredUntil().compareTo(deferralBackingForm.getDeferredUntil())); }

Target:
public void testInvalidDeferredUntilNotSpecified() throws Exception { LocationBackingForm venue = aLocationBackingForm().withId(1L).build(); DeferralBackingForm deferralBackingForm = aDeferralBackingForm() .withDeferralReason(aDeferralReasonBackingForm().withId(DEFERRAL_REASON_ID).build()) .withVenue(venue) .withDeferredDonor(aDonorBackingForm().withId(DEFERRED_DONOR_ID).build()) .withDeferralDate(new Date()) .build(); mockFormFields(); when(locationRepository.verifyLocationExists(1L)).thenReturn(true); when(donorRepository.verifyDonorExists(DEFERRED_DONOR_ID)).thenReturn(true); when(deferralReasonRepository.verifyDeferralReasonExists(DEFERRAL_REASON_ID)).thenReturn(true); Errors errors = new MapBindingResult(new HashMap<String, String>(), "deferral"); deferralBackingFormValidator.validate(deferralBackingForm, errors); Assert.assertEquals("Errors exist", 1, errors.getErrorCount()); Assert.assertNotNull("Error on deferredUntil", errors.getFieldError("deferredUntil")); }
Source:
private boolean isPlatformKeybindingBug517068Fixed() { Bundle bundle = Platform.getBundle("org.eclipse.e4.ui.bindings"); Version currentVersion = bundle.getVersion(); Version fixVersion = new Version(0, 12, 100); return currentVersion.compareTo(fixVersion) >= 0; }

Target:
private boolean isPlatformKeybindingBug517068Fixed() { Bundle bundle = Platform.getBundle("org.eclipse.e4.ui.bindings"); Version currentVersion = bundle.getVersion(); Version fixVersion = new Version(0, 12, 1); return currentVersion.compareTo(fixVersion) >= 0; }
Source:
public int compare(DiagnosticDescriptor o1, DiagnosticDescriptor o2) { String sourceFileName1 = o1.getSourceFileName() != null ? o1.getSourceFileName() : ""; String sourceFileName2 = o2.getSourceFileName() != null ? o2.getSourceFileName() : ""; int result = sourceFileName1.compareTo( sourceFileName2 ); if ( result != 0 ) { return result; } if ( o1.getLine() != null && o2.getLine() != null ) { result = o1.getLine().compareTo( o2.getLine() ); if ( result != 0 ) { return result; } } return o1.getKind().compareTo( o2.getKind() ); }

Target:
public int compare(DiagnosticDescriptor o1, DiagnosticDescriptor o2) { String sourceFileName1 = o1.getSourceFileName() != null ? o1.getSourceFileName() : ""; String sourceFileName2 = o2.getSourceFileName() != null ? o2.getSourceFileName() : ""; int result = sourceFileName1.compareTo( sourceFileName2 ); if ( result != 0 ) { return result; } result = o1.getLine().compareTo( o2.getLine() ); if ( result != 0 ) { return result; } return o1.getKind().compareTo( o2.getKind() ); }
Source:
VoltMessage asVoltMessage() { byte signatureBytes = signature.getBytes(Constants.UTF8ENCODING); ByteBuffer buf = ByteBuffer.allocate(20 + signatureBytes.length); buf.put((byte)ExportManager.RELEASE_BUFFER); buf.putInt(partitionId); buf.putInt(signatureBytes.length); buf.put(signatureBytes); buf.putLong(uso); buf.putInt(tuplesSent); return new BinaryPayloadMessage(new byte[0], buf.array()); }

Target:
VoltMessage asVoltMessage() { byte signatureBytes = signature.getBytes(Constants.UTF8ENCODING); ByteBuffer buf = ByteBuffer.allocate(21 + signatureBytes.length); buf.put((byte)ExportManager.RELEASE_BUFFER); buf.putInt(partitionId); buf.putInt(signatureBytes.length); buf.put(signatureBytes); buf.putLong(uso); buf.putInt(tuplesSent); return new BinaryPayloadMessage(new byte[0], buf.array()); }
Source:
private void suggestEnableAnnotations(Project project, NotificationGroup group) { String annotationProcessorsConfigName = new AnnotationProcessorsConfigurable(project).getDisplayName(); Notification notification = group.createNotification(LombokBundle.message("config.warn.annotation-processing.disabled.title"), LombokBundle.message("config.warn.annotation-processing.disabled.message", project.getName()), NotificationType.ERROR, (not, e) -> { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { enableAnnotations(project); } }); Notifications.Bus.notify(notification, project); }

Target:
private void suggestEnableAnnotations(Project project, NotificationGroup group) { Notification notification = group.createNotification(LombokBundle.message("config.warn.annotation-processing.disabled.title"), LombokBundle.message("config.warn.annotation-processing.disabled.message", project.getName()), NotificationType.ERROR, (not, e) -> { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { enableAnnotations(project); not.expire(); } }); Notifications.Bus.notify(notification, project); }
Source:
DefaultBlockWorker(BlockMasterClientPool blockMasterClientPool, FileSystemMasterClient fileSystemMasterClient, Sessions sessions, BlockStore blockStore, UfsManager ufsManager) { super(ExecutorServiceFactories.fixedThreadPool("block-worker-executor", 4)); mBlockMasterClientPool = blockMasterClientPool; mBlockMasterClient = mBlockMasterClientPool.acquire(); mFileSystemMasterClient = fileSystemMasterClient; mHeartbeatReporter = new BlockHeartbeatReporter(); mMetricsReporter = new BlockMetricsReporter(); mSessions = sessions; mBlockStore = blockStore; mWorkerId = new AtomicReference<>(-1L); mBlockStore.registerBlockStoreEventListener(mHeartbeatReporter); mBlockStore.registerBlockStoreEventListener(mMetricsReporter); mUfsManager = ufsManager; mUnderFileSystemBlockStore = new UnderFileSystemBlockStore(mBlockStore, ufsManager); Metrics.registerGauges(this); }

Target:
DefaultBlockWorker(BlockMasterClientPool blockMasterClientPool, FileSystemMasterClient fileSystemMasterClient, Sessions sessions, BlockStore blockStore, UfsManager ufsManager) { super(ExecutorServiceFactories.fixedThreadPool("block-worker-executor", 5)); mResourceCloser = Closer.create(); mBlockMasterClientPool = mResourceCloser.register(blockMasterClientPool); mFileSystemMasterClient = mResourceCloser.register(fileSystemMasterClient); mHeartbeatReporter = new BlockHeartbeatReporter(); mMetricsReporter = new BlockMetricsReporter(); mSessions = sessions; mBlockStore = blockStore; mWorkerId = new AtomicReference<>(-1L); mBlockStore.registerBlockStoreEventListener(mHeartbeatReporter); mBlockStore.registerBlockStoreEventListener(mMetricsReporter); mUfsManager = ufsManager; mUnderFileSystemBlockStore = new UnderFileSystemBlockStore(mBlockStore, ufsManager); Metrics.registerGauges(this); }
Source:
private ExecutableElement getOverriddenMethod(ExecutableElement currentMethod, TypeElement typeElement) { if ( typeElement == null ) { return null; } for ( Element element : elementUtils.getAllMembers( typeElement ) ) { if ( !element.getKind().equals( ElementKind.METHOD ) ) { continue; } if ( elementUtils.overrides( currentMethod, (ExecutableElement) element, getEnclosingTypeElement( currentMethod ) ) ) { return (ExecutableElement) element; } } return null; }

Target:
private ExecutableElement getOverriddenMethod(ExecutableElement currentMethod, TypeElement typeElement) { if ( typeElement == null ) { return null; } TypeElement enclosingTypeElement = getEnclosingTypeElement( currentMethod ); for ( Element element : elementUtils.getAllMembers( typeElement ) ) { if ( !element.getKind().equals( ElementKind.METHOD ) ) { continue; } if ( elementUtils.overrides( currentMethod, (ExecutableElement) element, enclosingTypeElement ) ) { return (ExecutableElement) element; } } return null; }
Source:
protected void executeCommand() { VmHandler.LockVm(getVm().getDynamicData(), getCompensationContext()); freeLock(); getDisksBasedOnImage(); if (disksImages.isEmpty()) { endSuccessfullySynchronous(); } else { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { MoveOrCopyAllImageGroups(); return null; } }); if (!getReturnValue().getTaskIdList().isEmpty()) { setSucceeded(true); } } }

Target:
protected void executeCommand() { VmHandler.LockVm(getVm().getDynamicData(), getCompensationContext()); freeLock(); if (!hasSnappableDisks()) { endSuccessfullySynchronous(); } else { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { MoveOrCopyAllImageGroups(); return null; } }); if (!getReturnValue().getTaskIdList().isEmpty()) { setSucceeded(true); } } }
Source:
protected boolean executeAnalysis(IProgressMonitor monitor) throws TmfAnalysisException { ITmfTrace trace = getTrace(); if (trace == null) { return false; } IStatus status1 = totalsModule.schedule(); IStatus status2 = eventTypesModule.schedule(); if (!(status1.isOK() && status2.isOK())) { cancelSubAnalyses(); return false; } totalsModule.waitForInitialization(); eventTypesModule.waitForInitialization(); ITmfStateSystem totalsSS = totalsModule.getStateSystem(); ITmfStateSystem eventTypesSS = eventTypesModule.getStateSystem(); if (totalsSS == null || eventTypesSS == null) { throw new IllegalStateException(); } fStatistics = new TmfStateStatistics(totalsSS, eventTypesSS); fInitialized.countDown(); if (!(totalsModule.waitForCompletion(monitor) && eventTypesModule.waitForCompletion(monitor))) { return false; } return true; }

Target:
protected boolean executeAnalysis(IProgressMonitor monitor) throws TmfAnalysisException { ITmfTrace trace = getTrace(); if (trace == null) { fInitialized.countDown(); return false; } IStatus status1 = totalsModule.schedule(); IStatus status2 = eventTypesModule.schedule(); if (!(status1.isOK() && status2.isOK())) { cancelSubAnalyses(); fInitialized.countDown(); return false; } totalsModule.waitForInitialization(); eventTypesModule.waitForInitialization(); ITmfStateSystem totalsSS = totalsModule.getStateSystem(); ITmfStateSystem eventTypesSS = eventTypesModule.getStateSystem(); if (totalsSS == null || eventTypesSS == null) { fInitialized.countDown(); return false; } fStatistics = new TmfStateStatistics(totalsSS, eventTypesSS); fInitialized.countDown(); if (!(totalsModule.waitForCompletion(monitor) && eventTypesModule.waitForCompletion(monitor))) { return false; } return true; }
Source:
void setChangeInfo(ChangeInfo info) { GitwebLink gw = Gerrit.getGitwebLink(); if (gw == null) { project.setInnerText(info.project()); return; } JsArray<RevisionInfo> revisions = info.revisions().values(); for (int i = 0; i < revisions.length(); i++) { if (revisions.get(i)._number() == patchSetId.get()) { String c = revisions.get(i).name(); SafeHtml.setInnerHTML(filePath, formatPath(path, info.project(), c)); SafeHtml.setInnerHTML(project, new SafeHtmlBuilder() .openAnchor() .setAttribute("href", gw.toFile(info.project(), c, "")) .setAttribute("title", gw.getLinkName()) .append(info.project()) .closeAnchor()); break; } } }

Target:
void setChangeInfo(ChangeInfo info) { GitwebLink gw = Gerrit.getGitwebLink(); if (gw != null) { JsArray<RevisionInfo> revisions = info.revisions().values(); for (int i = 0; i < revisions.length(); i++) { if (revisions.get(i)._number() == patchSetId.get()) { String c = revisions.get(i).name(); SafeHtml.setInnerHTML(filePath, formatPath(path, info.project(), c)); SafeHtml.setInnerHTML(project, new SafeHtmlBuilder() .openAnchor() .setAttribute("href", gw.toFile(info.project(), c, "")) .setAttribute("title", gw.getLinkName()) .append(info.project()) .closeAnchor()); return; } } } project.setInnerText(info.project()); }
Source:
public NewEpisodesNotification(Long feedId) { Feed feed = DBReader.getFeed(feedId); FeedPreferences prefs = feed.getPreferences(); if (!prefs.getKeepUpdated() || !prefs.getShowEpisodeNotification()) { dontShowNotification = true; lastEpisodeID = null; return; } List<FeedItem> feedItems = DBReader.getFeedItemList(feed); Long newestEpisodeId = null; if (!feedItems.isEmpty()) { newestEpisodeId = feedItems.get(0).getId(); } dontShowNotification = false; lastEpisodeID = newestEpisodeId; }

Target:
public NewEpisodesNotification(Long feedId) { Feed feed = DBReader.getFeed(feedId); FeedPreferences prefs = feed.getPreferences(); if (!prefs.getKeepUpdated() || !prefs.getShowEpisodeNotification()) { shouldShowNotification = false; lastEpisodeCount = -1; return; } lastEpisodeCount = getNewEpisodeCount(feedId); shouldShowNotification = true; }
Source:
private void reportMetrics(final EventTypeMetrics eventTypeMetrics, final String eventsAsString, final JSONArray eventsAsJsonObjects) { final int numberOfEventsInBatch = eventsAsJsonObjects.length(); eventTypeMetrics.getEventsPerBatchHistogram().update(numberOfEventsInBatch); eventTypeMetrics.getAverageEventSizeInBytesHistogram().update(eventsAsString.length() / numberOfEventsInBatch); }

Target:
private void reportMetrics(final EventTypeMetrics eventTypeMetrics, final String eventsAsString, final JSONArray eventsAsJsonObjects) { final int numberOfEventsInBatch = eventsAsJsonObjects.length(); eventTypeMetrics.getEventsPerBatchHistogram().update(numberOfEventsInBatch); final int averageApproximateEventSize = numberOfEventsInBatch > 0 ? eventsAsString.length() / numberOfEventsInBatch : 0; eventTypeMetrics.getAverageEventSizeInBytesHistogram().update(averageApproximateEventSize); }
Source:
public static String stripWorkDir(File workDir, File file) { final String filePath = file.getPath(); final String workDirPath = workDir.getPath(); if (filePath.length() <= workDirPath.length() || filePath.charAt(workDirPath.length()) != File.separatorChar || !filePath.startsWith(workDirPath)) { File absWd = workDir.isAbsolute() ? workDir : workDir.getAbsoluteFile(); File absFile = file.isAbsolute() ? file : file.getAbsoluteFile(); if (absWd.equals(workDir) && absFile.equals(file)) { return ""; } return stripWorkDir(absWd, absFile); } String relName = filePath.substring(workDirPath.length() + 1); if (File.separatorChar != '/') { relName = relName.replace(File.separatorChar, '/'); } return relName; }

Target:
public static String stripWorkDir(File workDir, File file) { final String filePath = file.getPath(); final String workDirPath = workDir.getPath(); if (filePath.length() <= workDirPath.length() || filePath.charAt(workDirPath.length()) != File.separatorChar || !filePath.startsWith(workDirPath)) { File absWd = workDir.isAbsolute() ? workDir : workDir.getAbsoluteFile(); File absFile = file.isAbsolute() ? file : file.getAbsoluteFile(); if (absWd.equals(workDir) && absFile.equals(file)) { return ""; } return stripWorkDir(absWd, absFile); } String relName = filePath.substring(workDirPath.length() + 1); if (File.separatorChar != '/') relName = relName.replace(File.separatorChar, '/'); return relName; }
Source:
public List<ERepositoryObjectType> getTypes() { return Arrays.asList(ERepositoryObjectType.PROCESS_MR, ERepositoryObjectType.PROCESS_STORM); }

Target:
public List<ERepositoryObjectType> getTypes() { List<ERepositoryObjectType> types = Arrays.asList(ERepositoryObjectType.PROCESS_MR, ERepositoryObjectType.SPARK_JOBLET, ERepositoryObjectType.TEST_CONTAINER); if (ERepositoryObjectType.PROCESS_STORM != null) { types.addAll( Arrays.asList(ERepositoryObjectType.PROCESS_STORM, ERepositoryObjectType.SPARK_STREAMING_JOBLET)); } return types; }
Source:
protected Type visitSymbolReference(SymbolReference node, StackableAstVisitorContext<Context> context) { if (context.getContext().isInLambda()) { LambdaArgumentDeclaration lambdaArgumentDeclaration = context.getContext().getNameToLambdaArgumentDeclarationMap().get(node.getName()); if (lambdaArgumentDeclaration != null) { Type result = getExpressionType(lambdaArgumentDeclaration); return setExpressionType(node, result); } } Type type = symbolTypes.get(Symbol.from(node)); if (type == null) { throw new SemanticException(UNKNOWN_IDENTIFIER, node, "Unknown identifier: %s", node); } return setExpressionType(node, type); }

Target:
protected Type visitSymbolReference(SymbolReference node, StackableAstVisitorContext<Context> context) { if (context.getContext().isInLambda()) { LambdaArgumentDeclaration lambdaArgumentDeclaration = context.getContext().getNameToLambdaArgumentDeclarationMap().get(node.getName()); if (lambdaArgumentDeclaration != null) { Type result = getExpressionType(lambdaArgumentDeclaration); return setExpressionType(node, result); } } Type type = symbolTypes.get(Symbol.from(node)); if (type == null) { throw new SemanticException(MISSING_ATTRIBUTE, node, "Unknown identifier: %s", node); } return setExpressionType(node, type); }
Source:
public AccessControlAccessPlugin(SubjectIdentity subjectIdentity) { this.subjectIdentity = subjectIdentity; this.subjectSupplier = () -> subjectIdentity.getUniqueIdentifier(SecurityUtils.getSubject()); }

Target:
public AccessControlAccessPlugin(SubjectIdentity subjectIdentity) { this.subjectSupplier = () -> subjectIdentity.getUniqueIdentifier(SecurityUtils.getSubject()); }
Source:
public void setEnvironment() throws Exception { super.init(userMode); String gatewayUrl; if (gatewayContextWrk.getContextTenant().getDomain().equals("carbon.super")) { gatewayUrl = gatewayUrlsWrk.getWebAppURLNhttp(); } else { gatewayUrl = gatewayUrlsWrk.getWebAppURLNhttp() + "t/" + gatewayContextWrk.getContextTenant().getDomain() + "/"; } apiEndPointUrl = gatewayUrl + "jaxrs_basic/services/customers/customerservice"; apiProvider = publisherContext.getContextTenant().getContextUser().getUserName(); }

Target:
public void setEnvironment() throws Exception { super.init(userMode); String gatewayUrl; if (gatewayContextWrk.getContextTenant().getDomain().equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) { gatewayUrl = gatewayUrlsWrk.getWebAppURLNhttp(); } else { gatewayUrl = gatewayUrlsWrk.getWebAppURLNhttp() + "t/" + gatewayContextWrk.getContextTenant().getDomain() + "/"; } apiEndPointUrl = gatewayUrl + "jaxrs_basic/services/customers/customerservice"; apiProvider = publisherContext.getContextTenant().getContextUser().getUserName(); }
Source:
public MutableLiveData<RecoverPasswordProgressState> getProgressLiveData() { return mProgressLiveData; }

Target:
public LiveData<Resource<String>> getProgressLiveData() { return mProgressLiveData; }
Source:
public void testGetMediaBytesWithNullByteArray() { when(urlService.fetchUrlConnection(any(String.class))).thenReturn(urlConnection); when(urlService.fetchInputStreamFromConnection(urlConnection)).thenReturn(inputStream); when(urlService.inputStreamToByteArray(any(InputStream.class))).thenReturn(null); Response response = resource.getMediaBytes(key, "Test"); assertEquals(response.getStatusInfo(), Response.Status.INTERNAL_SERVER_ERROR); }

Target:
public void testGetMediaBytesWithNullByteArray() { when(urlService.fetchUrlConnection(any(String.class))).thenReturn(urlConnection); when(urlService.fetchInputStreamFromConnection(urlConnection)).thenReturn(inputStream); when(urlService.inputStreamToByteArray(inputStream)).thenReturn(null); Response response = resource.getMediaBytes(key, "Test"); assertEquals(response.getStatusInfo(), Response.Status.INTERNAL_SERVER_ERROR); }
Source:
public FileSystemWriter<E> load(StorageKey key) throws Exception { Preconditions.checkState(view.getDataset() instanceof FileSystemDataset, "FileSystemWriters cannot create writer for " + view.getDataset()); FileSystemDataset dataset = (FileSystemDataset) view.getDataset(); Path partition = convert.fromKey(key); FileSystemWriter<E> writer = FileSystemWriter.newWriter( dataset.getFileSystem(), new Path(dataset.getDirectory(), partition), conf.getRollIntervalMillis(), conf.getTargetFileSize(), dataset.getDescriptor(), view.getSchema()); PartitionListener listener = dataset.getPartitionListener(); if (listener != null) { listener.partitionAdded( dataset.getNamespace(), dataset.getName(), partition.toString()); } writer.initialize(); return writer; }

Target:
public FileSystemWriter<E> load(StorageKey key) throws Exception { Preconditions.checkState(view.getDataset() instanceof FileSystemDataset, "FileSystemWriters cannot create writer for " + view.getDataset()); FileSystemDataset dataset = (FileSystemDataset) view.getDataset(); Path partition = convert.fromKey(key); FileSystemWriter<E> writer = FileSystemWriter.newWriter( dataset.getFileSystem(), new Path(dataset.getDirectory(), partition), conf.getRollIntervalMillis(), conf.getTargetFileSize(), dataset.getDescriptor(), view.getAccessor().getWriteSchema()); PartitionListener listener = dataset.getPartitionListener(); if (listener != null) { listener.partitionAdded( dataset.getNamespace(), dataset.getName(), partition.toString()); } writer.initialize(); return writer; }
Source:
public static int getCdDeviceIndex(String cdInterface) { switch (cdInterface) { case "scsi": return 2; case "ide": return 2; case "sata": return 2; default: return -1; } }

Target:
public static int getCdDeviceIndex(String cdInterface) { switch (cdInterface) { case "scsi": case "ide": case "sata": return 2; default: return -1; } }
Source:
public TokenRequest setScopes(List<String> scopes) { this.scopes.clear(); this.scopes.addAll(scopes); return this; }

Target:
public TokenRequest setScopes(List<String> scopes) { Objects.requireNonNull(scopes); this.scopes.clear(); this.scopes.addAll(scopes); return this; }
Source:
public static void skipContent(@Nonnull JayceInternalReaderImpl in) throws IOException { }

Target:
public static void skipContent(@Nonnull JayceInternalReaderImpl in) { }
Source:
private void updateClusterMigrationRelatedFields() { Cluster cluster = getSelectedCluster(); Boolean autoCoverge = cluster == null ? null : cluster.getAutoConverge(); if (autoCoverge == null) { autoCoverge = AsyncDataProvider.getInstance().getAutoConverge(); } getAutoConverge().setClusterValue(autoCoverge); Boolean compressed = cluster == null ? null : cluster.getMigrateCompressed(); if (compressed == null) { compressed = AsyncDataProvider.getInstance().getMigrateCompressed(); } getMigrateCompressed().setClusterValue(compressed); Boolean encrypted = cluster == null ? null : cluster.getMigrateEncrypted(); if (encrypted == null) { encrypted = AsyncDataProvider.getInstance().getMigrateEncrypted(); } getMigrateEncrypted().setClusterValue(encrypted); }

Target:
private void updateClusterMigrationRelatedFields() { Cluster cluster = getSelectedCluster(); Boolean autoConverge = cluster == null ? null : cluster.getAutoConverge(); if (autoConverge == null) { autoConverge = AsyncDataProvider.getInstance().getAutoConverge(); } getAutoConverge().setClusterValue(autoConverge); Boolean compressed = cluster == null ? null : cluster.getMigrateCompressed(); if (compressed == null) { compressed = AsyncDataProvider.getInstance().getMigrateCompressed(); } getMigrateCompressed().setClusterValue(compressed); Boolean encrypted = cluster == null ? null : cluster.getMigrateEncrypted(); if (encrypted == null) { encrypted = AsyncDataProvider.getInstance().getMigrateEncrypted(); } getMigrateEncrypted().setClusterValue(encrypted); }