auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void recordLatency(Response<? extends Request> response, String operation) { Serializable start = response.getRequest().getPropertyValue(METRICS_OPERATION_START); long latency = calculateLatency((Long) start); if (latency > 0) { DistributionSummary.builder(metricName(METRIC_PREFIX, operation, "latency")) .baseUnit("milliseconds") .tags("successful", Boolean.toString(response.getProcessingErrors().isEmpty())) .publishPercentiles(0.5, 0.95) .register(Metrics.globalRegistry) .record(latency); } }

Target:
private void recordLatency(Response<? extends Request> response, String operation) { Serializable start = response.getRequest().getPropertyValue(METRICS_OPERATION_START); long latency = calculateLatency((Long) start); if (latency <= 0) { LOGGER.debug("Detected an invalid latency for given start time [{}]", latency, start); return; } DistributionSummary.builder(metricName(METRIC_PREFIX, operation, "latency")) .baseUnit("milliseconds") .tags("successful", Boolean.toString(response.getProcessingErrors().isEmpty())) .publishPercentiles(0.5, 0.95) .register(Metrics.globalRegistry) .record(latency); }
Source:
private PackageDataModelOracleIncrementalPayload createAddressPayload() { PackageDataModelOracleIncrementalPayload payload = new PackageDataModelOracleIncrementalPayload(); HashMap<String, ModelField[]> addressModelFields = new HashMap<String, ModelField[]>(); addressModelFields.put( "org.Address", new ModelField[]{ new ModelField( "this", "org.Address", ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS, ModelField.FIELD_ORIGIN.SELF, FieldAccessorsAndMutators.ACCESSOR, "this" ), new ModelField( "street", "String", ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS, ModelField.FIELD_ORIGIN.DECLARED, FieldAccessorsAndMutators.BOTH, DataType.TYPE_STRING ), new ModelField( "homeAddress", "Boolean", ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS, ModelField.FIELD_ORIGIN.DECLARED, FieldAccessorsAndMutators.BOTH, DataType.TYPE_BOOLEAN ), new ModelField( "number", "java.lang.Integer", ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS, ModelField.FIELD_ORIGIN.DECLARED, FieldAccessorsAndMutators.BOTH, DataType.TYPE_NUMERIC_INTEGER )} ); payload.setModelFields( addressModelFields ); return payload; }

Target:
private PackageDataModelOracleIncrementalPayload createAddressPayload() { PackageDataModelOracleIncrementalPayload payload = new PackageDataModelOracleIncrementalPayload(); HashMap<String, ModelField[]> addressModelFields = new HashMap<String, ModelField[]>(); addressModelFields.put( "org.Address", new ModelField[]{ new ModelField( "this", "org.Address", ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS, ModelField.FIELD_ORIGIN.SELF, FieldAccessorsAndMutators.ACCESSOR, "this" ), new ModelField( "street", "String", ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS, ModelField.FIELD_ORIGIN.DECLARED, FieldAccessorsAndMutators.BOTH, DataType.TYPE_STRING ), new ModelField( "homeAddress", "Boolean", ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS, ModelField.FIELD_ORIGIN.DECLARED, FieldAccessorsAndMutators.BOTH, DataType.TYPE_BOOLEAN ), new ModelField( "number", Integer.class.getName(), ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS, ModelField.FIELD_ORIGIN.DECLARED, FieldAccessorsAndMutators.BOTH, DataType.TYPE_NUMERIC_INTEGER )} ); payload.setModelFields( addressModelFields ); return payload; }
Source:
private boolean processRow(String line) { List<String> values = ImmutableList.copyOf(ON_COMMA.split(line)); if (Iterables.size(values) < 8) { return true; } BbcGenreTree.Builder genreTree = BbcGenreTree.builder(genresPrefix + values.get(0)); if (!Strings.isNullOrEmpty(values.get(1))) { genreTree.withSecondLevelGenre(genresPrefix + stripQuotationMarks(values.get(1))); } if (!Strings.isNullOrEmpty(values.get(2))) { genreTree.withThirdLevelGenre(genresPrefix + stripQuotationMarks(values.get(2))); } mapping.put(genreTree.build(), parseYouViewGenres(Iterables.skip(values, 4))); return true; }

Target:
private boolean processRow(String line) { List<String> values = ImmutableList.copyOf(ON_COMMA.split(line)); if (Iterables.size(values) < 8) { throw new RuntimeException("Error processing line " + line + ", expected 8 items per line"); } BbcGenreTree.Builder genreTree = BbcGenreTree.builder(genresPrefix + values.get(0)); if (!Strings.isNullOrEmpty(values.get(1))) { genreTree.withSecondLevelGenre(genresPrefix + stripQuotationMarks(values.get(1))); } if (!Strings.isNullOrEmpty(values.get(2))) { genreTree.withThirdLevelGenre(genresPrefix + stripQuotationMarks(values.get(2))); } mapping.put(genreTree.build(), parseYouViewGenres(Iterables.skip(values, 4))); return true; }
Source:
public static String doGetFeatureUrl(String srs, JSONObject download, boolean addNameSpace) throws JSONException { String getFeatureUrl = ""; StringWriter s = new StringWriter(); s.append(PropertyUtil.get("download.basket.wfs.service.url")); if (addNameSpace) { s.append("?SERVICE=wfs&version=1.0.0&request=GetFeature&srsName=" + srs + "&outputFormat=SHAPE-ZIP&typeNames=" + download.getString(PARAM_LAYER)); } else { s.append("?SERVICE=wfs&version=1.0.0&request=GetFeature&srsName=" + srs + "&outputFormat=SHAPE-ZIP&typeNames=" + Helpers.getLayerNameWithoutNameSpace(download.getString(PARAM_LAYER))); } getFeatureUrl = s.toString(); return getFeatureUrl; }

Target:
public static String doGetFeatureUrl(String srs, JSONObject download, boolean addNameSpace) throws JSONException { String getFeatureUrl = ""; StringBuilder s = new StringBuilder(); s.append(PropertyUtil.get("oskari.wfs.service.url")); s.append("?SERVICE=wfs&version=1.0.0&request=GetFeature&srsName="); s.append(srs); s.append("&outputFormat=SHAPE-ZIP&typeNames="); if (addNameSpace) { s.append(download.getString(PARAM_LAYER)); } else { s.append(Helpers.getLayerNameWithoutNameSpace(download.getString(PARAM_LAYER))); } getFeatureUrl = s.toString(); return getFeatureUrl; }
Source:
public void init() throws DBException { _db.init(); this.reportLatencyForEachError = Boolean.parseBoolean(getProperties(). getProperty("reportlatencyforeacherror", "false")); String latencyTrackedErrors = getProperties().getProperty( "latencytrackederrors", null); if (latencyTrackedErrors != null) { this.latencyTrackedErrors = new HashSet<String>(Arrays.asList( latencyTrackedErrors.split(","))); } System.out.println("DBWrapper: report latency for each error is " + this.reportLatencyForEachError + " and specific error codes to track" + " for latency are: " + this.latencyTrackedErrors.toString()); }

Target:
public void init() throws DBException { _db.init(); this.reportLatencyForEachError = Boolean.parseBoolean(getProperties(). getProperty(REPORT_LATENCY_FOR_EACH_ERROR_PROPERTY, REPORT_LATENCY_FOR_EACH_ERROR_PROPERTY_DEFAULT)); if (!reportLatencyForEachError) { String latencyTrackedErrors = getProperties().getProperty( LATENCY_TRACKED_ERRORS_PROPERTY, null); if (latencyTrackedErrors != null) { this.latencyTrackedErrors = new HashSet<String>(Arrays.asList( latencyTrackedErrors.split(","))); } } System.err.println("DBWrapper: report latency for each error is " + this.reportLatencyForEachError + " and specific error codes to track" + " for latency are: " + this.latencyTrackedErrors.toString()); }
Source:
public ProductInfo createProduct(ProductInfo pinfo) { if (pinfo == null) { throw new IllegalArgumentException("pinfo is null"); } if (StringUtils.isBlank(pinfo.getId())) { throw new IllegalArgumentException("product is lacking an identifier: " + pinfo); } if (this.productMap.containsKey(pinfo.getId())) { throw new IllegalStateException("product already exists: " + pinfo.getId()); } ProductData pdata = new ProductData(); pdata.setId(pinfo.getId()); pdata.setProductContent(this.resolveProductContent(pinfo.getProductContent())); pdata.setName(pinfo.getName()); pdata.setMultiplier(pinfo.getMultiplier()); pdata.setAttributes(pinfo.getAttributes()); pdata.setDependentProductIds(pinfo.getDependentProductIds()); pdata.setCreated(new Date()); pdata.setUpdated(new Date()); pdata.setBranding(this.resolveBranding(pinfo.getBranding())); pdata.setProvidedProducts(this.resolveProvidedProducts(pinfo.getProvidedProducts())); this.productMap.put(pdata.getId(), pdata); this.productSubscriptionMap.put(pdata.getId(), new HashSet<>()); this.updateProductContentMappings(pdata); return pdata; }

Target:
public ProductInfo createProduct(ProductInfo pinfo) { if (pinfo == null) { throw new IllegalArgumentException("pinfo is null"); } if (StringUtils.isBlank(pinfo.getId())) { throw new IllegalArgumentException("product is lacking an identifier: " + pinfo); } if (this.productMap.containsKey(pinfo.getId())) { throw new IllegalStateException("product already exists: " + pinfo.getId()); } ProductData pdata = new ProductData(); pdata.setId(pinfo.getId()); pdata.setProductContent(this.resolveProductContent(pinfo.getProductContent())); pdata.setName(pinfo.getName()); pdata.setMultiplier(pinfo.getMultiplier()); pdata.setAttributes(pinfo.getAttributes()); pdata.setDependentProductIds(pinfo.getDependentProductIds()); pdata.setCreated(new Date()); pdata.setUpdated(new Date()); pdata.setBranding(this.resolveBranding(pinfo.getBranding())); pdata.setProvidedProducts(this.resolveProducts(pinfo.getProvidedProducts())); this.productMap.put(pdata.getId(), pdata); this.productSubscriptionMap.put(pdata.getId(), new HashSet<>()); this.updateProductContentMappings(pdata); return pdata; }
Source:
public List<String> getHeaders(String name) { MultivaluedMap<String, String> headers = requestContext.getMutableHeaders(); System.out.println(headers.get(name)); return headers.get(name); }

Target:
public List<String> getHeaders(String name) { MultivaluedMap<String, String> headers = requestContext.getMutableHeaders(); return headers.get(name); }
Source:
public Boolean call() throws Exception { long sleepBackoff = 200L, maxSleep = 0L; do { final PoolEntry poolEntry = createPoolEntry(); if (poolEntry != null) { connectionBag.add(poolEntry); return Boolean.TRUE; } else if (poolEntry == MAXED_POOL_MARKER) { return Boolean.FALSE; } else if (maxSleep == sleepBackoff) { return Boolean.FALSE; } maxSleep = sleepBackoff; quietlySleep(sleepBackoff); sleepBackoff = Math.min(connectionTimeout / 2, (long) (sleepBackoff * 1.3)); } while (true); }

Target:
public Boolean call() throws Exception { long sleepBackoff = 200L; do { if (totalConnections.get() + 1 > config.getMaximumPoolSize()) { return Boolean.FALSE; } final PoolEntry poolEntry = createPoolEntry(); if (poolEntry != null) { totalConnections.incrementAndGet(); connectionBag.add(poolEntry); return Boolean.TRUE; } quietlySleep(sleepBackoff); sleepBackoff = Math.min(connectionTimeout / 2, (long) (sleepBackoff * 1.3)); } while (true); }
Source:
private void createFeatures(ArcGISMap map){ LayerList layers = map.getOperationalLayers(); for(Layer layer: layers){ FeatureLayer fLayer = (FeatureLayer) layer; if(fLayer.getName().contains("Alaska National Parks")){ mOperationalLayers.add(fLayer); } } List<ArcGISFeatureTable> tables = map.getTables(); final ArcGISFeatureTable speciesFeatureTable = tables.get(0); speciesFeatureTable.addDoneLoadingListener(new Runnable() { @Override public void run() { Log.d(TAG, "Found table: " + speciesFeatureTable.getTableName()); } }); speciesFeatureTable.loadAsync(); }

Target:
private void createFeatures(ArcGISMap map){ LayerList layers = map.getOperationalLayers(); for(Layer layer: layers){ FeatureLayer fLayer = (FeatureLayer) layer; if(fLayer.getName().contains("Alaska National Parks")){ mOperationalLayers.add(fLayer); } } }
Source:
public <E extends RealmObject> void createAllFromJson(Class<E> clazz, JSONArray json) { if (clazz == null || json == null) { return; } for (int i = 0; i < json.length(); i++) { try { configuration.getSchemaMediator().createOrUpdateUsingJsonObject(clazz, this, json.getJSONObject(i), false); } catch (JSONException e) { throw new RealmException("Could not map Json", e); } } }

Target:
public <E extends RealmModel> void createAllFromJson(Class<E> clazz, JSONArray json) { if (clazz == null || json == null) { return; } for (int i = 0; i < json.length(); i++) { try { configuration.getSchemaMediator().createOrUpdateUsingJsonObject(clazz, this, json.getJSONObject(i), false); } catch (JSONException e) { throw new RealmException("Could not map JSON", e); } } }
Source:
protected ClusterState execute(ClusterState currentState, AlterTableRequest request) throws Exception { Index[] concreteIndices = indexNameExpressionResolver.concreteIndices(currentState, INDICES_OPTIONS, request.tableIdent().indexNameOrAlias()); if (request.isPartitioned()) { if (request.partitionIndexName() != null) { concreteIndices = indexNameExpressionResolver.concreteIndices(currentState, INDICES_OPTIONS, request.partitionIndexName()); currentState = updateMapping(currentState, request, concreteIndices); currentState = updateSettings(currentState, request.settings(), concreteIndices); } else { currentState = updateTemplate(currentState, request); if (!request.excludePartitions()) { List<String> supportedSettings = TableParameters.PARTITIONED_TABLE_PARAMETER_INFO_FOR_TEMPLATE_UPDATE .supportedSettings() .values() .stream() .map(Setting::getKey) .collect(Collectors.toList()); supportedSettings.add(IndexMetaData.SETTING_AUTO_EXPAND_REPLICAS); TableParameter parameterWithFilteredSettings = new TableParameter(request.settings(), supportedSettings); currentState = updateSettings(currentState, parameterWithFilteredSettings.settings(), concreteIndices); currentState = updateMapping(currentState, request, concreteIndices); } } } else { currentState = updateMapping(currentState, request, concreteIndices); currentState = updateSettings(currentState, request.settings(), concreteIndices); } return currentState; }

Target:
protected ClusterState execute(ClusterState currentState, AlterTableRequest request) throws Exception { if (request.isPartitioned()) { if (request.partitionIndexName() != null) { Index[] concreteIndices = resolveIndices(currentState, request.partitionIndexName()); currentState = updateMapping(currentState, request, concreteIndices); currentState = updateSettings(currentState, request.settings(), concreteIndices); } else { currentState = updateTemplate( currentState, request.tableIdent(), request.settings(), request.mappingDeltaAsMap(), (name, settings) -> validateSettings(name, settings, indexScopedSettings, metaDataCreateIndexService), indexScopedSettings); if (!request.excludePartitions()) { Index[] concreteIndices = resolveIndices(currentState, request.tableIdent().indexNameOrAlias()); List<String> supportedSettings = TableParameters.PARTITIONED_TABLE_PARAMETER_INFO_FOR_TEMPLATE_UPDATE .supportedSettings() .values() .stream() .map(Setting::getKey) .collect(Collectors.toList()); supportedSettings.add(IndexMetaData.SETTING_AUTO_EXPAND_REPLICAS); currentState = updateSettings(currentState, filterSettings(request.settings(), supportedSettings), concreteIndices); currentState = updateMapping(currentState, request, concreteIndices); } } } else { Index[] concreteIndices = resolveIndices(currentState, request.tableIdent().indexNameOrAlias()); currentState = updateMapping(currentState, request, concreteIndices); currentState = updateSettings(currentState, request.settings(), concreteIndices); } return currentState; }
Source:
public ISchedulingRule[] getTargetProjects() { List<ISchedulingRule> projects= new ArrayList<>(); IResourceRuleFactory ruleFactory= ResourcesPlugin.getWorkspace().getRuleFactory(); for (DiffProject fDiffProject : fDiffProjects) { IProject tempProject = Utilities.getProject(fDiffProject); ISchedulingRule scheduleRule= ruleFactory.modifyRule(tempProject.getFile(IProjectDescription.DESCRIPTION_FILE_NAME)); MultiRule multiRule= new MultiRule(new ISchedulingRule[] { scheduleRule, tempProject } ); projects.add(multiRule); } return projects.toArray(new ISchedulingRule[projects.size()]); }

Target:
public ISchedulingRule[] getTargetProjects() { List<ISchedulingRule> projects= new ArrayList<>(); IResourceRuleFactory ruleFactory= ResourcesPlugin.getWorkspace().getRuleFactory(); for (DiffProject diffProject : fDiffProjects) { IProject tempProject = Utilities.getProject(diffProject); ISchedulingRule scheduleRule= ruleFactory.modifyRule(tempProject.getFile(IProjectDescription.DESCRIPTION_FILE_NAME)); MultiRule multiRule= new MultiRule(new ISchedulingRule[] { scheduleRule, tempProject } ); projects.add(multiRule); } return projects.toArray(new ISchedulingRule[projects.size()]); }
Source:
public static void fillReleasesTable(XWPFTable table, Collection<LicenseInfoParsingResult> projectLicenseInfoResults) { for (LicenseInfoParsingResult result : projectLicenseInfoResults) { String releaseName = nullToEmptyString(result.getName()); String version = nullToEmptyString(result.getVersion()); if (result.getStatus()== LicenseInfoRequestStatus.SUCCESS) { Set<String> copyrights = Collections.emptySet(); Set<LicenseNameWithText> licenseNamesWithTexts = Collections.emptySet(); Set<String> acknowledgements = Collections.emptySet(); if (result.isSetLicenseInfo()) { LicenseInfo licenseInfo = result.getLicenseInfo(); if (licenseInfo.isSetCopyrights()) { copyrights = licenseInfo.getCopyrights(); } if (licenseInfo.isSetLicenseNamesWithTexts()) { licenseNamesWithTexts = licenseInfo.getLicenseNamesWithTexts(); acknowledgements = licenseNamesWithTexts.stream() .map(LicenseNameWithText::getAcknowledgements) .filter(Objects::nonNull).collect(Collectors.toSet()); } } addReleaseTableRow(table, releaseName, version, licenseNamesWithTexts, acknowledgements, copyrights); } else { String filename = Optional.ofNullable(result.getLicenseInfo()) .map(LicenseInfo::getFilenames) .map(l -> l.stream().findFirst().orElse(null)) .orElse(""); addReleaseTableErrorRow(table, releaseName, version, nullToEmptyString(result.getMessage()), filename); } } }

Target:
public static void fillReleasesTable(XWPFTable table, Collection<LicenseInfoParsingResult> projectLicenseInfoResults) { for (LicenseInfoParsingResult result : projectLicenseInfoResults) { String releaseName = nullToEmptyString(result.getName()); String version = nullToEmptyString(result.getVersion()); if (result.getStatus()== LicenseInfoRequestStatus.SUCCESS) { Set<String> copyrights = Collections.emptySet(); Set<LicenseNameWithText> licenseNamesWithTexts = Collections.emptySet(); Set<String> acknowledgements = Collections.emptySet(); if (result.isSetLicenseInfo()) { LicenseInfo licenseInfo = result.getLicenseInfo(); if (licenseInfo.isSetCopyrights()) { copyrights = licenseInfo.getCopyrights(); } if (licenseInfo.isSetLicenseNamesWithTexts()) { licenseNamesWithTexts = licenseInfo.getLicenseNamesWithTexts(); acknowledgements = licenseNamesWithTexts.stream() .map(LicenseNameWithText::getAcknowledgements) .filter(Objects::nonNull).collect(Collectors.toSet()); } } addReleaseTableRow(table, releaseName, version, licenseNamesWithTexts, acknowledgements, copyrights); } else { String filename = Optional.ofNullable(result.getLicenseInfo()) .map(LicenseInfo::getFilenames) .flatMap(l -> l.stream().findFirst()) .orElse(""); addReleaseTableErrorRow(table, releaseName, version, nullToEmptyString(result.getMessage()), filename); } } }
Source:
public void logSlowQuery(String sql, long startTimeNanos) { if ( logSlowQuery < 1 ) { return; } if ( startTimeNanos <= 0 ) { throw new IllegalArgumentException( "startTimeNanos should be greater than 0!" ); } long queryExecutionMillis = TimeUnit.NANOSECONDS.toMillis( System.nanoTime() - startTimeNanos ); if ( queryExecutionMillis > logSlowQuery ) { String logData = "SlowQuery: " + queryExecutionMillis + " milliseconds. SQL: '" + sql + "'"; LOG_SLOW.info( logData ); if ( logToStdout ) { System.out.println( logData ); } } }

Target:
public void logSlowQuery(String sql, long startTimeNanos) { if ( logSlowQuery < 1 ) { return; } if ( startTimeNanos <= 0 ) { throw new IllegalArgumentException( "startTimeNanos [" + startTimeNanos + "] should be greater than 0!" ); } long queryExecutionMillis = TimeUnit.NANOSECONDS.toMillis( System.nanoTime() - startTimeNanos ); if ( queryExecutionMillis > logSlowQuery ) { String logData = "SlowQuery: " + queryExecutionMillis + " milliseconds. SQL: '" + sql + "'"; LOG_SLOW.info( logData ); if ( logToStdout ) { System.out.println( logData ); } } }
Source:
public void bucketLoaded(AbstractBucket<Object> bucket) { try { super.bucketLoaded(bucket); logger.debug("Bucket loaded", bucket.bucketKey); eventBucketExchanger.exchange(bucket.bucketKey, 1, TimeUnit.MILLISECONDS); } catch (TimeoutException e) { logger.debug("Timeout happened"); } catch (InterruptedException e) { e.printStackTrace(); } }

Target:
public void bucketLoaded(AbstractBucket<Object> bucket) { try { super.bucketLoaded(bucket); logger.debug("Bucket loaded", bucket.bucketKey); eventBucketExchanger.exchange(bucket.bucketKey, 1, TimeUnit.MILLISECONDS); } catch (TimeoutException e) { logger.debug("Timeout happened {}", e); } catch (InterruptedException e) { throw new RuntimeException(e); } }
Source:
public ControllerFactory() { }

Target:
private ControllerFactory() { }
Source:
public void inputReady(NHttpServerConnection conn, ContentDecoder decoder) { try { ProtocolState protocolState = SourceContext.getState(conn); if (protocolState != ProtocolState.REQUEST_HEAD && protocolState != ProtocolState.REQUEST_BODY) { handleInvalidState(conn, "Request message body data received"); return; } log.info("point 1"); SourceContext.updateState(conn, ProtocolState.REQUEST_BODY); SourceRequest request = SourceContext.getRequest(conn); int readBytes = request.read(conn, decoder); if (isMessageSizeValidationEnabled) { HttpContext httpContext = conn.getContext(); if (httpContext.getAttribute(PassThroughConstants.MESSAGE_SIZE_VALIDATION_SUM) == null) { httpContext.setAttribute(PassThroughConstants.MESSAGE_SIZE_VALIDATION_SUM, 0); } int messageSizeSum = (int) httpContext.getAttribute(PassThroughConstants.MESSAGE_SIZE_VALIDATION_SUM); messageSizeSum += readBytes; if (messageSizeSum > validMaxMessageSize) { log.warn("Payload exceeds valid payload size range, hence discontinuing chunk stream at " + messageSizeSum + " bytes to prevent OOM."); dropSourceConnection(conn); conn.getContext().setAttribute(PassThroughConstants.SOURCE_CONNECTION_DROPPED, true); request.getPipe().forceProducerComplete(decoder); } httpContext.setAttribute(PassThroughConstants.MESSAGE_SIZE_VALIDATION_SUM, messageSizeSum); } if (readBytes > 0) { metrics.incrementBytesReceived(readBytes); } } catch (IOException e) { logIOException(conn, e); informReaderError(conn); SourceContext.updateState(conn, ProtocolState.CLOSED); sourceConfiguration.getSourceConnections().shutDownConnection(conn, true); } }

Target:
public void inputReady(NHttpServerConnection conn, ContentDecoder decoder) { try { ProtocolState protocolState = SourceContext.getState(conn); if (protocolState != ProtocolState.REQUEST_HEAD && protocolState != ProtocolState.REQUEST_BODY) { handleInvalidState(conn, "Request message body data received"); return; } SourceContext.updateState(conn, ProtocolState.REQUEST_BODY); SourceRequest request = SourceContext.getRequest(conn); int readBytes = request.read(conn, decoder); if (isMessageSizeValidationEnabled) { HttpContext httpContext = conn.getContext(); if (httpContext.getAttribute(PassThroughConstants.MESSAGE_SIZE_VALIDATION_SUM) == null) { httpContext.setAttribute(PassThroughConstants.MESSAGE_SIZE_VALIDATION_SUM, 0); } int messageSizeSum = (int) httpContext.getAttribute(PassThroughConstants.MESSAGE_SIZE_VALIDATION_SUM); messageSizeSum += readBytes; if (messageSizeSum > validMaxMessageSize) { log.warn("Payload exceeds valid payload size range, hence discontinuing chunk stream at " + messageSizeSum + " bytes to prevent OOM."); dropSourceConnection(conn); conn.getContext().setAttribute(PassThroughConstants.SOURCE_CONNECTION_DROPPED, true); request.getPipe().forceProducerComplete(decoder); } httpContext.setAttribute(PassThroughConstants.MESSAGE_SIZE_VALIDATION_SUM, messageSizeSum); } if (readBytes > 0) { metrics.incrementBytesReceived(readBytes); } } catch (IOException e) { logIOException(conn, e); informReaderError(conn); SourceContext.updateState(conn, ProtocolState.CLOSED); sourceConfiguration.getSourceConnections().shutDownConnection(conn, true); } }
Source:
private ColumnChunk readStruct(GroupField field) throws IOException { List<TypeSignatureParameter> fields = field.getType().getTypeSignature().getParameters(); Block[] blocks = new Block[fields.size()]; ColumnChunk columnChunk = null; List<Optional<Field>> parameters = field.getChildren(); for (int i = 0; i < fields.size(); i++) { Optional<Field> parameter = parameters.get(i); if (parameter.isPresent()) { columnChunk = readColumnChunk(parameter.get()); blocks[i] = columnChunk.getBlock(); } } for (int i = 0; i < fields.size(); i++) { if (blocks[i] == null) { blocks[i] = RunLengthEncodedBlock.create(field.getType(), null, columnChunk.getBlock().getPositionCount()); } } BooleanList structIsNull = ParquetStructColumnReader.calculateStructOffsets(field, columnChunk.getDefinitionLevels(), columnChunk.getRepetitionLevels()); Block rowBlock = RowBlock.fromFieldBlocks(structIsNull.toBooleanArray(), blocks, structIsNull.toBooleanArray().length); return new ColumnChunk(rowBlock, columnChunk.getDefinitionLevels(), columnChunk.getRepetitionLevels()); }

Target:
private ColumnChunk readStruct(GroupField field) throws IOException { List<TypeSignatureParameter> fields = field.getType().getTypeSignature().getParameters(); Block[] blocks = new Block[fields.size()]; ColumnChunk columnChunk = null; List<Optional<Field>> parameters = field.getChildren(); for (int i = 0; i < fields.size(); i++) { Optional<Field> parameter = parameters.get(i); if (parameter.isPresent()) { columnChunk = readColumnChunk(parameter.get()); blocks[i] = columnChunk.getBlock(); } } for (int i = 0; i < fields.size(); i++) { if (blocks[i] == null) { blocks[i] = RunLengthEncodedBlock.create(field.getType(), null, columnChunk.getBlock().getPositionCount()); } } BooleanList structIsNull = ParquetStructColumnReader.calculateStructOffsets(field, columnChunk.getDefinitionLevels(), columnChunk.getRepetitionLevels()); boolean[] structIsNullVector = structIsNull.toBooleanArray(); Block rowBlock = RowBlock.fromFieldBlocks(structIsNullVector.length, Optional.of(structIsNullVector), blocks); return new ColumnChunk(rowBlock, columnChunk.getDefinitionLevels(), columnChunk.getRepetitionLevels()); }
Source:
private void regenerateCertificatesImpl(Iterable<Entitlement> entitlements) { if (entitlements != null) { Set<String> deadCertIds = new HashSet<>(); for (Entitlement entitlement : entitlements) { Set<EntitlementCertificate> existing = entitlement.getCertificates(); try { entitlement.setCertificates(null); EntitlementCertificate generated = this.generateEntitlementCertificate( entitlement.getPool(), entitlement); entitlement.setDirty(false); this.eventSink.queueEvent(this.eventFactory.entitlementChanged(entitlement)); log.debug("Generated entitlementCertificate: #{}", generated.getId()); if (existing != null) { for (EntitlementCertificate cert : existing) { if (cert != null) { deadCertIds.add(cert.getId()); this.entitlementCertificateCurator.evict(cert); } } } } catch (CertificateSizeException cse) { entitlement.setCertificates(existing); log.warn("The certificate cannot be regenerated at this time: {}", cse.getMessage()); } } this.entitlementCurator.saveOrUpdateAll(entitlements, false, false); int count = this.entitlementCertificateCurator.deleteByIds(deadCertIds); log.debug("{} old entitlement certificates deleted"); } }

Target:
private void regenerateCertificatesImpl(Iterable<Entitlement> entitlements) { if (entitlements != null) { Set<String> entIds = new HashSet<>(); for (Entitlement entitlement : entitlements) { try { EntitlementCertificate generated = this.generateEntitlementCertificate( entitlement.getPool(), entitlement, false); entitlement.setDirty(false); entitlement.setCertificates(Collections.singleton(generated)); this.eventSink.queueEvent(this.eventFactory.entitlementChanged(entitlement)); entIds.add(entitlement.getId()); } catch (CertificateSizeException cse) { log.warn("The certificate cannot be regenerated at this time: {}", cse.getMessage()); } } int count = this.entitlementCertificateCurator.deleteByEntitlementIds(entIds); log.debug("{} old entitlement certificates deleted", count); this.entitlementCurator.saveOrUpdateAll(entitlements, false, false); } }
Source:
public boolean delete(final Identifier queryId) { if(queryStateMap.containsKey(queryId)) { queryStateMap.remove(queryId); return true; } else { return false; } }

Target:
public boolean delete(final Identifier queryId) { return queryStateMap.remove(queryId) != null ? true : false; }
Source:
public boolean onOptionsItemSelected(MenuItem item) { Intent intent = null; switch (item.getItemId()) { case R.id.menu_load: if (!NetworkUtils.isConnectedToNetwork(this)) { Toast.makeText(this, "No connection found, please connect your device and try again", Toast.LENGTH_SHORT).show(); return true; } if (syncInProgress) { Toast.makeText(this, "Already fetching forms, ignored the request", Toast.LENGTH_SHORT).show(); return true; } if (hasFormsWithData()) { Toast.makeText(this, "There is existing form data for selected form(s). Finish Incomplete data and sync Complete data to Server first before downloading selected forms", Toast.LENGTH_SHORT).show(); return true; } syncAllFormsInBackgroundService(); return true; case R.id.menu_upload: if (!NetworkUtils.isConnectedToNetwork(this)) { Toast.makeText(this, "No connection found, please connect your device and try again", Toast.LENGTH_SHORT).show(); return true; } if (syncInProgress) { Toast.makeText(this, "Already uploading forms, ignored the request", Toast.LENGTH_SHORT).show(); return true; } uploadAllFormsInBackgroundService(); return true; case R.id.menu_client_add: intent = new Intent(this, RegistrationFormsActivity.class); startActivity(intent); return true; case R.id.menu_tags: if (mainLayout.isDrawerOpen(GravityCompat.END)) { mainLayout.closeDrawer(GravityCompat.END); } else { mainLayout.openDrawer(GravityCompat.END); } return true; default: return super.onOptionsItemSelected(item); } }

Target:
public boolean onOptionsItemSelected(MenuItem item) { Intent intent = null; switch (item.getItemId()) { case R.id.menu_load: if (!NetworkUtils.isConnectedToNetwork(this)) { Toast.makeText(this, R.string.no_connection_found_msg, Toast.LENGTH_SHORT).show(); return true; } if (syncInProgress) { Toast.makeText(this, R.string.already_fetching_forms_msg, Toast.LENGTH_SHORT).show(); return true; } if (hasFormsWithData()) { AlertDialog alertDialog = new AlertDialog.Builder(this).create(); alertDialog.setMessage((getApplicationContext()) .getString(R.string.already_exists_some_forms_with_patient_data_msg) ); alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, "Ok", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { } }); alertDialog.show(); return true; } syncAllFormsInBackgroundService(); return true; case R.id.menu_upload: if (!NetworkUtils.isConnectedToNetwork(this)) { Toast.makeText(this, R.string.no_connection_found_msg, Toast.LENGTH_SHORT).show(); return true; } if (syncInProgress) { Toast.makeText(this, R.string.already_uploading_forms_msg, Toast.LENGTH_SHORT).show(); return true; } uploadAllFormsInBackgroundService(); return true; case R.id.menu_client_add: intent = new Intent(this, RegistrationFormsActivity.class); startActivity(intent); return true; case R.id.menu_tags: if (mainLayout.isDrawerOpen(GravityCompat.END)) { mainLayout.closeDrawer(GravityCompat.END); } else { mainLayout.openDrawer(GravityCompat.END); } return true; default: return super.onOptionsItemSelected(item); } }
Source:
public void handle(XFormParser p, Element e, Object parent) { String event = e.getAttributeValue(null, "event"); FormDef form = (FormDef) parent; PollSensorAction action; String ref = e.getAttributeValue(null, "ref"); if (ref != null) { IDataReference dataRef = new XPathReference(ref); if (dataRef != null) { dataRef = XFormParser.getAbsRef(dataRef, TreeReference.rootRef()); } TreeReference treeRef = FormInstance.unpackReference(dataRef); p.registerActionTarget(treeRef); action = new PollSensorAction(treeRef); } else { action = new PollSensorAction(); } form.registerEventListener(event, action); }

Target:
public void handle(XFormParser p, Element e, Object parent) { String event = e.getAttributeValue(null, "event"); FormDef form = (FormDef) parent; PollSensorAction action; String ref = e.getAttributeValue(null, "ref"); if (ref != null) { IDataReference dataRef = new XPathReference(ref); dataRef = XFormParser.getAbsRef(dataRef, TreeReference.rootRef()); TreeReference treeRef = FormInstance.unpackReference(dataRef); p.registerActionTarget(treeRef); action = new PollSensorAction(treeRef); } else { action = new PollSensorAction(); } form.registerEventListener(event, action); }
Source:
public void setQuotaMode(QuotaMode mode) { logger.info("Setting Quota mode to " + mode.name()); this.mode = mode; }

Target:
public void setQuotaMode(QuotaMode mode) { logger.info("Setting Quota mode to {}", mode.name()); this.mode = mode; }
Source:
private static boolean isPreJava8() { final String version = System.getProperty("java.version"); final String[] parts = version.split("\\."); try { int major = Integer.parseInt(parts[1]); final int token = Integer.parseInt(parts[0]); boolean isJEP223 = token != 1; if (isJEP223) { major = token; } return major < 8; } catch (final Exception ex) { return true; } }

Target:
private static boolean isPreJava8() { return org.apache.logging.log4j.util.Constants.JAVA_MAJOR_VERSION < 8; }
Source:
public PagingProvider<ReconnectableConnection, ReconnectableConnection> pagedOperation(Integer failOn) { return new PagingProvider<ReconnectableConnection, ReconnectableConnection>() { Integer counter = 0; @Override public List<ReconnectableConnection> getPage(ReconnectableConnection connection) { counter++; if (counter == failOn) { throw new ModuleException(MuleErrors.CONNECTIVITY, new ConnectionException("Failed to retrieve Page")); } return Collections.singletonList(connection); } @Override public Optional<Integer> getTotalResults(ReconnectableConnection connection) { return Optional.empty(); } @Override public void close(ReconnectableConnection connection) { } }; }

Target:
public PagingProvider<ReconnectableConnection, ReconnectableConnection> pagedOperation(Integer failOn) { return new PagingProvider<ReconnectableConnection, ReconnectableConnection>() { @Override public List<ReconnectableConnection> getPage(ReconnectableConnection connection) { getPageCalls++; if (getPageCalls == failOn) { throw new ModuleException(CONNECTIVITY, new ConnectionException("Failed to retrieve Page")); } return singletonList(connection); } @Override public Optional<Integer> getTotalResults(ReconnectableConnection connection) { return empty(); } @Override public void close(ReconnectableConnection connection) { closePagingProviderCalls++; } }; }
Source:
public boolean writeMutexCell(String tenantId, String schemaName, String tableName, String columnName, String familyName) throws SQLException { try { byte[] rowKey = columnName != null ? SchemaUtil.getColumnKey(tenantId, schemaName, tableName, columnName, familyName) : SchemaUtil.getTableKey(tenantId, schemaName, tableName); byte[] sysMutexPhysicalTableNameBytes = getSysMutexPhysicalTableNameBytes(); try (Table sysMutexTable = getTable(sysMutexPhysicalTableNameBytes)) { byte[] family = PhoenixDatabaseMetaData.SYSTEM_MUTEX_FAMILY_NAME_BYTES; byte[] qualifier = PhoenixDatabaseMetaData.SYSTEM_MUTEX_COLUMN_NAME_BYTES; byte[] value = MUTEX_LOCKED; Put put = new Put(rowKey); put.addColumn(family, qualifier, value); boolean checkAndPut = sysMutexTable.checkAndPut(rowKey, family, qualifier, null, put); String processName = ManagementFactory.getRuntimeMXBean().getName(); String msg = " tenantId : " + tenantId + " schemaName : " + schemaName + " tableName : " + tableName + " columnName : " + columnName + " familyName : " + familyName; if (!checkAndPut) { LOGGER.error(processName + " failed to acquire mutex for "+ msg); } else { LOGGER.debug(processName + " acquired mutex for "+ msg); } return checkAndPut; } } catch (IOException e) { throw ServerUtil.parseServerException(e); } }

Target:
public boolean writeMutexCell(String tenantId, String schemaName, String tableName, String columnName, String familyName) throws SQLException { try { byte[] rowKey = columnName != null ? SchemaUtil.getColumnKey(tenantId, schemaName, tableName, columnName, familyName) : SchemaUtil.getTableKey(tenantId, schemaName, tableName); try (Table sysMutexTable = getSysMutexTable()) { byte[] family = PhoenixDatabaseMetaData.SYSTEM_MUTEX_FAMILY_NAME_BYTES; byte[] qualifier = PhoenixDatabaseMetaData.SYSTEM_MUTEX_COLUMN_NAME_BYTES; byte[] value = MUTEX_LOCKED; Put put = new Put(rowKey); put.addColumn(family, qualifier, value); boolean checkAndPut = sysMutexTable.checkAndPut(rowKey, family, qualifier, null, put); String processName = ManagementFactory.getRuntimeMXBean().getName(); String msg = " tenantId : " + tenantId + " schemaName : " + schemaName + " tableName : " + tableName + " columnName : " + columnName + " familyName : " + familyName; if (!checkAndPut) { LOGGER.error(processName + " failed to acquire mutex for "+ msg); } else { LOGGER.debug(processName + " acquired mutex for "+ msg); } return checkAndPut; } } catch (IOException e) { throw ServerUtil.parseServerException(e); } }
Source:
public ReadableByteChannel get(PageId pageId, int pageOffset) throws IOException, PageNotFoundException { Path p = getFilePath(pageId); if (!Files.exists(p)) { throw new PageNotFoundException(p.toString()); } FileInputStream fis = new FileInputStream(p.toFile()); fis.skip(pageOffset); return fis.getChannel(); }

Target:
public ReadableByteChannel get(PageId pageId, int pageOffset) throws IOException, PageNotFoundException { Preconditions.checkArgument(pageOffset >= 0, "page offset should be non-negative"); Path p = getFilePath(pageId); if (!Files.exists(p)) { throw new PageNotFoundException(p.toString()); } File f = p.toFile(); Preconditions.checkArgument(pageOffset <= f.length(), "page offset %s exceeded page size %s", pageOffset, f.length()); FileInputStream fis = new FileInputStream(p.toFile()); try { fis.skip(pageOffset); return fis.getChannel(); } catch (Throwable t) { fis.close(); throw t; } }
Source:
String extractMetadataFromSlots(List<oasis.names.tc.ebxml_regrep.xsd.rim._3.SlotType1> documentSlots, String slotName, int valueIndex) { LOG.debug("extractMetadataFromSlots slotname: {}; index: {}", slotName, valueIndex); String slotValue = null; for (SlotType1 slot : documentSlots) { if (slotName.equals(slot.getName())) { LOG.debug("Found {}: {}", slotName, slot.getValueList().getValue()); if (valueIndex < 0) { slotValue = StringUtils.join(slot.getValueList().getValue(), VALUE_LIST_SEPERATOR); } else if (slot.getValueList() != null && slot.getValueList().getValue() != null && !slot.getValueList().getValue().isEmpty()) { slotValue = slot.getValueList().getValue().get(valueIndex); } else { slotValue = ""; } break; } } LOG.debug("{}: {}", slotName, slotValue); return slotValue; }

Target:
String extractMetadataFromSlots(List<oasis.names.tc.ebxml_regrep.xsd.rim._3.SlotType1> documentSlots, String slotName, int valueIndex) { LOG.debug("extractMetadataFromSlots slotname: {}; index: {}", slotName, valueIndex); String slotValue = null; for (SlotType1 slot : documentSlots) { if (slotName.equals(slot.getName())) { LOG.debug("Found slot with name: {}", slotName); if (valueIndex < 0) { slotValue = StringUtils.join(slot.getValueList().getValue(), VALUE_LIST_SEPERATOR); } else if (slot.getValueList().getValue() != null && valueIndex < slot.getValueList().getValue().size()) { slotValue = slot.getValueList().getValue().get(valueIndex); } else { slotValue = ""; } break; } } LOG.debug("Value for slot name {}: {}", slotName, slotValue); return slotValue; }
Source:
public PartitionStatistics getTableStatistics(String databaseName, String tableName) { try { Table table = getTable(databaseName, tableName).orElseThrow( () -> new PrestoException(HIVE_METASTORE_ERROR, String.format("Could not retrieve table %s.%s", databaseName, tableName))); HiveBasicStatistics basicStats = getHiveBasicStatistics(table.getParameters()); List<Column> columns = table.getPartitionColumns(); List<String> columnNames = columns.stream().map(Column::getName).collect(toImmutableList()); List<ColumnStatisticsInfo> colStatsList = client.getTableColumnStatistics(table.getDatabaseName(), table.getTableName(), columnNames); return new PartitionStatistics(basicStats, groupStatisticsByColumn(colStatsList, basicStats.getRowCount())); } catch (Exception e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } }

Target:
public PartitionStatistics getTableStatistics(String databaseName, String tableName) { try { Table table = getTable(databaseName, tableName).orElseThrow( () -> new PrestoException(HIVE_METASTORE_ERROR, String.format("Could not retrieve table %s.%s", databaseName, tableName))); HiveBasicStatistics basicStatistics = getHiveBasicStatistics(table.getParameters()); List<Column> columns = table.getPartitionColumns(); List<String> columnNames = columns.stream().map(Column::getName).collect(toImmutableList()); List<ColumnStatisticsInfo> columnStatistics = client.getTableColumnStatistics(table.getDatabaseName(), table.getTableName(), columnNames); return new PartitionStatistics(basicStatistics, groupStatisticsByColumn(columnStatistics, basicStatistics.getRowCount())); } catch (Exception e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } }
Source:
private void lazyLoadModulesConfig() throws IOException, ConfigInvalidException { if (modulesConfig == null) { loadModulesConfig(); } }

Target:
private void lazyLoadModulesConfig() throws IOException, ConfigInvalidException { if (modulesConfig == null) loadModulesConfig(); }
Source:
public void run() { try { if (!makeResourceWritable(provider.getShell())) { return; } } catch (CoreException e) { MessageDialog.openWarning(provider.getShell(), "Resource Not Accessible", e.getMessage()); return; } if (LaunchUtils.hasLaunchedTestCases()) { MessageDialog.openWarning(provider.getShell(), Messages.RenameAction_ErrorDialogTitle, Messages.RenameAction_ErrorDialogMsg); return; } if (!RefactoringSaveHelper.checkDirtyEditors(provider.getShell())) { return; } if (containsSingleTag(getStructuredSelection())) { RenameTagWizard wizard = new RenameTagWizard(getSelectedTag()); run(wizard, provider.getShell()); } else { List<?> resources = getSelectedResources(); if (resources.size() == 1) { IResource resource = (IResource) resources.get(0); Q7RenameResourceWizard wizard = new Q7RenameResourceWizard( resource); run(wizard, provider.getShell()); } } }

Target:
public void run() { try { if (!makeResourceWritable(provider.getShell())) { return; } } catch (CoreException e) { Q7UIPlugin.log(e); return; } if (LaunchUtils.hasLaunchedTestCases()) { MessageDialog.openWarning(provider.getShell(), Messages.RenameAction_ErrorDialogTitle, Messages.RenameAction_ErrorDialogMsg); return; } if (!RefactoringSaveHelper.checkDirtyEditors(provider.getShell())) { return; } if (containsSingleTag(getStructuredSelection())) { RenameTagWizard wizard = new RenameTagWizard(getSelectedTag()); run(wizard, provider.getShell()); } else { List<?> resources = getSelectedResources(); if (resources.size() == 1) { IResource resource = (IResource) resources.get(0); Q7RenameResourceWizard wizard = new Q7RenameResourceWizard( resource); run(wizard, provider.getShell()); } } }
Source:
private void setValue(Type type, BlockBuilder blockBuilder, String value) { if (value == null) { blockBuilder.appendNull(); return; } if (!(type instanceof FixedWidthType) && !(type instanceof VarcharType)) { throw new PinotException(PINOT_UNSUPPORTED_COLUMN_TYPE, Optional.empty(), "type '" + type + "' not supported"); } if (type instanceof FixedWidthType) { completedBytes += ((FixedWidthType) type).getFixedSize(); if (type instanceof BigintType) { type.writeLong(blockBuilder, parseDouble(value).longValue()); } else if (type instanceof IntegerType) { blockBuilder.writeInt(parseDouble(value).intValue()); } else if (type instanceof TinyintType) { blockBuilder.writeByte(parseDouble(value).byteValue()); } else if (type instanceof SmallintType) { blockBuilder.writeShort(parseDouble(value).shortValue()); } else if (type instanceof BooleanType) { type.writeBoolean(blockBuilder, parseBoolean(value)); } else if (type instanceof DecimalType || type instanceof DoubleType) { type.writeDouble(blockBuilder, parseDouble(value)); } else if (type instanceof TimestampType) { type.writeLong(blockBuilder, parseLong(value)); } else if (type instanceof DateType) { blockBuilder.writeInt(parseDouble(value).intValue()); } else { throw new PinotException(PINOT_UNSUPPORTED_COLUMN_TYPE, Optional.empty(), "type '" + type + "' not supported"); } } else { Slice slice = Slices.utf8Slice(value); blockBuilder.writeBytes(slice, 0, slice.length()).closeEntry(); completedBytes += slice.length(); } }

Target:
private void setValue(Type type, BlockBuilder blockBuilder, String value) { if (value == null) { blockBuilder.appendNull(); return; } if (!(type instanceof FixedWidthType) && !(type instanceof VarcharType)) { throw new PinotException(PINOT_UNSUPPORTED_COLUMN_TYPE, Optional.empty(), "type '" + type + "' not supported"); } if (type instanceof FixedWidthType) { completedBytes += ((FixedWidthType) type).getFixedSize(); if (type instanceof BigintType) { type.writeLong(blockBuilder, parseDouble(value).longValue()); } else if (type instanceof IntegerType) { blockBuilder.writeInt(parseDouble(value).intValue()); } else if (type instanceof TinyintType) { blockBuilder.writeByte(parseDouble(value).byteValue()); } else if (type instanceof SmallintType) { blockBuilder.writeShort(parseDouble(value).shortValue()); } else if (type instanceof BooleanType) { type.writeBoolean(blockBuilder, parseBoolean(value)); } else if (type instanceof DecimalType || type instanceof DoubleType) { type.writeDouble(blockBuilder, parseDouble(value)); } else if (type instanceof TimestampType) { type.writeLong(blockBuilder, parseLong(value)); } else if (type instanceof DateType) { type.writeLong(blockBuilder, parseLong(value)); } else { throw new PinotException(PINOT_UNSUPPORTED_COLUMN_TYPE, Optional.empty(), "type '" + type + "' not supported"); } } else { Slice slice = Slices.utf8Slice(value); blockBuilder.writeBytes(slice, 0, slice.length()).closeEntry(); completedBytes += slice.length(); } }
Source:
private void initialize() { this.setName(Constant.messages.getString("proxies.options.title")); this.add(getScrollPane()); this.setLayout(new GridBagLayout()); this.add(getMainProxyPanel(), LayoutHelper.getGBC(0, 0, 1, 0.0)); this.add(getSecurityProtocolsPanel(), LayoutHelper.getGBC(0, 1, 1, 0.0)); this.add(getScrollPane(), LayoutHelper.getGBC(0, 2, 1, 1.0, 1.0)); }

Target:
private void initialize() { this.setName(Constant.messages.getString("proxies.options.title")); this.setLayout(new GridBagLayout()); this.add(getScrollPane(), LayoutHelper.getGBC(0, 0, 1, 1.0, 1.0)); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ImageTransfer other = (ImageTransfer) obj; return Objects.equals(commandId, other.commandId) && Objects.equals(phase, other.phase) && type == other.type && Objects.equals(lastUpdated, other.lastUpdated) && Objects.equals(message, other.message) && Objects.equals(vdsId, other.vdsId) && Objects.equals(diskId, other.diskId) && Objects.equals(imagedTicketId, other.imagedTicketId) && Objects.equals(proxyUri, other.proxyUri) && Objects.equals(signedTicket, other.signedTicket) && Objects.equals(bytesSent, other.bytesSent) && Objects.equals(bytesTotal, other.bytesTotal); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ImageTransfer other = (ImageTransfer) obj; return Objects.equals(commandId, other.commandId) && Objects.equals(phase, other.phase) && Objects.equals(lastUpdated, other.lastUpdated) && Objects.equals(message, other.message) && Objects.equals(vdsId, other.vdsId) && Objects.equals(diskId, other.diskId) && Objects.equals(imagedTicketId, other.imagedTicketId) && Objects.equals(proxyUri, other.proxyUri) && Objects.equals(signedTicket, other.signedTicket) && Objects.equals(bytesSent, other.bytesSent) && Objects.equals(bytesTotal, other.bytesTotal) && type == other.type; }