auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void deleteRoleGroup(Context context, Collection collection, String roleID) throws SQLException, IOException, WorkflowConfigurationException { Workflow workflow = WorkflowFactory.getWorkflow(collection); Role role = workflow.getRoles().get(roleID); if(role.getScope() == Role.Scope.COLLECTION){ CollectionRole ass = CollectionRole.find(context, collection.getID(), roleID); ass.delete(); }else if(role.getScope() == Role.Scope.REPOSITORY){ Group groupToDelete = Group.findByName(context, roleID); if(groupToDelete != null){ <START> groupToDelete.delete(); <END> } } }</code><technical_language>Apologies for time verify this moment, while thinking it, is checking this group assigned in repository done Group.delete()</technical_language>

Target:
public static void deleteRoleGroup(Context context, Collection collection, String roleID) throws SQLException, IOException, WorkflowConfigurationException { Workflow workflow = WorkflowFactory.getWorkflow(collection); Role role = workflow.getRoles().get(roleID); if(role.getScope() == Role.Scope.COLLECTION){ CollectionRole ass = CollectionRole.find(context, collection.getID(), roleID); ass.delete(); } }
Source:
<code>public Map getVmStats(String uuid) { final Host host = getActiveHost(); Map resultMap = getDoneStatus(); List statusList = new ArrayList(); <START> VM vm = host.getRunningVMs().get(uuid); <END> statusList.add(fillVmStatsMap(vm)); resultMap.put("statsList", statusList); Utils.getLatency(); return resultMap; }</code><technical_language>vm null here</technical_language>

Target:
public Map getVmStats(String uuid) { final Host host = getActiveHost(); Map resultMap = getDoneStatus(); List statusList = new ArrayList(); VM vm = host.getRunningVMs().get(uuid); if (vm != null){ statusList.add(fillVmStatsMap(vm)); } resultMap.put("statsList", statusList); Utils.getLatency(); return resultMap; }
Source:
<code>public void destroyNode(String id) { <START> int event = api.getDropletApi().destroy(Integer.valueOf(id), true); <END> nodeTerminatedPredicate.apply(event); }</code><technical_language>id numeric</technical_language>

Target:
public void destroyNode(String id) { Droplet droplet = api.getDropletApi().get(Integer.valueOf(id)); final String nodeName = droplet.getName(); int event = api.getDropletApi().destroy(Integer.valueOf(id), true); nodeTerminatedPredicate.apply(event); Iterable<SshKey> keys = filter(api.getKeyPairApi().list(), new Predicate<SshKey>() { @Override public boolean apply(SshKey input) { return input.getName().equals(nodeName); } }); for (SshKey key : keys) { try { logger.info(">> deleting keypair %s...", key); api.getKeyPairApi().delete(key.getId()); } catch (RuntimeException ex) { logger.warn(ex, ">> could not delete keypair %s. You can safely delete this key pair manually", key); } } }
Source:
<code>public AbstractViewTest(boolean followBackpointers) { CorfuRuntime.overrideGetRouterFunction = this::getRouterFunction; runtime = CorfuRuntime.fromParameters(CorfuRuntimeParameters.builder() .followBackpointersEnabled(followBackpointers) <START> .garbageCollectionEnable(false) <END> .nettyEventLoop(NETTY_EVENT_LOOP) .build()); runtime.getParameters().setHoleFillRetry(0); }</code><technical_language>check AbstractIT universe framework disable gc in runtime well</technical_language>

Target:
public AbstractViewTest(boolean followBackpointers) { CorfuRuntime.overrideGetRouterFunction = this::getRouterFunction; runtime = CorfuRuntime.fromParameters(CorfuRuntimeParameters.builder() .followBackpointersEnabled(followBackpointers) .garbageCollectionEnabled(false) .nettyEventLoop(NETTY_EVENT_LOOP) .build()); runtime.getParameters().setHoleFillRetry(0); }
Source:
<code><START> public void recomputeDynamicFacets() { <END> recomputeFacets(); }</code><technical_language>update method for this case setting _dirty_ property false</technical_language>

Target:
public void recomputeDynamicFacets() { recomputeFacets(); dirty = false; }
Source:
<code>public void addLinks(List<String> sourceIds, String targetId, Session session) { MongoDBSession mongodbSession = (MongoDBSession) session; MongoCollection<Document> coll = getCollection(mongodbSession); List<Document> newDocs = sourceIds.stream() .map(sourceId -> buildDoc(sourceId, targetId)) <START> .filter(doc -> countDocuments(mongodbSession.getDirectory().databaseID, coll, <END> doc) == 0) .collect(Collectors.toList()); if (!newDocs.isEmpty()) { coll.insertMany(newDocs); } }</code><technical_language>Please move mongodbSession.getDirectory().databaseID a local variable evaluated (2 occurrences)</technical_language>

Target:
public void addLinks(List<String> sourceIds, String targetId, Session session) { MongoDBSession mongodbSession = (MongoDBSession) session; MongoCollection<Document> coll = getCollection(mongodbSession); String databaseID = mongodbSession.getDirectory().databaseID; List<Document> newDocs = sourceIds.stream() .map(sourceId -> buildDoc(sourceId, targetId)) .filter(doc -> countDocuments(databaseID, coll, doc) == 0) .collect(Collectors.toList()); if (!newDocs.isEmpty()) { coll.insertMany(newDocs); } }
Source:
<code>private RAMDirectory index() throws IOException, UnsupportedEncodingException, FileNotFoundException { RAMDirectory directory = new RAMDirectory(); IndexWriterConfig config = new IndexWriterConfig( LUCENE_VERSION, new StandardAnalyzer(LUCENE_VERSION, CharArraySet.EMPTY_SET)); config.setOpenMode(OpenMode.CREATE); IndexWriter iwriter = new IndexWriter(directory, config); for (String inputFile : inputFiles) { File file = new File(inputFile); BufferedReader titleReader = new BufferedReader( new InputStreamReader(new FileInputStream(file), "UTF-8")); String title = titleReader.readLine(); if (title != null && title.startsWith("[[")) { title = titleReader.readLine(); } titleReader.close(); <START> if (title != null) { <END> Matcher matcher = SECTION_HEADER.matcher(title); if (matcher.matches()) { title = matcher.group(1); } } else { title = ""; } String outputFile = AsciiDoctor.mapInFileToOutFile( inputFile, inExt, outExt); FileReader reader = new FileReader(file); Document doc = new Document(); doc.add(new TextField(Constants.DOC_FIELD, reader)); doc.add(new StringField( Constants.URL_FIELD, prefix + outputFile, Field.Store.YES)); doc.add(new TextField(Constants.TITLE_FIELD, title, Field.Store.YES)); iwriter.addDocument(doc); reader.close(); } iwriter.close(); return directory; }</code><technical_language>put a check for file empty, earlier in this block, skip indexing it</technical_language>

Target:
private RAMDirectory index() throws IOException, UnsupportedEncodingException, FileNotFoundException { RAMDirectory directory = new RAMDirectory(); IndexWriterConfig config = new IndexWriterConfig( LUCENE_VERSION, new StandardAnalyzer(LUCENE_VERSION, CharArraySet.EMPTY_SET)); config.setOpenMode(OpenMode.CREATE); IndexWriter iwriter = new IndexWriter(directory, config); for (String inputFile : inputFiles) { File file = new File(inputFile); if (file.length() == 0) { continue; } BufferedReader titleReader = new BufferedReader( new InputStreamReader(new FileInputStream(file), "UTF-8")); String title = titleReader.readLine(); if (title != null && title.startsWith("[[")) { title = titleReader.readLine(); } titleReader.close(); Matcher matcher = SECTION_HEADER.matcher(title); if (matcher.matches()) { title = matcher.group(1); } String outputFile = AsciiDoctor.mapInFileToOutFile( inputFile, inExt, outExt); FileReader reader = new FileReader(file); Document doc = new Document(); doc.add(new TextField(Constants.DOC_FIELD, reader)); doc.add(new StringField( Constants.URL_FIELD, prefix + outputFile, Field.Store.YES)); doc.add(new TextField(Constants.TITLE_FIELD, title, Field.Store.YES)); iwriter.addDocument(doc); reader.close(); } iwriter.close(); return directory; }
Source:
<code>private static void addJSONArrayIfPresent(JSONObject root, int index, String key, Object[] parameterSet) { if (root.has(key)) { parameterSet[index] = root.getJSONArray(key); } else { <START> parameterSet[index] = null; <END> } }</code><technical_language>values in parameters array initialized null this else clause is unnecessary</technical_language>

Target:
private static void addJSONArrayIfPresent(JSONObject root, int index, String key, Object[] parameterSet) { if (root.has(key)) { parameterSet[index] = root.getJSONArray(key); } }
Source:
<code>public static void discardAllChanges() { <START> Util.bot.toolbarButtonWithTooltip("Discard all local changes and synchronize with server").click(); <END> Util.bot.button(CommonConstants.YES).click(); }</code><technical_language>a constant</technical_language>

Target:
public static void discardAllChanges() { WorkbenchElementsValidator.bot .toolbarButtonWithTooltip( APIMConstants.DISCARD_ALL_LOCAL_CHANGES_AND_SYNCHRONIZE_WITH_SERVER) .click(); WorkbenchElementsValidator.bot.button(CommonConstants.YES).click(); }
Source:
<code>protected void initFromBuffer(ByteBuffer buf) throws IOException { m_path = new byte[buf.getInt()]; buf.get(m_path); m_stypeBytes = new byte[buf.getInt()]; buf.get(m_stypeBytes); m_nonce = new byte[buf.getInt()]; buf.get(m_nonce); m_response = PrivateVoltTableFactory.createVoltTableFromSharedBuffer(buf); <START> m_stype = SnapthotPathType.valueOf(new String(m_stypeBytes, Charsets.UTF_8)); <END> }</code><technical_language>StandardEncodings.UTF_8</technical_language>

Target:
protected void initFromBuffer(ByteBuffer buf) throws IOException { m_path = new byte[buf.getInt()]; buf.get(m_path); m_stypeBytes = new byte[buf.getInt()]; buf.get(m_stypeBytes); m_nonce = new byte[buf.getInt()]; buf.get(m_nonce); m_response = PrivateVoltTableFactory.createVoltTableFromSharedBuffer(buf); m_stype = SnapshotPathType.valueOf(new String(m_stypeBytes, Charsets.UTF_8)); }
Source:
<code>public void testRegistryConfigDocumentParse() throws Exception { File document = new File("src/test/resources/test.doc"); template.sendBody("direct:start3", document); resultEndpoint.setExpectedMessageCount(1); resultEndpoint.expectedMessagesMatches(new Predicate() { @Override public boolean matches(Exchange exchange) { Object body = exchange.getIn().getBody(String.class); Map<String, Object> headerMap = exchange.getIn().getHeaders(); assertThat(body, instanceOf(String.class)); assertThat((String) body, containsString("<body/>")); <START> assertThat(headerMap.get("TikaContent-Type"), equalTo("application/msword")); <END> return true; } }); resultEndpoint.assertIsSatisfied(); }</code><technical_language>I Content-Type is a common header, Exchange also, Exchange.CONTENT_TYPE</technical_language>

Target:
public void testRegistryConfigDocumentParse() throws Exception { File document = new File("src/test/resources/test.doc"); template.sendBody("direct:start3", document); resultEndpoint.setExpectedMessageCount(1); resultEndpoint.expectedMessagesMatches(new Predicate() { @Override public boolean matches(Exchange exchange) { Object body = exchange.getIn().getBody(String.class); Map<String, Object> headerMap = exchange.getIn().getHeaders(); assertThat(body, instanceOf(String.class)); assertThat((String) body, containsString("<body/>")); assertThat(headerMap.get(Exchange.CONTENT_TYPE), equalTo("application/msword")); return true; } }); resultEndpoint.assertIsSatisfied(); }
Source:
<code>public Report getReport(long reportId, EnumSet<ReportInclusion> includes, Integer pageSize, Integer page) throws SmartsheetException{ <START> this.checkParameters(pageSize, page); <END> String path = "reports/" + reportId; HashMap<String, String> parameters = new HashMap<String, String>(); parameters.put("include", QueryUtil.generateCommaSeparatedList(includes)); if (pageSize != null) { parameters.put("pageSize", pageSize.toString()); } if (page != null) { parameters.put("page", page.toString()); } path += QueryUtil.generateUrl(null, parameters); return this.getResource(path, Report.class); }</code><technical_language>checkParameters() validation for reasons: 1. checking for null in this function 2. preventing inputs API allows. Instead API return error if input is valid this. letting API return error find recreate of validation API constantly changing validation API changes theirs</technical_language>

Target:
public Report getReport(long reportId, EnumSet<ReportInclusion> includes, Integer pageSize, Integer page) throws SmartsheetException{ String path = "reports/" + reportId; HashMap<String, String> parameters = new HashMap<String, String>(); parameters.put("include", QueryUtil.generateCommaSeparatedList(includes)); parameters.put("pageSize", pageSize.toString()); parameters.put("page", page.toString()); path += QueryUtil.generateUrl(null, parameters); return this.getResource(path, Report.class); }
Source:
<code>public boolean updateSeenCategories(final Long accountId, final InsightCard.Category category) { final Map<String, AttributeValueUpdate> updates = Maps.newHashMap(); updates.put(MarketingInsightsSeenAttribute.CATEGORIES.shortName(), Util.addToSetAction(category.getValue())); final String now = DateTime.now(DateTimeZone.UTC).toString(DateTimeUtil.DYNAMO_DB_DATETIME_FORMAT); updates.put(MarketingInsightsSeenAttribute.UPDATED.shortName(), Util.putAction(now)); final Map<String, AttributeValue> key = getKey(accountId); final UpdateItemResult result = dynamoDBClient.updateItem(tableName, key, updates, "ALL_NEW"); if (result.getAttributes() == null) { return false; } <START> if (result.getAttributes().size() > 0) { <END> final List<String> categories = result.getAttributes().get(MarketingInsightsSeenAttribute.CATEGORIES.shortName()).getNS(); final String updatedCategory = String.valueOf(category.getValue()); if (categories.contains(updatedCategory)) { return true; } } return false; }</code><technical_language>!isEmpty()</technical_language>

Target:
public boolean updateSeenCategories(final Long accountId, final InsightCard.Category category) { final Map<String, AttributeValueUpdate> updates = Maps.newHashMap(); updates.put(MarketingInsightsSeenAttribute.CATEGORIES.shortName(), Util.addToSetAction(category.getValue())); final String now = DateTime.now(DateTimeZone.UTC).toString(DateTimeUtil.DYNAMO_DB_DATETIME_FORMAT); updates.put(MarketingInsightsSeenAttribute.UPDATED.shortName(), Util.putAction(now)); final Map<String, AttributeValue> key = getKey(accountId); final UpdateItemResult result = dynamoDBClient.updateItem(tableName, key, updates, "ALL_NEW"); if (result.getAttributes() == null) { return false; } if (!result.getAttributes().isEmpty()) { final List<String> categories = result.getAttributes().get(MarketingInsightsSeenAttribute.CATEGORIES.shortName()).getNS(); final String updatedCategory = String.valueOf(category.getValue()); if (categories.contains(updatedCategory)) { return true; } } return false; }
Source:
<code>protected Void doInBackground(Void... voids) { <START> SimperiumUtils.updateLastSeenTime(); <END> return null; }</code><technical_language>wondering if updateLastSeenTime a boolean returns true META_LAST_SEEN updated, this AsyncTask a Boolean enables skip updating badge updateLastSeenTime returns false. is updating time change anything</technical_language>

Target:
protected Boolean doInBackground(Void... voids) { return SimperiumUtils.updateLastSeenTime(); }
Source:
<code>public ResultScanner adapt( final com.google.cloud.bigtable.grpc.scanner.ResultScanner<FlatRow> bigtableResultScanner, final Span span) { return new AbstractClientScanner() { @Override public Result next() throws IOException { FlatRow row = bigtableResultScanner.next(); if (row == null) { closeSpan(); return null; } if (!hasMatchingLabels(row)) { close(); return null; } return rowAdapter.adaptResponse(row); } protected void closeSpan() { <START> try (NonThrowingCloseable s = Tracing.getTracer().withSpan(span)) { <END> span.end(); } } @Override public void close() { try { bigtableResultScanner.close(); } catch (IOException ioe) { throw Throwables.propagate(ioe); } finally { closeSpan(); } } public boolean renewLease() { throw new UnsupportedOperationException("renewLease"); } }; }</code><technical_language>s/NonThrowingCloseable/Closeable</technical_language>

Target:
public ResultScanner adapt( final com.google.cloud.bigtable.grpc.scanner.ResultScanner<FlatRow> bigtableResultScanner, final Span span) { return new AbstractClientScanner() { @Override public Result next() throws IOException { FlatRow row = bigtableResultScanner.next(); if (row == null) { closeSpan(); return null; } if (!hasMatchingLabels(row)) { close(); return null; } return rowAdapter.adaptResponse(row); } protected void closeSpan() { try (AutoCloseable c = Tracing.getTracer().withSpan(span)) { span.end(); } catch (Exception e) { } } @Override public void close() { try { bigtableResultScanner.close(); } catch (IOException ioe) { throw Throwables.propagate(ioe); } finally { closeSpan(); } } public boolean renewLease() { throw new UnsupportedOperationException("renewLease"); } }; }
Source:
<code>public boolean shouldSchedule(Queue.Task p, List<Action> actions) { for (Action action : actions) { if (action instanceof CauseAction) { for (Cause c : ((CauseAction) action).getCauses()) { if (c instanceof BranchIndexingCause) { if (p instanceof Job) { Job j = (Job) p; if (j.getParent() instanceof MultiBranchProject) { OverrideIndexTriggersJobProperty overrideProp = <START> (OverrideIndexTriggersJobProperty) j.getProperty(OverrideIndexTriggersJobProperty.class); <END> for (BranchProperty prop : ((MultiBranchProject) j.getParent()).getProjectFactory().getBranch(j).getProperties()) { if (prop instanceof NoTriggerBranchProperty && (overrideProp == null || !overrideProp.getEnableTriggers())) { return false; } } } } } } } } return true; }</code><technical_language>BTW if declare j a Job<?,?> do need cast</technical_language>

Target:
public boolean shouldSchedule(Queue.Task p, List<Action> actions) { for (Action action : actions) { if (action instanceof CauseAction) { for (Cause c : ((CauseAction) action).getCauses()) { if (c instanceof BranchIndexingCause) { if (p instanceof Job) { Job<?,?> j = (Job) p; if (j.getParent() instanceof MultiBranchProject) { OverrideIndexTriggersJobProperty overrideProp = j.getProperty(OverrideIndexTriggersJobProperty.class); if (overrideProp != null) { return overrideProp.getEnableTriggers(); } else { for (BranchProperty prop : ((MultiBranchProject) j.getParent()).getProjectFactory().getBranch(j).getProperties()) { if (prop instanceof NoTriggerBranchProperty) { return false; } } } } } } } } } return true; }
Source:
<code>public BtVodDescribedFieldsExtractor( ImageExtractor imageExtractor, TopicCreatingTopicResolver topicCreatingTopicResolver, TopicWriter topicWriter ) { this.imageExtractor = checkNotNull(imageExtractor); this.topicCreatingTopicResolver = checkNotNull(topicCreatingTopicResolver); this.topicWriter = checkNotNull(topicWriter); this.subGenreParser = new BtVodSubGenreParser(); this.topics = CacheBuilder.newBuilder() <START> .maximumSize(1000) <END> .build(); }</code><technical_language>1000</technical_language>

Target:
public BtVodDescribedFieldsExtractor( ImageExtractor imageExtractor, TopicCreatingTopicResolver topicCreatingTopicResolver, TopicWriter topicWriter ) { this.imageExtractor = checkNotNull(imageExtractor); this.topicCreatingTopicResolver = checkNotNull(topicCreatingTopicResolver); this.topicWriter = checkNotNull(topicWriter); this.subGenreParser = new BtVodSubGenreParser(); this.topics = CacheBuilder.newBuilder() .maximumSize(TOPIC_CACHE_SIZE) .build(); }
Source:
<code><START> protected Object cleanSimplePropertyValue( <END> Class<? extends PersistableBusinessObject> businessObjectClass, String propertyName, Object propertyValue) { if (propertyValue instanceof String) { return cleanStringValue(businessObjectClass, propertyName, (String) propertyValue); } else if (propertyValue instanceof Date) { return cleanDateValue(businessObjectClass, propertyName, (Date) propertyValue); } else if (propertyValue instanceof Boolean) { return cleanBooleanValue(businessObjectClass, propertyName, (Boolean) propertyValue); } else { return propertyValue; } }</code><technical_language>I this renamed cleanSimplePropertyValue handle Object types ..... a debug log statement section returning propertyValue logging instance type cleaning happened</technical_language>

Target:
protected Object cleanSimplePropertyValue( Class<? extends PersistableBusinessObject> businessObjectClass, String propertyName, Object propertyValue) { if (propertyValue instanceof String) { return cleanStringValue(businessObjectClass, propertyName, (String) propertyValue); } else if (propertyValue instanceof Date) { return cleanDateValue(businessObjectClass, propertyName, (Date) propertyValue); } else if (propertyValue instanceof Boolean) { return cleanBooleanValue(businessObjectClass, propertyName, (Boolean) propertyValue); } else if (ObjectUtils.isNull(propertyValue)) { LOG.debug("cleanSimplePropertyValue, property " + StringUtils.defaultIfBlank(propertyName, "[Blank]") + " is null on business object " + businessObjectClass.getName()); } else { LOG.debug("cleanSimplePropertyValue, no cleaning for property " + StringUtils.defaultIfBlank(propertyName, "[Blank]") + " on business object " + businessObjectClass.getName() + " (value: " + propertyValue.toString() + ")"); } return propertyValue; }
Source:
<code>private MacPool createPoolInternal(org.ovirt.engine.core.common.businessentities.MacPool macPool, boolean engineStartup) { if (macPools.containsKey(macPool.getId())) { throw new IllegalStateException(UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST); } log.debug("Creating new MacPool {}.", macPool); MacPool poolForScope = macPoolFactory.createMacPool(macPool, engineStartup); boolean isOverlapping = macPools.entrySet().stream() .anyMatch(poolEntry -> poolEntry.getKey() != poolForScope.getId() && poolEntry.getValue().overlaps(poolForScope)); if (isOverlapping) { String msg = "MAC pool '%s' overlaps with other MAC pools in the system"; log.warn(String.format(msg, macPool.getName())); <START> auditLogDirector.log(new <END> AuditLogableImpl(), AuditLogType.MAC_POOL_VIOLATES_NO_OVERLAPPING_RANGES, String.format(msg, macPool.getName())); } macPools.put(macPool.getId(), poolForScope); return poolForScope; }</code><technical_language>I if this is a vaild of auditLog</technical_language>

Target:
private MacPool createPoolInternal(org.ovirt.engine.core.common.businessentities.MacPool macPool, boolean engineStartup) { if (macPools.containsKey(macPool.getId())) { throw new IllegalStateException(UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST); } log.debug("Creating new MacPool {}.", macPool); MacPool poolForScope = macPoolFactory.createMacPool(macPool, engineStartup); List<MacPool> overlappingPools = macPools.entrySet().stream() .filter(poolEntry -> poolEntry.getKey() != poolForScope.getId() && poolEntry.getValue().overlaps(poolForScope)) .map(Map.Entry::getValue) .collect(Collectors.toList()); if (!overlappingPools.isEmpty()) { StringJoiner joiner = new StringJoiner(", "); overlappingPools.forEach(pool -> joiner.add(pool.getId().toString())); String macReport = joiner.toString(); String msg = "MAC pool '%s' overlaps with other MAC pools: [%s]"; log.warn(String.format(msg, macPool.getName(), macReport)); AuditLogableImpl auditLoggable = new AuditLogableImpl(); auditLoggable.addCustomValue("macPoolName", macPool.getName()); auditLoggable.addCustomValue("overlapping", macReport); auditLogDirector.log(auditLoggable, AuditLogType.MAC_POOL_VIOLATES_NO_OVERLAPPING_MAC_POOLS); } macPools.put(macPool.getId(), poolForScope); return poolForScope; }
Source:
<code>private void appendData(DecodedBlockNode[] decodedBlocks, int fixedWidthRowSize, List<Integer> variableWidthChannels, OutputBuffer outputBuffer) { if (decodedBlocks.length != channelCount) { throw new IllegalArgumentException(format("Unexpected number of decoded blocks %d. It should be %d.", decodedBlocks.length, channelCount)); } if (positionCount == 0) { return; } if (channelCount == 0) { bufferedRowCount += positionCount; return; } initializeBlockEncodingBuffers(decodedBlocks); <START> verify(blockEncodingBuffers != null, "blockEncodingBuffers is null"); <END> for (int i = 0; i < channelCount; i++) { blockEncodingBuffers[i].setupDecodedBlocksAndPositions(decodedBlocks[i], positions, positionCount); } populateSerializedRowSizes(fixedWidthRowSize, variableWidthChannels); int offset = 0; do { int batchSize = calculateNextBatchSize(fixedWidthRowSize, variableWidthChannels, offset); for (int i = 0; i < channelCount; i++) { blockEncodingBuffers[i].setNextBatch(offset, batchSize); blockEncodingBuffers[i].appendDataInBatch(); } bufferedRowCount += batchSize; offset += batchSize; if (bufferFull) { flush(outputBuffer); bufferFull = false; } } while (offset < positionCount); }</code><technical_language>@yingsu00 checks sense me. do need them</technical_language>

Target:
private void appendData(DecodedBlockNode[] decodedBlocks, int fixedWidthRowSize, List<Integer> variableWidthChannels, OutputBuffer outputBuffer) { if (decodedBlocks.length != channelCount) { throw new IllegalArgumentException(format("Unexpected number of decoded blocks %d. It should be %d.", decodedBlocks.length, channelCount)); } if (positionCount == 0) { return; } if (channelCount == 0) { bufferedRowCount += positionCount; return; } initializeBlockEncodingBuffers(decodedBlocks); for (int i = 0; i < channelCount; i++) { blockEncodingBuffers[i].setupDecodedBlocksAndPositions(decodedBlocks[i], positions, positionCount); } populateSerializedRowSizes(fixedWidthRowSize, variableWidthChannels); int offset = 0; do { int batchSize = calculateNextBatchSize(fixedWidthRowSize, variableWidthChannels, offset); for (int i = 0; i < channelCount; i++) { blockEncodingBuffers[i].setNextBatch(offset, batchSize); blockEncodingBuffers[i].appendDataInBatch(); } bufferedRowCount += batchSize; offset += batchSize; if (bufferFull) { flush(outputBuffer); bufferFull = false; } } while (offset < positionCount); }
Source:
<code>private void writeHeaderLong(FileSmoosher smoosher, RandomAccessFile headerFile, int bagSizePower, byte[] buffer) throws IOException { ByteBuffer helperBuffer = ByteBuffer.allocate(Ints.BYTES).order(ByteOrder.nativeOrder()); try (CountingOutputStream finalHeaderOut = new CountingOutputStream( ioPeon.makeOutputStream(makeFilename("header_final")))) { int numberOfElementsPerValueFile = 1 << bagSizePower; long currentNumBytes = 0; long relativeRefBytes = 0; long relativeNumBytes; headerFile.seek(0); for (int pos = 0; pos < numWritten; pos++) { if ((pos & (numberOfElementsPerValueFile - 1)) == 0) { relativeRefBytes = currentNumBytes; <START> numberOfElementsPerValueFile = 1 << bagSizePower; <END> } currentNumBytes = Long.reverseBytes(headerFile.readLong()); relativeNumBytes = currentNumBytes - relativeRefBytes; helperBuffer.putInt(0, Ints.checkedCast(relativeNumBytes)); finalHeaderOut.write(helperBuffer.array()); } long numBytesToPutInFile = finalHeaderOut.getCount(); finalHeaderOut.close(); try (InputStream is = new FileInputStream(ioPeon.getFile(makeFilename("header_final")))) { try (SmooshedWriter smooshChannel = smoosher .addWithSmooshedWriter(generateHeaderFileName(filenameBase), numBytesToPutInFile)) { writeBytesIntoSmooshedChannel(numBytesToPutInFile, buffer, smooshChannel, is); } } } }</code><technical_language>This line removed</technical_language>

Target:
private void writeHeaderLong(FileSmoosher smoosher, RandomAccessFile headerFile, int bagSizePower, byte[] buffer) throws IOException { ByteBuffer helperBuffer = ByteBuffer.allocate(Ints.BYTES).order(ByteOrder.nativeOrder()); try (CountingOutputStream finalHeaderOut = new CountingOutputStream( ioPeon.makeOutputStream(makeFilename("header_final")))) { int numberOfElementsPerValueFile = 1 << bagSizePower; long currentNumBytes = 0; long relativeRefBytes = 0; long relativeNumBytes; headerFile.seek(0); for (int pos = 0; pos < numWritten; pos++) { if ((pos & (numberOfElementsPerValueFile - 1)) == 0) { relativeRefBytes = currentNumBytes; } currentNumBytes = Long.reverseBytes(headerFile.readLong()); relativeNumBytes = currentNumBytes - relativeRefBytes; writeIntValueToOutputStream(helperBuffer, Ints.checkedCast(relativeNumBytes), finalHeaderOut); } long numBytesToPutInFile = finalHeaderOut.getCount(); finalHeaderOut.close(); try (InputStream is = new FileInputStream(ioPeon.getFile(makeFilename("header_final")))) { try (SmooshedWriter smooshChannel = smoosher .addWithSmooshedWriter(generateHeaderFileName(filenameBase), numBytesToPutInFile)) { writeBytesIntoSmooshedChannel(numBytesToPutInFile, buffer, smooshChannel, is); } } } }
Source:
<code>private static XMLInputFactory getOrCreateInputFactory() throws FactoryConfigurationError { if (ourInputFactory == null) { try { Class.forName("ca.uhn.fhir.repackage.javax.xml.stream.XMLInputFactory"); System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory"); } catch (ClassNotFoundException e) { } XMLInputFactory inputFactory = newInputFactory(); if (!ourHaveLoggedStaxImplementation) { logStaxImplementation(inputFactory.getClass()); } inputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false); inputFactory.setProperty("javax.xml.stream.isSupportingExternalEntities", false); try { Class.forName("com.ctc.wstx.stax.WstxInputFactory"); boolean isWoodstox = inputFactory instanceof com.ctc.wstx.stax.WstxInputFactory; if ( !isWoodstox ) { try { isWoodstox = inputFactory.getProperty( "org.codehaus.stax2.implVersion" ) != null; } <START> catch ( IllegalArgumentException e ) <END> { } } if (isWoodstox) { inputFactory.setProperty(WstxInputProperties.P_UNDECLARED_ENTITY_RESOLVER, XML_RESOLVER); try { inputFactory.setProperty(WstxInputProperties.P_MAX_ATTRIBUTE_SIZE, "100000000"); } catch (IllegalArgumentException e) { } } } catch (ClassNotFoundException e) { ourLog.debug("WstxOutputFactory (Woodstox) not found on classpath"); } ourInputFactory = inputFactory; } return ourInputFactory; }</code><technical_language>extra safe, sense catch Exception here</technical_language>

Target:
private static XMLInputFactory getOrCreateInputFactory() throws FactoryConfigurationError { if (ourInputFactory == null) { try { Class.forName("ca.uhn.fhir.repackage.javax.xml.stream.XMLInputFactory"); System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory"); } catch (ClassNotFoundException e) { } XMLInputFactory inputFactory = newInputFactory(); if (!ourHaveLoggedStaxImplementation) { logStaxImplementation(inputFactory.getClass()); } inputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false); inputFactory.setProperty("javax.xml.stream.isSupportingExternalEntities", false); try { Class.forName("com.ctc.wstx.stax.WstxInputFactory"); boolean isWoodstox = inputFactory instanceof com.ctc.wstx.stax.WstxInputFactory; if ( !isWoodstox ) { try { isWoodstox = inputFactory.getProperty( "org.codehaus.stax2.implVersion" ) != null; } catch ( Exception e ) { } } if (isWoodstox) { inputFactory.setProperty(WstxInputProperties.P_UNDECLARED_ENTITY_RESOLVER, XML_RESOLVER); try { inputFactory.setProperty(WstxInputProperties.P_MAX_ATTRIBUTE_SIZE, "100000000"); } catch (IllegalArgumentException e) { } } } catch (ClassNotFoundException e) { ourLog.debug("WstxOutputFactory (Woodstox) not found on classpath"); } ourInputFactory = inputFactory; } return ourInputFactory; }
Source:
<code>public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal(out); out.writeUTF(bulkImportDirectory); out.writeBoolean(samplingOnly); out.writeBoolean(outputKeysOnly); out.writeBoolean(skipSampling); out.writeUTF(indexName); out.writeDouble(sampleFraction); <START> ArrayUtil.writeByteArray(out, token); <END> }</code><technical_language>In super class InsertTAableWriterBuilder, readExternal writeExternal code serialize dese token, need here</technical_language>

Target:
public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal(out); out.writeUTF(bulkImportDirectory); out.writeBoolean(samplingOnly); out.writeBoolean(outputKeysOnly); out.writeBoolean(skipSampling); out.writeUTF(indexName); out.writeDouble(sampleFraction); }
Source:
<code>public RegisteredService findServiceBy(final long id) { <START> RegisteredService result = this.services.get(id); <END> if (result == null) { result = this.serviceRegistry.findServiceById(id); } return validateRegisteredService(result); }</code><technical_language>suggestion var result = this.services.get(id);</technical_language>

Target:
public RegisteredService findServiceBy(final long id) { val result = this.services.get(id, k -> this.serviceRegistry.findServiceById(id)); return validateRegisteredService(result); }
Source:
<code>for (Class<? extends Context> contextClass: CONTEXT_CLASSES) { Map<String, Attribute<?>> simpleAttributeNameToAttribute = Maps.newHashMap(); CONTEXT_TO_ATTRIBUTE_NAME_TO_ATTRIBUTE.put(contextClass, simpleAttributeNameToAttribute); <START> Set<Attribute<Object>> attributes = AttributeInitializer.getAttributesNoSave(contextClass); <END> LOG.debug("context class and attributes {}", contextClass, attributes); for (Attribute<Object> attribute: attributes) { simpleAttributeNameToAttribute.put(AttributeParseUtils.getSimpleName(attribute), attribute); } }</code><technical_language>getAttributes instead</technical_language>

Target:
for (Class<? extends Context> contextClass: CONTEXT_CLASSES) { Set<String> contextAttributes = Sets.newHashSet(); Field[] fields = contextClass.getDeclaredFields(); for (Field field: fields) { if (!Attribute.class.isAssignableFrom(field.getType())) { continue; } contextAttributes.add(field.getName()); } CONTEXT_CLASS_TO_ATTRIBUTES.put(contextClass, contextAttributes); }
Source:
<code><START> public static String createSubscriptionListUri(final Optional<String> owningApplication, <END> final Set<String> eventTypes, final int offset, final int limit) { final StringBuilder urlBuilder = new StringBuilder("/subscriptions?"); if (!eventTypes.isEmpty()) { eventTypes.stream() .map(et -> format("event_type={0}", et)) .forEach(et -> urlBuilder.append(et).append("&")); } owningApplication.ifPresent(owningApp -> urlBuilder .append("owning_application=") .append(owningApp) .append("&")); urlBuilder .append("offset=") .append(offset) .append("&limit=") .append(limit); return urlBuilder.toString(); }</code><technical_language>a consideration use: <LINK_0></technical_language>

Target:
public static String createSubscriptionListUri(final Optional<String> owningApplication, final Set<String> eventTypes, final int offset, final int limit) { final UriComponentsBuilder urlBuilder = UriComponentsBuilder.fromPath("/subscriptions"); if (!eventTypes.isEmpty()) { urlBuilder.queryParam("event_type", eventTypes.toArray()); } owningApplication.ifPresent(owningApp -> urlBuilder.queryParam("owning_application", owningApp)); return urlBuilder .queryParam("offset", offset) .queryParam("limit", limit) .build() .toString(); }
Source:
<code>public void validate(final boolean binary) { if (binary) { <START> throw new RuntimeException("Programmer error: wrong validator used"); <END> } }</code><technical_language>IllegalStateException match intent a a bare RuntimeException</technical_language>

Target:
public void validate(final boolean binary) { if (binary) { throw new IllegalStateException("Programmer error: wrong validator used"); } }
Source:
<code>public void testDeserialize() { <START> String jsonStr = "[\"2016-06-20T04:25:16.218+0000\", \"2016-06-20T04:25:16\", \"2016-06-20T04:25:16.218Z\",\"2015-05-28T18:01:57Z\",\"2016-06-20T04:25:16.218+0000\"]"; <END> JsonParser parser = new JsonParser(); JsonElement element = parser.parse(jsonStr); DateDeserializer deserializer = new DateDeserializer(); for (int i = 0; i < 5; i++) { assertTrue(deserializer.deserialize(element.getAsJsonArray().get(i), null, null) != null); } }</code><technical_language>bigger 120 characters</technical_language>

Target:
public void testDeserialize() { String[] dateStrings = {"2016-06-20T04:25:16.218+0000", "2016-06-20T04:25:16", "2016-06-20T04:25:16.218Z", "2015-05-28T18:01:57Z", "2016-06-20T04:25:16.218+0000"}; String jsonStr = "[\"" + StringUtils.join(dateStrings,"\",\"") + "\"]"; JsonParser parser = new JsonParser(); JsonElement element = parser.parse(jsonStr); DateDeserializer deserializer = new DateDeserializer(); for (int i = 0; i < 5; i++) { assertTrue(deserializer.deserialize(element.getAsJsonArray().get(i), null, null) != null); } }
Source:
<code>private void addReferenceUpdates(IProgressMonitor pm) { pm.beginTask("", fReferences.length); String editName= RefactoringCoreMessages.RenameFieldRefactoring_Update_field_reference; for (SearchResultGroup <START> fReference : <END> fReferences) { ICompilationUnit cu= fReference.getCompilationUnit(); if (cu == null) continue; SearchMatch[] results= fReference.getSearchResults(); for (SearchMatch result : results) { addTextEdit(fChangeManager.get(cu), editName, createTextChange(result)); } pm.worked(1); } }</code><technical_language>rename reference</technical_language>

Target:
private void addReferenceUpdates(IProgressMonitor pm) { pm.beginTask("", fReferences.length); String editName= RefactoringCoreMessages.RenameFieldRefactoring_Update_field_reference; for (SearchResultGroup reference : fReferences) { ICompilationUnit cu= reference.getCompilationUnit(); if (cu == null) continue; for (SearchMatch result : reference.getSearchResults()) { addTextEdit(fChangeManager.get(cu), editName, createTextChange(result)); } pm.worked(1); } }
Source:
<code>protected void onDestroy() { super.onDestroy(); if (mSched != null) { <START> mSched.setCurrentCard(null); <END> } Timber.d("onDestroy()"); if (mSpeakText) { ReadText.releaseTts(); } if (mUnmountReceiver != null) { unregisterReceiver(mUnmountReceiver); } if (mCardFrame != null) { mCardFrame.removeAllViews(); } destroyWebView(mCard); }</code><technical_language>mSched.discardPrefetchedCard similar more descriptive</technical_language>

Target:
protected void onDestroy() { super.onDestroy(); if (mSched != null) { mSched.discardCurrentCard(); } Timber.d("onDestroy()"); if (mSpeakText) { ReadText.releaseTts(); } if (mUnmountReceiver != null) { unregisterReceiver(mUnmountReceiver); } if (mCardFrame != null) { mCardFrame.removeAllViews(); } destroyWebView(mCard); }
Source:
<code>static void brandGlowEffect(Context context, int brandColor) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { try { int glowDrawableId = context.getResources().getIdentifier("overscroll_glow", "drawable", "android"); Drawable androidGlow = context.getResources().getDrawable(glowDrawableId); <START> assert androidGlow != null; <END> androidGlow.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN); int edgeDrawableId = context.getResources().getIdentifier("overscroll_edge", "drawable", "android"); Drawable androidEdge = context.getResources().getDrawable(edgeDrawableId); assert androidEdge != null; androidEdge.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN); } catch (Exception ignored) { } } }</code><technical_language>this added</technical_language>

Target:
static void brandGlowEffect(Context context, int brandColor) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { try { int glowDrawableId = context.getResources().getIdentifier("overscroll_glow", "drawable", "android"); Drawable androidGlow = context.getResources().getDrawable(glowDrawableId); androidGlow.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN); int edgeDrawableId = context.getResources().getIdentifier("overscroll_edge", "drawable", "android"); Drawable androidEdge = context.getResources().getDrawable(edgeDrawableId); androidEdge.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN); } catch (Exception ignored) { } } }
Source:
<code>public void onShoppingCartQuantityUpdated_updatesViewWithNewQuantity_whenCartItemIsSameAsCurrentOne() { <START> int newQuantity = 414; <END> ShoppingCartQuantityChangeEvent updateEvent = new ShoppingCartQuantityChangeEvent(currentShoppingCartItem, newQuantity); presenter.onShoppingCartQuantityChanged(updateEvent); verify(view).updateQuantity(newQuantity); }</code><technical_language>extract in a constant capitalize name add a const</technical_language>

Target:
public void onShoppingCartQuantityUpdated_updatesViewWithNewQuantity_whenCartItemIsSameAsCurrentOne() { ShoppingCartQuantityChangeEvent updateEvent = new ShoppingCartQuantityChangeEvent(currentShoppingCartItem, NEW_QUANTITY); presenter.onShoppingCartQuantityChanged(updateEvent); verify(view).updateQuantity(NEW_QUANTITY); }
Source:
<code><START> public IpUtil() throws RuntimeException { <END> ipAddressMatcherCache = new HashMap<String, IpAddressMatcher>(); for (String proxyIp : trustedProxies) { String sanitizedProxyIp = proxyIp.trim(); try { IpAddressMatcher matcher = new IpAddressMatcher(sanitizedProxyIp); ipAddressMatcherCache.put(sanitizedProxyIp, matcher); } catch (IllegalArgumentException ex) { throw new RuntimeException("Invalid entries found in the default trusted proxies list", ex); } } }</code><technical_language>exception unchecked clear do expect happen</technical_language>

Target:
public IpUtil() { ipAddressMatcherCache = new HashSet<IpAddressMatcher>(); for (String proxyIp : trustedProxies) { String sanitizedProxyIp = proxyIp.trim(); try { IpAddressMatcher matcher = new IpAddressMatcher(sanitizedProxyIp); ipAddressMatcherCache.add(matcher); } catch (IllegalArgumentException e) { throw new RuntimeException("Invalid entry '" + proxyIp + "' found in the default trusted proxies list", e); } } }
Source:
<code><START> private boolean isValidOperation(@NonNull final ContentProviderOperation operation) { <END> return !NO_OPERATION.equals(operation); }</code><technical_language>static</technical_language>

Target:
private static boolean isValidOperation(@NonNull final ContentProviderOperation operation) { return !NO_OPERATION.equals(operation); }
Source:
<code><START> @NotNull private Cache makeCache() throws IOException { <END> File cacheDir = File.createTempFile("cache-", ".dir"); cacheDir.delete(); return new Cache(cacheDir, 1024 * 1024); }</code><technical_language>@NotNull in OkHttp code. <LINK_0></technical_language>

Target:
private Cache makeCache() throws IOException { File cacheDir = File.createTempFile("cache-", ".dir"); cacheDir.delete(); return new Cache(cacheDir, 1024 * 1024); }
Source:
<code>public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateConditionalEvent emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_EDGES_TOP_LEVEL_EVENT_ID, HAS_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertConditionalEventExecutionSet(emptyEvent.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_ERPRESSION_TYPE, CANCELLING, <START> ""); <END> }</code><technical_language>suggestion EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateConditionalEvent emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_EDGES_TOP_LEVEL_EVENT_ID, HAS_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertConditionalEventExecutionSet(emptyEvent.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_ERPRESSION_TYPE, CANCELLING, EMPTY_VALUE); }
Source:
<code>public void register() throws IOException { initSystemDirectory(); InetSocketAddress socketAddress = conf.getSocketAddrVar(ConfVars.TAJO_MASTER_UMBILICAL_RPC_ADDRESS); <START> this.masterName = socketAddress.getAddress().getHostName()+ ":" + socketAddress.getPort(); <END> monitorInterval = conf.getIntVar(ConfVars.TAJO_MASTER_HA_MONITOR_INTERVAL); FileStatus[] files = fs.listStatus(activePath); if (files.length == 0) { createMasterFile(true); currentActiveMaster = masterName; LOG.info(String.format("This is added to active master (%s)", masterName)); } else { Path activePath = files[0].getPath(); currentActiveMaster = activePath.getName().replaceAll("_", ":"); if (!HAServiceUtil.isMasterAlive(currentActiveMaster, conf)) { fs.delete(activePath, true); createMasterFile(true); currentActiveMaster = masterName; LOG.info(String.format("This is added to active master (%s)", masterName)); } else { if (!currentActiveMaster.equals(masterName)) { createMasterFile(false); LOG.info(String.format("This is added to backup masters (%s)", masterName)); } else { LOG.info(String.format("This has already been added to active master (%s)", masterName)); } } } }</code><technical_language>If a hostname is FQDN, throw unknown host exception. In opinion, ip address is more safety. do think</technical_language>

Target:
public void register() throws IOException { initSystemDirectory(); InetSocketAddress socketAddress = conf.getSocketAddrVar(ConfVars.TAJO_MASTER_UMBILICAL_RPC_ADDRESS); this.masterName = socketAddress.getAddress().getHostAddress() + ":" + socketAddress.getPort(); monitorInterval = conf.getIntVar(ConfVars.TAJO_MASTER_HA_MONITOR_INTERVAL); FileStatus[] files = fs.listStatus(activePath); if (files.length == 0) { createMasterFile(true); currentActiveMaster = masterName; LOG.info(String.format("This is added to active master (%s)", masterName)); } else { Path activePath = files[0].getPath(); currentActiveMaster = activePath.getName().replaceAll("_", ":"); if (!HAServiceUtil.isMasterAlive(currentActiveMaster, conf)) { fs.delete(activePath, true); createMasterFile(true); currentActiveMaster = masterName; LOG.info(String.format("This is added to active master (%s)", masterName)); } else { if (!currentActiveMaster.equals(masterName)) { createMasterFile(false); LOG.info(String.format("This is added to backup masters (%s)", masterName)); } else { LOG.info(String.format("This has already been added to active master (%s)", masterName)); } } } }
Source:
<code>public long getLastModified(K src) { if (src instanceof URL) { URLConnection conn = null; try { conn = ((URL) src).openConnection(); final long v = conn.getLastModified(); return v != -1 ? v : 0; } catch (Throwable ex) { return -1; } finally { if (conn != null) { try { conn.getInputStream().close(); <START> } catch (Exception ignored) { } <END> } } } else if (src instanceof File) { final long v = ((File) src).lastModified(); return v == -1 ? 0 : v == 0 ? -1 : v; } else if (src == null) { throw new NullPointerException(); } else { throw new IllegalArgumentException("Unknown source: " + src + "\nOnly File and URL are supported"); } }</code><technical_language>log</technical_language>

Target:
public long getLastModified(K src) { if (src instanceof URL) { URLConnection conn = null; try { conn = ((URL) src).openConnection(); final long v = conn.getLastModified(); return v != -1 ? v : 0; } catch (Throwable ex) { return -1; } finally { if (conn != null) { try { conn.getInputStream().close(); } catch (Throwable e) { log.warn("The connection cannot be closed", e); } } } } else if (src instanceof File) { final long v = ((File) src).lastModified(); return v == -1 ? 0 : v == 0 ? -1 : v; } else if (src == null) { throw new NullPointerException(); } else { throw new IllegalArgumentException("Unknown source: " + src + "\nOnly File and URL are supported"); } }
Source:
<code>public RegexParseSpec( @JsonProperty("timestampSpec") TimestampSpec timestampSpec, @JsonProperty("dimensionsSpec") DimensionsSpec dimensionsSpec, @JsonProperty("listDelimiter") String listDelimiter, @JsonProperty("columns") List<String> columns, @JsonProperty("pattern") String pattern ) { super(timestampSpec, dimensionsSpec); this.listDelimiter = listDelimiter; <START> Preconditions.checkNotNull(columns, "columns"); <END> this.columns = columns; this.pattern = pattern; verify(dimensionsSpec.getDimensions()); }</code><technical_language>want this optional</technical_language>

Target:
public RegexParseSpec( @JsonProperty("timestampSpec") TimestampSpec timestampSpec, @JsonProperty("dimensionsSpec") DimensionsSpec dimensionsSpec, @JsonProperty("listDelimiter") String listDelimiter, @JsonProperty("columns") List<String> columns, @JsonProperty("pattern") String pattern ) { super(timestampSpec, dimensionsSpec); this.listDelimiter = listDelimiter; this.columns = columns; this.pattern = pattern; verify(dimensionsSpec.getDimensions()); }