auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void generateVisitMethodBody(BaseNodeMetaModel node, MethodDeclaration visitMethod, List<PropertyMetaModel> propertyMetaModels, CompilationUnit compilationUnit) { BlockStmt body = visitMethod.getBody().get(); body.getStatements().clear(); if (propertyMetaModels.isEmpty()) { body.addStatement(parseStatement("return 0;")); } else { String bodyBuilder = "return"; String prefix = ""; for (PropertyMetaModel field : propertyMetaModels) { final String getter = field.getGetterMethodName() + "()"; if (field.getNodeReference().isPresent()) { if (field.isOptional()) { bodyBuilder += f("%s (n.%s.isPresent()? n.%s.get().accept(this, arg):0)", prefix, getter, getter); } else { bodyBuilder += f("%s (n.%s.accept(this, arg))", prefix, getter); } } else { Class<?> type = field.getType(); if (type.equals(boolean.class)) { bodyBuilder += f("%s (n.%s?1:0)", prefix, getter); } else if (type.equals(int.class)) { bodyBuilder += f("%s n.%s", prefix, getter); } else { bodyBuilder += f("%s (n.%s.hashCode())", prefix, getter); } } prefix = "* 31 +"; } Statement returnStatement = parseStatement(bodyBuilder + ";"); body.addStatement(returnStatement); } }

Target:
protected void generateVisitMethodBody(BaseNodeMetaModel node, MethodDeclaration visitMethod, List<PropertyMetaModel> propertyMetaModels, CompilationUnit compilationUnit) { BlockStmt body = visitMethod.getBody().get(); body.getStatements().clear(); SeparatedItemStringBuilder builder = new SeparatedItemStringBuilder("return ", "* 31 +", ";"); if (propertyMetaModels.isEmpty()) { builder.append("0"); } else { for (PropertyMetaModel field : propertyMetaModels) { final String getter = field.getGetterMethodName() + "()"; if (field.getNodeReference().isPresent()) { if (field.isOptional()) { builder.append("(n.%s.isPresent()? n.%s.get().accept(this, arg):0)", getter, getter); } else { builder.append("(n.%s.accept(this, arg))", getter); } } else { Class<?> type = field.getType(); if (type.equals(boolean.class)) { builder.append("(n.%s?1:0)", getter); } else if (type.equals(int.class)) { builder.append("n.%s", getter); } else { builder.append("(n.%s.hashCode())", getter); } } } } body.addStatement(parseStatement(builder.toString())); }
Source:
public GraphicsConsoles list() { VM vm = getEntity(VM.class, VdcQueryType.GetVmByVmId, new IdQueryParameters(guid), guid.toString(), true); return VmMapper.map(vm, new GraphicsConsoles()); }

Target:
public GraphicsConsoles list() { VM vm = getEntity(VM.class, VdcQueryType.GetVmByVmId, new IdQueryParameters(guid), guid.toString(), true); GraphicsConsoles consoles = new GraphicsConsoles(); for (Map.Entry<GraphicsType, GraphicsInfo> graphicsInfo : vm.getGraphicsInfos().entrySet()) { consoles.getGraphicsConsoles().add(addLinks(populate(VmMapper.map(graphicsInfo, null), vm))); } return consoles; }
Source:
private static void navigate(final Activity activity, final String destName, final String destCode, final Geopoint coords) { Intent launchIntent = new Intent(INTENT_ACTION); launchIntent.putExtra(Intents.EXTRA_NAME, destName); launchIntent.putExtra(Intents.EXTRA_GEOCODE, destCode); launchIntent.putExtra(Intents.EXTRA_LATITUDE, coords.getLatitude()); launchIntent.putExtra(Intents.EXTRA_LONGITUDE, coords.getLongitude()); activity.startService(launchIntent); }

Target:
private static void navigate(final Activity activity, final String destName, final String destCode, final Geopoint coords) { final Intent launchIntent = new Intent(INTENT_ACTION); launchIntent.putExtra(Intents.EXTRA_NAME, destName) .putExtra(Intents.EXTRA_GEOCODE, destCode) .putExtra(Intents.EXTRA_LATITUDE, coords.getLatitude()) .putExtra(Intents.EXTRA_LONGITUDE, coords.getLongitude()); activity.startService(launchIntent); }
Source:
public void startScript(@PathVariable("name") String scriptName, @RequestParam Map<String, Object> parameters, HttpServletResponse response) throws IOException, URISyntaxException { ScriptJobExecution scriptJobExecution = scriptJobExecutionFactory.create(); scriptJobExecution.setName(scriptName); scriptJobExecution.setParameters(gson.toJson(parameters)); scriptJobExecution.setUser(userAccountService.getCurrentUser().getUsername()); dataService.add(scriptJobExecution.getEntityType().getId(), scriptJobExecution); executorService.submit(() -> jobExecutor.execute(scriptJobExecution)); String jobHref = concatEntityHref("/api/v2", scriptJobExecution.getEntityType().getId(), scriptJobExecution.getIdValue()); String jobControllerURL = menuReaderService.getMenu().findMenuItemPath(JobsController.ID); response.sendRedirect(format("{0}/viewJob/?jobHref={1}&refreshTimeoutMillis=1000", jobControllerURL, jobHref)); }

Target:
public void startScript(@PathVariable("name") String scriptName, @RequestParam Map<String, Object> parameters, HttpServletResponse response) throws IOException { ScriptJobExecution scriptJobExecution = scriptJobExecutionFactory.create(); scriptJobExecution.setName(scriptName); scriptJobExecution.setParameters(gson.toJson(parameters)); scriptJobExecution.setUser(userAccountService.getCurrentUser().getUsername()); jobExecutor.submit(scriptJobExecution); response.sendRedirect(jobsController.createJobExecutionViewHref(scriptJobExecution, 1000)); }
Source:
public void withClientRequests() throws Throwable { try (Cluster ignored = init(Cluster.create(3, config -> config.with(GOSSIP, NETWORK, NATIVE_PROTOCOL)))) { final com.datastax.driver.core.Cluster cluster = com.datastax.driver.core.Cluster.builder().addContactPoint("127.0.0.1").build(); Session session = cluster.connect(); session.execute("CREATE TABLE " + KEYSPACE + ".tbl (pk int, ck int, v int, PRIMARY KEY (pk, ck));"); session.execute("INSERT INTO " + KEYSPACE + ".tbl (pk, ck, v) values (1,1,1);"); Statement select = new SimpleStatement("select * from " + KEYSPACE + ".tbl;").setConsistencyLevel(ConsistencyLevel.ALL); final ResultSet resultSet = session.execute(select); Iterator<Object[]> rows = RowUtil.toObjects(resultSet); assertRows(rows, row(1, 1, 1)); Assert.assertEquals(3, cluster.getMetadata().getAllHosts().size()); session.close(); cluster.close(); } }

Target:
public void withClientRequests() throws Throwable { try (Cluster ignored = init(Cluster.create(3, config -> config.with(GOSSIP, NETWORK, NATIVE_PROTOCOL)))) { final com.datastax.driver.core.Cluster cluster = com.datastax.driver.core.Cluster.builder().addContactPoint("127.0.0.1").build(); Session session = cluster.connect(); session.execute("CREATE TABLE " + KEYSPACE + ".tbl (pk int, ck int, v int, PRIMARY KEY (pk, ck));"); session.execute("INSERT INTO " + KEYSPACE + ".tbl (pk, ck, v) values (1,1,1);"); Statement select = new SimpleStatement("select * from " + KEYSPACE + ".tbl;").setConsistencyLevel(ConsistencyLevel.ALL); final ResultSet resultSet = session.execute(select); assertRows(resultSet, row(1, 1, 1)); Assert.assertEquals(3, cluster.getMetadata().getAllHosts().size()); session.close(); cluster.close(); } }
Source:
public static void main(String[] args) { if (args.length != 0) { System.err.println("Usage: java -Dconfig=<secor_properties> " + "-Dlog4j.configuration=<log4j_properties> ConsumerMain"); return; } try { SecorConfig config = SecorConfig.load(); if (!config.getUploadOnShutdown()) { Runtime.getRuntime().addShutdownHook(new Thread(new StagingCleaner(config.getLocalPath()))); } OstrichAdminService ostrichService = new OstrichAdminService(config.getOstrichPort()); ostrichService.start(); FileUtil.configure(config); LogFileDeleter logFileDeleter = new LogFileDeleter(config); logFileDeleter.deleteOldLogs(); RateLimitUtil.configure(config); LOG.info("starting consumer threads", config.getConsumerThreads()); LinkedList<Consumer> consumers = new LinkedList<Consumer>(); for (int i = 0; i < config.getConsumerThreads(); ++i) { Consumer consumer = new Consumer(config); consumers.add(consumer); consumer.start(); } for (Consumer consumer : consumers) { consumer.join(); } } catch (Throwable t) { LOG.error("Consumer failed", t); System.exit(1); } }

Target:
public static void main(String[] args) { if (args.length != 0) { System.err.println("Usage: java -Dconfig=<secor_properties> " + "-Dlog4j.configuration=<log4j_properties> ConsumerMain"); return; } try { SecorConfig config = SecorConfig.load(); String stagingDirectoryPath = config.getLocalPath() + '/' + IdUtil.getLocalMessageDir(); ShutdownHookRegistry.registerHook(10, new StagingDirectoryCleaner(stagingDirectoryPath)); OstrichAdminService ostrichService = new OstrichAdminService(config.getOstrichPort()); ostrichService.start(); FileUtil.configure(config); LogFileDeleter logFileDeleter = new LogFileDeleter(config); logFileDeleter.deleteOldLogs(); RateLimitUtil.configure(config); LOG.info("starting consumer threads", config.getConsumerThreads()); LinkedList<Consumer> consumers = new LinkedList<Consumer>(); for (int i = 0; i < config.getConsumerThreads(); ++i) { Consumer consumer = new Consumer(config); consumers.add(consumer); consumer.start(); } for (Consumer consumer : consumers) { consumer.join(); } } catch (Throwable t) { LOG.error("Consumer failed", t); System.exit(1); } }
Source:
public Migration update(Long id, MigrationDefinition definition) throws MigrationNotFoundException, ReScheduleException, InvalidMigrationException { validateDefinition(definition); Migration migration = get(id); if (migration == null) { return null; } if (!ExecutionStatus.SCHEDULED.equals(migration.getStatus())) { throw new ReScheduleException("The migration is not scheduled and cannot be re-scheduled"); } if (ExecutionType.SYNC.equals(definition.getExecution().getType())) { throw new ReScheduleException("The migration execution type MUST be ASYNC"); } migration.setDefinition(definition); em.persist(migration); schedulerService.reScheduleMigration(migration); return migration; }

Target:
public Migration update(Long id, MigrationDefinition definition) throws MigrationNotFoundException, ReScheduleException, InvalidMigrationException { validateDefinition(definition); Migration migration = get(id); if (!ExecutionStatus.SCHEDULED.equals(migration.getStatus())) { throw new ReScheduleException("The migration is not scheduled and cannot be re-scheduled"); } if (ExecutionType.SYNC.equals(definition.getExecution().getType())) { throw new ReScheduleException("The migration execution type MUST be ASYNC"); } migration.setDefinition(definition); txHelper.withTransaction(() -> em.persist(migration)); schedulerService.reScheduleMigration(migration); return migration; }
Source:
private void tracker$enterPhaseOnDeath(final LivingEntity livingEntity) { if (!this.world.isRemote) { try (final CauseStackManager.StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame(); final PhaseContext<?> context = EntityPhase.State.DEATH_UPDATE.createPhaseContext(PhaseTracker.SERVER).source(livingEntity)) { context.buildAndSwitch(); frame.pushCause(this); this.shadow$onDeathUpdate(); } } else { this.shadow$onDeathUpdate(); } }

Target:
private void tracker$enterPhaseOnDeath(final LivingEntity livingEntity) { if (!((WorldBridge) this.world).bridge$isFake()) { try (final CauseStackManager.StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame(); final PhaseContext<?> context = EntityPhase.State.DEATH_UPDATE.createPhaseContext(PhaseTracker.SERVER).source(livingEntity)) { context.buildAndSwitch(); frame.pushCause(this); this.shadow$onDeathUpdate(); } } else { this.shadow$onDeathUpdate(); } }
Source:
public void setRemotePlayersHeldItemMountPointTranslations(@CommandParam("x") float x, @CommandParam("y") float y, @CommandParam("z") float z) { for (EntityRef remotePlayer : entityManager.getEntitiesWith(RemotePersonHeldItemMountPointComponent.class)) { RemotePersonHeldItemMountPointComponent remoteMountPointComponent = remotePlayer.getComponent(RemotePersonHeldItemMountPointComponent.class); if (remoteMountPointComponent != null) { remoteMountPointComponent.translate.set(x, y, z); } } }

Target:
public void setRemotePlayersHeldItemMountPointTranslations(@CommandParam("x") float x, @CommandParam("y") float y, @CommandParam("z") float z) { for (EntityRef remotePlayer : entityManager.getEntitiesWith(RemotePersonHeldItemMountPointComponent.class)) { RemotePersonHeldItemMountPointComponent remoteMountPointComponent = remotePlayer.getComponent(RemotePersonHeldItemMountPointComponent.class); remoteMountPointComponent.translate.set(x, y, z); } }
Source:
private void finalizeConsumer() { RabbitUtils.setPhysicalCloseRequired(true); RabbitUtils.closeChannel(getChannel()); if (!(getChannel() instanceof ChannelProxy)) { RabbitUtils.isPhysicalCloseRequired(); } RabbitUtils.closeConnection(this.connection); DirectMessageListenerContainer.this.cancellationLock.release(this); consumerRemoved(this); }

Target:
private void finalizeConsumer() { RabbitUtils.setPhysicalCloseRequired(getChannel(), true); RabbitUtils.closeChannel(getChannel()); RabbitUtils.closeConnection(this.connection); DirectMessageListenerContainer.this.cancellationLock.release(this); consumerRemoved(this); }
Source:
public void edit(final ImportExportRepoImageBaseModel model) { driver.edit(model); importAsTemplateEditor.setVisible(model.isImportModel()); clusterEditor.setVisible(model.isImportModel()); templateNameEditor.setVisible(model.isImportModel()); model.getPropertyChangedEvent().addListener(new IEventListener<PropertyChangedEventArgs>() { @Override public void eventRaised(Event<? extends PropertyChangedEventArgs> ev, Object sender, PropertyChangedEventArgs args) { if ("ImportExportEntities".equals(args.propertyName) && model.getEntities() != null) { imageList.setRowData(model.getEntities()); } } }); initTable(model); }

Target:
public void edit(final ImportExportRepoImageBaseModel model) { driver.edit(model); importAsTemplateEditor.setVisible(model.isImportModel()); clusterEditor.setVisible(model.isImportModel()); model.getPropertyChangedEvent().addListener(new IEventListener<PropertyChangedEventArgs>() { @Override public void eventRaised(Event<? extends PropertyChangedEventArgs> ev, Object sender, PropertyChangedEventArgs args) { if ("ImportExportEntities".equals(args.propertyName) && model.getEntities() != null) { imageList.setRowData(model.getEntities()); } } }); initTable(model); }
Source:
public void testDescribeTable() { MaterializedResult actualColumns = this.computeActual("DESC orders").toTestTypes(); MaterializedResult.Builder builder = MaterializedResult.resultBuilder(this.getQueryRunner().getDefaultSession(), VarcharType.VARCHAR, VarcharType.VARCHAR, VarcharType.VARCHAR, VarcharType.VARCHAR); for (MaterializedRow row : actualColumns.getMaterializedRows()) { builder.row(row.getField(0), row.getField(1), "", ""); } MaterializedResult filteredActual = builder.build(); builder = MaterializedResult.resultBuilder(this.getQueryRunner().getDefaultSession(), VarcharType.VARCHAR, VarcharType.VARCHAR, VarcharType.VARCHAR, VarcharType.VARCHAR); MaterializedResult expectedColumns = builder .row("orderkey", "bigint", "", "") .row("custkey", "bigint", "", "") .row("orderstatus", "varchar", "", "") .row("totalprice", "double", "", "") .row("orderdate", "varchar", "", "") .row("orderpriority", "varchar", "", "") .row("clerk", "varchar", "", "") .row("shippriority", "bigint", "", "") .row("comment", "varchar", "", "").build(); assertEquals(filteredActual, expectedColumns, String.format("%s != %s", filteredActual, expectedColumns)); }

Target:
public void testDescribeTable() { MaterializedResult actualColumns = this.computeActual("DESC orders").toTestTypes(); MaterializedResult.Builder builder = resultBuilder(this.getQueryRunner().getDefaultSession(), VARCHAR, VARCHAR, VARCHAR, VARCHAR); for (MaterializedRow row : actualColumns.getMaterializedRows()) { builder.row(row.getField(0), row.getField(1), "", ""); } MaterializedResult filteredActual = builder.build(); builder = resultBuilder(this.getQueryRunner().getDefaultSession(), VARCHAR, VARCHAR, VARCHAR, VARCHAR); MaterializedResult expectedColumns = builder .row("orderkey", "bigint", "", "") .row("custkey", "bigint", "", "") .row("orderstatus", "varchar", "", "") .row("totalprice", "double", "", "") .row("orderdate", "varchar", "", "") .row("orderpriority", "varchar", "", "") .row("clerk", "varchar", "", "") .row("shippriority", "bigint", "", "") .row("comment", "varchar", "", "").build(); assertEquals(filteredActual, expectedColumns, String.format("%s != %s", filteredActual, expectedColumns)); }
Source:
public static boolean getDeviceListWithoutStatusSupported(Version version) { return supportedInConfig(ConfigValues.NetworkExclusivenessPermissiveValidation, version); }

Target:
public static boolean getDeviceListWithoutStatusSupported(Version version) { return supportedInConfig(ConfigValues.getDeviceListWithoutStatusSupported, version); }
Source:
public void testNotExistsColumn() throws Exception { String inputFile = createParquetFile(); String outputFile = getParquetFileName(); String cargs[] = {inputFile, outputFile, "no_exist"}; executeCommandLine(cargs); }

Target:
public void testNotExistsColumn() throws Exception { String inputFile = createParquetFile("input"); String outputFile = createTempFile("output"); String cargs[] = {inputFile, outputFile, "no_exist"}; executeCommandLine(cargs); }
Source:
public MessageBatch createBatch(Subscription subscription) { try { ByteBuffer buffer = bufferPool.allocate(subscription.getBatchSubscriptionPolicy().getBatchVolume()); switch (subscription.getContentType()) { case JSON: return new JsonMessageBatch(randomUUID().toString(), buffer, subscription, clock); case AVRO: default: throw new UnsupportedOperationException(format("Batching is not supported yet for contentType=%s", subscription.getContentType())); } } catch (InterruptedException e) { throw new InternalProcessingException(e); } }

Target:
public MessageBatch createBatch(Subscription subscription) { try { ByteBuffer buffer = bufferPool.allocate(subscription.getBatchSubscriptionPolicy().getBatchVolume()); switch (subscription.getContentType()) { case JSON: return new JsonMessageBatch(randomUUID().toString(), buffer, subscription, clock); case AVRO: default: throw new UnsupportedOperationException("Batching is not supported yet for contentType " + subscription.getContentType()); } } catch (InterruptedException e) { throw new InternalProcessingException(e); } }
Source:
private String getAbbreviation(String name, String token) { StringBuilder abbrev = new StringBuilder(); for (String t : name.split(token)) { abbrev.append(t.substring(0, 1).toUpperCase()); } return abbrev.toString(); }

Target:
private static String getAbbreviation(String name, String token) { StringBuilder abbrev = new StringBuilder(); if (name != null) { for (String t : name.split(token)) { abbrev.append(t.substring(0, 1).toUpperCase()); } } return abbrev.toString(); }
Source:
public static Object sendImportRequisitionEvent(EventForwarder eventForwarder, String type, List<String> parameters, String rescanExisting) { EventBuilder eventBuilder = new EventBuilder(EventConstants.RELOAD_IMPORT_UEI, EVENT_SOURCE); if((!Strings.isNullOrEmpty(type)) && !parameters.isEmpty()) { String url = String.format("requisition://%s?%s", type, String.join("&", parameters)); eventBuilder.addParam(EventConstants.PARM_URL, url); if (!Strings.isNullOrEmpty(rescanExisting)) { List<String> validValues = Arrays.asList("yes", "dbonly", "no"); if(validValues.contains(rescanExisting)) { eventBuilder.addParam(EventConstants.PARM_IMPORT_RESCAN_EXISTING, rescanExisting); } else { System.out.printf("Not a valid rescanExisting value, valid values are : 'yes', 'no', 'dbonly'\n"); return null; } } eventForwarder.sendNow(eventBuilder.getEvent()); System.out.printf("Requisition import triggered asynchronously for URL : %s\n", url); } else { System.out.printf("No valid requisition parameters specified\n"); } return null; }

Target:
public static Object sendImportRequisitionEvent(EventForwarder eventForwarder, String type, List<String> parameters, String rescanExisting) throws URISyntaxException { EventBuilder eventBuilder = new EventBuilder(EventConstants.RELOAD_IMPORT_UEI, EVENT_SOURCE); if((!Strings.isNullOrEmpty(type)) && !parameters.isEmpty()) { URIBuilder builder = new URIBuilder().setScheme(URI_SCHEME).setHost(type); parse(parameters, builder); String url = builder.build().toString(); eventBuilder.addParam(EventConstants.PARM_URL, url); if (!Strings.isNullOrEmpty(rescanExisting)) { List<String> validValues = Arrays.asList("yes", "dbonly", "no"); if(validValues.contains(rescanExisting)) { eventBuilder.addParam(EventConstants.PARM_IMPORT_RESCAN_EXISTING, rescanExisting); } else { System.out.printf("Not a valid rescanExisting value, valid values are : %s \n", validValues); return null; } } eventForwarder.sendNow(eventBuilder.getEvent()); System.out.printf("Requisition import triggered asynchronously for URL : %s\n", url); } else { System.out.printf("No valid requisition parameters specified\n"); } return null; }
Source:
public HColumnDescriptor adapt(String familyName, ColumnFamily columnFamily) { HColumnDescriptor hColumnDescriptor = new HColumnDescriptor(familyName); String gcExpression = columnFamily.getGcExpression(); if (gcExpression != null) { } return hColumnDescriptor; }

Target:
public HColumnDescriptor adapt(String familyName, ColumnFamily columnFamily) { HColumnDescriptor hColumnDescriptor = new HColumnDescriptor(familyName); String gcExpression = columnFamily.getGcExpression(); if (gcExpression != null) { convertGarbageCollectionExpression(gcExpression, hColumnDescriptor); } return hColumnDescriptor; }
Source:
public Object loadObject(EntityProjection projection, Serializable id, RequestScope scope) { if (projection.getFilterExpression() == null || tx.supportsFiltering(projection.getType(), projection.getFilterExpression()) == FeatureSupport.FULL) { return tx.loadObject(projection, id, scope); } else { return super.loadObject(projection, id, scope); } }

Target:
public Object loadObject(EntityProjection projection, Serializable id, RequestScope scope) { if (projection.getFilterExpression() == null || tx.supportsFiltering(projection.getType(), projection.getFilterExpression()) == FeatureSupport.FULL) { return tx.loadObject(projection, id, scope); } else { return DataStoreTransaction.super.loadObject(projection, id, scope); } }
Source:
private String[] toStringArray(Object content){ String[] valueArray = null; if(content instanceof List){ valueArray = from((List<String>)content).toArray(String.class); }else{ valueArray = new String[]{(String)content}; } return valueArray; }

Target:
private String[] toStringArray(Object content){ if(content instanceof List){ return from((List<String>)content).toArray(String.class); } return new String[]{(String)content}; }
Source:
private static P2ResolutionResult singleEnv(Map<TargetEnvironment, P2ResolutionResult> map) { assertEquals(1, map.size()); for (P2ResolutionResult result : map.values()) { return result; } throw new AssertionError("should never happen"); }

Target:
private static P2ResolutionResult singleEnv(Map<TargetEnvironment, P2ResolutionResult> map) { assertEquals(1, map.size()); return map.values().iterator().next(); }
Source:
public List<Idea> findIdeasByTagId(final long tagId) { boolean isAnonymous = SecurityContextHolder.getContext().getAuthentication() instanceof AnonymousAuthenticationToken; final List<Idea> ideas = ideaRepository.findByTagId(tagId); ideas.forEach(idea -> { Hibernate.initialize(idea.getRelatedTags()); if (isAnonymous) { idea.setLiked(isCurrentUserLikedIdea(idea.getId())); } }); return ideas; }

Target:
public List<Idea> findIdeasByTagId(final long tagId) { final List<Idea> ideas = ideaRepository.findByTagId(tagId); ideas.forEach(idea -> { Hibernate.initialize(idea.getRelatedTags()); idea.setLiked(isCurrentUserLikedIdea(idea.getId())); }); return ideas; }
Source:
private StudentProfileAttributes extractProfileData() { StudentProfileAttributes editedProfile = StudentProfileAttributes.builder().build(); editedProfile.googleId = account.googleId; editedProfile.shortName = getRequestParamValue(Const.ParamsNames.STUDENT_SHORT_NAME); editedProfile.email = getRequestParamValue(Const.ParamsNames.STUDENT_PROFILE_EMAIL); editedProfile.institute = getRequestParamValue(Const.ParamsNames.STUDENT_PROFILE_INSTITUTION); editedProfile.nationality = getRequestParamValue(Const.ParamsNames.STUDENT_NATIONALITY); if ("".equals(editedProfile.nationality)) { editedProfile.nationality = getRequestParamValue("existingNationality"); } try { editedProfile.gender = GenderType.valueOf(getRequestParamValue(Const.ParamsNames.STUDENT_GENDER)); } catch (IllegalArgumentException iae) { setStatusForException(iae); } editedProfile.moreInfo = getRequestParamValue(Const.ParamsNames.STUDENT_PROFILE_MOREINFO); editedProfile.pictureKey = ""; preprocessParameters(editedProfile); validatePostParameters(editedProfile); return editedProfile; }

Target:
private StudentProfileAttributes extractProfileData() { StudentProfileAttributes editedProfile = StudentProfileAttributes.builder().build(); editedProfile.googleId = account.googleId; editedProfile.shortName = getRequestParamValue(Const.ParamsNames.STUDENT_SHORT_NAME); editedProfile.email = getRequestParamValue(Const.ParamsNames.STUDENT_PROFILE_EMAIL); editedProfile.institute = getRequestParamValue(Const.ParamsNames.STUDENT_PROFILE_INSTITUTION); editedProfile.nationality = getRequestParamValue(Const.ParamsNames.STUDENT_NATIONALITY); if ("".equals(editedProfile.nationality)) { editedProfile.nationality = getRequestParamValue("existingNationality"); } editedProfile.gender = GenderType.valueOf(getRequestParamValue(Const.ParamsNames.STUDENT_GENDER)); editedProfile.moreInfo = getRequestParamValue(Const.ParamsNames.STUDENT_PROFILE_MOREINFO); editedProfile.pictureKey = ""; preprocessParameters(editedProfile); validatePostParameters(editedProfile); return editedProfile; }
Source:
public void launch() { List<String> commands = Lists.newLinkedList(); if (isPackageInstall()) { commands.add(addSbinPathCommand()); commands.add(sudo(format("ulimit -n %s", getNumberOfOpenFiles()))); commands.add(sudo("service riak start")); } else { commands.add("ulimit -n 65536 || true"); commands.add(format("%s start >/dev/null 2>&1 < /dev/null &", getRiakCmd())); } ScriptHelper launchScript = newScript(LAUNCHING) .body.append(commands); if (!isRiakOnPath()) { addRiakOnPath(launchScript); } launchScript.failOnNonZeroResultCode().execute(); String mainUri = String.format("http://%s:%s/admin", entity.getAttribute(Attributes.HOSTNAME), entity.getAttribute(RiakNode.RIAK_WEB_PORT)); entity.setAttribute(Attributes.MAIN_URI, URI.create(mainUri)); }

Target:
public void launch() { List<String> commands = Lists.newLinkedList(); if (isPackageInstall()) { commands.add(addSbinPathCommand()); commands.add(sudo(format("sh -c \"ulimit -n %s && service riak start\"", maxOpenFiles()))); } else { commands.add("ulimit -n 65536 || true"); commands.add(format("%s start >/dev/null 2>&1 < /dev/null &", getRiakCmd())); } ScriptHelper launchScript = newScript(LAUNCHING) .body.append(commands); if (!isRiakOnPath()) { addRiakOnPath(launchScript); } launchScript.failOnNonZeroResultCode().execute(); String mainUri = String.format("http://%s:%s/admin", entity.getAttribute(Attributes.HOSTNAME), entity.getAttribute(RiakNode.RIAK_WEB_PORT)); entity.setAttribute(Attributes.MAIN_URI, URI.create(mainUri)); }
Source:
private void parseParticleEmitterSlots(JsonValue containerNode, HullConfig.Data configData) { Vector2 builderOrigin = new Vector2(configData.shipBuilderOrigin); for (JsonValue particleEmitterSlotNode : containerNode) { Vector2 position = readVector2(particleEmitterSlotNode, "position", null); position.sub(builderOrigin) .scl(configData.size); String particleName = particleEmitterSlotNode.getString("particleName", null); String trigger = particleEmitterSlotNode.getString("trigger", null); configData.particleEmitters.add(new ParticleEmitter(position, particleName, trigger)); } }

Target:
private void parseParticleEmitterSlots(JsonValue containerNode, HullConfig.Data configData) { Vector2 builderOrigin = new Vector2(configData.shipBuilderOrigin); for (JsonValue particleEmitterSlotNode : containerNode) { Vector2 position = readVector2(particleEmitterSlotNode, "position", null); position.sub(builderOrigin).scl(configData.size); String trigger = particleEmitterSlotNode.getString("trigger", null); float angleOffset = particleEmitterSlotNode.getFloat("angleOffset", 0f); boolean hasLight = particleEmitterSlotNode.getBoolean("hasLight", false); JsonValue particleNode = particleEmitterSlotNode.get("particle"); EffectConfig effectConfig = EffectConfig.load(particleNode, new EffectTypes(), new GameColors()); configData.particleEmitters.add(new DSParticleEmitter(position, trigger, angleOffset, hasLight, effectConfig)); } }
Source:
public boolean removeIncomingChatMarkerMessageListener(ChatMarkersListener listener) { synchronized (incomingListeners) { return incomingListeners.remove(listener); } }

Target:
public boolean removeIncomingChatMarkerMessageListener(ChatMarkersListener listener) { return incomingListeners.remove(listener); }
Source:
public FastForwardReporter(FastForward fastForward, MetricRegistry metricRegistry, ScheduledExecutorService executor, String key, long interval, TimeUnit intervalTimeUnit) { this.fastForward = fastForward; this.metricRegistry = metricRegistry; this.executor = executor; this.key = key; this.interval = interval; this.intervalTimeUnit = intervalTimeUnit; }

Target:
FastForwardReporter(FastForward fastForward, MetricRegistry metricRegistry, ScheduledExecutorService executor, String key, long interval, TimeUnit intervalTimeUnit) { this.fastForward = fastForward; this.metricRegistry = metricRegistry; this.executor = executor; this.key = key; this.interval = interval; this.intervalTimeUnit = intervalTimeUnit; }
Source:
private static void moveClippedBasesToTag(final SAMRecord rec, final int clipFrom) { final byte[] bases = rec.getReadBases(); final byte[] baseQualities = rec.getBaseQualities(); final int readLength = rec.getReadLength(); if(rec.getReadNegativeStrandFlag()) { rec.setAttribute(HARD_CLIPPED_BASES_TAG, StringUtil.bytesToString(Arrays.copyOf(bases, bases.length - clipFrom + 1))); rec.setAttribute(HARD_CLIPPED_BASE_QUALITIES_TAG, SAMUtils.phredToFastq(Arrays.copyOf(baseQualities, baseQualities.length - clipFrom + 1))); } else { rec.setAttribute(HARD_CLIPPED_BASES_TAG, StringUtil.bytesToString(Arrays.copyOfRange(bases, clipFrom - 1, readLength))); rec.setAttribute(HARD_CLIPPED_BASE_QUALITIES_TAG, SAMUtils.phredToFastq(Arrays.copyOfRange(baseQualities,clipFrom - 1, readLength))); } }

Target:
private static void moveClippedBasesToTag(final SAMRecord rec, final int clipFrom) { if (rec.getAttribute(HARD_CLIPPED_BASES_TAG) != null || rec.getAttribute(HARD_CLIPPED_BASE_QUALITIES_TAG) != null) { throw new PicardException("Record " + rec.getReadName() + " already contains tags for restoring hard-clipped bases. This operation will permanently erase information if it proceeds."); } final byte[] bases = rec.getReadBases(); final byte[] baseQualities = rec.getBaseQualities(); final int readLength = rec.getReadLength(); final int clipPositionFrom, clipPositionTo; if (rec.getReadNegativeStrandFlag()) { clipPositionFrom = 0; clipPositionTo = readLength - clipFrom + 1; } else { clipPositionFrom = clipFrom - 1; clipPositionTo = readLength; } String basesToKeepInTag = StringUtil.bytesToString(Arrays.copyOfRange(bases, clipPositionFrom, clipPositionTo)); String qualitiesToKeepInTag = SAMUtils.phredToFastq(Arrays.copyOfRange(baseQualities, clipPositionFrom, clipPositionTo)); if (rec.getReadNegativeStrandFlag()) { basesToKeepInTag = SequenceUtil.reverseComplement(basesToKeepInTag); qualitiesToKeepInTag = new StringBuilder(qualitiesToKeepInTag).reverse().toString(); } rec.setAttribute(HARD_CLIPPED_BASES_TAG, basesToKeepInTag); rec.setAttribute(HARD_CLIPPED_BASE_QUALITIES_TAG, qualitiesToKeepInTag); }
Source:
protected void initializeInternal() throws Exception { if (kubeClient == null) { kubeClient = KubeClientFactory.fromConfiguration(flinkConfig, getIoExecutor()); } podsWatch = kubeClient.watchPodsAndDoCallback( KubernetesUtils.getTaskManagerLabels(clusterId), new PodCallbackHandlerImpl()); recoverWorkerNodesFromPreviousAttempts(); }

Target:
protected void initializeInternal() throws Exception { kubeClientOpt = Optional.of(kubeClientFactory.fromConfiguration(flinkConfig, getIoExecutor())); podsWatchOpt = Optional.of( getKubeClient().watchPodsAndDoCallback( KubernetesUtils.getTaskManagerLabels(clusterId), new PodCallbackHandlerImpl())); recoverWorkerNodesFromPreviousAttempts(); }
Source:
public static DateDatum createDate(Datum datum) { switch (datum.type()) { case INT4: return new DateDatum(datum.asInt4()); case INT8: return new DateDatum(datum.asInt4()); case TEXT: return createDate(datum.asChars()); case DATE: return (DateDatum) datum; default: throw new TajoRuntimeException(Errors.ResultCode.INVALID_CAST, datum.type().toString(), Type.DATE.name()); } }

Target:
public static DateDatum createDate(Datum datum) { switch (datum.type()) { case INT4: return new DateDatum(datum.asInt4()); case INT8: return new DateDatum(datum.asInt4()); case TEXT: return createDate(datum.asChars()); case DATE: return (DateDatum) datum; default: throw new TajoRuntimeException(new InvalidCastException(datum.type(), Type.DATE)); } }
Source:
protected static Map<String,Effector<?>> findEffectors(Class<? extends Entity> clazz, Entity optionalEntity) { try { Map<String,Effector<?>> result = Maps.newLinkedHashMap(); Map<String,Field> sources = Maps.newLinkedHashMap(); for (Field f : clazz.getFields()) { if (Effector.class.isAssignableFrom(f.getType())) { if (!Modifier.isStatic(f.getModifiers())) { LOG.warn("Discouraged use of non-static effector "+f+" defined in " + (optionalEntity!=null ? optionalEntity : clazz)); if (optionalEntity==null) continue; } Effector<?> eff = (Effector<?>) f.get(optionalEntity); Effector<?> overwritten = result.put(eff.getName(), eff); Field source = sources.put(eff.getName(), f); if (overwritten!=null && overwritten != eff) LOG.warn("multiple definitions for effector on {}; preferring from to from {}", new Object[] { eff.getName(), optionalEntity!=null ? optionalEntity : clazz, eff, f, overwritten, source}); } } return result; } catch (IllegalAccessException e) { throw Throwables.propagate(e); } }

Target:
protected static Map<String,Effector<?>> findEffectors(Class<? extends Entity> clazz, Entity optionalEntity) { try { Map<String,Effector<?>> result = Maps.newLinkedHashMap(); Map<String,Field> sources = Maps.newLinkedHashMap(); for (Field f : clazz.getFields()) { if (Effector.class.isAssignableFrom(f.getType())) { if (!Modifier.isStatic(f.getModifiers())) { LOG.warn("Discouraged/deprecated use of non-static effector "+f+" defined in " + (optionalEntity!=null ? optionalEntity : clazz)); if (optionalEntity==null) continue; } Effector<?> eff = (Effector<?>) f.get(optionalEntity); Effector<?> overwritten = result.put(eff.getName(), eff); Field source = sources.put(eff.getName(), f); if (overwritten!=null && overwritten != eff) LOG.warn("multiple definitions for effector on {}; preferring from to from {}", new Object[] { eff.getName(), optionalEntity!=null ? optionalEntity : clazz, eff, f, overwritten, source}); } } return result; } catch (IllegalAccessException e) { throw Throwables.propagate(e); } }
Source:
public Map<String,List<Map<String,String>>> getTserverRecovery() { Map<String,List<Map<String,String>>> jsonObj = new HashMap<String,List<Map<String,String>>>(); List<Map<String,String>> recoveryList = new ArrayList<>(); Map<String,String> recoveryObj = new HashMap<String,String>(); MasterMonitorInfo mmi = Monitor.getMmi(); if (null == mmi) { throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR); } for (TabletServerStatus server : mmi.tServerInfo) { if (server.logSorts != null) { for (RecoveryStatus recovery : server.logSorts) { recoveryObj.put("server", AddressUtil.parseAddress(server.name, false).getHostText()); recoveryObj.put("log", recovery.name); recoveryObj.put("time", Long.toString(recovery.runtime)); recoveryObj.put("copySort", Double.toString(recovery.progress)); recoveryList.add(recoveryObj); } } } jsonObj.put("recoveryList", recoveryList); return jsonObj; }

Target:
public TabletServersRecovery getTserverRecovery() { TabletServersRecovery recoveryList = new TabletServersRecovery(); MasterMonitorInfo mmi = Monitor.getMmi(); if (null == mmi) { throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR); } for (TabletServerStatus server : mmi.tServerInfo) { if (server.logSorts != null) { for (RecoveryStatus recovery : server.logSorts) { String serv = AddressUtil.parseAddress(server.name, false).getHostText(); String log = recovery.name; int time = recovery.runtime; double copySort = recovery.progress; recoveryList.addRecovery(new TabletServerRecoveryInformation(serv, log, time, copySort)); } } } return recoveryList; }
Source:
public List<byte[]> handle(final ResultSet rs) throws SQLException { if (!rs.next()) { return Collections.emptyList(); } final ArrayList<byte[]> data = new ArrayList<>(); do { final byte[] bytes = rs.getBytes(1); data.add(bytes); } while (rs.next()); return data; }

Target:
public List<byte[]> handle(final ResultSet rs) throws SQLException { if (!rs.next()) { return Collections.emptyList(); } final List<byte[]> data = new ArrayList<>(); do { final byte[] bytes = rs.getBytes(1); data.add(bytes); } while (rs.next()); return data; }
Source:
public String BuildJSON() { if (swagger != null) { updateHostAndBasePath(); } else { synchronized (this) { log.info("Initiating Swagger specification creation"); toggleLogs(RestConstants.SWAGGER_LOGS_OFF); try { initSwagger(); addPaths(); addDefaultDefinitions(); } catch (Exception e) { log.error("Error while creating Swagger specification", e); } finally { toggleLogs(RestConstants.SWAGGER_LOGS_ON); log.info("Swagger specification creation complete"); } } } return createJSON(); }

Target:
private void BuildJSON() { synchronized (this) { log.info("Initiating Swagger specification creation"); toggleLogs(RestConstants.SWAGGER_LOGS_OFF); try { initSwagger(); addPaths(); addDefaultDefinitions(); } catch (Exception e) { log.error("Error while creating Swagger specification", e); } finally { toggleLogs(RestConstants.SWAGGER_LOGS_ON); log.info("Swagger specification creation complete"); } } }
Source:
public void send(final Message<?> message) throws Exception { if (message.getHeaders().containsKey("topic")) { final ProducerConfiguration<K, V> producerConfiguration = getTopicConfiguration(message .getHeaders().get("topic", String.class)); if (producerConfiguration != null) { producerConfiguration.send(message); } } else if (producerConfigurations.size() == 1) { producerConfigurations.get( producerConfigurations.keySet().iterator().next()).send( message); } }

Target:
public void send(final Message<?> message) throws Exception { if (message.getHeaders().containsKey("topic")) { final ProducerConfiguration<K, V> producerConfiguration = getTopicConfiguration(message .getHeaders().get("topic", String.class)); if (producerConfiguration != null) { producerConfiguration.send(message); } } else if (producerConfigurations.size() == 1) { producerConfigurations.get(producerConfigurations.keySet().iterator().next()).send(message); } else { throw new IllegalStateException("Could not send messages as there are multiple producer configurations" + "with no topic information found from the message header."); } }
Source:
public long enqueue(ByteBufferMessageSet messages, long fetchOffset) throws InterruptedException { long size = messages.getValidSize(); if (size > 0) { final long oldOffset = fetchedOffset.get(); chunkQueue.put(new FetchedDataChunk(messages, this, fetchOffset)); long newOffset = fetchedOffset.addAndGet(size); logger.debug(format("updated fetchset (origin+size=newOffset) => %d + %d = %d", oldOffset, size, newOffset)); } return size; }

Target:
public long enqueue(ByteBufferMessageSet messages, long fetchOffset) throws InterruptedException { long size = messages.getValidSize(); if (size > 0) { long oldOffset = fetchedOffset.get(); chunkQueue.put(new FetchedDataChunk(messages, this, fetchOffset)); long newOffset = fetchedOffset.addAndGet(size); logger.debug("updated fetchset (origin+size=newOffset) => " + oldOffset + " + " + size + " = " + newOffset); } return size; }
Source:
protected void doSetUp() throws Exception { super.doSetUp(); BackPressureGeneratorProcessingStrategy strategy = new BackPressureGeneratorProcessingStrategy(); flow = createAndRegisterFlow(muleContext, APPLE_FLOW, componentLocator, (ctx, n) -> strategy); async = createAsyncDelegateMessageProcessor(target, flow); async.setSchedulerService(new FixingBackPressureSchedulerService(strategy)); async.start(); }

Target:
protected void doSetUp() throws Exception { super.doSetUp(); BackPressureGeneratorProcessingStrategy strategy = new BackPressureGeneratorProcessingStrategy(); flow = createAndRegisterFlow(muleContext, APPLE_FLOW, componentLocator, (ctx, n) -> strategy); async = createAsyncDelegateMessageProcessor(target, flow); service = new FixingBackPressureSchedulerService(strategy); async.setSchedulerService(service); async.initialise(); async.start(); }
Source:
public FormValidation doCheckEncoding(@QueryParameter String encoding) { if (!StringUtils.isBlank(encoding)) { try { Charset.forName(encoding.trim()); } catch(Exception e) { return FormValidation.error(e, "Unsupported Encoding"); } if(!ParameterizedTriggerUtils.isSupportNonAsciiPropertiesFile()) { return FormValidation.warning("Non-ascii properties files are supported only since Java 1.6."); } } return FormValidation.ok(); }

Target:
public FormValidation doCheckEncoding(@QueryParameter String encoding) { if (!StringUtils.isBlank(encoding)) { try { Charset.forName(encoding.trim()); } catch(UnsupportedCharsetException e) { return FormValidation.error("Unsupported Encoding"); } catch(IllegalCharsetNameException e) { return FormValidation.error("Bad Encoding Name"); } if(!ParameterizedTriggerUtils.isSupportNonAsciiPropertiesFile()) { return FormValidation.warning("Non-ascii properties files are supported only since Java 1.6."); } } return FormValidation.ok(); }
Source:
public static void setNotificationOpenedHandler(NotificationOpenedHandler callback) { notificationOpenedHandler = callback; if (appContext != null) setAppContext(appContext); }

Target:
public static void setNotificationOpenedHandler(NotificationOpenedHandler callback) { notificationOpenedHandler = callback; if (initDone && notificationOpenedHandler != null) fireCallbackForOpenedNotifications(); }
Source:
private Resource locateResource() throws IOException , NullPointerException { Resource[] resources = this.context.getResources(this.ldif); if (null == resources || 0 == resources.length) { throw new IllegalArgumentException("requested resource is not found"); } return Arrays.stream(resources).filter(resource -> !StringUtils.isEmpty(resource.getFilename()) && resource.isFile() && resource.exists() && resource.isReadable() ) .findFirst() .orElseThrow(()->new IllegalArgumentException("Unable to load LDIF :"+this.ldif)); }

Target:
private Resource locateResource() throws IOException, NullPointerException { Resource[] resources = this.context.getResources(this.ldif); if (0 == resources.length) { throw new IllegalArgumentException("requested resource is not found"); } for (Resource resource : resources) { if (!isEmpty(resource.getFilename()) && resource.isFile() && resource.exists() && resource.isReadable()) { return resource; } } throw new IllegalArgumentException("Unable to load LDIF :" + this.ldif); }
Source:
public void poll(long timeout) { final long start = time.milliseconds(); long now = start; long remaining; do { if (coordinatorUnknown()) { log.debug("Broker coordinator is marked unknown. Attempting discovery with a timeout of {}ms", coordinatorDiscoveryTimeoutMs); if (ensureCoordinatorReady(time.timer(coordinatorDiscoveryTimeoutMs))) { log.debug("Broker coordinator is ready"); } else { log.debug("Can not connect to broker coordinator"); if (assignmentSnapshot != null && !assignmentSnapshot.failed()) { log.info("Broker coordinator was unreachable for {}ms. Revoking previous assignment to " + "avoid running tasks while not being a member the group", coordinatorDiscoveryTimeoutMs, assignmentSnapshot); listener.onRevoked(assignmentSnapshot.leader(), assignmentSnapshot.connectors(), assignmentSnapshot.tasks()); assignmentSnapshot.connectors().clear(); assignmentSnapshot.tasks().clear(); assignmentSnapshot.revokedConnectors().clear(); assignmentSnapshot.revokedTasks().clear(); } } now = time.milliseconds(); } if (rejoinNeededOrPending()) { ensureActiveGroup(); now = time.milliseconds(); } pollHeartbeat(now); long elapsed = now - start; remaining = timeout - elapsed; long pollTimeout = Math.min(Math.max(0, remaining), timeToNextHeartbeat(now)); client.poll(time.timer(pollTimeout)); now = time.milliseconds(); elapsed = now - start; remaining = timeout - elapsed; } while (remaining > 0); }

Target:
public void poll(long timeout) { final long start = time.milliseconds(); long now = start; long remaining; do { if (coordinatorUnknown()) { log.debug("Broker coordinator is marked unknown. Attempting discovery with a timeout of {}ms", coordinatorDiscoveryTimeoutMs); if (ensureCoordinatorReady(time.timer(coordinatorDiscoveryTimeoutMs))) { log.debug("Broker coordinator is ready"); } else { log.debug("Can not connect to broker coordinator"); final ExtendedAssignment localAssignmentSnapshot = assignmentSnapshot; if (localAssignmentSnapshot != null && !localAssignmentSnapshot.failed()) { log.info("Broker coordinator was unreachable for {}ms. Revoking previous assignment to " + "avoid running tasks while not being a member the group", coordinatorDiscoveryTimeoutMs, localAssignmentSnapshot); listener.onRevoked(localAssignmentSnapshot.leader(), localAssignmentSnapshot.connectors(), localAssignmentSnapshot.tasks()); assignmentSnapshot = null; } } now = time.milliseconds(); } if (rejoinNeededOrPending()) { ensureActiveGroup(); now = time.milliseconds(); } pollHeartbeat(now); long elapsed = now - start; remaining = timeout - elapsed; long pollTimeout = Math.min(Math.max(0, remaining), timeToNextHeartbeat(now)); client.poll(time.timer(pollTimeout)); now = time.milliseconds(); elapsed = now - start; remaining = timeout - elapsed; } while (remaining > 0); }
Source:
public void verify() { Preconditions.checkNotNull(schema.getDataSchema().getDataSource(), "dataSource"); Preconditions.checkNotNull(schema.getDataSchema().getParser(), "inputRowParser"); Preconditions.checkNotNull(schema.getDataSchema().getParser().getParseSpec(), "parseSpec"); Preconditions.checkNotNull(schema.getDataSchema().getNonNullTimestampSpec(), "timestampSpec"); Preconditions.checkNotNull(schema.getDataSchema().getGranularitySpec(), "granularitySpec"); Preconditions.checkNotNull(pathSpec, "inputSpec"); Preconditions.checkNotNull(schema.getTuningConfig().getWorkingPath(), "workingPath"); Preconditions.checkNotNull(schema.getIOConfig().getSegmentOutputPath(), "segmentOutputPath"); Preconditions.checkNotNull(schema.getTuningConfig().getVersion(), "version"); }

Target:
public void verify() { Preconditions.checkNotNull(schema.getDataSchema().getDataSource(), "dataSource"); Preconditions.checkNotNull(schema.getDataSchema().getParser(), "inputRowParser"); Preconditions.checkNotNull(schema.getDataSchema().getParser().getParseSpec(), "parseSpec"); Preconditions.checkNotNull(schema.getDataSchema().getGranularitySpec(), "granularitySpec"); Preconditions.checkNotNull(pathSpec, "inputSpec"); Preconditions.checkNotNull(schema.getTuningConfig().getWorkingPath(), "workingPath"); Preconditions.checkNotNull(schema.getIOConfig().getSegmentOutputPath(), "segmentOutputPath"); Preconditions.checkNotNull(schema.getTuningConfig().getVersion(), "version"); }