auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void refreshVdsRunTimeInfo() { boolean isVdsUpOrGoingToMaintenance = vds.getStatus() == VDSStatus.Up || vds.getStatus() == VDSStatus.PreparingForMaintenance || vds.getStatus() == VDSStatus.Error || vds.getStatus() == VDSStatus.NonOperational; try { if (isVdsUpOrGoingToMaintenance) { if (vdsManager.isTimeToRefreshStatistics() || vds.getStatus() == VDSStatus.PreparingForMaintenance) { <START> refreshVdsStats(isVdsUpOrGoingToMaintenance); <END> } else { refreshCommitedMemory(isVdsUpOrGoingToMaintenance); postProcessRefresh(); } } else { final AtomicBoolean processHardwareNeededAtomic = new AtomicBoolean(); vdsManager.refreshCapabilities( new RefreshCapabilitiesCallback(isVdsUpOrGoingToMaintenance, processHardwareNeededAtomic), processHardwareNeededAtomic, vds); } } catch (VDSRecoveringException e) { handleVDSRecoveringException(e); } catch (ClassCastException cce) { handleClassCastException(cce); } catch (Throwable t) { log.error("Failure to refresh host '{}' runtime info: {}", vds.getName(), t.getMessage()); log.debug("Exception", t); throw t; } if (isVdsUpOrGoingToMaintenance) { moveVDSToMaintenanceIfNeeded(); } }</code><technical_language>I another call refreshVdsStats false I understand this boolean is here. line 124 for this true - reads if line 124 127 change return false</technical_language>

Target:
public void refreshVdsRunTimeInfo() { boolean isVdsUpOrGoingToMaintenance = vds.getStatus() == VDSStatus.Up || vds.getStatus() == VDSStatus.PreparingForMaintenance || vds.getStatus() == VDSStatus.Error || vds.getStatus() == VDSStatus.NonOperational; try { if (isVdsUpOrGoingToMaintenance) { if (vdsManager.isTimeToRefreshStatistics() || vds.getStatus() == VDSStatus.PreparingForMaintenance) { refreshVdsStats(); } else { refreshCommitedMemory(true); postProcessRefresh(); } } else { final AtomicBoolean processHardwareNeededAtomic = new AtomicBoolean(); vdsManager.refreshCapabilities( new HostMonitoringRefreshCapabilitiesCallback(vds, vdsManager, this, processHardwareNeededAtomic), processHardwareNeededAtomic, vds); } } catch (VDSRecoveringException e) { handleVDSRecoveringException(e); } catch (ClassCastException cce) { handleClassCastException(cce); } catch (Throwable t) { log.error("Failure to refresh host '{}' runtime info: {}", vds.getName(), t.getMessage()); log.debug("Exception", t); throw t; } if (isVdsUpOrGoingToMaintenance) { moveVDSToMaintenanceIfNeeded(); } }
Source:
<code>private static String getOffsetInStandardFormat(int offsetInMillis) { <START> int hours = offsetInMillis / 1000 / 60 / 60; <END> if (hours > 0) { return "+" + hours; } else if (hours == 0) { return "Z"; } else { return "" + hours; } }</code><technical_language>this work for (ridiculous) timezones 30 45 minute offsets form UTC</technical_language>

Target:
public static String getOffsetInStandardFormat(int offsetInMillis) { int hours = offsetInMillis / 1000 / 60 / 60; String offsetStr; if (hours > 0) { offsetStr = "+" + intPad(hours, 2); } else if (hours == 0) { offsetStr = "Z"; } else { offsetStr = "-" + intPad(Math.abs(hours), 2); } int totalMinutes = offsetInMillis / 1000 / 60; int remainderMinutes = Math.abs(totalMinutes) % 60; if (remainderMinutes != 0) { offsetStr += (":" + intPad(remainderMinutes, 2)); } return offsetStr; }
Source:
<code>public boolean hasOpenGraph() { boolean result = false; final WebElement openGraphContainer = getReplyCreatorWrapper() <START> .findElement(By.className("og-container")); <END> if (null != openGraphContainer) { result = null != openGraphContainer.findElement(By.className("og-texts")); } return result; }</code><technical_language>I prefer defining Bys top of class</technical_language>

Target:
public boolean hasOpenGraph() { boolean result = false; final WebElement openGraphContainer = getReplyCreatorWrapper() .findElement(getOpenGraphContainer()); if (null != openGraphContainer) { result = null != openGraphContainer.findElement(getOpenGraphText()); } return result; }
Source:
<code>public void setUp() throws Exception { <START> client = createClient(); <END> }</code><technical_language>need createClient a method a a 1 liner in 1 place</technical_language>

Target:
public void setUp() throws Exception { LauncherFactory factory = mock(LauncherFactory.class); client = spy(new DifferentialClient( DUMMY_DIFF_ID, factory, DUMMY_CONDUIT_TOKEN, DUMMY_ARC_PATH )); }
Source:
<code>public Object fromBody( TypedInput body, Type type ) throws ConversionException { try { if ( StringUtils.equals( body.mimeType(), BYTE_MIME_TYPE ) ) { return IOUtils.toByteArray( body.in() ); } JavaType javaType = objectMapper.getTypeFactory().constructType( type ); InputStream in = body.in(); <START> if ( in.available() == 0 ) { <END> return null; } return objectMapper.readValue( body.in(), javaType ); } catch ( IOException e ) { logger.error( "Unable to deserialize object of type from body with mime-type {}.", type, body.mimeType(), e ); throw new ConversionException( e ); } }</code><technical_language>This is I telling yesterday return objectMapper.readValue(body.in(), javatype); works fine this is 0. I approve of moving this rhizome</technical_language>

Target:
public Object fromBody( TypedInput body, Type type ) throws ConversionException { try ( InputStream in = body.in() ) { if ( StringUtils.equals( body.mimeType(), BYTE_MIME_TYPE ) ) { return IOUtils.toByteArray( in ); } JavaType javaType = objectMapper.getTypeFactory().constructType( type ); return objectMapper.readValue( body.in(), javaType ); } catch ( IOException e ) { logger.error( "Unable to deserialize object of type from body with mime-type {}.", type, body.mimeType(), e ); throw new ConversionException( e ); } }
Source:
<code>public static void main(String[] args) throws Exception { LOG.info("Application started"); File configurationFile; if (args.length == 0) { configurationFile = <START> new File(FileDropZoneMain.class.getClassLoader().getResource("file-drop-zone.properties").getPath()); <END> } else if (args.length == 1) { configurationFile = new File(args[0]); } else { LOG.error("Too many arguments: {}", args.length); return; } PollingServiceManager pollingServiceManager = new PollingServiceManager(configurationFile); try { pollingServiceManager.initManager(); pollingServiceManager.initObservers(); } catch (IOException e) { LOG.error("Error during manager setup: {}", e.getMessage()); return; } LOG.info("Starting monitor"); pollingServiceManager.startMonitor(); Runtime.getRuntime().addShutdownHook(new Thread(new FileDropZoneShutdownTask(pollingServiceManager))); }</code><technical_language>print , some message like, default file "file-drop-zone.properties"</technical_language>

Target:
public static void main(String[] args) throws Exception { File configurationFile; if (args.length == 0) { LOG.info("Application started using default file: \"file-drop-zone.properties\""); configurationFile = new File(FileDropZoneMain.class.getClassLoader().getResource("file-drop-zone.properties").getPath()); } else { LOG.info("Application started using file: {}", args[0]); configurationFile = new File(args[0]); } PollingServiceManager pollingServiceManager = new PollingServiceManager(configurationFile); try { pollingServiceManager.initManager(); pollingServiceManager.initObservers(); } catch (IOException e) { LOG.error("Error during manager setup: {}", e); return; } LOG.info("Starting monitor"); pollingServiceManager.startMonitor(); Runtime.getRuntime().addShutdownHook(new Thread(new FileDropZoneShutdownTask(pollingServiceManager))); }
Source:
<code>public LogTruncationException(Map<TopicPartition, OffsetAndMetadata> divergentOffsets) { <START> super(Utils.transformMap(divergentOffsets, Function.identity(), OffsetAndMetadata::offset), <END> "detected log truncation"); }</code><technical_language>this change? losing epoch information is contained in OffsetAndMetadata. Note this is a public API, remove divergentOffsets a KIP</technical_language>

Target:
public LogTruncationException(Map<TopicPartition, OffsetAndMetadata> divergentOffsets) { super("Detected log truncation with diverging offsets " + divergentOffsets, Utils.transformMap(divergentOffsets, Function.identity(), OffsetAndMetadata::offset)); this.divergentOffsets = Collections.unmodifiableMap(divergentOffsets); }
Source:
<code>public static PageRequest getPageRequest(QueryOptions queryOptions) { int limit = (int) queryOptions.get("limit"); <START> int skip = (int) queryOptions.get("skip"); <END> return getPageRequest(limit, skip); }</code><technical_language>Set default values properties undefined. casts throw exception. For consistency, in <LINK_0></technical_language>

Target:
public static PageRequest getPageRequest(QueryOptions queryOptions) { int limit = (queryOptions.get("limit") == null) ? 10 : (int) queryOptions.get("limit"); int skip = (queryOptions.get("skip") == null) ? 0 : (int) queryOptions.get("skip"); return getPageRequest(limit, skip); }
Source:
<code>public void tailsNonUtf() throws Exception { try ( final StartsDockerDaemon start = new StartsDockerDaemon(Profile.EMPTY) ) { Assume.assumeTrue( "true".equalsIgnoreCase(System.getProperty("run-docker-tests")) ); final PfShell sshd = start.shell(); final String clean = "some output"; new Shell.Plain( new SSH(sshd.host(), sshd.port(), sshd.login(), sshd.key()) ).exec(String.format("echo '%s\u00ea' > /tmp/stdout", clean)); final Talk talk = new Talk.InFile(); final String hash = "a1b5c3e3"; final String key = "id"; talk.modify( new Directives().xpath("/talk") .add("daemon") .attr(key, hash) .add("title").set("tail").up() .add("script").set("empty").up() .add("dir").set("/tmp").up() .add("code").set("-7").up() .add("started").set(new Time().iso()).up() .add("ended").set(new Time().iso()).up().up() .add("shell").attr(key, hash) .add("host").set(sshd.host()).up() .add("port").set(Integer.toString(sshd.port())).up() .add("login").set(sshd.login()).up() .add("key").set(sshd.key()).up().up() ); MatcherAssert.assertThat( IOUtils.toString( new Tail(talk.read(), hash).read(), Charsets.UTF_8 ), <START> Matchers.is(String.format("%sê\n", clean)) <END> ); } }</code><technical_language>@original-brownbear oh, I see, \u00ea</technical_language>

Target:
public void tailsNonUtf() throws Exception { Assume.assumeTrue( "true".equalsIgnoreCase(System.getProperty("run-docker-tests")) ); try ( final StartsDockerDaemon start = new StartsDockerDaemon(Profile.EMPTY) ) { final PfShell sshd = start.shell(); final String clean = "some output"; new Shell.Plain( new SSH(sshd.host(), sshd.port(), sshd.login(), sshd.key()) ).exec(String.format("echo '%s\u00ea' > /tmp/stdout", clean)); final Talk talk = new Talk.InFile(); final String hash = "a1b5c3e3"; final String key = "id"; talk.modify( new Directives().xpath("/talk") .add("daemon") .attr(key, hash) .add("title").set("tail").up() .add("script").set("empty").up() .add("dir").set("/tmp").up() .add("code").set("-7").up() .add("started").set(new Time().iso()).up() .add("ended").set(new Time().iso()).up().up() .add("shell").attr(key, hash) .add("host").set(sshd.host()).up() .add("port").set(Integer.toString(sshd.port())).up() .add("login").set(sshd.login()).up() .add("key").set(sshd.key()).up().up() ); MatcherAssert.assertThat( IOUtils.toString( new Tail(talk.read(), hash).read(), Charsets.UTF_8 ), Matchers.is(String.format("%sê\n", clean)) ); } }
Source:
<code><START> public PollerFlux<CertificateOperation, KeyVaultCertificate> getCertificateOperation(String name) { <END> return new PollerFlux<>(Duration.ofSeconds(1), null, createPollOperation(name), cancelOperation(name), fetchResultOperation(name)); }</code><technical_language>This return NPE</technical_language>

Target:
public PollerFlux<CertificateOperation, KeyVaultCertificate> getCertificateOperation(String name) { return new PollerFlux<>(Duration.ofSeconds(1), (pollingContext) -> Mono.empty(), createPollOperation(name), cancelOperation(name), fetchResultOperation(name)); }
Source:
<code>public List<UsagePriceOverride> getResolvedUsageOverrides(Usage[] usages, List<UsagePriceOverride> usagePriceOverrides) throws CatalogApiException{ List<UsagePriceOverride> resolvedUsageOverrides = new ArrayList<UsagePriceOverride>(); for (final Usage curUsage : usages) { final UsagePriceOverride curOverride = Iterables.tryFind(usagePriceOverrides, new Predicate<UsagePriceOverride>() { @Override public boolean apply(final UsagePriceOverride input) { return input.getName() != null && input.getName().equals(curUsage.getName()); } }).orNull(); if(curOverride != null) { List<TierPriceOverride> tierPriceOverrides = getResolvedTierOverrides(curUsage.getTiers(), curOverride.getTierPriceOverrides()); resolvedUsageOverrides.add(new DefaultUsagePriceOverride(curUsage.getName(), curUsage.getUsageType(),tierPriceOverrides)); } else <START> resolvedUsageOverrides.add(null); <END> } return resolvedUsageOverrides; }</code><technical_language>instead return original overridden entry</technical_language>

Target:
public List<UsagePriceOverride> getResolvedUsageOverrides(Usage[] usages, List<UsagePriceOverride> usagePriceOverrides) throws CatalogApiException{ List<UsagePriceOverride> resolvedUsageOverrides = new ArrayList<UsagePriceOverride>(); for (final Usage curUsage : usages) { final UsagePriceOverride curOverride = Iterables.tryFind(usagePriceOverrides, new Predicate<UsagePriceOverride>() { @Override public boolean apply(final UsagePriceOverride input) { return input.getName() != null && input.getName().equals(curUsage.getName()); } }).orNull(); if(curOverride != null) { List<TierPriceOverride> tierPriceOverrides = getResolvedTierOverrides(curUsage.getTiers(), curOverride.getTierPriceOverrides()); resolvedUsageOverrides.add(new DefaultUsagePriceOverride(curUsage.getName(), curUsage.getUsageType(),tierPriceOverrides)); } else { resolvedUsageOverrides.add(null); } } return resolvedUsageOverrides; }
Source:
<code>private void throwImmutableException() { <START> throw new RuntimeException("PLANNING_USER: " + getEntityId() + " object can not be modified."); <END> }</code><technical_language>Soft suggestion: UnsupportedOperationException more suitable in this context</technical_language>

Target:
private void throwImmutableException() { throw new UnsupportedOperationException("PLANNING_USER: " + getEntityId() + " object can not be modified."); }
Source:
<code>public void testAddedNotificationsContainTagsFromMetadata() { itemRegistry.addRegistryChangeListener(mockListener); prepareMetadata(ITEM_NAME, "hello"); prepareItem(ITEM_NAME); ArgumentCaptor<Item> captor = ArgumentCaptor.forClass(Item.class); verify(mockListener).added(captor.capture()); Item res = captor.getValue(); assertEquals(1, res.getTags().size()); assertEquals("hello", res.getTags().iterator().next()); <START> StringItem item = new StringItem(ITEM_NAME); <END> managedItemProvider.update(item); }</code><technical_language>lines w/o effect test</technical_language>

Target:
public void testAddedNotificationsContainTagsFromMetadata() { itemRegistry.addRegistryChangeListener(mockListener); prepareMetadata(ITEM_NAME, "hello"); prepareItem(ITEM_NAME); ArgumentCaptor<Item> captor = ArgumentCaptor.forClass(Item.class); verify(mockListener).added(captor.capture()); Item res = captor.getValue(); assertEquals(1, res.getTags().size()); assertEquals("hello", res.getTags().iterator().next()); }
Source:
<code>public boolean getTaskGroupSuccess() { boolean childrenTasksSuccess = taskGroupSuccess; for (VdcActionParametersBase childParameters : getImagesParameters()) { <START> childrenTasksSuccess &= childParameters.getTaskGroupSuccess(); <END> } return childrenTasksSuccess; }</code><technical_language>break this loop reached a failed childParameters.getTaskGroupSuccess()</technical_language>

Target:
public boolean getTaskGroupSuccess() { boolean childrenTasksSuccess = taskGroupSuccess; for (VdcActionParametersBase childParameters : getImagesParameters()) { childrenTasksSuccess &= childParameters.getTaskGroupSuccess(); if (!childrenTasksSuccess) { break; } } return childrenTasksSuccess; }
Source:
<code>public void actionPerformed(ActionEvent e) { Enum canOpen = etc.canOpen(); if (canOpen == EditorTopComponent.CanOpenState.SAVE_AND_OPEN) { etc.fileAction().saveFile(); this.setVisible(true); } else if (canOpen == EditorTopComponent.CanOpenState.OPEN) { <START> this.setVisible(true); <END> } }</code><technical_language>switch-case Throw a new Exception for default-case</technical_language>

Target:
public void actionPerformed(ActionEvent e) { FileActions fileAction = new FileActions(); switch (etc.canOpen()) { case SAVE_AND_OPEN: fileAction.saveFile(FileChooserService.DialogType.SAVE); this.setVisible(true); break; case OPEN: this.setVisible(true); break; default: break; } }
Source:
<code>@Test public void multipleNamedArguments() { Map<String, Object> map = new HashMap<>(); map.put("pipe", System.class); map.put("text", "tacos"); CodeBlock block = CodeBlock.builder() <START> .addNamed("$pipe:T.out.println(\"Let's eat some $text:L\");", map) <END> .build(); assertThat(block.toString()).isEqualTo( "java.lang.System.out.println(\"Let's eat some tacos\");"); }</code><technical_language>topic: right pretty dumb do right if embed $L a quoted string. consider fixing</technical_language>

Target:
@Test public void multipleNamedArguments() { Map<String, Object> map = new LinkedHashMap<>(); map.put("pipe", System.class); map.put("text", "tacos"); CodeBlock block = CodeBlock.builder() .addNamed("$pipe:T.out.println(\"Let's eat some $text:L\");", map) .build(); assertThat(block.toString()).isEqualTo( "java.lang.System.out.println(\"Let's eat some tacos\");"); }
Source:
<code>public void setup(OperatorContext context) { <START> mode=context.getValue(context.PROCESSING_MODE); <END> if(mode==ProcessingMode.EXACTLY_ONCE){ throw new RuntimeException("This operator only supports atmost once and atleast once processing modes"); } super.setup(context); }</code><technical_language>context.PROCESSING_MODE => OperatorContext.PROCESSING_MODE (to get rid of "The static field Context.OperatorContext.PROCESSING_MODE accessed in a static way")</technical_language>

Target:
public void setup(OperatorContext context) { mode=context.getValue(OperatorContext.PROCESSING_MODE); if(mode==ProcessingMode.EXACTLY_ONCE){ throw new RuntimeException("This operator only supports atmost once and atleast once processing modes"); } super.setup(context); }
Source:
<code>UmiGraph(final DuplicateSet set, final String umiTag, final String molecularIdentifierTag, final boolean allowMissingUmis, final boolean duplexUmis) { this.umiTag = umiTag; this.molecularIdentifierTag = molecularIdentifierTag; this.allowMissingUmis = allowMissingUmis; this.duplexUmis = duplexUmis; records = set.getRecords(); for (final SAMRecord rec : records) { if (rec.getStringAttribute(umiTag) == null) { if (allowMissingUmis) { rec.setAttribute(umiTag, ""); <START> } else { <END> throw new PicardException("Read " + rec.getReadName() + " does not contain a UMI with the " + umiTag + " attribute."); } } } umiCounts = records.stream().collect(Collectors.groupingBy(p -> duplexUmis ? UmiUtil.getTopStrandNormalizedDuplexUMI(p, umiTag) : p.getStringAttribute(umiTag), counting())); numUmis = umiCounts.size(); umi = new String[numUmis]; duplicateSetID = IntStream.rangeClosed(0, numUmis-1).toArray(); int i = 0; for (final String key : umiCounts.keySet()) { umi[i] = key; i++; } }</code><technical_language>If test for negative case avoid else, negative case results in a throw</technical_language>

Target:
UmiGraph(final DuplicateSet set, final String umiTag, final String molecularIdentifierTag, final boolean allowMissingUmis, final boolean duplexUmis) { this.umiTag = umiTag; this.molecularIdentifierTag = molecularIdentifierTag; this.allowMissingUmis = allowMissingUmis; this.duplexUmis = duplexUmis; records = set.getRecords(); for (final SAMRecord rec : records) { if (rec.getStringAttribute(umiTag) == null) { if (!allowMissingUmis) { throw new PicardException("Read " + rec.getReadName() + " does not contain a UMI with the " + umiTag + " attribute."); } rec.setAttribute(umiTag, ""); } } umiCounts = records.stream().collect(Collectors.groupingBy(p -> UmiUtil.getTopStrandNormalizedUmi(p, umiTag, duplexUmis), counting())); numUmis = umiCounts.size(); umi = new String[numUmis]; duplicateSetID = IntStream.rangeClosed(0, numUmis-1).toArray(); int i = 0; for (final String key : umiCounts.keySet()) { umi[i] = key; i++; } }
Source:
<code>public void migrateOldConfiguration() throws Exception { String url = "<LINK_0>"; <START> String oldConfiguration = "<hudson.plugins.jira.JiraProjectProperty_-DescriptorImpl>\n" <END> + " <sites>\n" + " <hudson.plugins.jira.JiraSite>\n" + " <url>" + url + "</url>\n" + " <useHTTPAuth>false</useHTTPAuth>\n" + " <supportsWikiStyleComment>false</supportsWikiStyleComment>\n" + " <recordScmChanges>false</recordScmChanges>\n" + " <disableChangelogAnnotations>false</disableChangelogAnnotations>\n" + " <updateJiraIssueForAllStatus>false</updateJiraIssueForAllStatus>\n" + " <timeout>10</timeout>\n" + " <readTimeout>30</readTimeout>\n" + " <threadExecutorNumber>10</threadExecutorNumber>\n" + " <dateTimePattern></dateTimePattern>\n" + " <appendChangeTimestamp>false</appendChangeTimestamp>\n" + " </hudson.plugins.jira.JiraSite>\n" + " </sites>\n" + "</hudson.plugins.jira.JiraProjectProperty_-DescriptorImpl>"; XStream xstream = new XStream2(); JiraSite expected = new JiraSite(url); DescriptorImpl instance = (DescriptorImpl)xstream.fromXML(oldConfiguration); assertNotNull(instance); assertNull(instance.sites); JiraSite actual = JiraGlobalConfiguration.get().getSites().get(0); assertEquals(url, actual.getName()); r.assertEqualDataBoundBeans(expected, actual); }</code><technical_language>prefer read xml xml file proper IDE support for</technical_language>

Target:
public void migrateOldConfiguration() throws Exception { String url = "<LINK_0>"; XStream xstream = new XStream2(); JiraSite expected = new JiraSite(url); InputStream resource = getClass().getResourceAsStream("oldJiraProjectProperty.xml"); DescriptorImpl instance = (DescriptorImpl) xstream.fromXML(resource); assertNotNull(instance); assertNull(instance.sites); JiraSite actual = JiraGlobalConfiguration.get().getSites().get(0); assertEquals(url, actual.getName()); r.assertEqualDataBoundBeans(expected, actual); }
Source:
<code><START> public MutableLiveData<String> getTitle() { <END> return mTitle; }</code><technical_language>expose MutableLiveData, LiveData</technical_language>

Target:
public LiveData<String> getTitle() { return mTitle; }
Source:
<code>public int hashCode() { <START> int result = processId.hashCode(); <END> result = 31 * result + processName.hashCode(); return result; }</code><technical_language>again..</technical_language>

Target:
public int hashCode() { int result = processId.hashCode(); result = ~~result; result = 31 * result + processName.hashCode(); result = ~~result; return result; }
Source:
<code>private void create() throws SQLException { if(!validateDatabase(true)) <START> throw new SchemaMigrationException("Target database is not empty, please consider executing with \"migrate\" option"); <END> flyway.migrate(); }</code><technical_language>"Please empty database "migrate" if running a previous version</technical_language>

Target:
private void create() throws SQLException { try (Connection connection = flyway.getDataSource().getConnection()) { if (!isDatabaseEmpty(connection)) throw new SchemaMigrationException("Please use an empty database or use \"migrate\" if you are already running a previous version."); } flyway.migrate(); }
Source:
<code>public Ds3Element( final String name, final String type, final String componentType) { <START> this.name = name; <END> this.type = type; this.componentType = componentType; this.ds3Annotations = null; }</code><technical_language>Generally kinds of constructors end calling other constructor directory, passing in null for param</technical_language>

Target:
public Ds3Element( final String name, final String type, final String componentType) { this(name, type, componentType, null); }
Source:
<code>public static FeedbackSessionAttributes getSoftDeletedSession(String feedbackSessionName, String instructorId) { Map<String, String[]> params = new HashMap<>(); params.put(Const.ParamsNames.ENTITY_TYPE, new String[] { Const.EntityType.INSTRUCTOR }); params.put(Const.ParamsNames.IS_IN_RECYCLE_BIN, new String[] { "true" }); params.put(Const.ParamsNames.USER_ID, new String[] { instructorId }); ResponseBodyAndCode response = executeGetRequest(Const.ResourceURIs.SESSIONS, params); if (response.responseCode == HttpStatus.SC_NOT_FOUND) { return null; } FeedbackSessionsData sessionsData = JsonUtils.fromJson(response.responseBody, FeedbackSessionsData.class); List<FeedbackSessionData> sessionsDataList = sessionsData.getFeedbackSessions(); <START> for (FeedbackSessionData feedbackSession : sessionsDataList) { <END> if (feedbackSession.getFeedbackSessionName().equals(feedbackSessionName)) { return FeedbackSessionAttributes .builder(feedbackSession.getCourseId(), feedbackSession.getFeedbackSessionName()) .build(); } } return null; }</code><technical_language>Minor point: I realise this is a common pattern BackDoor. I personally a fan of sweeping a list find return item inside. happy path is clear :P This is alternate of it: FeedbackSessionData feedbackSession = sessionsData.getFeedbackSessions() .stream() .filter(fs -> fs.getFeedbackSessionName().equals(feedbackSessionName)) .findFirst() .orElse(null); if (feedbackSession == null) { return null; } return FeedbackSessionAttributes .builder(feedbackSession.getCourseId(), feedbackSession.getFeedbackSessionName()) .build();</technical_language>

Target:
public static FeedbackSessionAttributes getSoftDeletedSession(String feedbackSessionName, String instructorId) { Map<String, String[]> params = new HashMap<>(); params.put(Const.ParamsNames.ENTITY_TYPE, new String[] { Const.EntityType.INSTRUCTOR }); params.put(Const.ParamsNames.IS_IN_RECYCLE_BIN, new String[] { "true" }); params.put(Const.ParamsNames.USER_ID, new String[] { instructorId }); ResponseBodyAndCode response = executeGetRequest(Const.ResourceURIs.SESSIONS, params); if (response.responseCode == HttpStatus.SC_NOT_FOUND) { return null; } FeedbackSessionsData sessionsData = JsonUtils.fromJson(response.responseBody, FeedbackSessionsData.class); FeedbackSessionData feedbackSession = sessionsData.getFeedbackSessions() .stream() .filter(fs -> fs.getFeedbackSessionName().equals(feedbackSessionName)) .findFirst() .orElse(null); if (feedbackSession == null) { return null; } return FeedbackSessionAttributes .builder(feedbackSession.getCourseId(), feedbackSession.getFeedbackSessionName()) .build(); }
Source:
<code>public List<StoragePoolVO> findZoneWideStoragePoolsByTags(long dcId, String[] tags) { if (tags == null || tags.length == 0) { QueryBuilder<StoragePoolVO> sc = QueryBuilder.create(StoragePoolVO.class); sc.and(sc.entity().getDataCenterId(), Op.EQ, dcId); sc.and(sc.entity().getStatus(), Op.EQ, Status.Up); sc.and(sc.entity().getScope(), Op.EQ, ScopeType.ZONE); return sc.list(); } else { <START> StringBuilder sql = new StringBuilder(ZoneWideTagsSqlPrefix); <END> for (String tag : tags){ sql.append("(storage_pool_tags.tag='" + tag + "') OR "); } sql.delete(sql.length() - 4, sql.length()); sql.append(ZoneWideTagsSqlSuffix); TransactionLegacy txn = TransactionLegacy.currentTxn(); try (PreparedStatement pstmt = txn.prepareStatement(sql.toString());){ List<StoragePoolVO> pools = new ArrayList<StoragePoolVO>(); if (pstmt != null) { int i = 1; pstmt.setLong(i++, dcId); pstmt.setString(i++, ScopeType.ZONE.toString()); pstmt.setInt(i++, tags.length); try(ResultSet rs = pstmt.executeQuery();) { while (rs.next()) { pools.add(toEntityBean(rs, false)); } }catch (SQLException e) { throw new CloudRuntimeException("findZoneWideStoragePoolsByTags:Exception:" + e.getMessage(), e); } } return pools; } catch (SQLException e) { throw new CloudRuntimeException("findZoneWideStoragePoolsByTags:Exception:" + e.getMessage(), e); } } }</code><technical_language>@nvazquez extracting lines 463-469 a method? Then, create doc of test cases. This is a pretty tricky bit of code (Especially line 468)</technical_language>

Target:
public List<StoragePoolVO> findZoneWideStoragePoolsByTags(long dcId, String[] tags) { if (tags == null || tags.length == 0) { QueryBuilder<StoragePoolVO> sc = QueryBuilder.create(StoragePoolVO.class); sc.and(sc.entity().getDataCenterId(), Op.EQ, dcId); sc.and(sc.entity().getStatus(), Op.EQ, Status.Up); sc.and(sc.entity().getScope(), Op.EQ, ScopeType.ZONE); return sc.list(); } else { String sqlValues = getSqlValuesFromStorageTags(tags); String sql = getSqlPreparedStatement(ZoneWideTagsSqlPrefix, ZoneWideTagsSqlSuffix, sqlValues, null); return searchStoragePoolsPreparedStatement(sql, dcId, null, null, ScopeType.ZONE, tags.length); } }
Source:
<code>private static Type resourceType(Tree resource) { <START> if (resource instanceof VariableTree) { <END> return ((VariableTree) resource).type().symbolType(); } return ((TypeTree) resource).symbolType(); }</code><technical_language>Please resource.is(Tree.Kind.VARIABLE)</technical_language>

Target:
private static Type resourceType(Tree resource) { if (resource.is(Tree.Kind.VARIABLE)) { return ((VariableTree) resource).type().symbolType(); } return ((TypeTree) resource).symbolType(); }
Source:
<code>private void handleRemoveProject(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException { final User user = session.getUser(); final String projectName = getParam(req, "project"); final Project project = this.projectManager.getProject(projectName); if (project == null) { this.setErrorMessageInCookie(resp, "Project " + projectName + " doesn't exist."); resp.sendRedirect(req.getContextPath()); return; } if (!hasPermission(project, user, Type.ADMIN)) { this.setErrorMessageInCookie(resp, "Cannot delete. User '" + user.getUserId() + "' is not an ADMIN."); resp.sendRedirect(req.getRequestURI() + "?project=" + projectName); return; } removeAssociatedSchedules(project); try { this.projectManager.removeProject(project, user); } catch (final ProjectManagerException e) { this.setErrorMessageInCookie(resp, e.getMessage()); resp.sendRedirect(req.getRequestURI() + "?project=" + projectName); return; } finally { try { <START> if (this.enableQuartz) { <END> this.scheduler.unscheduleAll(project); } } catch (final SchedulerException e) { this.setErrorMessageInCookie(resp, e.getMessage()); resp.sendRedirect(req.getRequestURI() + "?project=" + projectName); } } this.setSuccessMessageInCookie(resp, "Project '" + projectName + "' was successfully deleted and associated schedules are removed."); resp.sendRedirect(req.getContextPath()); }</code><technical_language>this move removeProject try catch block? Another question. Do remove normal schedule today removing a project</technical_language>

Target:
private void handleRemoveProject(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException { final User user = session.getUser(); final String projectName = getParam(req, "project"); final Project project = this.projectManager.getProject(projectName); if (project == null) { this.setErrorMessageInCookie(resp, "Project " + projectName + " doesn't exist."); resp.sendRedirect(req.getContextPath()); return; } if (!hasPermission(project, user, Type.ADMIN)) { this.setErrorMessageInCookie(resp, "Cannot delete. User '" + user.getUserId() + "' is not an ADMIN."); resp.sendRedirect(req.getRequestURI() + "?project=" + projectName); return; } removeAssociatedSchedules(project); try { this.projectManager.removeProject(project, user); } catch (final ProjectManagerException e) { this.setErrorMessageInCookie(resp, e.getMessage()); resp.sendRedirect(req.getRequestURI() + "?project=" + projectName); return; } this.setSuccessMessageInCookie(resp, "Project '" + projectName + "' was successfully deleted and associated schedules are removed."); resp.sendRedirect(req.getContextPath()); }
Source:
<code>public void count(final String aspect, final long delta, final String... tags) { <START> send(new StringBuilder(prefix).append(sanitiseAspect(aspect)).append(":").append(delta).append("|c").append(tagString(tags)).toString()); <END> }</code><technical_language>factorize this logic in a function instead of repeating everywhere</technical_language>

Target:
public void count(final String aspect, final long delta, final String... tags) { send(aspect, tags, Long.toString(delta), "|c"); }
Source:
<code>public ConnectorPlanOptimizerProvider getConnectorPlanOptimizerProvider() { return new ConnectorPlanOptimizerProvider() { @Override public Set<ConnectorPlanOptimizer> getLogicalPlanOptimizers() { <START> return ImmutableSet.of(planOptimizer); <END> } @Override public Set<ConnectorPlanOptimizer> getPhysicalPlanOptimizers() { return ImmutableSet.of(); } }; }</code><technical_language>If is filter pushdown, getPhysicalPlanOptimizers is place put optimizer</technical_language>

Target:
public ConnectorPlanOptimizerProvider getConnectorPlanOptimizerProvider() { return new DruidPlanOptimizerProvider(planOptimizer); }
Source:
<code>public Object visit(ASTPrimaryExpression node, Object data) { if (node.jjtGetNumChildren() > 3) { if (!"isEmpty".equals(node.jjtGetChild(node.jjtGetNumChildren() - 2).getImage())) { return data; } Node prevCall = node.jjtGetChild(node.jjtGetNumChildren() - 4); String target = prevCall.jjtGetNumChildren() > 0 ? prevCall.jjtGetChild(0).getImage() : prevCall.getImage(); <START> if (target != null && target.indexOf("trim") != -1) { <END> addViolation(data, node); } } return data; }</code><technical_language>reason for target != null && "trim".equals(target)</technical_language>

Target:
public Object visit(ASTPrimaryExpression node, Object data) { if (node.jjtGetNumChildren() > 3) { if (!"isEmpty".equals(node.jjtGetChild(node.jjtGetNumChildren() - 2).getImage())) { return data; } Node prevCall = node.jjtGetChild(node.jjtGetNumChildren() - 4); String target = prevCall.jjtGetNumChildren() > 0 ? prevCall.jjtGetChild(0).getImage() : prevCall.getImage(); if (target != null && "trim".equals(target) || target.endsWith(".trim")) { addViolation(data, node); } } return data; }
Source:
<code>public boolean equals(Object o) { if (!(o instanceof CollectionKeys)) { return false; } CollectionKeys other = (CollectionKeys) o; <START> return defaultKeyBundle.equals(other.defaultKeyBundle) && <END> CollectionKeys.differences(this, other).isEmpty(); }</code><technical_language>defaultKeyBundle null</technical_language>

Target:
public boolean equals(Object o) { if (!(o instanceof CollectionKeys)) { return false; } CollectionKeys other = (CollectionKeys) o; try { return defaultKeyBundle().equals(other.defaultKeyBundle()) && CollectionKeys.differences(this, other).isEmpty(); } catch (NoCollectionKeysSetException e) { return false; } }
Source:
<code>public void testJobQueueAddingJobsAtSametime() throws InterruptedException { String queueName = TestHelper.getTestMethodName(); JobQueue.Builder builder = TaskTestUtil.buildJobQueue(queueName); WorkflowConfig.Builder workflowCfgBuilder = new WorkflowConfig.Builder().setWorkflowId(queueName).setParallelJobs(1) .setJobPurgeInterval(-1); _driver.start(builder.setWorkflowConfig(workflowCfgBuilder.build()).build()); <START> System.out.println("before add jobs"); <END> JobConfig.Builder jobBuilder = new JobConfig.Builder().setTargetResource(WorkflowGenerator.DEFAULT_TGT_DB) .setCommand(MockTask.TASK_COMMAND).setMaxAttemptsPerTask(2); List<String> jobNames = new ArrayList<>(); List<JobConfig.Builder> jobBuilders = new ArrayList<>(); _driver.waitToStop(queueName, 5000L); for (int i = 0; i < 5; i++) { jobNames.add("JOB" + i); jobBuilders.add(jobBuilder); } _driver.enqueueJobs(queueName, jobNames, jobBuilders); _driver.resume(queueName); System.out.println("before poll to job state"); _driver.pollForJobState(queueName, TaskUtil.getNamespacedJobName(queueName, "JOB" + 4), TaskState.COMPLETED); }</code><technical_language>delete this line</technical_language>

Target:
public void testJobQueueAddingJobsAtSametime() throws InterruptedException { String queueName = TestHelper.getTestMethodName(); JobQueue.Builder builder = TaskTestUtil.buildJobQueue(queueName); WorkflowConfig.Builder workflowCfgBuilder = new WorkflowConfig.Builder().setWorkflowId(queueName).setParallelJobs(1); _driver.start(builder.setWorkflowConfig(workflowCfgBuilder.build()).build()); JobConfig.Builder jobBuilder = new JobConfig.Builder().setTargetResource(WorkflowGenerator.DEFAULT_TGT_DB) .setCommand(MockTask.TASK_COMMAND).setMaxAttemptsPerTask(2); List<String> jobNames = new ArrayList<>(); List<JobConfig.Builder> jobBuilders = new ArrayList<>(); _driver.waitToStop(queueName, 5000L); for (int i = 0; i < 5; i++) { jobNames.add("JOB" + i); jobBuilders.add(jobBuilder); } _driver.enqueueJobs(queueName, jobNames, jobBuilders); _driver.resume(queueName); _driver.pollForJobState(queueName, TaskUtil.getNamespacedJobName(queueName, "JOB" + 4), TaskState.COMPLETED); }
Source:
<code>public BinaryContent transform(Metacard metacard, Map<String, Serializable> arguments) throws CatalogTransformerException { if (metacard == null) { LOGGER.debug("Attempted to transform null metacard"); throw new CatalogTransformerException("Unable to transform null metacard"); } Map<String, String> aliases = (Map<String, String>) arguments.getOrDefault("aliases", new HashMap<>()); String attributeString = (String) arguments.get("columnOrder"); ArrayList<String> attributes = new ArrayList<String>(Arrays.asList((attributeString).split(","))); Appendable appendable = writeMetacardsToCsv( Collections.singletonList(metacard), new ArrayList<AttributeDescriptor>( metacard .getMetacardType() .getAttributeDescriptors() .stream() <START> .filter(attr -> attributes.contains(attr.getName())) <END> .collect(Collectors.toList())), aliases); return createResponse(appendable); }</code><technical_language>Is this transformer else? wondering if avoid filtering if columnOrder arg is passed in</technical_language>

Target:
public BinaryContent transform(Metacard metacard, Map<String, Serializable> arguments) throws CatalogTransformerException { if (metacard == null) { LOGGER.debug("Attempted to transform null metacard"); throw new CatalogTransformerException("Unable to transform null metacard"); } Map<String, String> aliases = (Map<String, String>) arguments.getOrDefault("aliases", new HashMap<>()); String attributeString = arguments.get("columnOrder") != null ? (String) arguments.get("columnOrder") : ""; List<String> attributes = Arrays.asList((attributeString).split(",")); List<AttributeDescriptor> allAttributes = new ArrayList<AttributeDescriptor>(metacard.getMetacardType().getAttributeDescriptors()); List<AttributeDescriptor> descriptors = CollectionUtils.isEmpty(attributes) ? allAttributes : allAttributes .stream() .filter(attr -> attributes.contains(attr.getName())) .collect(Collectors.toList()); Appendable appendable = writeMetacardsToCsv(Collections.singletonList(metacard), descriptors, aliases); return createResponse(appendable); }
Source:
<code>public ConnectableDevice(JSONObject json) { this(); setId(json.optString(KEY_ID, null)); setLastKnownIPAddress(json.optString(KEY_LAST_IP, null)); setFriendlyName(json.optString(KEY_FRIENDLY, null)); setModelName(json.optString(KEY_MODEL_NAME, null)); setModelNumber(json.optString(KEY_MODEL_NUMBER, null)); setLastSeenOnWifi(json.optString(KEY_LAST_SEEN, null)); setLastConnected(json.optLong(KEY_LAST_CONNECTED, 0)); setLastDetection(json.optLong(KEY_LAST_DETECTED, 0)); try { <START> JSONObject jsonServices = json.getJSONObject(KEY_SERVICES); <END> Iterator<?> keys = jsonServices.keys(); if(keys!=null) { while (keys.hasNext()) { String key = (String) keys.next(); if (jsonServices.get(key) instanceof JSONObject) { JSONObject serviceObject = (JSONObject) jsonServices.get(key); DeviceService service = DeviceService.getService(serviceObject); addService(service); } } } } catch (JSONException e) { e.printStackTrace(); } }</code><technical_language>'optJSONObject here, piece of code this</technical_language>

Target:
public ConnectableDevice(JSONObject json) { this(); setId(json.optString(KEY_ID, null)); setLastKnownIPAddress(json.optString(KEY_LAST_IP, null)); setFriendlyName(json.optString(KEY_FRIENDLY, null)); setModelName(json.optString(KEY_MODEL_NAME, null)); setModelNumber(json.optString(KEY_MODEL_NUMBER, null)); setLastSeenOnWifi(json.optString(KEY_LAST_SEEN, null)); setLastConnected(json.optLong(KEY_LAST_CONNECTED, 0)); setLastDetection(json.optLong(KEY_LAST_DETECTED, 0)); JSONObject jsonServices = json.optJSONObject(KEY_SERVICES); if(jsonServices!=null) { Iterator<?> keys = jsonServices.keys(); if (keys != null) { while (keys.hasNext()) { String key = (String) keys.next(); JSONObject serviceObject = jsonServices.optJSONObject(key); if (serviceObject!=null) { DeviceService service = DeviceService.getService(serviceObject); addService(service); } } } } }
Source:
<code>public boolean equals(Airport a){ <START> if((this.name).equals(a.name)){ <END> return true; } else return false; }</code><technical_language>java return this.name.equals(a.name);</technical_language>

Target:
public boolean equals(Airport a){ return (this.name).equals(a.name); }
Source:
<code>public boolean setValue(T newValue) { if (!validator.validate(newValue)) return false; PropertyChangeEvent event = new PropertyChangeEvent(this, id.toString(), this.value, newValue); <START> this.value = newValue; <END> dispatchChangedEvent(event); return true; }</code><technical_language>remove empty lines this one</technical_language>

Target:
public boolean setValue(T newValue) { if (!validate(newValue)) { return false; } PropertyChangeEvent event = new PropertyChangeEvent(this, id.toString(), this.value, newValue); this.value = newValue; dispatchChangedEvent(event); return true; }
Source:
<code>public Geometry clip(Geometry g, boolean ensureValid) { if (g == null) { return null; } Envelope geomEnvelope = g.getEnvelopeInternal(); if (geomEnvelope.isNull()) { return null; } if (bounds.contains(geomEnvelope)) { return g; } else if (!bounds.intersects(geomEnvelope)) { return null; } if (g instanceof LineString) { return clipLineString((LineString) g); } else if (g instanceof Polygon) { <START> Polygon polygon = (Polygon) g; <END> if (ensureValid) { GeometryFactory gf = g.getFactory(); CoordinateSequenceFactory csf = gf.getCoordinateSequenceFactory(); Polygon fence = gf.createPolygon(buildBoundsString(gf, csf), null); return g.intersection(fence); } else { return clipPolygon((Polygon) g); } } else if (g instanceof GeometryCollection) { return clipCollection((GeometryCollection) g, ensureValid); } else { return g; } }</code><technical_language>Is this anywhere</technical_language>

Target:
public Geometry clip(Geometry g, boolean ensureValid) { if (g == null) { return null; } Envelope geomEnvelope = g.getEnvelopeInternal(); if (geomEnvelope.isNull()) { return null; } if (bounds.contains(geomEnvelope)) { return g; } else if (!bounds.intersects(geomEnvelope)) { return null; } if (g instanceof LineString) { return clipLineString((LineString) g); } else if (g instanceof Polygon) { if (ensureValid) { GeometryFactory gf = g.getFactory(); CoordinateSequenceFactory csf = gf.getCoordinateSequenceFactory(); Polygon fence = gf.createPolygon(buildBoundsString(gf, csf), null); return g.intersection(fence); } else { return clipPolygon((Polygon) g); } } else if (g instanceof GeometryCollection) { return clipCollection((GeometryCollection) g, ensureValid); } else { return g; } }
Source:
<code>public void getDSObyIdentifier(HttpServletRequest request, HttpServletResponse response, @RequestParam(PARAM) UUID uuid) throws IOException, SQLException, SearchServiceException { Context context = null; try { context = ContextUtil.obtainContext(request); for (DSpaceObjectService dSpaceObjectService : contentServiceFactory.getDSpaceObjectServices()) { DSpaceObject dso = dSpaceObjectService.find(context, uuid); if (dso != null) { DSpaceObjectRest dsor = converter.convert(dso); <START> URI link = linkTo(dsor.getController(), dsor.getCategory(), English.plural(dsor.getType())) <END> .slash(dsor.getId()).toUri(); response.setStatus(HttpServletResponse.SC_FOUND); response.sendRedirect(link.toString()); return; } } response.setStatus(HttpServletResponse.SC_NOT_FOUND); } finally { context.abort(); } }</code><technical_language>getTypePlural() here? <LINK_0></technical_language>

Target:
public void getDSObyIdentifier(HttpServletRequest request, HttpServletResponse response, @RequestParam(PARAM) UUID uuid) throws IOException, SQLException, SearchServiceException { Context context = null; try { context = ContextUtil.obtainContext(request); for (DSpaceObjectService dSpaceObjectService : contentServiceFactory.getDSpaceObjectServices()) { DSpaceObject dso = dSpaceObjectService.find(context, uuid); if (dso != null) { DSpaceObjectRest dsor = converter.convert(dso); URI link = linkTo(dsor.getController(), dsor.getCategory(), dsor.getTypePlural()) .slash(dsor.getId()).toUri(); response.setStatus(HttpServletResponse.SC_FOUND); response.sendRedirect(link.toString()); return; } } response.setStatus(HttpServletResponse.SC_NOT_FOUND); } finally { context.abort(); } }
Source:
<code>public List<QuotaConsumptionParameter> getQuotaVdsConsumptionParameters() { List<QuotaConsumptionParameter> list = new ArrayList<QuotaConsumptionParameter>(); <START> VM vm = DbFacade.getInstance().getVmDao().get(getVmToAttach(getParameters().getVmPoolId())); <END> setStoragePoolId(vm.getStoragePoolId()); list.add(new QuotaVdsGroupConsumptionParameter(vm.getQuotaId(), null, QuotaConsumptionParameter.QuotaAction.CONSUME, vm.getVdsGroupId(), vm.getCpuPerSocket() * vm.getNumOfSockets(), vm.getMemSizeMb())); return list; }</code><technical_language>extract getVmDao getter</technical_language>

Target:
public List<QuotaConsumptionParameter> getQuotaVdsConsumptionParameters() { List<QuotaConsumptionParameter> list = new ArrayList<QuotaConsumptionParameter>(); if (vmToAttach != null) { VM vm = getVmDAO().get(vmToAttach); setStoragePoolId(vm.getStoragePoolId()); list.add(new QuotaVdsGroupConsumptionParameter(vm.getQuotaId(), null, QuotaConsumptionParameter.QuotaAction.CONSUME, vm.getVdsGroupId(), vm.getCpuPerSocket() * vm.getNumOfSockets(), vm.getMemSizeMb())); } return list; }
Source:
<code>public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { super.configurePipeline(pipelineConfigurer); if (!S3_LOG.equals(config.logFormat) && !CLF_LOG.equals(config.logFormat) && !CLOUDFRONT_LOG.equals(config.logFormat)) { LOG.error("Log format not currently supported."); throw new IllegalStateException("Unsupported log format: " + config.logFormat); } Schema inputSchema = pipelineConfigurer.getStageConfigurer().getInputSchema(); if (inputSchema != null) { if (!validateInputSchemaType(inputSchema.getType())) { <START> throw new IllegalArgumentException( <END> String.format("Unsupported inputType in schema, only Schema.Type.BYTES and Schema.Type.STRING " + "are supported InputType: %s", inputSchema.getType().toString())); } } pipelineConfigurer.getStageConfigurer().setOutputSchema(LOG_SCHEMA); }</code><technical_language>for validate method throw this, message, validate is whats invalid</technical_language>

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { super.configurePipeline(pipelineConfigurer); if (!S3_LOG.equals(config.logFormat) && !CLF_LOG.equals(config.logFormat) && !CLOUDFRONT_LOG.equals(config.logFormat)) { LOG.error("Log format not currently supported."); throw new IllegalStateException("Unsupported log format: " + config.logFormat); } Schema inputSchema = pipelineConfigurer.getStageConfigurer().getInputSchema(); if (inputSchema != null) { if (!inputSchema.getType().equals(Schema.Type.RECORD)) { throw new IllegalArgumentException("Only Input Schema of type Schema.Type.RECORD is supported"); } Schema.Field inputNameSchema = inputSchema.getField(config.inputName); try { if (inputNameSchema != null && inputNameSchema.getSchema() != null) { validateInputSchemaType(inputNameSchema.getSchema().getType()); } } catch (IllegalArgumentException e) { LOG.error(e.getMessage()); throw Throwables.propagate(e); } } pipelineConfigurer.getStageConfigurer().setOutputSchema(LOG_SCHEMA); }