auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void init() { Fabric.with(this, new Crashlytics()); LocationMemory.getInstance().init(getApplicationContext()); TypefaceCache.getInstance().init(getApplicationContext()); D2.init(this); FlowConfig flowConfig = new FlowConfig .Builder(this) .addDatabaseHolder(EyeSeeTeaGeneratedDatabaseHolder.class) .build(); FlowManager.init(flowConfig); SdkQueries.createDBIndexes(); PostMigration.launchPostMigration(); if (!BuildConfig.multiuser) { Log.i(TAG, "Pull on SplashScreen ..."); PullController pullController = new PullController(getApplication().getApplicationContext()); PullUseCase pullUseCase = new PullUseCase(pullController); pullUseCase.execute(false, new PullUseCase.Callback() { @Override public void onComplete() { } @Override public void onStep(PullStep step) { Log.d(this.getClass().getSimpleName(), step.toString()); } @Override public void onError(String message) { Log.e(this.getClass().getSimpleName(), message); } @Override public void onNetworkError() { Log.e(this.getClass().getSimpleName(), "Network Error"); } }); } }

Target:
private void init() { Fabric.with(this, new Crashlytics()); LocationMemory.getInstance().init(getApplicationContext()); TypefaceCache.getInstance().init(getApplicationContext()); D2.init(this); FlowConfig flowConfig = new FlowConfig .Builder(this) .addDatabaseHolder(EyeSeeTeaGeneratedDatabaseHolder.class) .build(); FlowManager.init(flowConfig); SdkQueries.createDBIndexes(); PostMigration.launchPostMigration(); if (!BuildConfig.multiuser) { Log.i(TAG, "Pull on SplashScreen ..."); PullController pullController = new PullController( getApplication().getApplicationContext()); PullUseCase pullUseCase = new PullUseCase(pullController); pullUseCase.execute(true, new PullUseCase.Callback() { @Override public void onComplete() { } @Override public void onStep(PullStep step) { Log.d(this.getClass().getSimpleName(), step.toString()); } @Override public void onError(String message) { Log.e(this.getClass().getSimpleName(), message); } @Override public void onNetworkError() { Log.e(this.getClass().getSimpleName(), "Network Error"); } }); } }
Source:
public ResponseHeader(Struct struct, short headerVersion) { this.data = new ResponseHeaderData(struct, headerVersion); this.headerVersion = headerVersion; }

Target:
public ResponseHeader(Struct struct, short headerVersion) { this(new ResponseHeaderData(struct, headerVersion), headerVersion); }
Source:
public void setValue(String value) { setValue(value != null ? value.replace("L", "32") : value, false); } @Override public String getValue() { return selectedItemsString != null ? selectedItemsString.replace("32", "L") : selectedItemsString; } private void setSelectedValue() { selectedItemsString = null; for(String item : selectedItems) { if (selectedItemsString == null) { selectedItemsString = item; } else { selectedItemsString = selectedItemsString.concat(","); selectedItemsString = selectedItemsString.concat(item); } } ValueChangeEvent.fire(this, getValue()); } public void setEnabled(boolean enabled) { } }

Target:
public void setValue(String value) { setValue(value != null ? value.replace("L", Integer.toString(LAST_DAY)) : value, false); }
Source:
@Bean @Primary KnownTypeQueryExecutor queryExecutor() { MongoLookupEntryStore lookupStore = new MongoLookupEntryStore(mongo.collection("lookup"), new NoLoggingPersistenceAuditLog(), readPreference); KnownTypeContentResolver mongoContentResolver = new MongoContentResolver(mongo, lookupStore); KnownTypeContentResolver cassandraContentResolver = new CassandraKnownTypeContentResolver(cassandra); DefaultEquivalentContentResolver defaultEquivalentContentResolver = new DefaultEquivalentContentResolver( mongoContentResolver, lookupStore ); KnownTypeQueryExecutor queryExecutor = new LookupResolvingQueryExecutor( cassandraContentResolver, defaultEquivalentContentResolver, lookupStore, cassandraEnabled ); queryExecutor = new UriFetchingQueryExecutor(localOrRemoteFetcher, queryExecutor, equivUpdater, ImmutableSet.of(FACEBOOK)); queryExecutor = new CurieResolvingQueryExecutor(queryExecutor); queryExecutor = new FilterActivelyPublishedOnlyQueryExecutor(queryExecutor); queryExecutor = new MergeOnOutputQueryExecutor(queryExecutor); queryExecutor = new FilterScheduleOnlyQueryExecutor(queryExecutor); return Boolean.parseBoolean(applicationsEnabled) ? new ApplicationConfigurationQueryExecutor(queryExecutor) : queryExecutor; }

Target:
KnownTypeQueryExecutor queryExecutor() { MongoLookupEntryStore lookupStore = new MongoLookupEntryStore( mongo.collection("lookup"), new NoLoggingPersistenceAuditLog(), readPreference ); KnownTypeContentResolver mongoContentResolver = new MongoContentResolver(mongo, lookupStore); KnownTypeContentResolver cassandraContentResolver = new CassandraKnownTypeContentResolver(cassandra); DefaultEquivalentContentResolver defaultEquivalentContentResolver = new DefaultEquivalentContentResolver(mongoContentResolver, lookupStore); KnownTypeQueryExecutor queryExecutor = new LookupResolvingQueryExecutor( cassandraContentResolver, defaultEquivalentContentResolver, lookupStore, cassandraEnabled ); queryExecutor = new UriFetchingQueryExecutor (localOrRemoteFetcher, queryExecutor, equivUpdater, ImmutableSet.of(FACEBOOK)); queryExecutor = new CurieResolvingQueryExecutor(queryExecutor); queryExecutor = new FilterActivelyPublishedOnlyQueryExecutor(queryExecutor); queryExecutor = new MergeOnOutputQueryExecutor(queryExecutor); queryExecutor = new FilterScheduleOnlyQueryExecutor(queryExecutor); return Boolean.parseBoolean(applicationsEnabled) ? new ApplicationConfigurationQueryExecutor(queryExecutor) : queryExecutor; }
Source:
public FulltextProviderImpl( GraphDatabaseService db, Log log, AvailabilityGuard availabilityGuard, JobScheduler scheduler, TransactionIdStore transactionIdStore, FileSystemAbstraction fileSystem, File storeDir, String analyzerClassName ) { this.db = db; this.log = log; this.transactionIdStore = transactionIdStore; JobScheduler jobScheduler = scheduler; applier = new FulltextUpdateApplier( log, availabilityGuard, scheduler ); applier.start(); factory = new FulltextFactory( fileSystem, storeDir, analyzerClassName ); writableNodeIndices = new Map[]{new ConcurrentHashMap<>(), new ConcurrentHashMap<>()}; writableRelationshipIndices = new Map[]{new ConcurrentHashMap<>(), new ConcurrentHashMap<>()}; configurationLock = new ReentrantReadWriteLock( true ); flipper = true; flipperJob = jobScheduler.schedule( FLIPPER, () -> { boolean isAvailable; do { isAvailable = availabilityGuard.isAvailable( 100 ); } while ( !isAvailable && !availabilityGuard.isShutdown() ); while ( flipper ) { try { flip(); } catch ( IOException e ) { e.printStackTrace(); } } } ); }

Target:
public FulltextProviderImpl( GraphDatabaseService db, Log log, AvailabilityGuard availabilityGuard, JobScheduler scheduler, TransactionIdStore transactionIdStore, FileSystemAbstraction fileSystem, File storeDir, String analyzerClassName ) { this.db = db; this.log = log; this.transactionIdStore = transactionIdStore; JobScheduler jobScheduler = scheduler; applier = new FulltextUpdateApplier( log, availabilityGuard, scheduler ); applier.start(); factory = new FulltextFactory( fileSystem, storeDir, analyzerClassName ); writableNodeIndices = new Map[]{new ConcurrentHashMap<>(), new ConcurrentHashMap<>()}; writableRelationshipIndices = new Map[]{new ConcurrentHashMap<>(), new ConcurrentHashMap<>()}; configurationLock = new ReentrantReadWriteLock( true ); flipperJob = jobScheduler.schedule( FLIPPER, () -> { boolean isAvailable; do { isAvailable = availabilityGuard.isAvailable( 100 ); } while ( !isAvailable && !availabilityGuard.isShutdown() ); while ( !closed ) { try { flip(); } catch ( IOException e ) { log.error( "Unable to flip fulltext index", e ); } } } ); }
Source:
protected NuxeoOAuth2Token readEntity(JsonNode jn) throws IOException { String cliendId = getStringField(jn, "clientId"); NuxeoOAuth2Token token = new NuxeoOAuth2Token(0, cliendId); token.setServiceName(getStringField(jn, "serviceName")); token.setNuxeoLogin(getStringField(jn, "nuxeoLogin")); token.setServiceLogin(getStringField(jn, "serviceLogin")); SimpleDateFormat dateFormat = new SimpleDateFormat(NuxeoOAuth2TokenWriter.DATE_FORMAT); Calendar cal = Calendar.getInstance(); try { cal.setTime(dateFormat.parse(getStringField(jn, "creationDate"))); } catch (ParseException e) { cal = null; } token.setCreationDate(cal); token.setIsShared(getBooleanField(jn, "isShared")); List<String> sharedWith = getStringListField(jn, "sharedWith"); token.setSharedWith(sharedWith == null ? "" : StringUtils.join(sharedWith, ",")); return token; }

Target:
protected NuxeoOAuth2Token readEntity(JsonNode jn) throws IOException { String cliendId = getStringField(jn, "clientId"); NuxeoOAuth2Token token = new NuxeoOAuth2Token(0, cliendId); token.setServiceName(getStringField(jn, "serviceName")); token.setNuxeoLogin(getStringField(jn, "nuxeoLogin")); token.setServiceLogin(getStringField(jn, "serviceLogin")); SimpleDateFormat dateFormat = new SimpleDateFormat(NuxeoOAuth2TokenWriter.DATE_FORMAT); Calendar cal = Calendar.getInstance(); try { cal.setTime(dateFormat.parse(getStringField(jn, "creationDate"))); } catch (ParseException e) { cal = null; } token.setCreationDate(cal); token.setIsShared(getBooleanField(jn, "isShared")); List<String> sharedWith = getStringListField(jn, "sharedWith"); token.setSharedWith(sharedWith == null ? "" : String.join(",", sharedWith)); return token; }
Source:
public void initializeDatastream(Datastream stream, List<Datastream> allDatastreams) throws DatastreamValidationException { LOG.info("validating datastream " + stream.toString()); try { MysqlSource source = MysqlSource.createFromUri(stream.getSource().getConnectionString()); if (source.getSourceType() != MysqlConnector.SourceType.MYSQLSERVER) { String msg = "Connector can only support datastreams of MYSQLSERVER source type"; LOG.error(msg); throw new DatastreamValidationException(msg); } if (!MysqlQueryUtils.checkTableExists(source, _defaultUserName, _defaultPassword)) { throw new DatastreamValidationException( String.format("Invalid datastream: Can't find table %s in db %s.", source.getDatabaseName(), source.getTableName())); } if (stream.getSource().hasPartitions() && stream.getSource().getPartitions() != 1) { String msg = "Mysql snapshot connector can only support single partition sources"; LOG.error(msg); throw new DatastreamValidationException(msg); } } catch (SourceNotValidException | SQLException e) { LOG.error("Received exception while validating the Mysql source", e); throw new DatastreamValidationException(e); } }

Target:
public void initializeDatastream(Datastream stream, List<Datastream> allDatastreams) throws DatastreamValidationException { LOG.info("validating datastream " + stream.toString()); try { MysqlSource source = MysqlSource.createFromUri(stream.getSource().getConnectionString()); if (source.getSourceType() != MysqlConnector.SourceType.MYSQLSERVER) { String msg = "Connector can only support datastreams of MYSQLSERVER source type"; LOG.error(msg); throw new DatastreamValidationException(msg); } if (!MysqlQueryUtils.checkTableExists(source, getUserNameFromDatastream(stream), getPasswordFromDatastream(stream))) { throw new DatastreamValidationException( String.format("Invalid datastream: Can't find table %s in db %s.", source.getDatabaseName(), source.getTableName())); } if (stream.getSource().hasPartitions() && stream.getSource().getPartitions() != 1) { String msg = "Mysql snapshot connector can only support single partition sources"; LOG.error(msg); throw new DatastreamValidationException(msg); } } catch (SourceNotValidException | SQLException e) { LOG.error("Received exception while validating the Mysql source", e); throw new DatastreamValidationException(e); } }
Source:
private ItemStack getItemsToOutput(@Nonnull Material item) { if (Tag.LOGS.isTagged(item)) { Optional<Material> planks = MaterialConverter.getPlanksFromLog(item); return new ItemStack(planks.get(), 8); } else if (Tag.PLANKS.isTagged(item)) { return new ItemStack(Material.STICK, 4); } else { return null; } }

Target:
private ItemStack getItemsToOutput(@Nonnull Material item) { if (Tag.LOGS.isTagged(item)) { Optional<Material> planks = MaterialConverter.getPlanksFromLog(item); if (planks.isPresent()) { return new ItemStack(planks.get(), 8); } else { return null; } } else if (Tag.PLANKS.isTagged(item)) { return new ItemStack(Material.STICK, 4); } else { return null; } }
Source:
public List<String> validatePropertyTriple(Statement propertyTriple) { List<String> invalid = new ArrayList<>(); String subject = propertyTriple.getSubject().stringValue(); if (!isValidTripleComponent(subject, VALID_NAMESPACES.statement(), "statement")) { invalid.add(subject); } String predicate = propertyTriple.getPredicate().stringValue(); if (!isValidTripleComponent(predicate, VALID_NAMESPACES.property(WikibaseUris.PropertyType.STATEMENT), "property")) { invalid.add(predicate); } Value object = propertyTriple.getObject(); if (object instanceof URI) { String objectString = object.stringValue(); if (!isValidTripleComponent(objectString, VALID_NAMESPACES.entity(), "item")) { if (objectString.startsWith(VALID_NAMESPACES.root() + "/")) { log.error("Probably a Wikidata term, but not an Item: {}", objectString); invalid.add(objectString); } else { int distance = computeNamespaceDistance(objectString, VALID_NAMESPACES.entity(), "item"); if (distance <= EDIT_DISTANCE_THRESHOLD) { log.error("Probably a typo: {}", objectString); invalid.add(objectString); } else { int responseCode = 200; try { responseCode = resolve(objectString); } catch (IOException ioe) { log.error("Not resolvable: Reason: {}", objectString, ioe.getClass().getSimpleName()); invalid.add(objectString); } if (responseCode >= 400) { log.error("Not resolvable: HTTP error code: {}", objectString, responseCode); invalid.add(objectString); } } } } } return invalid; }

Target:
public List<String> validatePropertyTriple(Statement propertyTriple) { List<String> invalid = new ArrayList<>(); String subject = propertyTriple.getSubject().stringValue(); if (!isValidTripleComponent(subject, VALID_NAMESPACES.statement(), "statement")) { invalid.add(subject); } String predicate = propertyTriple.getPredicate().stringValue(); if (!isValidTripleComponent(predicate, VALID_NAMESPACES.property(WikibaseUris.PropertyType.STATEMENT), "property")) { invalid.add(predicate); } Value object = propertyTriple.getObject(); if (object instanceof URI) { String objectString = object.stringValue(); if (!isValidTripleComponent(objectString, VALID_NAMESPACES.entity(), "item")) { if (objectString.startsWith(VALID_NAMESPACES.root() + "/")) { log.error("Probably a Wikidata term, but not an Item: {}", objectString); invalid.add(objectString); } else { int distance = computeNamespaceDistance(objectString, VALID_NAMESPACES.entity(), "item"); if (distance <= EDIT_DISTANCE_THRESHOLD) { log.error("Probably a typo: {}", objectString); invalid.add(objectString); } else { boolean isValidURL = validateURL(objectString); if (!isValidURL) { invalid.add(objectString); } } } } } return invalid; }
Source:
private long reqSaveImages(@NonNull ReadingListPage page, @NonNull Iterable<String> urls) throws IOException, InterruptedException { int numOfImages = ((Collection<?>) urls).size(); long totalSize = 0; if (numOfImages == 0) { WikipediaApp.getInstance().getBus().post(new PageDownloadEvent(MAX_PROGRESS, page)); } else { int percentage = SECTIONS_PROGRESS; int updateRate = numOfImages / SECTIONS_PROGRESS; int urlCount = 0; for (String url : urls) { urlCount = updateRate == 0 ? urlCount : urlCount == updateRate ? 0 : urlCount + 1; if (savedPageSyncNotification.isSyncPaused() || savedPageSyncNotification.isSyncCanceled()) { throw new InterruptedException("Sync paused or cancelled."); } try { totalSize += reqSaveImage(page.wiki(), url); if (urlCount == updateRate) { WikipediaApp.getInstance().getBus().post(new PageDownloadEvent(++percentage, page)); } } catch (Exception e) { if (isRetryable(e)) { throw e; } } } } WikipediaApp.getInstance().getBus().post(new PageDownloadEvent(MAX_PROGRESS, page)); return totalSize; }

Target:
private long reqSaveImages(@NonNull ReadingListPage page, @NonNull Iterable<String> urls) throws IOException, InterruptedException { int numOfImages = ((Collection<?>) urls).size(); long totalSize = 0; float percentage = SECTIONS_PROGRESS; float updateRate = (float) SECTIONS_PROGRESS / numOfImages; for (String url : urls) { if (savedPageSyncNotification.isSyncPaused() || savedPageSyncNotification.isSyncCanceled()) { throw new InterruptedException("Sync paused or cancelled."); } try { totalSize += reqSaveImage(page.wiki(), url); percentage += updateRate; page.downloadProgress((int) percentage); WikipediaApp.getInstance().getBus().post(new PageDownloadEvent(page)); } catch (Exception e) { if (isRetryable(e)) { throw e; } } } page.downloadProgress(MAX_PROGRESS); WikipediaApp.getInstance().getBus().post(new PageDownloadEvent(page)); return totalSize; }
Source:
public String getDomain() { return "gerrit"; }

Target:
public String getDomain() { return GERRIT_DOMAIN_NAME; }
Source:
protected void flush() throws IOException { if (outputStream != null) { if (fileSystemWAL.fileContext.getDefaultFileSystem() instanceof LocalFs || fileSystemWAL.fileContext.getDefaultFileSystem() instanceof RawLocalFs) { close(); } else { ((HdfsDataOutputStream)outputStream).hsync(EnumSet.of(SyncFlag.UPDATE_LENGTH)); } } }

Target:
protected void flush() throws IOException { if (outputStream != null) { if (fileSystemWAL.fileContext.getDefaultFileSystem() instanceof LocalFs || fileSystemWAL.fileContext.getDefaultFileSystem() instanceof RawLocalFs) { close(); } else { Syncable syncableOutputStream = (Syncable)outputStream; syncableOutputStream.hflush(); syncableOutputStream.hsync(); } } }
Source:
protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("SELECT id " + "FROM loaded_templates " + "WHERE template_type = 'QUALITY_GATE'"); massUpdate.update("DELETE from loaded_templates WHERE id=?"); massUpdate.rowPluralName("delete loaded templates for quality gate"); massUpdate.execute((row, update) -> { update.setLong(1, row.getLong(1)); return true; }); }

Target:
protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("SELECT id " + "FROM loaded_templates " + "WHERE template_type = ?") .setString(1, "QUALITY_GATE"); massUpdate.update("DELETE from loaded_templates WHERE id=?"); massUpdate.rowPluralName("delete loaded templates for quality gate"); massUpdate.execute((row, update) -> { update.setLong(1, row.getLong(1)); return true; }); }
Source:
private void checkState() { if (parent == null && providers.isEmpty()) { throw new IllegalArgumentException( "A parent AuthenticationManager or a list " + "of AuthenticationProviders is required"); } else if (providers.stream().anyMatch(Objects::isNull)) { throw new IllegalArgumentException( "providers list cannot contain null values"); } }

Target:
private void checkState() { if (parent == null && providers.isEmpty()) { throw new IllegalArgumentException( "A parent AuthenticationManager or a list " + "of AuthenticationProviders is required"); } else if (CollectionUtils.contains(providers.iterator(), null)) { throw new IllegalArgumentException( "providers list cannot contain null values"); } }
Source:
private int calculateDelay(final int retry) { int delay = this.retryDelay; if (this.exponentialBackoff) { final double exponent = Math.pow(this.backoffMultiplier, retry); delay *= exponent; } return delay; }

Target:
private int calculateDelay(final int retry) { int delay = this.retryDelay; if (this.exponentialBackoff) { final double factor = Math.pow(this.backoffMultiplier, retry); delay *= factor; } return delay; }
Source:
public AtomicReference<NodeMetadata> apply(AtomicReference<NodeAndNovaTemplateOptions> input) { checkState(nodeRunning.apply(input.get().getNodeMetadata()), "node never achieved state running %s", input.get().getNodeMetadata()); NodeMetadata node = input.get().getNodeMetadata().get(); String regionId = node.getLocation().getParent().getId(); FloatingIPApi floatingIpApi = novaApi.getFloatingIPApi(regionId).get(); Optional<Set<String>> poolNames = input.get().getNovaTemplateOptions().get().getFloatingIpPoolNames(); Optional<FloatingIP> ip = allocateFloatingIPForNode(floatingIpApi, poolNames, node.getId()); if (!ip.isPresent()) { RegionAndId regionAndId = RegionAndId.fromSlashEncoded(node.getId()); novaApi.getServerApi(regionAndId.getRegion()).delete(regionAndId.getId()); throw new InsufficientResourcesException("Failed to allocate a FloatingIP for node(" + node.getId() + ")"); } logger.debug(">> adding floatingIp(%s) to node(%s)", ip.get().getIp(), node.getId()); floatingIpApi.addToServer(ip.get().getIp(), node.getProviderId()); input.get().getNodeMetadata().set(NodeMetadataBuilder.fromNodeMetadata(node).publicAddresses(ImmutableSet.of(ip.get().getIp())).build()); floatingIpCache.asMap().putIfAbsent(RegionAndId.fromSlashEncoded(node.getId()), ImmutableList.of(ip.get())); return input.get().getNodeMetadata(); }

Target:
public AtomicReference<NodeMetadata> apply(AtomicReference<NodeAndNovaTemplateOptions> input) { checkState(nodeRunning.apply(input.get().getNodeMetadata()), "node never achieved state running %s", input.get().getNodeMetadata()); NodeMetadata node = input.get().getNodeMetadata().get(); String regionId = node.getLocation().getParent().getId(); FloatingIPApi floatingIpApi = novaApi.getFloatingIPApi(regionId).get(); Optional<Set<String>> poolNames = input.get().getNovaTemplateOptions().get().getFloatingIpPoolNames(); Optional<FloatingIP> ip = allocateFloatingIPForNode(floatingIpApi, poolNames, node.getId()); if (!ip.isPresent()) { cleanupServer.apply(node.getId()); throw new InsufficientResourcesException("Failed to allocate a FloatingIP for node(" + node.getId() + ")"); } logger.debug(">> adding floatingIp(%s) to node(%s)", ip.get().getIp(), node.getId()); floatingIpApi.addToServer(ip.get().getIp(), node.getProviderId()); input.get().getNodeMetadata().set(NodeMetadataBuilder.fromNodeMetadata(node).publicAddresses(ImmutableSet.of(ip.get().getIp())).build()); floatingIpCache.asMap().putIfAbsent(RegionAndId.fromSlashEncoded(node.getId()), ImmutableList.of(ip.get())); return input.get().getNodeMetadata(); }
Source:
public void onConfirm(View v) { HashMap<String, String> params = new HashMap<String, String>(); for (int i = 0; i < TEXT_FIELDS.length; i++) { EditText input = (EditText) this.findViewById(TEXT_FIELDS[i]); if (input.isEnabled() && input.getText().toString().length() > 0) { String key = this.getString(EXTRAS[i]); params.put(key, input.getText().toString()); } } Intent intent = new Intent(); intent.putExtra(this.getString(R.string.filter_params_extra), params); this.setResult(RESULT_OK, intent); this.finish(); }

Target:
public void onConfirm(View v) { Intent intent = new Intent(); for (int i = 0; i < TEXT_FIELDS.length; i++) { EditText input = (EditText) this.findViewById(TEXT_FIELDS[i]); if (input.isEnabled() && input.getText().toString().length() > 0) { String key = this.getString(EXTRAS[i]); intent.putExtra(key, input.getText().toString()); } } this.setResult(RESULT_OK, intent); this.finish(); }
Source:
protected void checkSalutation() { if (Strings.isFilled(salutation)) { codeLists.getRequiredValue("salutations", salutation); } }

Target:
protected void checkSalutation() { if (Strings.isFilled(salutation)) { codeLists.verifyValue("salutations", salutation); } }
Source:
public void onProcessResourcePackStatus(CPacketResourcePackStatus packet, CallbackInfo ci) { PacketThreadUtil.checkThreadAndEnqueue(packet, (INetHandlerPlayServer) this, this.playerEntity.getServerWorld()); }

Target:
private void onProcessResourcePackStatus(CPacketResourcePackStatus packet, CallbackInfo ci) { PacketThreadUtil.checkThreadAndEnqueue(packet, (INetHandlerPlayServer) this, this.player.getServerWorld()); }
Source:
List<MetricFamilySamples> fromCounter(String dropwizardName, Counter counter) { String name = sanitizeMetricName(dropwizardName); MetricFamilySamples.Sample sample = sampleBuilder.createSample(dropwizardName, "", new ArrayList<String>(), new ArrayList<String>(), new Long(counter.getCount()).doubleValue()); return Arrays.asList(new MetricFamilySamples(name, Type.GAUGE, getHelpMessage(dropwizardName, counter), Arrays.asList(sample))); }

Target:
MetricFamilySamples fromCounter(String dropwizardName, Counter counter) { MetricFamilySamples.Sample sample = sampleBuilder.createSample(dropwizardName, "", new ArrayList<String>(), new ArrayList<String>(), new Long(counter.getCount()).doubleValue()); return new MetricFamilySamples(sample.name, Type.GAUGE, getHelpMessage(dropwizardName, counter), Arrays.asList(sample)); }
Source:
private static boolean checkImmutable(Class<?> type) { if (_ignoredClasses.containsKey(type)) return true; if (Modifier.isFinal(type.getModifiers())) { _ignoredClasses.put(type, Boolean.TRUE); return true; } if (_ignoredSuperClasses.size() > 0) { for (Class c = type; (c = c.getSuperclass()) != null;) { if (_ignoredSuperClasses.containsKey(c)) return true; } } return false; }

Target:
private static boolean checkImmutable(Class<?> type) { if (_ignoredClasses.containsKey(type)) return true; if (Modifier.isFinal(type.getModifiers())) { _ignoredClasses.put(type, Boolean.TRUE); return true; } if (_ignoredSuperClasses.size() > 0) { for (Class c = type; (c = c.getSuperclass()) != null;) { if (_ignoredSuperClasses.containsKey(c)) { _ignoredClasses.put(type, Boolean.TRUE); return true; } } } return false; }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof DnsResolverConfiguration)) { return false; } DnsResolverConfiguration that = (DnsResolverConfiguration) o; return Objects.equals(getNameServers(), that.getNameServers()); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof DnsResolverConfiguration)) { return false; } DnsResolverConfiguration that = (DnsResolverConfiguration) o; return Objects.equals(getId(), that.getId()) && Objects.equals(getNameServers(), that.getNameServers()); }
Source:
public void createDatabase(Database database) { try { retry() .stopOn(AlreadyExistsException.class, InvalidObjectException.class, MetaException.class) .stopOnIllegalExceptions() .run("createDatabase", stats.getCreateDatabase().wrap(() -> { Optional<UgiAndDelegationToken> ut = withUGIAndToken(UserGroupInformation.getCurrentUser().getShortUserName()); if (ut.isPresent()) { UserGroupInformationUtils.executeActionInDoAs(ut.get().ugi, () -> { try (HiveMetastoreClient client = clientProvider.createMetastoreClientWithToken(ut.get().token.encodeToUrlString())) { client.createDatabase(database); } return null; }); } else { try (HiveMetastoreClient client = clientProvider.createMetastoreClient()) { client.createDatabase(database); } } return null; })); } catch (AlreadyExistsException e) { throw new SchemaAlreadyExistsException(database.getName()); } catch (TException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } catch (Exception e) { throw propagate(e); } }

Target:
public void createDatabase(Database database) { try { retry() .stopOn(AlreadyExistsException.class, InvalidObjectException.class, MetaException.class) .stopOnIllegalExceptions() .run("createDatabase", stats.getCreateDatabase().wrap(() -> wrapMetastoreCallable((HiveMetastoreClient client, ThriftHiveMetastoreStats stat) -> stat.getAlterDatabase().wrapCall(() -> { client.createDatabase(database); return null; })))); } catch (AlreadyExistsException e) { throw new SchemaAlreadyExistsException(database.getName()); } catch (TException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } catch (Exception e) { throw propagate(e); } }
Source:
private void receive() { new Thread(() -> { while (isActive) { DatagramPacket packet; byte[] buf = new byte[1024]; packet = new DatagramPacket(buf, buf.length); try { _socket.receive(packet); byte[] data = Arrays.copyOf(packet.getData(), packet.getLength()); ByteBuffer buffer = ByteBuffer.allocate(1024); buffer.order(ByteOrder.LITTLE_ENDIAN); buffer.put(data); buffer.rewind(); if (buffer.get() != 1) { return; } byte value = buffer.get(); Opcodes opcode = Opcodes.fromInteger(value); buffer.get(); switch (opcode) { case BROADCAST_POSITION_UPDATE: { recievePositionUpdate(buffer); } case BROADCAST_SCORE_UPDATE: { recieveScoreUpdate(buffer); } case BROADCAST_HEALTH_UPDATE: { recieveHealthUpdate(buffer); } default: break; } } catch (IOException e) { e.printStackTrace(); } } }).start(); }

Target:
private void receive() { new Thread(() -> { while (isActive) { DatagramPacket packet; byte[] buf = new byte[1024]; packet = new DatagramPacket(buf, buf.length); try { _socket.receive(packet); byte[] data = Arrays.copyOf(packet.getData(), packet.getLength()); ByteBuffer buffer = ByteBuffer.allocate(1024); buffer.order(ByteOrder.LITTLE_ENDIAN); buffer.put(data); buffer.rewind(); if (buffer.get() != 1) { return; } byte value = buffer.get(); Opcodes opcode = Opcodes.fromInteger(value); buffer.get(); switch (opcode) { case BROADCAST_POSITION_UPDATE: { readPositionUpdate(buffer); } case BROADCAST_SCORE_UPDATE: { readScoreUpdate(buffer); } case BROADCAST_HEALTH_UPDATE: { readHealthUpdate(buffer); } default: break; } } catch (IOException e) { e.printStackTrace(); } } }).start(); }
Source:
void verify(SingleBackendCliTestRunner runner, TimestampService tss, long immutableTs, long prePunch, long postPunch, long lastFreshTs, boolean shouldTestImmutable) throws Exception; } @Test public void testWithoutFile() throws Exception { cliArgs.add("fetch"); if (isImmutable) { cliArgs.add("-i"); } cliArgs.add("-d"); runAndVerifyCli((runner, tss, immutableTs, prePunch, postPunch, lastFreshTs, shouldTestImmutable) -> { String output = runner.run(true, false); try { Scanner scanner = new Scanner(output); scanner.nextLine(); long timestamp = getTimestampFromStdout(scanner); scanner.nextLine(); long wallClockTimestamp = getWallClockTimestamp(scanner); scanner.close(); if (shouldTestImmutable && isImmutable) { verifyImmutableTs(timestamp, immutableTs, prePunch, postPunch, lastFreshTs, tss.getFreshTimestamp(), wallClockTimestamp); } else { verifyFreshTs(timestamp, prePunch, postPunch, lastFreshTs, tss.getFreshTimestamp(), wallClockTimestamp); } } catch (RuntimeException e) { throw new RuntimeException("Failed " + e.getMessage() + " while processing result:\n" + output, e); } }); }

Target:
void verify(SingleBackendCliTestRunner runner, TimestampService tss, long immutableTs, long prePunch, long postPunch, long lastFreshTs, boolean shouldTestImmutable) throws Exception; } @Test public void testWithoutFile() throws Exception { cliArgs.add("fetch"); if (isImmutable) { cliArgs.add("-i"); } cliArgs.add("-d"); runAndVerifyCli((runner, tss, immutableTs, prePunch, postPunch, lastFreshTs, shouldTestImmutable) -> { String output = runner.run(true, false); try { Scanner scanner = new Scanner(output); String shouldBeDeprecationLine = scanner.nextLine(); verifyDeprecation(shouldBeDeprecationLine); long timestamp = getTimestampFromStdout(scanner); scanner.nextLine(); long wallClockTimestamp = getWallClockTimestamp(scanner); scanner.close(); if (shouldTestImmutable && isImmutable) { verifyImmutableTs(timestamp, immutableTs, prePunch, postPunch, lastFreshTs, tss.getFreshTimestamp(), wallClockTimestamp); } else { verifyFreshTs(timestamp, prePunch, postPunch, lastFreshTs, tss.getFreshTimestamp(), wallClockTimestamp); } } catch (RuntimeException e) { throw new RuntimeException("Failed " + e.getMessage() + " while processing result:\n" + output, e); } }); }
Source:
private void doInit(ExtMap input, ExtMap output) { try { this.ds = new DataSourceProvider(configuration).provide(); this.authorization = new Authorization(ds); this.tasks = new Tasks(ds, this.authorization); ExtensionUtils.checkDbVersion( ds.getConnection(), input.<ExtMap>get(Base.InvokeKeys.CONTEXT).<String>get(Base.ContextKeys.CONFIGURATION_FILE) ); output.put(Base.InvokeKeys.RESULT, Base.InvokeResult.SUCCESS); } catch (Exception ex) { LOG.debug("Exception", ex); output.put(Base.InvokeKeys.RESULT, Base.InvokeResult.FAILED); output.put(Base.InvokeKeys.MESSAGE, ex.getMessage()); } }

Target:
private void doInit(ExtMap input, ExtMap output) throws SQLException, IOException { this.ds = new DataSourceProvider(configuration).provide(); this.authorization = new Authorization(ds); this.tasks = new Tasks(ds, this.authorization); ExtensionUtils.checkDbVersion( ds.getConnection(), input.<ExtMap>get(Base.InvokeKeys.CONTEXT).<String>get(Base.ContextKeys.CONFIGURATION_FILE) ); }
Source:
public IOperation createOperation(VariableMap variableMap, OperationLogger logger) throws Exception { String pairs = variableMap.getString("Porting RPCR ID Pairs"); return new PortPairsOperation(logger, pairs); }

Target:
public IOperation createOperation(VariableMap variableMap, OperationLogger logger) throws Exception { String pairs = variableMap.getString(PORT_NAME); return new PortPairsOperation(logger, pairs); }
Source:
public void setClientOperations(final Client client) { ArgumentVerifier.assertNotNull(client, "Client"); if(isRunning() && !clients.containsKey(client.getChannel()) && !client.isClosed() && client.getClientsSocketExecuter() == this) { clients.putIfAbsent(client.getChannel(), client); } if(clients.containsKey(client.getChannel()) && !client.isClosed() && isRunning()) { if(client.getChannel().isConnectionPending()) { schedulerPool.execute(new AddToSelector(client, commonSelector, SelectionKey.OP_CONNECT)); } else if(client.canWrite() && client.canRead()) { schedulerPool.execute(new AddToSelector(client, commonSelector, SelectionKey.OP_WRITE|SelectionKey.OP_READ)); } else if (client.canRead()){ schedulerPool.execute(new AddToSelector(client, commonSelector, SelectionKey.OP_READ)); } else if (client.canWrite()){ schedulerPool.execute(new AddToSelector(client, commonSelector, SelectionKey.OP_WRITE)); } else { schedulerPool.execute(new AddToSelector(client, commonSelector, 0)); } commonSelector.wakeup(); } else if(client.isClosed()) { clients.remove(client.getChannel()); } }

Target:
public void setClientOperations(final Client client) { ArgumentVerifier.assertNotNull(client, "Client"); if(!clients.containsKey(client.getChannel()) || client.isClosed()) { clients.remove(client.getChannel()); return; } if(client.getChannel().isConnectionPending()) { schedulerPool.execute(new AddToSelector(client, commonSelector, SelectionKey.OP_CONNECT)); } else if(client.canWrite() && client.canRead()) { schedulerPool.execute(new AddToSelector(client, commonSelector, SelectionKey.OP_WRITE|SelectionKey.OP_READ)); } else if (client.canRead()){ schedulerPool.execute(new AddToSelector(client, commonSelector, SelectionKey.OP_READ)); } else if (client.canWrite()){ schedulerPool.execute(new AddToSelector(client, commonSelector, SelectionKey.OP_WRITE)); } else { schedulerPool.execute(new AddToSelector(client, commonSelector, 0)); } commonSelector.wakeup(); }
Source:
public CloseableIterator<K> iterator() { return new RemovableCloseableIterator<>( new CloseableIteratorMapper<>(retrieveEntries(null, batchSize), e -> (K) e.getKey()), RemoteCacheImpl.this::remove); }

Target:
public CloseableIterator<K> iterator() { return new RemovableCloseableIterator<>( new CloseableIteratorMapper<>(retrieveEntries( "org.infinispan.server.hotrod.HotRodServer$ToEmptyBytesKeyValueFilterConverter", batchSize), e -> (K) e.getKey()), RemoteCacheImpl.this::remove); }
Source:
public boolean schemaExists() throws Exception { final Connection db = getConnection(); final String sql = "select * from " + this.table + " limit 1"; db.setAutoCommit(false); try (final PreparedStatement test = db.prepareStatement(sql)) { try (final ResultSet rs = test.executeQuery()) { rs.next(); } db.commit(); return true; } catch (Exception e) { db.rollback(); return false; } finally { db.setAutoCommit(true); } }

Target:
public boolean schemaExists() throws Exception { final String sql = "select * from " + this.table + " limit 1"; beginTransaction(); try (final PreparedStatement test = getConnection().prepareStatement(sql)) { try (final ResultSet rs = test.executeQuery()) { rs.next(); } commitTransaction(); return true; } catch (Exception e) { rollbackTransaction(); return false; } }
Source:
private void discoverGeoRepDataInCluster(VDSGroup cluster, String volumeName) { if (!supportsGlusterGeoRepFeature(cluster)) { return; } Map<String, GlusterGeoRepSession> sessionsMap = getSessionsFromCLI(cluster, volumeName); if (sessionsMap == null) { log.debug("Error in retrieving sessions for cluster: from CLI, nothing to do", cluster.getName()); return; } updateDiscoveredSessions(cluster, sessionsMap); }

Target:
private void discoverGeoRepDataInCluster(VDSGroup cluster, String volumeName) { if (!supportsGlusterGeoRepFeature(cluster)) { return; } Map<String, GlusterGeoRepSession> sessionsMap = getSessionsFromCLI(cluster, volumeName); if (sessionsMap == null) { log.debug("No sessions retrieved for cluster: from CLI, nothing to do", cluster.getName()); return; } updateDiscoveredSessions(cluster, sessionsMap); }
Source:
public FileFilter createFileFilter() { return new FileFilter() { @Override public boolean accept(File file) { String name = file.getName(); return name.endsWith(".ex") || name.endsWith(".exs"); } }; }

Target:
public FileFilter createFileFilter() { return new FileFilter() { @Override public boolean accept(File file) { String name = file.getName(); return FileUtilRt.extensionEquals(name, ElixirBuilder.ELIXIR_SOURCE_EXTENSION) || FileUtilRt.extensionEquals(name, ElixirBuilder.ELIXIR_SCRIPT_EXTENSION); } }; }
Source:
public void getLunConnectionsForFC() { LUNs lun = new LUNs(); ArrayList<StorageServerConnections> connections = new ArrayList<StorageServerConnections>(); lun.setLunConnections(connections); Map<StorageType, List<StorageServerConnections>> connectionsByType = StorageHelperBase.filterLUNsByStorageType(lun); assertTrue("Map of storage connections should be empty.", connectionsByType.isEmpty()); }

Target:
public void getLunConnectionsForFC() { LUNs lun = new LUNs(); ArrayList<StorageServerConnections> connections = new ArrayList<StorageServerConnections>(); lun.setLunConnections(connections); Map<StorageType, List<StorageServerConnections>> connectionsByType = StorageHelperBase.filterConnectionsByStorageType(lun); assertTrue("Map of storage connections should be empty.", connectionsByType.isEmpty()); }
Source:
private Long deserializeRestoreInformation(List<String> children, Map<String, Set<SnapshotInfo>> snapshotFragments) throws Exception { try { int recover = m_action.ordinal(); Long clStartTxnId = null; for (String node : children) { if (node.equals("snapshot_id")) continue; byte[] data = null; data = m_zk.getData(VoltZK.restore + "/" + node, false, null); String jsonData = new String(data, "UTF8"); JSONObject json = new JSONObject(jsonData); long maxTxnId = json.optLong("max", Long.MIN_VALUE); if (maxTxnId != Long.MIN_VALUE) { if (clStartTxnId == null || maxTxnId > clStartTxnId) { clStartTxnId = maxTxnId; } } int remoteRecover = json.getInt("action"); if (remoteRecover != recover) { String msg = "Database actions are not consistent. Remote node action is not 'recover'. " + "Please enter the same database action on the command-line."; VoltDB.crashLocalVoltDB(msg, true, null); } JSONArray snapInfos = json.getJSONArray("snapInfos"); int snapInfoCnt = snapInfos.length(); for (int i=0; i < snapInfoCnt; i++) { JSONObject jsonInfo = snapInfos.getJSONObject(i); SnapshotInfo info = new SnapshotInfo(jsonInfo); Set<SnapshotInfo> fragments = snapshotFragments.get(info.nonce); if (fragments == null) { fragments = new HashSet<SnapshotInfo>(); snapshotFragments.put(info.nonce, fragments); } fragments.add(info); } } return clStartTxnId; } catch (JSONException je) { VoltDB.crashLocalVoltDB("Error exchanging snapshot information", true, je); } throw new RuntimeException("impossible"); }

Target:
private Long deserializeRestoreInformation(List<String> children, Map<String, Set<SnapshotInfo>> snapshotFragments) throws Exception { try { int recover = m_action.ordinal(); Long clStartTxnId = null; for (String node : children) { if (node.equals("snapshot_id")) continue; byte[] data = null; data = m_zk.getData(VoltZK.restore + "/" + node, false, null); String jsonData = new String(data, "UTF8"); JSONObject json = new JSONObject(jsonData); long maxTxnId = json.optLong("max", Long.MIN_VALUE); if (maxTxnId != Long.MIN_VALUE) { if (clStartTxnId == null || maxTxnId > clStartTxnId) { clStartTxnId = maxTxnId; } } int remoteRecover = json.getInt("action"); if (remoteRecover != recover) { String msg = "Database actions are not consistent. Remote node action is not 'recover'. " + "Please enter the same database action on the command-line."; VoltDB.crashLocalVoltDB(msg, false, null); } JSONArray snapInfos = json.getJSONArray("snapInfos"); int snapInfoCnt = snapInfos.length(); for (int i=0; i < snapInfoCnt; i++) { JSONObject jsonInfo = snapInfos.getJSONObject(i); SnapshotInfo info = new SnapshotInfo(jsonInfo); Set<SnapshotInfo> fragments = snapshotFragments.get(info.nonce); if (fragments == null) { fragments = new HashSet<SnapshotInfo>(); snapshotFragments.put(info.nonce, fragments); } fragments.add(info); } } return clStartTxnId; } catch (JSONException je) { VoltDB.crashLocalVoltDB("Error exchanging snapshot information", true, je); } throw new RuntimeException("impossible"); }
Source:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && sourceObject != null) { String message; if (chooseUseText == null) { String effectText = executingEffects.getText(source.getModes().getMode()); message = "Pay " + cost.getText() + " to prevent (" + effectText.substring(0, effectText.length() - 1) + ")?"; } else { message = chooseUseText; } message = CardUtil.replaceSourceName(message, sourceObject.getName()); boolean result = true; boolean doEffect = true; for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null && player != controller && cost.canPay(source, source.getSourceId(), player.getId(), game) && player.chooseUse(Outcome.Detriment, message, source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), player.getId(), false, null)) { if (!game.isSimulation()) { game.informPlayers(player.getLogName() + " pays the cost to prevent the effect"); } doEffect = false; break; } } } if (doEffect) { for (Effect effect : executingEffects) { effect.setTargetPointer(this.targetPointer); if (effect instanceof OneShotEffect) { result &= effect.apply(game, source); } else { game.addEffect((ContinuousEffect) effect, source); } } } return result; } return false; }

Target:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && sourceObject != null) { String message; if (chooseUseText == null) { String effectText = executingEffects.getText(source.getModes().getMode()); message = "Pay " + cost.getText() + " to prevent (" + effectText.substring(0, effectText.length() - 1) + ")?"; } else { message = chooseUseText; } message = CardUtil.replaceSourceName(message, sourceObject.getName()); boolean result = true; boolean doEffect = true; for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null && player != controller && cost.canPay(source, source.getSourceId(), player.getId(), game) && player.chooseUse(Outcome.Detriment, message, source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), player.getId(), false, null)) { if (!game.isSimulation()) { game.informPlayers(player.getLogName() + " pays the cost to prevent the effect"); } doEffect = false; } } } if (doEffect) { for (Effect effect : executingEffects) { effect.setTargetPointer(this.targetPointer); if (effect instanceof OneShotEffect) { result &= effect.apply(game, source); } else { game.addEffect((ContinuousEffect) effect, source); } } } return result; } return false; }
Source:
private void showWarningNotification(String code, String message) { if(message == null) message = ""; getApplication().getMainWindow().showNotification(getLocalizedMessage(code) + message, Window.Notification.TYPE_WARNING_MESSAGE); }

Target:
private void showWarningNotification(String code, String message) { getApplication().getMainWindow().showNotification(getLocalizedMessage(code) + nvl(message), Window.Notification.TYPE_WARNING_MESSAGE); }
Source:
protected void testExecute_asInstructorWithCourseId_shouldReturnAllSessionsForCourse() { InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); loginAsInstructor(instructor1OfCourse1.googleId); String[] submissionParam = { Const.ParamsNames.COURSE_ID, instructor1OfCourse1.getCourseId(), }; GetFeedbackSessionsAction a = getAction(submissionParam); FeedbackSessionsData fsData = (FeedbackSessionsData) getJsonResult(a).getOutput(); assertEquals(6, fsData.getFeedbackSessions().size()); }

Target:
protected void testExecute_asInstructorWithCourseId_shouldReturnAllSessionsForCourse() { InstructorAttributes instructor2OfCourse1 = typicalBundle.instructors.get("instructor2OfCourse1"); loginAsInstructor(instructor2OfCourse1.googleId); String[] submissionParam = { Const.ParamsNames.COURSE_ID, instructor2OfCourse1.getCourseId(), Const.ParamsNames.ENTITY_TYPE, Const.EntityType.INSTRUCTOR, }; GetFeedbackSessionsAction action = getAction(submissionParam); FeedbackSessionsData fsData = (FeedbackSessionsData) getJsonResult(action).getOutput(); assertEquals(5, fsData.getFeedbackSessions().size()); assertAllInstructorSessionsMatch(fsData, sessionsInCourse1); }
Source:
public void endVisit(UnaryExpression x, BlockScope b) { int operator = ((x.bits & ASTNode.OperatorMASK) >> ASTNode.OperatorSHIFT); if (operator == OperatorIds.PLUS && !(x.expression instanceof Literal)) { foundUnaryPos = true; Constant outer = x.constant; Constant inner = x.expression.constant; boolean hasEcjUnaryPosBug = !outer.equals(inner); assert hasEcjUnaryPosBug; } }

Target:
public void endVisit(UnaryExpression x, BlockScope b) { int operator = ((x.bits & ASTNode.OperatorMASK) >> ASTNode.OperatorSHIFT); if (operator == OperatorIds.PLUS && !(x.expression instanceof Literal)) { hasEcjUnaryPosBug = true; Constant outer = x.constant; Constant inner = x.expression.constant; boolean hasEcjUnaryPosBug = !outer.equals(inner); assert hasEcjUnaryPosBug; } }
Source:
public static void setBaseExtensionFields(DomainResource fhirResource, BaseOpenmrsMetadata openmrsMetadata) { fhirResource.addExtension(createDateCreatedExtension(openmrsMetadata.getDateCreated())); fhirResource.addExtension(createCreatorExtension(openmrsMetadata.getCreator())); if (openmrsMetadata.getDateChanged() != null) { fhirResource.addExtension(createDateChangedExtension(openmrsMetadata.getDateChanged())); fhirResource.addExtension(createChangedByExtension(openmrsMetadata.getChangedBy())); } if (openmrsMetadata.getRetired()) { fhirResource.addExtension(createRetiredExtension(openmrsMetadata.getRetired())); fhirResource.addExtension(createDateRetiredExtension(openmrsMetadata.getDateRetired())); fhirResource.addExtension(createRetiredByExtension(openmrsMetadata.getRetiredBy())); fhirResource.addExtension(createRetireReasonExtension(openmrsMetadata.getRetireReason())); } }

Target:
public static void setBaseExtensionFields(DomainResource fhirResource, BaseOpenmrsMetadata openmrsMetadata) { fhirResource.addExtension(ExtensionsUtil.createDateCreatedExtension(openmrsMetadata.getDateCreated())); fhirResource.addExtension(ExtensionsUtil.createCreatorExtension(openmrsMetadata.getCreator())); if (openmrsMetadata.getDateChanged() != null) { fhirResource.addExtension(ExtensionsUtil.createDateChangedExtension(openmrsMetadata.getDateChanged())); fhirResource.addExtension(ExtensionsUtil.createChangedByExtension(openmrsMetadata.getChangedBy())); } if (openmrsMetadata.getRetired()) { fhirResource.addExtension(ExtensionsUtil.createRetiredExtension(openmrsMetadata.getRetired())); fhirResource.addExtension(ExtensionsUtil.createDateRetiredExtension(openmrsMetadata.getDateRetired())); fhirResource.addExtension(ExtensionsUtil.createRetiredByExtension(openmrsMetadata.getRetiredBy())); fhirResource.addExtension(ExtensionsUtil.createRetireReasonExtension(openmrsMetadata.getRetireReason())); } }