auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void checkinUsers(List<User> users) { EKBCommit commit = getEKBCommit(); preparePersistenceAccess(); for (User user : users) { List<User> result = queryService.queryByString(User.class, "username:\"" + user.getUsername() + "\""); if (result.size() == 0) { LOGGER.info("Create User " + user.getUsername()); commit.addInsert(user); } else if (result.size() == 1) { LOGGER.info("Update User " + user.getUsername()); commit.addUpdate(user); } else { LOGGER.error("Error: Duplicate users in EngSB"); commit.addUpdate(user); } } persistService.commit(commit); revokePersistenceAccess(); }

Target:
public void checkinUsers(List<User> users) { EKBCommit commit = getEKBCommit(); preparePersistenceAccess(); for (User user : users) { List<User> result = queryService.query(User.class, QueryRequest.query("username", user.getUsername())); if (result.size() == 0) { LOGGER.info("Create User " + user.getUsername()); commit.addInsert(user); } else if (result.size() == 1) { LOGGER.info("Update User " + user.getUsername()); commit.addUpdate(user); } else { LOGGER.warn("Error: Duplicate users in EngSB"); commit.addUpdate(user); } } persistService.commit(commit); revokePersistenceAccess(); }
Source:
private List<CreateMessage> produce(int messageNum) { StringBuilder bodyBuilder = new StringBuilder(); bodyBuilder.append(format("%s=%s%n", PRODUCER_NAME, producerName)); bodyBuilder.append(format("%s=%d%n", MESSAGE_NUM, messageNum)); bodyBuilder.append(format("%s=%s%n", MESSAGE_TEXT, "Queue This Way")); CreateMessage message = CreateMessage.builder().ttl(300).body(bodyBuilder.toString()).build(); System.out.format(" Producer %s Message %s:%d%n", producerName, producerName, messageNum); return ImmutableList.of(message); }

Target:
private List<CreateMessage> produce(int messageNum) { StringBuilder bodyBuilder = new StringBuilder(); bodyBuilder.append(format("%s=%s%n", PRODUCER_NAME, producerName)) .append(format("%s=%d%n", MESSAGE_NUM, messageNum)) .append(format("%s=%s%n", MESSAGE_TEXT, "Queue This Way")); CreateMessage message = CreateMessage.builder().ttl(300).body(bodyBuilder.toString()).build(); System.out.format(" Producer %s Message %s:%d%n", producerName, producerName, messageNum); return ImmutableList.of(message); }
Source:
public static WebArchive deployment() { return ShrinkWrap.create(WebArchive.class, "http-test.war") .addPackage(HttpInvocationInContainerTestCase.class.getPackage()) .addAsManifestResource(createPermissionsXmlAsset( new SocketPermission("localhost:8080", "connect,resolve") ), "permissions.xml"); }

Target:
public static WebArchive deployment() { String SERVER_HOST_PORT = TestSuiteEnvironment.getHttpAddress() + ":" + TestSuiteEnvironment.getHttpPort(); return ShrinkWrap.create(WebArchive.class, "http-test.war") .addPackage(HttpInvocationInContainerTestCase.class.getPackage()) .addAsManifestResource(createPermissionsXmlAsset( new SocketPermission(SERVER_HOST_PORT, "connect,resolve") ), "permissions.xml"); }
Source:
public String getLabel(long time){ try { int quark = fValuechange.handleEntry(fBaseQuark, time); ITmfStateInterval value = fSs.querySingleState(time, quark); if (value != null && !value.getStateValue().isNull()) { ITmfStateValue state = value.getStateValue(); return state.toString(); } } catch (StateValueTypeException | TimeRangeException | AttributeNotFoundException | StateSystemDisposedException e) { } return null; }

Target:
public String getLabel(long time){ if (fValuechange == null) { return null; } try { int quark = fValuechange.handleEntry(fBaseQuark, time); ITmfStateInterval value = fSs.querySingleState(time, quark); if (value != null && !value.getStateValue().isNull()) { ITmfStateValue state = value.getStateValue(); return state.toString(); } } catch (StateValueTypeException | TimeRangeException | AttributeNotFoundException | StateSystemDisposedException e) { } return null; }
Source:
public void setValue_serialize_to_xml() throws Exception { final SProcessContractData saProcessContractData = new SProcessContractData(); final MyPojo theName = new MyPojo("theName", "theValue".getBytes()); saProcessContractData.setValue(theName); final Serializable value = saProcessContractData.value; assertThat(value).isInstanceOf(String.class); final Serializable unserializedValue = saProcessContractData.getValue(); assertThat(unserializedValue).isInstanceOf(MyPojo.class); assertThat(((MyPojo) unserializedValue).getName()).isEqualTo("theName"); assertThat(((MyPojo) unserializedValue).getContent()).isEqualTo("theValue".getBytes()); assertThat(value).isEqualTo("<?xml version=\"1.0\" ?><org.bonitasoft.engine.core.contract.data.MyPojo><name>theName</name><content>dGhlVmFsdWU=</content></org.bonitasoft.engine.core.contract.data.MyPojo>"); }

Target:
public void setValue_serialize_to_xml() throws Exception { final SProcessContractData saProcessContractData = new SProcessContractData(); final MyPojo myPojo = new MyPojo("theName", "theValue".getBytes()); saProcessContractData.setValue(myPojo); final Serializable value = saProcessContractData.value; assertThat(value).isInstanceOf(String.class); final Serializable unserializedValue = saProcessContractData.getValue(); assertThat(unserializedValue).isInstanceOf(MyPojo.class); assertThat(((MyPojo) unserializedValue).getName()).isEqualTo("theName"); assertThat(((MyPojo) unserializedValue).getContent()).isEqualTo("theValue".getBytes()); assertThat(value).isEqualTo(XStreamFactory.getXStream().toXML(myPojo)); }
Source:
public String toString() { return "DelimitedParserSchema [delimiterChar=" + delimiterChar + ", quoteChar=" + quoteChar + ", lineDelimiter=" + lineDelimiter + ", fields=" + fields + "]"; }

Target:
public String toString() { return "DelimitedSchema [delimiterChar=" + delimiterChar + ", quoteChar=" + quoteChar + ", lineDelimiter=" + lineDelimiter + ", fieldNames=" + fieldNames + ", fields=" + fields + "]"; }
Source:
public static VirtualFile convertToVirtualFile( @NotNull IResource resource) { if (resource instanceof IProject) { throw new IllegalArgumentException( "The given resource must be a file or a folder. resource: " + resource); } IntelliJProjectImplV2 sarosProject = (IntelliJProjectImplV2) resource .getProject().getAdapter(IntelliJProjectImplV2.class); return sarosProject.findVirtualFile(resource.getProjectRelativePath()); }

Target:
public static VirtualFile convertToVirtualFile( @NotNull IResource resource) { if (resource instanceof IProject) { throw new IllegalArgumentException( "The given resource must be a file or a folder. resource: " + resource); } IntelliJProjectImplV2 wrappedModule = (IntelliJProjectImplV2) resource .getProject().getAdapter(IntelliJProjectImplV2.class); return wrappedModule.findVirtualFile(resource.getProjectRelativePath()); }
Source:
public void close(boolean wait) { for (int i = 0; i < clients.length; i++) { clients[i].close(wait); if (null != clientsV3) { clientsV3[i].close(wait); } } }

Target:
public void close(boolean wait) { for (int i = 0; i < clients.length; i++) { clients[i].close(wait); if (clients != clientsV3Enforced) { clientsV3Enforced[i].close(wait); } } }
Source:
public ATNSimulator setProfile(boolean profile) { ParserATNSimulator previous = getInterpreter(); if ( profile ) { setInterpreter(new ProfilingATNSimulator(this)); } else { if ( previous!=null ) { ParserATNSimulator interp = new ParserATNSimulator(this, getATN(), previous.decisionToDFA, previous.getSharedContextCache()); setInterpreter(interp); } } return previous; }

Target:
public void setProfile(boolean profile) { ParserATNSimulator interp = getInterpreter(); if ( profile ) { if (!(interp instanceof ProfilingATNSimulator)) { setInterpreter(new ProfilingATNSimulator(this)); } } else if (interp instanceof ProfilingATNSimulator) { setInterpreter(new ParserATNSimulator(this, getATN(), interp.decisionToDFA, interp.getSharedContextCache())); } }
Source:
protected byte[] readIncludedConfig(String relPath) throws ConfigInvalidException { final File file; if (relPath.startsWith("~/")) { file = fs.resolve(fs.userHome(), relPath.substring(2)); } else { file = fs.resolve(configFile.getParentFile(), relPath); } if (!file.exists()) return null; try { return IO.readFully(file); } catch (IOException ioe) { throw new ConfigInvalidException(MessageFormat .format(JGitText.get().cannotReadFile, relPath), ioe); } }

Target:
protected byte[] readIncludedConfig(String relPath) throws ConfigInvalidException { final File file; if (relPath.startsWith("~/")) { file = fs.resolve(fs.userHome(), relPath.substring(2)); } else { file = fs.resolve(configFile.getParentFile(), relPath); } if (!file.exists()) { return null; } try { return IO.readFully(file); } catch (IOException ioe) { throw new ConfigInvalidException(MessageFormat .format(JGitText.get().cannotReadFile, relPath), ioe); } }
Source:
public boolean startWork(String id) { synchronized (mLock) { return startWork(id, null); } }

Target:
public boolean startWork(String id) { return startWork(id, null); }
Source:
public void addDependency(final ProcessorGraphNode node) { assert node != this; this.dependencies.add(node); node.addRequirement(this); }

Target:
public void addDependency(final ProcessorGraphNode node) { Assert.isTrue(node != this, "A processor can't depends on himself"); this.dependencies.add(node); node.addRequirement(this); }
Source:
public static VmNetworkInterface map(NIC model, VmNetworkInterface template) { VmNetworkInterface entity = template != null ? template : new VmNetworkInterface(); if (model.isSetVm() && model.getVm().isSetId()) { entity.setVmId(new Guid(model.getVm().getId())); } if (model.isSetId()) { entity.setId(new Guid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetMac() && model.getMac().isSetAddress()) { entity.setMacAddress(model.getMac().getAddress()); } if (model.isSetNetwork() && model.getNetwork().isSetName()) { entity.setNetworkName(model.getNetwork().getName()); } if (model.isSetInterface()) { NicInterface nicType = NicInterface.fromValue(model.getInterface()); if (nicType != null) { entity.setType(map(nicType)); } } if (model.isSetActive()) { entity.setActive(model.isActive()); } model.setPromisc(entity.isPromisc()); return entity; }

Target:
public static VmNetworkInterface map(NIC model, VmNetworkInterface template) { VmNetworkInterface entity = template != null ? template : new VmNetworkInterface(); if (model.isSetVm() && model.getVm().isSetId()) { entity.setVmId(new Guid(model.getVm().getId())); } if (model.isSetId()) { entity.setId(new Guid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetMac() && model.getMac().isSetAddress()) { entity.setMacAddress(model.getMac().getAddress()); } if (model.isSetNetwork() && model.getNetwork().isSetName()) { entity.setNetworkName(model.getNetwork().getName()); } if (model.isSetInterface()) { NicInterface nicType = NicInterface.fromValue(model.getInterface()); if (nicType != null) { entity.setType(map(nicType)); } } if (model.isSetActive()) { entity.setActive(model.isActive()); } if (model.isSetPromisc()) { model.setPromisc(entity.isPromisc()); } return entity; }
Source:
protected void doExecute() { Collection<EObject> impactedEObjects = new ArrayList<EObject>(); DslCommonPlugin.PROFILER.startWork(SiriusTasksKey.CLEANING_REMOVEDANGLING_KEY); for (EObject eObject : toRemoveXRefFrom) { ECrossReferenceAdapter filteredCrossReferencer = new SiriusCrossReferenceAdapter(domain.getResourceSet(), (DAnalysisSessionImpl) session) { @Override public Collection<Setting> getInverseReferences(EObject eObject, boolean resolve) { Collection<Setting> settings = xReferencer.getInverseReferences(eObject, resolve); Collection<Setting> settingsToTryToUnset = new ArrayList<>(); for (Setting s : settings) { if (!toRemoveXRefFrom.contains(s.getEObject())) { settingsToTryToUnset.add(s); } } return settingsToTryToUnset; } }; impactedEObjects.addAll(modelAccessor.eRemoveInverseCrossReferences(eObject, filteredCrossReferencer, isReferenceToIgnorePredicate)); } for (EObject impactedEObject : impactedEObjects) { Resource resource = impactedEObject.eResource(); if (semanticResources.contains(resource)) { refreshEditorsPrecommitListener.disable(); break; } } DslCommonPlugin.PROFILER.stopWork(SiriusTasksKey.CLEANING_REMOVEDANGLING_KEY); toRemoveXRefFrom.clear(); modelAccessor = null; xReferencer = null; semanticResources = null; refreshEditorsPrecommitListener = null; }

Target:
protected void doExecute() { Collection<EObject> impactedEObjects = new ArrayList<EObject>(); DslCommonPlugin.PROFILER.startWork(SiriusTasksKey.CLEANING_REMOVEDANGLING_KEY); for (EObject eObject : toRemoveXRefFrom) { ECrossReferenceAdapter filteredCrossReferencer = new SiriusCrossReferenceAdapter((DAnalysisSessionImpl) session) { @Override public Collection<Setting> getInverseReferences(EObject eObject, boolean resolve) { Collection<Setting> settings = xReferencer.getInverseReferences(eObject, resolve); Collection<Setting> settingsToTryToUnset = new ArrayList<>(); for (Setting s : settings) { if (!toRemoveXRefFrom.contains(s.getEObject())) { settingsToTryToUnset.add(s); } } return settingsToTryToUnset; } }; impactedEObjects.addAll(modelAccessor.eRemoveInverseCrossReferences(eObject, filteredCrossReferencer, isReferenceToIgnorePredicate)); } for (EObject impactedEObject : impactedEObjects) { Resource resource = impactedEObject.eResource(); if (semanticResources.contains(resource)) { refreshEditorsPrecommitListener.disable(); break; } } DslCommonPlugin.PROFILER.stopWork(SiriusTasksKey.CLEANING_REMOVEDANGLING_KEY); toRemoveXRefFrom.clear(); modelAccessor = null; xReferencer = null; semanticResources = null; refreshEditorsPrecommitListener = null; }
Source:
public void shouldNotSupportMultipleProvidersWithSameDescriptor() { IndexProvider.Descriptor descriptor = new IndexProvider.Descriptor( "provider", "1.2" ); IndexProvider provider1 = mock( IndexProvider.class ); when( provider1.getProviderDescriptor() ).thenReturn( descriptor ); IndexProvider provider2 = mock( IndexProvider.class ); when( provider2.getProviderDescriptor() ).thenReturn( descriptor ); try { new DefaultIndexProviderMap( provider1, singletonList( provider2 ) ); fail( "Should have failed" ); } catch ( IllegalArgumentException e ) { } }

Target:
public void shouldNotSupportMultipleProvidersWithSameDescriptor() { Descriptor descriptor = new Descriptor( "provider", "1.2" ); IndexProvider provider1 = mock( IndexProvider.class ); when( provider1.getProviderDescriptor() ).thenReturn( descriptor ); IndexProvider provider2 = mock( IndexProvider.class ); when( provider2.getProviderDescriptor() ).thenReturn( descriptor ); assertThrows( IllegalArgumentException.class, () -> new DefaultIndexProviderMap( provider1, singletonList( provider2 ) ) ); }
Source:
public void setList_managedRealmList() { dynamicRealm.executeTransaction(new DynamicRealm.Transaction() { @Override public void execute(DynamicRealm realm) { realm.deleteAll(); DynamicRealmObject allTypes = realm.createObject(AllTypes.CLASS_NAME); allTypes.setString(AllTypes.FIELD_STRING, "bender"); DynamicRealmObject anotherAllTypes; { anotherAllTypes = realm.createObject(AllTypes.CLASS_NAME); anotherAllTypes.setString(AllTypes.FIELD_STRING, "bender2"); DynamicRealmObject dog = realm.createObject(Dog.CLASS_NAME); dog.setString(Dog.FIELD_NAME, "nibbler"); anotherAllTypes.getList(AllTypes.FIELD_REALMLIST).add(dog); } allTypes.setList(AllTypes.FIELD_REALMLIST, anotherAllTypes.getList(AllTypes.FIELD_REALMLIST)); } }); DynamicRealmObject allTypes = dynamicRealm.where(AllTypes.CLASS_NAME) .equalTo(AllTypes.FIELD_STRING, "bender") .findFirst(); assertEquals(1, allTypes.getList(AllTypes.FIELD_REALMLIST).size()); assertEquals("nibbler", allTypes.getList(AllTypes.FIELD_REALMLIST).first().get(Dog.FIELD_NAME)); dynamicRealm.executeTransaction(new DynamicRealm.Transaction() { @Override public void execute(DynamicRealm realm) { DynamicRealmObject anotherAllTypes = dynamicRealm.where(AllTypes.CLASS_NAME) .equalTo(AllTypes.FIELD_STRING, "bender2") .findFirst(); anotherAllTypes.getList(AllTypes.FIELD_REALMLIST).get(0).setString(Dog.FIELD_NAME, "nibbler_modified"); } }); assertEquals("nibbler_modified", allTypes.getList(AllTypes.FIELD_REALMLIST).first().get(Dog.FIELD_NAME)); }

Target:
public void setList_managedRealmList() { dynamicRealm.executeTransaction(new DynamicRealm.Transaction() { @Override public void execute(DynamicRealm realm) { realm.deleteAll(); DynamicRealmObject allTypes = realm.createObject(AllTypes.CLASS_NAME); allTypes.setString(AllTypes.FIELD_STRING, "bender"); DynamicRealmObject anotherAllTypes; { anotherAllTypes = realm.createObject(AllTypes.CLASS_NAME); anotherAllTypes.setString(AllTypes.FIELD_STRING, "bender2"); DynamicRealmObject dog = realm.createObject(Dog.CLASS_NAME); dog.setString(Dog.FIELD_NAME, "nibbler"); anotherAllTypes.getList(AllTypes.FIELD_REALMLIST).add(dog); } allTypes.setList(AllTypes.FIELD_REALMLIST, anotherAllTypes.getList(AllTypes.FIELD_REALMLIST)); } }); DynamicRealmObject allTypes = dynamicRealm.where(AllTypes.CLASS_NAME) .equalTo(AllTypes.FIELD_STRING, "bender") .findFirst(); assertEquals(1, allTypes.getList(AllTypes.FIELD_REALMLIST).size()); assertEquals("nibbler", allTypes.getList(AllTypes.FIELD_REALMLIST).first().get(Dog.FIELD_NAME)); dynamicRealm.executeTransaction(new DynamicRealm.Transaction() { @Override public void execute(DynamicRealm realm) { DynamicRealmObject anotherAllTypes = dynamicRealm.where(AllTypes.CLASS_NAME) .equalTo(AllTypes.FIELD_STRING, "bender2") .findFirst(); anotherAllTypes.getList(AllTypes.FIELD_REALMLIST).first() .setString(Dog.FIELD_NAME, "nibbler_modified"); } }); assertEquals("nibbler_modified", allTypes.getList(AllTypes.FIELD_REALMLIST).first().get(Dog.FIELD_NAME)); }
Source:
Common(ForgeConfigSpec.Builder builder) { builder.comment("Common configuration settings") .push("common"); versionCheck = builder.comment("Check for new versions of Vampirism on startup").define("versionCheck", true); collectStats = builder.comment("Send mod version, MC version and mod count to mod author").define("collectStats", true); disableVampireForest = builder.comment("Disable vampire forest generation").define("disableVampireForest", false); disableHunterTentGen = builder.comment("Disable hunter camp generation").define("disableHunterTentGen", false); builder.pop(); }

Target:
Common(ForgeConfigSpec.Builder builder) { builder.comment("Common configuration settings") .push("common"); versionCheck = builder.comment("Check for new versions of Vampirism on startup").define("versionCheck", true); collectStats = builder.comment("Send mod version, MC version and mod count to mod author").define("collectStats", true); builder.pop(); }
Source:
public String getName() { if (getClass().getPackage().getImplementationTitle() == null) { return "Glowstone"; } else { return getClass().getPackage().getImplementationTitle(); } }

Target:
public String getName() { if (isNameNull) { return "Glowstone"; } else { return getClass().getPackage().getImplementationTitle(); } }
Source:
private void waitFor( ForsetiLockManager.Lock lock, ResourceType type, long resourceId, int tries ) { waitingForLock = lock; clearWaitList(); lock.copyHolderWaitListsInto( waitList ); applyWaitStrategy( type, tries ); int b = lock.detectDeadlock( id() ); if ( b != -1 && deadlockResolutionStrategy.shouldAbort( this, clientById.apply( b ) ) ) { UnsafeUtil.loadFence(); String message = this + " can't acquire " + lock + " on " + type + "(" + resourceId + "), because holders of that lock " + "are waiting for " + this + ".\n Wait list:" + lock.describeWaitList(); if ( lock.detectDeadlock( id() ) != -1 ) { if ( isDeadlockReal( lock, tries ) ) { waitList.clear(); waitingForLock = null; throw new DeadlockDetectedException( message ); } } } waitingForLock = null; }

Target:
private void waitFor( ForsetiLockManager.Lock lock, ResourceType type, long resourceId, int tries ) { waitingForLock = lock; clearWaitList(); lock.copyHolderWaitListsInto( waitList ); applyWaitStrategy( type, tries ); int b = lock.detectDeadlock( id() ); if ( b != -1 && deadlockResolutionStrategy.shouldAbort( this, clientById.apply( b ) ) ) { UnsafeUtil.loadFence(); String message = this + " can't acquire " + lock + " on " + type + "(" + resourceId + "), because holders of that lock " + "are waiting for " + this + ".\n Wait list:" + lock.describeWaitList(); if ( lock.detectDeadlock( id() ) != -1 ) { if ( isDeadlockReal( lock, tries ) ) { throw new DeadlockDetectedException( message ); } } } }
Source:
public RecurrentAttentionLayer build() { if(!this.projectInput && this.nHeads != 1){ throw new IllegalArgumentException("projectInput must be true when nHeads != 1"); } if(!this.projectInput && nIn != nOut){ throw new IllegalArgumentException("nIn must be equal to nOut when projectInput is false"); } if(this.projectInput && nOut == 0){ throw new IllegalArgumentException("nOut must be specified when projectInput is true"); } if(this.nOut % nHeads != 0 && headSize == 0){ throw new IllegalArgumentException("nOut isn't divided by nHeads cleanly. Specify the headSize manually."); } return new RecurrentAttentionLayer(this); }

Target:
public RecurrentAttentionLayer build() { Preconditions.checkArgument(this.projectInput || this.nHeads == 1, "projectInput must be true when nHeads != 1"); Preconditions.checkArgument(this.projectInput || nIn == nOut, "nIn must be equal to nOut when projectInput is false"); Preconditions.checkArgument(!this.projectInput || nOut != 0, "nOut must be specified when projectInput is true"); Preconditions.checkArgument(this.nOut % nHeads == 0 || headSize > 0, "nOut isn't divided by nHeads cleanly. Specify the headSize manually."); return new RecurrentAttentionLayer(this); }
Source:
public List<Entity> resolve(Location location) throws IllegalArgumentException { Preconditions.checkArgument(this.requiresLocation == true && location == null); return PlayerSelector.func_179656_b(MinecraftServer.getServer(), this.asString(), net.minecraft.entity.Entity.class); }

Target:
public List<Entity> resolve(Location location) throws IllegalArgumentException { checkArgument(!this.requiresLocation || location != null); return PlayerSelector.func_179656_b(new FakeCommandSender(location), this.asString(), net.minecraft.entity.Entity.class); }
Source:
public void createControl(Composite parent, final FormToolkit toolkit) { Collection<String> reviewUrls = taskReviewStore.getReviewUrls(getTaskEditorPage().getTask().getUrl()); getReviewsFromUrls(reviewUrls); if (reviews.size() == 0) { return; } reviewContainers = new ArrayList<TaskReview>(); populateReviews(reviewContainers); selectionProvider = new SelectionProviderAdapter(); section = createSection(parent, toolkit, hasIncoming); section.setText(section.getText()); expandSection(toolkit, section); section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent event) { if (reviewContainers == null) { expandSection(toolkit, section); getTaskEditorPage().reflow(); } } }); setSection(toolkit, section); }

Target:
public void createControl(Composite parent, final FormToolkit toolkit) { Collection<String> reviewUrls = taskReviewStore.getReviewUrls(getTaskEditorPage().getTask().getUrl()); getReviewsFromUrls(reviewUrls); if (reviews.size() == 0) { return; } reviewContainers = new ArrayList<TaskReview>(); try { populateReviews(reviewContainers); } catch (NumberFormatException e) { return; } selectionProvider = new SelectionProviderAdapter(); section = createSection(parent, toolkit, hasIncoming); section.setText(section.getText()); expandSection(toolkit, section); section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent event) { if (reviewContainers == null) { expandSection(toolkit, section); getTaskEditorPage().reflow(); } } }); setSection(toolkit, section); }
Source:
private void addMethodIfMatching(String annotationName, String method, String argumentSignature) { if (method.contains("<init>") || method.contains("<clinit>")) { return; } if (desiredAnnotations.contains( Signatures.fieldDescriptorToBinaryName(annotationName.trim()))) { matchingFullyQualifiedMethodSignatures.add( getFullyQualifiedMethodSignature(method, argumentSignature)); } }

Target:
private void addMethodIfMatching(String annotationName, String method, String argumentSignature) { if (desiredAnnotations.contains(Signatures.fieldDescriptorToBinaryName(annotationName))) { matchingSignatures.add(getFullyQualifiedMethodSignature(method, argumentSignature)); } }
Source:
public static boolean canShare(Metacard metacard) { return metacard != null && metacard .getMetacardType() .getAttributeDescriptors() .stream() .map(AttributeDescriptor::getName) .anyMatch(attr -> Objects.equals(SecurityAttributes.ACCESS_GROUPS, attr)) && metacard .getMetacardType() .getAttributeDescriptors() .stream() .map(AttributeDescriptor::getName) .anyMatch(attr -> Objects.equals(SecurityAttributes.ACCESS_INDIVIDUALS, attr)) && metacard .getMetacardType() .getAttributeDescriptors() .stream() .map(AttributeDescriptor::getName) .anyMatch(attr -> Objects.equals(CoreAttributes.METACARD_OWNER, attr)); }

Target:
public static boolean canShare(Metacard metacard) { return metacard != null && isSharingCapable(metacard) && metacard .getMetacardType() .getAttributeDescriptors() .stream() .map(AttributeDescriptor::getName) .anyMatch(attr -> Objects.equals(SecurityAttributes.ACCESS_GROUPS, attr)) && metacard .getMetacardType() .getAttributeDescriptors() .stream() .map(AttributeDescriptor::getName) .anyMatch(attr -> Objects.equals(SecurityAttributes.ACCESS_INDIVIDUALS, attr)); }
Source:
public Set<ByteArrayWrapper> smembers( ByteArrayWrapper key) { RedisSet redisSet = region.getOrDefault(key, RedisSet.EMPTY); return redisSet.smembers(); }

Target:
public Set<ByteArrayWrapper> smembers( ByteArrayWrapper key) { return getRedisSet(key).smembers(); }
Source:
InternalJob toInternalJob() { JobId jobIdInstance = new JobIdImpl(getId(), getJobName()); JobInfoImpl jobInfo = createJobInfo(jobIdInstance); InternalJob internalJob = new InternalTaskFlowJob(); internalJob.setCredentials(getCredentials()); internalJob.setJobInfo(jobInfo); internalJob.setGenericInformation(getGenericInformation()); internalJob.setVariables(variablesToJobVariables()); internalJob.setProjectName(getProjectName()); internalJob.setOwner(getOwner()); internalJob.setDescription(getDescription()); internalJob.setInputSpace(getInputSpace()); internalJob.setOutputSpace(getOutputSpace()); internalJob.setGlobalSpace(getGlobalSpace()); internalJob.setUserSpace(getGlobalSpace()); internalJob.setMaxNumberOfExecution(getMaxNumberOfExecution()); internalJob.setOnTaskError(OnTaskError.getInstance(this.onTaskErrorString)); internalJob.setScheduledTimeForRemoval(getScheduledTimeForRemoval()); try { internalJob.setResultMap(SerializationUtil.deserializeVariableMap(getResultMap())); } catch (IOException | ClassNotFoundException e) { e.printStackTrace(); } return internalJob; }

Target:
InternalJob toInternalJob() { JobId jobIdInstance = new JobIdImpl(getId(), getJobName()); JobInfoImpl jobInfo = createJobInfo(jobIdInstance); InternalJob internalJob = new InternalTaskFlowJob(); internalJob.setCredentials(getCredentials()); internalJob.setJobInfo(jobInfo); internalJob.setGenericInformation(getGenericInformation()); internalJob.setVariables(variablesToJobVariables()); internalJob.setProjectName(getProjectName()); internalJob.setOwner(getOwner()); internalJob.setDescription(getDescription()); internalJob.setInputSpace(getInputSpace()); internalJob.setOutputSpace(getOutputSpace()); internalJob.setGlobalSpace(getGlobalSpace()); internalJob.setUserSpace(getGlobalSpace()); internalJob.setMaxNumberOfExecution(getMaxNumberOfExecution()); internalJob.setOnTaskError(OnTaskError.getInstance(this.onTaskErrorString)); internalJob.setScheduledTimeForRemoval(getScheduledTimeForRemoval()); try { internalJob.setResultMap(SerializationUtil.deserializeVariableMap(getResultMap())); } catch (IOException | ClassNotFoundException e) { logger.error("error when serializing result map variables " + e); } return internalJob; }
Source:
String cacheKeyForStageHistories(String pipelineName, String stageName) { return cacheKeyGenerator.generate("stageHistories", pipelineName.toLowerCase(), stageName.toLowerCase()); }

Target:
String cacheKeyForStageHistories(String pipelineName, String stageName) { return cacheKeyGenerator.generate("stageHistories", new CaseInsensitiveString(pipelineName), new CaseInsensitiveString(stageName)); }
Source:
public ExpandedQuery rewrite(ExpandedQuery query) { querySeq.clear(); matchSeq.clear(); visit((Query) query.getUserQuery()); if (priorMatch.isFinal()) { hasReplacement = true; querySeq.addAll(priorMatch.value); } else { if (!matchSeq.isEmpty()) { querySeq.addAll(matchSeq); } } return hasReplacement ? buildQueryFromSeqList(querySeq) : query; }

Target:
public ExpandedQuery rewrite(ExpandedQuery query) { querySeq = new LinkedList<>(); matchSeq = new LinkedList<>(); visit((Query) query.getUserQuery()); if (priorMatch.isFinal()) { hasReplacement = true; querySeq.addAll(priorMatch.value); } else { if (!matchSeq.isEmpty()) { querySeq.addAll(matchSeq); } } return hasReplacement ? buildQueryFromSeqList(query, querySeq) : query; }
Source:
@Override public Throwable error() { if (caught != null || request == null) return caught; return request.maybeError(); }

Target:
@Override public Throwable error() { if (caught != null) return caught; if (request == null) return null; return request.maybeError(); }
Source:
public String toString() { return "SslSession(alpn=" + (alpn == null ? "null" : alpn) + ", npn=" + (npn == null ? "null" : npn) + ", version=" + (version == null ? "null" : version) + ", cipher=" + (cipher == null ? "null" : cipher) + ", establishedTime=" + Long.toString(establishedTime) + ", peerCert=" + (peerCert == null ? "null" : peerCert.toString()) + ")"; }

Target:
public String toString() { return "SslSession(alpn=" + alpn + ", npn=" + npn + ", version=" + version + ", cipher=" + cipher + ", establishedTime=" + Long.toString(establishedTime) + ", peerCert=" + peerCert + ")"; }
Source:
public List<Condition> getConditionHistory(Patient patient) { Query query = sessionFactory.getCurrentSession().createQuery("select con from Condition as con inner join fetch con.concept as c where con.patient.patientId = :patientId and con.voided = false group by c.conceptId, con.conditionId order by con.dateCreated desc"); query.setInteger("patientId", patient.getId()); return query.list(); }

Target:
public List<Condition> getConditionHistory(Patient patient) { Query query = sessionFactory.getCurrentSession().createQuery("select con from Condition as con where con.patient.patientId = :patientId and con.voided = false " + "order by con.dateCreated desc"); query.setInteger("patientId", patient.getId()); return query.list(); }
Source:
protected void executeQueryCommand() { if (getVdsStaticDao().getAllForHost(getParameters().getServerName()).size() > 0 || getVdsStaticDao().getAllWithIpAddress(getParameters().getServerName()).size() > 0) { setReturnMessage(); } SSHClient client = null; try { client = connect(getParameters().getServerName()); validateFingerprint(client, getParameters().getFingerprint()); authenticate(client, ROOT, getParameters().getPassword()); String serversXml = executeCommand(client); Map<String, String> serverFingerPrint = extractServers(serversXml); if (isServerPartOfCluster(serverFingerPrint)) { setReturnMessage(); } getQueryReturnValue().setReturnValue(serverFingerPrint); } catch (Exception e) { throw new RuntimeException(e); } finally { if (client != null) { client.disconnect(); } } }

Target:
protected void executeQueryCommand() { if (getVdsStaticDao().getAllForHost(getParameters().getServerName()).size() > 0 || getVdsStaticDao().getAllWithIpAddress(getParameters().getServerName()).size() > 0) { setReturnMessage(); } SSHClient client = null; try { client = connect(getParameters().getServerName()); validateFingerprint(client, getParameters().getFingerprint()); authenticate(client, ROOT, getParameters().getPassword()); String serversXml = executeCommand(client); Map<String, String> serverFingerPrint = extractServers(serversXml); if (areServersPartOfCluster(serverFingerPrint.keySet())) { setReturnMessage(); } getQueryReturnValue().setReturnValue(serverFingerPrint); } catch (Exception e) { throw new RuntimeException(e); } finally { if (client != null) { client.disconnect(); } } }
Source:
public Builder clientResetHandler(SyncSession.ClientResetHandler handler) { if (handler == null) { throw new IllegalArgumentException("Non-null 'handler' required."); } this.clientResetHandler = handler; return this; }

Target:
public Builder clientResetHandler(SyncSession.ClientResetHandler handler) { Util.checkNull(handler, "handler"); this.clientResetHandler = handler; return this; }
Source:
public void testUnsetCommand() throws SQLException { PostgreSQLContainer postgres = (PostgreSQLContainer) new PostgreSQLContainer().withCommand("postgres -c max_connections=42").withCommand(); postgres.start(); try { ResultSet resultSet = performQuery(postgres,"SELECT current_setting('max_connections')"); String result = resultSet.getString(1); assertNotEquals("max_connections should not be overriden", "42", result); } finally { postgres.stop(); } }

Target:
public void testUnsetCommand() throws SQLException { try (PostgreSQLContainer postgres = new PostgreSQLContainer<>().withCommand("postgres -c max_connections=42").withCommand()) { postgres.start(); ResultSet resultSet = performQuery(postgres, "SELECT current_setting('max_connections')"); String result = resultSet.getString(1); assertNotEquals("max_connections should not be overriden", "42", result); } }
Source:
public synchronized void registerHandler(HttpHandlerRegistrationInfo registrationInfo, HttpHandler handler) { if (undertow == null) { Undertow.Builder builder = Undertow.builder(); if (key.getSslContext() != null) { builder.addHttpsListener(key.getPort(), key.getHost(), key.getSslContext()); } else { builder.addHttpListener(key.getPort(), key.getHost()); } if (options != null) { if (options.getIoThreads() != null) { builder.setIoThreads(options.getIoThreads()); } if (options.getWorkerThreads() != null) { builder.setWorkerThreads(options.getWorkerThreads()); } if (options.getBufferSize() != null) { builder.setBufferSize(options.getBufferSize()); } if (options.getDirectBuffers() != null) { builder.setDirectBuffers(options.getDirectBuffers()); } } undertow = builder.setHandler(rootHandler).build(); LOG.info("Starting Undertow server on {}://{}:{}", key.getSslContext() != null ? "https" : "http", key.getHost(), key.getPort()); undertow.start(); } String path = registrationInfo.getUri().getPath(); String methods = registrationInfo.getMethodRestrict(); boolean prefixMatch = !registrationInfo.isMatchOnUriPrefix(); rootHandler.add(path, methods != null ? methods.split(",") : null, prefixMatch, handler); }

Target:
public synchronized void registerHandler(HttpHandlerRegistrationInfo registrationInfo, HttpHandler handler) { if (undertow == null) { Undertow.Builder builder = Undertow.builder(); if (key.getSslContext() != null) { builder.addHttpsListener(key.getPort(), key.getHost(), key.getSslContext()); } else { builder.addHttpListener(key.getPort(), key.getHost()); } if (options != null) { if (options.getIoThreads() != null) { builder.setIoThreads(options.getIoThreads()); } if (options.getWorkerThreads() != null) { builder.setWorkerThreads(options.getWorkerThreads()); } if (options.getBufferSize() != null) { builder.setBufferSize(options.getBufferSize()); } if (options.getDirectBuffers() != null) { builder.setDirectBuffers(options.getDirectBuffers()); } } undertow = builder.setHandler(rootHandler).build(); LOG.info("Starting Undertow server on {}://{}:{}", key.getSslContext() != null ? "https" : "http", key.getHost(), key.getPort()); undertow.start(); } String path = registrationInfo.getUri().getPath(); String methods = registrationInfo.getMethodRestrict(); boolean prefixMatch = registrationInfo.isMatchOnUriPrefix(); rootHandler.add(path, methods != null ? methods.split(",") : null, prefixMatch, handler); }
Source:
public void project(ICause cause) throws ContradictionException { RealInterval res; switch (op) { case NEG: case ABS: case EXP: case LN: case SQRT: case COS: res = RealUtils.acos_wrt(this, e); if (res.getLB() > res.getUB()) { throw model.getSolver().getContradictionException().set(cause, null, ""); } break; case SIN: res = RealUtils.asin_wrt(this, e); if (res.getLB() > res.getUB()) { throw model.getSolver().getContradictionException().set(cause, null, ""); } break; case TAN: case ACOS: case ASIN: case ATAN: case COSH: case SINH: case TANH: case ACOSH: case ASINH: case ATANH: default: throw new UnsupportedOperationException("Equation does not support " + op.name()); } e.intersect(res, cause); }

Target:
public void project(ICause cause) throws ContradictionException { RealInterval res; switch (op) { case COS: res = RealUtils.acos_wrt(this, e); break; case SIN: res = RealUtils.asin_wrt(this, e); break; case NEG: res = new RealIntervalConstant(-this.getUB(), -this.getLB()); break; case SQR: res = RealUtils.iRoot(this, 2, e); break; case SQRT: res = RealUtils.iPower(this, 2); break; case CUB: res = RealUtils.iRoot(this, 3, e); break; case CBRT: res = RealUtils.iPower(this, 3); break; case ABS: res = new RealIntervalConstant(-this.getUB(), this.getUB()); break; case EXP: case LN: case TAN: case ACOS: case ASIN: case ATAN: case COSH: case SINH: case TANH: case ACOSH: case ASINH: case ATANH: default: throw new UnsupportedOperationException("Equation does not support " + op.name()+". Consider using Ibex instead."); } e.intersect(res, cause); }
Source:
public Banner update(Long bannerId, Banner banner) { if (!bannerRepository.exists(bannerId)) throw new BannerNotFoundException(); return bannerRepository.saveAndFlush(banner); }

Target:
public Banner update(Long bannerId, Banner banner) { if (!bannerRepository.exists(bannerId)) { throw new BannerNotFoundException(); } return bannerRepository.saveAndFlush(banner); }
Source:
private static Map<Integer, String> getExecutableNames(ITmfTrace trace) { Map<Integer, String> executableNames = new HashMap<>(); KernelAnalysisModule kernelAnlysis = TmfTraceUtils.getAnalysisModuleOfClass(trace, KernelAnalysisModule.class, KernelAnalysisModule.ID); if (kernelAnlysis == null) { return Collections.emptyMap(); } Collection<Integer> threadIds = KernelThreadInformationProvider.getThreadIds(kernelAnlysis); if (!threadIds.isEmpty()) { for (Integer tid : threadIds) { String execName = KernelThreadInformationProvider.getExecutableName(kernelAnlysis, tid); if (execName != null) { executableNames.put(tid, execName); } } } return executableNames; }

Target:
private static Map<Integer, String> getExecutableNames(ITmfTrace trace) { Map<Integer, String> executableNames = new HashMap<>(); KernelAnalysisModule kernelAnlysis = TmfTraceUtils.getAnalysisModuleOfClass(trace, KernelAnalysisModule.class, KernelAnalysisModule.ID); if (kernelAnlysis == null) { return Collections.emptyMap(); } Collection<Integer> threadIds = KernelThreadInformationProvider.getThreadIds(kernelAnlysis); if (threadIds.isEmpty()) { return Collections.emptyMap(); } for (Integer tid : threadIds) { String execName = KernelThreadInformationProvider.getExecutableName(kernelAnlysis, tid); if (execName != null) { executableNames.put(tid, execName); } } return executableNames; }
Source:
public void validate(final T credentials, final WebContext context) throws HttpAction { init(context); try { final CommonProfile profile = this.cache.get(credentials, () -> { logger.debug("Delegating authentication to {}...", delegate); delegate.validate(credentials, context); return credentials.getUserProfile(); }); credentials.setUserProfile(profile); logger.debug("Found cached credential. Using cached profile {}...", profile); } catch (UncheckedExecutionException e) { if (e.getCause() instanceof RuntimeException) { throw (RuntimeException) e.getCause(); } else if (e.getCause() != null) { throw new TechnicalException(e.getCause()); } else { throw new TechnicalException(e); } } catch (ExecutionException e) { if (e.getCause() instanceof HttpAction) { throw (HttpAction) e.getCause(); } else if (e.getCause() != null) { throw new TechnicalException(e.getCause()); } else { throw new TechnicalException(e); } } catch (ExecutionError e) { if (e.getCause() instanceof Error) { throw (Error) e; } else if (e.getCause() != null) { throw new TechnicalException(e.getCause()); } else { throw new TechnicalException(e); } } }

Target:
public void validate(final T credentials, final WebContext context) throws HttpAction { init(context); try { final CommonProfile profile = this.cache.get(credentials, () -> { logger.debug("Delegating authentication to {}...", delegate); delegate.validate(credentials, context); return credentials.getUserProfile(); }); credentials.setUserProfile(profile); logger.debug("Found cached credential. Using cached profile {}...", profile); } catch (Exception e) { throw new CredentialsException(e); } }
Source:
@Override public float getPagesFillFactor() { if (!metricsEnabled || fillFactorProvider == null) return 0; T2<Long, Long> fillFactor = fillFactorProvider.apply(); long totalAllocated = Math.max(fillFactor.get2(), (getPageSize() * totalAllocatedPages.longValue())); return (float) (totalAllocated - (fillFactor.get2() - fillFactor.get1())) / totalAllocated; }

Target:
@Override public float getPagesFillFactor() { if (!metricsEnabled || freeSpaceProvider == null) return 0; long freeSpace = freeSpaceProvider.apply(); long totalAllocated = getPageSize() * totalAllocatedPages.longValue(); return (float) (totalAllocated - freeSpace) / totalAllocated; }
Source:
public final int parseArguments(final Parameters params) throws CmdLineException { final String token = params.getParameter(0); String projectName = token; while (projectName.endsWith("/")) { projectName = projectName.substring(0, projectName.length() - 1); } if (projectName.endsWith(".git")) { projectName = projectName.substring(0, projectName.length() - 4); while (projectName.endsWith("/")) { projectName = projectName.substring(0, projectName.length() - 1); } } while (projectName.startsWith("/")) { projectName = projectName.substring(1); } boolean projectExists = false; for (Project.NameKey name : projectCache.all()) { if (name.get().equals(projectName)) { projectExists = true; break; } } if (!projectExists) { throw new CmdLineException(owner, "'" + token + "': not a Gerrit project"); } final ProjectControl control; try { Project.NameKey nameKey = new Project.NameKey(projectName); control = projectControlFactory.validateFor(nameKey, ProjectControl.OWNER | ProjectControl.VISIBLE); } catch (NoSuchProjectException e) { throw new CmdLineException(owner, "'" + token + "': not a Gerrit project"); } setter.addValue(control); return 1; }

Target:
public final int parseArguments(final Parameters params) throws CmdLineException { final String token = params.getParameter(0); String projectName = token; while (projectName.endsWith("/")) { projectName = projectName.substring(0, projectName.length() - 1); } if (projectName.endsWith(".git")) { projectName = projectName.substring(0, projectName.length() - 4); while (projectName.endsWith("/")) { projectName = projectName.substring(0, projectName.length() - 1); } } while (projectName.startsWith("/")) { projectName = projectName.substring(1); } final ProjectControl control; try { Project.NameKey nameKey = new Project.NameKey(projectName); control = projectControlFactory.validateFor(nameKey, ProjectControl.OWNER | ProjectControl.VISIBLE); } catch (NoSuchProjectException e) { throw new CmdLineException(owner, "'" + projectName + "': is not a Gerrit project"); } setter.addValue(control); return 1; }
Source:
protected boolean tryFeed(Material food, GlowPlayer player) { if (isAdult() && !isTamed()) { int taming = computeTamingAmount(food); if (taming > 0) { domestication = Math.max(domestication + taming, maxDomestication); super.tryFeed(food, player); return true; } } return super.tryFeed(food, player); }

Target:
protected boolean tryFeed(Material food, GlowPlayer player) { if (!isAdult() || isTamed()) { return super.tryFeed(food, player); } int taming = computeDomestication(food); if (taming > 0) { domestication = Math.max(domestication + taming, maxDomestication); super.tryFeed(food, player); return true; } return super.tryFeed(food, player); }
Source:
public ImportSourceDescriptor importDescriptor(@Context UriInfo uriInfo, @QueryParam("projectPath") String projectPath) throws ApiException, IOException { final VirtualFile virtualFile = vfsRegistry.getProvider(workspaceId).getMountPoint(true).getVirtualFile(projectPath); if (virtualFile.getChild(".svn") != null) { return DtoFactory.getInstance().createDto(ImportSourceDescriptor.class) .withType("subversion") .withLocation(subversionApi.getRepositoryUrl(((VirtualFileImpl)virtualFile).getIoFile().getPath())); } else { throw new ServerException("Not subversion repository"); } }

Target:
public ImportSourceDescriptor importDescriptor(@Context UriInfo uriInfo, @QueryParam("projectPath") String projectPath) throws ApiException, IOException { final VirtualFile virtualFile = vfsRegistry.getProvider(workspaceId).getMountPoint(true).getVirtualFile(projectPath); if (virtualFile.getChild(".svn") != null) { return newDto(ImportSourceDescriptor.class) .withType("subversion") .withLocation(subversionApi.getRepositoryUrl(((VirtualFileImpl)virtualFile).getIoFile().getPath())); } else { throw new ServerException("Not subversion repository"); } }
Source:
private static ProxyProvider.Proxy mapProxyType(ProxyOptions.Type type, ClientLogger logger) { switch (type) { case HTTP: return ProxyProvider.Proxy.HTTP; case SOCKS4: return ProxyProvider.Proxy.SOCKS4; case SOCKS5: return ProxyProvider.Proxy.SOCKS5; default: throw logger.logExceptionAsError(new IllegalStateException( String.format("Unknown Proxy type '%s' in use. Not configuring Netty proxy.", type))); } }

Target:
private static ProxyProvider.Proxy mapProxyType(ProxyOptions.Type type, ClientLogger logger) { Objects.requireNonNull(type, "'ProxyOptions.getType()' cannot be null."); switch (type) { case HTTP: return ProxyProvider.Proxy.HTTP; case SOCKS4: return ProxyProvider.Proxy.SOCKS4; case SOCKS5: return ProxyProvider.Proxy.SOCKS5; default: throw logger.logExceptionAsError(new IllegalStateException( String.format("Unknown proxy type '%s' in use. Use a proxy type from 'ProxyOptions.Type'.", type))); } }
Source:
protected void SyncSearch() { DiskImage diskImage = (DiskImage) getEntity(); if (diskImage == null) { return; } AsyncQuery _asyncQuery = new AsyncQuery(); _asyncQuery.setModel(this); _asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void OnSuccess(Object model, Object returnValue) { SearchableListModel searchableListModel = (SearchableListModel) model; searchableListModel.setItems((ArrayList<StorageDomain>) ((VdcQueryReturnValue) returnValue).getReturnValue()); } }; GetStorageDomainsByImageIdParameters getImageByImageIdParameters = new GetStorageDomainsByImageIdParameters(diskImage.getImageId()); getImageByImageIdParameters.setRefresh(getIsQueryFirstTime()); Frontend.RunQuery(VdcQueryType.GetStorageDomainsByImageId, getImageByImageIdParameters, _asyncQuery); setIsQueryFirstTime(false); }

Target:
protected void SyncSearch() { DiskImage diskImage = (DiskImage) getEntity(); if (diskImage == null) { return; } AsyncQuery _asyncQuery = new AsyncQuery(); _asyncQuery.setModel(this); _asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void OnSuccess(Object model, Object returnValue) { SearchableListModel searchableListModel = (SearchableListModel) model; searchableListModel.setItems((ArrayList<StorageDomain>) ((VdcQueryReturnValue) returnValue).getReturnValue()); } }; GetStorageDomainsByImageIdParameters getStorageDomainsByImageIdParameters = new GetStorageDomainsByImageIdParameters(diskImage.getImageId()); getStorageDomainsByImageIdParameters.setRefresh(getIsQueryFirstTime()); Frontend.RunQuery(VdcQueryType.GetStorageDomainsByImageId, getStorageDomainsByImageIdParameters, _asyncQuery); setIsQueryFirstTime(false); }
Source:
private void setPanelMessage(String message) { String itemName; dscAlarmItemUpdate.setSysMessage(message); itemName = getItemName(DSCAlarmItemType.PANEL_MESSAGE, 0, 0); if (itemName != "") { updateItem(itemName, 0, message); } }

Target:
private void setPanelMessage(String message) { String itemName; dscAlarmItemUpdate.setSysMessage(message); itemName = getItemName(DSCAlarmItemType.PANEL_MESSAGE, 0, 0); if (StringUtils.isNotEmpty(itemName)) { updateItem(itemName, 0, message); } }