auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static void createSubtitleLabel(Composite parent, String text) { final Label label = new Label(parent, SWT.WRAP); label.setText(text + ':'); final FontDescriptor boldDescriptor = <START> FontDescriptor.createFrom(parent.getFont()).setStyle(SWT.BOLD); <END> final Font boldFont = boldDescriptor.createFont(parent.getDisplay()); label.setFont(boldFont); label.addDisposeListener(event -> boldFont.dispose()); }</code><technical_language>setStyle() modifies font descriptor ensures createFont() creates a new font disposed</technical_language>

Target:
private static void createSubtitleLabel(Composite parent, String text) { final Label label = new Label(parent, SWT.WRAP); label.setText(text + ':'); final FontDescriptor boldDescriptor = FontDescriptor.createFrom(parent.getFont()).setStyle(SWT.BOLD); final Font boldFont = boldDescriptor.createFont(parent.getDisplay()); label.setFont(boldFont); label.addDisposeListener(event -> boldDescriptor.destroyFont(boldFont)); }
Source:
<code>private Mono<PagedResponse<CustomFormModelInfo>> listNextPageModelInfo(String nextPageLink, Context context) { return service.listCustomModelsNextSinglePageAsync(nextPageLink) <START> .doOnSubscribe(ignoredValue -> logger.info("Retrieving the next listing page - Page {}", nextPageLink)) <END> .doOnSuccess(response -> logger.info("Retrieved the next listing page - Page {}", nextPageLink)) .doOnError(error -> logger.warning("Failed to retrieve the next listing page - Page {}", nextPageLink, error)) .map(res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), toCustomFormModelInfo(res.getValue()), res.getContinuationToken(), null)); }</code><technical_language>mention models info here</technical_language>

Target:
private Mono<PagedResponse<CustomFormModelInfo>> listNextPageModelInfo(String nextPageLink, Context context) { if (CoreUtils.isNullOrEmpty(nextPageLink)) { return Mono.empty(); } return service.listCustomModelsNextSinglePageAsync(nextPageLink, context) .doOnSubscribe(ignoredValue -> logger.info("Retrieving the next listing page - Page {}", nextPageLink)) .doOnSuccess(response -> logger.info("Retrieved the next listing page - Page {}", nextPageLink)) .doOnError(error -> logger.warning("Failed to retrieve the next listing page - Page {}", nextPageLink, error)) .map(res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), toCustomFormModelInfo(res.getValue()), res.getContinuationToken(), null)); }
Source:
<code>public int size() { if (size == -1) { int tempsize = 0; if ((from instanceof Integer || from instanceof Long) && (to instanceof Integer || to instanceof Long)) { final BigInteger fromNum = new BigInteger(from.toString()); final BigInteger toNum = new BigInteger(to.toString()); final BigInteger sizeNum = toNum.subtract(fromNum).add(new BigInteger("1")); tempsize = sizeNum.intValue(); if (!BigInteger.valueOf(tempsize).equals(sizeNum)) { tempsize = Integer.MAX_VALUE; } } else if (from instanceof Character && to instanceof Character) { final char fromNum = (Character) from; final char toNum = (Character) to; tempsize = toNum - fromNum + 1; } else if (((from instanceof BigDecimal || from instanceof BigInteger) && to instanceof Number) || ((to instanceof BigDecimal || to instanceof BigInteger) && from instanceof Number)) { final BigDecimal fromNum = new BigDecimal(from.toString()); final BigDecimal toNum = new BigDecimal(to.toString()); <START> final BigInteger sizeNum = toNum.subtract(fromNum).add(BigDecimal.valueOf(1.0)).toBigInteger(); <END> tempsize = sizeNum.intValue(); if (!BigInteger.valueOf(tempsize).equals(sizeNum)) { tempsize = Integer.MAX_VALUE; } } else { final Iterator<Comparable> iter = new StepIterator(this, 1); while (iter.hasNext()) { tempsize++; if (tempsize < 0) { break; } iter.next(); } } if (tempsize < 0) { tempsize = Integer.MAX_VALUE; } size = tempsize; } return size; }</code><technical_language>use: BigDecimal.ONE days</technical_language>

Target:
public int size() { if (size == -1) { int tempsize = 0; if ((from instanceof Integer || from instanceof Long) && (to instanceof Integer || to instanceof Long)) { final BigInteger fromNum = new BigInteger(from.toString()); final BigInteger toNum = new BigInteger(to.toString()); final BigInteger sizeNum = toNum.subtract(fromNum).add(new BigInteger("1")); tempsize = sizeNum.intValue(); if (!BigInteger.valueOf(tempsize).equals(sizeNum)) { tempsize = Integer.MAX_VALUE; } } else if (from instanceof Character && to instanceof Character) { final char fromNum = (Character) from; final char toNum = (Character) to; tempsize = toNum - fromNum + 1; } else if (((from instanceof BigDecimal || from instanceof BigInteger) && to instanceof Number) || ((to instanceof BigDecimal || to instanceof BigInteger) && from instanceof Number)) { final BigDecimal fromNum = new BigDecimal(from.toString()); final BigDecimal toNum = new BigDecimal(to.toString()); final BigInteger sizeNum = toNum.subtract(fromNum).add(BigDecimal.ONE).toBigInteger(); tempsize = sizeNum.intValue(); if (!BigInteger.valueOf(tempsize).equals(sizeNum)) { tempsize = Integer.MAX_VALUE; } } else { final Iterator<Comparable> iter = new StepIterator(this, 1); while (iter.hasNext()) { tempsize++; if (tempsize < 0) { break; } iter.next(); } } if (tempsize < 0) { tempsize = Integer.MAX_VALUE; } size = tempsize; } return size; }
Source:
<code>private static String getWhereClause( TupleDomain<Integer> tupleDomain, List<String> columnNames, List<Type> types, Set<Integer> uuidColumnIndexes, List<ValueBuffer> bindValues, Optional<String> additionalFixedCondition) { ImmutableList.Builder<String> conjunctsBuilder = ImmutableList.builder(); if (!tupleDomain.isNone()) { Map<Integer, Domain> domainMap = tupleDomain.getDomains().get(); for (Map.Entry<Integer, Domain> entry : domainMap.entrySet()) { int index = entry.getKey(); String columnName = columnNames.get(index); Type type = types.get(index); conjunctsBuilder.add(toPredicate(index, columnName, type, entry.getValue(), uuidColumnIndexes, bindValues)); } } <START> if (additionalFixedCondition.isPresent()) { <END> conjunctsBuilder.add(additionalFixedCondition.get()); } List<String> conjuncts = conjunctsBuilder.build(); if (conjuncts.isEmpty()) { return ""; } StringBuilder where = new StringBuilder("WHERE "); return Joiner.on(" AND\n").appendTo(where, conjuncts).toString(); }</code><technical_language>This "if present get" pattern replaced .ifPresent</technical_language>

Target:
private static String getWhereClause( TupleDomain<Integer> tupleDomain, List<String> columnNames, List<Type> types, Set<Integer> uuidColumnIndexes, List<ValueBuffer> bindValues, Optional<String> additionalFixedCondition) { ImmutableList.Builder<String> conjunctsBuilder = ImmutableList.builder(); if (!tupleDomain.isNone()) { Map<Integer, Domain> domainMap = tupleDomain.getDomains().get(); for (Map.Entry<Integer, Domain> entry : domainMap.entrySet()) { int index = entry.getKey(); String columnName = columnNames.get(index); Type type = types.get(index); conjunctsBuilder.add(toPredicate(index, columnName, type, entry.getValue(), uuidColumnIndexes, bindValues)); } } additionalFixedCondition.ifPresent(condition -> conjunctsBuilder.add(condition)); List<String> conjuncts = conjunctsBuilder.build(); if (conjuncts.isEmpty()) { return ""; } StringBuilder where = new StringBuilder("WHERE "); return Joiner.on(" AND\n").appendTo(where, conjuncts).toString(); }
Source:
<code>private ContentFileInterface createContentFile(Process process, URI image) throws IOException { <START> ContentFileInterface contentFileInterface = UghImplementation.INSTANCE.createContentFile(); <END> URI path = serviceManager.getProcessService().getImagesTifDirectory(false, process).resolve(image); contentFileInterface.setLocation(path.getPath()); return contentFileInterface; }</code><technical_language>Interface appended variable name</technical_language>

Target:
private ContentFileInterface createContentFile(Process process, URI image) throws IOException { ContentFileInterface contentFile = UghImplementation.INSTANCE.createContentFile(); URI path = serviceManager.getProcessService().getImagesTifDirectory(false, process).resolve(image); contentFile.setLocation(path.getPath()); return contentFile; }
Source:
<code>public long[] getLatencyBucketsBy100ms() { final long buckets[] = new long[HUNDRED_MS_BUCKET_COUNT]; for (int ii = 0; ii < HUNDRED_MS_BUCKET_COUNT; ii++) { <START> buckets[ii] = m_latencyHistogram.getCountBetweenValues(ii * 100000, (ii + 1) * 100000); <END> } return buckets; }</code><technical_language>long arguments if L literal i.e. 1000L</technical_language>

Target:
public long[] getLatencyBucketsBy100ms() { final long buckets[] = new long[HUNDRED_MS_BUCKET_COUNT]; for (int ii = 0; ii < HUNDRED_MS_BUCKET_COUNT; ii++) { buckets[ii] = m_latencyHistogram.getCountBetweenValues(ii * 100000L, (ii + 1) * 100000L); } return buckets; }
Source:
<code>private <T extends Connection> T parseConnection(EClass conType) { T connection = (T) LibraryElementFactory.eINSTANCE.create(conType); connection.setResTypeConnection(false); String destinationElement = getAttributeValue(LibraryElementTags.DESTINATION_ATTRIBUTE); if <START> (destinationElement != null) { <END> IInterfaceElement destination = getConnectionEndPoint(destinationElement); if (null != destination) { connection.setDestination(destination); } else { Activator.getDefault().logError("Connection destination not found: " + destinationElement); return null; } } String sourceElement = getAttributeValue(LibraryElementTags.SOURCE_ATTRIBUTE); if (null != sourceElement) { IInterfaceElement source = getConnectionEndPoint(sourceElement); if (null != source) { connection.setSource(source); } else { Activator.getDefault().logError("Connection source not found: " + sourceElement); return null; } } String commentElement = getAttributeValue(LibraryElementTags.COMMENT_ATTRIBUTE); if (null != commentElement) { connection.setComment(commentElement); } parseConnectionRouting(connection); return connection; }</code><technical_language>order of operands</technical_language>

Target:
private <T extends Connection> T parseConnection(EClass conType) { T connection = (T) LibraryElementFactory.eINSTANCE.create(conType); connection.setResTypeConnection(false); String destinationElement = getAttributeValue(LibraryElementTags.DESTINATION_ATTRIBUTE); if (null != destinationElement) { IInterfaceElement destination = getConnectionEndPoint(destinationElement); if (null != destination) { connection.setDestination(destination); } else { Activator.getDefault().logError("Connection destination not found: " + destinationElement); return null; } } String sourceElement = getAttributeValue(LibraryElementTags.SOURCE_ATTRIBUTE); if (null != sourceElement) { IInterfaceElement source = getConnectionEndPoint(sourceElement); if (null != source) { connection.setSource(source); } else { Activator.getDefault().logError("Connection source not found: " + sourceElement); return null; } } String commentElement = getAttributeValue(LibraryElementTags.COMMENT_ATTRIBUTE); if (null != commentElement) { connection.setComment(commentElement); } parseConnectionRouting(connection); return connection; }
Source:
<code>private String toFormattedAddress(InetSocketAddress clientAddress) { if (clientAddress.isUnresolved()) { <START> return "UNKNOWN"; <END> } else { return String.format("%s:%s", clientAddress.getAddress().getHostAddress(), clientAddress.getPort()); } }</code><technical_language>this a bit dangerous? If in a network dns "Unknown" place</technical_language>

Target:
private Optional<String> toFormattedAddress(InetSocketAddress clientAddress) { Optional<String> res = Optional.empty(); if (!clientAddress.isUnresolved()) { res = Optional.of(String.format("%s:%s", clientAddress.getAddress().getHostAddress(), clientAddress.getPort())); } return res; }
Source:
<code>public boolean onOptionsItemSelected( final MenuItem item ) { final MainActivity main = MainActivity.getMainActivity(); NavigationView navigationView = (NavigationView) getActivity().findViewById(R.id.left_drawer); switch ( item.getItemId() ) { case MENU_USER_STATS: navigationView.getMenu().setGroupVisible(R.id.stats_group, true); MenuItem userStatsMenuItem = navigationView.getMenu().findItem(R.id.nav_user_stats); <START> navigationView.getMenu().setGroupVisible(R.id.stats_group, true); <END> userStatsMenuItem.setCheckable(true); userStatsMenuItem.setChecked(true); if (main != null) main.selectFragment(R.id.nav_user_stats); return true; case MENU_RANK_STATS: MenuItem rankStatsMenuItem = navigationView.getMenu().findItem(R.id.nav_rank); navigationView.getMenu().setGroupVisible(R.id.stats_group, true); rankStatsMenuItem.setCheckable(true); rankStatsMenuItem.setChecked(true); if (main != null) main.selectFragment(R.id.nav_rank); return true; } return false; }</code><technical_language>This is time for navigation view in this case</technical_language>

Target:
public boolean onOptionsItemSelected( final MenuItem item ) { final MainActivity main = MainActivity.getMainActivity(); NavigationView navigationView = (NavigationView) getActivity().findViewById(R.id.left_drawer); switch ( item.getItemId() ) { case MENU_USER_STATS: MenuUtil.selectStatsSubmenuItem(navigationView, main, R.id.nav_user_stats); return true; case MENU_RANK_STATS: MenuUtil.selectStatsSubmenuItem(navigationView, main, R.id.nav_rank); return true; } return false; }
Source:
<code>boolean isCollapsingExplicitlyDenied() { <START> if (parent != null && parent.type == Type.OBJECTLIT && <END> parent.docInfo != null && parent.docInfo.hasEnumParameterType()) { return false; } if (docInfo == null) { Ref ref = getDeclaration(); if (ref != null) { docInfo = getDocInfoForDeclaration(ref); } } return docInfo != null && docInfo.isNoCollapse(); }</code><technical_language>helper method for enum ancestors</technical_language>

Target:
boolean isCollapsingExplicitlyDenied() { if (isDescendantOfEnum()) { return false; } if (docInfo == null) { Ref ref = getDeclaration(); if (ref != null) { docInfo = getDocInfoForDeclaration(ref); } } return docInfo != null && docInfo.isNoCollapse(); }
Source:
<code>public String render(T size) { if (isUnavailable(size)) { return CONSTANTS.unAvailablePropertyLabel(); } String res; switch (format) { case LEGACY: res = renderLegacySize(size.longValue()); break; case HUMAN_READABLE: res = renderHumanReadableSize(size.longValue()); break; default: throw new RuntimeException("Format '" + format + "' is not supported!"); } <START> return res; <END> }</code><technical_language>If return case clause, get rid of res temporary variable, breaks return line. switch(format) { case LEGACY: return renderLegacySize(size.longValue()); ... default: throw ... }</technical_language>

Target:
public String render(T size) { if (isUnavailable(size)) { return CONSTANTS.unAvailablePropertyLabel(); } switch (format) { case GIGABYTE: return renderGigabyteSize(size.longValue()); case HUMAN_READABLE: return renderHumanReadableSize(size.longValue()); default: throw new RuntimeException("Format '" + format + "' is not supported!"); } }
Source:
<code>private void activate() { for (ExtensionEntry entry : loadedEntries.values()) { entry.enabled = <START> EngineLocalConfig.getInstance().getBoolean( <END> "ENGINE_EXTENSION_ENABLE_" + entry.getName(), entry.enabled ); if (entry.enabled) { try { entry.extension = (Extension) lookupService( Extension.class, entry.getConfig().getProperty(CLASS), entry.getConfig().getProperty(MODULE) ).newInstance(); entry.extension.setContext(entry.context); entry.extension.init(); activatedEntries.put(entry.getName(), entry); MultiValueMapUtils.addToMap(entry.getProvides(), entry, providesEntries); } catch (Exception ex) { log.error( String.format( "Error in activating extension %1$s. Exception message is %2$s", entry.getName(), ex.getMessage() ) ); if (log.isDebugEnabled()) { log.error("", ex); } } } } }</code><technical_language>please do add new line = operator... be: entry.enabled = EngineLocalConfig. need for getInstance() in a loop... please store a reference</technical_language>

Target:
private void activate() { EngineLocalConfig config = EngineLocalConfig.getInstance(); for (ExtensionEntry entry : loadedEntries.values()) { entry.enabled = config.getBoolean(ENGINE_EXTENSION_ENABLED + entry.getName(), entry.enabled); if (entry.enabled) { try { entry.extension = (Extension) lookupService( Extension.class, entry.getConfig().getProperty(CLASS), entry.getConfig().getProperty(MODULE) ).newInstance(); entry.extension.setContext(entry.context); entry.extension.init(); activatedEntries.put(entry.getName(), entry); MultiValueMapUtils.addToMap(entry.getProvides(), entry, providesEntries); } catch (Exception ex) { log.error( String.format( "Error in activating extension %1$s. Exception message is %2$s", entry.getName(), ex.getMessage() ) ); if (log.isDebugEnabled()) { log.error("", ex); } } } } }
Source:
<code>public void testPush() throws Exception { Configuration conf = new Configuration(true); <START> File tmpDir = Files.createTempDir(); <END> tmpDir.deleteOnExit(); File tmp = new File(tmpDir, "version.bin"); tmp.deleteOnExit(); final byte[] data = new byte[]{0x0, 0x0, 0x0, 0x1}; Files.write(data, tmp); final long size = data.length; HdfsDataSegmentPusherConfig config = new HdfsDataSegmentPusherConfig(); config.storageDirectory = tmpDir.getName(); HdfsDataSegmentPusher pusher = new HdfsDataSegmentPusher(config, conf, new DefaultObjectMapper()); DataSegment segmentToPush = new DataSegment( "foo", new Interval("2015/2016"), "0", Maps.<String, Object>newHashMap(), Lists.<String>newArrayList(), Lists.<String>newArrayList(), new NoneShardSpec(), 0, size ); DataSegment segment = pusher.push(tmpDir, segmentToPush); Assert.assertEquals(segmentToPush.getSize(), segment.getSize()); final File dir = new File(config.getStorageDirectory()); FileUtils.deleteDirectory(dir); }</code><technical_language>Create TemporaryFolder</technical_language>

Target:
public void testPush() throws Exception { Configuration conf = new Configuration(true); File segmentDir = tempFolder.newFolder(); File tmp = new File(segmentDir, "version.bin"); final byte[] data = new byte[]{0x0, 0x0, 0x0, 0x1}; Files.write(data, tmp); final long size = data.length; HdfsDataSegmentPusherConfig config = new HdfsDataSegmentPusherConfig(); config.setStorageDirectory(tempFolder.newFolder().getAbsolutePath()); HdfsDataSegmentPusher pusher = new HdfsDataSegmentPusher(config, conf, new DefaultObjectMapper()); DataSegment segmentToPush = new DataSegment( "foo", new Interval("2015/2016"), "0", Maps.<String, Object>newHashMap(), Lists.<String>newArrayList(), Lists.<String>newArrayList(), new NoneShardSpec(), 0, size ); DataSegment segment = pusher.push(segmentDir, segmentToPush); Assert.assertEquals(segmentToPush.getSize(), segment.getSize()); }
Source:
<code>public static void passInformationToTransformation(final VariableSpace variableSpace, final JobConf job) { <START> variableSpace.setVariable("Internal.Hadoop.NumMapTasks", Integer.toString(job.getNumMapTasks())); <END> variableSpace.setVariable("Internal.Hadoop.NumReduceTasks", Integer.toString(job.getNumReduceTasks())); String taskId = job.get("mapred.task.id"); variableSpace.setVariable("Internal.Hadoop.TaskId", taskId); String nodeNumber; if (Const.isEmpty(taskId)) { nodeNumber="0"; } else { int lastUnderscoreIndex = taskId.lastIndexOf("_"); if (lastUnderscoreIndex>=0) { nodeNumber = taskId.substring(lastUnderscoreIndex+1); } else { nodeNumber = "0"; } } variableSpace.setVariable("Internal.Hadoop.NodeNumber", Integer.toString(Integer.valueOf(nodeNumber))); }</code><technical_language>Needs a check for variableSpace != null</technical_language>

Target:
public static void passInformationToTransformation(final VariableSpace variableSpace, final JobConf job) { if ( variableSpace != null && job != null ) { variableSpace.setVariable("Internal.Hadoop.NumMapTasks", Integer.toString(job.getNumMapTasks())); variableSpace.setVariable("Internal.Hadoop.NumReduceTasks", Integer.toString(job.getNumReduceTasks())); String taskId = job.get("mapred.task.id"); variableSpace.setVariable("Internal.Hadoop.TaskId", taskId); String nodeNumber; if (Const.isEmpty(taskId)) { nodeNumber="0"; } else { int lastUnderscoreIndex = taskId.lastIndexOf("_"); if (lastUnderscoreIndex>=0) { nodeNumber = taskId.substring(lastUnderscoreIndex+1); } else { nodeNumber = "0"; } } variableSpace.setVariable("Internal.Hadoop.NodeNumber", Integer.toString(Integer.valueOf(nodeNumber))); } }
Source:
<code>public static AgentKeyImpl parse(String agentKey) throws IllegalArgumentException { String[] parts = agentKey.split(":"); if (parts.length == 1) { return new AgentKeyImpl(parts[0], null); } else if (parts.length == 2) { return new AgentKeyImpl(parts[0], parts[1]); } else { <START> throw new IllegalArgumentException("" + agentKey); <END> } }</code><technical_language>Check error message</technical_language>

Target:
public static AgentKeyImpl parse(String agentKey) throws IllegalArgumentException { String[] parts = agentKey.split(":"); if (parts.length == 1) { return new AgentKeyImpl(parts[0], null); } else if (parts.length == 2) { return new AgentKeyImpl(parts[0], parts[1]); } else { throw new IllegalArgumentException("Illegal format: " + agentKey); } }
Source:
<code><START> SynchronousMessageSubscriber(long prefetch, SynchronousReceiveWork initialWork) { <END> this.prefetch = prefetch; this.initialWork = initialWork; }</code><technical_language>queue initial request? need initialWork a member variable. prefetch. java SynchronousMessageSubscriber(long prefetch, SynchronousReceiveWork initialWork) { this.prefetch = prefetch; this.workQueue.add(initialWork); // inititalWork.count + prefetch figure out request a subscription. } @Override protected void hookOnSubscribe(Subscription subscription) { this.subscription = subscription; subscription.request(requested); }</technical_language>

Target:
SynchronousMessageSubscriber(long prefetch, SynchronousReceiveWork initialWork) { this.workQueue.add(initialWork); requested = initialWork.getNumberOfEvents() > prefetch ? initialWork.getNumberOfEvents() : prefetch; }
Source:
<code>public void noSequenceSizeItemSequenceInfoBinding() throws Exception { CoreEvent event = spy(testEvent()); <START> when(event.getItemSequenceInfo()).thenReturn(Optional.of(ItemSequenceInfo.of(43))); <END> TypedValue result = expressionLanguage.evaluate(ITEM_SEQUENCE_INFO + ".position", event, BindingContext.builder().build()); assertThat(result.getValue(), is(43)); result = expressionLanguage.evaluate(ITEM_SEQUENCE_INFO + ".sequenceSize", event, BindingContext.builder().build()); assertThat(result.getValue(), is(nullValue())); }</code><technical_language>put static imports (all other occurrences below)</technical_language>

Target:
public void noSequenceSizeItemSequenceInfoBinding() throws Exception { CoreEvent event = spy(testEvent()); when(event.getItemSequenceInfo()).thenReturn(of(ItemSequenceInfo.of(43))); TypedValue result = expressionLanguage.evaluate(ITEM_SEQUENCE_INFO + ".position", event, BindingContext.builder().build()); assertThat(result.getValue(), is(43)); result = expressionLanguage.evaluate(ITEM_SEQUENCE_INFO + ".sequenceSize", event, BindingContext.builder().build()); assertThat(result.getValue(), is(nullValue())); }
Source:
<code>public synchronized void close() throws IOException { <START> scanHandler.cancel(); <END> }</code><technical_language>I synchronized</technical_language>

Target:
public void close() throws IOException { scanHandler.cancel(); }
Source:
<code>public FilterBuilder withReferenceBases(String referenceBases) { if (referenceBases != null) { <START> filters.add(new VariantRepositoryReferenceBasesFilter(new ArrayList<>(Arrays.asList(referenceBases)))); <END> } return this; }</code><technical_language>suggestion filters.add(new VariantRepositoryReferenceBasesFilter(Collections.singletonList(referenceBases)));</technical_language>

Target:
public FilterBuilder withReferenceBases(String referenceBases) { if (referenceBases != null) { filters.add(new VariantRepositoryReferenceBasesFilter(Collections.singletonList(referenceBases))); } return this; }
Source:
<code>public void testAcceptedIssuersWithCRLs() throws Throwable { ServiceName serviceName = Capabilities.TRUST_MANAGER_RUNTIME_CAPABILITY.getCapabilityServiceName("trust-with-crl"); TrustManager trustManager = (TrustManager) services.getContainer().getService(serviceName).getValue(); Assert.assertNotNull(trustManager); <START> Assert.assertTrue(((SSLDefinitions.ReloadableX509ExtendedTrustManager) trustManager).getAcceptedIssuers().length > 0); <END> }</code><technical_language>Instead of casting SSLDefinitions.ReloadableX509ExtendedTrustManager, able cast X509TrustManager instead. Then, ReloadableX509ExtendedTrustManager private again</technical_language>

Target:
public void testAcceptedIssuersWithCRLs() throws Throwable { ServiceName serviceName = Capabilities.TRUST_MANAGER_RUNTIME_CAPABILITY.getCapabilityServiceName("trust-with-crl"); TrustManager trustManager = (TrustManager) services.getContainer().getService(serviceName).getValue(); Assert.assertNotNull(trustManager); Assert.assertTrue(((X509TrustManager) trustManager).getAcceptedIssuers().length > 0); }
Source:
<code>private String getConfigPath() { <START> return getInstallDir() + "/rabbitmq"; <END> }</code><technical_language>more sense for config path refer runDir installDir</technical_language>

Target:
private String getConfigPath() { return getRunDir() + "/rabbitmq"; }
Source:
<code>public boolean validateItemUnitPrice(PurApItem item) { boolean valid = true; if (item.getItemType().isLineItemIndicator()) { if (ObjectUtils.isNull(item.getItemUnitPrice())) { valid = false; <START> String attributeLabel = businessObjectDictionaryService.getBusinessObjectEntry(item.getClass().getName()) .getAttributeDefinition(PurapPropertyConstants.ITEM_DESCRIPTION).getLabel(); <END> GlobalVariables.getMessageMap().putError(PurapPropertyConstants.ITEM_UNIT_PRICE, KFSKeyConstants.ERROR_REQUIRED, attributeLabel + " in " + item.getItemIdentifierString()); } } if (ObjectUtils.isNotNull(item.getItemUnitPrice())) { if ((BigDecimal.ZERO.compareTo(item.getItemUnitPrice()) > 0) && ((!item.getItemTypeCode().equals(ItemTypeCodes.ITEM_TYPE_ORDER_DISCOUNT_CODE)) && (!item.getItemTypeCode().equals(ItemTypeCodes.ITEM_TYPE_TRADE_IN_CODE)))) { GlobalVariables.getMessageMap().putError(PurapPropertyConstants.ITEM_UNIT_PRICE, PurapKeyConstants.ERROR_ITEM_AMOUNT_BELOW_ZERO, ItemFields.UNIT_COST, item.getItemIdentifierString()); valid = false; } else if ((BigDecimal.ZERO.compareTo(item.getItemUnitPrice()) < 0) && ((item.getItemTypeCode().equals(ItemTypeCodes.ITEM_TYPE_ORDER_DISCOUNT_CODE)) || (item.getItemTypeCode().equals(ItemTypeCodes.ITEM_TYPE_TRADE_IN_CODE)))) { GlobalVariables.getMessageMap().putError(PurapPropertyConstants.ITEM_UNIT_PRICE, PurapKeyConstants.ERROR_ITEM_AMOUNT_NOT_BELOW_ZERO, ItemFields.UNIT_COST, item.getItemIdentifierString()); valid = false; } } return valid; }</code><technical_language>this reference ITEM_UNIT_PRICE instead, in code</technical_language>

Target:
public boolean validateItemUnitPrice(PurApItem item) { boolean valid = true; if (item.getItemType().isLineItemIndicator()) { if (ObjectUtils.isNull(item.getItemUnitPrice())) { valid = false; String attributeLabel = businessObjectDictionaryService.getBusinessObjectEntry(item.getClass().getName()) .getAttributeDefinition(PurapPropertyConstants.ITEM_UNIT_PRICE).getLabel(); GlobalVariables.getMessageMap().putError(PurapPropertyConstants.ITEM_UNIT_PRICE, KFSKeyConstants.ERROR_REQUIRED, attributeLabel + " in " + item.getItemIdentifierString()); } } if (ObjectUtils.isNotNull(item.getItemUnitPrice())) { if ((BigDecimal.ZERO.compareTo(item.getItemUnitPrice()) > 0) && ((!item.getItemTypeCode().equals(ItemTypeCodes.ITEM_TYPE_ORDER_DISCOUNT_CODE)) && (!item.getItemTypeCode().equals(ItemTypeCodes.ITEM_TYPE_TRADE_IN_CODE)))) { GlobalVariables.getMessageMap().putError(PurapPropertyConstants.ITEM_UNIT_PRICE, PurapKeyConstants.ERROR_ITEM_AMOUNT_BELOW_ZERO, ItemFields.UNIT_COST, item.getItemIdentifierString()); valid = false; } else if ((BigDecimal.ZERO.compareTo(item.getItemUnitPrice()) < 0) && ((item.getItemTypeCode().equals(ItemTypeCodes.ITEM_TYPE_ORDER_DISCOUNT_CODE)) || (item.getItemTypeCode().equals(ItemTypeCodes.ITEM_TYPE_TRADE_IN_CODE)))) { GlobalVariables.getMessageMap().putError(PurapPropertyConstants.ITEM_UNIT_PRICE, PurapKeyConstants.ERROR_ITEM_AMOUNT_NOT_BELOW_ZERO, ItemFields.UNIT_COST, item.getItemIdentifierString()); valid = false; } } return valid; }
Source:
<code>public XBeePacket parsePacket() throws InvalidPacketException { try { readBytes = 0; lengthRead = false; checksum = new XBeeChecksum(); int hSize = readByte(); int lSize = readByte(); length = hSize << 8 | lSize; lengthRead = true; int apiID = readByte(); APIFrameType apiType = APIFrameType.get(apiID); XBeePacket packet = null; if (apiType == null) { byte[] payload = readBytes(length - 1); packet = new UnknownXBeePacket(apiID, payload); } else { switch (apiType) { case TX_64: packet = parseTX64Packet(); break; case TX_16: packet = parseTX16Packet(); break; case AT_COMMAND: packet = parseATCommandPacket(); break; case TRANSMIT_REQUEST: packet = parseTransmitRequestPacket(); break; case AT_COMMAND_RESPONSE: packet = parseATCommandResponsePacket(); break; case RX_64: packet = parseRX64Packet(); break; case RX_16: packet = parseRX16Packet(); break; case TX_STATUS: packet = parseTXStatusPacket(); break; case TRANSMIT_STATUS: packet = parseTransmitStatusPacket(); break; case RECEIVE_PACKET: packet = parseZigBeeReceivePacket(); break; case GENERIC: default: packet = parseGenericPacket(); } } readByte(); return packet; } catch (IOException e) { <START> throw new InvalidPacketException("Error parsing packet: " + e.getMessage()); <END> } }</code><technical_language>Add original IOException of this new one: throw new InvalidPacketException("Error parsing packet: " + e.getMessage(), e);</technical_language>

Target:
public XBeePacket parsePacket() throws InvalidPacketException { try { readBytes = 0; lengthRead = false; checksum = new XBeeChecksum(); int hSize = readByte(); int lSize = readByte(); length = hSize << 8 | lSize; lengthRead = true; int apiID = readByte(); APIFrameType apiType = APIFrameType.get(apiID); XBeePacket packet = null; if (apiType == null) { byte[] payload = readBytes(length - 1); packet = new UnknownXBeePacket(apiID, payload); } else { switch (apiType) { case TX_64: packet = parseTX64Packet(); break; case TX_16: packet = parseTX16Packet(); break; case AT_COMMAND: packet = parseATCommandPacket(); break; case TRANSMIT_REQUEST: packet = parseTransmitRequestPacket(); break; case AT_COMMAND_RESPONSE: packet = parseATCommandResponsePacket(); break; case RX_64: packet = parseRX64Packet(); break; case RX_16: packet = parseRX16Packet(); break; case TX_STATUS: packet = parseTXStatusPacket(); break; case TRANSMIT_STATUS: packet = parseTransmitStatusPacket(); break; case RECEIVE_PACKET: packet = parseZigBeeReceivePacket(); break; case GENERIC: default: packet = parseGenericPacket(); } } readByte(); return packet; } catch (IOException e) { throw new InvalidPacketException("Error parsing packet: " + e.getMessage(), e); } }
Source:
<code>void deleteLeastRecentlyUsedActiveTokens() { Date leastRecentlyUsedDate = new Date(System.currentTimeMillis() - ONE_DAY_MILLIS * 30); OAuthRefreshTokenInformation toRemove = createRefreshToken("abcd", leastRecentlyUsedDate); OAuthRefreshTokenInformation doNotRemove1 = createRefreshToken("abcd", new Date()); OAuthRefreshTokenInformation doNotRemove2 = createRefreshToken("abcd", new Date(System.currentTimeMillis() - 1000 * 5)); <START> OAuthRefreshTokenInformation expired = createRefreshToken("abcd", new Date(System.currentTimeMillis() - ONE_YEAR_MILLIS)); <END> oauthRefreshTokenDao.deleteLeastRecentlyUsedTokensOverLimit(userId, client.getClient_id(), 2L); assertFalse(oauthRefreshTokenDao.getRefreshTokenMetadata(toRemove.getTokenId()).isPresent()); assertTrue(oauthRefreshTokenDao.getRefreshTokenMetadata(doNotRemove1.getTokenId()).isPresent()); assertTrue(oauthRefreshTokenDao.getRefreshTokenMetadata(doNotRemove2.getTokenId()).isPresent()); assertFalse(oauthRefreshTokenDao.getRefreshTokenMetadata(expired.getTokenId()).isPresent()); }</code><technical_language>rename avoid confusion</technical_language>

Target:
void deleteLeastRecentlyUsedActiveTokens() { Long tokenLimit = 2L; OAuthRefreshTokenInformation oldToken1 = createRefreshToken("abcd", new Date(System.currentTimeMillis() - ONE_YEAR_MILLIS)); OAuthRefreshTokenInformation oldToken2 = createRefreshToken("abcd", new Date(System.currentTimeMillis() - ONE_DAY_MILLIS)); OAuthRefreshTokenInformation newToken1 = createRefreshToken("abcd", new Date(System.currentTimeMillis() - ONE_HOUR_MILLIS)); OAuthRefreshTokenInformation newToken2 = createRefreshToken("abcd", new Date()); oauthRefreshTokenDao.deleteLeastRecentlyUsedTokensOverLimit(userId, client.getClient_id(), tokenLimit); assertFalse(oauthRefreshTokenDao.getRefreshTokenMetadata(oldToken1.getTokenId()).isPresent()); assertFalse(oauthRefreshTokenDao.getRefreshTokenMetadata(oldToken2.getTokenId()).isPresent()); assertTrue(oauthRefreshTokenDao.getRefreshTokenMetadata(newToken1.getTokenId()).isPresent()); assertTrue(oauthRefreshTokenDao.getRefreshTokenMetadata(newToken2.getTokenId()).isPresent()); }
Source:
<code>public void writeTo(StreamOutput out) throws IOException { windowDefinition.writeTo(out); <START> out.writeGenericValue(startFrameOffset); <END> out.writeGenericValue(endFrameOffset); Symbols.toStream(standaloneWithInputs, out); out.writeVInt(functionsWithInputs.size()); for (Map.Entry<WindowFunction, List<Symbol>> functionWithInputs : functionsWithInputs.entrySet()) { Symbols.toStream(functionWithInputs.getKey(), out); Symbols.toStream(functionWithInputs.getValue(), out); } }</code><technical_language>I need add version handling in streaming here. support rolling upgrades 4.0 4.1 send values a node running 4.0 other hand, attempt read values if node sending is running 4.0</technical_language>

Target:
public void writeTo(StreamOutput out) throws IOException { windowDefinition.writeTo(out); if (out.getVersion().onOrAfter(Version.V_4_1_0)) { out.writeGenericValue(startFrameOffset); out.writeGenericValue(endFrameOffset); } Symbols.toStream(standaloneWithInputs, out); out.writeVInt(functionsWithInputs.size()); for (Map.Entry<WindowFunction, List<Symbol>> functionWithInputs : functionsWithInputs.entrySet()) { Symbols.toStream(functionWithInputs.getKey(), out); Symbols.toStream(functionWithInputs.getValue(), out); } }
Source:
<code>public void initialize() { logger.debug("Initializing Meteoblue bridge"); MeteoBlueBridgeConfig config = getConfigAs(MeteoBlueBridgeConfig.class); String apiKeyTemp = config.getApiKey(); if (StringUtils.isBlank(apiKeyTemp)) { <START> logger.warn("Cannot initialize Meteoblue bridge. No apiKey provided."); <END> updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR); return; } apiKey = apiKeyTemp; updateStatus(ThingStatus.ONLINE); }</code><technical_language>please move this message ThingStatusDetail of updateStatus call below? This users in UI directly</technical_language>

Target:
public void initialize() { logger.debug("Initializing meteoblue bridge"); MeteoBlueBridgeConfig config = getConfigAs(MeteoBlueBridgeConfig.class); String apiKeyTemp = config.getApiKey(); if (StringUtils.isBlank(apiKeyTemp)) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Cannot initialize meteoblue bridge. No apiKey provided."); return; } apiKey = apiKeyTemp; healthCheck(); }
Source:
<code><START> public void onActivityCreated(Activity activity, Bundle savedInstanceState) { <END> checkForDecideUpdates(activity); }</code><technical_language>Is checkForDecideUpdates() in onActivityResumed()? I current logic, call is necessary register listeners</technical_language>

Target:
public void onActivityCreated(Activity activity, Bundle savedInstanceState) { }
Source:
<code>private boolean createShellExecutor(String executorClassName) { try { Class<?> clazz = Class.forName(executorClassName); Constructor<?> ctor = clazz.getConstructor(); executor = (SqlExecutor) ctor.newInstance(); } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { <START> return false; <END> } return true; }</code><technical_language>exception is swallowed, log hard debug. please log exception is swallowed here</technical_language>

Target:
private void createShellExecutor(String executorClassName) throws ExecutorException { try { Class<?> clazz = Class.forName(executorClassName); Constructor<?> ctor = clazz.getConstructor(); executor = (SqlExecutor) ctor.newInstance(); } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { throw new ExecutorException(e); } }
Source:
<code>public void stop(Runnable callback) { try { this.connectionManager.stop(callback); } finally { <START> this.connectionLatch = new CountDownLatch(1); <END> } }</code><technical_language>I suggest do this in start() (or instead). This code relies fact connection manager invokes callback returning. While this is true now, in future</technical_language>

Target:
public void stop(Runnable callback) { this.connectionManager.stop(callback); }
Source:
<code>public void draw(UiDrawer uiDrawer) { uiDrawer.draw(rectangle, SolColor.UI_INACTIVE); uiDrawer.draw(sliderTexture, rectangle.width, rectangle.height, 0, 0, rectangle.x, rectangle.y, 0, SolColor.WHITE); uiDrawer.setTextMode(true); String trimmedValue = Float.toString(value); int lenght = trimmedValue.substring(trimmedValue.indexOf('.')).length(); <START> System.out.println(value); <END> if(lenght > trimAt) { String leftSubstring = trimmedValue.substring(0, trimmedValue.indexOf('.')); String rightSubstring = trimmedValue.substring(trimmedValue.indexOf('.'), leftSubstring.length() + 1 + trimAt); trimmedValue = leftSubstring + rightSubstring; } uiDrawer.drawString(text + trimmedValue, rectangle.x + rectangle.width * 0.5f, rectangle.y + rectangle.height * 0.5f, 1, true, SolColor.WHITE); uiDrawer.setTextMode(false); uiDrawer.draw(sliderMarkerTexture, rectangle.width * HANDLE_SCALE, rectangle.height, rectangle.width * HANDLE_SCALE * 0.5f, 0, rectangle.x + value * rectangle.width, rectangle.y, 0, SolColor.WHITE); }</code><technical_language>Is intended print this here</technical_language>

Target:
public void draw(UiDrawer uiDrawer) { uiDrawer.draw(rectangle, SolColor.UI_INACTIVE); uiDrawer.draw(sliderTexture, rectangle.width, rectangle.height, 0, 0, rectangle.x, rectangle.y, 0, SolColor.WHITE); uiDrawer.setTextMode(true); String trimmedValue = Float.toString(value); int length = trimmedValue.substring(trimmedValue.indexOf('.')).length(); if (length > trimAt) { String leftSubstring = trimmedValue.substring(0, trimmedValue.indexOf('.')); String rightSubstring = trimmedValue.substring(trimmedValue.indexOf('.'), leftSubstring.length() + 1 + trimAt); trimmedValue = leftSubstring + rightSubstring; } uiDrawer.drawString(text + trimmedValue, rectangle.x + rectangle.width * 0.5f, rectangle.y + rectangle.height * 0.5f, 1, true, SolColor.WHITE); uiDrawer.setTextMode(false); uiDrawer.draw(sliderMarkerTexture, rectangle.width * HANDLE_SCALE, rectangle.height, rectangle.width * HANDLE_SCALE * 0.5f, 0, rectangle.x + value * rectangle.width, rectangle.y, 0, SolColor.WHITE); }
Source:
<code>Main(Logger console) { this.console = console; this.jc = new JCommander(this); this.help = new Help(jc, console); jc.setProgramName(DEFAULT_PROGRAM_NAME); jc.addCommand("help", help, "-h", "-help", "--help"); jc.addCommand("create", new CreateDatasetCommand(console)); jc.addCommand("copy", new CopyCommand(console)); jc.addCommand("transform", new TransformCommand(console)); jc.addCommand("update", new UpdateDatasetCommand(console)); jc.addCommand("delete", new DeleteDatasetCommand(console)); jc.addCommand("schema", new SchemaCommand(console)); jc.addCommand("info", new InfoCommand(console)); jc.addCommand("show", new ShowRecordsCommand(console)); jc.addCommand("csv-schema", new CSVSchemaCommand(console)); jc.addCommand("csv-import", new CSVImportCommand(console)); jc.addCommand("obj-schema", new ObjectSchemaCommand(console)); <START> jc.addCommand("informat-import", new InputFormatImportCommand(console)); <END> jc.addCommand("partition-config", new CreatePartitionStrategyCommand(console)); jc.addCommand("mapping-config", new CreateColumnMappingCommand(console)); jc.addCommand("log4j-config", new Log4jConfigCommand(console)); jc.addCommand("flume-config", new FlumeConfigCommand(console)); }</code><technical_language>I command name, I thought of a yet</technical_language>

Target:
Main(Logger console) { this.console = console; this.jc = new JCommander(this); this.help = new Help(jc, console); jc.setProgramName(DEFAULT_PROGRAM_NAME); jc.addCommand("help", help, "-h", "-help", "--help"); jc.addCommand("create", new CreateDatasetCommand(console)); jc.addCommand("copy", new CopyCommand(console)); jc.addCommand("transform", new TransformCommand(console)); jc.addCommand("update", new UpdateDatasetCommand(console)); jc.addCommand("delete", new DeleteCommand(console)); jc.addCommand("schema", new SchemaCommand(console)); jc.addCommand("info", new InfoCommand(console)); jc.addCommand("show", new ShowRecordsCommand(console)); jc.addCommand("obj-schema", new ObjectSchemaCommand(console)); jc.addCommand("inputformat-import", new InputFormatImportCommand(console)); jc.addCommand("csv-schema", new CSVSchemaCommand(console)); jc.addCommand("csv-import", new CSVImportCommand(console)); jc.addCommand("json-schema", new JSONSchemaCommand(console)); jc.addCommand("json-import", new JSONImportCommand(console)); jc.addCommand("partition-config", new CreatePartitionStrategyCommand(console)); jc.addCommand("mapping-config", new CreateColumnMappingCommand(console)); jc.addCommand("log4j-config", new Log4jConfigCommand(console)); jc.addCommand("flume-config", new FlumeConfigCommand(console)); }
Source:
<code>public Operation build() { return new Operation(method, summary, notes, responseModel, uniqueId, position, tags, produces, <START> consumes, protocol, securityReferences, parameters, responseMessages, deprecated, isHidden, nickname); <END> }</code><technical_language>is a uniqueId in operation model. I dont want introduce swagger specific vocabulary internal models! If change this I this pr :merged: :+1:</technical_language>

Target:
public Operation build() { return new Operation(method, summary, notes, responseModel, uniqueId, position, tags, produces, consumes, protocol, securityReferences, parameters, responseMessages, deprecated, isHidden); }
Source:
<code>public List<ClientModel> getAlwaysDisplayInConsoleClients(RealmModel realm) { String cacheKey = getRealmClientsQueryCacheKey(realm.getId()); boolean queryDB = invalidations.contains(cacheKey) || listInvalidations.contains(realm.getId()); if (queryDB) { return getClientDelegate().getAlwaysDisplayInConsoleClients(realm); } ClientListQuery query = cache.get(cacheKey, ClientListQuery.class); if (query != null) { logger.tracev("getClients cache hit: {0}", realm.getName()); } if (query == null) { Long loaded = cache.getCurrentRevision(cacheKey); List<ClientModel> model = getClientDelegate().getAlwaysDisplayInConsoleClients(realm); if (model == null) return null; Set<String> ids = new HashSet<>(); for (ClientModel client : model) ids.add(client.getId()); query = new ClientListQuery(loaded, cacheKey, realm, ids); logger.tracev("adding realm clients cache miss: realm {0} key {1}", realm.getName(), cacheKey); cache.addRevisioned(query, startupRevision); return model; } List<ClientModel> list = new LinkedList<>(); for (String id : query.getClients()) { ClientModel client = session.realms().getClientById(id, realm); if (client == null) { invalidations.add(cacheKey); <START> return getRealmDelegate().getAlwaysDisplayInConsoleClients(realm); <END> } list.add(client); } return list; }</code><technical_language>getClientDelegate</technical_language>

Target:
public List<ClientModel> getAlwaysDisplayInConsoleClients(RealmModel realm) { return getClientDelegate().getAlwaysDisplayInConsoleClients(realm); }
Source:
<code>public CliCommand init(final Arguments args) throws Exception { processCommandOptions(requiredArgs, optionalArgs, args); this.bucketName = args.getBucket(); this.priority = args.getPriority(); this.numberOfThreads = args.getNumberOfThreads(); this.directory = args.getDirectory(); if (Guard.isStringNullOrEmpty(this.directory) || directory.equals(".")) { this.outputPath = FileSystems.getDefault().getPath("."); } else { final Path dirPath = FileSystems.getDefault().getPath(directory); this.outputPath = FileSystems.getDefault().getPath(".").resolve(dirPath); } <START> LOG.info("Output Path = " + this.outputPath); <END> this.discard = args.isDiscard(); if (this.discard && !Guard.isStringNullOrEmpty(directory)) { throw new CommandException("Cannot set both directory and --discard"); } if (this.discard) { LOG.warn("Using /dev/null getter -- all incoming data will be discarded"); } if(!Guard.isStringNullOrEmpty(args.getPrefix())) { this.prefixes = ImmutableList.copyOf(args.getPrefix().split(PREFIX_SEPARATOR)); } if (args.isSync()) { LOG.info("Using sync command"); this.sync = true; } return this; }</code><technical_language>updated logging syntax: <LINK_0></technical_language>

Target:
public CliCommand init(final Arguments args) throws Exception { processCommandOptions(requiredArgs, optionalArgs, args); this.bucketName = args.getBucket(); this.priority = args.getPriority(); this.numberOfThreads = args.getNumberOfThreads(); this.directory = args.getDirectory(); if (Guard.isStringNullOrEmpty(this.directory) || directory.equals(".")) { this.outputPath = FileSystems.getDefault().getPath("."); } else { final Path dirPath = FileSystems.getDefault().getPath(directory); this.outputPath = FileSystems.getDefault().getPath(".").resolve(dirPath); } LOG.info("Output Path = {}", this.outputPath); this.discard = args.isDiscard(); if (this.discard && !Guard.isStringNullOrEmpty(directory)) { throw new CommandException("Cannot set both directory and --discard"); } if (this.discard) { LOG.warn("Using /dev/null getter -- all incoming data will be discarded"); } final String[] prefix = args.getOptionValues(PREFIXES.getOpt()); if(prefix != null && prefix.length > 0) { this.prefixes = ImmutableList.copyOf(prefix); } if (args.isSync()) { LOG.info("Using sync command"); this.sync = true; } return this; }
Source:
<code>public void finishJob() { log.info("Shutting down..."); cleanShutdown = true; shuttingDown = true; for (final Map.Entry<Long, Sink> entry : sinks.entrySet()) { persistAndMerge(entry.getKey(), entry.getValue()); } while (!sinks.isEmpty()) { try { log.info( "Cannot shut down yet! Sinks remaining: %s", Joiner.on(", ").join( Iterables.transform( sinks.values(), new Function<Sink, String>() { @Override public String apply(Sink input) { return input.getSegment().getIdentifier(); } } ) ) ); synchronized (handoffCondition) { while (!sinks.isEmpty()) { handoffCondition.wait(); } } } catch (InterruptedException e) { throw Throwables.propagate(e); } } shutdownExecutors(); stopped = true; if (!cleanShutdown) { <START> throw new ISE("Exception occurred during persist and merge."); <END> } }</code><technical_language>add exception due failed</technical_language>

Target:
public void finishJob() { log.info("Shutting down..."); shuttingDown = true; for (final Map.Entry<Long, Sink> entry : sinks.entrySet()) { persistAndMerge(entry.getKey(), entry.getValue()); } while (!sinks.isEmpty()) { try { log.info( "Cannot shut down yet! Sinks remaining: %s", Joiner.on(", ").join( Iterables.transform( sinks.values(), new Function<Sink, String>() { @Override public String apply(Sink input) { return input.getSegment().getIdentifier(); } } ) ) ); synchronized (handoffCondition) { while (!sinks.isEmpty()) { handoffCondition.wait(); } } } catch (InterruptedException e) { throw Throwables.propagate(e); } } shutdownExecutors(); stopped = true; if (!cleanShutdown) { throw new ISE("Exception occurred during persist and merge."); } }