auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testCreateTableWithPKConstraint() throws Exception { String tableName = generateUniqueName(); String schemaName = generateUniqueName(); Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { String pTableFullName = SchemaUtil.getQualifiedTableName(schemaName, tableName); String query = "create table " + pTableFullName + "(a_char CHAR(15) NOT NULL, " + "b_char CHAR(15) NOT NULL, " + "c_bigint BIGINT NOT NULL CONSTRAINT PK PRIMARY KEY (a_char, b_char, c_bigint)) IMMUTABLE_ROWS=TRUE"; conn.createStatement().execute(query); conn.commit(); String args = {"-tb", tableName, "-s", schemaName}; SchemaExtractionTool set = new SchemaExtractionTool(); set.setConf(conn.unwrap(PhoenixConnection.class).getQueryServices().getConfiguration()); set.run(args); Assert.assertEquals(query.toUpperCase(), set.getOutput().toUpperCase()); } }

Target:
public void testCreateTableWithPKConstraint() throws Exception { String tableName = generateUniqueName(); String schemaName = generateUniqueName(); String pTableFullName = SchemaUtil.getQualifiedTableName(schemaName, tableName); String query = "create table " + pTableFullName + "(a_char CHAR(15) NOT NULL, " + "b_char CHAR(15) NOT NULL, " + "c_bigint BIGINT NOT NULL CONSTRAINT PK PRIMARY KEY (a_char, b_char, c_bigint)) IMMUTABLE_ROWS=TRUE"; List<String> queries = new ArrayList<String>(){}; queries.add(query); String result = runSchemaExtractionTool(schemaName, tableName, null, queries); Assert.assertEquals(query.toUpperCase(), result.toUpperCase()); }
Source:
private void validateExtension() { Set<String> usedOverrideKeys = new HashSet<>(); for (OverrideSetting setting : overrides) { if (usedOverrideKeys.contains(setting.nativeRuleName)) { throw new IllegalArgumentException( "Multiple overrides specified for the same rule: " + setting.nativeRuleName); } else { usedOverrideKeys.add(setting.nativeRuleName); } Preconditions.checkNotNull(Strings.emptyToNull(setting.nativeRuleName), "nativeRuleName is required for override"); Preconditions.checkNotNull(Strings.emptyToNull(setting.importLocation), "importLocation is required for override"); Preconditions.checkNotNull(Strings.emptyToNull(setting.newRuleName), "newRuleName is required for override"); } }

Target:
private void validateExtension() { Set<String> usedOverrideKeys = new HashSet<>(); for (RawOverrideSetting baseSetting : overrides) { RawOverrideSetting setting = applyDefaults(baseSetting); Preconditions.checkNotNull( Strings.emptyToNull(setting.getNativeRuleName()), "nativeRuleName is required for override"); Preconditions.checkNotNull( Strings.emptyToNull(setting.getImportLocation()), setting.getNativeRuleName() + ": importLocation is required for override," + " since no defaultImportLocation is specified"); Preconditions.checkNotNull( Strings.emptyToNull(setting.getNewRuleName()), setting.getNativeRuleName() + ": newRuleName is required for override," + " since no defaultRuleNamePrefix is specified"); if (usedOverrideKeys.contains(setting.getNativeRuleName())) { throw new IllegalArgumentException( "Multiple overrides specified for the same rule: " + setting.getNativeRuleName()); } else { usedOverrideKeys.add(setting.getNativeRuleName()); } } }
Source:
private void searchForReuse(ProgressMonitor monitor) throws IOException { long cnt = 0; cnt += objectsLists[Constants.OBJ_COMMIT].size(); cnt += objectsLists[Constants.OBJ_TREE].size(); cnt += objectsLists[Constants.OBJ_BLOB].size(); cnt += objectsLists[Constants.OBJ_TAG].size(); long start = System.currentTimeMillis(); beginPhase(PackingPhase.FINDING_SOURCES, monitor, cnt); if (cnt <= 4096) { BlockList<ObjectToPack> tmp = new BlockList<ObjectToPack>(); tmp.addAll(objectsLists[Constants.OBJ_TAG]); tmp.addAll(objectsLists[Constants.OBJ_COMMIT]); tmp.addAll(objectsLists[Constants.OBJ_TREE]); tmp.addAll(objectsLists[Constants.OBJ_BLOB]); searchForReuse(monitor, tmp); if (pruneCurrentObjectList) { pruneEdgesFromObjectList(objectsLists[Constants.OBJ_COMMIT]); pruneEdgesFromObjectList(objectsLists[Constants.OBJ_TREE]); pruneEdgesFromObjectList(objectsLists[Constants.OBJ_BLOB]); pruneEdgesFromObjectList(objectsLists[Constants.OBJ_TAG]); } } else { searchForReuse(monitor, objectsLists[Constants.OBJ_TAG]); searchForReuse(monitor, objectsLists[Constants.OBJ_COMMIT]); searchForReuse(monitor, objectsLists[Constants.OBJ_TREE]); searchForReuse(monitor, objectsLists[Constants.OBJ_BLOB]); } endPhase(monitor); stats.timeSearchingForReuse = System.currentTimeMillis() - start; }

Target:
private void searchForReuse(ProgressMonitor monitor) throws IOException { long cnt = 0; cnt += objectsLists[Constants.OBJ_COMMIT].size(); cnt += objectsLists[Constants.OBJ_TREE].size(); cnt += objectsLists[Constants.OBJ_BLOB].size(); cnt += objectsLists[Constants.OBJ_TAG].size(); long start = System.currentTimeMillis(); beginPhase(PackingPhase.FINDING_SOURCES, monitor, cnt); if (cnt <= 4096) { BlockList<ObjectToPack> tmp = new BlockList<ObjectToPack>(cnt); tmp.addAll(objectsLists[Constants.OBJ_TAG]); tmp.addAll(objectsLists[Constants.OBJ_COMMIT]); tmp.addAll(objectsLists[Constants.OBJ_TREE]); tmp.addAll(objectsLists[Constants.OBJ_BLOB]); searchForReuse(monitor, tmp); if (pruneCurrentObjectList) { pruneEdgesFromObjectList(objectsLists[Constants.OBJ_COMMIT]); pruneEdgesFromObjectList(objectsLists[Constants.OBJ_TREE]); pruneEdgesFromObjectList(objectsLists[Constants.OBJ_BLOB]); pruneEdgesFromObjectList(objectsLists[Constants.OBJ_TAG]); } } else { searchForReuse(monitor, objectsLists[Constants.OBJ_TAG]); searchForReuse(monitor, objectsLists[Constants.OBJ_COMMIT]); searchForReuse(monitor, objectsLists[Constants.OBJ_TREE]); searchForReuse(monitor, objectsLists[Constants.OBJ_BLOB]); } endPhase(monitor); stats.timeSearchingForReuse = System.currentTimeMillis() - start; }
Source:
private static boolean isOnlyDictionaryEncodingPages(Set<Encoding> encodings) { if (encodings.size() > PARQUET_DATA_TRIPLE) { return false; } for (Encoding encoding : encodings) { if (encoding.usesDictionary()) { return true; } } return false; }

Target:
private boolean isOnlyDictionaryEncodingPages(Set<Encoding> encodings) { if (encodings.size() > 3) { return false; } for (Encoding encoding : encodings) { if (encoding.usesDictionary()) { return true; } } return false; }
Source:
public Object handle(UnitOfWork<? extends CommandMessage<?>> unitOfWork, InterceptorChain interceptorChain) throws Exception { InterceptorChainParameterResolverFactory.initialize(interceptorChain); delegate.handle(unitOfWork.getMessage(), target); Optional<CommandHandlerInterceptorHandlingMember> unwrap = delegate.unwrap( CommandHandlerInterceptorHandlingMember.class); Object result = null; if (unwrap.isPresent() && unwrap.get().shouldInvokeInterceptorChain()) { result = interceptorChain.proceed(); } return result; }

Target:
public Object handle(UnitOfWork<? extends CommandMessage<?>> unitOfWork, InterceptorChain interceptorChain) throws Exception { InterceptorChainParameterResolverFactory.initialize(interceptorChain); Object result = delegate.handle(unitOfWork.getMessage(), target); if (delegate.unwrap(CommandHandlerInterceptorHandlingMember.class) .map(CommandHandlerInterceptorHandlingMember::shouldInvokeInterceptorChain).orElse(false)) { result = interceptorChain.proceed(); } return result; }
Source:
private void createSessions() throws ConfigError, FieldConvertError { final SessionSettings settings = getSettings(); boolean continueInitOnError = false; if (settings.isSetting(SessionFactory.SETTING_CONTINUE_INIT_ON_ERROR)) { continueInitOnError = settings.getBool(SessionFactory.SETTING_CONTINUE_INIT_ON_ERROR); } final Map<SessionID, Session> initiatorSessions = new HashMap<>(); for (final Iterator<SessionID> i = settings.sectionIterator(); i.hasNext();) { final SessionID sessionID = i.next(); if (isInitiatorSession(sessionID)) { try { if (!settings.isSetting(sessionID, SETTING_INACTIVE_SESSION) || !settings.getBool(sessionID, SETTING_INACTIVE_SESSION)) { final Session quickfixSession = createSession(sessionID); initiatorSessions.put(sessionID, quickfixSession); } } catch (final Throwable e) { if (continueInitOnError) { log.error("error during session initialization, continuing...", e); } else { throw e instanceof ConfigError ? (ConfigError) e : new ConfigError( "error during session initialization", e); } } } } setSessions(initiatorSessions); }

Target:
private void createSessions() throws ConfigError, FieldConvertError { final SessionSettings settings = getSettings(); boolean continueInitOnError = false; if (settings.isSetting(SessionFactory.SETTING_CONTINUE_INIT_ON_ERROR)) { continueInitOnError = settings.getBool(SessionFactory.SETTING_CONTINUE_INIT_ON_ERROR); } final Map<SessionID, Session> initiatorSessions = new HashMap<>(); for (final Iterator<SessionID> i = settings.sectionIterator(); i.hasNext();) { final SessionID sessionID = i.next(); if (isInitiatorSession(sessionID)) { try { if (!settings.isSetting(sessionID, SETTING_DYNAMIC_SESSION) || !settings.getBool(sessionID, SETTING_DYNAMIC_SESSION)) { final Session quickfixSession = createSession(sessionID); initiatorSessions.put(sessionID, quickfixSession); } } catch (final Throwable e) { if (continueInitOnError) { log.error("error during session initialization, continuing...", e); } else { throw e instanceof ConfigError ? (ConfigError) e : new ConfigError( "error during session initialization", e); } } } } setSessions(initiatorSessions); }
Source:
@Override public String getProcName() { return getClass().getSimpleName() + " " + WAL.stripWALsDirPrefix(getWAL()); }

Target:
@Override public String getProcName() { return getClass().getSimpleName() + " " + getWALNameFromStrPath(getWAL()); }
Source:
public String explainQuery(@CliOption(key = {"", "query"}, mandatory = true, help = "Query to execute") String sql, @CliOption(key = {"save"}, mandatory = false, help = "query to explain") String location) throws UnsupportedEncodingException { QueryPlan plan = getClient().getQueryPlan(sql); if (plan.isHasError() == true) { return "Explain FAILED:" + plan.getErrorMsg(); } return plan.getPlanString(); }

Target:
public String explainQuery(@CliOption(key = {"", "query"}, mandatory = true, help = "Query to execute") String sql, @CliOption(key = {"save"}, mandatory = false, help = "query to explain") String location) throws UnsupportedEncodingException { QueryPlan plan = getClient().getQueryPlan(sql); if (plan.isError()) { return "Explain FAILED:" + plan.getErrorMsg(); } return plan.getPlanString(); }
Source:
public int hashCode() { final int iHash = Double.hashCode( getRealDouble() ); final int rHash = Double.hashCode( getImaginaryDouble() ); return Util.combineHash( iHash, rHash ); }

Target:
public int hashCode() { final int rHash = Double.hashCode( getRealDouble() ); final int iHash = Double.hashCode( getImaginaryDouble() ); return Util.combineHash( rHash, iHash ); }
Source:
public AsyncQuery updateStatus(String asyncQueryId, QueryStatus status) { AsyncQuery queryObj = (AsyncQuery) DBUtil.executeInTransaction(elideSettings, dataStore, (tx, scope) -> { EntityProjection asyncQueryCollection = EntityProjection.builder() .type(AsyncQuery.class) .build(); AsyncQuery query = (AsyncQuery) tx.loadObject(asyncQueryCollection, asyncQueryId, scope); query.setStatus(status); tx.save(query, scope); return query; }); return queryObj; }

Target:
public AsyncQuery updateStatus(String asyncQueryId, QueryStatus status) { AsyncQuery queryObj = (AsyncQuery) executeInTransaction(elideSettings, dataStore, (tx, scope) -> { EntityProjection asyncQueryCollection = EntityProjection.builder() .type(AsyncQuery.class) .build(); AsyncQuery query = (AsyncQuery) tx.loadObject(asyncQueryCollection, asyncQueryId, scope); query.setStatus(status); tx.save(query, scope); return query; }); return queryObj; }
Source:
public void anonCanSignUpWithoutConfirmingVerificationEmail() { WikiBasePageObject base = new WikiBasePageObject(); SignUpPageObject signUp = base.navigateToSpecialSignUpPage(wikiURL); String userName = "User" + signUp.getTimeStamp(); String password = "Pass" + signUp.getTimeStamp(); String email = credentials.emailQaart2; RegisterArea register = new RegisterArea(false); register.typeEmailAddress(email); register.typeUsername(userName); register.typePassword(password); register.typeBirthdate(PageContent.WIKI_SIGN_UP_BIRTHMONTH, PageContent.WIKI_SIGN_UP_BIRTHDAY, PageContent.WIKI_SIGN_UP_BIRTHYEAR); register.clickSignUpSubmitButton(); base.verifyUserLoggedIn(userName); BannerNotifications notification = new BannerNotifications(); Assertion.assertEquals(notification.getBannerNotificationTextEmailNotConfirmed(), "Oh no! Your email address has not yet been confirmed. You should have a confirmation message in your inbox. Didn't get it? Click here and we'll send a new one. If you need to change your address, head to your Preferences page."); }

Target:
public void anonCanSignUpWithoutConfirmingVerificationEmail() { WikiBasePageObject base = new WikiBasePageObject(); SignUpPageObject signUp = base.navigateToSpecialSignUpPage(wikiURL); String userName = "User" + signUp.getTimeStamp(); String password = "Pass" + signUp.getTimeStamp(); String email = credentials.emailQaart2; RegisterArea register = new RegisterArea(false); register.typeEmailAddress(email); register.typeUsername(userName); register.typePassword(password); register.typeBirthdate(PageContent.WIKI_SIGN_UP_BIRTHMONTH, PageContent.WIKI_SIGN_UP_BIRTHDAY, PageContent.WIKI_SIGN_UP_BIRTHYEAR); register.clickSignUpSubmitButton(); base.verifyUserLoggedIn(userName); BannerNotifications notification = new BannerNotifications(); String bannerNotifMessageEN = "Oh no! Your email address has not yet been confirmed. " + "You should have a confirmation message in your inbox. " + "Didn't get it? Click here and we'll send a new one. " + "If you need to change your address, " + "head to your Preferences page."; Assertion.assertEquals( notification.getBannerNotificationTextEmailNotConfirmed(), bannerNotifMessageEN); }
Source:
private static void initialize(final List<HyperEdgeSegment> segments, final List<HyperEdgeSegment> sources, final List<HyperEdgeSegment> sinks, final boolean criticalOnly) { int nextMark = -1; for (HyperEdgeSegment segment : segments) { segment.mark = nextMark--; int inWeight = 0; int outWeight = 0; int criticalInWeight = 0; int criticalOutWeight = 0; for (HyperEdgeSegmentDependency dependency : segment.getOutgoingSegmentDependencies()) { switch (dependency.getType()) { case CRITICAL: assert dependency.getWeight() > 0; outWeight += dependency.getWeight(); criticalOutWeight += dependency.getWeight(); break; default: if (!criticalOnly) { outWeight += dependency.getWeight(); } } } for (HyperEdgeSegmentDependency dependency : segment.getIncomingSegmentDependencies()) { switch (dependency.getType()) { case CRITICAL: assert dependency.getWeight() > 0; inWeight += dependency.getWeight(); criticalInWeight += dependency.getWeight(); break; default: if (!criticalOnly) { inWeight += dependency.getWeight(); } } } segment.setInWeight(inWeight); segment.setCriticalInWeight(criticalInWeight); segment.setOutWeight(outWeight); segment.setCriticalOutWeight(criticalOutWeight); if (outWeight == 0) { sinks.add(segment); } else if (inWeight == 0) { sources.add(segment); } } }

Target:
private static void initialize(final List<HyperEdgeSegment> segments, final List<HyperEdgeSegment> sources, final List<HyperEdgeSegment> sinks, final boolean criticalOnly) { int nextMark = -1; for (HyperEdgeSegment segment : segments) { segment.mark = nextMark--; int criticalInWeight = segment.getIncomingSegmentDependencies().stream() .filter(dep -> dep.getType() == DependencyType.CRITICAL) .mapToInt(dep -> dep.getWeight()) .sum(); int criticalOutWeight = segment.getOutgoingSegmentDependencies().stream() .filter(dep -> dep.getType() == DependencyType.CRITICAL) .mapToInt(dep -> dep.getWeight()) .sum(); int inWeight = criticalInWeight; int outWeight = criticalOutWeight; if (!criticalOnly) { inWeight = segment.getIncomingSegmentDependencies().stream() .mapToInt(dep -> dep.getWeight()) .sum(); outWeight = segment.getOutgoingSegmentDependencies().stream() .mapToInt(dep -> dep.getWeight()) .sum(); } segment.setInWeight(inWeight); segment.setCriticalInWeight(criticalInWeight); segment.setOutWeight(outWeight); segment.setCriticalOutWeight(criticalOutWeight); if (outWeight == 0) { sinks.add(segment); } else if (inWeight == 0) { sources.add(segment); } } }
Source:
public AbfsInputStreamContext withReadAheadQueueDepth( final int readAheadQueueDepth) { this.readAheadQueueDepth = (readAheadQueueDepth >= 0) ? readAheadQueueDepth : Runtime.getRuntime().availableProcessors();; return this; }

Target:
public AbfsInputStreamContext withReadAheadQueueDepth( final int readAheadQueueDepth) { this.readAheadQueueDepth = (readAheadQueueDepth >= 0) ? readAheadQueueDepth : Runtime.getRuntime().availableProcessors(); return this; }
Source:
public static SerializableError of(String message, Class<? extends Exception> exceptionClass) { return ImmutableSerializableError.builder() .message(message) .exceptionName(exceptionClass.getName()) .build(); }

Target:
public static SerializableError of(String message, Class<? extends Exception> exceptionClass) { return ImmutableSerializableError.builder() .message(message) .errorName(exceptionClass.getName()) .build(); }
Source:
List<ClassMethodPair> getLifecycleMethods(final Class<Annotation> clazz) { return lifecycleMethods.get(clazz); }

Target:
public List<ClassMethodPair> getLifecycleMethods(final Class<Annotation> clazz) { return lifecycleMethods.get(clazz); }
Source:
public ScheduledFuture schedule(TaskDefinition definition) { checkNotDuplicateTask(definition.getName()); checkNotAtCapacity(); try { taskLifecycleHook.preTaskSchedule(name, definition); return createContextAndSchedule(definition); } finally { taskLifecycleHook.postTaskSchedule(name, definition); } }

Target:
public ScheduledFuture schedule(TaskDefinition definition) { checkNotDuplicateTask(definition.getName()); acquirePermit(false); return createContextAndSchedule(definition); }
Source:
protected GeoWaveStoreType getStoreType() { return GeoWaveStoreType.DYNAMODB; }

Target:
protected GeoWaveStoreType getStoreType() { return GeoWaveStoreType.REDIS; }
Source:
private void assertBigRedirectAlertAttributes(Alert alert) { assertThat(alert.getRisk(), is(Alert.RISK_LOW)); assertThat(alert.getConfidence(), is(Alert.CONFIDENCE_MEDIUM)); assertThat(alert.getName(), is(getLocalisedString("name"))); assertThat(alert.getDescription(), is(getLocalisedString("desc"))); assertThat(alert.getSolution(), is(getLocalisedString("soln"))); assertThat(alert.getReference(), is(getLocalisedString("refs"))); assertThat(alert.getOtherInfo(), is(getExpectedExtraInfo())); assertThat(alert.getCweId(), is(201)); assertThat(alert.getWascId(), is(13)); assertThat(alert.getUri(), is(URI)); }

Target:
private static void assertBigRedirectAlertAttributes(Alert alert) { assertThat(alert.getRisk(), is(Alert.RISK_LOW)); assertThat(alert.getConfidence(), is(Alert.CONFIDENCE_MEDIUM)); assertThat(alert.getName(), is(getLocalisedString("name"))); assertThat(alert.getDescription(), is(getLocalisedString("desc"))); assertThat(alert.getSolution(), is(getLocalisedString("soln"))); assertThat(alert.getReference(), is(getLocalisedString("refs"))); assertThat(alert.getOtherInfo(), is(getExpectedExtraInfo())); assertThat(alert.getCweId(), is(201)); assertThat(alert.getWascId(), is(13)); assertThat(alert.getUri(), is(URI)); }
Source:
public void forEach(BiConsumer<Long, EntryLogMetadata> action) throws EntryLogMetadataMapException { CloseableIterator<Entry<byte[], byte[]>> iterator = metadataMapDB.iterator(); try { while (iterator.hasNext()) { if (isClosed.get()) { break; } Entry<byte[], byte[]> entry = iterator.next(); long entryLogId = ArrayUtil.getLong(entry.getKey(), 0); ByteArrayInputStream localBais = bais.get(); DataInputStream localDatais = datais.get(); if (localBais.available() < entry.getValue().length) { localBais.close(); localDatais.close(); ByteArrayInputStream newBais = new ByteArrayInputStream(entry.getValue()); bais.set(newBais); datais.set(new DataInputStream(newBais)); } else { localBais.read(entry.getValue(), 0, entry.getValue().length); } localBais.reset(); localDatais.reset(); action.accept(entryLogId, EntryLogMetadata.deserialize(datais.get())); } } catch (IOException e) { LOG.error("Failed to iterate over entry-log metadata map {}", e.getMessage(), e); throw new EntryLogMetadataMapException(e); } finally { try { iterator.close(); } catch (IOException e) { LOG.error("Failed to close entry-log metadata-map rocksDB iterator {}", e.getMessage(), e); } } }

Target:
public void forEach(BiConsumer<Long, EntryLogMetadata> action) throws EntryLogMetadataMapException { CloseableIterator<Entry<byte[], byte[]>> iterator = metadataMapDB.iterator(); try { while (iterator.hasNext()) { if (isClosed.get()) { break; } Entry<byte[], byte[]> entry = iterator.next(); long entryLogId = ArrayUtil.getLong(entry.getKey(), 0); ByteArrayInputStream localBais = bais.get(); DataInputStream localDatais = datais.get(); if (localBais.available() < entry.getValue().length) { localBais.close(); localDatais.close(); ByteArrayInputStream newBais = new ByteArrayInputStream(entry.getValue()); bais.set(newBais); datais.set(new DataInputStream(newBais)); } else { localBais.read(entry.getValue(), 0, entry.getValue().length); } localBais.reset(); localDatais.reset(); EntryLogMetadataRecyclable metadata = EntryLogMetadata.deserialize(datais.get()); try { action.accept(entryLogId, metadata); } finally { metadata.recycle(); } } } catch (IOException e) { LOG.error("Failed to iterate over entry-log metadata map {}", e.getMessage(), e); throw new EntryLogMetadataMapException(e); } finally { try { iterator.close(); } catch (IOException e) { LOG.error("Failed to close entry-log metadata-map rocksDB iterator {}", e.getMessage(), e); } } }
Source:
static INode.BlocksMapUpdateInfo deleteSnapshot( FSDirectory fsd, FSPermissionChecker pc, SnapshotManager snapshotManager, String snapshotRoot, String snapshotName, boolean logRetryCache) throws IOException { final INodesInPath iip = fsd.resolvePath(pc, snapshotRoot, DirOp.WRITE); if (fsd.isPermissionEnabled()) { fsd.checkOwner(pc, iip); } final long now = Time.now(); if (fsd.isSnapshotDeletionOrdered()) { final INodeDirectory srcRoot = snapshotManager.getSnapshottableRoot(iip); final DirectorySnapshottableFeature snapshottable = srcRoot.getDirectorySnapshottableFeature(); final Snapshot snapshot = snapshottable.getSnapshotByName( srcRoot, snapshotName); final int earliest = snapshottable.getDiffs().iterator().next() .getSnapshotId(); if (snapshot.getId() != earliest) { final XAttr snapshotXAttr = buildXAttr(snapshotName); final List<XAttr> xattrs = Lists.newArrayListWithCapacity(1); xattrs.add(snapshotXAttr); FSDirXAttrOp.unprotectedSetXAttrs(fsd, iip, xattrs, EnumSet.of(XAttrSetFlag.CREATE, XAttrSetFlag.REPLACE)); return null; } } final INode.BlocksMapUpdateInfo collectedBlocks = deleteSnapshot( fsd, snapshotManager, iip, snapshotName, now); fsd.getEditLog().logDeleteSnapshot(snapshotRoot, snapshotName, logRetryCache, now); return collectedBlocks; }

Target:
static INode.BlocksMapUpdateInfo deleteSnapshot( FSDirectory fsd, FSPermissionChecker pc, SnapshotManager snapshotManager, String snapshotRoot, String snapshotName, boolean logRetryCache) throws IOException { final INodesInPath iip = fsd.resolvePath(pc, snapshotRoot, DirOp.WRITE); if (fsd.isPermissionEnabled()) { fsd.checkOwner(pc, iip); } final long now = Time.now(); final INode.BlocksMapUpdateInfo collectedBlocks = deleteSnapshot( fsd, snapshotManager, iip, snapshotName, now); fsd.getEditLog().logDeleteSnapshot(snapshotRoot, snapshotName, logRetryCache, now); return collectedBlocks; }
Source:
public void send(DatastreamProducerRecord record, String source, int sourcePartition, T sourceCheckpoint) { SourcePartition sp = new SourcePartition(source, sourcePartition); CallbackStatus status = _callbackStatusMap.computeIfAbsent(sp, d -> new CallbackStatus()); status.register(sourceCheckpoint); _eventProducer.send(record, ((metadata, exception) -> { if (exception != null) { LOG.error("Failed to send datastream record: " + metadata, exception); } status.ack(sourceCheckpoint); })); }

Target:
public void send(DatastreamProducerRecord record, String source, int sourcePartition, T sourceCheckpoint) { SourcePartition sp = new SourcePartition(source, sourcePartition); CallbackStatus status = _callbackStatusMap.computeIfAbsent(sp, d -> new CallbackStatus()); status.register(sourceCheckpoint); _eventProducer.send(record, ((metadata, exception) -> { if (exception != null) { LOG.error("Failed to send datastream record: " + metadata, exception); } else { status.ack(sourceCheckpoint); } })); }
Source:
private void handleLightMeasurementDeviceEvents(final Device device, final List<Event> lightMeasurementDeviceEvents) { if (lightMeasurementDeviceEvents.isEmpty()) { LOGGER.info("List of events is empty for device: {}, not able to process events.", device.getDeviceIdentification()); return; } try { final String deviceIdentification = device.getDeviceIdentification(); final String correlationUid = this.correlationIdProviderTimestampService.getCorrelationId( this.netmanagementOrganisation, deviceIdentification); final EventMessageDataContainer dataContainer = new EventMessageDataContainer(lightMeasurementDeviceEvents); final RequestMessage requestMessage = new RequestMessage(correlationUid, this.netmanagementOrganisation, deviceIdentification, dataContainer); final String key = "PUBLIC_LIGHTING-1.0"; final JmsTemplate jmsTemplate = this.domainRequestMessageJmsTemplateFactory.getJmsTemplate(key); jmsTemplate.send(new MessageCreator() { @Override public Message createMessage(final Session session) throws JMSException { final ObjectMessage objectMessage = session.createObjectMessage(requestMessage); objectMessage.setJMSType(DeviceFunction.SET_TRANSITION.name()); return objectMessage; } }); } catch (final Exception e) { LOGGER.error("Unexpected exception while handling events for light measurement device: {}", device.getDeviceIdentification()); } }

Target:
private void handleLightMeasurementDeviceEvents(final Device device, final List<Event> lightMeasurementDeviceEvents) { if (lightMeasurementDeviceEvents.isEmpty()) { LOGGER.info("List of events is empty for device: {}, not needed to process events.", device.getDeviceIdentification()); return; } try { final String deviceIdentification = device.getDeviceIdentification(); final String correlationUid = this.correlationIdProviderTimestampService.getCorrelationId( this.netmanagementOrganisation, deviceIdentification); final EventMessageDataContainer dataContainer = new EventMessageDataContainer(lightMeasurementDeviceEvents); final RequestMessage requestMessage = new RequestMessage(correlationUid, this.netmanagementOrganisation, deviceIdentification, dataContainer); final String key = "PUBLIC_LIGHTING-1.0"; final JmsTemplate jmsTemplate = this.domainRequestMessageJmsTemplateFactory.getJmsTemplate(key); jmsTemplate.send(new MessageCreator() { @Override public Message createMessage(final Session session) throws JMSException { final ObjectMessage objectMessage = session.createObjectMessage(requestMessage); objectMessage.setJMSType(DeviceFunction.SET_TRANSITION.name()); return objectMessage; } }); } catch (final Exception e) { LOGGER.error( String.format("Unexpected exception while handling events for light measurement device: %s", device.getDeviceIdentification()), e); } }
Source:
private void saveSanStorage() { StorageModel storageModel = (StorageModel) getWindow(); final SanStorageModel sanStorageModel = (SanStorageModel) storageModel.getCurrentStorageItem(); List<String> unkownStatusLuns = new ArrayList<>(); List<LUNs> usedStatusLuns = new ArrayList<>(); for (LunModel lunModel : sanStorageModel.getAddedLuns()) { if (lunModel.getStatus() == LunStatus.Used) { usedStatusLuns.add((LUNs) lunModel.getEntity()); } else if (lunModel.getStatus() == LunStatus.Unknown) { unkownStatusLuns.add(lunModel.getLunId()); } } if (!unkownStatusLuns.isEmpty()) { Guid hostId = sanStorageModel.getContainer().getHost().getSelectedItem().getId(); Model target = getWidgetModel() != null ? getWidgetModel() : sanStorageModel.getContainer(); Frontend.getInstance() .runQuery(VdcQueryType.GetDeviceList, new GetDeviceListQueryParameters(hostId, sanStorageModel.getType(), true, unkownStatusLuns), new AsyncQuery(target, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { VdcQueryReturnValue response = (VdcQueryReturnValue) returnValue; if (response.getSucceeded()) { List<LUNs> checkedLuns = (ArrayList<LUNs>) response.getReturnValue(); postGetLunsMessages(sanStorageModel.getUsedLunsMessages(checkedLuns)); } else { sanStorageModel.setGetLUNsFailure( ConstantsManager.getInstance() .getConstants() .couldNotRetrieveLUNsLunsFailure()); } } }, true)); } else { postGetLunsMessages(sanStorageModel.getUsedLunsMessages(usedStatusLuns)); } }

Target:
private void saveSanStorage() { StorageModel storageModel = (StorageModel) getWindow(); final SanStorageModel sanStorageModel = (SanStorageModel) storageModel.getCurrentStorageItem(); Map<LunStatus, List<LUNs>> lunsMapByStatus = getLunsMapByStatus(sanStorageModel.getAddedLuns()); if (!lunsMapByStatus.get(LunStatus.Unknown).isEmpty()) { Guid hostId = sanStorageModel.getContainer().getHost().getSelectedItem().getId(); Model target = getWidgetModel() != null ? getWidgetModel() : sanStorageModel.getContainer(); List<String> unkownStatusLuns = new ArrayList<>(); for (LUNs lun : lunsMapByStatus.get(LunStatus.Unknown)) { unkownStatusLuns.add(lun.getLUN_id()); } Frontend.getInstance() .runQuery(VdcQueryType.GetDeviceList, new GetDeviceListQueryParameters(hostId, sanStorageModel.getType(), true, unkownStatusLuns), new AsyncQuery(target, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { VdcQueryReturnValue response = (VdcQueryReturnValue) returnValue; if (response.getSucceeded()) { List<LUNs> checkedLuns = (ArrayList<LUNs>) response.getReturnValue(); postGetLunsMessages(sanStorageModel.getUsedLunsMessages(checkedLuns)); } else { sanStorageModel.setGetLUNsFailure( ConstantsManager.getInstance() .getConstants() .couldNotRetrieveLUNsLunsFailure()); } } }, true)); } else { postGetLunsMessages(sanStorageModel.getUsedLunsMessages(lunsMapByStatus.get(LunStatus.Used))); } }
Source:
public BuyClient build() { if (BuildConfig.DEBUG) { if (TextUtils.isEmpty(shopDomain) || shopDomain.contains(":") || shopDomain.contains("/")) { throw new IllegalArgumentException("shopDomain is not set or invalid. shopDomain must be a valid URL and cannot start with 'http://'"); } } else { if (TextUtils.isEmpty(shopDomain) || shopDomain.contains(":") || shopDomain.contains("/") || !shopDomain.contains(".myshopify.com")) { throw new IllegalArgumentException("shopDomain is not set or invalid. shopDomain must be of the form 'shopname.myshopify.com' and cannot start with 'http://'"); } } if (TextUtils.isEmpty(this.apiKey)) { throw new IllegalArgumentException("apiKey is not set or invalid. apiKey must be provided, and cannot be empty"); } if (TextUtils.isEmpty(appId)) { throw new IllegalArgumentException("appId is not set or invalid. appId must be provided, and cannot be empty"); } if (TextUtils.isEmpty(applicationName)) { throw new IllegalArgumentException("applicationName is not set or invalid. applicationName must be provided, and cannot be empty"); } return new BuyClientImpl( this.apiKey, this.appId, this.applicationName, this.shopDomain, this.completeCheckoutWebReturnUrl, this.completeCheckoutWebReturnLabel, this.customerToken, this.callbackScheduler, this.productPageSize, this.interceptors ); }

Target:
public BuyClient build() { if (BuildConfig.DEBUG) { if (TextUtils.isEmpty(shopDomain) || shopDomain.contains(":") || shopDomain.contains("/")) { throw new IllegalArgumentException("shopDomain is not set or invalid. shopDomain must be a valid URL and cannot start with 'http://'"); } } else { if (TextUtils.isEmpty(shopDomain) || shopDomain.contains(":") || shopDomain.contains("/") || !shopDomain.contains(".myshopify.com")) { throw new IllegalArgumentException("shopDomain is not set or invalid. shopDomain must be of the form 'shopname.myshopify.com' and cannot start with 'http://'"); } } if (TextUtils.isEmpty(apiKey)) { throw new IllegalArgumentException("apiKey is not set or invalid. apiKey must be provided, and cannot be empty"); } if (TextUtils.isEmpty(appId)) { throw new IllegalArgumentException("appId is not set or invalid. appId must be provided, and cannot be empty"); } if (TextUtils.isEmpty(applicationName)) { throw new IllegalArgumentException("applicationName is not set or invalid. applicationName must be provided, and cannot be empty"); } return new BuyClientDefault( apiKey, appId, applicationName, shopDomain, completeCheckoutWebReturnUrl, completeCheckoutWebReturnLabel, customerToken, callbackScheduler, productPageSize, networkRequestRetryMaxCount, networkRequestRetryDelayMs, networkRequestRetryBackoffMultiplier, interceptors ); }
Source:
public void writeTo(final Object data, Class<?> dataClass, Type arg2, Annotation[] annotation, MediaType mediaType, MultivaluedMap<String, Object> map, OutputStream outputStream) throws IOException, WebApplicationException { try { new FOPMessageBodyWriter(); Source source = new JAXBSource(jaxbContext, data); String xslName = "/" + dataClass.getSimpleName() + "AsPdf.xsl"; InputStream templateStream = dataClass.getResourceAsStream(xslName); StreamSource transformSource = new StreamSource(templateStream); FopFactory fopFactory = FopFactory.newInstance(); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); TransformerFactory transfact = TransformerFactory.newInstance(); final ByteArrayOutputStream pdfoutStream = new ByteArrayOutputStream(); Transformer xslfoTransformer = transfact.newTransformer(transformSource); Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, pdfoutStream); Result res = new SAXResult(fop.getDefaultHandler()); xslfoTransformer.transform(source, res); StreamingOutput stream = new StreamingOutput() { public void write(OutputStream output) throws IOException, WebApplicationException { output.write(pdfoutStream.toByteArray()); } }; Response.ok(stream).type("application/pdf").header("content-disposition", "attachment; filename=\"stats.pdf\"").build(); } catch(Exception e) { log.error(e.toString()); } }

Target:
public void writeTo(final Object data, Class<?> dataClass, Type arg2, Annotation[] annotation, MediaType mediaType, MultivaluedMap<String, Object> map, OutputStream outputStream) throws IOException, WebApplicationException { try { String xslName = "/" + dataClass.getSimpleName() + "AsPdf.xsl"; InputStream templateStream = dataClass.getResourceAsStream(xslName); QName qName = new QName("volume_profile_details"); StreamSource transformSource = new StreamSource(templateStream); ObjectFactory objectFactory = new ObjectFactory(); Method factoryMethod = null; for (Method currentMethod : objectFactory.getClass().getDeclaredMethods()) { Class<?>[] parameterTypes = currentMethod.getParameterTypes(); if (parameterTypes.length == 1 && parameterTypes[0] == arg2) { factoryMethod = currentMethod; break; } } JAXBElement<?> element = (JAXBElement<?>) factoryMethod.invoke(objectFactory, data); Source source = new JAXBSource(jaxbContext, element); FopFactory fopFactory = FopFactory.newInstance(); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); TransformerFactory transfact = TransformerFactory.newInstance(); Transformer xslfoTransformer = transfact.newTransformer(transformSource); Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, outputStream); Result res = new SAXResult(fop.getDefaultHandler()); xslfoTransformer.transform(source, res); } catch(Exception e) { log.error("Error while generating PDF.", e); } }
Source:
protected Position handlePosition(Position position) { Position last = getLastPosition(position.getDeviceId()); if (last != null && last.getLatitude() != 0 && last.getLongitude() != 0) { double distance = DistanceCalculator.distance( position.getLatitude(), position.getLongitude(), last.getLatitude(), last.getLongitude()); if (coordinatesMinError != 0 && distance < coordinatesMinError || coordinatesMaxError != 0 && distance > coordinatesMaxError && !position.getValid()) { position.setLatitude(last.getLatitude()); position.setLongitude(last.getLongitude()); } } return position; }

Target:
protected Position handlePosition(Position position) { Position last = getLastPosition(position.getDeviceId()); if (last != null && last.getValid() && last.getLatitude() != 0 && last.getLongitude() != 0) { double distance = DistanceCalculator.distance( position.getLatitude(), position.getLongitude(), last.getLatitude(), last.getLongitude()); boolean satisfiesMin = coordinatesMinError == 0 || distance > coordinatesMinError; boolean satisfiesMax = coordinatesMaxError == 0 || distance < coordinatesMaxError || position.getValid(); if (!satisfiesMin || !satisfiesMax) { position.setLatitude(last.getLatitude()); position.setLongitude(last.getLongitude()); } } return position; }
Source:
public InputStream inputStream() throws IOException { return Files.newInputStream(filePath); }

Target:
public InputStream inputStream() throws IOException { Charset charset = getCharset(); if (charset == null) { charset = StandardCharsets.UTF_8; } try (TextFileContext context = new TextFileContext(file)) { return new ByteArrayInputStream(contents().getBytes(charset)); } catch (CoreException e) { throw new IOException("error while streaming file: " + file.getFullPath(), e); } }
Source:
public MenuPresenterWidget(EventBus eventBus, MenuPresenterWidget.ViewDef view, Provider<ConfigurePopupPresenterWidget> configurePopupProvider) { super(eventBus, view); this.configurePopupProvider = configurePopupProvider; for (int i = 0; i < PrimaryMenuContainerType.values().length; i++) { menuContainers.add(PrimaryMenuContainerType.values()[i].getId()); } menuContainers.add(null); }

Target:
public MenuPresenterWidget(EventBus eventBus, MenuPresenterWidget.ViewDef view, Provider<ConfigurePopupPresenterWidget> configurePopupProvider) { super(eventBus, view); this.configurePopupProvider = configurePopupProvider; for (PrimaryMenuContainerType type: PrimaryMenuContainerType.values()) { menuContainers.add(type.getId()); } menuContainers.add(null); }
Source:
private void addSignatureHeader(final URL url, final String httpMethod, final Map<String, String> httpHeaders) { String pathAndQuery = url.getPath(); if (url.getQuery() != null) { pathAndQuery += '?' + url.getQuery(); } final String signed = Arrays.stream(SIGNED_HEADERS) .map(httpHeaders::get) .collect(Collectors.joining(";")); String stringToSign = httpMethod.toUpperCase(Locale.US) + "\n" + pathAndQuery + "\n" + signed; final String signature = Base64.getEncoder().encodeToString(sha256HMAC.doFinal(stringToSign.getBytes(StandardCharsets.UTF_8))); httpHeaders.put(AUTHORIZATION_HEADER, String.format("HMAC-SHA256 Credential=%s, SignedHeaders=%s, " + "Signature=%s", credentials.id(), signedHeadersValue, signature)); }

Target:
private void addSignatureHeader(final URL url, final String httpMethod, final Map<String, String> httpHeaders) { String pathAndQuery = url.getPath(); if (url.getQuery() != null) { pathAndQuery += '?' + url.getQuery(); } final String signed = Arrays.stream(SIGNED_HEADERS) .map(httpHeaders::get) .collect(Collectors.joining(";")); String stringToSign = httpMethod.toUpperCase(Locale.US) + "\n" + pathAndQuery + "\n" + signed; final String signature = Base64.getEncoder().encodeToString(sha256HMAC.doFinal(stringToSign.getBytes(StandardCharsets.UTF_8))); httpHeaders.put(AUTHORIZATION_HEADER, String.format(HMAC_SHA256, credentials.id(), signedHeadersValue, signature)); }
Source:
public Collection<BeanDefinition> parse(Element element, ParserContext parserContext) { String idAttribute = element.getAttribute("id"); BeanDefinitionBuilder stateBuilder = BeanDefinitionBuilder .genericBeanDefinition("org.springframework.batch.core.job.flow.support.state.SplitState"); List<Element> flowElements = DomUtils.getChildElementsByTagName(element, "flow"); if (flowElements.size() < 2) { parserContext.getReaderContext().error("A <split/> must contain at least two 'flow' elements.", element); } Collection<Object> flows = new ManagedList<Object>(); int i = 0; String prefix = idAttribute; for (Element nextElement : flowElements) { FlowParser flowParser = new FlowParser(prefix + "." + i, jobFactoryRef); flows.add(flowParser.parse(nextElement, parserContext)); i++; } stateBuilder.addConstructorArgValue(flows); stateBuilder.addConstructorArgValue(prefix); return FlowParser.getNextElements(parserContext, null, stateBuilder.getBeanDefinition(), element); }

Target:
public Collection<BeanDefinition> parse(Element element, ParserContext parserContext) { String idAttribute = element.getAttribute("id"); BeanDefinitionBuilder stateBuilder = BeanDefinitionBuilder .genericBeanDefinition("org.springframework.batch.core.job.flow.support.state.SplitState"); List<Element> flowElements = DomUtils.getChildElementsByTagName(element, "flow"); if (flowElements.size() < 2) { parserContext.getReaderContext().error("A <split/> must contain at least two 'flow' elements.", element); } Collection<Object> flows = new ManagedList<Object>(); int i = 0; for (Element nextElement : flowElements) { FlowParser flowParser = new FlowParser(idAttribute + "." + i, jobFactoryRef); flows.add(flowParser.parse(nextElement, parserContext)); i++; } stateBuilder.addConstructorArgValue(flows); stateBuilder.addConstructorArgValue(idAttribute); return FlowParser.getNextElements(parserContext, null, stateBuilder.getBeanDefinition(), element); }
Source:
private void initNavBar() { previousButton = (Button) findViewById(R.id.button_previous); nextButton = (Button) findViewById(R.id.button_next); indexTextView = (TextView) findViewById(R.id.textview_index); Typeface typeface = Typeface.createFromAsset(getAssets(), "icomoon.ttf"); previousButton.setTypeface(typeface); nextButton.setTypeface(typeface); previousButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { loadWordAndShow(serverIDs[--currentIndex]); updateNavBar(); } }); nextButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { loadWordAndShow(serverIDs[++currentIndex]); updateNavBar(); } }); updateNavBar(); }

Target:
private void initNavBar() { previousButton = (Button) findViewById(R.id.button_previous); nextButton = (Button) findViewById(R.id.button_next); indexTextView = (TextView) findViewById(R.id.textview_index); previousButton.setTypeface(Settings.iconFont); nextButton.setTypeface(Settings.iconFont); previousButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { loadWordAndShow(serverIDs[--currentIndex]); updateNavBar(); } }); nextButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { loadWordAndShow(serverIDs[++currentIndex]); updateNavBar(); } }); updateNavBar(); }
Source:
public static String formatDateTimeForComments(Date date) { if (date == null) { return ""; } SimpleDateFormat sdf = null; Calendar c = Calendar.getInstance(); c.setTime(date); if (c.get(Calendar.HOUR_OF_DAY) == 12) { sdf = new SimpleDateFormat("EEE, dd MMM yyyy, hh:mm"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(date) + " NOON UTC"; } if (c.get(Calendar.HOUR_OF_DAY) == 0) { sdf = new SimpleDateFormat("EEE, dd MMM yyyy, KK:mm"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(date) + " MIDNIGHT UTC"; } sdf = new SimpleDateFormat("EEE, dd MMM yyyy, hh:mm a zzz"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(date); }

Target:
public static String formatDateTimeForComments(Date date) { if (date == null) { return ""; } SimpleDateFormat sdf = null; Calendar c = Calendar.getInstance(); c.setTime(date); if (c.get(Calendar.HOUR_OF_DAY) == 12 && c.get(Calendar.MINUTE) == 0) { sdf = new SimpleDateFormat("EEE, dd MMM yyyy, hh:mm"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(date) + " NOON UTC"; } sdf = new SimpleDateFormat("EEE, dd MMM yyyy, hh:mm a zzz"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(date); }
Source:
public String getDisplayName() { return this.getFluid().getAttributes().getDisplayName(this); }

Target:
public ITextComponent getDisplayName() { return this.getFluid().getAttributes().getDisplayName(this); }
Source:
public void createCardPaymentWithMetadata() { publicAuthMock.mapBearerTokenToAccountId(API_KEY, GATEWAY_ACCOUNT_ID, CARD); CreateChargeRequestParams createChargeRequestParams = aCreateChargeRequestParams() .withAmount(100) .withDescription(DESCRIPTION) .withReference(REFERENCE) .withReturnUrl(RETURN_URL) .withMetadata(Map.of("foo", "foo you", "fuh", "fuh you")) .build(); connectorMock.respondOk_whenCreateCharge(GATEWAY_ACCOUNT_ID, createChargeRequestParams); postPaymentResponse(API_KEY, paymentPayload(createChargeRequestParams)) .statusCode(201) .contentType(JSON).log().body() .body("metadata.foo", is("foo you")) .body("metadata.fuh", is("fuh you")); connectorMock.verifyCreateChargeConnectorRequest(GATEWAY_ACCOUNT_ID, createChargeRequestParams); }

Target:
public void createCardPaymentWithMetadata() { publicAuthMock.mapBearerTokenToAccountId(API_KEY, GATEWAY_ACCOUNT_ID, CARD); CreateChargeRequestParams createChargeRequestParams = aCreateChargeRequestParams() .withAmount(100) .withDescription(DESCRIPTION) .withReference(REFERENCE) .withReturnUrl(RETURN_URL) .withMetadata(Map.of("reconciled", true, "ledger_code", 123, "fuh", "fuh you")) .build(); connectorMock.respondOk_whenCreateCharge(GATEWAY_ACCOUNT_ID, createChargeRequestParams); postPaymentResponse(API_KEY, paymentPayload(createChargeRequestParams)) .statusCode(201) .contentType(JSON) .body("metadata.reconciled", is(true)) .body("metadata.ledger_code", is(123)) .body("metadata.fuh", is("fuh you")); connectorMock.verifyCreateChargeConnectorRequest(GATEWAY_ACCOUNT_ID, createChargeRequestParams); }
Source:
public long getEstimatedKeyCount() throws IOException { if (rawTable instanceof RDBTable) { return rawTable.getEstimatedKeyCount(); } throw new IllegalArgumentException( "Unsupported operation getEstimatedKeyCount() on table type " + rawTable.getClass().getCanonicalName()); }

Target:
public long getEstimatedKeyCount() throws IOException { return rawTable.getEstimatedKeyCount(); }
Source:
public TaskScheduler resolveTaskScheduler() { return resolveSchedulerBean(TaskScheduler.class); }

Target:
TaskScheduler resolveTaskScheduler() { return resolveSchedulerBean(TaskScheduler.class); }
Source:
public void sendNotification(final String organisationIdentification, final String deviceIdentification, final String result, final String correlationUid, final String message, final Object notificationType) { final String notifyUrl = this.notificationUrl(correlationUid); if (notifyUrl != null && !notifyUrl.isEmpty() && !"\"\"".equals(notifyUrl)) { final SendNotificationRequest notificationRequest = this.notificationRequest(organisationIdentification, deviceIdentification, result, correlationUid, message, notificationType); this.doSendNotification(this.webServiceTemplateFactory, organisationIdentification, this.notificationUsername, notifyUrl, notificationRequest); } }

Target:
public void sendNotification(final String organisationIdentification, final String deviceIdentification, final String result, final String correlationUid, final String message, final Object notificationType) { final String notifyUrl = this.notificationUrl(correlationUid); final SendNotificationRequest notificationRequest = this.notificationRequest(organisationIdentification, deviceIdentification, result, correlationUid, message, notificationType); this.doSendNotification(this.webServiceTemplateFactory, organisationIdentification, this.notificationUsername, notifyUrl, notificationRequest); }
Source:
public void refreshServicedUnitList() { UUID uuid = null; if (null != getSelectedServicedUnit()) { uuid = getSelectedServicedUnit().getId(); } ignoreUnitTable = true; servicedUnitModel.setData(getCampaign().getServiceableUnits()); ignoreUnitTable = false; if (!focusOnUnit(uuid)) { refreshTaskList(); txtServicedUnitView.setText(""); } refreshPartsAcquisition(); }

Target:
public void refreshServicedUnitList() { UUID uuid = (getSelectedServicedUnit() != null) ? getSelectedServicedUnit().getId() : null; ignoreUnitTable = true; servicedUnitModel.setData(getCampaign().getServiceableUnits()); ignoreUnitTable = false; if (!focusOnUnit(uuid)) { refreshTaskList(); txtServicedUnitView.setText(""); } refreshPartsAcquisition(); }