auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected IStatus validate() { if (selectedDataObservable.getValue() instanceof BusinessObjectData) { if (checkedElements.isEmpty()) { return ValidationStatus.error(Messages.atLeastOneAttributeShouldBeSelectedError); } else { final StringBuilder sb = new StringBuilder(); validateMandatoryFieldsNotSelected(sb, mappings, checkedElements); if (sb.length() > 0) { if (sb.indexOf(",") == sb.lastIndexOf(",")) { sb.replace(sb.lastIndexOf(","), sb.lastIndexOf(",") + 1, ""); } final String message = container instanceof Task ? Messages.mandatoryFieldsNotSelectedStepWarning : Messages.mandatoryFieldsNotSelectedWarning; return ValidationStatus.warning(Messages.bind(message, sb.toString())); } } } return ValidationStatus.ok(); }

Target:
protected IStatus validate() { if (selectedDataObservable.getValue() instanceof BusinessObjectData) { if (checkedElements.isEmpty()) { return ValidationStatus.error(Messages.atLeastOneAttributeShouldBeSelectedError); } else { final StringBuilder sb = new StringBuilder(); validateMandatoryFieldsNotSelected(sb, mappings, checkedElements); if (sb.length() > 0) { int lastIndexOf = sb.lastIndexOf(","); if (sb.indexOf(",") == lastIndexOf) { sb.replace(lastIndexOf, lastIndexOf + 1, ""); } final String message = container instanceof Task ? Messages.mandatoryFieldsNotSelectedStepWarning : Messages.mandatoryFieldsNotSelectedWarning; return ValidationStatus.warning(Messages.bind(message, sb.toString())); } } } return ValidationStatus.ok(); }
Source:
private SAMLAttributeParser() { super(SAMLAssertionQNames.ATTRIBUTE); Set<String> localAttributeNames = new HashSet<>(); for (SAMLAssertionQNames name : Arrays.asList(SAMLAssertionQNames.ATTR_NAME, SAMLAssertionQNames.ATTR_FRIENDLY_NAME, SAMLAssertionQNames.ATTR_NAME_FORMAT)) { localAttributeNames.add(name.getQName().getLocalPart()); } DEFAULT_KNOWN_LOCAL_ATTRIBUTE_NAMES = localAttributeNames; }

Target:
private SAMLAttributeParser() { super(SAMLAssertionQNames.ATTRIBUTE); }
Source:
private MethodInvoker createMethodInvoker(final Method method) { try { BiFunction<Object, Object[], Object> fastMethod = BytecodeGen.fastMethod(method); if (fastMethod != null) { return new MethodInvoker() { @Override public Object invoke(Object target, Object... parameters) throws IllegalAccessException, InvocationTargetException { try { return fastMethod.apply(target, parameters); } catch (Throwable e) { throw new InvocationTargetException(e); } } }; } } catch (Exception | LinkageError e) { } int modifiers = method.getModifiers(); if (!Modifier.isPublic(modifiers) || !Modifier.isPublic(method.getDeclaringClass().getModifiers())) { method.setAccessible(true); } return new MethodInvoker() { @Override public Object invoke(Object target, Object... parameters) throws IllegalAccessException, InvocationTargetException { return method.invoke(target, parameters); } }; }

Target:
private MethodInvoker createMethodInvoker(final Method method) { try { BiFunction<Object, Object[], Object> fastMethod = BytecodeGen.fastMethod(method); if (fastMethod != null) { return new MethodInvoker() { @Override public Object invoke(Object target, Object... parameters) throws InvocationTargetException { try { return fastMethod.apply(target, parameters); } catch (Throwable e) { throw new InvocationTargetException(e); } } }; } } catch (Exception | LinkageError e) { } int modifiers = method.getModifiers(); if (!Modifier.isPublic(modifiers) || !Modifier.isPublic(method.getDeclaringClass().getModifiers())) { method.setAccessible(true); } return new MethodInvoker() { @Override public Object invoke(Object target, Object... parameters) throws IllegalAccessException, InvocationTargetException { return method.invoke(target, parameters); } }; }
Source:
public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("display"); description.addProperty("templateId"); description.addProperty("dcTermsIdentifier"); description.addProperty("dcTermsTitle"); description.addProperty("dcTermsType"); description.addProperty("dcTermsPublisher"); description.addProperty("dcTermsCreator"); description.addProperty("dcTermsRights"); description.addProperty("display"); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; } else if (rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("charset"); description.addProperty("path"); description.addProperty("templateId"); description.addProperty("dcTermsIdentifier"); description.addProperty("dcTermsTitle"); description.addProperty("dcTermsDescription"); description.addProperty("dcTermsType"); description.addProperty("dcTermsLanguage"); description.addProperty("dcTermsPublisher"); description.addProperty("dcTermsCreator"); description.addProperty("dcTermsRights"); description.addProperty("dcTermsLicense"); description.addProperty("dcTermsDate"); description.addProperty("display"); description.addSelfLink(); return description; } else { return null; } }

Target:
public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("templateId"); description.addProperty("dcTermsIdentifier"); description.addProperty("dcTermsTitle"); description.addProperty("dcTermsType"); description.addProperty("dcTermsPublisher"); description.addProperty("dcTermsCreator"); description.addProperty("dcTermsRights"); description.addProperty("display"); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; } else if (rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("charset"); description.addProperty("path"); description.addProperty("templateId"); description.addProperty("dcTermsIdentifier"); description.addProperty("dcTermsTitle"); description.addProperty("dcTermsDescription"); description.addProperty("dcTermsType"); description.addProperty("dcTermsLanguage"); description.addProperty("dcTermsPublisher"); description.addProperty("dcTermsCreator"); description.addProperty("dcTermsRights"); description.addProperty("dcTermsLicense"); description.addProperty("dcTermsDate"); description.addProperty("display"); description.addSelfLink(); return description; } else { return null; } }
Source:
public KafkaBasedLog(String topic, Map<String, Object> producerConfigs, Map<String, Object> consumerConfigs, Callback<ConsumerRecord<K, V>> consumedCallback, Time time, Runnable initializer) { this.topic = topic; this.producerConfigs = producerConfigs; this.consumerConfigs = consumerConfigs; this.consumedCallback = consumedCallback; this.stopRequested = false; this.readLogEndOffsetCallbacks = new ArrayDeque<>(); this.time = time; this.initializer = initializer != null ? initializer : () -> { }; }

Target:
public KafkaBasedLog(String topic, Map<String, Object> producerConfigs, Map<String, Object> consumerConfigs, Callback<ConsumerRecord<K, V>> consumedCallback, Time time, Runnable initializer) { this(topic, producerConfigs, consumerConfigs, consumedCallback, time, initializer, CREATE_TOPIC_TIMEOUT_MS); }
Source:
public boolean verify() throws ScriptSignatureException { if (fContainSignature) { byte[] signByte = SignatureHelper.convertBase64ToBytes(fSignatureString); byte[] certByte = SignatureHelper.convertBase64ToBytes(fCertificateChainString[0]); Certificate userCert = getCertificate(certByte); try { PublicKey publicKey = userCert.getPublicKey(); String encryptionAlgo = publicKey.getAlgorithm(); Signature signature = Signature.getInstance(fHashAlgorithm + "with" + encryptionAlgo, fProvider); signature.initVerify(publicKey); signature.update(fContent.getBytes()); boolean verified = signature.verify(signByte); return verified; } catch (SignatureException e) { Logger.error(Activator.PLUGIN_ID, "Signature object not initialized properly or signature is not readable.", e); throw new ScriptSignatureException("Signature is not readable.", e); } catch (NoSuchAlgorithmException e) { throw new ScriptSignatureException("Algorithm used by signature is not recognized by provider.", e); } catch (InvalidKeyException e) { throw new ScriptSignatureException("Public key is invalid.", e); } catch (NoSuchProviderException e) { throw new ScriptSignatureException("No such provider is registered in Security Providers' list.", e); } } throw new ScriptSignatureException("Script does not contain signature."); }

Target:
public boolean verify() throws ScriptSignatureException { if (fSignatureInfo != null) { byte[] signByte = SignatureHelper.convertBase64ToBytes(fSignatureInfo.getSignature()); byte[] certByte = SignatureHelper.convertBase64ToBytes(fSignatureInfo.getCertificateChain()[0]); Certificate userCert = getCertificate(certByte); try { PublicKey publicKey = userCert.getPublicKey(); String encryptionAlgo = publicKey.getAlgorithm(); Signature signature = Signature.getInstance(fSignatureInfo.getMessageDigestAlgo() + "with" + encryptionAlgo, fSignatureInfo.getProvider()); signature.initVerify(publicKey); signature.update(fSignatureInfo.getContentOnly().getBytes()); return signature.verify(signByte); } catch (SignatureException e) { Logger.error(Activator.PLUGIN_ID, "Signature object not initialized properly or signature is not readable.", e); throw new ScriptSignatureException("Signature is not readable.", e); } catch (NoSuchAlgorithmException e) { throw new ScriptSignatureException("Algorithm used by signature is not recognized by provider.", e); } catch (InvalidKeyException e) { throw new ScriptSignatureException("Public key is invalid.", e); } catch (NoSuchProviderException e) { throw new ScriptSignatureException("No such provider is registered in Security Providers' list.", e); } } throw new ScriptSignatureException("Script does not contain signature."); }
Source:
protected boolean matchEntity(DiskImage entity, Guid id) { return id != null && (id.equals(entity.getId()) || id.equals(entity.getImageId()) || id.equals(entity.getvm_snapshot_id())); }

Target:
protected boolean matchEntity(DiskImage entity, Guid id) { return id != null && (id.equals(entity.getId()) || id.equals(entity.getvm_snapshot_id())); }
Source:
public void setupRoutes() { path(controllerBasePath(), () -> { before("/*", mimeType, this::setContentType); before("/*", mimeType, this.apiAuthenticationHelper::checkUserAnd403); get(Routes.FeedsAPI.PIPELINES_XML, this.mimeType, this::pipelinesXML); get(Routes.FeedsAPI.STAGES_XML, this.mimeType, this::stagesXML); get(Routes.FeedsAPI.PIPELINE_XML, this.mimeType, this::pipelineXML); get(Routes.FeedsAPI.STAGE_XML, this.mimeType, this::stageXML); get(Routes.FeedsAPI.JOB_XML, this.mimeType, this::jobXML); get(Routes.FeedsAPI.SCHEDULED_JOB_XML, this.mimeType, this::scheduledJobs); get(Routes.FeedsAPI.MATERIAL_URL, this.mimeType, this::materialXML); }); }

Target:
public void setupRoutes() { path(controllerBasePath(), () -> { before("/*", mimeType, super::setContentType); before("/*", mimeType, this.apiAuthenticationHelper::checkUserAnd403); get(Routes.FeedsAPI.PIPELINES_XML, this.mimeType, this::pipelinesXML); get(Routes.FeedsAPI.STAGES_XML, this.mimeType, this::stagesXML); get(Routes.FeedsAPI.PIPELINE_XML, this.mimeType, this::pipelineXML); get(Routes.FeedsAPI.STAGE_XML, this.mimeType, this::stageXML); get(Routes.FeedsAPI.JOB_XML, this.mimeType, this::jobXML); get(Routes.FeedsAPI.SCHEDULED_JOB_XML, this.mimeType, this::scheduledJobs); get(Routes.FeedsAPI.MATERIAL_URL, this.mimeType, this::materialXML); after("/*", this::setContentType); }); }
Source:
private Optional<VariantWithSamplesAndAnnotation> getVariantByCoordinatesAndAnnotationVersion( String variantCoreString, String annotationVepVersion, String annotationVepCacheVersion) throws AnnotationMetadataNotFoundException, IllegalArgumentException { String[] regionId = variantCoreString.split(":"); Optional<String> alternate = Optional.ofNullable(regionId[3]); if (!alternate.isPresent()) { return Optional.ofNullable(null); } AnnotationMetadata annotationMetadata = null; if (annotationVepVersion != null && annotationVepCacheVersion != null) { annotationMetadata = new AnnotationMetadata(annotationVepVersion, annotationVepCacheVersion); } List<VariantWithSamplesAndAnnotation> variantWithSamplesAndAnnotationList = service. findByChromosomeAndStartAndReferenceAndAlternate(regionId[0], Integer.parseInt(regionId[1]), regionId[2], alternate.get(), annotationMetadata); if (variantWithSamplesAndAnnotationList.size() == 1) { return Optional.of(variantWithSamplesAndAnnotationList.get(0)); } else if (variantWithSamplesAndAnnotationList.size() > 1) { throw new IllegalArgumentException("More than one variant retireved. Please enter a unique VariantId"); } return Optional.ofNullable(null); }

Target:
private Optional<VariantWithSamplesAndAnnotation> getVariantByCoordinatesAndAnnotationVersion( String variantCoreString, String annotationVepVersion, String annotationVepCacheVersion) throws AnnotationMetadataNotFoundException, IllegalArgumentException { String[] regionId = variantCoreString.split(":"); AnnotationMetadata annotationMetadata = null; if (annotationVepVersion != null && annotationVepCacheVersion != null) { annotationMetadata = new AnnotationMetadata(annotationVepVersion, annotationVepCacheVersion); } List<VariantWithSamplesAndAnnotation> variantWithSamplesAndAnnotationList = service. findByChromosomeAndStartAndReferenceAndAlternate(regionId[0], Integer.parseInt(regionId[1]), regionId[2], regionId[3], annotationMetadata); if (variantWithSamplesAndAnnotationList.size() == 1) { return Optional.of(variantWithSamplesAndAnnotationList.get(0)); } else if (variantWithSamplesAndAnnotationList.size() > 1) { throw new IllegalArgumentException("More than one variant has been found."); } return Optional.ofNullable(null); }
Source:
public VillagerCareer getCareer(String name) { for (VillagerCareer car : this.careers) { if (car.getName() == name) return car; } return null; }

Target:
public VillagerCareer getCareer(String name) { for (VillagerCareer car : this.careers) { if (car.getName().equals(name)) return car; } return null; }
Source:
private void checkEntityForRollback(BusinessEntity<?> entity) { if(entity == null) { throw new IllegalArgumentException("Can not create snapshot from a null entity"); } Class<? extends BusinessEntity> entityClazz = entity.getClass(); if(DbFacade.getInstance().getDaoForEntity((Class<BusinessEntity<Serializable>>)entityClazz) == null) { throw new IllegalArgumentException("There is no rollback DAO registered for entity type "+entityClazz.getName()); } }

Target:
private void checkEntityForRollback(BusinessEntity<?> entity) { if(entity == null) { throw new IllegalArgumentException("Can not create snapshot from a null entity"); } if (DbFacade.getInstance().getDaoForEntity((Class<BusinessEntity<Serializable>>) entity.getClass()) == null) { throw new IllegalArgumentException("There is no rollback DAO registered for entity type " + entity.getClass().getName()); } }
Source:
public static MBLayer create(JSONObject layer ){ if( layer.containsKey("type") && layer.get("type") instanceof String){ String type = (String) layer.get("type"); switch( type ){ case "line": return new LineMBLayer(layer); case "fill": return new FillMBLayer(layer); case "raster": return new RasterMBLayer(layer); default: throw new MBFormatException(("\"type\" " + type + " is not a valid layer type. Must be one of: " + "background, fill, line, symbol, raster, circle, fill-extrusion")); } } throw new MBFormatException("\"type\" required to create layer."); }

Target:
public static MBLayer create(JSONObject layer ){ if( layer.containsKey("type") && layer.get("type") instanceof String){ String type = (String) layer.get("type"); switch( type ){ case "line": return new LineMBLayer(layer); case "fill": return new FillMBLayer(layer); case "raster": return new RasterMBLayer(layer); case "symbol": case "circle": case "fill-extrusion": throw new UnsupportedOperationException("MBLayer type "+type+" not yet implemented"); default: throw new MBFormatException(("\"type\" " + type + " is not a valid layer type. Must be one of: " + "background, fill, line, symbol, raster, circle, fill-extrusion")); } } throw new MBFormatException("\"type\" required to create layer."); }
Source:
public void sendNotifications( Map preference, String application, Event event, Map config, String status) { Map<String, ?> execution = (Map<String, ?>) event.getContent().get("execution"); String pipelineConfigId = (String) execution.get("pipelineConfigId"); if (pipelineConfigId == null) { return; } log.info("Received dry run notification for {}", pipelineConfigId); Optional<Pipeline> match = front50 .getPipelines(application) .stream() .filter(pipeline -> pipeline.getId().equals(pipelineConfigId)) .findFirst(); if (!match.isPresent()) { log.error("No pipeline with config id found for {}", pipelineConfigId, application); return; } try { Pipeline pipeline = match.get(); log.warn("Triggering dry run of {}", pipeline.getApplication(), pipeline.getName()); Trigger trigger = Trigger.builder() .type(Trigger.Type.DRYRUN.toString()) .lastSuccessfulExecution(execution) .build(); orca.trigger( pipeline .withName(format("%s (dry run)", pipeline.getName())) .withId(null) .withTrigger(trigger) .withNotifications(mapper.convertValue(properties.getNotifications(), List.class))) .subscribe(response -> log.info("Pipeline triggered: {}", response)); } catch (Exception ex) { log.error(format("Error triggering dry run of %s", pipelineConfigId), ex); } }

Target:
public void sendNotifications( Map preference, String application, Event event, Map config, String status) { Map<String, ?> execution = (Map<String, ?>) event.getContent().get("execution"); String pipelineConfigId = (String) execution.get("pipelineConfigId"); if (pipelineConfigId == null) { return; } log.info("Received dry run notification for {}", pipelineConfigId); Optional<Pipeline> match = front50 .getPipelines(application) .stream() .filter(pipeline -> pipeline.getId().equals(pipelineConfigId)) .findFirst(); if (!match.isPresent()) { log.error("No pipeline with config id found for {}", pipelineConfigId, application); return; } try { Pipeline pipeline = match.get(); log.warn("Triggering dry run of {}", pipeline.getApplication(), pipeline.getName()); Trigger trigger = Trigger.builder() .type(Trigger.Type.DRYRUN.toString()) .lastSuccessfulExecution(execution) .build(); orca.trigger( pipeline .withName(format("%s (dry run)", pipeline.getName())) .withId(null) .withTrigger(trigger) .withNotifications(mapper.convertValue(properties.getNotifications(), List.class))) .subscribe(response -> log.info("Pipeline triggered: {}", response)); } catch (Exception ex) { log.error("Error triggering dry run of {}", pipelineConfigId, ex); } }
Source:
public void DeleteAndRestoreMapTests_004_StaffUserCanDeleteMap() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userNameStaff, credentials.passwordStaff, wikiURL); InteractiveMapPageObject selectedMap = base.openInteractiveMapById(wikiURL, InteractiveMapsContent.mapToDeleteAndRestore); selectedMap.verifyMapOpened(); String deletedMapId = selectedMap.getEmbedMapID(); DeleteAMapComponentObject deleteMapModal = selectedMap.deleteMap(); InteractiveMapsPageObject specialMap = deleteMapModal.deleteMap(); specialMap.verifyMapDeletedMessage(); }

Target:
public void DeleteAndRestoreMapTests_004_StaffUserCanDeleteMap() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userNameStaff, credentials.passwordStaff, wikiURL); InteractiveMapPageObject selectedMap = base.openInteractiveMapById(wikiURL, InteractiveMapsContent.mapToDeleteAndRestore[2]); selectedMap.verifyMapOpened(); DeleteAMapComponentObject deleteMapModal = selectedMap.deleteMap(); InteractiveMapsPageObject specialMap = deleteMapModal.deleteMap(); }
Source:
public void testList() { List<CloudService> response = api().list(); for (CloudService cloudService : api().list()) { checkHostedService(cloudService); } if (!response.isEmpty()) { CloudService cloudService = response.iterator().next(); assertEquals(api().get(cloudService.name()), cloudService); } }

Target:
public void testList() { List<CloudService> response = api().list(); for (CloudService cloudService : response) { checkHostedService(cloudService); } if (!response.isEmpty()) { CloudService cloudService = response.iterator().next(); assertEquals(api().get(cloudService.name()), cloudService); } }
Source:
public void setMode(Mode mode) { if (!mode.name().equals(model.getOptionsParam().getViewParam().getMode())) { this.mode = mode; getExtensionLoader().sessionModeChangedAllPlugin(mode); model.getOptionsParam().getViewParam().setMode(mode.name()); } }

Target:
public void setMode(Mode mode) { if (this.mode != mode) { this.mode = mode; getExtensionLoader().sessionModeChangedAllPlugin(mode); model.getOptionsParam().getViewParam().setMode(mode.name()); } }
Source:
public synchronized void loadAccounts() { accounts = new HashMap<String, Account>(); accountsInOrder = new LinkedList<Account>(); String accountUuids = getStorage().getString("accountUuids", null); if ((accountUuids != null) && (accountUuids.length() != 0)) { String[] uuids = accountUuids.split(","); for (String uuid : uuids) { Account newAccount = new Account(this, uuid); accounts.put(uuid, newAccount); accountsInOrder.add(newAccount); } } if ((newAccount != null) && newAccount.getAccountNumber() != -1) { accounts.put(newAccount.getUuid(), newAccount); if (!accountsInOrder.contains(newAccount)) accountsInOrder.add(newAccount); newAccount = null; } }

Target:
public synchronized void loadAccounts() { accounts = new HashMap<String, Account>(); accountsInOrder = new LinkedList<Account>(); String accountUuids = getStorage().getString("accountUuids", null); if ((accountUuids != null) && (accountUuids.length() != 0)) { String[] uuids = accountUuids.split(","); for (String uuid : uuids) { Account newAccount = new Account(this, uuid); accounts.put(uuid, newAccount); accountsInOrder.add(newAccount); } } if ((newAccount != null) && newAccount.getAccountNumber() != -1) { accounts.put(newAccount.getUuid(), newAccount); if (!accountsInOrder.contains(newAccount)) { accountsInOrder.add(newAccount); } newAccount = null; } }
Source:
private byte[] wrapConfidentialityProtectedMessage(byte[] message, int offset, int len) throws SaslException { byte[] messageMac = computeHMAC(wrapHmacKeyIntegrity, wrapSeqNum, hmacMD5, message, offset, len); int paddingLength = 0; byte[] pad = null; int blockSize = wrapCipher.getBlockSize(); if (blockSize > 0) { paddingLength = blockSize - ((len + 10) % blockSize); pad = new byte[paddingLength]; Arrays.fill(pad, (byte)paddingLength); } byte[] toCipher = new byte[len + paddingLength + 10]; System.arraycopy(message, offset, toCipher, 0, len); if (paddingLength > 0) { System.arraycopy(pad, 0, toCipher, len, paddingLength); } System.arraycopy(messageMac, 0, toCipher, len + paddingLength, 10); byte[] cipheredPart = null; byte[] result = null; try { cipheredPart = wrapCipher.update(toCipher); result = new byte[cipheredPart.length + 6]; System.arraycopy(cipheredPart, 0, result, 0, cipheredPart.length); integerByteOrdered(1, result, cipheredPart.length, 2); integerByteOrdered(wrapSeqNum, result, cipheredPart.length + 2, 4); } catch (Exception e) { throw log.mechProblemDuringCrypt(getMechanismName(), e).toSaslException(); } wrapSeqNum++; return result; }

Target:
private byte[] wrapConfidentialityProtectedMessage(byte[] message, int offset, int len) throws SaslException { byte[] messageMac = computeHMAC(wrapHmacKeyIntegrity, wrapSeqNum, hmacMD5, message, offset, len); int paddingLength = 0; byte[] pad = null; int blockSize = wrapCipher.getBlockSize(); if (blockSize > 0) { paddingLength = blockSize - ((len + 10) % blockSize); pad = new byte[paddingLength]; Arrays.fill(pad, (byte)paddingLength); } byte[] toCipher = new byte[len + paddingLength + 10]; System.arraycopy(message, offset, toCipher, 0, len); if (paddingLength > 0) { System.arraycopy(pad, 0, toCipher, len, paddingLength); } System.arraycopy(messageMac, 0, toCipher, len + paddingLength, 10); byte[] cipheredPart = null; try { cipheredPart = wrapCipher.update(toCipher); } catch (Exception e) { throw log.mechProblemDuringCrypt(getMechanismName(), e).toSaslException(); } if (cipheredPart == null){ throw log.mechProblemDuringCryptResultIsNull(getMechanismName()).toSaslException(); } byte[] result = new byte[cipheredPart.length + 6]; System.arraycopy(cipheredPart, 0, result, 0, cipheredPart.length); integerByteOrdered(1, result, cipheredPart.length, 2); integerByteOrdered(wrapSeqNum, result, cipheredPart.length + 2, 4); wrapSeqNum++; return result; }
Source:
public PingServiceGrpc.PingServiceBlockingStub getBlockingPingClient( final String serverHost, final int serverPort ) { final Channel channel = channelFactory.getSharedManagedChannel(serverHost, serverPort); return PingServiceGrpc.newBlockingStub(channel); }

Target:
public PingServiceGrpc.PingServiceBlockingStub getBlockingPingClient( final String serverHost, final int serverPort ) { return PingServiceGrpc.newBlockingStub( channelFactory.getSharedManagedChannel(serverHost, serverPort) ); }
Source:
public String getInstallationLocationNamespace() { String kubernetesNamespace = System.getenv("KUBERNETES_NAMESPACE"); String podNamespace = System.getenv("POD_NAMESPACE"); return kubernetesNamespace == null ? podNamespace : kubernetesNamespace; }

Target:
public String getInstallationLocationNamespace() { if (kubernetesNamespace == null && podNamespace == null) { LOG.warn( "Neither KUBERNETES_NAMESPACE nor POD_NAMESPACE is defined. Unable to determine Che installation location"); } return kubernetesNamespace == null ? podNamespace : kubernetesNamespace; }
Source:
public void init() { if (initialized) { return; } this.totalBuffer = bufferSupplier.get(); LimitedBufferGrouper.validateBufferCapacity( limit, maxLoadFactor, totalBuffer, bucketSize ); int heapByteSize = (limit + 1) * Ints.BYTES; int hashTableSize = ByteBufferHashTable.calculateTableArenaSizeWithFixedAdditionalSize( totalBuffer.capacity(), bucketSize, heapByteSize ); hashTableBuffer = totalBuffer.duplicate(); hashTableBuffer.position(0); hashTableBuffer.limit(hashTableSize); hashTableBuffer = hashTableBuffer.slice(); offsetHeapBuffer = totalBuffer.duplicate(); offsetHeapBuffer.position(hashTableSize); offsetHeapBuffer = offsetHeapBuffer.slice(); offsetHeapBuffer.limit(totalBuffer.capacity() - hashTableSize); this.hashTable = new AlternatingByteBufferHashTable( maxLoadFactor, initialBuckets, bucketSize, hashTableBuffer, keySize, bufferGrouperMaxSize ); this.heapIndexUpdater = new BufferGrouperOffsetHeapIndexUpdater(totalBuffer, bucketSize - Ints.BYTES); this.offsetHeap = new ByteBufferMinMaxOffsetHeap(offsetHeapBuffer, limit, makeHeapComparator(), heapIndexUpdater); reset(); initialized = true; }

Target:
public void init() { if (initialized) { return; } this.totalBuffer = bufferSupplier.get(); validateBufferCapacity( limit, maxLoadFactor, totalBuffer, bucketSize ); int heapByteSize = (limit + 1) * Ints.BYTES; int hashTableSize = ByteBufferHashTable.calculateTableArenaSizeWithFixedAdditionalSize( totalBuffer.capacity(), bucketSize, heapByteSize ); hashTableBuffer = totalBuffer.duplicate(); hashTableBuffer.position(0); hashTableBuffer.limit(hashTableSize); hashTableBuffer = hashTableBuffer.slice(); offsetHeapBuffer = totalBuffer.duplicate(); offsetHeapBuffer.position(hashTableSize); offsetHeapBuffer = offsetHeapBuffer.slice(); offsetHeapBuffer.limit(totalBuffer.capacity() - hashTableSize); this.hashTable = new AlternatingByteBufferHashTable( maxLoadFactor, initialBuckets, bucketSize, hashTableBuffer, keySize, bufferGrouperMaxSize ); this.heapIndexUpdater = new BufferGrouperOffsetHeapIndexUpdater(totalBuffer, bucketSize - Ints.BYTES); this.offsetHeap = new ByteBufferMinMaxOffsetHeap(offsetHeapBuffer, limit, makeHeapComparator(), heapIndexUpdater); reset(); initialized = true; }
Source:
public Disk update(Disk incoming) { if (incoming.isSetQcowVersion()) { return performUpdate( incoming, new QueryIdResolver<>(QueryType.GetDiskByDiskId, IdQueryParameters.class), ActionType.AmendImageGroupVolumes, new UpdateParametersProvider()); } return performUpdate(incoming, new DiskResolver(), ActionType.UpdateVmDisk, new BackendDiskResource.UpdateParametersProvider()); }

Target:
public Disk update(Disk incoming) { if (incoming.isSetQcowVersion()) { return performUpdate( incoming, new QueryIdResolver<>(QueryType.GetDiskByDiskId, IdQueryParameters.class), ActionType.AmendImageGroupVolumes, new UpdateParametersProvider()); } return performUpdate(incoming, new QueryIdResolver<>(QueryType.GetDiskByDiskId, IdQueryParameters.class), ActionType.UpdateVmDisk, new BackendDiskResource.UpdateParametersProvider()); }
Source:
public static Set<Gene> searchGene(String keyword, Boolean exactSearch) { Set<Gene> genes = new HashSet<>(); if (exactSearch == null) exactSearch = false; if (keyword != null && keyword != "") { Set<Gene> allGenes = GeneUtils.getAllGenes(); if (org.apache.commons.lang3.math.NumberUtils.isNumber(keyword)) { for (Gene gene : allGenes) { String entrezId = Integer.toString(gene.getEntrezGeneId()); if (exactSearch) { if (entrezId.equals(keyword)) { genes.add(gene); } } else { if (entrezId.contains(keyword)) { genes.add(gene); } } } } else { keyword = keyword.toLowerCase(); for (Gene gene : allGenes) { String hugoSymbol = gene.getHugoSymbol().toLowerCase(); if (exactSearch) { if (hugoSymbol.equals(keyword)) { genes.add(gene); } else { for (String alias : gene.getGeneAliases()) { if (alias.toLowerCase().equals(keyword)) { genes.add(gene); break; } } } } else { if (StringUtils.containsIgnoreCase(hugoSymbol, keyword)) { genes.add(gene); } else { for (String alias : gene.getGeneAliases()) { if (StringUtils.containsIgnoreCase(alias, keyword)) { genes.add(gene); break; } } } } } } } return genes; }

Target:
public static Set<Gene> searchGene(String keyword, Boolean exactSearch) { Set<Gene> genes = new HashSet<>(); if (exactSearch == null) exactSearch = false; if (keyword != null && keyword != "") { Set<Gene> allGenes = GeneUtils.getAllGenes(); if (org.apache.commons.lang3.math.NumberUtils.isNumber(keyword)) { for (Gene gene : allGenes) { String entrezId = Integer.toString(gene.getEntrezGeneId()); if (exactSearch) { if (entrezId.equals(keyword)) { genes.add(gene); } } else { if (entrezId.contains(keyword)) { genes.add(gene); } } } } else { keyword = keyword.toLowerCase(); for (Gene gene : allGenes) { String hugoSymbol = gene.getHugoSymbol(); if (exactSearch) { if (hugoSymbol.equalsIgnoreCase(keyword)) { genes.add(gene); } else { for (String alias : gene.getGeneAliases()) { if (alias.toLowerCase().equals(keyword)) { genes.add(gene); break; } } } } else { if (StringUtils.containsIgnoreCase(hugoSymbol, keyword)) { genes.add(gene); } else { for (String alias : gene.getGeneAliases()) { if (StringUtils.containsIgnoreCase(alias, keyword)) { genes.add(gene); break; } } } } } } } return genes; }
Source:
public List<ProgramState> setConstraint(ProgramState programState, ObjectConstraint nullConstraint) { Constraint cstraint = programState.getConstraint(this, nullConstraint.getClass()); if (cstraint == null) { if(nullConstraint.isNull()) { PMap<Class<? extends Constraint>, Constraint> onlyNullConstraint = PCollections.<Class<? extends Constraint>, Constraint>emptyMap() .put(ObjectConstraint.class, ObjectConstraint.NULL); return ImmutableList.of(programState.addConstraints(this, onlyNullConstraint)); } else { return ImmutableList.of(programState.addConstraint(this, nullConstraint)); } } else if (cstraint != nullConstraint) { return ImmutableList.of(); } return ImmutableList.of(programState); }

Target:
public List<ProgramState> setConstraint(ProgramState programState, ObjectConstraint nullConstraint) { Constraint constraint = programState.getConstraint(this, nullConstraint.getClass()); if (constraint == null) { if(nullConstraint.isNull()) { PMap<Class<? extends Constraint>, Constraint> onlyNullConstraint = PCollections.<Class<? extends Constraint>, Constraint>emptyMap() .put(ObjectConstraint.class, ObjectConstraint.NULL); return ImmutableList.of(programState.addConstraints(this, onlyNullConstraint)); } else { return ImmutableList.of(programState.addConstraint(this, nullConstraint)); } } else if (constraint != nullConstraint) { return ImmutableList.of(); } return ImmutableList.of(programState); }
Source:
public static void moveToList(final Collection<Geocache> caches, final int listId) { if (caches.isEmpty()) { Log.e("No cache was passed to moveToList"); return; } final AbstractList list = AbstractList.getListById(listId); if (list == null) { Log.e("Target list with id " + list + " does not exist in moveToList"); return; } if (!list.isConcrete()) { return; } init(); final SQLiteStatement add = PreparedStatement.ADD_TO_LIST.getStatement(); final SQLiteStatement remove = PreparedStatement.REMOVE_FROM_ALL_LISTS.getStatement(); database.beginTransaction(); try { for (final Geocache cache : caches) { remove.bindString(1, cache.getGeocode()); remove.execute(); add.bindLong(1, listId); add.bindString(2, cache.getGeocode()); add.execute(); cache.getLists().add(listId); } database.setTransactionSuccessful(); } finally { database.endTransaction(); } }

Target:
public static void moveToList(final Collection<Geocache> caches, final int listId) { if (caches.isEmpty()) { Log.e("No cache was passed to moveToList"); return; } final AbstractList list = AbstractList.getListById(listId); if (list == null) { Log.e("Target list with id " + list + " does not exist in moveToList"); return; } if (!list.isConcrete()) { return; } init(); final SQLiteStatement add = PreparedStatement.ADD_TO_LIST.getStatement(); final SQLiteStatement remove = PreparedStatement.REMOVE_FROM_ALL_LISTS.getStatement(); database.beginTransaction(); try { for (final Geocache cache : caches) { remove.bindString(1, cache.getGeocode()); remove.execute(); add.bindLong(1, listId); add.bindString(2, cache.getGeocode()); add.execute(); cache.getLists().clear(); cache.getLists().add(listId); } database.setTransactionSuccessful(); } finally { database.endTransaction(); } }
Source:
public void testGetCompletionTimesTwoFragmentInteractionP2PSync() throws Exception { Trace trace1 = new Trace(); trace1.setId("1_2ip2psync"); trace1.setStartTime(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()) - 4000); Consumer c1 = new Consumer(); c1.setUri("testuri"); c1.setDuration(5000); trace1.getNodes().add(c1); Producer p1 = new Producer(); p1.setUri("testuri2"); p1.setBaseTime(500); p1.setDuration(4000); p1.addInteractionCorrelationId("cid1_2ip2psync"); c1.getNodes().add(p1); Trace trace2 = new Trace(); trace2.setId("2_2ip2psync"); trace2.setStartTime(trace1.getStartTime() + 2000); Consumer c2 = new Consumer(); c2.setUri("testuri2"); c2.setDuration(1000); c2.addInteractionCorrelationId("cid1_2ip2psync"); trace2.getNodes().add(c2); tracePublisher.publish(null, Arrays.asList(trace1, trace2)); Wait.until(() -> traceService.searchFragments(null, new Criteria()).size() == 2); Wait.until(() -> analyticsService.getTraceCompletionTimes(null, new Criteria()).size() == 1); List<CompletionTime> times = analyticsService.getTraceCompletionTimes(null, new Criteria()); assertNotNull(times); assertEquals(1, times.size()); assertEquals(5000, times.get(0).getDuration()); }

Target:
public void testGetCompletionTimesTwoFragmentInteractionP2PSync() throws Exception { Trace trace1 = new Trace(); trace1.setId("1_2ip2psync"); trace1.setStartTime(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()) - FOUR_MS_IN_MICRO_SEC); Consumer c1 = new Consumer(); c1.setUri("testuri"); c1.setDuration(5000); trace1.getNodes().add(c1); Producer p1 = new Producer(); p1.setUri("testuri2"); p1.setBaseTime(500); p1.setDuration(4000); p1.addInteractionCorrelationId("cid1_2ip2psync"); c1.getNodes().add(p1); Trace trace2 = new Trace(); trace2.setId("2_2ip2psync"); trace2.setStartTime(trace1.getStartTime() + 2000); Consumer c2 = new Consumer(); c2.setUri("testuri2"); c2.setDuration(1000); c2.addInteractionCorrelationId("cid1_2ip2psync"); trace2.getNodes().add(c2); tracePublisher.publish(null, Arrays.asList(trace1, trace2)); Wait.until(() -> traceService.searchFragments(null, new Criteria()).size() == 2); Wait.until(() -> analyticsService.getTraceCompletionTimes(null, new Criteria()).size() == 1); List<CompletionTime> times = analyticsService.getTraceCompletionTimes(null, new Criteria()); assertNotNull(times); assertEquals(1, times.size()); assertEquals(5000, times.get(0).getDuration()); }
Source:
public Map<String, Object> saveNewReport(@RequestBody ReportPayload payLoad) { final ReportDto reportDto = payLoad.getReport(); final Map<String, Object> response = new HashMap<String, Object>(); ReportDto dto = null; RestStatusDto statusDto = new RestStatusDto(); statusDto.setStatus("failed"); if (reportDto != null) { User user = userDao.findUserByEmail(reportDto.getUser()); if (user != null) { Report r = new Report(); BeanUtils.copyProperties(reportDto, r, doNotCopy); r.setUser(user.getKey().getId()); r.setState(Report.QUEUED); r = reportDao.save(r); Queue queue = QueueFactory.getDefaultQueue(); TaskOptions options = TaskOptions.Builder.withUrl("/app_worker/reportservlet") .param(TaskRequest.ACTION_PARAM, ReportTaskRequest.START_ACTION) .param(ReportTaskRequest.ID_PARAM, Long.toString(r.getKey().getId())); queue.add(options); dto = new ReportDto(); DtoMarshaller.copyToDto(r, dto); statusDto.setStatus("ok"); } } response.put("meta", statusDto); response.put("report", dto); return response; }

Target:
public Map<String, Object> saveNewReport(@RequestBody ReportPayload payLoad) { final ReportDto reportDto = payLoad.getReport(); final Map<String, Object> response = new HashMap<String, Object>(); ReportDto dto = null; RestStatusDto statusDto = new RestStatusDto(); statusDto.setStatus("failed"); if (reportDto != null) { Report r = new Report(); BeanUtils.copyProperties(reportDto, r, doNotCopy); r.setUser((Long)SecurityContextHolder.getContext().getAuthentication().getCredentials()); r.setState(Report.QUEUED); r = reportDao.save(r); ReportServlet.queueStart(r); dto = new ReportDto(); BeanUtils.copyProperties(r, dto); dto.setKeyId(r.getKey().getId()); statusDto.setStatus("ok"); } response.put("meta", statusDto); response.put("report", dto); return response; }
Source:
private String getMessage(String identifier, String value) { return INT_IDENTIFIER_VALUE.replace("xxx", identifier).replace("nnn", value); }

Target:
private String getMessage(String identifier, String value) { return MessageFormat.format("Either make \"{0}\" a \"long\" or correct this shift to {1}", identifier, value); }
Source:
public void setBackgroundRGB(@Nullable RGB background) { fBackgroundRGB = background; if (fBackgroundColor != null) { fBackgroundColor.dispose(); } if (fDimmedBackgroundColor != null) { fDimmedBackgroundColor.dispose(); } Display display = Display.getDefault(); fBackgroundColor = (fBackgroundRGB != null) ? new Color(display, fBackgroundRGB) : null; fDimmedBackgroundColor = (fBackgroundRGB == null) ? null : new Color(display, ColorUtil.blend( fBackgroundRGB, display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB())); }

Target:
public void setBackgroundRGB(@Nullable RGB background) { fBackgroundRGB = background; if (fBackgroundColor != null) { fBackgroundColor.dispose(); } if (fDimmedBackgroundColor != null) { fDimmedBackgroundColor.dispose(); } if (fDimmedForegroundColor != null) { fDimmedForegroundColor.dispose(); } Display display = Display.getDefault(); fBackgroundColor = (fBackgroundRGB != null) ? new Color(display, fBackgroundRGB) : null; fDimmedBackgroundColor = (fBackgroundRGB == null) ? null : new Color(display, ColorUtil.blend( fBackgroundRGB, display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB())); fDimmedForegroundColor = new Color(display, ColorUtil.blend( (fForegroundRGB != null) ? fForegroundRGB : display.getSystemColor(SWT.COLOR_LIST_FOREGROUND).getRGB(), (fBackgroundRGB != null) ? fBackgroundRGB : display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB())); }
Source:
public void testIsUsingScsiReservationValidWhenAddingFloatingDisk() { setupForLun(); LunDisk lunDisk1 = createLunDisk(); lunDisk1.setSgio(ScsiGenericIO.FILTERED); lunDisk1.setUsingScsiReservation(true); assertThat(lunValidator.isUsingScsiReservationValid(null, lunDisk1), failsWith(VdcBllMessages.ACTION_TYPE_FAILED_SCSI_RESERVATION_NOT_VALID_FOR_FLOATING_DISK)); }

Target:
public void testIsUsingScsiReservationValidWhenAddingFloatingDisk() { setupForLun(); LunDisk lunDisk1 = createLunDisk(ScsiGenericIO.UNFILTERED, true); assertThat(lunValidator.isUsingScsiReservationValid(null, lunDisk1), failsWith(VdcBllMessages.ACTION_TYPE_FAILED_SCSI_RESERVATION_NOT_VALID_FOR_FLOATING_DISK)); }
Source:
private static String formatRepeat(final TimingWindow tw) { if (tw.getDuration() == TimingWindow.WINDOW_REMAINS_OPEN_FOREVER) return null; switch (tw.getRepeat()) { case -1: return "forever"; case 0: return "never"; case 1: return "1 time"; default: return tw.getRepeat() + " times"; } }

Target:
private static String formatRepeat(final TimingWindow tw) { if (tw.getDuration() == TimingWindow.WINDOW_REMAINS_OPEN_FOREVER) return null; final int repeats = tw.getRepeat(); switch (repeats) { case TimingWindow.REPEAT_FOREVER: return "forever"; case TimingWindow.REPEAT_NEVER: return "never"; default: return String.format("%d time%s", repeats, repeats > 1 ? "s" : ""); } }
Source:
protected <T extends APIEntity> void clone(T from) { }

Target:
protected <T extends APIEntity> void clone(T from) { cloneBase(from); APIJiraPriority jiraPriority = (APIJiraPriority) from; this.name = jiraPriority.name; }
Source:
public ITmfTrace getTrace() { for (ITmfTrace openedTrace : TmfTraceManager.getInstance().getOpenedTraces()) { for (ITmfTrace singleTrace : TmfTraceManager.getTraceSet(openedTrace)) { if (getParent() instanceof TmfExperimentElement) { if (getElementUnderTraceFolder().getResource().equals(singleTrace.getResource())) { return singleTrace; } } else { if (getResource().equals(singleTrace.getResource())) { return singleTrace; } } } } return null; }

Target:
public ITmfTrace getTrace() { ITmfProjectModelElement parent = getParent(); IResource resource = getElementUnderTraceFolder().getResource(); if (parent instanceof TmfExperimentElement) { return lookupExperimentTrace((TmfExperimentElement) parent, resource); } return lookupSingleTrace(resource); }
Source:
private CriticalPathInfo findCriticalPathHelper(PTOperator operator, Map<PTOperator, CriticalPathInfo> cache) { if (cache.containsKey(operator)) { return cache.get(operator); } CriticalPathInfo cpi; PTOperator slowestUpstreamOperator = slowestUpstreamOp.get(operator); if (slowestUpstreamOperator != null) { cpi = findCriticalPathHelper(slowestUpstreamOperator, cache); try { cpi = (CriticalPathInfo)cpi.clone(); } catch (CloneNotSupportedException ex) { throw new RuntimeException(); } } else { cpi = new CriticalPathInfo(); } cpi.latency += operator.stats.getLatencyMA(); cpi.path.addLast(operator.getId()); cache.put(operator, cpi); return cpi; }

Target:
private CriticalPathInfo findCriticalPathHelper(PTOperator operator, Map<PTOperator, CriticalPathInfo> cache) { CriticalPathInfo cpi = cache.get(operator); if (cpi != null) { return cpi; } PTOperator slowestUpstreamOperator = slowestUpstreamOp.get(operator); if (slowestUpstreamOperator != null) { cpi = findCriticalPathHelper(slowestUpstreamOperator, cache); try { cpi = (CriticalPathInfo)cpi.clone(); } catch (CloneNotSupportedException ex) { throw new RuntimeException(); } } else { cpi = new CriticalPathInfo(); } cpi.latency += operator.stats.getLatencyMA(); cpi.path.addLast(operator.getId()); cache.put(operator, cpi); return cpi; }
Source:
protected void calculateBounds() { if (this.dropdownShell != null && !this.dropdownShell.isDisposed()) { Point size = getSize(); int listHeight = (getVisibleItemCount() > 0 ? getVisibleItemCount() : 3) * this.dropdownTable.getItemHeight() + this.dropdownTable.getGridLineWidth() * 2; this.dropdownTable.getColumn(0).pack(); int listWidth = Math.max( this.dropdownTable.computeSize(SWT.DEFAULT, listHeight, true).x, size.x); int correction = 0; if (this.maxVisibleItems > 0 && getVisibleItemCount() < this.dropdownTable.getItemCount()) { correction = 2; } this.dropdownTable.setSize(listWidth - correction, listHeight - correction); calculateColumnWidth(); Point textPosition = this.text.toDisplay(this.text.getLocation()); int dropdownShellStartingY = textPosition.y + this.text.getBounds().height; int shellBottomY = textPosition.y + this.text.getBounds().height + listHeight; if (shellBottomY > Display.getCurrent().getBounds().height) { dropdownShellStartingY = textPosition.y - listHeight; } int filterTextBoxHeight = 0; if (this.dropdownFilter) { Point point = this.filterBox.computeSize(SWT.DEFAULT, SWT.DEFAULT); filterTextBoxHeight = this.filterBox.getBorderWidth() + point.y; } Rectangle shellBounds = new Rectangle( textPosition.x, dropdownShellStartingY, listWidth, listHeight + filterTextBoxHeight); this.dropdownShell.setBounds(shellBounds); } }

Target:
protected void calculateBounds() { if (this.dropdownShell != null && !this.dropdownShell.isDisposed()) { Point size = getSize(); int listHeight = (getVisibleItemCount() > 0 ? getVisibleItemCount() : 3) * this.dropdownTable.getItemHeight() + this.dropdownTable.getGridLineWidth() * 2; this.dropdownTable.getColumn(0).pack(); int listWidth = Math.max( this.dropdownTable.computeSize(SWT.DEFAULT, listHeight, true).x, size.x); int correction = 0; if (this.maxVisibleItems > 0 && getVisibleItemCount() < this.dropdownTable.getItemCount()) { correction = 2; } this.dropdownTable.setSize(listWidth - correction, listHeight - correction); calculateColumnWidth(); Point textPosition = this.text.toDisplay(this.text.getLocation()); int dropdownShellStartingY = textPosition.y + this.text.getBounds().height; int shellBottomY = textPosition.y + this.text.getBounds().height + listHeight; if (shellBottomY > Display.getCurrent().getBounds().height) { dropdownShellStartingY = textPosition.y - listHeight; } int filterTextBoxHeight = this.showDropdownFilter ? this.filterBox.computeSize(SWT.DEFAULT, SWT.DEFAULT).y : 0; Rectangle shellBounds = new Rectangle( textPosition.x, dropdownShellStartingY, listWidth, listHeight + filterTextBoxHeight); this.dropdownShell.setBounds(shellBounds); } }
Source:
public void contributorCanNotEditContributors() { final List<Contributor> contributors = new ArrayList<>(); contributors.add(new Contributor("admin", ContributorType.CONTRIBUTOR)); assertFalse(service.canEditContributors(contributors, ContributorType.OWNER)); assertFalse(service.canEditContributors(contributors, ContributorType.ADMIN)); assertFalse(service.canEditContributors(contributors, ContributorType.CONTRIBUTOR)); }

Target:
public void contributorCanNotEditContributors() { final List<Contributor> contributors = new ArrayList<>(); contributors.add(new Contributor("owner", ContributorType.CONTRIBUTOR)); assertFalse(service.canEditContributors(contributors, ContributorType.OWNER)); assertFalse(service.canEditContributors(contributors, ContributorType.ADMIN)); assertFalse(service.canEditContributors(contributors, ContributorType.CONTRIBUTOR)); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Implementation other = (Implementation) o; if (emulateSdk != other.emulateSdk) return false; if (!qualifiers.equals(other.qualifiers)) return false; if (!Arrays.equals(shadows, other.shadows)) return false; return true; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Implementation other = (Implementation) o; if (emulateSdk != other.emulateSdk) return false; if (reportSdk != other.reportSdk) return false; if (!qualifiers.equals(other.qualifiers)) return false; if (!Arrays.equals(shadows, other.shadows)) return false; if (application != other.application) return false; return true; }