auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Node parent() { return parents.isEmpty() ? null : Lists.newArrayList(parents.keySet()).get(0); }

Target:
public Node parent() { return parents.isEmpty() ? null : getParents().get(0); }
Source:
public void validate() { for (Builder<?> validatable : asList(globalJmxStatistics, transport, serialization, shutdown, site)) { validatable.validate(); } for (Builder<?> m : modules) { m.validate(); } }

Target:
public void validate() { for (Builder<?> validatable : asList(evictionThreadPool, listenerThreadPool, replicationQueueThreadPool, persistenceThreadPool, globalJmxStatistics, transport, serialization, shutdown, site)) { validatable.validate(); } for (Builder<?> m : modules) { m.validate(); } }
Source:
protected boolean setAndValidateDiskProfiles() { if (getParameters().getVm().getDiskMap() != null) { Map<DiskImage, Guid> map = new HashMap<>(); for (Disk disk : getParameters().getVm().getDiskMap().values()) { if (disk instanceof DiskImage) { DiskImage diskImage = (DiskImage) disk; map.put(diskImage, imageToDestinationDomainMap.get(diskImage.getId())); } } return validate(DiskProfileHelper.setAndValidateDiskProfiles(map)); } return true; }

Target:
protected boolean setAndValidateDiskProfiles() { if (getParameters().getVm().getDiskMap() != null) { Map<DiskImage, Guid> map = new HashMap<>(); for (Disk disk : getParameters().getVm().getDiskMap().values()) { if (disk.getDiskStorageType() == DiskStorageType.IMAGE) { DiskImage diskImage = (DiskImage) disk; map.put(diskImage, imageToDestinationDomainMap.get(diskImage.getId())); } } return validate(DiskProfileHelper.setAndValidateDiskProfiles(map)); } return true; }
Source:
public void parse(InputStream in, boolean recurse, MimeConfig parserConfig) throws IOException, MessagingException { mHeader.clear(); mFrom = null; mTo = null; mCc = null; mBcc = null; mReplyTo = null; xOriginalTo = null; deliveredTo = null; xEnvelopeTo = null; mMessageId = null; mReferences = null; mInReplyTo = null; mSentDate = null; mBody = null; MimeStreamParser parser = new MimeStreamParser(parserConfig); parser.setContentHandler(new MimeMessageBuilder(new DefaultBodyFactory())); if (recurse) { parser.setRecurse(); } try { parser.parse(new EOLConvertingInputStream(in)); } catch (MimeException me) { throw new MessagingException(me.getMessage(), me); } }

Target:
void parse(InputStream in, boolean recurse, MimeConfig parserConfig) throws IOException, MessagingException { mHeader.clear(); mFrom = null; mTo = null; mCc = null; mBcc = null; mReplyTo = null; xOriginalTo = null; deliveredTo = null; xEnvelopeTo = null; mMessageId = null; mReferences = null; mInReplyTo = null; mSentDate = null; mBody = null; MimeStreamParser parser = new MimeStreamParser(parserConfig); parser.setContentHandler(new MimeMessageBuilder(new DefaultBodyFactory())); if (recurse) { parser.setRecurse(); } try { parser.parse(new EOLConvertingInputStream(in)); } catch (MimeException me) { throw new MessagingException(me.getMessage(), me); } }
Source:
private void flushCurrentSortBuffer() throws IOException { if (currentSortBuffer == null || !currentSortBuffer.hasRemaining()) { releaseCurrentSortBuffer(); return; } currentSortBuffer.finish(); PartitionedFileWriter fileWriter = getPartitionedFileWriter(); while (currentSortBuffer.hasRemaining()) { BufferWithChannel bufferWithChannel = currentSortBuffer.copyData(writeBuffer); Buffer buffer = bufferWithChannel.getBuffer(); int subpartitionIndex = bufferWithChannel.getChannelIndex(); writeCompressedBufferIfPossible(buffer, fileWriter, subpartitionIndex); updateStatistics(buffer, subpartitionIndex); } releaseCurrentSortBuffer(); }

Target:
private void flushCurrentSortBuffer() throws IOException { if (currentSortBuffer == null) { return; } currentSortBuffer.finish(); if (currentSortBuffer.hasRemaining()) { fileWriter.startNewRegion(); while (currentSortBuffer.hasRemaining()) { BufferWithChannel bufferWithChannel = currentSortBuffer.copyIntoSegment(writeBuffer); Buffer buffer = bufferWithChannel.getBuffer(); int subpartitionIndex = bufferWithChannel.getChannelIndex(); writeCompressedBufferIfPossible(buffer, subpartitionIndex); } } currentSortBuffer.release(); }
Source:
public BaseChangeEvent<T> getNext() throws IOException { if (lock.tryLock()) { try { eventStream = getEventStream(); return eventStream.getNextEvent(); } finally { lock.unlock(); } } throw new RuntimeException("Resource already open"); }

Target:
public synchronized BaseChangeEvent<T> getNext() throws AppException, IOException { eventStream = getEventStream(); return eventStream.getNextEvent(); }
Source:
static int getDataSerializedSize(Message amqpMessage) { if (amqpMessage == null) { return 0; } int payloadSize = getPayloadSize(amqpMessage); final MessageAnnotations messageAnnotations = amqpMessage.getMessageAnnotations(); final ApplicationProperties applicationProperties = amqpMessage.getApplicationProperties(); int annotationsSize = 0; int applicationPropertiesSize = 0; if (messageAnnotations != null) { for (Symbol value : messageAnnotations.getValue().keySet()) { annotationsSize += sizeof(value); } for (Object value : messageAnnotations.getValue().values()) { annotationsSize += sizeof(value); } } if (applicationProperties != null) { for (Object value : applicationProperties.getValue().keySet()) { applicationPropertiesSize += sizeof(value); } for (Object value : applicationProperties.getValue().values()) { applicationPropertiesSize += sizeof(value); } } return annotationsSize + applicationPropertiesSize + payloadSize; }

Target:
static int getDataSerializedSize(Message amqpMessage) { if (amqpMessage == null) { return 0; } int payloadSize = getPayloadSize(amqpMessage); final MessageAnnotations messageAnnotations = amqpMessage.getMessageAnnotations(); final ApplicationProperties applicationProperties = amqpMessage.getApplicationProperties(); int annotationsSize = 0; int applicationPropertiesSize = 0; if (messageAnnotations != null) { final Map<Symbol, Object> map = messageAnnotations.getValue(); for (Symbol key : map.keySet()) { final int size = sizeof(key) + sizeof(map.get(key)); annotationsSize += size; } } if (applicationProperties != null) { final Map<String, Object> map = applicationProperties.getValue(); for (String key : map.keySet()) { final int size = sizeof(key) + sizeof(map.get(key)); applicationPropertiesSize += size; } } return annotationsSize + applicationPropertiesSize + payloadSize; }
Source:
public void throwsExceptionWhenNotCorrectlyCreated() throws IOException { new RqForm.Fake( new RqFake(), "param" ); }

Target:
public void throwsExceptionWhenNotCorrectlyCreated() throws Exception { new RqForm.Fake( new RqFake(), "param" ); }
Source:
void setSubject(String subject) { if (subject != null) { this.subject = subject; if(subject.matches("^[R|r][E|e].*?:.*")) { this.simplifiedSubject = subject.replaceAll("[R|r][E|e].*?:", "").trim(); isReplySubject = true; } else { this.simplifiedSubject = subject; } } else { this.simplifiedSubject = null; } }

Target:
void setSubject(String subject) { if (subject != null) { this.subject = subject; if(subject.matches("^[R|r][E|e].*?:.*")) { this.simplifiedSubject = subject.replaceAll("[R|r][E|e].*?:", "").trim(); replySubject = true; } else { this.simplifiedSubject = subject; } } else { this.simplifiedSubject = ""; } }
Source:
public void cancel(Object brokerConsumer, Message message, boolean updateCounts) throws Exception { OperationContext oldContext = recoverContext(); try { try { ((ServerConsumer) brokerConsumer).individualCancel(message.getMessageID(), updateCounts); } catch (IllegalStateException e) { } ((ServerConsumer) brokerConsumer).getQueue().forceDelivery(); } finally { resetContext(oldContext); } }

Target:
public void cancel(Object brokerConsumer, Message message, boolean updateCounts) throws Exception { OperationContext oldContext = recoverContext(); try { try { ((ServerConsumer) brokerConsumer).individualCancel(message.getMessageID(), updateCounts); ((ServerConsumer) brokerConsumer).getQueue().forceDelivery(); } catch (IllegalStateException e) { if (logger.isDebugEnabled()) { logger.debug("silently ignoring cancel", e); } } } finally { resetContext(oldContext); } }
Source:
boolean isKernelFipsMode(Guid vdsGuid) { boolean fips = vdsDynamicDao.get(vdsGuid).isFipsEnabled(); log.info("Kernel FIPS - Guid: " + vdsGuid + " fips: " + fips); return fips; }

Target:
boolean isKernelFipsMode(Guid vdsGuid) { boolean fips = vdsDynamicDao.get(vdsGuid).isFipsEnabled(); log.debug("Kernel FIPS - Guid: fips: {}", vdsGuid, fips); return fips; }
Source:
public static Class<?> _forName(String className) throws ClassNotFoundException { try { switch(className){ case "boolean": return boolean.class; case "byte": return byte.class; case "char": return char.class; case "short": return short.class; case "int": return int.class; case "long": return long.class; case "float": return float.class; case "double": return double.class; case "boolean[]": return boolean[].class; case "byte[]": return byte[].class; case "char[]": return char[].class; case "short[]": return short[].class; case "int[]": return int[].class; case "long[]": return long[].class; case "float[]": return float[].class; case "double[]": return double[].class; default: return arrayForName(className); } } catch (ClassNotFoundException e) { if (className.indexOf('.') == -1) { try { return arrayForName("java.lang." + className); } catch (ClassNotFoundException e2) { } } throw e; } }

Target:
public static Class<?> _forName(String className) throws ClassNotFoundException { switch(className){ case "boolean": return boolean.class; case "byte": return byte.class; case "char": return char.class; case "short": return short.class; case "int": return int.class; case "long": return long.class; case "float": return float.class; case "double": return double.class; case "boolean[]": return boolean[].class; case "byte[]": return byte[].class; case "char[]": return char[].class; case "short[]": return short[].class; case "int[]": return int[].class; case "long[]": return long[].class; case "float[]": return float[].class; case "double[]": return double[].class; } try { return arrayForName(className); } catch (ClassNotFoundException e) { if (className.indexOf('.') == -1) { try { return arrayForName("java.lang." + className); } catch (ClassNotFoundException e2) { } } throw e; } }
Source:
public void setMaxZoom(final int level) { if (this.maxZoom != level) { this.maxZoom = level; AjaxRequestTarget target = getRequestCycle().find(AjaxRequestTarget.class); if (target != null && findPage() != null) { target.appendJavaScript(getJSsetMaxZoom(maxZoom)); } } }

Target:
public void setMaxZoom(final int level) { if (this.maxZoom != level) { this.maxZoom = level >= 0 ? level : 0; AjaxRequestTarget target = getRequestCycle().find(AjaxRequestTarget.class); if (target != null && findPage() != null) { target.appendJavaScript(getJSsetMaxZoom(maxZoom)); } } }
Source:
public void initSequence(String key, long id) { while ((getNextLong(key)) < id) { continue; } }

Target:
public void initSequence(String key, long id) { while (getNextLong(key) < id) { continue; } }
Source:
public static Result verify( DataSource apk, ApkUtils.ZipSections zipSections, int minSdkVersion, int maxSdkVersion) throws IOException, ApkFormatException, NoSuchAlgorithmException, ApkSigningBlockUtils.SignatureNotFoundException { Result result = new Result(); SignatureInfo signatureInfo = ApkSigningBlockUtils.findSignature(apk, zipSections, APK_SIGNATURE_SCHEME_V2_BLOCK_ID , result); DataSource beforeApkSigningBlock = apk.slice(0, signatureInfo.apkSigningBlockOffset); DataSource centralDir = apk.slice( signatureInfo.centralDirOffset, signatureInfo.eocdOffset - signatureInfo.centralDirOffset); ByteBuffer eocd = signatureInfo.eocd; verify(beforeApkSigningBlock, signatureInfo.signatureBlock, centralDir, eocd, minSdkVersion, maxSdkVersion, result); return result; }

Target:
public static ApkSigningBlockUtils.Result verify( DataSource apk, ApkUtils.ZipSections zipSections, int minSdkVersion, int maxSdkVersion) throws IOException, ApkFormatException, NoSuchAlgorithmException, ApkSigningBlockUtils.SignatureNotFoundException { ApkSigningBlockUtils.Result result = new ApkSigningBlockUtils.Result(); SignatureInfo signatureInfo = ApkSigningBlockUtils.findSignature(apk, zipSections, APK_SIGNATURE_SCHEME_V2_BLOCK_ID , result); DataSource beforeApkSigningBlock = apk.slice(0, signatureInfo.apkSigningBlockOffset); DataSource centralDir = apk.slice( signatureInfo.centralDirOffset, signatureInfo.eocdOffset - signatureInfo.centralDirOffset); ByteBuffer eocd = signatureInfo.eocd; verify(beforeApkSigningBlock, signatureInfo.signatureBlock, centralDir, eocd, minSdkVersion, maxSdkVersion, result); return result; }
Source:
protected void after() { try { for (RealmConfiguration configuration : configurations) { } } catch (IllegalStateException e) { if (!isUnitTestFailed()) { throw e; } } finally { super.after(); } }

Target:
protected void after() { try { for (RealmConfiguration configuration : configurations) { Realm.deleteRealm(configuration); } } catch (IllegalStateException e) { if (!isUnitTestFailed()) { throw e; } } finally { super.after(); } }
Source:
private void packageListBoxSetup() { final String path = presenter.getPath().toURI(); if ( thereIsAnActiveProject() && isAProjectResource( path ) ) { packageListBox.setContext( context, true, new Command() { @Override public void execute() { copyButton.setEnabled( true ); } } ); } }

Target:
void packageListBoxSetup() { final String path = presenter.getPath().toURI(); if ( thereIsAnActiveProject() && isAProjectResource( path ) ) { copyButton().setEnabled( false ); packageListBox.setContext( context, true, () -> copyButton.setEnabled( true ) ); } }
Source:
private void setDefaultValues() { fCharsetEditor.loadDefault(); fWideCharsetEditor.loadDefault(); String defaultSourceShow = DefaultScope.INSTANCE.getNode(CCorePlugin.PLUGIN_ID) .get(CCorePreferenceConstants.SHOW_SOURCE_FILES_IN_BINARIES, "all_time"); switch (defaultSourceShow) { case "all_time": fShowSourceNotFoundAllTime.setSelection(true); break; case "sometimes": fShowSourceNotFoundOnlyCaseSourceNotFound.setSelection(true); break; case "never": fShowSourceNotFoundNever.setSelection(true); break; } }

Target:
private void setDefaultValues() { fCharsetEditor.loadDefault(); fWideCharsetEditor.loadDefault(); String defaultSourceShow = DefaultScope.INSTANCE.getNode(CCorePlugin.PLUGIN_ID) .get(CCorePreferenceConstants.SHOW_SOURCE_FILES_IN_BINARIES, "all_time"); setShowEditorButtons(defaultSourceShow); }
Source:
public ITypeMapper getTypeMapper(String contributorId) { ITypeMapper legacyPropertyTypeMapper = null; Collection<IItemDescriptor> values = this.id2descriptors.values(); for (IItemDescriptor itemDescriptor : values) { if (itemDescriptor instanceof LegacyPropertyContributorItemDescriptor) { if (contributorId != null && contributorId.equals(itemDescriptor.getId())) { legacyPropertyTypeMapper = ((LegacyPropertyContributorItemDescriptor) itemDescriptor).getTypeMapper(); } } } return legacyPropertyTypeMapper; }

Target:
public ITypeMapper getTypeMapper(String contributorId) { Collection<IItemDescriptor> values = this.id2descriptors.values(); for (IItemDescriptor itemDescriptor : values) { if (itemDescriptor instanceof LegacyPropertyContributorItemDescriptor) { if (contributorId != null && contributorId.equals(itemDescriptor.getId())) { return ((LegacyPropertyContributorItemDescriptor) itemDescriptor).getTypeMapper(); } } } return null; }
Source:
private void checkExcludedScopes(List<String> excludedScopes) { if (excludedScopes != null && excludedScopes.size() > 0) { excludedScopes.stream().forEach(scope -> { if (scope.startsWith(SCOPE_REVERSE_STR)) { throw new IllegalArgumentException("excludedScope " + scope + " cannot start with " + SCOPE_REVERSE_STR); } }); } }

Target:
private void checkExcludedScopes(List<String> excludedScopes) { if (!CollectionUtils.isEmpty(excludedScopes)) { excludedScopes.stream().forEach(scope -> { if (scope.startsWith(SCOPE_REVERSE_STR)) { throw new IllegalArgumentException("excludedScope " + scope + " cannot start with " + SCOPE_REVERSE_STR); } }); } }
Source:
private String getKeepAliveProperty() { try { return getPropertyAccessor().getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.KEEP_ALIVE_PROP); } catch (PropertyAccessException ex) { LOG.warn("Unable to access property: {}", NhincConstants.KEEP_ALIVE_PROP, ex); return null; } }

Target:
private String getKeepAliveProperty() { try { return getPropertyAccessor().getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.KEEP_ALIVE_PROP); } catch (PropertyAccessException ex) { LOG.warn("Unable to access property: {}", NhincConstants.KEEP_ALIVE_PROP, ex.getLocalizedMessage(),ex); return null; } }
Source:
public byte[] getCacheKey() { byte[] previousStopBytes = StringUtils.toUtf8(getPreviousStop()); return ByteBuffer.allocate(1 + previousStopBytes.length) .put(CACHE_TYPE_ID) .put(previousStopBytes) .array(); }

Target:
public byte[] getCacheKey() { byte[] previousStopBytes = getPreviousStop() == null ? new byte[]{} : StringUtils.toUtf8(getPreviousStop()); return ByteBuffer.allocate(1 + previousStopBytes.length) .put(CACHE_TYPE_ID) .put(previousStopBytes) .array(); }
Source:
private double sumSquaredDeviation() { double m = mean(); double result = 0.0; for (Entry<ImmutableBytesPtr, Integer> entry : valueVsCount.entrySet()) { double colValue = ((Number) this.stdDevColExp.getDataType().toObject(entry.getKey())) .doubleValue(); double delta = colValue - m; result += (delta * delta) * entry.getValue(); } return result; }

Target:
private double sumSquaredDeviation() { double m = mean(); double result = 0.0; for (Entry<ImmutableBytesPtr, Integer> entry : valueVsCount.entrySet()) { double colValue = this.stdDevColExp.getDataType().getCodec().decodeDouble(entry.getKey(), null); double delta = colValue - m; result += (delta * delta) * entry.getValue(); } return result; }
Source:
GlobalConfigurationBuilder(PathAddress address) { super(CONFIGURATION, address); this.name = address.getLastElement().getValue(); this.module = new InjectedValueDependency<>(CacheContainerComponent.MODULE.getServiceName(address), Module.class); this.transport = new InjectedValueDependency<>(CacheContainerComponent.TRANSPORT.getServiceName(address), TransportConfiguration.class); this.site = new InjectedValueDependency<>(CacheContainerComponent.SITE.getServiceName(address), SiteConfiguration.class); for (ThreadPoolResourceDefinition threadPoolResourceDefinition : EnumSet.allOf(ThreadPoolResourceDefinition.class)) { this.pools.put(threadPoolResourceDefinition, new InjectedValueDependency<>(threadPoolResourceDefinition.getServiceName(address), ThreadPoolConfiguration.class)); } for (ScheduledThreadPoolResourceDefinition pool : EnumSet.allOf(ScheduledThreadPoolResourceDefinition.class)) { this.schedulers.put(pool, new InjectedValueDependency<>(pool.getServiceName(address), ThreadPoolConfiguration.class)); } }

Target:
GlobalConfigurationBuilder(PathAddress address) { super(CONFIGURATION, address); this.name = address.getLastElement().getValue(); this.module = new InjectedValueDependency<>(CacheContainerComponent.MODULE.getServiceName(address), Module.class); this.transport = new InjectedValueDependency<>(CacheContainerComponent.TRANSPORT.getServiceName(address), TransportConfiguration.class); this.site = new InjectedValueDependency<>(CacheContainerComponent.SITE.getServiceName(address), SiteConfiguration.class); for (ThreadPoolResourceDefinition pool : EnumSet.allOf(ThreadPoolResourceDefinition.class)) { this.pools.put(pool, new InjectedValueDependency<>(pool.getServiceName(address), ThreadPoolConfiguration.class)); } for (ScheduledThreadPoolResourceDefinition pool : EnumSet.allOf(ScheduledThreadPoolResourceDefinition.class)) { this.schedulers.put(pool, new InjectedValueDependency<>(pool.getServiceName(address), ThreadPoolConfiguration.class)); } }
Source:
private static Map<VariableReferenceExpression, VariableReferenceExpression> computeIdentityTranslations(Map<VariableReferenceExpression, RowExpression> assignments) { Map<VariableReferenceExpression, VariableReferenceExpression> outputToInput = new HashMap<>(); for (Map.Entry<VariableReferenceExpression, RowExpression> assignment : assignments.entrySet()) { if (assignment.getValue() instanceof VariableReferenceExpression) { outputToInput.put(assignment.getKey(), (VariableReferenceExpression) assignment.getValue()); } } return outputToInput; }

Target:
private static Map<VariableReferenceExpression, VariableReferenceExpression> computeIdentityTranslations(Map<VariableReferenceExpression, RowExpression> assignments) { Map<VariableReferenceExpression, VariableReferenceExpression> outputToInput = new HashMap<>(); for (Map.Entry<VariableReferenceExpression, RowExpression> assignment : assignments.entrySet()) { checkArgument(!isExpression(assignment.getValue()), "Cannot have OriginalExpression in assignments"); if (assignment.getValue() instanceof VariableReferenceExpression) { outputToInput.put(assignment.getKey(), (VariableReferenceExpression) assignment.getValue()); } } return outputToInput; }
Source:
public void doesNotInvokeDelegateIfNoValidTimestamps() { Map<Long, Long> result = preStartHandlingService.get(TWO_INVALID_TIMESTAMPS); assertThat(result).containsExactlyInAnyOrderEntriesOf( ImmutableMap.of( ZERO_TIMESTAMP, BEFORE_TIME_TIMESTAMP, NEGATIVE_TIMESTAMP, BEFORE_TIME_TIMESTAMP)); }

Target:
public void doesNotInvokeDelegateIfNoValidTimestamps() { Map<Long, Long> result = preStartHandlingService.get(TWO_INVALID_TIMESTAMPS); assertThat(result).containsOnly( Maps.immutableEntry(ZERO_TIMESTAMP, BEFORE_TIME_TIMESTAMP), Maps.immutableEntry(NEGATIVE_TIMESTAMP, BEFORE_TIME_TIMESTAMP)); }
Source:
public Condition getConditionById(String uuid) { String conceptsAsConditions = Context.getAdministrationService().getGlobalProperty("fhir.concepts.conditions"); List<String> concepts = new ArrayList<String>(); if (StringUtils.isNotBlank(conceptsAsConditions)) { concepts = Arrays.asList(conceptsAsConditions.split(",")); } Obs obs = Context.getObsService().getObsByUuid(uuid); String conceptID = Integer.toString(obs.getConcept().getId()); if (obs == null || obs.isVoided() || !concepts.contains(conceptID)) { return null; } return generateFHIRConditionForOpenMRSObs(obs); }

Target:
public Condition getConditionById(String uuid) { int[] conceptsAsConditions = FHIRUtils.getConceptIdsOfConditions(); Obs obs = Context.getObsService().getObsByUuid(uuid); if (obs == null || obs.isVoided() || conceptsAsConditions == null || !ArrayUtils.contains (conceptsAsConditions, obs.getConcept().getId())) { return null; } return generateFHIRConditionForOpenMRSObs(obs); }
Source:
public void testDdlFailIfRenameFromNotExists() throws IOException { addWorkflow(projectDir, "acceptance/td/td_ddl/rename_not_exists.dig"); CommandStatus runStatus = runWorkflow("rename_not_exists"); assertThat(runStatus.errUtf8(), runStatus.code(), not(0)); }

Target:
public void testDdlFailIfRenameFromNotExists() throws IOException { addWorkflow(projectDir, "acceptance/td/td_ddl/rename_not_exists.dig"); CommandStatus runStatus = runWorkflow("rename_not_exists", "database=" + database); assertThat(runStatus.errUtf8(), runStatus.code(), is(not(0))); assertThat(runStatus.errUtf8(), containsString("Renaming table " + database + ".rename_table_from doesn't exist")); }
Source:
public void init() throws APIManagerIntegrationTestException { super.init(); try { userManagementClient.addUser(TEST_USER_1, TEST_USER_1_PASSWORD, new String[] { "admin" }, "manager"); userManagementClient.addUser(TEST_USER_2, TEST_USER_2_PASSWORD, new String[] { "admin" }, "manager"); } catch (UserAdminUserAdminException e) { log.error("Error while creating the test users"); assertTrue(false, e.getMessage()); } catch (RemoteException e) { log.error("Error while creating the test users"); assertTrue(false, e.getMessage()); } publisherURLHttp = publisherUrls.getWebAppURLHttp(); storeURLHttp = storeUrls.getWebAppURLHttp(); apiPublisher = new APIPublisherRestClient(publisherURLHttp); apiStore = new APIStoreRestClient(storeURLHttp); }

Target:
public void init() throws APIManagerIntegrationTestException { super.init(); try { userManagementClient.addUser(TEST_USER_1, TEST_USER_1_PASSWORD, new String[] { "admin" }, "manager"); userManagementClient.addUser(TEST_USER_2, TEST_USER_2_PASSWORD, new String[] { "admin" }, "manager"); } catch (UserAdminUserAdminException e) { log.error("Error while creating the test users"); Assert.fail(e.getMessage()); } catch (RemoteException e) { log.error("Error while creating the test users"); Assert.fail(e.getMessage()); } publisherURLHttp = publisherUrls.getWebAppURLHttp(); storeURLHttp = storeUrls.getWebAppURLHttp(); apiPublisher = new APIPublisherRestClient(publisherURLHttp); apiStore = new APIStoreRestClient(storeURLHttp); }
Source:
private AccessToken validateAccessToken(String token) { AccessToken accessToken; try { accessToken = connector.validateAccessToken(new AccessToken.Builder(token).build()); } catch (ConnectionInitializationException e) { LOGGER.warn(String.format("Unable to retrieve access token from auth-server %s: %s", authServerHome, e.getMessage())); throw e; } catch(OsiamRequestException e) { LOGGER.warn("Error when validating access token", e); throw e; } return accessToken; }

Target:
private AccessToken validateAccessToken(String token) { AccessToken accessToken; try { accessToken = connector.validateAccessToken(new AccessToken.Builder(token).build()); } catch (ConnectionInitializationException e) { LOGGER.warn(String.format("Unable to retrieve access token from auth-server %s: %s", authServerHome, e.getMessage())); throw e; } catch(OsiamRequestException e) { LOGGER.warn("Error validating access token", e); throw e; } return accessToken; }
Source:
public PoolDTO clone() { PoolDTO copy = super.clone(); OwnerDTO owner = this.getOwner(); copy.owner = owner != null ? owner.clone() : null; CertificateDTO certificate = this.getCertificate(); copy.certificate = certificate != null ? certificate.clone() : null; copy.setAttributes(this.getAttributes()); copy.setCalculatedAttributes(this.getCalculatedAttributes()); copy.setProductAttributes(this.getProductAttributes()); copy.setDerivedProductAttributes(this.getDerivedProductAttributes()); copy.setBranding(this.getBranding()); copy.setProvidedProducts(this.getProvidedProducts()); copy.setDerivedProvidedProducts(this.getDerivedProvidedProducts()); copy.endDate = this.endDate != null ? new Date(this.endDate.getTime()) : null; copy.startDate = this.startDate != null ? new Date(this.startDate.getTime()) : null; return copy; }

Target:
public PoolDTO clone() { PoolDTO copy = super.clone(); OwnerDTO owner = this.getOwner(); copy.owner = owner != null ? owner.clone() : null; CertificateDTO certificate = this.getCertificate(); copy.certificate = certificate != null ? certificate.clone() : null; copy.setAttributes(this.getAttributes()); copy.setCalculatedAttributes(this.getCalculatedAttributes()); copy.setProductAttributes(this.getProductAttributes()); copy.setDerivedProductAttributes(this.getDerivedProductAttributes()); copy.setBranding(this.getBranding()); copy.setProvidedProducts(this.getProvidedProducts()); copy.setDerivedProvidedProducts(this.getDerivedProvidedProducts()); copy.endDate = this.endDate != null ? (Date) this.endDate.clone() : null; copy.startDate = this.startDate != null ? (Date) this.startDate.clone() : null; return copy; }
Source:
public static ObjectMapper getMapper() { synchronized (lock) { if (mapper == null) { mapper = new ObjectMapper(); mapper.setDateFormat(new SimpleDateFormat("MMM d, yyyy h:mm:ss aa")); } } return mapper; }

Target:
public static synchronized ObjectMapper getMapper() { return mapper; }
Source:
public void setBuildDropDownEnabled(boolean enabled) { this.build.disabled = !enabled; this.buildCaret.disabled = !enabled; if(enabled) { this.install.classList.remove("disabled"); } else { this.install.classList.add("disabled"); } }

Target:
public void setBuildDropDownEnabled(boolean enabled) { this.build.disabled = !enabled; this.buildCaret.disabled = !enabled; if (enabled) { this.install.classList.remove(DISABLED_CLASS); } else { this.install.classList.add(DISABLED_CLASS); } }
Source:
public void storeServerMetrics(final String serverId, final ServerMetrics metrics) { final DataInfo dataInfo = new DataInfoImpl(metrics.getNumPartitionBlocks()); final EvaluatorParameters evaluatorParameters = new ServerEvaluatorParameters(serverId, dataInfo, metrics); serverEvalParams.add(evaluatorParameters); try { final URL obj = new URL(this.dolphinURL); final HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("POST"); con.setDoOutput(true); con.setDoInput(true); con.connect(); final OutputStream os = con.getOutputStream(); final String param = "workerid=-1&serverid=" + serverId; System.out.println("request with " + param); os.write((param).getBytes()); os.flush(); os.close(); final BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()) ); String inputLine; final StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); } catch (Exception e) { System.out.println(e); } }

Target:
public void storeServerMetrics(final String serverId, final ServerMetrics metrics) { final DataInfo dataInfo = new DataInfoImpl(metrics.getNumPartitionBlocks()); final EvaluatorParameters evaluatorParameters = new ServerEvaluatorParameters(serverId, dataInfo, metrics); serverEvalParams.add(evaluatorParameters); if (this.dashboardEnabled) { sendMetrics(serverId, metrics.toString()); } }
Source:
public static String getEAP6xVersionNoSlotCheck(File location, String metaInfPath, String versionPrefix, String releaseName) { IPath rootPath = new Path(location.getAbsolutePath()); IPath eapDir = rootPath.append(metaInfPath); if( eapDir.toFile().exists()) { IPath manifest = eapDir.append("MANIFEST.MF"); Properties p2 = JBossServerType.loadProperties(manifest.toFile()); String type = p2.getProperty("JBoss-Product-Release-Name"); String version = p2.getProperty("JBoss-Product-Release-Version"); boolean matchesName = releaseName == null || releaseName.equals(type); boolean matchesVersion = versionPrefix == null || version.startsWith(versionPrefix); if( matchesName && matchesVersion ) return version; } return null; }

Target:
static String getEAP6xVersionNoSlotCheck(File location, String metaInfPath, String versionPrefix, String releaseName) { IPath rootPath = new Path(location.getAbsolutePath()); IPath eapDir = rootPath.append(metaInfPath); if( eapDir.toFile().exists()) { IPath manifest = eapDir.append("MANIFEST.MF"); Properties p2 = JBossServerType.loadProperties(manifest.toFile()); String type = p2.getProperty("JBoss-Product-Release-Name"); String version = p2.getProperty("JBoss-Product-Release-Version"); boolean matchesName = releaseName == null || releaseName.equals(type); boolean matchesVersion = versionPrefix == null || version.startsWith(versionPrefix); if( matchesName && matchesVersion ) return version; } return null; }
Source:
private boolean checkCanPerformPlugUnPlugDisk() { boolean returnValue = true; if (getVm().getStatus() == VMStatus.Up || getVm().getStatus() == VMStatus.Paused) { setVdsId(getVm().getRunOnVds().getValue()); returnValue = isHotPlugSupported() && isOsSupportingHotPlug() && isInterfaceSupportedForPlugUnPlug(disk); } if (returnValue) { oldVmDevice = getVmDeviceDao().get(new VmDeviceId(disk.getId(), getVmId())); if (getPlugAction() == VDSCommandType.HotPlugDisk && oldVmDevice.getIsPlugged()) { returnValue = false; addCanDoActionMessage(VdcBllMessages.HOT_PLUG_DISK_IS_NOT_UNPLUGGED); } if (getPlugAction() == VDSCommandType.HotUnPlugDisk && !oldVmDevice.getIsPlugged()) { returnValue = false; addCanDoActionMessage(VdcBllMessages.HOT_UNPLUG_DISK_IS_NOT_PLUGGED); } } return returnValue; }

Target:
private boolean checkCanPerformPlugUnPlugDisk() { boolean returnValue = true; if (getVm().getStatus().isUpOrPaused()) { setVdsId(getVm().getRunOnVds().getValue()); returnValue = isHotPlugSupported() && isOsSupportingHotPlug() && isInterfaceSupportedForPlugUnPlug(disk); } if (returnValue) { oldVmDevice = getVmDeviceDao().get(new VmDeviceId(disk.getId(), getVmId())); if (getPlugAction() == VDSCommandType.HotPlugDisk && oldVmDevice.getIsPlugged()) { returnValue = false; addCanDoActionMessage(VdcBllMessages.HOT_PLUG_DISK_IS_NOT_UNPLUGGED); } if (getPlugAction() == VDSCommandType.HotUnPlugDisk && !oldVmDevice.getIsPlugged()) { returnValue = false; addCanDoActionMessage(VdcBllMessages.HOT_UNPLUG_DISK_IS_NOT_PLUGGED); } } return returnValue; }
Source:
public boolean hasCubicChunks(EntityPlayerMP player) { if (!hasFML(player)) { return false; } NetHandlerPlayServer connection = player.connection; NetworkManager netManager = connection.netManager; Channel channel = netManager.channel(); Attribute<NetworkDispatcher> attr = channel.attr(NetworkDispatcher.FML_DISPATCHER); NetworkDispatcher networkDispatcher = attr.get(); Map<String, String> modList = networkDispatcher.getModList(); return modList.containsKey("cubicchunks"); }

Target:
public boolean hasCubicChunks(EntityPlayerMP player) { NetHandlerPlayServer connection = player.connection; if (connection == null) { return false; } NetworkManager netManager = connection.netManager; if (netManager == null) { return false; } Channel channel = netManager.channel(); if (!channel.attr(NetworkRegistry.FML_MARKER).get()) { return false; } Attribute<NetworkDispatcher> attr = channel.attr(NetworkDispatcher.FML_DISPATCHER); NetworkDispatcher networkDispatcher = attr.get(); Map<String, String> modList = networkDispatcher.getModList(); return modList.containsKey("cubicchunks"); }
Source:
public boolean verifyEvidence(final Evidence evidence) throws RealmUnavailableException { Assert.checkNotNullParam("evidence", evidence); if (evidence instanceof PasswordGuessEvidence) { this.subject = null; boolean successfulLogin; final CallbackHandler callbackHandler = createCallbackHandler(principal, (PasswordGuessEvidence) evidence); final Subject subject = new Subject(); final LoginContext context = createLoginContext(loginConfiguration, subject, callbackHandler); log.tracef("Trying to authenticate subject %s using LoginContext %s using JaasSecurityRealm", (principal != null) ? principal.getName() : "null", context.toString()); try { context.login(); successfulLogin = true; this.subject = subject; } catch (LoginException le) { ElytronMessages.log.debugJAASAuthenticationFailure(principal, le); successfulLogin = false; } return successfulLogin; } else { return false; } }

Target:
public boolean verifyEvidence(final Evidence evidence) throws RealmUnavailableException { Assert.checkNotNullParam("evidence", evidence); if (evidence instanceof PasswordGuessEvidence) { this.subject = null; boolean successfulLogin; final CallbackHandler callbackHandler = createCallbackHandler(principal, (PasswordGuessEvidence) evidence); final Subject subject = new Subject(); final LoginContext context = createLoginContext(loginConfiguration, subject, callbackHandler); log.tracef("Trying to authenticate subject %s using LoginContext %s using JaasSecurityRealm", principal, context); try { context.login(); successfulLogin = true; this.subject = subject; } catch (LoginException le) { ElytronMessages.log.debugJAASAuthenticationFailure(principal, le); successfulLogin = false; } return successfulLogin; } else { return false; } }
Source:
public void not_accept_nulls_as_parameter_values() throws NoSuchMethodException { final Constructor constructor = root.getClass() .getDeclaredConstructor(BoundedContext.class, String.class); final NullPointerTester tester = new NullPointerTester(); tester.setDefault(Constructor.class, constructor); tester.setDefault(BoundedContext.class, boundedContext); tester.setDefault(AggregateRoot.class, root); tester.testStaticMethods(Aggregates.class, NullPointerTester.Visibility.PUBLIC); }

Target:
public void not_accept_nulls_as_parameter_values() throws NoSuchMethodException { final Constructor constructor = root.getClass() .getDeclaredConstructor(BoundedContext.class, String.class); final NullPointerTester tester = new NullPointerTester(); tester.setDefault(Constructor.class, constructor) .setDefault(BoundedContext.class, boundedContext) .setDefault(AggregateRoot.class, root) .testStaticMethods(Aggregates.class, NullPointerTester.Visibility.PACKAGE); }
Source:
public void testCreateValid() throws IOException { HttpPut putRequest = new HttpPut(WebServerHelper.getUri("/v1/reports")); putRequest.setHeader(new BasicHeader(HttpHeaders.CONTENT_TYPE, "application/json")); putRequest.setEntity(new StringEntity(loadResource("testCreateValid"))); try (CloseableHttpResponse response = WebServerHelper.getClient().execute(putRequest)) { assertEquals(Http.Status.NO_CONTENT, response.getStatusLine().getStatusCode()); } final Report writtenReport = OBJECT_MAPPER.readValue(loadResource("testCreateValid"), models.view.reports.Report.class); final String reportId = writtenReport.getId().toString(); HttpGet getRequest = new HttpGet(WebServerHelper.getUri("/v1/reports/" + reportId)); try (CloseableHttpResponse response = WebServerHelper.getClient().execute(getRequest)) { assertEquals(Http.Status.OK, response.getStatusLine().getStatusCode()); final Report returnedReport = OBJECT_MAPPER.readValue(response.getEntity().getContent(), models.view.reports.Report.class); assertEquals(writtenReport, returnedReport); } }

Target:
public void testCreateValid() throws IOException { final Report report = Report.fromInternal(TestBeanFactory.createReportBuilder().build()); final HttpPut putRequest = new HttpPut(WebServerHelper.getUri("/v1/reports")); putRequest.setHeader(new BasicHeader(HttpHeaders.CONTENT_TYPE, "application/json")); putRequest.setEntity(new StringEntity(OBJECT_MAPPER.writeValueAsString(report))); try (CloseableHttpResponse response = WebServerHelper.getClient().execute(putRequest)) { assertEquals(Http.Status.NO_CONTENT, response.getStatusLine().getStatusCode()); } final String reportId = report.getId().toString(); final HttpGet getRequest = new HttpGet(WebServerHelper.getUri("/v1/reports/" + reportId)); try (CloseableHttpResponse response = WebServerHelper.getClient().execute(getRequest)) { assertEquals(Http.Status.OK, response.getStatusLine().getStatusCode()); final Report returnedReport = WebServerHelper.readContentAs(response, models.view.reports.Report.class); assertEquals(report, returnedReport); } }
Source:
PendingRow(BatchMutateContext context) { lastContext = context; }

Target:
PendingRow(BatchMutateContext context) { count = 1; lastContext = context; }
Source:
static Iterator<String> getFilteredReferences(String targetNames, Collection<String> required) { List inputList = new ArrayList<>(); inputList.addAll(Arrays.asList(targetNames)); return new FilteredStringsIterator(inputList, required); }

Target:
static Iterator<String> getFilteredReferences(String targetNames, Collection<String> required) { return new FilteredStringsIterator(Arrays.asList(targetNames), required); }
Source:
public void testStartNoAutoCreateThenAutoCreate() throws Exception { ClusteringServiceConfiguration creationConfigBad = ClusteringServiceConfigurationBuilder.cluster(URI.create(CLUSTER_URI_BASE + "my-application")) .defaultServerResource("defaultResource") .resourcePool("sharedPrimary", 16, MemoryUnit.MB, "serverResource1") .resourcePool("sharedSecondary", 16, MemoryUnit.MB, "serverResource2") .resourcePool("sharedTertiary", 32, MemoryUnit.MB) .build(); DefaultClusteringService creationServiceBad = new DefaultClusteringService(creationConfigBad); try { creationServiceBad.start(null); fail("Expecting IllegalStateException"); } catch (IllegalStateException e) { } List<ObservableEhcacheActiveEntity> activeEntitiesBad = observableEhcacheServerEntityService.getServedActiveEntities(); assertThat(activeEntitiesBad.size(), is(0)); ClusteringServiceConfiguration creationConfigGood = ClusteringServiceConfigurationBuilder.cluster(URI.create(CLUSTER_URI_BASE + "my-application?auto-create")) .defaultServerResource("defaultResource") .resourcePool("sharedPrimary", 16, MemoryUnit.MB, "serverResource1") .resourcePool("sharedSecondary", 16, MemoryUnit.MB, "serverResource2") .resourcePool("sharedTertiary", 32, MemoryUnit.MB) .build(); DefaultClusteringService creationServiceGood = new DefaultClusteringService(creationConfigGood); try { creationServiceGood.start(null); } catch (Exception e) { fail("There should not be an error on start"); } }

Target:
public void testStartNoAutoCreateThenAutoCreate() throws Exception { ClusteringServiceConfiguration creationConfigBad = ClusteringServiceConfigurationBuilder.cluster(URI.create(CLUSTER_URI_BASE + "my-application")) .defaultServerResource("defaultResource") .resourcePool("sharedPrimary", 16, MemoryUnit.MB, "serverResource1") .resourcePool("sharedSecondary", 16, MemoryUnit.MB, "serverResource2") .resourcePool("sharedTertiary", 32, MemoryUnit.MB) .build(); DefaultClusteringService creationServiceBad = new DefaultClusteringService(creationConfigBad); try { creationServiceBad.start(null); fail("Expecting IllegalStateException"); } catch (IllegalStateException e) { } List<ObservableEhcacheActiveEntity> activeEntitiesBad = observableEhcacheServerEntityService.getServedActiveEntities(); assertThat(activeEntitiesBad.size(), is(0)); ClusteringServiceConfiguration creationConfigGood = ClusteringServiceConfigurationBuilder.cluster(URI.create(CLUSTER_URI_BASE + "my-application?auto-create")) .defaultServerResource("defaultResource") .resourcePool("sharedPrimary", 16, MemoryUnit.MB, "serverResource1") .resourcePool("sharedSecondary", 16, MemoryUnit.MB, "serverResource2") .resourcePool("sharedTertiary", 32, MemoryUnit.MB) .build(); DefaultClusteringService creationServiceGood = new DefaultClusteringService(creationConfigGood); creationServiceGood.start(null); }
Source:
public static BoundType toBoundType(FrameBound.Type type) { switch (type) { case UNBOUNDED_PRECEDING: return UNBOUNDED_PRECEDING; case PRECEDING: return PRECEDING; case CURRENT_ROW: return CURRENT_ROW; case FOLLOWING: return FOLLOWING; case UNBOUNDED_FOLLOWING: return UNBOUNDED_FOLLOWING; default: throw new UnsupportedOperationException(format("unrecognized window frame type %s", type)); } }

Target:
public static BoundType toBoundType(FrameBound.Type type) { switch (type) { case UNBOUNDED_PRECEDING: return UNBOUNDED_PRECEDING; case PRECEDING: return PRECEDING; case CURRENT_ROW: return CURRENT_ROW; case FOLLOWING: return FOLLOWING; case UNBOUNDED_FOLLOWING: return UNBOUNDED_FOLLOWING; default: throw new UnsupportedOperationException(format("unrecognized frame bound type %s", type)); } }
Source:
public void execute(int iterationId) { try { StorageHelperDirector.getInstance().getItem(getStorageDomain().getStorageType()) .connectStorageToDomainByVdsId(getStorageDomain(), getVdss().get(iterationId).getId()); } catch (RuntimeException e) { log.errorFormat("Failed to connect host {0} to storage server (name: {1}, id: {2}). Exception: {3}", getVdss().get(iterationId).getName(), getStorageDomain().getName(), getStorageDomain().getId(), e); } }

Target:
public void execute(int iterationId) { VDS vds = getVdss().get(iterationId); try { StorageHelperDirector.getInstance().getItem(getStorageDomain().getStorageType()) .connectStorageToDomainByVdsId(getStorageDomain(), vds.getId()); } catch (RuntimeException e) { log.errorFormat("Failed to connect host {0} to storage domain (name: {1}, id: {2}). Exception: {3}", vds.getName(), getStorageDomain().getName(), getStorageDomain().getId(), e); } }
Source:
public static String getAliceLibraryVersion() { if (!aliceLibraryVersion.equals("")) { return aliceLibraryVersion; } else { try { String gitCommand = "git show"; Process gitGetter = Runtime.getRuntime().exec(gitCommand); Scanner s = new Scanner(gitGetter.getInputStream(), "UTF-8"); if (s.hasNextLine()) { String fullCommitLine = s.nextLine(); String pattern = "commit (\\d+)"; aliceLibraryVersion = fullCommitLine.replaceAll(pattern, "$1"); return aliceLibraryVersion; } return "Couldn't get hash of most recent commit"; } catch (IOException e) { e.printStackTrace(); return "Couldn't load Git status"; } } }

Target:
public static String getAliceLibraryVersion() { if (!aliceLibraryVersion.equals("")) { return aliceLibraryVersion; } else { try { String gitCommand = "git log -1 --format=%h"; Process gitGetter = Runtime.getRuntime().exec(gitCommand); Scanner s = new Scanner(gitGetter.getInputStream(), "UTF-8"); if (s.hasNextLine()) { aliceLibraryVersion = s.nextLine(); return aliceLibraryVersion; } return "Couldn't get hash of most recent commit"; } catch (IOException e) { e.printStackTrace(); return "Couldn't load Git status"; } } }
Source:
public static LocalizedString process(LocalizedString origin) { LocalizedString result = new LocalizedString(); for (Locale l : origin.getLocales()) { result = result.with(l, process(origin.getContent(l))); } return result; }

Target:
public static LocalizedString process(LocalizedString origin) { return origin.map(Component::process); }
Source:
public String getMimetypeFromFilenameWithBlobMimetypeFallback(String filename, Blob blob, String defaultMimetype) throws MimetypeDetectionException { try { return getMimetypeFromFilename(filename); } catch (MimetypeNotFoundException e) { String mimeTypeName = blob.getMimeType(); MimetypeEntry mimetypeEntry = getMimetypeEntryByName(mimeTypeName); if (mimetypeEntry != null) { return mimeTypeName; } else { return getMimetypeFromBlobWithDefault(blob, defaultMimetype); } } }

Target:
public String getMimetypeFromFilenameWithBlobMimetypeFallback(String filename, Blob blob, String defaultMimetype) throws MimetypeDetectionException { try { return getMimetypeFromFilename(filename); } catch (MimetypeNotFoundException e) { String mimeTypeName = blob.getMimeType(); if (isMimetypeEntry(mimeTypeName)) { return mimeTypeName; } else { return getMimetypeFromBlobWithDefault(blob, defaultMimetype); } } }
Source:
public List<PostEventResultTask> splitTask() { return ImmutableList.of(this); }

Target:
public List<PostEventResultTask> splitTask() { if (events.size() > 1) { int splitPoint = events.size() / 2; return ImmutableList.of( new PostEventResultTask(currentAgentId, events.subList(0, splitPoint)), new PostEventResultTask(currentAgentId, events.subList(splitPoint, events.size()))); } return ImmutableList.of(this); }
Source:
public void logHttp() { Connector connector = newConnector("HTTP/1.1", "http"); when(tomcat.getService().findConnectors()).thenReturn(new Connector[] {connector}); underTest.log(tomcat); verify(logger).info(eq("HTTP connector enabled on port {}"), anyInt()); verifyNoMoreInteractions(logger); }

Target:
public void logHttp() { Connector connector = newConnector("HTTP/1.1", "http"); when(tomcat.getService().findConnectors()).thenReturn(new Connector[] {connector}); underTest.log(tomcat); verify(logger).info(eq("HTTP connector enabled on port {}"), eq(1234)); verifyNoMoreInteractions(logger); }
Source:
protected void run(EventEnvelope event) { checkState(isActive(), "Notifying by a non-activated subscription."); SubscriptionUpdate update = createSubscriptionUpdate(event); notifyAction.accept(update); }

Target:
protected void run(EventEnvelope event) { checkState(isActive(), "Dispatched an event of type %s to the non-active subscription with ID %s", TypeUrl.of(event.getMessage()), subscription.getId().getValue()); SubscriptionUpdate update = createSubscriptionUpdate(event); notifyAction.accept(update); }
Source:
public void tearDown() throws Exception { fc.delete(testRootDirPath, true); }

Target:
public void tearDown() throws Exception { if (fc != null) { fc.delete(testRootDirPath, true); } }
Source:
public Mono<Void> forceCloseHandle(String handleId) { return withContext(context -> forceCloseHandleWithResponse(handleId, context)).flatMap(FluxUtil::toMono); }

Target:
public Mono<Void> forceCloseHandle(String handleId) { try { return withContext(context -> forceCloseHandleWithResponse(handleId, context)).flatMap(FluxUtil::toMono); } catch (RuntimeException ex) { return monoError(logger, ex); } }