auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private int persistColumnStats(Hive db) throws HiveException, MetaException, IOException { ColumnStatistics colStats = constructColumnStatsFromInput(); ColumnStatisticsDesc colStatsDesc = colStats.getStatsDesc(); <START> if (AcidUtils.isTransactionalTable(getHive().getTable(colStatsDesc.getDbName(), <END> colStatsDesc.getTableName())) && work.getColStats() != null) { LOG.debug("Skipped updating column stats for table " + TableName.getDbTable(colStatsDesc.getDbName(), colStatsDesc.getTableName()) + " because it is converted to a transactional table during replication."); return 0; } SetPartitionsStatsRequest request = new SetPartitionsStatsRequest(Collections.singletonList(colStats)); db.setPartitionColumnStatistics(request); return 0; }</code><technical_language>Do need check if is replication flow? Currently, skip updating stats for txn table non-replication flow too</technical_language>

Target:
private int persistColumnStats(Hive db) throws HiveException, MetaException, IOException { ColumnStatistics colStats = constructColumnStatsFromInput(); ColumnStatisticsDesc colStatsDesc = colStats.getStatsDesc(); if (work.getColStats() != null && AcidUtils.isTransactionalTable(getHive().getTable(colStatsDesc.getDbName(), colStatsDesc.getTableName()))) { LOG.debug("Skipped updating column stats for table " + TableName.getDbTable(colStatsDesc.getDbName(), colStatsDesc.getTableName()) + " because it is converted to a transactional table during replication."); return 0; } SetPartitionsStatsRequest request = new SetPartitionsStatsRequest(Collections.singletonList(colStats)); db.setPartitionColumnStatistics(request); return 0; }
Source:
<code>public OUT nextRecord(OUT tuple) throws IOException { try { resultSet.next(); int column_count = resultSetMetaData.getColumnCount(); for (int pos = 0; pos < column_count; pos++) { <START> int type = resultSetMetaData.getColumnType(pos + 1); <END> addValue(pos, type, tuple); } return tuple; } catch (SQLException se) { close(); throw new IOException("Couldn't read data - " + se.getMessage(), se); } catch (NullPointerException npe) { close(); throw new IOException("Couldn't access resultSet", npe); } }</code><technical_language>I extract schema / return types for tuple</technical_language>

Target:
public OUT nextRecord(OUT tuple) throws IOException { try { resultSet.next(); if (columnTypes == null) { extractTypes(tuple); } addValue(tuple); return tuple; } catch (SQLException se) { close(); throw new IOException("Couldn't read data - " + se.getMessage(), se); } catch (NullPointerException npe) { close(); throw new IOException("Couldn't access resultSet", npe); } }
Source:
<code>public void onMapReady(@NonNull MapboxMap mapboxMap) { this.mapboxMap = mapboxMap; mapboxMap.setStyle(Style.LIGHT, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { <START> initLayerIcons(); <END> addClusteredGeoJsonSource(); Toast.makeText(ImageClusteringActivity.this, R.string.zoom_map_in_and_out_instruction, Toast.LENGTH_SHORT).show(); } }); }</code><technical_language>add style parameter initLayerIcons</technical_language>

Target:
public void onMapReady(@NonNull MapboxMap mapboxMap) { mapboxMap.setStyle(Style.LIGHT, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { initLayerIcons(style); addClusteredGeoJsonSource(style); Toast.makeText(ImageClusteringActivity.this, R.string.zoom_map_in_and_out_instruction, Toast.LENGTH_SHORT).show(); } }); }
Source:
<code>public void addBondToParameters(CreateOrUpdateBond bond) { <START> assert bond.getId() == null : "When adding a bond to the parameters its id should be null"; END> Guid originalIdOfBondWithTheSameName = originalBondNameToId.get(bond.getName()); bond.setId(originalIdOfBondWithTheSameName); if (originalIdOfBondWithTheSameName != null) { removedBonds.remove(originalIdOfBondWithTheSameName); } bonds.add(bond); }</code><technical_language>(not only) opinion, (but) feel free ignore. Assertions work runtime. optimizing, endup some NPE explanation. throw exception for example: java.util.Objects#requireNonNull(T, java.lang.String) This construct overpower assertions in way. Assertions benefit is cool keyword</technical_language>

Target:
public void addBondToParameters(CreateOrUpdateBond bond) { if (bond.getId() != null) { throw new IllegalArgumentException("When adding a bond to the parameters its id should be null"); } CreateOrUpdateBond originalBondWithTheSameName = originalBondsByName.get(bond.getName()); if (originalBondWithTheSameName != null) { bond.setId(originalBondWithTheSameName.getId()); removedBonds.remove(originalBondWithTheSameName); } bonds.add(bond); }
Source:
<code>public void testImportVMFromConfigurationXMLCouldNotGetParsed() { OvfEntityData ovfEntity = getOvfEntityData(); ovfEntity.setOvfData("This is not a valid XML"); initCommand(ovfEntity); when(unregisteredOVFDataDao.getByEntityIdAndStorageDomain(vmId, storageDomainId)).thenReturn(ovfEntity); assertFalse(cmd.canDoAction()); assertTrue(cmd.getReturnValue() .getCanDoActionMessages() <START> .contains(VdcBllMessages.ACTION_TYPE_FAILED_OVF_CONFIGURATION_NOT_SUPPORTED.toString())); <END> }</code><technical_language>Please CanDoActionAssertUtils</technical_language>

Target:
public void testImportVMFromConfigurationXMLCouldNotGetParsed() { OvfEntityData ovfEntity = getOvfEntityData(); ovfEntity.setOvfData("This is not a valid XML"); initCommand(ovfEntity); when(unregisteredOVFDataDao.getByEntityIdAndStorageDomain(vmId, storageDomainId)).thenReturn(ovfEntity); CanDoActionTestUtils.runAndAssertCanDoActionFailure(cmd, VdcBllMessages.ACTION_TYPE_FAILED_OVF_CONFIGURATION_NOT_SUPPORTED); }
Source:
<code><START> public static void deleteQueue(String projectId, String locationId, String queueId) throws Exception { <END> try (CloudTasksClient client = CloudTasksClient.create()) { String queuePath = QueueName.of(projectId, locationId, queueId).toString(); client.deleteQueue(queuePath); System.out.println("Queue deleted: " + queueId); } }</code><technical_language>Ideally specific exceptions based developers see</technical_language>

Target:
public static void deleteQueue(String projectId, String locationId, String queueId) throws IOException { try (CloudTasksClient client = CloudTasksClient.create()) { String queuePath = QueueName.of(projectId, locationId, queueId).toString(); client.deleteQueue(queuePath); System.out.println("Queue deleted: " + queueId); } }
Source:
<code>public void shouldAcceptIndel() throws Exception { <START> Variant input = new Variant("1", 1000, 1002, "AT", "T"); <END> Variant output = processor.process(input); assertEquals(Variant.VariantType.INDEL, input.getType()); assertNotNull(output); assertEquals(input, output); }</code><technical_language>coordinates 1000, 1001</technical_language>

Target:
public void shouldAcceptIndel() throws Exception { Variant input = new Variant("1", 1000, 1001, "AT", "T"); Variant output = processor.process(input); assertEquals(Variant.VariantType.INDEL, input.getType()); assertNotNull(output); assertEquals(input, output); }
Source:
<code>private void showStatusDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.post_settings_status); int checkedItem = getCurrentPostStatusIndex(); if (checkedItem == -1) { checkedItem = 0; } builder.setSingleChoiceItems(R.array.post_settings_statuses, checkedItem, null); <START> builder.setPositiveButton(R.string.dialog_button_ok, new DialogInterface.OnClickListener() { <END> public void onClick(DialogInterface dialog, int which) { ListView lw = ((AlertDialog)dialog).getListView(); String newStatus = (String) lw.getAdapter().getItem(lw.getCheckedItemPosition()); mStatusTextView.setText(newStatus); updatePostSettingsAndSaveButton(); } }); builder.setNegativeButton(R.string.cancel, null); builder.show(); }</code><technical_language>[recently started](<LINK_0> android.R.string.ok, switch here</technical_language>

Target:
private void showStatusDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.post_settings_status); int checkedItem = getCurrentPostStatusIndex(); if (checkedItem == -1) { checkedItem = 0; } builder.setSingleChoiceItems(R.array.post_settings_statuses, checkedItem, null); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { ListView listView = ((AlertDialog)dialog).getListView(); String newStatus = (String) listView.getAdapter().getItem(listView.getCheckedItemPosition()); mStatusTextView.setText(newStatus); updatePostSettingsAndSaveButton(); } }); builder.setNegativeButton(R.string.cancel, null); builder.show(); }
Source:
<code>public Model bodyToInternalModel(final String extResourceId, final InputStream stream, final MediaType contentType, final HttpIdentifierConverter idTranslator) throws RepositoryRuntimeException, BadRequestException { final Model model = parseBodyAsModel(stream, contentType, extResourceId); final List<Statement> insertStatements = new ArrayList<>(); final StmtIterator stmtIterator = model.listStatements(); while (stmtIterator.hasNext()) { final Statement stmt = stmtIterator.nextStatement(); <START> if (stmt.getSubject().isURIResource()) { <END> final String originalSubj = stmt.getSubject().getURI(); final String subj = idTranslator.inExternalDomain(originalSubj) ? idTranslator.toInternalId(originalSubj) : originalSubj; RDFNode obj = stmt.getObject(); if (stmt.getObject().isResource()) { final String objString = stmt.getObject().asResource().getURI(); if (idTranslator.inExternalDomain(objString)) { obj = model.getResource(idTranslator.toInternalId(objString)); } } if (!subj.equals(originalSubj) || !obj.equals(stmt.getObject())) { insertStatements.add(new StatementImpl(model.getResource(subj), stmt.getPredicate(), obj)); stmtIterator.remove(); } } } model.add(insertStatements); log.debug("Model: {}", model); return model; }</code><technical_language>mind adding else block contains a "debug()" log message indicating statement skipped</technical_language>

Target:
public Model bodyToInternalModel(final String extResourceId, final InputStream stream, final MediaType contentType, final HttpIdentifierConverter idTranslator) throws RepositoryRuntimeException, BadRequestException { final Model model = parseBodyAsModel(stream, contentType, extResourceId); final List<Statement> insertStatements = new ArrayList<>(); final StmtIterator stmtIterator = model.listStatements(); while (stmtIterator.hasNext()) { final Statement stmt = stmtIterator.nextStatement(); if (stmt.getSubject().isURIResource()) { final String originalSubj = stmt.getSubject().getURI(); final String subj = idTranslator.inExternalDomain(originalSubj) ? idTranslator.toInternalId(originalSubj) : originalSubj; RDFNode obj = stmt.getObject(); if (stmt.getObject().isResource()) { final String objString = stmt.getObject().asResource().getURI(); if (idTranslator.inExternalDomain(objString)) { obj = model.getResource(idTranslator.toInternalId(objString)); } } if (!subj.equals(originalSubj) || !obj.equals(stmt.getObject())) { insertStatements.add(new StatementImpl(model.getResource(subj), stmt.getPredicate(), obj)); stmtIterator.remove(); } } else { log.debug("Subject is not a URI resource, skipping", stmt.getSubject()); } } model.add(insertStatements); log.debug("Model: {}", model); return model; }
Source:
<code>public void testWithParameters() throws IOException { try (Analyzer ws = newHomoglyphFilter()) { TokenStream ts = ws.tokenStream("", input); <START> BaseTokenStreamTestCase.assertTokenStreamContents(ts, <END> expected); } }</code><technical_language>static import</technical_language>

Target:
public void testWithParameters() throws IOException { try (Analyzer ws = newHomoglyphFilter()) { TokenStream ts = ws.tokenStream("", input); assertTokenStreamContents(ts, expected); } }
Source:
<code>boolean upgradeIfNecessary(AbstractProject<?,?> job) throws IOException { if (!isUpgradeNeeded()) { return false; } <START> int i = projectName.lastIndexOf('/'); <END> if (i != -1 && projectName.indexOf('=', i) != -1 && Jenkins.getInstance().getItem(projectName, job.getParent(), Job.class) == null) { project = projectName.substring(0, i); parameters = projectName.substring(i + 1); } else { project = projectName; parameters = null; } Logger.getLogger(CopyArtifact.class.getName()).log(Level.INFO, "Split {0} into {1} with parameters {2}", new Object[] {projectName, project, parameters}); projectName = null; job.save(); return true; }</code><technical_language>BTW a tip for minimizing diff lines in a PR: avoid changing indentation of long blocks of existing code if helped: boolean upgradeIfNecessary(AbstractProject<?,?> job) throws IOException { if (isUpgradeNeeded()) { int i = projectName.lastIndexOf('/'); return true; } else { return false; } } This practice PR easier review, history easier follow (especially git blame), merge conflicts likely</technical_language>

Target:
private boolean upgradeIfNecessary(AbstractProject<?,?> job) throws IOException { if (isUpgradeNeeded()) { int i = projectName.lastIndexOf('/'); if (i != -1 && projectName.indexOf('=', i) != -1 && Jenkins.getInstance().getItem(projectName, job.getParent(), Job.class) == null) { project = projectName.substring(0, i); parameters = projectName.substring(i + 1); } else { project = projectName; parameters = null; } LOGGER.log(Level.INFO, "Split {0} into {1} with parameters {2}", new Object[] {projectName, project, parameters}); projectName = null; job.save(); return true; } else { return false; } }
Source:
<code>public PointDescription getPointDescription(@NonNull Context ctx) { <START> if (isPersonal()) { <END> return new PointDescription(PointDescription.POINT_TYPE_FAVORITE, getName(ctx)); } else { return getPointDescription(); } }</code><technical_language>clear difference personal non-persona. I identical in cases return new PointDescription(PointDescription.POINT_TYPE_FAVORITE, getName(ctx));</technical_language>

Target:
public PointDescription getPointDescription(@NonNull Context ctx) { return new PointDescription(PointDescription.POINT_TYPE_FAVORITE, getDisplayName(ctx)); }
Source:
<code>protected void doGet(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { final StringBuilder rdr = new StringBuilder(); <START> rdr.append(URLEncoder.encode(urlProvider.get(), "UTF-8")); <END> rdr.append('#'); rdr.append(getToken(req)); CacheHeaders.setNotCacheable(rsp); rsp.sendRedirect(rdr.toString()); }</code><technical_language>If URL access this web application is unsafe hosed. IIRC this string gerrit.config. If admin p0wn3d gerrit.config other problems</technical_language>

Target:
protected void doGet(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { final StringBuilder rdr = new StringBuilder(); rdr.append(urlProvider.get()); rdr.append('#'); rdr.append(getToken(req)); CacheHeaders.setNotCacheable(rsp); rsp.sendRedirect(rdr.toString()); }
Source:
<code>public String toString() { String subscription = "Subscription [id = " + getId(); if (product != null) { <START> subscription += getProduct().getId(); <END> } if (owner != null) { subscription += ", owner = " + getOwner().getKey(); } return subscription + "]"; }</code><technical_language>this line be: subscription += ", product = " + getProduct().getId();</technical_language>

Target:
public String toString() { String subscription = "Subscription [id = " + getId(); if (product != null) { subscription += ", product = " + getProduct().getId(); } if (owner != null) { subscription += ", owner = " + getOwner().getKey(); } return subscription + "]"; }
Source:
<code>protected boolean validate() { DiskValidator diskValidator = new DiskValidator(getDiskImage()); <START> List<Pair<VM, VmDevice>> vmsForDisk = vmDao.getVmsWithPlugInfo(getDiskImage().getId()); <END> if (!validate(diskValidator.isDiskExists()) || !validate(diskValidator.isDiskPluggedToVmsThatAreNotDown(false, vmsForDisk))) { return false; } setStoragePoolId(getDiskImage().getStoragePoolId()); if (!validate(new StoragePoolValidator(getStoragePool()).isUp())) { return false; } if (!FeatureSupported.qcowCompatSupported(getStoragePool().getCompatibilityVersion())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_AMEND_NOT_SUPPORTED_BY_DC_VERSION, String.format("$dataCenterVersion %s", getStoragePool().getCompatibilityVersion().toString())); } if (getDiskImage().getVmEntityType().isTemplateType()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CANT_AMEND_TEMPLATE_DISK); } setStorageDomainId(getDiskImage().getStorageIds().get(0)); StorageDomainValidator storageDomainValidator = new StorageDomainValidator(getStorageDomain()); if (!validate(storageDomainValidator.isDomainExistAndActive())) { return false; } DiskImagesValidator diskImagesValidator = new DiskImagesValidator(Collections.singletonList(getDiskImage())); return validate(diskImagesValidator.diskImagesNotIllegal()) && validate(diskImagesValidator.diskImagesNotLocked()); }</code><technical_language>if disk exist fail NPE here, please verify exists</technical_language>

Target:
protected boolean validate() { DiskValidator diskValidator = new DiskValidator(getDiskImage()); if (!validate(diskValidator.isDiskExists())) { return false; } List<Pair<VM, VmDevice>> vmsForDisk = vmDao.getVmsWithPlugInfo(getDiskImage().getId()); if (!validate(diskValidator.isDiskPluggedToVmsThatAreNotDown(false, vmsForDisk))) { return false; } setStoragePoolId(getDiskImage().getStoragePoolId()); if (!validate(new StoragePoolValidator(getStoragePool()).isUp())) { return false; } if (!FeatureSupported.qcowCompatSupported(getStoragePool().getCompatibilityVersion())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_AMEND_NOT_SUPPORTED_BY_DC_VERSION, String.format("$dataCenterVersion %s", getStoragePool().getCompatibilityVersion().toString())); } if (getDiskImage().getVmEntityType().isTemplateType()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CANT_AMEND_TEMPLATE_DISK); } setStorageDomainId(getDiskImage().getStorageIds().get(0)); StorageDomainValidator storageDomainValidator = new StorageDomainValidator(getStorageDomain()); if (!validate(storageDomainValidator.isDomainExistAndActive())) { return false; } DiskImagesValidator diskImagesValidator = new DiskImagesValidator(Collections.singletonList(getDiskImage())); return validate(diskImagesValidator.diskImagesNotIllegal()) && validate(diskImagesValidator.diskImagesNotLocked()); }
Source:
<code>private void refresh() { <START> final TmfTraceManager tm = TmfTraceManager.getInstance(); <END> Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (fTimeGraphCombo.isDisposed()) { return; } ITimeGraphEntry[] entries = null; synchronized (fEntryListMap) { fEntryList = fEntryListMap.get(fTrace); if (fEntryList == null) { fEntryList = new ArrayList<ControlFlowEntry>(); } entries = fEntryList.toArray(new ITimeGraphEntry[0]); } Arrays.sort(entries, fControlFlowEntryComparator); fTimeGraphCombo.setInput(entries); fTimeGraphCombo.getTimeGraphViewer().setTimeBounds(fStartTime, fEndTime); long timestamp = fTrace == null ? 0 : tm.getCurrentTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); long startTime = fTrace == null ? 0 : tm.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); long endTime = fTrace == null ? 0 : tm.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); startTime = Math.max(startTime, fStartTime); endTime = Math.min(endTime, fEndTime); fTimeGraphCombo.getTimeGraphViewer().setSelectedTime(timestamp, false); fTimeGraphCombo.getTimeGraphViewer().setStartFinishTime(startTime, endTime); for (TreeColumn column : fTimeGraphCombo.getTreeViewer().getTree().getColumns()) { column.pack(); } startZoomThread(startTime, endTime); } }); }</code><technical_language>move this run method</technical_language>

Target:
private void refresh() { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (fTimeGraphCombo.isDisposed()) { return; } ITimeGraphEntry[] entries = null; synchronized (fEntryListMap) { fEntryList = fEntryListMap.get(fTrace); if (fEntryList == null) { fEntryList = new ArrayList<ControlFlowEntry>(); } entries = fEntryList.toArray(new ITimeGraphEntry[0]); } Arrays.sort(entries, fControlFlowEntryComparator); fTimeGraphCombo.setInput(entries); fTimeGraphCombo.getTimeGraphViewer().setTimeBounds(fStartTime, fEndTime); final TmfTraceManager tm = TmfTraceManager.getInstance(); long timestamp = fTrace == null ? 0 : tm.getCurrentTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); long startTime = fTrace == null ? 0 : tm.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); long endTime = fTrace == null ? 0 : tm.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); startTime = Math.max(startTime, fStartTime); endTime = Math.min(endTime, fEndTime); fTimeGraphCombo.getTimeGraphViewer().setSelectedTime(timestamp, false); fTimeGraphCombo.getTimeGraphViewer().setStartFinishTime(startTime, endTime); for (TreeColumn column : fTimeGraphCombo.getTreeViewer().getTree().getColumns()) { column.pack(); } startZoomThread(startTime, endTime); } }); }
Source:
<code>public QpidConnection(QpidConfigBuilder config, Configuration candlepinConfiguration) { try { <START> this.producerMap = new HashMap<>(); <END> this.config = config; this.candlepinConfig = candlepinConfiguration; this.producerMap = new HashMap<>(); ctx = createInitialContext(); connectionFactory = createConnectionFactory(); } catch (NamingException e) { throw new RuntimeException(e); } }</code><technical_language>This is initialized line 97</technical_language>

Target:
public QpidConnection(QpidConfigBuilder config, Configuration candlepinConfiguration) { try { this.config = config; this.candlepinConfig = candlepinConfiguration; this.producerMap = new HashMap<>(); ctx = createInitialContext(); connectionFactory = createConnectionFactory(); } catch (NamingException e) { throw new RuntimeException(e); } }
Source:
<code>private Attribute(String key, State state, String value) { if (key == null) throw new NullPointerException( "The key of an attribute should not be null"); this.key = key; <START> this.state = state != null ? state : State.CUSTOM; <END> this.value = value; }</code><technical_language>I thought State.UNSET null-safe default, possibly CUSTOM/UNSET depending parameter is null not</technical_language>

Target:
private Attribute(String key, State state, String value) { if (key == null) throw new NullPointerException( "The key of an attribute should not be null"); if (state == null) throw new NullPointerException( "The state of an attribute should not be null"); this.key = key; this.state = state; this.value = value; }
Source:
<code>private void updateSslVerifyUser(boolean value) { StoredConfig userConfig = null; try { userConfig = SystemReader.getInstance().getUserConfig(); updateSslVerify(userConfig, value); } catch (IOException | ConfigInvalidException e) { LOG.error(MessageFormat.format(JGitText.get().userConfigInvalid, <START> userConfig, e)); <END> } }</code><technical_language>Hm. need a bit more exception handling report config invalid. in case userConfig is null. I ConfigInvalidException's message include file name</technical_language>

Target:
private void updateSslVerifyUser(boolean value) { StoredConfig userConfig = null; try { userConfig = SystemReader.getInstance().getUserConfig(); updateSslVerify(userConfig, value); } catch (IOException | ConfigInvalidException e) { LOG.error(e.getMessage(), e); } }
Source:
<code>public Set<String> doGetExpired(Set<String> candidates) { final long now = System.currentTimeMillis(); return candidates .stream() .filter( <START> c -> { <END> SessionData sessionData = sessionDataMap.get(c); return sessionData != null && sessionData.getExpiry() > now; }) .collect(Collectors.toSet()); }</code><technical_language>Easier read if create a private method named isSessionNotExpired reference filter</technical_language>

Target:
public Set<String> doGetExpired(Set<String> candidates) { final long now = System.currentTimeMillis(); return candidates.stream().filter(c -> isExpired(c, now)).collect(Collectors.toSet()); }
Source:
<code><START> static Context notInLambda() <END> { return new Context(null, null); }</code><technical_language>I is correct methods public factories for class logically part of class' public API. Visibility is controlled class level. Similarly, if a top level package-private class, methods public package-private. In addition more clear public API, a line change if class needs public (instead of changing / thinking method)</technical_language>

Target:
public static Context notInLambda() { return new Context(null, null); }
Source:
<code>private static Set<SymbolicValue> computedFrom(@Nullable SymbolicValue symbolicValue) { if (symbolicValue == null) { return Collections.emptySet(); } <START> HashSet<SymbolicValue> result = new HashSet<>(); <END> result.add(symbolicValue); symbolicValue.computedFrom().forEach(sv -> result.addAll(computedFrom(sv))); return result; }</code><technical_language>minor: rely interface full type</technical_language>

Target:
private static Set<SymbolicValue> computedFrom(@Nullable SymbolicValue symbolicValue) { if (symbolicValue == null) { return Collections.emptySet(); } Set<SymbolicValue> result = new HashSet<>(); result.add(symbolicValue); symbolicValue.computedFrom().forEach(sv -> result.addAll(computedFrom(sv))); return result; }
Source:
<code>protected void executeQueryCommand() { List<VM> vmList = getDbFacade().getVmDao() .getAllForNetwork(getParameters().getNetworkId()); List<VmNetworkInterface> vmNetworkInterfaceList = getDbFacade().getVmNetworkInterfaceDao() .getAllForNetwork(getParameters().getNetworkId()); final Map<Guid, VM> vmsById = Entities.businessEntitiesById(vmList); List<PairQueryable<VmNetworkInterface, VM>> vmInterfaceVmPairs = new ArrayList<PairQueryable<VmNetworkInterface, VM>>(); for (VmNetworkInterface vmNetworkInterface : vmNetworkInterfaceList) { VM vm = vmsById.get(vmNetworkInterface.getVmId()); if (getParameters().getRunningVms() == null <START> || VM.isStatusDown(vm.getStatus()) != getParameters().getRunningVms()) { <END> vmInterfaceVmPairs.add(new PairQueryable<VmNetworkInterface, VM>(vmNetworkInterface, vm)); } } getQueryReturnValue().setReturnValue(vmInterfaceVmPairs); }</code><technical_language>please vm.isStatusUp() instead</technical_language>

Target:
protected void executeQueryCommand() { List<VM> vmList = getDbFacade().getVmDao() .getAllForNetwork(getParameters().getNetworkId()); List<VmNetworkInterface> vmNetworkInterfaceList = getDbFacade().getVmNetworkInterfaceDao() .getAllForNetwork(getParameters().getNetworkId()); final Map<Guid, VM> vmsById = Entities.businessEntitiesById(vmList); List<PairQueryable<VmNetworkInterface, VM>> vmInterfaceVmPairs = new ArrayList<PairQueryable<VmNetworkInterface, VM>>(); for (VmNetworkInterface vmNetworkInterface : vmNetworkInterfaceList) { VM vm = vmsById.get(vmNetworkInterface.getVmId()); if (getParameters().getRunningVms() == null || getParameters().getRunningVms().equals(vm.isStatusUp())) { vmInterfaceVmPairs.add(new PairQueryable<VmNetworkInterface, VM>(vmNetworkInterface, vm)); } } getQueryReturnValue().setReturnValue(vmInterfaceVmPairs); }
Source:
<code>protected void onMessage(Context context, Intent intent) { Log.d(LOG_TAG, "onMessage - context: " + context); Bundle extras = intent.getExtras(); if (extras != null) { <START> if (!FORCE_SHOW && PushPlugin.isInForeground()) { <END> extras.putBoolean(FOREGROUND, true); PushPlugin.sendExtras(extras); } else { extras.putBoolean(FOREGROUND, false); String message = this.getMessageText(extras); String title = getString(extras, TITLE, ""); if ((message != null && message.length() != 0) || (title != null && title.length() != 0)) { createNotification(context, extras); } } } }</code><technical_language>this option in a similar this? java SharedPreferences prefs = context.getSharedPreferences(PushPlugin.COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); boolean force_show = prefs.getBoolean(FORCE_SHOW, false); Accessing FORCE_SHOW is targeting String defined in PushConstants, a String is true'ish, making option decide on</technical_language>

Target:
protected void onMessage(Context context, Intent intent) { Log.d(LOG_TAG, "onMessage - context: " + context); Bundle extras = intent.getExtras(); if (extras != null) { SharedPreferences prefs = context.getSharedPreferences(PushPlugin.COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); boolean forceShow = prefs.getBoolean(FORCE_SHOW, false); if (!forceShow && PushPlugin.isInForeground()) { extras.putBoolean(FOREGROUND, true); PushPlugin.sendExtras(extras); } else if (forceShow && PushPlugin.isInForeground()) { extras.putBoolean(FOREGROUND, true); showNotificationIfPossible(context, extras); } else { extras.putBoolean(FOREGROUND, false); showNotificationIfPossible(context, extras); } } }
Source:
<code><START> public void setAcceptableValues(Collection<Object> values) { <END> Collection<String> stringValues = new ArrayList<String>(); for (Object value : values) { stringValues.add((String) value); } suggestOracle.clear(); suggestOracle.addAll(stringValues); suggestOracle.setDefaultSuggestionsFromText(stringValues); }</code><technical_language>Please use- Linq.<String> Cast(Iterable);</technical_language>

Target:
public void setAcceptableValues(Collection<Object> values) { Collection<String> stringValues = Linq.Cast(values); suggestOracle.clear(); suggestOracle.addAll(stringValues); suggestOracle.setDefaultSuggestionsFromText(stringValues); }
Source:
<code>public void process(Report report, Properties configuration) { try { URL url = new URL(configuration.getProperty("connection url")); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type", "text/html; charset=UTF-8"); connection.setDoOutput(true); connection.connect(); if (report.getRenderedOutput() != null && "true".equalsIgnoreCase(configuration.getProperty("Add report"))) { String addcontent = configuration.getProperty(("Add report") + configuration.getProperty("subject")); <START> if (report.getOutputContentType().contains("text") || report.getOutputContentType().contains("html")) { <END> addcontent = new String(report.getRenderedOutput(),"UTF-8"); } OutputStreamWriter writer = new OutputStreamWriter( connection.getOutputStream()); writer.write(addcontent); writer.flush(); writer.close(); } } catch (Exception e) { throw new RuntimeException("Error occurred while sending report via http POST", e); } }</code><technical_language>spaces in names. Please camel case</technical_language>

Target:
public void process(Report report, Properties configuration) { OutputStreamWriter writer = null; try { if (report.getRenderedOutput() != null && "true".equalsIgnoreCase(configuration.getProperty(ADD_REPORT))) { URL url = new URL(configuration.getProperty(CONNECTION_URL)); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); String outPutContentType = report.getOutputContentType(); connection.setRequestProperty("Content-Type", "outPutContentType; charset=UTF-8"); connection.setDoOutput(true); connection.connect(); String addContent = configuration.getProperty(SUBJECT,""); addContent = new String(report.getRenderedOutput(),"UTF-8"); writer = new OutputStreamWriter( connection.getOutputStream()); writer.write(addContent); writer.flush(); } } catch (Exception e) { throw new RuntimeException("Error occurred while sending report via http POST", e); } finally { IOUtils.closeQuietly(writer); } }
Source:
<code><START> public long nanosToCycles(long nanos) { <END> CTFTrace trace = fTrace; if (trace != null) { return trace.timestampNanoToCycles(nanos - trace.getClock().getClockOffsetNs()) + trace.getOffset(); } return 0; }</code><technical_language>This method is a simple converter is dependent frequency dependent clock offset. return nanos * clock.getAntiScale(), nanos if clock is null</technical_language>

Target:
public long nanosToCycles(long nanos) { CTFTrace trace = fTrace; if (trace != null) { return trace.timestampNanoToCycles(nanos) + trace.getOffset(); } return 0; }
Source:
<code>public void testStripsInvalidCharactersFromHostname() { origApp.start(ImmutableList.of(origApp.newLocalhostProvisioningLocation())); cluster.resize(1); assertDnsEntityEventuallyHasActiveMembers(1); EntityLocal e = (EntityLocal) Iterables.getOnlyElement(cluster.getMembers()); e.setAttribute(PrefixAndIdEnricher.SENSOR, " _-pretend.hostname.10.0.0.7.my-cloud.com"); EntityTestUtils.assertAttributeEqualsEventually(dns, BindDnsServer.A_RECORDS, <START> ImmutableMap.of("pretendhostname10007my-cloudcom", e.getAttribute(Attributes.ADDRESS))); <END> }</code><technical_language>This change if hostname filter is updated</technical_language>

Target:
public void testStripsInvalidCharactersFromHostname() { origApp.start(ImmutableList.of(origApp.newLocalhostProvisioningLocation())); cluster.resize(1); assertDnsEntityEventuallyHasActiveMembers(1); EntityLocal e = (EntityLocal) Iterables.getOnlyElement(cluster.getMembers()); e.setAttribute(PrefixAndIdEnricher.SENSOR, " _-pretend.hostname.10.0.0.7.my-cloud.com"); EntityTestUtils.assertAttributeEqualsEventually(dns, BindDnsServer.A_RECORDS, ImmutableMap.of("pretend-hostname-10-0-0-7-my-cloud-com", e.getAttribute(Attributes.ADDRESS))); }
Source:
<code>public Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, State state, List<IndexId> indices, long startTime, long repositoryStateId, ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards, String failure) { this.state = state; this.snapshot = snapshot; this.includeGlobalState = includeGlobalState; this.partial = partial; this.indices = indices; this.startTime = startTime; if (shards == null) { this.shards = ImmutableOpenMap.of(); this.waitingIndices = ImmutableOpenMap.of(); } else { this.shards = shards; this.waitingIndices = findWaitingIndices(shards); } this.repositoryStateId = repositoryStateId; this.failure = failure; <START> } <END></code><technical_language>This method is present in latest ES master, remove it</technical_language>

Target:
public Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, State state, List<IndexId> indices, long startTime, long repositoryStateId, ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards, String failure) { this.state = state; this.snapshot = snapshot; this.includeGlobalState = includeGlobalState; this.partial = partial; this.indices = indices; this.startTime = startTime; if (shards == null) { this.shards = ImmutableOpenMap.of(); this.waitingIndices = ImmutableOpenMap.of(); } else { this.shards = shards; this.waitingIndices = findWaitingIndices(shards); assert assertShardsConsistent(state, indices, shards); } this.repositoryStateId = repositoryStateId; this.failure = failure; }
Source:
<code>private <T> void mandatoryCheck(T t, String message) { try { requireNonNull(t, message); } catch (NullPointerException ex) { <START> error().data("field", t.getClass().getSimpleName()).logAndThrow(ex, "NullPointerException when calling TimeSeriesCellWriter"); <END> } }</code><technical_language>I need wrap NullPointerException in a runtime exception behaviour is maintained. .logAndThrow(new RuntimeException(ex), "NullPointerException calling TimeSeriesCellWriter")</technical_language>

Target:
private <T> void mandatoryCheck(T t, String message) { try { requireNonNull(t, message); } catch (NullPointerException ex) { error().data("field", t.getClass().getSimpleName()).logAndThrow(new RuntimeException(ex), "NullPointerException when calling TimeSeriesCellWriter"); } }
Source:
<code>private String authRegistryHeader(final AuthRegistryConfig authRegistryConfig) throws DockerException { if (authRegistryConfig == null) { return "null"; } try { String authRegistryJson = ObjectMapperProvider.objectMapper().writeValueAsString(authRegistryConfig); <START> String apiVersion = version().apiVersion(); <END> int versionComparison = versionCompare(apiVersion, "1.19"); if (versionComparison < 0) { authRegistryJson = "{\"configs\":" + authRegistryJson + "}"; } else if (versionComparison == 0) { authRegistryJson = "{\"auths\":" + authRegistryJson + "}"; } log.debug("Registry Config Json {}", authRegistryJson); String authRegistryEncoded = Base64.encodeAsString(authRegistryJson); log.debug("Registry Config Encoded {}", authRegistryEncoded); return authRegistryEncoded; } catch (JsonProcessingException | InterruptedException ex) { throw new DockerException("Could not encode X-Registry-Config header", ex); } }</code><technical_language>nit: prepend a final</technical_language>

Target:
private String authRegistryHeader(final AuthRegistryConfig authRegistryConfig) throws DockerException { if (authRegistryConfig == null) { return "null"; } try { String authRegistryJson = ObjectMapperProvider.objectMapper().writeValueAsString(authRegistryConfig); final String apiVersion = version().apiVersion(); final int versionComparison = compareVersion(apiVersion, "1.19"); if (versionComparison < 0) { authRegistryJson = "{\"configs\":" + authRegistryJson + "}"; } else if (versionComparison == 0) { authRegistryJson = "{\"auths\":" + authRegistryJson + "}"; } log.debug("Registry Config Json {}", authRegistryJson); String authRegistryEncoded = Base64.encodeAsString(authRegistryJson); log.debug("Registry Config Encoded {}", authRegistryEncoded); return authRegistryEncoded; } catch (JsonProcessingException | InterruptedException ex) { throw new DockerException("Could not encode X-Registry-Config header", ex); } }
Source:
<code>protected Optional<ManagementClient> getOrchestrator(){ BaseClient baseClient = runtime.getLayoutView().getRuntimeLayout().getBaseClient(nodeForWorkflow); if(baseClient.pingSync()){ log.info("getOrchestrator: orchestrator selected {}", nodeForWorkflow); return Optional.of(runtime.getLayoutView() .getRuntimeLayout().getManagementClient(nodeForWorkflow)); } else{ return Optional.empty(); } <START> } <END></code><technical_language>log client is responding pings</technical_language>

Target:
protected Optional<ManagementClient> getOrchestrator(){ runtime.invalidateLayout(); Layout layout = new Layout(runtime.getLayoutView().getLayout()); BaseClient baseClient = runtime.getLayoutView().getRuntimeLayout(layout).getBaseClient(nodeForWorkflow); if(baseClient.pingSync()){ log.info("getOrchestrator: orchestrator selected {}", nodeForWorkflow); return Optional.of(runtime.getLayoutView() .getRuntimeLayout(layout).getManagementClient(nodeForWorkflow)); } else{ log.warn("getOrchestrator: a server is not responding to pings", nodeForWorkflow); return Optional.empty(); } }
Source:
<code>public void onPlaceGainFocusEvent(final @Observes PlaceGainFocusEvent placeGainFocusEvent) { <START> if (!placeGainFocusEvent.getPlace().getIdentifier().equals(IDENTIFIER)) { <END> placeManager.closePlace(IDENTIFIER); } }</code><technical_language>placeGainFocusEvent.getPlace().getIdentifier() is null</technical_language>

Target:
public void onPlaceGainFocusEvent(final @Observes PlaceGainFocusEvent placeGainFocusEvent) { if (!Objects.equals(placeGainFocusEvent.getPlace().getIdentifier(), IDENTIFIER)) { placeManager.closePlace(IDENTIFIER); } }
Source:
<code>public Integer parse(CharSequence text) throws ParseException { MatchResult match = RegExp.compile("^(\\d+)\\s*(\\w*)$").exec(text.toString().trim()); MatchResult match_megabytes = <START> RegExp.compile("^(\\d+)\\s*(\\w*)$").exec(messages.megabytes("0")); END> if (match == null) { return 0; } String prefix = match.getGroup(1); String suffix = match.getGroup(2); String suffix_megabytes = match_megabytes != null ? match_megabytes.getGroup(2) : null; Integer size = null; try { size = Integer.parseInt(prefix); } catch (NumberFormatException e) { return 0; } if (suffix.equalsIgnoreCase("TB") || suffix.equalsIgnoreCase("T")) { return size * 1024 * 1024; } else if (suffix.equalsIgnoreCase("GB") || suffix.equalsIgnoreCase("G")) { return size * 1024; } else if (suffix.equalsIgnoreCase("MB") || suffix.equalsIgnoreCase("M") || (suffix_megabytes != null && suffix.equalsIgnoreCase(suffix_megabytes))) { return size; } else if (StringHelper.isNullOrEmpty(suffix)) { return size; } else { return 0; } }</code><technical_language>I moving this a new line is more readable</technical_language>

Target:
public Integer parse(CharSequence text) throws ParseException { MatchResult match = RegExp.compile("^(\\d+)\\s*(\\w*)$").exec(text.toString().trim()); MatchResult match_megabytes = RegExp.compile("^(\\d+)\\s*(\\w*)$").exec(messages.megabytes("0")); if (match == null) { return 0; } String prefix = match.getGroup(1); String suffix = match.getGroup(2); String suffix_megabytes = match_megabytes != null ? match_megabytes.getGroup(2) : null; Integer size = null; try { size = Integer.parseInt(prefix); } catch (NumberFormatException e) { return 0; } if (suffix.equalsIgnoreCase("TB") || suffix.equalsIgnoreCase("T")) { return size * 1024 * 1024; } else if (suffix.equalsIgnoreCase("GB") || suffix.equalsIgnoreCase("G")) { return size * 1024; } else if (suffix.equalsIgnoreCase("MB") || suffix.equalsIgnoreCase("M") || suffix.equalsIgnoreCase(suffix_megabytes)) { return size; } else if (StringHelper.isNullOrEmpty(suffix)) { return size; } else { return 0; } }
Source:
<code>private void installAndUninstallFeatures() { try { <START> if (!StringUtils.isBlank(postInstallFeatureStart)) { <END> featuresService.installFeature( postInstallFeatureStart, EnumSet.of(FeaturesService.Option.NoAutoRefreshBundles)); } if (!StringUtils.isBlank(postInstallFeatureStop)) { featuresService.uninstallFeature(postInstallFeatureStop); } } catch (Exception e) { LOGGER.debug("Error while trying to run the post-install start and stop operations.", e); } }</code><technical_language>isNotBlank() instead</technical_language>

Target:
private void installAndUninstallFeatures() { try { if (StringUtils.isNotBlank(postInstallFeatureStart)) { featuresService.installFeature( postInstallFeatureStart, EnumSet.of(FeaturesService.Option.NoAutoRefreshBundles)); } if (StringUtils.isNotBlank(postInstallFeatureStop)) { featuresService.uninstallFeature(postInstallFeatureStop); } } catch (Exception e) { LOGGER.debug("Error while trying to run the post-install start and stop operations.", e); } }
Source:
<code>public void testNonexistentProject() { TraceScriptingModule traceScriptingModule = new TraceScriptingModule(); boolean fileExist = true; try { traceScriptingModule.openMinimalTrace(NONEXISTENT_PROJECT, TRACE_FILE, false); <START> } catch (FileNotFoundException e) { <END> fileExist = false; } assertTrue(!fileExist); }</code><technical_language>EASE, exceptions pass error messages user explain failure, want check error message (maybe put in externalized messages? constants for now). a variable Exception e = null; set in catch, assertTrue(e instanceof FileNotFoundException); assertEquals("the message", e.getMessage())</technical_language>

Target:
public void testNonexistentProject() { TraceScriptingModule traceScriptingModule = new TraceScriptingModule(); boolean fileExist = true; try { traceScriptingModule.openMinimalTrace(NONEXISTENT_PROJECT, TRACE_FILE, false); } catch (FileNotFoundException e) { assertEquals(TraceScriptingModule.ERROR_INIT, e.getMessage()); fileExist = false; } assertTrue(!fileExist); }
Source:
<code><START> public ViewBinder(Context ctx, ILogger logger) { <END> setLogger(logger); setContext(ctx); mConverterService = new ValueConverterService(getLogger()); mResourceService = new ResourceService(getLogger()); SourceBindingFactory sourceFactory = new SourceBindingFactory(getLogger()); TargetBindingFactory targetFactory = new TargetBindingFactory(getLogger()); BindingSpecificationParser bindingParser = new BindingSpecificationParser(mConverterService, mResourceService, getLogger()); BindingSpecificationListParser listParser = new BindingSpecificationListParser(bindingParser, getLogger()); mBinder = new TextSpecificationBinder(listParser, sourceFactory, targetFactory, getLogger()); mViewResolver = new ChainedViewResolver(new ViewResolver(getLogger())); mInflaterFactory = new BindableLayoutInflaterFactory(this, mViewResolver); setFontManager(new FontManager(getLogger())); registerDefaultConverters(); }</code><technical_language>I remove this dependency Constructor add a setter done for IImageLoader. in constructor strong constraint. is ViewBinder a logger, feel right</technical_language>

Target:
public ViewBinder(Context ctx, ILogger logger) { setLogger(logger); setContext(ctx); init(); }
Source:
<code>public void setSize(int size) { if (size < 9 || size > 54 || size % 9 != 0) { throw new IllegalArgumentException("Invalid size! Size must be one of: [9, 18, 27, 36, 45, 54]"); } this.size = size; <START> cfg.setValue(PlayerBackpack.backpacks + id + ".size", size); <END> Inventory inv = Bukkit.createInventory(null, size, "Backpack [" + size + " Slots]"); for (int slot = 0; slot < this.inventory.getSize(); slot++) { inv.setItem(slot, this.inventory.getItem(slot)); } this.inventory = inv; markDirty(); }</code><technical_language>PlayerBackpack is redundant here, need class in</technical_language>

Target:
public void setSize(int size) { if (size < 9 || size > 54 || size % 9 != 0) { throw new IllegalArgumentException("Invalid size! Size must be one of: [9, 18, 27, 36, 45, 54]"); } this.size = size; cfg.setValue(CONFIG_PREFIX + id + ".size", size); Inventory inv = Bukkit.createInventory(null, size, "Backpack [" + size + " Slots]"); for (int slot = 0; slot < this.inventory.getSize(); slot++) { inv.setItem(slot, this.inventory.getItem(slot)); } this.inventory = inv; markDirty(); }
Source:
<code>public void getPersonPhoto(@PathVariable("id") Long id, HttpServletResponse response) throws IOException, SQLException { Person person = personService.getPersonById(id); if(person.getPhoto() == null) { <START> throw new RestException("No photo found for user", 404); <END> } response.addHeader("Content-Type", "image/jpeg"); ServletOutputStream outStream = response.getOutputStream(); IOUtils.copy(person.getPhoto().getBinaryStream(), outStream); outStream.flush(); outStream.close(); }</code><technical_language>HttpServletResponse.SC_NOT_FOUND</technical_language>

Target:
public void getPersonPhoto(@PathVariable("id") Long id, HttpServletResponse response) throws IOException, SQLException { Avatar avatar = personService.getPersonPhoto(id); response.addHeader("Content-Type", "image/jpeg"); ServletOutputStream outStream = response.getOutputStream(); IOUtils.copy(avatar.getAvatar().getBinaryStream(), outStream); outStream.flush(); outStream.close(); }
Source:
<code>public Tuple exec(Tuple input) throws IOException { Tuple t = mTupleFactory.newTuple(3); try { DataBag bg = (DataBag) input.get(0); Double d = null; if(bg.iterator().hasNext()) { Tuple tp = bg.iterator().next(); d = (Double)tp.get(0); } t.set(0, d); <START> t.set(1, d*d); <END> if (d == null) t.set(2, 0L); else t.set(2, 1L); return t; } catch(NumberFormatException nfe) { try { t.set(0, null); t.set(1, null); t.set(2, 0L); } catch (ExecException e) { throw e; } return t; } catch (ExecException ee) { throw ee; } catch (Exception e) { int errCode = 2106; String msg = "Error while computing variance in " + this.getClass().getSimpleName(); throw new ExecException(msg, errCode, PigException.BUG, e); } }</code><technical_language>if d is null</technical_language>

Target:
public Tuple exec(Tuple input) throws IOException { Tuple t = mTupleFactory.newTuple(3); try { DataBag bg = (DataBag) input.get(0); Double d = null; if(bg.iterator().hasNext()) { Tuple tp = bg.iterator().next(); d = (Double)tp.get(0); } if (d == null){ t.set(0, null); t.set(1, null); t.set(2, 0L); } else { t.set(0, d); t.set(1, d*d); t.set(2, 1L); } return t; } catch(NumberFormatException nfe) { try { t.set(0, null); t.set(1, null); t.set(2, 0L); } catch (ExecException e) { throw e; } return t; } catch (ExecException ee) { throw ee; } catch (Exception e) { int errCode = 2106; String msg = "Error while computing variance in " + this.getClass().getSimpleName(); throw new ExecException(msg, errCode, PigException.BUG, e); } }